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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/esm2020/src/application_config.mjs +21 -0
  2. package/esm2020/src/application_init.mjs +23 -31
  3. package/esm2020/src/application_module.mjs +3 -2
  4. package/esm2020/src/application_ref.mjs +35 -33
  5. package/esm2020/src/application_tokens.mjs +2 -13
  6. package/esm2020/src/change_detection/change_detection.mjs +2 -2
  7. package/esm2020/src/change_detection/change_detector_ref.mjs +3 -2
  8. package/esm2020/src/change_detection/constants.mjs +1 -49
  9. package/esm2020/src/change_detection/differs/iterable_differs.mjs +3 -2
  10. package/esm2020/src/change_detection/differs/keyvalue_differs.mjs +3 -2
  11. package/esm2020/src/console.mjs +3 -2
  12. package/esm2020/src/core.mjs +4 -3
  13. package/esm2020/src/core_private_export.mjs +6 -7
  14. package/esm2020/src/core_render3_private_export.mjs +3 -1
  15. package/esm2020/src/debug/debug_node.mjs +1 -5
  16. package/esm2020/src/di/injector.mjs +3 -2
  17. package/esm2020/src/di/r3_injector.mjs +5 -1
  18. package/esm2020/src/di/reflective_injector.mjs +3 -2
  19. package/esm2020/src/hydration/annotate.mjs +140 -0
  20. package/esm2020/src/hydration/api.mjs +120 -0
  21. package/esm2020/src/hydration/error_handling.mjs +29 -0
  22. package/esm2020/src/hydration/interfaces.mjs +10 -0
  23. package/esm2020/src/hydration/node_lookup_utils.mjs +75 -0
  24. package/esm2020/src/hydration/skip_hydration.mjs +34 -0
  25. package/esm2020/src/hydration/tokens.mjs +25 -0
  26. package/esm2020/src/hydration/utils.mjs +131 -0
  27. package/esm2020/src/linker/compiler.mjs +3 -2
  28. package/esm2020/src/linker/component_factory_resolver.mjs +3 -2
  29. package/esm2020/src/linker/destroy_ref.mjs +41 -0
  30. package/esm2020/src/linker/element_ref.mjs +3 -2
  31. package/esm2020/src/linker/query_list.mjs +6 -7
  32. package/esm2020/src/linker/template_ref.mjs +6 -5
  33. package/esm2020/src/linker/view_container_ref.mjs +3 -2
  34. package/esm2020/src/linker.mjs +2 -1
  35. package/esm2020/src/render/api.mjs +3 -2
  36. package/esm2020/src/render3/component_ref.mjs +16 -9
  37. package/esm2020/src/render3/features/standalone_feature.mjs +1 -1
  38. package/esm2020/src/render3/fields.mjs +10 -1
  39. package/esm2020/src/render3/hooks.mjs +3 -2
  40. package/esm2020/src/render3/i18n/i18n_util.mjs +3 -3
  41. package/esm2020/src/render3/instructions/element.mjs +56 -13
  42. package/esm2020/src/render3/instructions/element_container.mjs +54 -9
  43. package/esm2020/src/render3/instructions/listener.mjs +3 -3
  44. package/esm2020/src/render3/instructions/shared.mjs +40 -24
  45. package/esm2020/src/render3/instructions/template.mjs +2 -2
  46. package/esm2020/src/render3/instructions/text.mjs +36 -5
  47. package/esm2020/src/render3/interfaces/definition.mjs +1 -1
  48. package/esm2020/src/render3/interfaces/node.mjs +1 -1
  49. package/esm2020/src/render3/interfaces/renderer_dom.mjs +1 -1
  50. package/esm2020/src/render3/interfaces/view.mjs +4 -2
  51. package/esm2020/src/render3/jit/directive.mjs +1 -2
  52. package/esm2020/src/render3/node_manipulation.mjs +25 -14
  53. package/esm2020/src/render3/state.mjs +45 -1
  54. package/esm2020/src/render3/util/view_utils.mjs +11 -2
  55. package/esm2020/src/render3/view_ref.mjs +4 -3
  56. package/esm2020/src/sanitization/sanitizer.mjs +3 -2
  57. package/esm2020/src/testability/testability.mjs +5 -3
  58. package/esm2020/src/transfer_state.mjs +153 -0
  59. package/esm2020/src/util/iterable.mjs +6 -7
  60. package/esm2020/src/util/lang.mjs +1 -11
  61. package/esm2020/src/util/ng_dev_mode.mjs +3 -1
  62. package/esm2020/src/version.mjs +1 -1
  63. package/esm2020/testing/src/logger.mjs +6 -5
  64. package/esm2020/testing/src/ng_zone_mock.mjs +6 -5
  65. package/esm2020/testing/src/test_bed.mjs +3 -2
  66. package/fesm2015/core.mjs +1076 -297
  67. package/fesm2015/core.mjs.map +1 -1
  68. package/fesm2015/testing.mjs +747 -159
  69. package/fesm2015/testing.mjs.map +1 -1
  70. package/fesm2020/core.mjs +1066 -295
  71. package/fesm2020/core.mjs.map +1 -1
  72. package/fesm2020/testing.mjs +741 -159
  73. package/fesm2020/testing.mjs.map +1 -1
  74. package/index.d.ts +290 -87
  75. package/package.json +3 -3
  76. package/schematics/migrations/router-link-with-href/bundle.js.map +2 -2
  77. package/schematics/ng-generate/standalone-migration/bundle.js +1044 -1024
  78. package/schematics/ng-generate/standalone-migration/bundle.js.map +4 -4
  79. package/testing/index.d.ts +1 -1
  80. package/esm2020/src/util/symbol.mjs +0 -30
package/fesm2015/core.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v16.0.0-next.0
2
+ * @license Angular v16.0.0-next.2
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -555,6 +555,8 @@ function ngDevModeResetPerfCounters() {
555
555
  rendererAppendChild: 0,
556
556
  rendererInsertBefore: 0,
557
557
  rendererCreateComment: 0,
558
+ hydratedNodes: 0,
559
+ hydratedComponents: 0,
558
560
  };
559
561
  // Make sure to refer to ngDevMode as ['ngDevMode'] for closure.
560
562
  const allowNgDevModeTrue = locationString.indexOf('ngDevMode=false') === -1;
@@ -855,54 +857,6 @@ var ChangeDetectionStrategy;
855
857
  */
856
858
  ChangeDetectionStrategy[ChangeDetectionStrategy["Default"] = 1] = "Default";
857
859
  })(ChangeDetectionStrategy || (ChangeDetectionStrategy = {}));
858
- /**
859
- * Defines the possible states of the default change detector.
860
- * @see `ChangeDetectorRef`
861
- */
862
- var ChangeDetectorStatus;
863
- (function (ChangeDetectorStatus) {
864
- /**
865
- * A state in which, after calling `detectChanges()`, the change detector
866
- * state becomes `Checked`, and must be explicitly invoked or reactivated.
867
- */
868
- ChangeDetectorStatus[ChangeDetectorStatus["CheckOnce"] = 0] = "CheckOnce";
869
- /**
870
- * A state in which change detection is skipped until the change detector mode
871
- * becomes `CheckOnce`.
872
- */
873
- ChangeDetectorStatus[ChangeDetectorStatus["Checked"] = 1] = "Checked";
874
- /**
875
- * A state in which change detection continues automatically until explicitly
876
- * deactivated.
877
- */
878
- ChangeDetectorStatus[ChangeDetectorStatus["CheckAlways"] = 2] = "CheckAlways";
879
- /**
880
- * A state in which a change detector sub tree is not a part of the main tree and
881
- * should be skipped.
882
- */
883
- ChangeDetectorStatus[ChangeDetectorStatus["Detached"] = 3] = "Detached";
884
- /**
885
- * Indicates that the change detector encountered an error checking a binding
886
- * or calling a directive lifecycle method and is now in an inconsistent state. Change
887
- * detectors in this state do not detect changes.
888
- */
889
- ChangeDetectorStatus[ChangeDetectorStatus["Errored"] = 4] = "Errored";
890
- /**
891
- * Indicates that the change detector has been destroyed.
892
- */
893
- ChangeDetectorStatus[ChangeDetectorStatus["Destroyed"] = 5] = "Destroyed";
894
- })(ChangeDetectorStatus || (ChangeDetectorStatus = {}));
895
- /**
896
- * Reports whether a given strategy is currently the default for change detection.
897
- * @param changeDetectionStrategy The strategy to check.
898
- * @returns True if the given strategy is the current default, false otherwise.
899
- * @see `ChangeDetectorStatus`
900
- * @see `ChangeDetectorRef`
901
- */
902
- function isDefaultChangeDetectionStrategy(changeDetectionStrategy) {
903
- return changeDetectionStrategy == null ||
904
- changeDetectionStrategy === ChangeDetectionStrategy.Default;
905
- }
906
860
 
907
861
  /**
908
862
  * Defines the CSS styles encapsulation policies for the {@link Component} decorator's
@@ -974,6 +928,15 @@ const NG_FACTORY_DEF = getClosureSafeProperty({ ɵfac: getClosureSafeProperty })
974
928
  */
975
929
  // TODO(misko): This is wrong. The NG_ELEMENT_ID should never be minified.
976
930
  const NG_ELEMENT_ID = getClosureSafeProperty({ __NG_ELEMENT_ID__: getClosureSafeProperty });
931
+ /**
932
+ * The `NG_ENV_ID` field on a DI token indicates special processing in the `EnvironmentInjector`:
933
+ * getting such tokens from the `EnvironmentInjector` will bypass the standard DI resolution
934
+ * strategy and instead will return implementation produced by the `NG_ENV_ID` factory function.
935
+ *
936
+ * This particular retrieval of DI tokens is mostly done to eliminate circular dependencies and
937
+ * improve tree-shaking.
938
+ */
939
+ const NG_ENV_ID = getClosureSafeProperty({ __NG_ENV_ID__: getClosureSafeProperty });
977
940
 
978
941
  /** Counter used to generate unique IDs for component definitions. */
979
942
  let componentDefCount = 0;
@@ -1328,6 +1291,8 @@ const PREORDER_HOOK_FLAGS = 18;
1328
1291
  const QUERIES = 19;
1329
1292
  const ID = 20;
1330
1293
  const EMBEDDED_VIEW_INJECTOR = 21;
1294
+ const ON_DESTROY_HOOKS = 22;
1295
+ const HYDRATION = 23;
1331
1296
  /**
1332
1297
  * Size of LView's header. Necessary to adjust for it when setting slots.
1333
1298
  *
@@ -1335,7 +1300,7 @@ const EMBEDDED_VIEW_INJECTOR = 21;
1335
1300
  * instruction index into `LView` index. All other indexes should be in the `LView` index space and
1336
1301
  * there should be no need to refer to `HEADER_OFFSET` anywhere else.
1337
1302
  */
1338
- const HEADER_OFFSET = 22;
1303
+ const HEADER_OFFSET = 24;
1339
1304
  // Note: This hack is necessary so we don't erroneously get a circular dependency
1340
1305
  // failure based on types.
1341
1306
  const unusedValueExportToPlacateAjd$3 = 1;
@@ -1773,10 +1738,20 @@ function updateTransplantedViewCount(lContainer, amount) {
1773
1738
  parent = parent[PARENT];
1774
1739
  }
1775
1740
  }
1741
+ /**
1742
+ * Stores a LView-specific destroy callback.
1743
+ */
1744
+ function storeLViewOnDestroy(lView, onDestroyCallback) {
1745
+ if (lView[ON_DESTROY_HOOKS] === null) {
1746
+ lView[ON_DESTROY_HOOKS] = [];
1747
+ }
1748
+ lView[ON_DESTROY_HOOKS].push(onDestroyCallback);
1749
+ }
1776
1750
 
1777
1751
  const instructionState = {
1778
1752
  lFrame: createLFrame(null),
1779
1753
  bindingsEnabled: true,
1754
+ skipHydrationRootTNode: null,
1780
1755
  };
1781
1756
  /**
1782
1757
  * In this mode, any changes in bindings will throw an ExpressionChangedAfterChecked error.
@@ -1807,6 +1782,21 @@ function decreaseElementDepthCount() {
1807
1782
  function getBindingsEnabled() {
1808
1783
  return instructionState.bindingsEnabled;
1809
1784
  }
1785
+ /**
1786
+ * Returns true if currently inside a skip hydration block.
1787
+ * @returns boolean
1788
+ */
1789
+ function isInSkipHydrationBlock() {
1790
+ return instructionState.skipHydrationRootTNode !== null;
1791
+ }
1792
+ /**
1793
+ * Returns true if this is the root TNode of the skip hydration block.
1794
+ * @param tNode the current TNode
1795
+ * @returns boolean
1796
+ */
1797
+ function isSkipHydrationRootTNode(tNode) {
1798
+ return instructionState.skipHydrationRootTNode === tNode;
1799
+ }
1810
1800
  /**
1811
1801
  * Enables directive matching on elements.
1812
1802
  *
@@ -1829,6 +1819,13 @@ function getBindingsEnabled() {
1829
1819
  function ɵɵenableBindings() {
1830
1820
  instructionState.bindingsEnabled = true;
1831
1821
  }
1822
+ /**
1823
+ * Sets a flag to specify that the TNode is in a skip hydration block.
1824
+ * @param tNode the current TNode
1825
+ */
1826
+ function enterSkipHydrationBlock(tNode) {
1827
+ instructionState.skipHydrationRootTNode = tNode;
1828
+ }
1832
1829
  /**
1833
1830
  * Disables directive matching on element.
1834
1831
  *
@@ -1851,6 +1848,12 @@ function ɵɵenableBindings() {
1851
1848
  function ɵɵdisableBindings() {
1852
1849
  instructionState.bindingsEnabled = false;
1853
1850
  }
1851
+ /**
1852
+ * Clears the root skip hydration node when leaving a skip hydration block.
1853
+ */
1854
+ function leaveSkipHydrationBlock() {
1855
+ instructionState.skipHydrationRootTNode = null;
1856
+ }
1854
1857
  /**
1855
1858
  * Return the current `LView`.
1856
1859
  */
@@ -2275,6 +2278,21 @@ function namespaceHTMLInternal() {
2275
2278
  function getNamespace$1() {
2276
2279
  return instructionState.lFrame.currentNamespace;
2277
2280
  }
2281
+ let _wasLastNodeCreated = true;
2282
+ /**
2283
+ * Retrieves a global flag that indicates whether the most recent DOM node
2284
+ * was created or hydrated.
2285
+ */
2286
+ function wasLastNodeCreated() {
2287
+ return _wasLastNodeCreated;
2288
+ }
2289
+ /**
2290
+ * Sets a global flag to indicate whether the most recent DOM node
2291
+ * was created or hydrated.
2292
+ */
2293
+ function lastNodeWasCreated(flag) {
2294
+ _wasLastNodeCreated = flag;
2295
+ }
2278
2296
 
2279
2297
  /**
2280
2298
  * Adds all directive lifecycle hooks from the given `DirectiveDef` to the given `TView`.
@@ -2450,8 +2468,9 @@ function callHooks(currentView, arr, initPhase, currentNodeIndex) {
2450
2468
  }
2451
2469
  else {
2452
2470
  const isInitHook = arr[i] < 0;
2453
- if (isInitHook)
2471
+ if (isInitHook) {
2454
2472
  currentView[PREORDER_HOOK_FLAGS] += 65536 /* PreOrderHookFlags.NumberOfInitHooksCalledIncrementer */;
2473
+ }
2455
2474
  if (lastNodeIndexFound < nodeIndexLimit || nodeIndexLimit == -1) {
2456
2475
  callHook(currentView, initPhase, arr, i);
2457
2476
  currentView[PREORDER_HOOK_FLAGS] =
@@ -5952,10 +5971,6 @@ function cleanUpView(tView, lView) {
5952
5971
  function processCleanups(tView, lView) {
5953
5972
  const tCleanup = tView.cleanup;
5954
5973
  const lCleanup = lView[CLEANUP];
5955
- // `LCleanup` contains both share information with `TCleanup` as well as instance specific
5956
- // information appended at the end. We need to know where the end of the `TCleanup` information
5957
- // is, and we track this with `lastLCleanupIndex`.
5958
- let lastLCleanupIndex = -1;
5959
5974
  if (tCleanup !== null) {
5960
5975
  for (let i = 0; i < tCleanup.length - 1; i += 2) {
5961
5976
  if (typeof tCleanup[i] === 'string') {
@@ -5965,29 +5980,33 @@ function processCleanups(tView, lView) {
5965
5980
  ngDevMode && assertNumber(targetIdx, 'cleanup target must be a number');
5966
5981
  if (targetIdx >= 0) {
5967
5982
  // unregister
5968
- lCleanup[lastLCleanupIndex = targetIdx]();
5983
+ lCleanup[targetIdx]();
5969
5984
  }
5970
5985
  else {
5971
5986
  // Subscription
5972
- lCleanup[lastLCleanupIndex = -targetIdx].unsubscribe();
5987
+ lCleanup[-targetIdx].unsubscribe();
5973
5988
  }
5974
5989
  i += 2;
5975
5990
  }
5976
5991
  else {
5977
5992
  // This is a cleanup function that is grouped with the index of its context
5978
- const context = lCleanup[lastLCleanupIndex = tCleanup[i + 1]];
5993
+ const context = lCleanup[tCleanup[i + 1]];
5979
5994
  tCleanup[i].call(context);
5980
5995
  }
5981
5996
  }
5982
5997
  }
5983
5998
  if (lCleanup !== null) {
5984
- for (let i = lastLCleanupIndex + 1; i < lCleanup.length; i++) {
5985
- const instanceCleanupFn = lCleanup[i];
5986
- ngDevMode && assertFunction(instanceCleanupFn, 'Expecting instance cleanup function.');
5987
- instanceCleanupFn();
5988
- }
5989
5999
  lView[CLEANUP] = null;
5990
6000
  }
6001
+ const destroyHooks = lView[ON_DESTROY_HOOKS];
6002
+ if (destroyHooks !== null) {
6003
+ for (let i = 0; i < destroyHooks.length; i++) {
6004
+ const destroyHooksFn = destroyHooks[i];
6005
+ ngDevMode && assertFunction(destroyHooksFn, 'Expecting destroy hook to be a function.');
6006
+ destroyHooksFn();
6007
+ }
6008
+ lView[ON_DESTROY_HOOKS] = null;
6009
+ }
5991
6010
  }
5992
6011
  /** Calls onDestroy hooks for this view */
5993
6012
  function executeOnDestroys(tView, lView) {
@@ -6298,6 +6317,17 @@ function nativeRemoveNode(renderer, rNode, isHostElement) {
6298
6317
  nativeRemoveChild(renderer, nativeParent, rNode, isHostElement);
6299
6318
  }
6300
6319
  }
6320
+ /**
6321
+ * Removes the contents of a given RElement using a given renderer.
6322
+ *
6323
+ * @param renderer A renderer to be used
6324
+ * @param rElement the native RElement to be cleared
6325
+ */
6326
+ function clearElementContents(renderer, rElement) {
6327
+ while (rElement.firstChild) {
6328
+ nativeRemoveChild(renderer, rElement, rElement.firstChild, false);
6329
+ }
6330
+ }
6301
6331
  /**
6302
6332
  * Performs the operation of `action` on the node. Typically this involves inserting or removing
6303
6333
  * nodes on the LView or projection boundary.
@@ -7921,6 +7951,9 @@ class R3Injector extends EnvironmentInjector {
7921
7951
  }
7922
7952
  get(token, notFoundValue = THROW_IF_NOT_FOUND, flags = InjectFlags.Default) {
7923
7953
  this.assertNotDestroyed();
7954
+ if (token.hasOwnProperty(NG_ENV_ID)) {
7955
+ return token[NG_ENV_ID](this);
7956
+ }
7924
7957
  flags = convertToBitFlags(flags);
7925
7958
  // Set the injection context.
7926
7959
  const previousInjector = setCurrentInjector(this);
@@ -8198,6 +8231,331 @@ function forEachSingleProvider(providers, fn) {
8198
8231
  }
8199
8232
  }
8200
8233
 
8234
+ /**
8235
+ * A [DI token](guide/glossary#di-token "DI token definition") representing a unique string ID, used
8236
+ * primarily for prefixing application attributes and CSS styles when
8237
+ * {@link ViewEncapsulation#Emulated ViewEncapsulation.Emulated} is being used.
8238
+ *
8239
+ * BY default, the value is randomly generated and assigned to the application by Angular.
8240
+ * To provide a custom ID value, use a DI provider <!-- TODO: provider --> to configure
8241
+ * the root {@link Injector} that uses this token.
8242
+ *
8243
+ * @publicApi
8244
+ */
8245
+ const APP_ID = new InjectionToken('AppId', {
8246
+ providedIn: 'root',
8247
+ factory: _appIdRandomProviderFactory,
8248
+ });
8249
+ function _appIdRandomProviderFactory() {
8250
+ return `${_randomChar()}${_randomChar()}${_randomChar()}`;
8251
+ }
8252
+ /**
8253
+ * Providers that generate a random `APP_ID_TOKEN`.
8254
+ * @publicApi
8255
+ */
8256
+ const APP_ID_RANDOM_PROVIDER = {
8257
+ provide: APP_ID,
8258
+ useFactory: _appIdRandomProviderFactory,
8259
+ deps: [],
8260
+ };
8261
+ function _randomChar() {
8262
+ return String.fromCharCode(97 + Math.floor(Math.random() * 25));
8263
+ }
8264
+ /**
8265
+ * A function that is executed when a platform is initialized.
8266
+ * @publicApi
8267
+ */
8268
+ const PLATFORM_INITIALIZER = new InjectionToken('Platform Initializer');
8269
+ /**
8270
+ * A token that indicates an opaque platform ID.
8271
+ * @publicApi
8272
+ */
8273
+ const PLATFORM_ID = new InjectionToken('Platform ID', {
8274
+ providedIn: 'platform',
8275
+ factory: () => 'unknown', // set a default platform name, when none set explicitly
8276
+ });
8277
+ /**
8278
+ * A [DI token](guide/glossary#di-token "DI token definition") that indicates the root directory of
8279
+ * the application
8280
+ * @publicApi
8281
+ */
8282
+ const PACKAGE_ROOT_URL = new InjectionToken('Application Packages Root URL');
8283
+ // We keep this token here, rather than the animations package, so that modules that only care
8284
+ // about which animations module is loaded (e.g. the CDK) can retrieve it without having to
8285
+ // include extra dependencies. See #44970 for more context.
8286
+ /**
8287
+ * A [DI token](guide/glossary#di-token "DI token definition") that indicates which animations
8288
+ * module has been loaded.
8289
+ * @publicApi
8290
+ */
8291
+ const ANIMATION_MODULE_TYPE = new InjectionToken('AnimationModuleType');
8292
+
8293
+ function escapeTransferStateContent(text) {
8294
+ const escapedText = {
8295
+ '&': '&a;',
8296
+ '"': '&q;',
8297
+ '\'': '&s;',
8298
+ '<': '&l;',
8299
+ '>': '&g;',
8300
+ };
8301
+ return text.replace(/[&"'<>]/g, s => escapedText[s]);
8302
+ }
8303
+ function unescapeTransferStateContent(text) {
8304
+ const unescapedText = {
8305
+ '&a;': '&',
8306
+ '&q;': '"',
8307
+ '&s;': '\'',
8308
+ '&l;': '<',
8309
+ '&g;': '>',
8310
+ };
8311
+ return text.replace(/&[^;]+;/g, s => unescapedText[s]);
8312
+ }
8313
+ /**
8314
+ * Create a `StateKey<T>` that can be used to store value of type T with `TransferState`.
8315
+ *
8316
+ * Example:
8317
+ *
8318
+ * ```
8319
+ * const COUNTER_KEY = makeStateKey<number>('counter');
8320
+ * let value = 10;
8321
+ *
8322
+ * transferState.set(COUNTER_KEY, value);
8323
+ * ```
8324
+ *
8325
+ * @publicApi
8326
+ */
8327
+ function makeStateKey(key) {
8328
+ return key;
8329
+ }
8330
+ function initTransferState() {
8331
+ const transferState = new TransferState();
8332
+ transferState.store = retrieveTransferredState(getDocument(), inject(APP_ID));
8333
+ return transferState;
8334
+ }
8335
+ /**
8336
+ * A key value store that is transferred from the application on the server side to the application
8337
+ * on the client side.
8338
+ *
8339
+ * The `TransferState` is available as an injectable token.
8340
+ * On the client, just inject this token using DI and use it, it will be lazily initialized.
8341
+ * On the server it's already included if `renderApplication` function is used. Otherwise, import
8342
+ * the `ServerTransferStateModule` module to make the `TransferState` available.
8343
+ *
8344
+ * The values in the store are serialized/deserialized using JSON.stringify/JSON.parse. So only
8345
+ * boolean, number, string, null and non-class objects will be serialized and deserialized in a
8346
+ * non-lossy manner.
8347
+ *
8348
+ * @publicApi
8349
+ */
8350
+ class TransferState {
8351
+ constructor() {
8352
+ /** @internal */
8353
+ this.store = {};
8354
+ this.onSerializeCallbacks = {};
8355
+ }
8356
+ /**
8357
+ * Get the value corresponding to a key. Return `defaultValue` if key is not found.
8358
+ */
8359
+ get(key, defaultValue) {
8360
+ return this.store[key] !== undefined ? this.store[key] : defaultValue;
8361
+ }
8362
+ /**
8363
+ * Set the value corresponding to a key.
8364
+ */
8365
+ set(key, value) {
8366
+ this.store[key] = value;
8367
+ }
8368
+ /**
8369
+ * Remove a key from the store.
8370
+ */
8371
+ remove(key) {
8372
+ delete this.store[key];
8373
+ }
8374
+ /**
8375
+ * Test whether a key exists in the store.
8376
+ */
8377
+ hasKey(key) {
8378
+ return this.store.hasOwnProperty(key);
8379
+ }
8380
+ /**
8381
+ * Indicates whether the state is empty.
8382
+ */
8383
+ get isEmpty() {
8384
+ return Object.keys(this.store).length === 0;
8385
+ }
8386
+ /**
8387
+ * Register a callback to provide the value for a key when `toJson` is called.
8388
+ */
8389
+ onSerialize(key, callback) {
8390
+ this.onSerializeCallbacks[key] = callback;
8391
+ }
8392
+ /**
8393
+ * Serialize the current state of the store to JSON.
8394
+ */
8395
+ toJson() {
8396
+ // Call the onSerialize callbacks and put those values into the store.
8397
+ for (const key in this.onSerializeCallbacks) {
8398
+ if (this.onSerializeCallbacks.hasOwnProperty(key)) {
8399
+ try {
8400
+ this.store[key] = this.onSerializeCallbacks[key]();
8401
+ }
8402
+ catch (e) {
8403
+ console.warn('Exception in onSerialize callback: ', e);
8404
+ }
8405
+ }
8406
+ }
8407
+ return JSON.stringify(this.store);
8408
+ }
8409
+ }
8410
+ /** @nocollapse */
8411
+ TransferState.ɵprov =
8412
+ /** @pureOrBreakMyCode */ ɵɵdefineInjectable({
8413
+ token: TransferState,
8414
+ providedIn: 'root',
8415
+ factory: initTransferState,
8416
+ });
8417
+ function retrieveTransferredState(doc, appId) {
8418
+ // Locate the script tag with the JSON data transferred from the server.
8419
+ // The id of the script tag is set to the Angular appId + 'state'.
8420
+ const script = doc.getElementById(appId + '-state');
8421
+ let initialState = {};
8422
+ if (script && script.textContent) {
8423
+ try {
8424
+ // Avoid using any here as it triggers lint errors in google3 (any is not allowed).
8425
+ initialState = JSON.parse(unescapeTransferStateContent(script.textContent));
8426
+ }
8427
+ catch (e) {
8428
+ console.warn('Exception while restoring TransferState for app ' + appId, e);
8429
+ }
8430
+ }
8431
+ return initialState;
8432
+ }
8433
+
8434
+ /* Represents a key in NghDom that holds information about <ng-container>s. */
8435
+ const ELEMENT_CONTAINERS = 'e';
8436
+
8437
+ /**
8438
+ * The name of the key used in the TransferState collection,
8439
+ * where hydration information is located.
8440
+ */
8441
+ const TRANSFER_STATE_TOKEN_ID = '__ɵnghData__';
8442
+ /**
8443
+ * Lookup key used to reference DOM hydration data (ngh) in `TransferState`.
8444
+ */
8445
+ const NGH_DATA_KEY = makeStateKey(TRANSFER_STATE_TOKEN_ID);
8446
+ /**
8447
+ * The name of the attribute that would be added to host component
8448
+ * nodes and contain a reference to a particular slot in transferred
8449
+ * state that contains the necessary hydration info for this component.
8450
+ */
8451
+ const NGH_ATTR_NAME = 'ngh';
8452
+ /**
8453
+ * Reference to a function that reads `ngh` attribute value from a given RNode
8454
+ * and retrieves hydration information from the TransferState using that value
8455
+ * as an index. Returns `null` by default, when hydration is not enabled.
8456
+ *
8457
+ * @param rNode Component's host element.
8458
+ * @param injector Injector that this component has access to.
8459
+ */
8460
+ let _retrieveHydrationInfoImpl = (rNode, injector) => null;
8461
+ function retrieveHydrationInfoImpl(rNode, injector) {
8462
+ var _a;
8463
+ const nghAttrValue = rNode.getAttribute(NGH_ATTR_NAME);
8464
+ if (nghAttrValue == null)
8465
+ return null;
8466
+ let data = {};
8467
+ // An element might have an empty `ngh` attribute value (e.g. `<comp ngh="" />`),
8468
+ // which means that no special annotations are required. Do not attempt to read
8469
+ // from the TransferState in this case.
8470
+ if (nghAttrValue !== '') {
8471
+ const transferState = injector.get(TransferState, null, { optional: true });
8472
+ if (transferState !== null) {
8473
+ const nghData = transferState.get(NGH_DATA_KEY, []);
8474
+ // The nghAttrValue is always a number referencing an index
8475
+ // in the hydration TransferState data.
8476
+ data = nghData[Number(nghAttrValue)];
8477
+ // If the `ngh` attribute exists and has a non-empty value,
8478
+ // the hydration info *must* be present in the TransferState.
8479
+ // If there is no data for some reasons, this is an error.
8480
+ ngDevMode && assertDefined(data, 'Unable to retrieve hydration info from the TransferState.');
8481
+ }
8482
+ }
8483
+ const dehydratedView = {
8484
+ data,
8485
+ firstChild: (_a = rNode.firstChild) !== null && _a !== void 0 ? _a : null,
8486
+ };
8487
+ // The `ngh` attribute is cleared from the DOM node now
8488
+ // that the data has been retrieved.
8489
+ rNode.removeAttribute(NGH_ATTR_NAME);
8490
+ // Note: don't check whether this node was claimed for hydration,
8491
+ // because this node might've been previously claimed while processing
8492
+ // template instructions.
8493
+ ngDevMode && markRNodeAsClaimedByHydration(rNode, /* checkIfAlreadyClaimed */ false);
8494
+ ngDevMode && ngDevMode.hydratedComponents++;
8495
+ return dehydratedView;
8496
+ }
8497
+ /**
8498
+ * Sets the implementation for the `retrieveNghInfo` function.
8499
+ */
8500
+ function enableRetrieveHydrationInfoImpl() {
8501
+ _retrieveHydrationInfoImpl = retrieveHydrationInfoImpl;
8502
+ }
8503
+ /**
8504
+ * Retrieves hydration info by reading the value from the `ngh` attribute
8505
+ * and accessing a corresponding slot in TransferState storage.
8506
+ */
8507
+ function retrieveHydrationInfo(rNode, injector) {
8508
+ return _retrieveHydrationInfoImpl(rNode, injector);
8509
+ }
8510
+ /**
8511
+ * Retrieves an instance of a component LView from a given ViewRef.
8512
+ * Returns an instance of a component LView or `null` in case of an embedded view.
8513
+ */
8514
+ function getComponentLViewForHydration(viewRef) {
8515
+ // Reading an internal field from `ViewRef` instance.
8516
+ let lView = viewRef._lView;
8517
+ const tView = lView[TVIEW];
8518
+ // A registered ViewRef might represent an instance of an
8519
+ // embedded view, in which case we do not need to annotate it.
8520
+ if (tView.type === 2 /* TViewType.Embedded */) {
8521
+ return null;
8522
+ }
8523
+ // Check if it's a root view and if so, retrieve component's
8524
+ // LView from the first slot after the header.
8525
+ if (isRootView(lView)) {
8526
+ lView = lView[HEADER_OFFSET];
8527
+ }
8528
+ return lView;
8529
+ }
8530
+ /**
8531
+ * Marks a node as "claimed" by hydration process.
8532
+ * This is needed to make assessments in tests whether
8533
+ * the hydration process handled all nodes.
8534
+ */
8535
+ function markRNodeAsClaimedByHydration(node, checkIfAlreadyClaimed = true) {
8536
+ if (!ngDevMode) {
8537
+ throw new Error('Calling `markRNodeAsClaimedByHydration` in prod mode ' +
8538
+ 'is not supported and likely a mistake.');
8539
+ }
8540
+ if (checkIfAlreadyClaimed && isRNodeClaimedForHydration(node)) {
8541
+ throw new Error('Trying to claim a node, which was claimed already.');
8542
+ }
8543
+ node.__claimed = true;
8544
+ ngDevMode.hydratedNodes++;
8545
+ }
8546
+ function isRNodeClaimedForHydration(node) {
8547
+ return !!node.__claimed;
8548
+ }
8549
+ function storeNgContainerInfo(hydrationInfo, index, firstChild) {
8550
+ var _a;
8551
+ (_a = hydrationInfo.ngContainers) !== null && _a !== void 0 ? _a : (hydrationInfo.ngContainers = {});
8552
+ hydrationInfo.ngContainers[index] = { firstChild };
8553
+ }
8554
+ function getNgContainerSize(hydrationInfo, index) {
8555
+ var _a, _b;
8556
+ return (_b = (_a = hydrationInfo.data[ELEMENT_CONTAINERS]) === null || _a === void 0 ? void 0 : _a[index]) !== null && _b !== void 0 ? _b : null;
8557
+ }
8558
+
8201
8559
  /**
8202
8560
  * Represents a component created by a `ComponentFactory`.
8203
8561
  * Provides access to the component instance and related objects,
@@ -8377,7 +8735,7 @@ class Version {
8377
8735
  /**
8378
8736
  * @publicApi
8379
8737
  */
8380
- const VERSION = new Version('16.0.0-next.0');
8738
+ const VERSION = new Version('16.0.0-next.2');
8381
8739
 
8382
8740
  // This default value is when checking the hierarchy for a token.
8383
8741
  //
@@ -8458,6 +8816,23 @@ class ErrorHandler {
8458
8816
  }
8459
8817
  }
8460
8818
 
8819
+ const NG_DEV_MODE$1 = typeof ngDevMode === 'undefined' || !!ngDevMode;
8820
+ /**
8821
+ * Internal token that specifies whether hydration is enabled.
8822
+ */
8823
+ const IS_HYDRATION_FEATURE_ENABLED = new InjectionToken(NG_DEV_MODE$1 ? 'IS_HYDRATION_FEATURE_ENABLED' : '');
8824
+ // By default (in client rendering mode), we remove all the contents
8825
+ // of the host element and render an application after that.
8826
+ const PRESERVE_HOST_CONTENT_DEFAULT = false;
8827
+ /**
8828
+ * Internal token that indicates whether host element content should be
8829
+ * retained during the bootstrap.
8830
+ */
8831
+ const PRESERVE_HOST_CONTENT = new InjectionToken(NG_DEV_MODE$1 ? 'PRESERVE_HOST_CONTENT' : '', {
8832
+ providedIn: 'root',
8833
+ factory: () => PRESERVE_HOST_CONTENT_DEFAULT,
8834
+ });
8835
+
8461
8836
  function normalizeDebugBindingName(name) {
8462
8837
  // Attribute names with `$` (eg `x-y$`) are valid per spec, but unsupported by some browsers
8463
8838
  name = camelCaseToDashCase(name.replace(/[$@]/g, '_'));
@@ -10157,7 +10532,7 @@ function renderChildComponents(hostLView, components) {
10157
10532
  renderComponent(hostLView, components[i]);
10158
10533
  }
10159
10534
  }
10160
- function createLView(parentLView, tView, context, flags, host, tHostNode, rendererFactory, renderer, sanitizer, injector, embeddedViewInjector) {
10535
+ function createLView(parentLView, tView, context, flags, host, tHostNode, rendererFactory, renderer, sanitizer, injector, embeddedViewInjector, hydrationInfo) {
10161
10536
  const lView = tView.blueprint.slice();
10162
10537
  lView[HOST] = host;
10163
10538
  lView[FLAGS] = flags | 4 /* LViewFlags.CreationMode */ | 64 /* LViewFlags.Attached */ | 8 /* LViewFlags.FirstLViewPass */;
@@ -10177,6 +10552,7 @@ function createLView(parentLView, tView, context, flags, host, tHostNode, render
10177
10552
  lView[INJECTOR$1] = injector || parentLView && parentLView[INJECTOR$1] || null;
10178
10553
  lView[T_HOST] = tHostNode;
10179
10554
  lView[ID] = getUniqueLViewId();
10555
+ lView[HYDRATION] = hydrationInfo;
10180
10556
  lView[EMBEDDED_VIEW_INJECTOR] = embeddedViewInjector;
10181
10557
  ngDevMode &&
10182
10558
  assertEqual(tView.type == 2 /* TViewType.Embedded */ ? parentLView !== null : true, true, 'Embedded views must have parentLView');
@@ -10239,6 +10615,7 @@ function createTNodeAtIndex(tView, index, type, name, attrs) {
10239
10615
  // In the case of i18n the `currentTNode` may already be linked, in which case we don't want
10240
10616
  // to break the links which i18n created.
10241
10617
  currentTNode.next = tNode;
10618
+ tNode.prev = currentTNode;
10242
10619
  }
10243
10620
  }
10244
10621
  }
@@ -10617,10 +10994,19 @@ function createViewBlueprint(bindingStartIndex, initialViewLength) {
10617
10994
  * @param rendererFactory Factory function to create renderer instance.
10618
10995
  * @param elementOrSelector Render element or CSS selector to locate the element.
10619
10996
  * @param encapsulation View Encapsulation defined for component that requests host element.
10620
- */
10621
- function locateHostElement(renderer, elementOrSelector, encapsulation) {
10622
- // When using native Shadow DOM, do not clear host element to allow native slot projection
10623
- const preserveContent = encapsulation === ViewEncapsulation$1.ShadowDom;
10997
+ * @param injector Root view injector instance.
10998
+ */
10999
+ function locateHostElement(renderer, elementOrSelector, encapsulation, injector) {
11000
+ // Note: we use default value for the `PRESERVE_HOST_CONTENT` here even though it's a
11001
+ // tree-shakable one (providedIn:'root'). This code path can be triggered during dynamic component
11002
+ // creation (after calling ViewContainerRef.createComponent) when an injector instance can be
11003
+ // provided. The injector instance might be disconnected from the main DI tree, thus the
11004
+ // `PRESERVE_HOST_CONTENT` woild not be able to instantiate. In this case, the default value will
11005
+ // be used.
11006
+ const preserveHostContent = injector.get(PRESERVE_HOST_CONTENT, PRESERVE_HOST_CONTENT_DEFAULT);
11007
+ // When using native Shadow DOM, do not clear host element to allow native slot
11008
+ // projection.
11009
+ const preserveContent = preserveHostContent || encapsulation === ViewEncapsulation$1.ShadowDom;
10624
11010
  return renderer.selectRootElement(elementOrSelector, preserveContent);
10625
11011
  }
10626
11012
  /**
@@ -10629,24 +11015,24 @@ function locateHostElement(renderer, elementOrSelector, encapsulation) {
10629
11015
  * On the first template pass, saves in TView:
10630
11016
  * - Cleanup function
10631
11017
  * - Index of context we just saved in LView.cleanupInstances
10632
- *
10633
- * This function can also be used to store instance specific cleanup fns. In that case the `context`
10634
- * is `null` and the function is store in `LView` (rather than it `TView`).
10635
11018
  */
10636
11019
  function storeCleanupWithContext(tView, lView, context, cleanupFn) {
10637
11020
  const lCleanup = getOrCreateLViewCleanup(lView);
10638
- if (context === null) {
10639
- // If context is null that this is instance specific callback. These callbacks can only be
10640
- // inserted after template shared instances. For this reason in ngDevMode we freeze the TView.
10641
- if (ngDevMode) {
10642
- Object.freeze(getOrCreateTViewCleanup(tView));
10643
- }
10644
- lCleanup.push(cleanupFn);
11021
+ // Historically the `storeCleanupWithContext` was used to register both framework-level and
11022
+ // user-defined cleanup callbacks, but over time those two types of cleanups were separated. This
11023
+ // dev mode checks assures that user-level cleanup callbacks are _not_ stored in data structures
11024
+ // reserved for framework-specific hooks.
11025
+ ngDevMode &&
11026
+ assertDefined(context, 'Cleanup context is mandatory when registering framework-level destroy hooks');
11027
+ lCleanup.push(context);
11028
+ if (tView.firstCreatePass) {
11029
+ getOrCreateTViewCleanup(tView).push(cleanupFn, lCleanup.length - 1);
10645
11030
  }
10646
11031
  else {
10647
- lCleanup.push(context);
10648
- if (tView.firstCreatePass) {
10649
- getOrCreateTViewCleanup(tView).push(cleanupFn, lCleanup.length - 1);
11032
+ // Make sure that no new framework-level cleanup functions are registered after the first
11033
+ // template pass is done (and TView data structures are meant to fully constructed).
11034
+ if (ngDevMode) {
11035
+ Object.freeze(getOrCreateTViewCleanup(tView));
10650
11036
  }
10651
11037
  }
10652
11038
  }
@@ -10677,8 +11063,9 @@ function createTNode(tView, tParent, type, index, value, attrs) {
10677
11063
  initialInputs: undefined,
10678
11064
  inputs: null,
10679
11065
  outputs: null,
10680
- tViews: null,
11066
+ tView: null,
10681
11067
  next: null,
11068
+ prev: null,
10682
11069
  projectionNext: null,
10683
11070
  child: null,
10684
11071
  parent: tParent,
@@ -10888,7 +11275,6 @@ function resolveDirectives(tView, lView, tNode, localRefs) {
10888
11275
  // Please make sure to have explicit type for `exportsMap`. Inferred type triggers bug in
10889
11276
  // tsickle.
10890
11277
  ngDevMode && assertFirstCreatePass(tView);
10891
- let hasDirectives = false;
10892
11278
  if (getBindingsEnabled()) {
10893
11279
  const exportsMap = localRefs === null ? null : { '': -1 };
10894
11280
  const matchResult = findDirectiveDefMatches(tView, tNode);
@@ -10901,7 +11287,6 @@ function resolveDirectives(tView, lView, tNode, localRefs) {
10901
11287
  [directiveDefs, hostDirectiveDefs] = matchResult;
10902
11288
  }
10903
11289
  if (directiveDefs !== null) {
10904
- hasDirectives = true;
10905
11290
  initializeDirectives(tView, lView, tNode, directiveDefs, exportsMap, hostDirectiveDefs);
10906
11291
  }
10907
11292
  if (exportsMap)
@@ -10909,7 +11294,6 @@ function resolveDirectives(tView, lView, tNode, localRefs) {
10909
11294
  }
10910
11295
  // Merge the template attrs last so that they have the highest priority.
10911
11296
  tNode.mergedAttrs = mergeHostAttrs(tNode.mergedAttrs, tNode.attrs);
10912
- return hasDirectives;
10913
11297
  }
10914
11298
  /** Initializes the data structures necessary for a list of directives to be instantiated. */
10915
11299
  function initializeDirectives(tView, lView, tNode, directives, exportsMap, hostDirectiveDefs) {
@@ -11223,7 +11607,7 @@ function addComponentLogic(lView, hostTNode, def) {
11223
11607
  // Only component views should be added to the view tree directly. Embedded views are
11224
11608
  // accessed through their containers because they may be removed / re-added later.
11225
11609
  const rendererFactory = lView[RENDERER_FACTORY];
11226
- const componentView = addToViewTree(lView, createLView(lView, tView, null, def.onPush ? 32 /* LViewFlags.Dirty */ : 16 /* LViewFlags.CheckAlways */, native, hostTNode, rendererFactory, rendererFactory.createRenderer(native, def), null, null, null));
11610
+ const componentView = addToViewTree(lView, createLView(lView, tView, null, def.onPush ? 32 /* LViewFlags.Dirty */ : 16 /* LViewFlags.CheckAlways */, native, hostTNode, rendererFactory, rendererFactory.createRenderer(native, def), null, null, null, null));
11227
11611
  // Component view will always be created before any injected LContainers,
11228
11612
  // so this is a regular element, wrap it with the component view
11229
11613
  lView[hostTNode.index] = componentView;
@@ -11468,6 +11852,11 @@ function renderComponent(hostLView, componentHostIdx) {
11468
11852
  const componentView = getComponentLViewByIndex(componentHostIdx, hostLView);
11469
11853
  const componentTView = componentView[TVIEW];
11470
11854
  syncViewWithBlueprint(componentTView, componentView);
11855
+ const hostRNode = componentView[HOST];
11856
+ // Populate an LView with hydration info retrieved from the DOM via TransferState.
11857
+ if (hostRNode !== null && componentView[HYDRATION] === null) {
11858
+ componentView[HYDRATION] = retrieveHydrationInfo(hostRNode, componentView[INJECTOR$1]);
11859
+ }
11471
11860
  renderView(componentTView, componentView, componentView[CONTEXT]);
11472
11861
  }
11473
11862
  /**
@@ -11841,7 +12230,7 @@ class ViewRef$1 {
11841
12230
  destroyLView(this._lView[TVIEW], this._lView);
11842
12231
  }
11843
12232
  onDestroy(callback) {
11844
- storeCleanupWithContext(this._lView[TVIEW], this._lView, null, callback);
12233
+ storeLViewOnDestroy(this._lView, callback);
11845
12234
  }
11846
12235
  /**
11847
12236
  * Marks a view and all of its ancestors dirty.
@@ -12168,13 +12557,13 @@ class ComponentFactory extends ComponentFactory$1 {
12168
12557
  // dynamically. Default to 'div' if this component did not specify any tag name in its selector.
12169
12558
  const elementName = this.componentDef.selectors[0][0] || 'div';
12170
12559
  const hostRNode = rootSelectorOrNode ?
12171
- locateHostElement(hostRenderer, rootSelectorOrNode, this.componentDef.encapsulation) :
12560
+ locateHostElement(hostRenderer, rootSelectorOrNode, this.componentDef.encapsulation, rootViewInjector) :
12172
12561
  createElementNode(hostRenderer, elementName, getNamespace(elementName));
12173
12562
  const rootFlags = this.componentDef.onPush ? 32 /* LViewFlags.Dirty */ | 256 /* LViewFlags.IsRoot */ :
12174
12563
  16 /* LViewFlags.CheckAlways */ | 256 /* LViewFlags.IsRoot */;
12175
12564
  // Create the root view. Uses empty TView and ContentTemplate.
12176
12565
  const rootTView = createTView(0 /* TViewType.Root */, null, null, 1, 0, null, null, null, null, null);
12177
- const rootLView = createLView(null, rootTView, null, rootFlags, null, null, rendererFactory, hostRenderer, sanitizer, rootViewInjector, null);
12566
+ const rootLView = createLView(null, rootTView, null, rootFlags, null, null, rendererFactory, hostRenderer, sanitizer, rootViewInjector, null, null);
12178
12567
  // rootView is the parent when bootstrapping
12179
12568
  // TODO(misko): it looks like we are entering view here but we don't really need to as
12180
12569
  // `renderView` does that. However as the code is written it is needed because
@@ -12285,7 +12674,7 @@ function createRootComponentTNode(lView, rNode) {
12285
12674
  /**
12286
12675
  * Creates the root component view and the root component node.
12287
12676
  *
12288
- * @param rNode Render host element.
12677
+ * @param hostRNode Render host element.
12289
12678
  * @param rootComponentDef ComponentDef
12290
12679
  * @param rootView The parent view where the host node is stored
12291
12680
  * @param rendererFactory Factory to be used for creating child renderers.
@@ -12294,11 +12683,17 @@ function createRootComponentTNode(lView, rNode) {
12294
12683
  *
12295
12684
  * @returns Component view created
12296
12685
  */
12297
- function createRootComponentView(tNode, rNode, rootComponentDef, rootDirectives, rootView, rendererFactory, hostRenderer, sanitizer) {
12686
+ function createRootComponentView(tNode, hostRNode, rootComponentDef, rootDirectives, rootView, rendererFactory, hostRenderer, sanitizer) {
12298
12687
  const tView = rootView[TVIEW];
12299
- applyRootComponentStyling(rootDirectives, tNode, rNode, hostRenderer);
12300
- const viewRenderer = rendererFactory.createRenderer(rNode, rootComponentDef);
12301
- const componentView = createLView(rootView, getOrCreateComponentTView(rootComponentDef), null, rootComponentDef.onPush ? 32 /* LViewFlags.Dirty */ : 16 /* LViewFlags.CheckAlways */, rootView[tNode.index], tNode, rendererFactory, viewRenderer, sanitizer || null, null, null);
12688
+ applyRootComponentStyling(rootDirectives, tNode, hostRNode, hostRenderer);
12689
+ // Hydration info is on the host element and needs to be retreived
12690
+ // and passed to the component LView.
12691
+ let hydrationInfo = null;
12692
+ if (hostRNode !== null) {
12693
+ hydrationInfo = retrieveHydrationInfo(hostRNode, rootView[INJECTOR$1]);
12694
+ }
12695
+ const viewRenderer = rendererFactory.createRenderer(hostRNode, rootComponentDef);
12696
+ const componentView = createLView(rootView, getOrCreateComponentTView(rootComponentDef), null, rootComponentDef.onPush ? 32 /* LViewFlags.Dirty */ : 16 /* LViewFlags.CheckAlways */, rootView[tNode.index], tNode, rendererFactory, viewRenderer, sanitizer || null, null, null, hydrationInfo);
12302
12697
  if (tView.firstCreatePass) {
12303
12698
  markAsComponentHost(tView, tNode, rootDirectives.length - 1);
12304
12699
  }
@@ -12776,41 +13171,19 @@ function validateMappings(bindingType, def, hostDirectiveBindings) {
12776
13171
  }
12777
13172
  }
12778
13173
 
12779
- let _symbolIterator = null;
12780
- function getSymbolIterator() {
12781
- if (!_symbolIterator) {
12782
- const Symbol = _global['Symbol'];
12783
- if (Symbol && Symbol.iterator) {
12784
- _symbolIterator = Symbol.iterator;
12785
- }
12786
- else {
12787
- // es6-shim specific logic
12788
- const keys = Object.getOwnPropertyNames(Map.prototype);
12789
- for (let i = 0; i < keys.length; ++i) {
12790
- const key = keys[i];
12791
- if (key !== 'entries' && key !== 'size' &&
12792
- Map.prototype[key] === Map.prototype['entries']) {
12793
- _symbolIterator = key;
12794
- }
12795
- }
12796
- }
12797
- }
12798
- return _symbolIterator;
12799
- }
12800
-
12801
13174
  function isIterable(obj) {
12802
- return obj !== null && typeof obj === 'object' && obj[getSymbolIterator()] !== undefined;
13175
+ return obj !== null && typeof obj === 'object' && obj[Symbol.iterator] !== undefined;
12803
13176
  }
12804
13177
  function isListLikeIterable(obj) {
12805
13178
  if (!isJsObject(obj))
12806
13179
  return false;
12807
13180
  return Array.isArray(obj) ||
12808
13181
  (!(obj instanceof Map) && // JS Map are iterables but return entries as [k, v]
12809
- getSymbolIterator() in obj); // JS Iterable have a Symbol.iterator prop
13182
+ Symbol.iterator in obj); // JS Iterable have a Symbol.iterator prop
12810
13183
  }
12811
13184
  function areIterablesEqual(a, b, comparator) {
12812
- const iterator1 = a[getSymbolIterator()]();
12813
- const iterator2 = b[getSymbolIterator()]();
13185
+ const iterator1 = a[Symbol.iterator]();
13186
+ const iterator2 = b[Symbol.iterator]();
12814
13187
  while (true) {
12815
13188
  const item1 = iterator1.next();
12816
13189
  const item2 = iterator2.next();
@@ -12829,7 +13202,7 @@ function iterateListLike(obj, fn) {
12829
13202
  }
12830
13203
  }
12831
13204
  else {
12832
- const iterator = obj[getSymbolIterator()]();
13205
+ const iterator = obj[Symbol.iterator]();
12833
13206
  let item;
12834
13207
  while (!((item = iterator.next()).done)) {
12835
13208
  fn(item.value);
@@ -13482,7 +13855,7 @@ function templateFirstCreatePass(index, tView, lView, templateFn, decls, vars, t
13482
13855
  const tNode = getOrCreateTNode(tView, index, 4 /* TNodeType.Container */, tagName || null, getConstant(tViewConsts, attrsIndex));
13483
13856
  resolveDirectives(tView, lView, tNode, getConstant(tViewConsts, localRefsIndex));
13484
13857
  registerPostOrderHooks(tView, tNode);
13485
- const embeddedTView = tNode.tViews = createTView(2 /* TViewType.Embedded */, tNode, templateFn, decls, vars, tView.directiveRegistry, tView.pipeRegistry, null, tView.schemas, tViewConsts);
13858
+ const embeddedTView = tNode.tView = createTView(2 /* TViewType.Embedded */, tNode, templateFn, decls, vars, tView.directiveRegistry, tView.pipeRegistry, null, tView.schemas, tViewConsts);
13486
13859
  if (tView.queries !== null) {
13487
13860
  tView.queries.template(tView, tNode);
13488
13861
  embeddedTView.queries = tView.queries.embeddedTView(tNode);
@@ -13552,6 +13925,122 @@ function ɵɵreference(index) {
13552
13925
  return load(contextLView, HEADER_OFFSET + index);
13553
13926
  }
13554
13927
 
13928
+ /**
13929
+ * Verifies whether a given node matches an expected criteria,
13930
+ * based on internal data structure state.
13931
+ */
13932
+ function validateMatchingNode(node, nodeType, tagName, lView, tNode) {
13933
+ if (node.nodeType !== nodeType ||
13934
+ (node.nodeType === Node.ELEMENT_NODE &&
13935
+ node.tagName.toLowerCase() !== (tagName === null || tagName === void 0 ? void 0 : tagName.toLowerCase()))) {
13936
+ // TODO: improve error message and use RuntimeError instead.
13937
+ throw new Error(`Unexpected node found during hydration.`);
13938
+ }
13939
+ }
13940
+ /**
13941
+ * Verifies whether next sibling node exists.
13942
+ */
13943
+ function validateSiblingNodeExists(node) {
13944
+ if (!node.nextSibling) {
13945
+ // TODO: improve error message and use RuntimeError instead.
13946
+ throw new Error(`Unexpected state: insufficient number of sibling nodes.`);
13947
+ }
13948
+ }
13949
+
13950
+ /** Whether current TNode is a first node in an <ng-container>. */
13951
+ function isFirstElementInNgContainer(tNode) {
13952
+ var _a;
13953
+ return !tNode.prev && ((_a = tNode.parent) === null || _a === void 0 ? void 0 : _a.type) === 8 /* TNodeType.ElementContainer */;
13954
+ }
13955
+ /** Returns first element from a DOM segment that corresponds to this <ng-container>. */
13956
+ function getDehydratedNgContainer(hydrationInfo, tContainerNode) {
13957
+ var _a;
13958
+ const noOffsetIndex = tContainerNode.index - HEADER_OFFSET;
13959
+ const ngContainer = (_a = hydrationInfo.ngContainers) === null || _a === void 0 ? void 0 : _a[noOffsetIndex];
13960
+ ngDevMode &&
13961
+ assertDefined(ngContainer, 'Unexpected state: no hydration info available for a given TNode, ' +
13962
+ 'which represents an element container.');
13963
+ return ngContainer;
13964
+ }
13965
+ /**
13966
+ * Locate a node in DOM tree that corresponds to a given TNode.
13967
+ *
13968
+ * @param hydrationInfo The hydration annotation data
13969
+ * @param tView the current tView
13970
+ * @param lView the current lView
13971
+ * @param tNode the current tNode
13972
+ * @returns an RNode that represents a given tNode
13973
+ */
13974
+ function locateNextRNode(hydrationInfo, tView, lView, tNode) {
13975
+ var _a, _b;
13976
+ let native = null;
13977
+ if (tView.firstChild === tNode) {
13978
+ // We create a first node in this view, so we use a reference
13979
+ // to the first child in this DOM segment.
13980
+ native = hydrationInfo.firstChild;
13981
+ }
13982
+ else {
13983
+ // Locate a node based on a previous sibling or a parent node.
13984
+ const previousTNodeParent = tNode.prev === null;
13985
+ const previousTNode = ((_a = tNode.prev) !== null && _a !== void 0 ? _a : tNode.parent);
13986
+ ngDevMode &&
13987
+ assertDefined(previousTNode, 'Unexpected state: current TNode does not have a connection ' +
13988
+ 'to the previous node or a parent node.');
13989
+ const previousRElement = getNativeByTNode(previousTNode, lView);
13990
+ if (isFirstElementInNgContainer(tNode)) {
13991
+ const ngContainer = getDehydratedNgContainer(hydrationInfo, tNode.parent);
13992
+ native = (_b = ngContainer.firstChild) !== null && _b !== void 0 ? _b : null;
13993
+ }
13994
+ else {
13995
+ if (previousTNodeParent) {
13996
+ native = previousRElement.firstChild;
13997
+ }
13998
+ else {
13999
+ native = previousRElement.nextSibling;
14000
+ }
14001
+ }
14002
+ }
14003
+ return native;
14004
+ }
14005
+ /**
14006
+ * Skips over a specified number of nodes and returns the next sibling node after that.
14007
+ */
14008
+ function siblingAfter(skip, from) {
14009
+ let currentNode = from;
14010
+ for (let i = 0; i < skip; i++) {
14011
+ ngDevMode && validateSiblingNodeExists(currentNode);
14012
+ currentNode = currentNode.nextSibling;
14013
+ }
14014
+ return currentNode;
14015
+ }
14016
+
14017
+ /**
14018
+ * The name of an attribute that can be added to the hydration boundary node
14019
+ * (component host node) to disable hydration for the content within that boundary.
14020
+ */
14021
+ const SKIP_HYDRATION_ATTR_NAME = 'ngSkipHydration';
14022
+ /**
14023
+ * Helper function to check if a given node has the 'ngSkipHydration' attribute
14024
+ */
14025
+ function hasNgSkipHydrationAttr(tNode) {
14026
+ const SKIP_HYDRATION_ATTR_NAME_LOWER_CASE = SKIP_HYDRATION_ATTR_NAME.toLowerCase();
14027
+ const attrs = tNode.mergedAttrs;
14028
+ if (attrs === null)
14029
+ return false;
14030
+ // only ever look at the attribute name and skip the values
14031
+ for (let i = 0; i < attrs.length; i += 2) {
14032
+ const value = attrs[i];
14033
+ // This is a marker, which means that the static attributes section is over,
14034
+ // so we can exit early.
14035
+ if (typeof value === 'number')
14036
+ return false;
14037
+ if (typeof value === 'string' && value.toLowerCase() === SKIP_HYDRATION_ATTR_NAME_LOWER_CASE) {
14038
+ return true;
14039
+ }
14040
+ }
14041
+ return false;
14042
+ }
14043
+
13555
14044
  /**
13556
14045
  * Update a property on a selected element.
13557
14046
  *
@@ -13592,16 +14081,13 @@ function setDirectiveInputsWhichShadowsStyling(tView, tNode, lView, value, isCla
13592
14081
  setInputsForProperty(tView, lView, inputs[property], property, value);
13593
14082
  }
13594
14083
 
13595
- function elementStartFirstCreatePass(index, tView, lView, native, name, attrsIndex, localRefsIndex) {
14084
+ function elementStartFirstCreatePass(index, tView, lView, name, attrsIndex, localRefsIndex) {
13596
14085
  ngDevMode && assertFirstCreatePass(tView);
13597
14086
  ngDevMode && ngDevMode.firstCreatePass++;
13598
14087
  const tViewConsts = tView.consts;
13599
14088
  const attrs = getConstant(tViewConsts, attrsIndex);
13600
14089
  const tNode = getOrCreateTNode(tView, index, 2 /* TNodeType.Element */, name, attrs);
13601
- const hasDirectives = resolveDirectives(tView, lView, tNode, getConstant(tViewConsts, localRefsIndex));
13602
- if (ngDevMode) {
13603
- validateElementIsKnown(native, lView, tNode.value, tView.schemas, hasDirectives);
13604
- }
14090
+ resolveDirectives(tView, lView, tNode, getConstant(tViewConsts, localRefsIndex));
13605
14091
  if (tNode.attrs !== null) {
13606
14092
  computeStaticStyling(tNode, tNode.attrs, false);
13607
14093
  }
@@ -13636,13 +14122,18 @@ function ɵɵelementStart(index, name, attrsIndex, localRefsIndex) {
13636
14122
  assertEqual(getBindingIndex(), tView.bindingStartIndex, 'elements should be created before any bindings');
13637
14123
  ngDevMode && assertIndexInRange(lView, adjustedIndex);
13638
14124
  const renderer = lView[RENDERER];
13639
- const native = lView[adjustedIndex] = createElementNode(renderer, name, getNamespace$1());
13640
14125
  const tNode = tView.firstCreatePass ?
13641
- elementStartFirstCreatePass(adjustedIndex, tView, lView, native, name, attrsIndex, localRefsIndex) :
14126
+ elementStartFirstCreatePass(adjustedIndex, tView, lView, name, attrsIndex, localRefsIndex) :
13642
14127
  tView.data[adjustedIndex];
14128
+ const native = _locateOrCreateElementNode(tView, lView, tNode, renderer, name);
14129
+ lView[adjustedIndex] = native;
14130
+ const hasDirectives = isDirectiveHost(tNode);
14131
+ if (ngDevMode && tView.firstCreatePass) {
14132
+ validateElementIsKnown(native, lView, tNode.value, tView.schemas, hasDirectives);
14133
+ }
13643
14134
  setCurrentTNode(tNode, true);
13644
14135
  setupStaticAttributes(renderer, native, tNode);
13645
- if ((tNode.flags & 32 /* TNodeFlags.isDetached */) !== 32 /* TNodeFlags.isDetached */) {
14136
+ if ((tNode.flags & 32 /* TNodeFlags.isDetached */) !== 32 /* TNodeFlags.isDetached */ && wasLastNodeCreated()) {
13646
14137
  // In the i18n case, the translation may have removed this element, so only add it if it is not
13647
14138
  // detached. See `TNodeType.Placeholder` and `LFrame.inI18n` for more context.
13648
14139
  appendChild(tView, lView, native, tNode);
@@ -13654,7 +14145,7 @@ function ɵɵelementStart(index, name, attrsIndex, localRefsIndex) {
13654
14145
  attachPatchData(native, lView);
13655
14146
  }
13656
14147
  increaseElementDepthCount();
13657
- if (isDirectiveHost(tNode)) {
14148
+ if (hasDirectives) {
13658
14149
  createDirectivesInstances(tView, lView, tNode);
13659
14150
  executeContentQueries(tView, tNode, lView);
13660
14151
  }
@@ -13682,6 +14173,9 @@ function ɵɵelementEnd() {
13682
14173
  }
13683
14174
  const tNode = currentTNode;
13684
14175
  ngDevMode && assertTNodeType(tNode, 3 /* TNodeType.AnyRNode */);
14176
+ if (isSkipHydrationRootTNode(tNode)) {
14177
+ leaveSkipHydrationBlock();
14178
+ }
13685
14179
  decreaseElementDepthCount();
13686
14180
  const tView = getTView();
13687
14181
  if (tView.firstCreatePass) {
@@ -13714,6 +14208,40 @@ function ɵɵelement(index, name, attrsIndex, localRefsIndex) {
13714
14208
  ɵɵelementEnd();
13715
14209
  return ɵɵelement;
13716
14210
  }
14211
+ let _locateOrCreateElementNode = (tView, lView, tNode, renderer, name) => {
14212
+ lastNodeWasCreated(true);
14213
+ return createElementNode(renderer, name, getNamespace$1());
14214
+ };
14215
+ /**
14216
+ * Enables hydration code path (to lookup existing elements in DOM)
14217
+ * in addition to the regular creation mode of element nodes.
14218
+ */
14219
+ function locateOrCreateElementNodeImpl(tView, lView, tNode, renderer, name) {
14220
+ const hydrationInfo = lView[HYDRATION];
14221
+ const isNodeCreationMode = !hydrationInfo || isInSkipHydrationBlock();
14222
+ lastNodeWasCreated(isNodeCreationMode);
14223
+ // Regular creation mode.
14224
+ if (isNodeCreationMode) {
14225
+ return createElementNode(renderer, name, getNamespace$1());
14226
+ }
14227
+ // Hydration mode, looking up an existing element in DOM.
14228
+ const native = locateNextRNode(hydrationInfo, tView, lView, tNode);
14229
+ ngDevMode &&
14230
+ validateMatchingNode(native, Node.ELEMENT_NODE, name, lView, tNode);
14231
+ ngDevMode && markRNodeAsClaimedByHydration(native);
14232
+ // Checks if the skip hydration attribute is present during hydration so we know to
14233
+ // skip attempting to hydrate this block.
14234
+ if (hydrationInfo && hasNgSkipHydrationAttr(tNode)) {
14235
+ enterSkipHydrationBlock(tNode);
14236
+ // Since this isn't hydratable, we need to empty the node
14237
+ // so there's no duplicate content after render
14238
+ clearElementContents(renderer, native);
14239
+ }
14240
+ return native;
14241
+ }
14242
+ function enableLocateOrCreateElementNodeImpl() {
14243
+ _locateOrCreateElementNode = locateOrCreateElementNodeImpl;
14244
+ }
13717
14245
 
13718
14246
  function elementContainerStartFirstCreatePass(index, tView, lView, attrsIndex, localRefsIndex) {
13719
14247
  ngDevMode && ngDevMode.firstCreatePass++;
@@ -13759,10 +14287,12 @@ function ɵɵelementContainerStart(index, attrsIndex, localRefsIndex) {
13759
14287
  tView.data[adjustedIndex];
13760
14288
  setCurrentTNode(tNode, true);
13761
14289
  ngDevMode && ngDevMode.rendererCreateComment++;
13762
- const native = lView[adjustedIndex] =
13763
- lView[RENDERER].createComment(ngDevMode ? 'ng-container' : '');
13764
- appendChild(tView, lView, native, tNode);
13765
- attachPatchData(native, lView);
14290
+ const comment = _locateOrCreateElementContainerNode(tView, lView, tNode, index);
14291
+ lView[adjustedIndex] = comment;
14292
+ if (wasLastNodeCreated()) {
14293
+ appendChild(tView, lView, comment, tNode);
14294
+ }
14295
+ attachPatchData(comment, lView);
13766
14296
  if (isDirectiveHost(tNode)) {
13767
14297
  createDirectivesInstances(tView, lView, tNode);
13768
14298
  executeContentQueries(tView, tNode, lView);
@@ -13814,6 +14344,46 @@ function ɵɵelementContainer(index, attrsIndex, localRefsIndex) {
13814
14344
  ɵɵelementContainerEnd();
13815
14345
  return ɵɵelementContainer;
13816
14346
  }
14347
+ let _locateOrCreateElementContainerNode = (tView, lView, tNode, index) => {
14348
+ lastNodeWasCreated(true);
14349
+ return createCommentNode(lView[RENDERER], ngDevMode ? 'ng-container' : '');
14350
+ };
14351
+ /**
14352
+ * Enables hydration code path (to lookup existing elements in DOM)
14353
+ * in addition to the regular creation mode of comment nodes that
14354
+ * represent <ng-container>'s anchor.
14355
+ */
14356
+ function locateOrCreateElementContainerNode(tView, lView, tNode, index) {
14357
+ let comment;
14358
+ const hydrationInfo = lView[HYDRATION];
14359
+ const isNodeCreationMode = !hydrationInfo || isInSkipHydrationBlock();
14360
+ lastNodeWasCreated(isNodeCreationMode);
14361
+ // Regular creation mode.
14362
+ if (isNodeCreationMode) {
14363
+ return createCommentNode(lView[RENDERER], ngDevMode ? 'ng-container' : '');
14364
+ }
14365
+ // Hydration mode, looking up existing elements in DOM.
14366
+ const currentRNode = locateNextRNode(hydrationInfo, tView, lView, tNode);
14367
+ const ngContainerSize = getNgContainerSize(hydrationInfo, index);
14368
+ ngDevMode &&
14369
+ assertNumber(ngContainerSize, 'Unexpected state: hydrating an <ng-container>, ' +
14370
+ 'but no hydration info is available.');
14371
+ if (ngContainerSize > 0) {
14372
+ storeNgContainerInfo(hydrationInfo, index, currentRNode);
14373
+ comment = siblingAfter(ngContainerSize, currentRNode);
14374
+ }
14375
+ else {
14376
+ // If <ng-container> has no nodes,
14377
+ // the current node is an anchor (comment) node.
14378
+ comment = currentRNode;
14379
+ }
14380
+ ngDevMode && validateMatchingNode(comment, Node.COMMENT_NODE, null, lView, tNode);
14381
+ ngDevMode && markRNodeAsClaimedByHydration(comment);
14382
+ return comment;
14383
+ }
14384
+ function enableLocateOrCreateElementContainerNodeImpl() {
14385
+ _locateOrCreateElementContainerNode = locateOrCreateElementContainerNode;
14386
+ }
13817
14387
 
13818
14388
  /**
13819
14389
  * Returns the current OpaqueViewState instance.
@@ -13842,16 +14412,6 @@ function isPromise(obj) {
13842
14412
  function isSubscribable(obj) {
13843
14413
  return !!obj && typeof obj.subscribe === 'function';
13844
14414
  }
13845
- /**
13846
- * Determine if the argument is an Observable
13847
- *
13848
- * Strictly this tests that the `obj` is `Subscribable`, since `Observable`
13849
- * types need additional methods, such as `lift()`. But it is adequate for our
13850
- * needs since within the Angular framework code we only ever need to use the
13851
- * `subscribe()` method, and RxJS has mechanisms to wrap `Subscribable` objects
13852
- * into `Observable` as needed.
13853
- */
13854
- const isObservable = isSubscribable;
13855
14415
 
13856
14416
  /**
13857
14417
  * Adds an event listener to the current node.
@@ -14014,7 +14574,7 @@ function listenerInternal(tView, lView, renderer, tNode, eventName, listenerFn,
14014
14574
  const minifiedName = props[i + 1];
14015
14575
  const directiveInstance = lView[index];
14016
14576
  const output = directiveInstance[minifiedName];
14017
- if (ngDevMode && !isObservable(output)) {
14577
+ if (ngDevMode && !isSubscribable(output)) {
14018
14578
  throw new Error(`@Output ${minifiedName} not initialized in '${directiveInstance.constructor.name}'.`);
14019
14579
  }
14020
14580
  const subscription = output.subscribe(listenerFn);
@@ -16158,11 +16718,39 @@ function ɵɵtext(index, value = '') {
16158
16718
  const tNode = tView.firstCreatePass ?
16159
16719
  getOrCreateTNode(tView, adjustedIndex, 1 /* TNodeType.Text */, value, null) :
16160
16720
  tView.data[adjustedIndex];
16161
- const textNative = lView[adjustedIndex] = createTextNode(lView[RENDERER], value);
16162
- appendChild(tView, lView, textNative, tNode);
16721
+ const textNative = _locateOrCreateTextNode(tView, lView, tNode, value);
16722
+ lView[adjustedIndex] = textNative;
16723
+ if (wasLastNodeCreated()) {
16724
+ appendChild(tView, lView, textNative, tNode);
16725
+ }
16163
16726
  // Text nodes are self closing.
16164
16727
  setCurrentTNode(tNode, false);
16165
16728
  }
16729
+ let _locateOrCreateTextNode = (tView, lView, tNode, value) => {
16730
+ lastNodeWasCreated(true);
16731
+ return createTextNode(lView[RENDERER], value);
16732
+ };
16733
+ /**
16734
+ * Enables hydration code path (to lookup existing elements in DOM)
16735
+ * in addition to the regular creation mode of text nodes.
16736
+ */
16737
+ function locateOrCreateTextNodeImpl(tView, lView, tNode, value) {
16738
+ const hydrationInfo = lView[HYDRATION];
16739
+ const isNodeCreationMode = !hydrationInfo || isInSkipHydrationBlock();
16740
+ lastNodeWasCreated(isNodeCreationMode);
16741
+ // Regular creation mode.
16742
+ if (isNodeCreationMode) {
16743
+ return createTextNode(lView[RENDERER], value);
16744
+ }
16745
+ // Hydration mode, looking up an existing element in DOM.
16746
+ const textNative = locateNextRNode(hydrationInfo, tView, lView, tNode);
16747
+ ngDevMode && validateMatchingNode(textNative, Node.TEXT_NODE, null, lView, tNode);
16748
+ ngDevMode && markRNodeAsClaimedByHydration(textNative);
16749
+ return textNative;
16750
+ }
16751
+ function enableLocateOrCreateTextNodeImpl() {
16752
+ _locateOrCreateTextNode = locateOrCreateTextNodeImpl;
16753
+ }
16166
16754
 
16167
16755
  /**
16168
16756
  *
@@ -17840,7 +18428,7 @@ function getTIcu(tView, index) {
17840
18428
  if (value === null || typeof value === 'string')
17841
18429
  return null;
17842
18430
  if (ngDevMode &&
17843
- !(value.hasOwnProperty('tViews') || value.hasOwnProperty('currentCaseLViewIndex'))) {
18431
+ !(value.hasOwnProperty('tView') || value.hasOwnProperty('currentCaseLViewIndex'))) {
17844
18432
  throwError('We expect to get \'null\'|\'TIcu\'|\'TIcuContainer\', but got: ' + value);
17845
18433
  }
17846
18434
  // Here the `value.hasOwnProperty('currentCaseLViewIndex')` is a polymorphic read as it can be
@@ -17869,7 +18457,7 @@ function getTIcu(tView, index) {
17869
18457
  function setTIcu(tView, index, tIcu) {
17870
18458
  const tNode = tView.data[index];
17871
18459
  ngDevMode &&
17872
- assertEqual(tNode === null || tNode.hasOwnProperty('tViews'), true, 'We expect to get \'null\'|\'TIcuContainer\'');
18460
+ assertEqual(tNode === null || tNode.hasOwnProperty('tView'), true, 'We expect to get \'null\'|\'TIcuContainer\'');
17873
18461
  if (tNode === null) {
17874
18462
  tView.data[index] = tIcu;
17875
18463
  }
@@ -20970,7 +21558,8 @@ function _wrapInTimeout(fn) {
20970
21558
  const EventEmitter = EventEmitter_;
20971
21559
 
20972
21560
  function symbolIterator() {
20973
- return this._results[getSymbolIterator()]();
21561
+ // @ts-expect-error accessing a private member
21562
+ return this._results[Symbol.iterator]();
20974
21563
  }
20975
21564
  /**
20976
21565
  * An unmodifiable list of items that Angular keeps up to date when the state
@@ -21022,11 +21611,10 @@ class QueryList {
21022
21611
  // This function should be declared on the prototype, but doing so there will cause the class
21023
21612
  // declaration to have side-effects and become not tree-shakable. For this reason we do it in
21024
21613
  // the constructor.
21025
- // [getSymbolIterator()](): Iterator<T> { ... }
21026
- const symbol = getSymbolIterator();
21614
+ // [Symbol.iterator](): Iterator<T> { ... }
21027
21615
  const proto = QueryList.prototype;
21028
- if (!proto[symbol])
21029
- proto[symbol] = symbolIterator;
21616
+ if (!proto[Symbol.iterator])
21617
+ proto[Symbol.iterator] = symbolIterator;
21030
21618
  }
21031
21619
  /**
21032
21620
  * Returns the QueryList entry at `index`.
@@ -21165,8 +21753,8 @@ const R3TemplateRef = class TemplateRef extends ViewEngineTemplateRef {
21165
21753
  this.elementRef = elementRef;
21166
21754
  }
21167
21755
  createEmbeddedView(context, injector) {
21168
- const embeddedTView = this._declarationTContainer.tViews;
21169
- const embeddedLView = createLView(this._declarationLView, embeddedTView, context, 16 /* LViewFlags.CheckAlways */, null, embeddedTView.declTNode, null, null, null, null, injector || null);
21756
+ const embeddedTView = this._declarationTContainer.tView;
21757
+ const embeddedLView = createLView(this._declarationLView, embeddedTView, context, 16 /* LViewFlags.CheckAlways */, null, embeddedTView.declTNode, null, null, null, null, injector || null, null);
21170
21758
  const declarationLContainer = this._declarationLView[this._declarationTContainer.index];
21171
21759
  ngDevMode && assertLContainer(declarationLContainer);
21172
21760
  embeddedLView[DECLARATION_LCONTAINER] = declarationLContainer;
@@ -21195,7 +21783,7 @@ function injectTemplateRef() {
21195
21783
  */
21196
21784
  function createTemplateRef(hostTNode, hostLView) {
21197
21785
  if (hostTNode.type & 4 /* TNodeType.Container */) {
21198
- ngDevMode && assertDefined(hostTNode.tViews, 'TView must be allocated');
21786
+ ngDevMode && assertDefined(hostTNode.tView, 'TView must be allocated');
21199
21787
  return new R3TemplateRef(hostLView, hostTNode, createElementRef(hostTNode, hostLView));
21200
21788
  }
21201
21789
  return null;
@@ -22752,7 +23340,7 @@ function compileComponent(type, metadata) {
22752
23340
  // * for NgModule-based components, they're set when the NgModule which declares the
22753
23341
  // component resolves in the module scoping queue
22754
23342
  // * for standalone components, they're set just below, after `compileComponent`.
22755
- declarations: [], changeDetection: metadata.changeDetection, encapsulation, interpolation: metadata.interpolation, viewProviders: metadata.viewProviders || null, isStandalone: !!metadata.standalone });
23343
+ declarations: [], changeDetection: metadata.changeDetection, encapsulation, interpolation: metadata.interpolation, viewProviders: metadata.viewProviders || null });
22756
23344
  compilationDepth++;
22757
23345
  try {
22758
23346
  if (meta.usesInheritance) {
@@ -23277,10 +23865,6 @@ const NgModule = makeDecorator('NgModule', (ngModule) => ngModule, undefined, un
23277
23865
  * to be used by the decorator versions of these annotations.
23278
23866
  */
23279
23867
 
23280
- function noop(...args) {
23281
- // Do nothing.
23282
- }
23283
-
23284
23868
  /*
23285
23869
  * This file exists to support compilation of @angular/core in Ivy mode.
23286
23870
  *
@@ -23378,17 +23962,16 @@ const APP_INITIALIZER = new InjectionToken('Application Initializer');
23378
23962
  * @publicApi
23379
23963
  */
23380
23964
  class ApplicationInitStatus {
23381
- constructor(appInits) {
23382
- this.appInits = appInits;
23383
- this.resolve = noop;
23384
- this.reject = noop;
23965
+ constructor() {
23966
+ var _a;
23385
23967
  this.initialized = false;
23386
23968
  this.done = false;
23387
- // TODO: Throw RuntimeErrorCode.INVALID_MULTI_PROVIDER if appInits is not an array
23388
23969
  this.donePromise = new Promise((res, rej) => {
23389
23970
  this.resolve = res;
23390
23971
  this.reject = rej;
23391
23972
  });
23973
+ // TODO: Throw RuntimeErrorCode.INVALID_MULTI_PROVIDER if appInits is not an array
23974
+ this.appInits = (_a = inject(APP_INITIALIZER, { optional: true })) !== null && _a !== void 0 ? _a : [];
23392
23975
  }
23393
23976
  /** @internal */
23394
23977
  runInitializers() {
@@ -23396,24 +23979,23 @@ class ApplicationInitStatus {
23396
23979
  return;
23397
23980
  }
23398
23981
  const asyncInitPromises = [];
23982
+ for (const appInits of this.appInits) {
23983
+ const initResult = appInits();
23984
+ if (isPromise(initResult)) {
23985
+ asyncInitPromises.push(initResult);
23986
+ }
23987
+ else if (isSubscribable(initResult)) {
23988
+ const observableAsPromise = new Promise((resolve, reject) => {
23989
+ initResult.subscribe({ complete: resolve, error: reject });
23990
+ });
23991
+ asyncInitPromises.push(observableAsPromise);
23992
+ }
23993
+ }
23399
23994
  const complete = () => {
23995
+ // @ts-expect-error overwriting a readonly
23400
23996
  this.done = true;
23401
23997
  this.resolve();
23402
23998
  };
23403
- if (this.appInits) {
23404
- for (let i = 0; i < this.appInits.length; i++) {
23405
- const initResult = this.appInits[i]();
23406
- if (isPromise(initResult)) {
23407
- asyncInitPromises.push(initResult);
23408
- }
23409
- else if (isObservable(initResult)) {
23410
- const observableAsPromise = new Promise((resolve, reject) => {
23411
- initResult.subscribe({ complete: resolve, error: reject });
23412
- });
23413
- asyncInitPromises.push(observableAsPromise);
23414
- }
23415
- }
23416
- }
23417
23999
  Promise.all(asyncInitPromises)
23418
24000
  .then(() => {
23419
24001
  complete();
@@ -23427,92 +24009,15 @@ class ApplicationInitStatus {
23427
24009
  this.initialized = true;
23428
24010
  }
23429
24011
  }
23430
- ApplicationInitStatus.ɵfac = function ApplicationInitStatus_Factory(t) { return new (t || ApplicationInitStatus)(ɵɵinject(APP_INITIALIZER, 8)); };
24012
+ ApplicationInitStatus.ɵfac = function ApplicationInitStatus_Factory(t) { return new (t || ApplicationInitStatus)(); };
23431
24013
  ApplicationInitStatus.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: ApplicationInitStatus, factory: ApplicationInitStatus.ɵfac, providedIn: 'root' });
23432
24014
  (function () {
23433
24015
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ApplicationInitStatus, [{
23434
24016
  type: Injectable,
23435
24017
  args: [{ providedIn: 'root' }]
23436
- }], function () {
23437
- return [{ type: undefined, decorators: [{
23438
- type: Inject,
23439
- args: [APP_INITIALIZER]
23440
- }, {
23441
- type: Optional
23442
- }] }];
23443
- }, null);
24018
+ }], null, null);
23444
24019
  })();
23445
24020
 
23446
- /**
23447
- * A [DI token](guide/glossary#di-token "DI token definition") representing a unique string ID, used
23448
- * primarily for prefixing application attributes and CSS styles when
23449
- * {@link ViewEncapsulation#Emulated ViewEncapsulation.Emulated} is being used.
23450
- *
23451
- * BY default, the value is randomly generated and assigned to the application by Angular.
23452
- * To provide a custom ID value, use a DI provider <!-- TODO: provider --> to configure
23453
- * the root {@link Injector} that uses this token.
23454
- *
23455
- * @publicApi
23456
- */
23457
- const APP_ID = new InjectionToken('AppId', {
23458
- providedIn: 'root',
23459
- factory: _appIdRandomProviderFactory,
23460
- });
23461
- function _appIdRandomProviderFactory() {
23462
- return `${_randomChar()}${_randomChar()}${_randomChar()}`;
23463
- }
23464
- /**
23465
- * Providers that generate a random `APP_ID_TOKEN`.
23466
- * @publicApi
23467
- */
23468
- const APP_ID_RANDOM_PROVIDER = {
23469
- provide: APP_ID,
23470
- useFactory: _appIdRandomProviderFactory,
23471
- deps: [],
23472
- };
23473
- function _randomChar() {
23474
- return String.fromCharCode(97 + Math.floor(Math.random() * 25));
23475
- }
23476
- /**
23477
- * A function that is executed when a platform is initialized.
23478
- * @publicApi
23479
- */
23480
- const PLATFORM_INITIALIZER = new InjectionToken('Platform Initializer');
23481
- /**
23482
- * A token that indicates an opaque platform ID.
23483
- * @publicApi
23484
- */
23485
- const PLATFORM_ID = new InjectionToken('Platform ID', {
23486
- providedIn: 'platform',
23487
- factory: () => 'unknown', // set a default platform name, when none set explicitly
23488
- });
23489
- /**
23490
- * A [DI token](guide/glossary#di-token "DI token definition") that provides a set of callbacks to
23491
- * be called for every component that is bootstrapped.
23492
- *
23493
- * Each callback must take a `ComponentRef` instance and return nothing.
23494
- *
23495
- * `(componentRef: ComponentRef) => void`
23496
- *
23497
- * @publicApi
23498
- */
23499
- const APP_BOOTSTRAP_LISTENER = new InjectionToken('appBootstrapListener');
23500
- /**
23501
- * A [DI token](guide/glossary#di-token "DI token definition") that indicates the root directory of
23502
- * the application
23503
- * @publicApi
23504
- */
23505
- const PACKAGE_ROOT_URL = new InjectionToken('Application Packages Root URL');
23506
- // We keep this token here, rather than the animations package, so that modules that only care
23507
- // about which animations module is loaded (e.g. the CDK) can retrieve it without having to
23508
- // include extra dependencies. See #44970 for more context.
23509
- /**
23510
- * A [DI token](guide/glossary#di-token "DI token definition") that indicates which animations
23511
- * module has been loaded.
23512
- * @publicApi
23513
- */
23514
- const ANIMATION_MODULE_TYPE = new InjectionToken('AnimationModuleType');
23515
-
23516
24021
  class Console {
23517
24022
  log(message) {
23518
24023
  // tslint:disable-next-line:no-console
@@ -23906,6 +24411,10 @@ function scheduleMicroTask(fn) {
23906
24411
  }
23907
24412
  }
23908
24413
 
24414
+ function noop(...args) {
24415
+ // Do nothing.
24416
+ }
24417
+
23909
24418
  function getNativeRequestAnimationFrame() {
23910
24419
  let nativeRequestAnimationFrame = _global['requestAnimationFrame'];
23911
24420
  let nativeCancelAnimationFrame = _global['cancelAnimationFrame'];
@@ -24634,6 +25143,7 @@ function setTestabilityGetter(getter) {
24634
25143
  }
24635
25144
  let _testabilityGetter;
24636
25145
 
25146
+ const NG_DEV_MODE = typeof ngDevMode === 'undefined' || ngDevMode;
24637
25147
  let _platformInjector = null;
24638
25148
  /**
24639
25149
  * Internal token to indicate whether having multiple bootstrapped platform should be allowed (only
@@ -24647,7 +25157,17 @@ const ALLOW_MULTIPLE_PLATFORMS = new InjectionToken('AllowMultipleToken');
24647
25157
  * entire class tree-shakeable.
24648
25158
  */
24649
25159
  const PLATFORM_DESTROY_LISTENERS = new InjectionToken('PlatformDestroyListeners');
24650
- const NG_DEV_MODE = typeof ngDevMode === 'undefined' || ngDevMode;
25160
+ /**
25161
+ * A [DI token](guide/glossary#di-token "DI token definition") that provides a set of callbacks to
25162
+ * be called for every component that is bootstrapped.
25163
+ *
25164
+ * Each callback must take a `ComponentRef` instance and return nothing.
25165
+ *
25166
+ * `(componentRef: ComponentRef) => void`
25167
+ *
25168
+ * @publicApi
25169
+ */
25170
+ const APP_BOOTSTRAP_LISTENER = new InjectionToken('appBootstrapListener');
24651
25171
  function compileNgModuleFactory(injector, options, moduleType) {
24652
25172
  ngDevMode && assertNgModuleType(moduleType);
24653
25173
  const moduleFactory = new NgModuleFactory(moduleType);
@@ -24666,7 +25186,7 @@ function compileNgModuleFactory(injector, options, moduleType) {
24666
25186
  if (isComponentResourceResolutionQueueEmpty()) {
24667
25187
  return Promise.resolve(moduleFactory);
24668
25188
  }
24669
- const compilerProviders = _mergeArrays(compilerOptions.map(o => o.providers));
25189
+ const compilerProviders = compilerOptions.flatMap((option) => { var _a; return (_a = option.providers) !== null && _a !== void 0 ? _a : []; });
24670
25190
  // In case there are no compiler providers, we just return the module factory as
24671
25191
  // there won't be any resource loader. This can happen with Ivy, because AOT compiled
24672
25192
  // modules can be still passed through "bootstrapModule". In that case we shouldn't
@@ -24739,9 +25259,7 @@ function createOrReusePlatformInjector(providers = []) {
24739
25259
  }
24740
25260
  function runPlatformInitializers(injector) {
24741
25261
  const inits = injector.get(PLATFORM_INITIALIZER, null);
24742
- if (inits) {
24743
- inits.forEach((init) => init());
24744
- }
25262
+ inits === null || inits === void 0 ? void 0 : inits.forEach((init) => init());
24745
25263
  }
24746
25264
  /**
24747
25265
  * Internal create application API that implements the core application creation logic and optional
@@ -24766,7 +25284,7 @@ function internalCreateApplication(config) {
24766
25284
  // bootstrap level as well as providers passed to the bootstrap call by a user.
24767
25285
  const allAppProviders = [
24768
25286
  { provide: NgZone, useValue: ngZone },
24769
- ...(appProviders || []), //
25287
+ ...(appProviders || []),
24770
25288
  ];
24771
25289
  const envInjector = createEnvironmentInjector(allAppProviders, platformInjector, 'Environment Injector');
24772
25290
  const exceptionHandler = envInjector.get(ErrorHandler, null);
@@ -25037,21 +25555,21 @@ PlatformRef.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: PlatformRef, fa
25037
25555
  // `NgZoneOptions` that are recognized by the NgZone constructor. Passing no options will result in
25038
25556
  // a set of default options returned.
25039
25557
  function getNgZoneOptions(options) {
25558
+ var _a, _b;
25040
25559
  return {
25041
25560
  enableLongStackTrace: typeof ngDevMode === 'undefined' ? false : !!ngDevMode,
25042
- shouldCoalesceEventChangeDetection: !!(options && options.ngZoneEventCoalescing) || false,
25043
- shouldCoalesceRunChangeDetection: !!(options && options.ngZoneRunCoalescing) || false,
25561
+ shouldCoalesceEventChangeDetection: (_a = options === null || options === void 0 ? void 0 : options.ngZoneEventCoalescing) !== null && _a !== void 0 ? _a : false,
25562
+ shouldCoalesceRunChangeDetection: (_b = options === null || options === void 0 ? void 0 : options.ngZoneRunCoalescing) !== null && _b !== void 0 ? _b : false,
25044
25563
  };
25045
25564
  }
25046
- function getNgZone(ngZoneToUse, options) {
25047
- let ngZone;
25565
+ function getNgZone(ngZoneToUse = 'zone.js', options) {
25048
25566
  if (ngZoneToUse === 'noop') {
25049
- ngZone = new NoopNgZone();
25567
+ return new NoopNgZone();
25050
25568
  }
25051
- else {
25052
- ngZone = (ngZoneToUse === 'zone.js' ? undefined : ngZoneToUse) || new NgZone(options);
25569
+ if (ngZoneToUse === 'zone.js') {
25570
+ return new NgZone(options);
25053
25571
  }
25054
- return ngZone;
25572
+ return ngZoneToUse;
25055
25573
  }
25056
25574
  function _callAndReportToErrorHandler(errorHandler, ngZone, callback) {
25057
25575
  try {
@@ -25073,12 +25591,9 @@ function _callAndReportToErrorHandler(errorHandler, ngZone, callback) {
25073
25591
  }
25074
25592
  function optionsReducer(dst, objs) {
25075
25593
  if (Array.isArray(objs)) {
25076
- dst = objs.reduce(optionsReducer, dst);
25077
- }
25078
- else {
25079
- dst = Object.assign(Object.assign({}, dst), objs);
25594
+ return objs.reduce(optionsReducer, dst);
25080
25595
  }
25081
- return dst;
25596
+ return Object.assign(Object.assign({}, dst), objs);
25082
25597
  }
25083
25598
  /**
25084
25599
  * A reference to an Angular application running on a page.
@@ -25193,11 +25708,12 @@ class ApplicationRef {
25193
25708
  this._exceptionHandler = _exceptionHandler;
25194
25709
  /** @internal */
25195
25710
  this._bootstrapListeners = [];
25196
- this._views = [];
25197
25711
  this._runningTick = false;
25198
25712
  this._stable = true;
25199
25713
  this._destroyed = false;
25200
25714
  this._destroyListeners = [];
25715
+ /** @internal */
25716
+ this._views = [];
25201
25717
  /**
25202
25718
  * Get a list of component types registered to this application.
25203
25719
  * This list is populated even before the component is created.
@@ -25254,8 +25770,7 @@ class ApplicationRef {
25254
25770
  unstableSub.unsubscribe();
25255
25771
  };
25256
25772
  });
25257
- this.isStable =
25258
- merge$1(isCurrentlyStable, isStable.pipe(share()));
25773
+ this.isStable = merge$1(isCurrentlyStable, isStable.pipe(share()));
25259
25774
  }
25260
25775
  /**
25261
25776
  * Bootstrap a component onto the element identified by its selector or, optionally, to a
@@ -25486,11 +26001,6 @@ function _lastDefined(args) {
25486
26001
  }
25487
26002
  return undefined;
25488
26003
  }
25489
- function _mergeArrays(parts) {
25490
- const result = [];
25491
- parts.forEach((part) => part && result.push(...part));
25492
- return result;
25493
- }
25494
26004
 
25495
26005
  /**
25496
26006
  * Returns whether Angular is in development mode.
@@ -25530,6 +26040,37 @@ function enableProdMode() {
25530
26040
 
25531
26041
  // Public API for render
25532
26042
 
26043
+ /**
26044
+ * `DestroyRef` lets you set callbacks to run for any cleanup or destruction behavior.
26045
+ * The scope of this destruction depends on where `DestroyRef` is injected. If `DestroyRef`
26046
+ * is injected in a component or directive, the callbacks run when that component or
26047
+ * directive is destroyed. Otherwise the callbacks run when a corresponding injector is destroyed.
26048
+ */
26049
+ class DestroyRef {
26050
+ }
26051
+ /**
26052
+ * @internal
26053
+ * @nocollapse
26054
+ */
26055
+ DestroyRef.__NG_ELEMENT_ID__ = injectDestroyRef;
26056
+ /**
26057
+ * @internal
26058
+ * @nocollapse
26059
+ */
26060
+ DestroyRef.__NG_ENV_ID__ = (injector) => injector;
26061
+ class NodeInjectorDestroyRef extends DestroyRef {
26062
+ constructor(_lView) {
26063
+ super();
26064
+ this._lView = _lView;
26065
+ }
26066
+ onDestroy(callback) {
26067
+ storeLViewOnDestroy(this._lView, callback);
26068
+ }
26069
+ }
26070
+ function injectDestroyRef() {
26071
+ return new NodeInjectorDestroyRef(getLView());
26072
+ }
26073
+
25533
26074
  /**
25534
26075
  * Returns the NgModuleFactory with the given id (specified using [@NgModule.id
25535
26076
  * field](api/core/NgModule#id)), if it exists and has been loaded. Factories for NgModules that do
@@ -26266,10 +26807,6 @@ function getDebugNode(nativeNode) {
26266
26807
  }
26267
26808
  return null;
26268
26809
  }
26269
- // TODO: cleanup all references to this function and remove it.
26270
- function getDebugNodeR2(_nativeNode) {
26271
- return null;
26272
- }
26273
26810
  function getAllDebugNodes() {
26274
26811
  return Array.from(_nativeNodeToDebugNode.values());
26275
26812
  }
@@ -27359,14 +27896,242 @@ ApplicationModule.ɵinj = /*@__PURE__*/ ɵɵdefineInjector({});
27359
27896
  }], function () { return [{ type: ApplicationRef }]; }, null);
27360
27897
  })();
27361
27898
 
27899
+ /**
27900
+ * A collection that tracks all serialized views (`ngh` DOM annotations)
27901
+ * to avoid duplication. An attempt to add a duplicate view results in the
27902
+ * collection returning the index of the previously collected serialized view.
27903
+ * This reduces the number of annotations needed for a given page.
27904
+ */
27905
+ class SerializedViewCollection {
27906
+ constructor() {
27907
+ this.views = [];
27908
+ this.indexByContent = new Map();
27909
+ }
27910
+ add(serializedView) {
27911
+ const viewAsString = JSON.stringify(serializedView);
27912
+ if (!this.indexByContent.has(viewAsString)) {
27913
+ const index = this.views.length;
27914
+ this.views.push(serializedView);
27915
+ this.indexByContent.set(viewAsString, index);
27916
+ return index;
27917
+ }
27918
+ return this.indexByContent.get(viewAsString);
27919
+ }
27920
+ getAll() {
27921
+ return this.views;
27922
+ }
27923
+ }
27924
+ /**
27925
+ * Computes the number of root nodes in a given view
27926
+ * (or child nodes in a given container if a tNode is provided).
27927
+ */
27928
+ function calcNumRootNodes(tView, lView, tNode) {
27929
+ const rootNodes = [];
27930
+ collectNativeNodes(tView, lView, tNode, rootNodes);
27931
+ return rootNodes.length;
27932
+ }
27933
+ /**
27934
+ * Annotates all components bootstrapped in a given ApplicationRef
27935
+ * with info needed for hydration.
27936
+ *
27937
+ * @param appRef An instance of an ApplicationRef.
27938
+ * @param doc A reference to the current Document instance.
27939
+ */
27940
+ function annotateForHydration(appRef, doc) {
27941
+ const serializedViewCollection = new SerializedViewCollection();
27942
+ const viewRefs = appRef._views;
27943
+ for (const viewRef of viewRefs) {
27944
+ const lView = getComponentLViewForHydration(viewRef);
27945
+ // An `lView` might be `null` if a `ViewRef` represents
27946
+ // an embedded view (not a component view).
27947
+ if (lView !== null) {
27948
+ const hostElement = lView[HOST];
27949
+ if (hostElement) {
27950
+ const context = {
27951
+ serializedViewCollection,
27952
+ };
27953
+ annotateHostElementForHydration(hostElement, lView, context);
27954
+ }
27955
+ }
27956
+ }
27957
+ const allSerializedViews = serializedViewCollection.getAll();
27958
+ if (allSerializedViews.length > 0) {
27959
+ const transferState = appRef.injector.get(TransferState);
27960
+ transferState.set(NGH_DATA_KEY, allSerializedViews);
27961
+ }
27962
+ }
27963
+ /**
27964
+ * Serializes the lView data into a SerializedView object that will later be added
27965
+ * to the TransferState storage and referenced using the `ngh` attribute on a host
27966
+ * element.
27967
+ *
27968
+ * @param lView the lView we are serializing
27969
+ * @param context the hydration context
27970
+ * @returns the `SerializedView` object containing the data to be added to the host node
27971
+ */
27972
+ function serializeLView(lView, context) {
27973
+ var _a;
27974
+ const ngh = {};
27975
+ const tView = lView[TVIEW];
27976
+ // Iterate over DOM element references in an LView.
27977
+ for (let i = HEADER_OFFSET; i < tView.bindingStartIndex; i++) {
27978
+ const tNode = tView.data[i];
27979
+ const noOffsetIndex = i - HEADER_OFFSET;
27980
+ // Local refs (e.g. <div #localRef>) take up an extra slot in LViews
27981
+ // to store the same element. In this case, there is no information in
27982
+ // a corresponding slot in TNode data structure. If that's the case, just
27983
+ // skip this slot and move to the next one.
27984
+ if (!tNode) {
27985
+ continue;
27986
+ }
27987
+ if (isLContainer(lView[i])) {
27988
+ // TODO: serialization of LContainers will be added
27989
+ // in followup PRs.
27990
+ }
27991
+ else if (Array.isArray(lView[i])) {
27992
+ // This is a component, annotate the host node with an `ngh` attribute.
27993
+ const targetNode = unwrapRNode(lView[i][HOST]);
27994
+ if (!targetNode.hasAttribute(SKIP_HYDRATION_ATTR_NAME)) {
27995
+ annotateHostElementForHydration(targetNode, lView[i], context);
27996
+ }
27997
+ }
27998
+ else {
27999
+ // <ng-container> case
28000
+ if (tNode.type & 8 /* TNodeType.ElementContainer */) {
28001
+ // An <ng-container> is represented by the number of
28002
+ // top-level nodes. This information is needed to skip over
28003
+ // those nodes to reach a corresponding anchor node (comment node).
28004
+ (_a = ngh[ELEMENT_CONTAINERS]) !== null && _a !== void 0 ? _a : (ngh[ELEMENT_CONTAINERS] = {});
28005
+ ngh[ELEMENT_CONTAINERS][noOffsetIndex] = calcNumRootNodes(tView, lView, tNode.child);
28006
+ }
28007
+ }
28008
+ }
28009
+ return ngh;
28010
+ }
28011
+ /**
28012
+ * Physically adds the `ngh` attribute and serialized data to the host element.
28013
+ *
28014
+ * @param element The Host element to be annotated
28015
+ * @param lView The associated LView
28016
+ * @param context The hydration context
28017
+ */
28018
+ function annotateHostElementForHydration(element, lView, context) {
28019
+ const ngh = serializeLView(lView, context);
28020
+ const index = context.serializedViewCollection.add(ngh);
28021
+ const renderer = lView[RENDERER];
28022
+ renderer.setAttribute(element, NGH_ATTR_NAME, index.toString());
28023
+ }
28024
+
28025
+ /**
28026
+ * Indicates whether the hydration-related code was added,
28027
+ * prevents adding it multiple times.
28028
+ */
28029
+ let isHydrationSupportEnabled = false;
28030
+ /**
28031
+ * Brings the necessary hydration code in tree-shakable manner.
28032
+ * The code is only present when the `provideHydrationSupport` is
28033
+ * invoked. Otherwise, this code is tree-shaken away during the
28034
+ * build optimization step.
28035
+ *
28036
+ * This technique allows us to swap implementations of methods so
28037
+ * tree shaking works appropriately when hydration is disabled or
28038
+ * enabled. It brings in the appropriate version of the method that
28039
+ * supports hydration only when enabled.
28040
+ */
28041
+ function enableHydrationRuntimeSupport() {
28042
+ if (!isHydrationSupportEnabled) {
28043
+ isHydrationSupportEnabled = true;
28044
+ enableRetrieveHydrationInfoImpl();
28045
+ enableLocateOrCreateElementNodeImpl();
28046
+ enableLocateOrCreateTextNodeImpl();
28047
+ enableLocateOrCreateElementContainerNodeImpl();
28048
+ }
28049
+ }
28050
+ /**
28051
+ * Detects whether the code is invoked in a browser.
28052
+ * Later on, this check should be replaced with a tree-shakable
28053
+ * flag (e.g. `!isServer`).
28054
+ */
28055
+ function isBrowser() {
28056
+ return inject(PLATFORM_ID) === 'browser';
28057
+ }
28058
+ /**
28059
+ * Returns a set of providers required to setup hydration support
28060
+ * for an application that is server side rendered.
28061
+ *
28062
+ * ## NgModule-based bootstrap
28063
+ *
28064
+ * You can add the function call to the root AppModule of an application:
28065
+ * ```
28066
+ * import {provideHydrationSupport} from '@angular/core';
28067
+ *
28068
+ * @NgModule({
28069
+ * providers: [
28070
+ * // ... other providers ...
28071
+ * provideHydrationSupport()
28072
+ * ],
28073
+ * declarations: [AppComponent],
28074
+ * bootstrap: [AppComponent]
28075
+ * })
28076
+ * class AppModule {}
28077
+ * ```
28078
+ *
28079
+ * ## Standalone-based bootstrap
28080
+ *
28081
+ * Add the function to the `bootstrapApplication` call:
28082
+ * ```
28083
+ * import {provideHydrationSupport} from '@angular/core';
28084
+ *
28085
+ * bootstrapApplication(RootComponent, {
28086
+ * providers: [
28087
+ * // ... other providers ...
28088
+ * provideHydrationSupport()
28089
+ * ]
28090
+ * });
28091
+ * ```
28092
+ *
28093
+ * The function sets up an internal flag that would be recognized during
28094
+ * the server side rendering time as well, so there is no need to
28095
+ * configure or change anything in NgUniversal to enable the feature.
28096
+ *
28097
+ * @publicApi
28098
+ * @developerPreview
28099
+ */
28100
+ function provideHydrationSupport() {
28101
+ return makeEnvironmentProviders([
28102
+ {
28103
+ provide: ENVIRONMENT_INITIALIZER,
28104
+ useValue: () => {
28105
+ // Since this function is used across both server and client,
28106
+ // make sure that the runtime code is only added when invoked
28107
+ // on the client. Moving forward, the `isBrowser` check should
28108
+ // be replaced with a tree-shakable alternative (e.g. `isServer`
28109
+ // flag).
28110
+ if (isBrowser()) {
28111
+ enableHydrationRuntimeSupport();
28112
+ }
28113
+ },
28114
+ multi: true,
28115
+ },
28116
+ {
28117
+ provide: IS_HYDRATION_FEATURE_ENABLED,
28118
+ useValue: true,
28119
+ },
28120
+ {
28121
+ provide: PRESERVE_HOST_CONTENT,
28122
+ // Preserve host element content only in a browser
28123
+ // environment. On a server, an application is rendered
28124
+ // from scratch, so the host content needs to be empty.
28125
+ useFactory: () => isBrowser(),
28126
+ }
28127
+ ]);
28128
+ }
28129
+
27362
28130
  /** Coerces a value (typically a string) to a boolean. */
27363
28131
  function coerceToBoolean(value) {
27364
28132
  return typeof value === 'boolean' ? value : (value != null && value !== 'false');
27365
28133
  }
27366
28134
 
27367
- // TODO(alxhub): allows tests to compile, can be removed when tests have been updated.
27368
- const ɵivyEnabled = true;
27369
-
27370
28135
  /**
27371
28136
  * Compiles a partial directive declaration object into a full directive definition object.
27372
28137
  *
@@ -28070,6 +28835,20 @@ function reflectComponentType(component) {
28070
28835
  };
28071
28836
  }
28072
28837
 
28838
+ /**
28839
+ * Merge multiple application configurations from left to right.
28840
+ *
28841
+ * @param configs Two or more configurations to be merged.
28842
+ * @returns A merged [ApplicationConfig](api/core/ApplicationConfig).
28843
+ *
28844
+ * @publicApi
28845
+ */
28846
+ function mergeApplicationConfig(...configs) {
28847
+ return configs.reduce((prev, curr) => {
28848
+ return Object.assign(prev, curr, { providers: [...prev.providers, ...curr.providers] });
28849
+ }, { providers: [] });
28850
+ }
28851
+
28073
28852
  /**
28074
28853
  * @module
28075
28854
  * @description
@@ -28105,5 +28884,5 @@ if (typeof ngDevMode !== 'undefined' && ngDevMode) {
28105
28884
  * Generated bundle index. Do not edit.
28106
28885
  */
28107
28886
 
28108
- 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, computed, createComponent, createEnvironmentInjector, createNgModule, createNgModuleRef, createPlatform, createPlatformFactory, defineInjectable, destroyPlatform, effect, enableProdMode, forwardRef, getDebugNode, getModuleFactory, getNgModuleById, getPlatform, importProvidersFrom, inject, isDevMode, isSignal, isStandalone, makeEnvironmentProviders, platformCore, reflectComponentType, resolveForwardRef, setTestabilityGetter, signal, untracked, 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, XSS_SECURITY_URL as ɵXSS_SECURITY_URL, _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, convertToBitFlags as ɵconvertToBitFlags, createInjector as ɵcreateInjector, defaultIterableDiffers as ɵdefaultIterableDiffers, defaultKeyValueDiffers as ɵdefaultKeyValueDiffers, detectChanges as ɵdetectChanges, devModeEqual as ɵdevModeEqual, findLocaleData as ɵfindLocaleData, flushModuleScopingQueueAsMuchAsPossible as ɵflushModuleScopingQueueAsMuchAsPossible, formatRuntimeError as ɵformatRuntimeError, 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, internalCreateApplication as ɵinternalCreateApplication, isBoundToModule as ɵisBoundToModule, isDefaultChangeDetectionStrategy as ɵisDefaultChangeDetectionStrategy, isEnvironmentProviders as ɵisEnvironmentProviders, isInjectable as ɵisInjectable, isListLikeIterable as ɵisListLikeIterable, isObservable as ɵisObservable, isPromise as ɵisPromise, isSubscribable as ɵisSubscribable, ɵivyEnabled, makeDecorator as ɵmakeDecorator, 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, ɵɵCopyDefinitionFeature, FactoryTarget as ɵɵFactoryTarget, ɵɵHostDirectivesFeature, ɵɵ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, ɵɵvalidateIframeAttribute, ɵɵviewQuery };
28887
+ 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, DestroyRef, 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, computed, createComponent, createEnvironmentInjector, createNgModule, createNgModuleRef, createPlatform, createPlatformFactory, defineInjectable, destroyPlatform, effect, enableProdMode, forwardRef, getDebugNode, getModuleFactory, getNgModuleById, getPlatform, importProvidersFrom, inject, isDevMode, isSignal, isStandalone, makeEnvironmentProviders, mergeApplicationConfig, platformCore, reflectComponentType, resolveForwardRef, setTestabilityGetter, signal, untracked, ALLOW_MULTIPLE_PLATFORMS as ɵALLOW_MULTIPLE_PLATFORMS, APP_ID_RANDOM_PROVIDER as ɵAPP_ID_RANDOM_PROVIDER, ComponentFactory$1 as ɵComponentFactory, Console as ɵConsole, DEFAULT_LOCALE_ID as ɵDEFAULT_LOCALE_ID, INJECTOR_SCOPE as ɵINJECTOR_SCOPE, IS_HYDRATION_FEATURE_ENABLED as ɵIS_HYDRATION_FEATURE_ENABLED, 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, TransferState as ɵTransferState, ViewRef$1 as ɵViewRef, XSS_SECURITY_URL as ɵXSS_SECURITY_URL, _sanitizeHtml as ɵ_sanitizeHtml, _sanitizeUrl as ɵ_sanitizeUrl, allowSanitizationBypassAndThrow as ɵallowSanitizationBypassAndThrow, annotateForHydration as ɵannotateForHydration, 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, convertToBitFlags as ɵconvertToBitFlags, createInjector as ɵcreateInjector, defaultIterableDiffers as ɵdefaultIterableDiffers, defaultKeyValueDiffers as ɵdefaultKeyValueDiffers, detectChanges as ɵdetectChanges, devModeEqual as ɵdevModeEqual, escapeTransferStateContent as ɵescapeTransferStateContent, findLocaleData as ɵfindLocaleData, flushModuleScopingQueueAsMuchAsPossible as ɵflushModuleScopingQueueAsMuchAsPossible, formatRuntimeError as ɵformatRuntimeError, getComponentDef as ɵgetComponentDef, getDebugNode as ɵgetDebugNode, 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, internalCreateApplication as ɵinternalCreateApplication, isBoundToModule as ɵisBoundToModule, isEnvironmentProviders as ɵisEnvironmentProviders, isInjectable as ɵisInjectable, isNgModule as ɵisNgModule, isPromise as ɵisPromise, isSubscribable as ɵisSubscribable, makeDecorator as ɵmakeDecorator, makeStateKey as ɵmakeStateKey, noSideEffects as ɵnoSideEffects, patchComponentDefWithScope as ɵpatchComponentDefWithScope, provideHydrationSupport as ɵprovideHydrationSupport, 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, unescapeTransferStateContent as ɵunescapeTransferStateContent, unregisterAllLocaleData as ɵunregisterLocaleData, unwrapSafeValue as ɵunwrapSafeValue, ɵɵCopyDefinitionFeature, FactoryTarget as ɵɵFactoryTarget, ɵɵHostDirectivesFeature, ɵɵ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, ɵɵvalidateIframeAttribute, ɵɵviewQuery };
28109
28888
  //# sourceMappingURL=core.mjs.map