@angular/core 16.0.0-next.1 → 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 (54) hide show
  1. package/esm2020/src/application_config.mjs +21 -0
  2. package/esm2020/src/application_init.mjs +21 -30
  3. package/esm2020/src/application_ref.mjs +31 -31
  4. package/esm2020/src/application_tokens.mjs +2 -13
  5. package/esm2020/src/change_detection/change_detection.mjs +2 -2
  6. package/esm2020/src/change_detection/constants.mjs +1 -49
  7. package/esm2020/src/core.mjs +4 -3
  8. package/esm2020/src/core_private_export.mjs +5 -7
  9. package/esm2020/src/core_render3_private_export.mjs +2 -1
  10. package/esm2020/src/debug/debug_node.mjs +1 -5
  11. package/esm2020/src/hydration/annotate.mjs +140 -0
  12. package/esm2020/src/hydration/api.mjs +120 -0
  13. package/esm2020/src/hydration/error_handling.mjs +29 -0
  14. package/esm2020/src/hydration/interfaces.mjs +10 -0
  15. package/esm2020/src/hydration/node_lookup_utils.mjs +75 -0
  16. package/esm2020/src/hydration/skip_hydration.mjs +34 -0
  17. package/esm2020/src/hydration/tokens.mjs +25 -0
  18. package/esm2020/src/hydration/utils.mjs +131 -0
  19. package/esm2020/src/linker/template_ref.mjs +4 -4
  20. package/esm2020/src/render3/component_ref.mjs +16 -9
  21. package/esm2020/src/render3/i18n/i18n_util.mjs +3 -3
  22. package/esm2020/src/render3/instructions/element.mjs +48 -6
  23. package/esm2020/src/render3/instructions/element_container.mjs +54 -9
  24. package/esm2020/src/render3/instructions/listener.mjs +3 -3
  25. package/esm2020/src/render3/instructions/shared.mjs +25 -8
  26. package/esm2020/src/render3/instructions/template.mjs +2 -2
  27. package/esm2020/src/render3/instructions/text.mjs +36 -5
  28. package/esm2020/src/render3/interfaces/node.mjs +1 -1
  29. package/esm2020/src/render3/interfaces/renderer_dom.mjs +1 -1
  30. package/esm2020/src/render3/interfaces/view.mjs +3 -2
  31. package/esm2020/src/render3/jit/directive.mjs +1 -2
  32. package/esm2020/src/render3/node_manipulation.mjs +12 -1
  33. package/esm2020/src/render3/state.mjs +45 -1
  34. package/esm2020/src/transfer_state.mjs +15 -10
  35. package/esm2020/src/util/lang.mjs +1 -11
  36. package/esm2020/src/util/ng_dev_mode.mjs +3 -1
  37. package/esm2020/src/version.mjs +1 -1
  38. package/esm2020/testing/src/logger.mjs +3 -3
  39. package/esm2020/testing/src/ng_zone_mock.mjs +3 -3
  40. package/fesm2015/core.mjs +1127 -517
  41. package/fesm2015/core.mjs.map +1 -1
  42. package/fesm2015/testing.mjs +677 -90
  43. package/fesm2015/testing.mjs.map +1 -1
  44. package/fesm2020/core.mjs +1119 -515
  45. package/fesm2020/core.mjs.map +1 -1
  46. package/fesm2020/testing.mjs +671 -90
  47. package/fesm2020/testing.mjs.map +1 -1
  48. package/index.d.ts +174 -92
  49. package/package.json +2 -2
  50. package/schematics/migrations/relative-link-resolution/bundle.js +7 -7
  51. package/schematics/migrations/router-link-with-href/bundle.js +10 -10
  52. package/schematics/ng-generate/standalone-migration/bundle.js +693 -668
  53. package/schematics/ng-generate/standalone-migration/bundle.js.map +4 -4
  54. package/testing/index.d.ts +1 -1
package/fesm2020/core.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v16.0.0-next.1
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
@@ -1300,6 +1254,7 @@ const QUERIES = 19;
1300
1254
  const ID = 20;
1301
1255
  const EMBEDDED_VIEW_INJECTOR = 21;
1302
1256
  const ON_DESTROY_HOOKS = 22;
1257
+ const HYDRATION = 23;
1303
1258
  /**
1304
1259
  * Size of LView's header. Necessary to adjust for it when setting slots.
1305
1260
  *
@@ -1307,7 +1262,7 @@ const ON_DESTROY_HOOKS = 22;
1307
1262
  * instruction index into `LView` index. All other indexes should be in the `LView` index space and
1308
1263
  * there should be no need to refer to `HEADER_OFFSET` anywhere else.
1309
1264
  */
1310
- const HEADER_OFFSET = 23;
1265
+ const HEADER_OFFSET = 24;
1311
1266
  // Note: This hack is necessary so we don't erroneously get a circular dependency
1312
1267
  // failure based on types.
1313
1268
  const unusedValueExportToPlacateAjd$4 = 1;
@@ -1796,6 +1751,7 @@ function storeLViewOnDestroy(lView, onDestroyCallback) {
1796
1751
  const instructionState = {
1797
1752
  lFrame: createLFrame(null),
1798
1753
  bindingsEnabled: true,
1754
+ skipHydrationRootTNode: null,
1799
1755
  };
1800
1756
  /**
1801
1757
  * In this mode, any changes in bindings will throw an ExpressionChangedAfterChecked error.
@@ -1826,6 +1782,21 @@ function decreaseElementDepthCount() {
1826
1782
  function getBindingsEnabled() {
1827
1783
  return instructionState.bindingsEnabled;
1828
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
+ }
1829
1800
  /**
1830
1801
  * Enables directive matching on elements.
1831
1802
  *
@@ -1848,6 +1819,13 @@ function getBindingsEnabled() {
1848
1819
  function ɵɵenableBindings() {
1849
1820
  instructionState.bindingsEnabled = true;
1850
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
+ }
1851
1829
  /**
1852
1830
  * Disables directive matching on element.
1853
1831
  *
@@ -1870,6 +1848,12 @@ function ɵɵenableBindings() {
1870
1848
  function ɵɵdisableBindings() {
1871
1849
  instructionState.bindingsEnabled = false;
1872
1850
  }
1851
+ /**
1852
+ * Clears the root skip hydration node when leaving a skip hydration block.
1853
+ */
1854
+ function leaveSkipHydrationBlock() {
1855
+ instructionState.skipHydrationRootTNode = null;
1856
+ }
1873
1857
  /**
1874
1858
  * Return the current `LView`.
1875
1859
  */
@@ -2294,6 +2278,21 @@ function namespaceHTMLInternal() {
2294
2278
  function getNamespace$1() {
2295
2279
  return instructionState.lFrame.currentNamespace;
2296
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
+ }
2297
2296
 
2298
2297
  /**
2299
2298
  * Adds all directive lifecycle hooks from the given `DirectiveDef` to the given `TView`.
@@ -6331,6 +6330,17 @@ function nativeRemoveNode(renderer, rNode, isHostElement) {
6331
6330
  nativeRemoveChild(renderer, nativeParent, rNode, isHostElement);
6332
6331
  }
6333
6332
  }
6333
+ /**
6334
+ * Removes the contents of a given RElement using a given renderer.
6335
+ *
6336
+ * @param renderer A renderer to be used
6337
+ * @param rElement the native RElement to be cleared
6338
+ */
6339
+ function clearElementContents(renderer, rElement) {
6340
+ while (rElement.firstChild) {
6341
+ nativeRemoveChild(renderer, rElement, rElement.firstChild, false);
6342
+ }
6343
+ }
6334
6344
  /**
6335
6345
  * Performs the operation of `action` on the node. Typically this involves inserting or removing
6336
6346
  * nodes on the LView or projection boundary.
@@ -8229,176 +8239,498 @@ function forEachSingleProvider(providers, fn) {
8229
8239
  }
8230
8240
 
8231
8241
  /**
8232
- * Represents a component created by a `ComponentFactory`.
8233
- * Provides access to the component instance and related objects,
8234
- * and provides the means of destroying the instance.
8242
+ * A [DI token](guide/glossary#di-token "DI token definition") representing a unique string ID, used
8243
+ * primarily for prefixing application attributes and CSS styles when
8244
+ * {@link ViewEncapsulation#Emulated ViewEncapsulation.Emulated} is being used.
8245
+ *
8246
+ * BY default, the value is randomly generated and assigned to the application by Angular.
8247
+ * To provide a custom ID value, use a DI provider <!-- TODO: provider --> to configure
8248
+ * the root {@link Injector} that uses this token.
8235
8249
  *
8236
8250
  * @publicApi
8237
8251
  */
8238
- class ComponentRef$1 {
8252
+ const APP_ID = new InjectionToken('AppId', {
8253
+ providedIn: 'root',
8254
+ factory: _appIdRandomProviderFactory,
8255
+ });
8256
+ function _appIdRandomProviderFactory() {
8257
+ return `${_randomChar()}${_randomChar()}${_randomChar()}`;
8239
8258
  }
8240
8259
  /**
8241
- * Base class for a factory that can create a component dynamically.
8242
- * Instantiate a factory for a given type of component with `resolveComponentFactory()`.
8243
- * Use the resulting `ComponentFactory.create()` method to create a component of that type.
8244
- *
8245
- * @see [Dynamic Components](guide/dynamic-component-loader)
8246
- *
8260
+ * Providers that generate a random `APP_ID_TOKEN`.
8247
8261
  * @publicApi
8248
- *
8249
- * @deprecated Angular no longer requires Component factories. Please use other APIs where
8250
- * Component class can be used directly.
8251
8262
  */
8252
- class ComponentFactory$1 {
8253
- }
8254
-
8255
- function noComponentFactoryError(component) {
8256
- const error = Error(`No component factory found for ${stringify(component)}. Did you add it to @NgModule.entryComponents?`);
8257
- error[ERROR_COMPONENT] = component;
8258
- return error;
8259
- }
8260
- const ERROR_COMPONENT = 'ngComponent';
8261
- function getComponent$1(error) {
8262
- return error[ERROR_COMPONENT];
8263
- }
8264
- class _NullComponentFactoryResolver {
8265
- resolveComponentFactory(component) {
8266
- throw noComponentFactoryError(component);
8267
- }
8263
+ const APP_ID_RANDOM_PROVIDER = {
8264
+ provide: APP_ID,
8265
+ useFactory: _appIdRandomProviderFactory,
8266
+ deps: [],
8267
+ };
8268
+ function _randomChar() {
8269
+ return String.fromCharCode(97 + Math.floor(Math.random() * 25));
8268
8270
  }
8269
8271
  /**
8270
- * A simple registry that maps `Components` to generated `ComponentFactory` classes
8271
- * that can be used to create instances of components.
8272
- * Use to obtain the factory for a given component type,
8273
- * then use the factory's `create()` method to create a component of that type.
8274
- *
8275
- * Note: since v13, dynamic component creation via
8276
- * [`ViewContainerRef.createComponent`](api/core/ViewContainerRef#createComponent)
8277
- * does **not** require resolving component factory: component class can be used directly.
8278
- *
8272
+ * A function that is executed when a platform is initialized.
8279
8273
  * @publicApi
8280
- *
8281
- * @deprecated Angular no longer requires Component factories. Please use other APIs where
8282
- * Component class can be used directly.
8283
8274
  */
8284
- class ComponentFactoryResolver$1 {
8285
- }
8286
- ComponentFactoryResolver$1.NULL = ( /* @__PURE__ */new _NullComponentFactoryResolver());
8287
-
8275
+ const PLATFORM_INITIALIZER = new InjectionToken('Platform Initializer');
8288
8276
  /**
8289
- * Creates an ElementRef from the most recent node.
8290
- *
8291
- * @returns The ElementRef instance to use
8277
+ * A token that indicates an opaque platform ID.
8278
+ * @publicApi
8292
8279
  */
8293
- function injectElementRef() {
8294
- return createElementRef(getCurrentTNode(), getLView());
8295
- }
8280
+ const PLATFORM_ID = new InjectionToken('Platform ID', {
8281
+ providedIn: 'platform',
8282
+ factory: () => 'unknown', // set a default platform name, when none set explicitly
8283
+ });
8296
8284
  /**
8297
- * Creates an ElementRef given a node.
8298
- *
8299
- * @param tNode The node for which you'd like an ElementRef
8300
- * @param lView The view to which the node belongs
8301
- * @returns The ElementRef instance to use
8285
+ * A [DI token](guide/glossary#di-token "DI token definition") that indicates the root directory of
8286
+ * the application
8287
+ * @publicApi
8302
8288
  */
8303
- function createElementRef(tNode, lView) {
8304
- return new ElementRef(getNativeByTNode(tNode, lView));
8305
- }
8289
+ const PACKAGE_ROOT_URL = new InjectionToken('Application Packages Root URL');
8290
+ // We keep this token here, rather than the animations package, so that modules that only care
8291
+ // about which animations module is loaded (e.g. the CDK) can retrieve it without having to
8292
+ // include extra dependencies. See #44970 for more context.
8306
8293
  /**
8307
- * A wrapper around a native element inside of a View.
8308
- *
8309
- * An `ElementRef` is backed by a render-specific element. In the browser, this is usually a DOM
8310
- * element.
8311
- *
8312
- * @security Permitting direct access to the DOM can make your application more vulnerable to
8313
- * XSS attacks. Carefully review any use of `ElementRef` in your code. For more detail, see the
8314
- * [Security Guide](https://g.co/ng/security).
8315
- *
8294
+ * A [DI token](guide/glossary#di-token "DI token definition") that indicates which animations
8295
+ * module has been loaded.
8316
8296
  * @publicApi
8317
8297
  */
8318
- // Note: We don't expose things like `Injector`, `ViewContainer`, ... here,
8319
- // i.e. users have to ask for what they need. With that, we can build better analysis tools
8320
- // and could do better codegen in the future.
8321
- class ElementRef {
8322
- constructor(nativeElement) {
8323
- this.nativeElement = nativeElement;
8324
- }
8298
+ const ANIMATION_MODULE_TYPE = new InjectionToken('AnimationModuleType');
8299
+
8300
+ function escapeTransferStateContent(text) {
8301
+ const escapedText = {
8302
+ '&': '&a;',
8303
+ '"': '&q;',
8304
+ '\'': '&s;',
8305
+ '<': '&l;',
8306
+ '>': '&g;',
8307
+ };
8308
+ return text.replace(/[&"'<>]/g, s => escapedText[s]);
8325
8309
  }
8326
- /**
8327
- * @internal
8328
- * @nocollapse
8329
- */
8330
- ElementRef.__NG_ELEMENT_ID__ = injectElementRef;
8331
- /**
8332
- * Unwraps `ElementRef` and return the `nativeElement`.
8333
- *
8334
- * @param value value to unwrap
8335
- * @returns `nativeElement` if `ElementRef` otherwise returns value as is.
8336
- */
8337
- function unwrapElementRef(value) {
8338
- return value instanceof ElementRef ? value.nativeElement : value;
8310
+ function unescapeTransferStateContent(text) {
8311
+ const unescapedText = {
8312
+ '&a;': '&',
8313
+ '&q;': '"',
8314
+ '&s;': '\'',
8315
+ '&l;': '<',
8316
+ '&g;': '>',
8317
+ };
8318
+ return text.replace(/&[^;]+;/g, s => unescapedText[s]);
8339
8319
  }
8340
-
8341
8320
  /**
8342
- * Creates and initializes a custom renderer that implements the `Renderer2` base class.
8321
+ * Create a `StateKey<T>` that can be used to store value of type T with `TransferState`.
8343
8322
  *
8344
- * @publicApi
8345
- */
8346
- class RendererFactory2 {
8347
- }
8348
- /**
8349
- * Extend this base class to implement custom rendering. By default, Angular
8350
- * renders a template into DOM. You can use custom rendering to intercept
8351
- * rendering calls, or to render to something other than DOM.
8323
+ * Example:
8352
8324
  *
8353
- * Create your custom renderer using `RendererFactory2`.
8325
+ * ```
8326
+ * const COUNTER_KEY = makeStateKey<number>('counter');
8327
+ * let value = 10;
8354
8328
  *
8355
- * Use a custom renderer to bypass Angular's templating and
8356
- * make custom UI changes that can't be expressed declaratively.
8357
- * For example if you need to set a property or an attribute whose name is
8358
- * not statically known, use the `setProperty()` or
8359
- * `setAttribute()` method.
8329
+ * transferState.set(COUNTER_KEY, value);
8330
+ * ```
8360
8331
  *
8361
8332
  * @publicApi
8362
8333
  */
8363
- class Renderer2 {
8334
+ function makeStateKey(key) {
8335
+ return key;
8364
8336
  }
8365
- /**
8366
- * @internal
8367
- * @nocollapse
8368
- */
8369
- Renderer2.__NG_ELEMENT_ID__ = () => injectRenderer2();
8370
- /** Injects a Renderer2 for the current component. */
8371
- function injectRenderer2() {
8372
- // We need the Renderer to be based on the component that it's being injected into, however since
8373
- // DI happens before we've entered its view, `getLView` will return the parent view instead.
8374
- const lView = getLView();
8375
- const tNode = getCurrentTNode();
8376
- const nodeAtIndex = getComponentLViewByIndex(tNode.index, lView);
8377
- return (isLView(nodeAtIndex) ? nodeAtIndex : lView)[RENDERER];
8337
+ function initTransferState() {
8338
+ const transferState = new TransferState();
8339
+ transferState.store = retrieveTransferredState(getDocument(), inject(APP_ID));
8340
+ return transferState;
8378
8341
  }
8379
-
8380
8342
  /**
8381
- * Sanitizer is used by the views to sanitize potentially dangerous values.
8343
+ * A key value store that is transferred from the application on the server side to the application
8344
+ * on the client side.
8382
8345
  *
8383
- * @publicApi
8384
- */
8385
- class Sanitizer {
8386
- }
8387
- /** @nocollapse */
8388
- Sanitizer.ɵprov = ɵɵdefineInjectable({
8389
- token: Sanitizer,
8390
- providedIn: 'root',
8391
- factory: () => null,
8392
- });
8393
-
8394
- /**
8395
- * @description Represents the version of Angular
8346
+ * The `TransferState` is available as an injectable token.
8347
+ * On the client, just inject this token using DI and use it, it will be lazily initialized.
8348
+ * On the server it's already included if `renderApplication` function is used. Otherwise, import
8349
+ * the `ServerTransferStateModule` module to make the `TransferState` available.
8350
+ *
8351
+ * The values in the store are serialized/deserialized using JSON.stringify/JSON.parse. So only
8352
+ * boolean, number, string, null and non-class objects will be serialized and deserialized in a
8353
+ * non-lossy manner.
8396
8354
  *
8397
8355
  * @publicApi
8398
8356
  */
8399
- class Version {
8400
- constructor(full) {
8401
- this.full = full;
8357
+ class TransferState {
8358
+ constructor() {
8359
+ /** @internal */
8360
+ this.store = {};
8361
+ this.onSerializeCallbacks = {};
8362
+ }
8363
+ /**
8364
+ * Get the value corresponding to a key. Return `defaultValue` if key is not found.
8365
+ */
8366
+ get(key, defaultValue) {
8367
+ return this.store[key] !== undefined ? this.store[key] : defaultValue;
8368
+ }
8369
+ /**
8370
+ * Set the value corresponding to a key.
8371
+ */
8372
+ set(key, value) {
8373
+ this.store[key] = value;
8374
+ }
8375
+ /**
8376
+ * Remove a key from the store.
8377
+ */
8378
+ remove(key) {
8379
+ delete this.store[key];
8380
+ }
8381
+ /**
8382
+ * Test whether a key exists in the store.
8383
+ */
8384
+ hasKey(key) {
8385
+ return this.store.hasOwnProperty(key);
8386
+ }
8387
+ /**
8388
+ * Indicates whether the state is empty.
8389
+ */
8390
+ get isEmpty() {
8391
+ return Object.keys(this.store).length === 0;
8392
+ }
8393
+ /**
8394
+ * Register a callback to provide the value for a key when `toJson` is called.
8395
+ */
8396
+ onSerialize(key, callback) {
8397
+ this.onSerializeCallbacks[key] = callback;
8398
+ }
8399
+ /**
8400
+ * Serialize the current state of the store to JSON.
8401
+ */
8402
+ toJson() {
8403
+ // Call the onSerialize callbacks and put those values into the store.
8404
+ for (const key in this.onSerializeCallbacks) {
8405
+ if (this.onSerializeCallbacks.hasOwnProperty(key)) {
8406
+ try {
8407
+ this.store[key] = this.onSerializeCallbacks[key]();
8408
+ }
8409
+ catch (e) {
8410
+ console.warn('Exception in onSerialize callback: ', e);
8411
+ }
8412
+ }
8413
+ }
8414
+ return JSON.stringify(this.store);
8415
+ }
8416
+ }
8417
+ /** @nocollapse */
8418
+ TransferState.ɵprov =
8419
+ /** @pureOrBreakMyCode */ ɵɵdefineInjectable({
8420
+ token: TransferState,
8421
+ providedIn: 'root',
8422
+ factory: initTransferState,
8423
+ });
8424
+ function retrieveTransferredState(doc, appId) {
8425
+ // Locate the script tag with the JSON data transferred from the server.
8426
+ // The id of the script tag is set to the Angular appId + 'state'.
8427
+ const script = doc.getElementById(appId + '-state');
8428
+ let initialState = {};
8429
+ if (script && script.textContent) {
8430
+ try {
8431
+ // Avoid using any here as it triggers lint errors in google3 (any is not allowed).
8432
+ initialState = JSON.parse(unescapeTransferStateContent(script.textContent));
8433
+ }
8434
+ catch (e) {
8435
+ console.warn('Exception while restoring TransferState for app ' + appId, e);
8436
+ }
8437
+ }
8438
+ return initialState;
8439
+ }
8440
+
8441
+ /* Represents a key in NghDom that holds information about <ng-container>s. */
8442
+ const ELEMENT_CONTAINERS = 'e';
8443
+
8444
+ /**
8445
+ * The name of the key used in the TransferState collection,
8446
+ * where hydration information is located.
8447
+ */
8448
+ const TRANSFER_STATE_TOKEN_ID = '__ɵnghData__';
8449
+ /**
8450
+ * Lookup key used to reference DOM hydration data (ngh) in `TransferState`.
8451
+ */
8452
+ const NGH_DATA_KEY = makeStateKey(TRANSFER_STATE_TOKEN_ID);
8453
+ /**
8454
+ * The name of the attribute that would be added to host component
8455
+ * nodes and contain a reference to a particular slot in transferred
8456
+ * state that contains the necessary hydration info for this component.
8457
+ */
8458
+ const NGH_ATTR_NAME = 'ngh';
8459
+ /**
8460
+ * Reference to a function that reads `ngh` attribute value from a given RNode
8461
+ * and retrieves hydration information from the TransferState using that value
8462
+ * as an index. Returns `null` by default, when hydration is not enabled.
8463
+ *
8464
+ * @param rNode Component's host element.
8465
+ * @param injector Injector that this component has access to.
8466
+ */
8467
+ let _retrieveHydrationInfoImpl = (rNode, injector) => null;
8468
+ function retrieveHydrationInfoImpl(rNode, injector) {
8469
+ const nghAttrValue = rNode.getAttribute(NGH_ATTR_NAME);
8470
+ if (nghAttrValue == null)
8471
+ return null;
8472
+ let data = {};
8473
+ // An element might have an empty `ngh` attribute value (e.g. `<comp ngh="" />`),
8474
+ // which means that no special annotations are required. Do not attempt to read
8475
+ // from the TransferState in this case.
8476
+ if (nghAttrValue !== '') {
8477
+ const transferState = injector.get(TransferState, null, { optional: true });
8478
+ if (transferState !== null) {
8479
+ const nghData = transferState.get(NGH_DATA_KEY, []);
8480
+ // The nghAttrValue is always a number referencing an index
8481
+ // in the hydration TransferState data.
8482
+ data = nghData[Number(nghAttrValue)];
8483
+ // If the `ngh` attribute exists and has a non-empty value,
8484
+ // the hydration info *must* be present in the TransferState.
8485
+ // If there is no data for some reasons, this is an error.
8486
+ ngDevMode && assertDefined(data, 'Unable to retrieve hydration info from the TransferState.');
8487
+ }
8488
+ }
8489
+ const dehydratedView = {
8490
+ data,
8491
+ firstChild: rNode.firstChild ?? null,
8492
+ };
8493
+ // The `ngh` attribute is cleared from the DOM node now
8494
+ // that the data has been retrieved.
8495
+ rNode.removeAttribute(NGH_ATTR_NAME);
8496
+ // Note: don't check whether this node was claimed for hydration,
8497
+ // because this node might've been previously claimed while processing
8498
+ // template instructions.
8499
+ ngDevMode && markRNodeAsClaimedByHydration(rNode, /* checkIfAlreadyClaimed */ false);
8500
+ ngDevMode && ngDevMode.hydratedComponents++;
8501
+ return dehydratedView;
8502
+ }
8503
+ /**
8504
+ * Sets the implementation for the `retrieveNghInfo` function.
8505
+ */
8506
+ function enableRetrieveHydrationInfoImpl() {
8507
+ _retrieveHydrationInfoImpl = retrieveHydrationInfoImpl;
8508
+ }
8509
+ /**
8510
+ * Retrieves hydration info by reading the value from the `ngh` attribute
8511
+ * and accessing a corresponding slot in TransferState storage.
8512
+ */
8513
+ function retrieveHydrationInfo(rNode, injector) {
8514
+ return _retrieveHydrationInfoImpl(rNode, injector);
8515
+ }
8516
+ /**
8517
+ * Retrieves an instance of a component LView from a given ViewRef.
8518
+ * Returns an instance of a component LView or `null` in case of an embedded view.
8519
+ */
8520
+ function getComponentLViewForHydration(viewRef) {
8521
+ // Reading an internal field from `ViewRef` instance.
8522
+ let lView = viewRef._lView;
8523
+ const tView = lView[TVIEW];
8524
+ // A registered ViewRef might represent an instance of an
8525
+ // embedded view, in which case we do not need to annotate it.
8526
+ if (tView.type === 2 /* TViewType.Embedded */) {
8527
+ return null;
8528
+ }
8529
+ // Check if it's a root view and if so, retrieve component's
8530
+ // LView from the first slot after the header.
8531
+ if (isRootView(lView)) {
8532
+ lView = lView[HEADER_OFFSET];
8533
+ }
8534
+ return lView;
8535
+ }
8536
+ /**
8537
+ * Marks a node as "claimed" by hydration process.
8538
+ * This is needed to make assessments in tests whether
8539
+ * the hydration process handled all nodes.
8540
+ */
8541
+ function markRNodeAsClaimedByHydration(node, checkIfAlreadyClaimed = true) {
8542
+ if (!ngDevMode) {
8543
+ throw new Error('Calling `markRNodeAsClaimedByHydration` in prod mode ' +
8544
+ 'is not supported and likely a mistake.');
8545
+ }
8546
+ if (checkIfAlreadyClaimed && isRNodeClaimedForHydration(node)) {
8547
+ throw new Error('Trying to claim a node, which was claimed already.');
8548
+ }
8549
+ node.__claimed = true;
8550
+ ngDevMode.hydratedNodes++;
8551
+ }
8552
+ function isRNodeClaimedForHydration(node) {
8553
+ return !!node.__claimed;
8554
+ }
8555
+ function storeNgContainerInfo(hydrationInfo, index, firstChild) {
8556
+ hydrationInfo.ngContainers ?? (hydrationInfo.ngContainers = {});
8557
+ hydrationInfo.ngContainers[index] = { firstChild };
8558
+ }
8559
+ function getNgContainerSize(hydrationInfo, index) {
8560
+ return hydrationInfo.data[ELEMENT_CONTAINERS]?.[index] ?? null;
8561
+ }
8562
+
8563
+ /**
8564
+ * Represents a component created by a `ComponentFactory`.
8565
+ * Provides access to the component instance and related objects,
8566
+ * and provides the means of destroying the instance.
8567
+ *
8568
+ * @publicApi
8569
+ */
8570
+ class ComponentRef$1 {
8571
+ }
8572
+ /**
8573
+ * Base class for a factory that can create a component dynamically.
8574
+ * Instantiate a factory for a given type of component with `resolveComponentFactory()`.
8575
+ * Use the resulting `ComponentFactory.create()` method to create a component of that type.
8576
+ *
8577
+ * @see [Dynamic Components](guide/dynamic-component-loader)
8578
+ *
8579
+ * @publicApi
8580
+ *
8581
+ * @deprecated Angular no longer requires Component factories. Please use other APIs where
8582
+ * Component class can be used directly.
8583
+ */
8584
+ class ComponentFactory$1 {
8585
+ }
8586
+
8587
+ function noComponentFactoryError(component) {
8588
+ const error = Error(`No component factory found for ${stringify(component)}. Did you add it to @NgModule.entryComponents?`);
8589
+ error[ERROR_COMPONENT] = component;
8590
+ return error;
8591
+ }
8592
+ const ERROR_COMPONENT = 'ngComponent';
8593
+ function getComponent$1(error) {
8594
+ return error[ERROR_COMPONENT];
8595
+ }
8596
+ class _NullComponentFactoryResolver {
8597
+ resolveComponentFactory(component) {
8598
+ throw noComponentFactoryError(component);
8599
+ }
8600
+ }
8601
+ /**
8602
+ * A simple registry that maps `Components` to generated `ComponentFactory` classes
8603
+ * that can be used to create instances of components.
8604
+ * Use to obtain the factory for a given component type,
8605
+ * then use the factory's `create()` method to create a component of that type.
8606
+ *
8607
+ * Note: since v13, dynamic component creation via
8608
+ * [`ViewContainerRef.createComponent`](api/core/ViewContainerRef#createComponent)
8609
+ * does **not** require resolving component factory: component class can be used directly.
8610
+ *
8611
+ * @publicApi
8612
+ *
8613
+ * @deprecated Angular no longer requires Component factories. Please use other APIs where
8614
+ * Component class can be used directly.
8615
+ */
8616
+ class ComponentFactoryResolver$1 {
8617
+ }
8618
+ ComponentFactoryResolver$1.NULL = ( /* @__PURE__ */new _NullComponentFactoryResolver());
8619
+
8620
+ /**
8621
+ * Creates an ElementRef from the most recent node.
8622
+ *
8623
+ * @returns The ElementRef instance to use
8624
+ */
8625
+ function injectElementRef() {
8626
+ return createElementRef(getCurrentTNode(), getLView());
8627
+ }
8628
+ /**
8629
+ * Creates an ElementRef given a node.
8630
+ *
8631
+ * @param tNode The node for which you'd like an ElementRef
8632
+ * @param lView The view to which the node belongs
8633
+ * @returns The ElementRef instance to use
8634
+ */
8635
+ function createElementRef(tNode, lView) {
8636
+ return new ElementRef(getNativeByTNode(tNode, lView));
8637
+ }
8638
+ /**
8639
+ * A wrapper around a native element inside of a View.
8640
+ *
8641
+ * An `ElementRef` is backed by a render-specific element. In the browser, this is usually a DOM
8642
+ * element.
8643
+ *
8644
+ * @security Permitting direct access to the DOM can make your application more vulnerable to
8645
+ * XSS attacks. Carefully review any use of `ElementRef` in your code. For more detail, see the
8646
+ * [Security Guide](https://g.co/ng/security).
8647
+ *
8648
+ * @publicApi
8649
+ */
8650
+ // Note: We don't expose things like `Injector`, `ViewContainer`, ... here,
8651
+ // i.e. users have to ask for what they need. With that, we can build better analysis tools
8652
+ // and could do better codegen in the future.
8653
+ class ElementRef {
8654
+ constructor(nativeElement) {
8655
+ this.nativeElement = nativeElement;
8656
+ }
8657
+ }
8658
+ /**
8659
+ * @internal
8660
+ * @nocollapse
8661
+ */
8662
+ ElementRef.__NG_ELEMENT_ID__ = injectElementRef;
8663
+ /**
8664
+ * Unwraps `ElementRef` and return the `nativeElement`.
8665
+ *
8666
+ * @param value value to unwrap
8667
+ * @returns `nativeElement` if `ElementRef` otherwise returns value as is.
8668
+ */
8669
+ function unwrapElementRef(value) {
8670
+ return value instanceof ElementRef ? value.nativeElement : value;
8671
+ }
8672
+
8673
+ /**
8674
+ * Creates and initializes a custom renderer that implements the `Renderer2` base class.
8675
+ *
8676
+ * @publicApi
8677
+ */
8678
+ class RendererFactory2 {
8679
+ }
8680
+ /**
8681
+ * Extend this base class to implement custom rendering. By default, Angular
8682
+ * renders a template into DOM. You can use custom rendering to intercept
8683
+ * rendering calls, or to render to something other than DOM.
8684
+ *
8685
+ * Create your custom renderer using `RendererFactory2`.
8686
+ *
8687
+ * Use a custom renderer to bypass Angular's templating and
8688
+ * make custom UI changes that can't be expressed declaratively.
8689
+ * For example if you need to set a property or an attribute whose name is
8690
+ * not statically known, use the `setProperty()` or
8691
+ * `setAttribute()` method.
8692
+ *
8693
+ * @publicApi
8694
+ */
8695
+ class Renderer2 {
8696
+ }
8697
+ /**
8698
+ * @internal
8699
+ * @nocollapse
8700
+ */
8701
+ Renderer2.__NG_ELEMENT_ID__ = () => injectRenderer2();
8702
+ /** Injects a Renderer2 for the current component. */
8703
+ function injectRenderer2() {
8704
+ // We need the Renderer to be based on the component that it's being injected into, however since
8705
+ // DI happens before we've entered its view, `getLView` will return the parent view instead.
8706
+ const lView = getLView();
8707
+ const tNode = getCurrentTNode();
8708
+ const nodeAtIndex = getComponentLViewByIndex(tNode.index, lView);
8709
+ return (isLView(nodeAtIndex) ? nodeAtIndex : lView)[RENDERER];
8710
+ }
8711
+
8712
+ /**
8713
+ * Sanitizer is used by the views to sanitize potentially dangerous values.
8714
+ *
8715
+ * @publicApi
8716
+ */
8717
+ class Sanitizer {
8718
+ }
8719
+ /** @nocollapse */
8720
+ Sanitizer.ɵprov = ɵɵdefineInjectable({
8721
+ token: Sanitizer,
8722
+ providedIn: 'root',
8723
+ factory: () => null,
8724
+ });
8725
+
8726
+ /**
8727
+ * @description Represents the version of Angular
8728
+ *
8729
+ * @publicApi
8730
+ */
8731
+ class Version {
8732
+ constructor(full) {
8733
+ this.full = full;
8402
8734
  this.major = full.split('.')[0];
8403
8735
  this.minor = full.split('.')[1];
8404
8736
  this.patch = full.split('.').slice(2).join('.');
@@ -8407,7 +8739,7 @@ class Version {
8407
8739
  /**
8408
8740
  * @publicApi
8409
8741
  */
8410
- const VERSION = new Version('16.0.0-next.1');
8742
+ const VERSION = new Version('16.0.0-next.2');
8411
8743
 
8412
8744
  // This default value is when checking the hierarchy for a token.
8413
8745
  //
@@ -8488,6 +8820,23 @@ class ErrorHandler {
8488
8820
  }
8489
8821
  }
8490
8822
 
8823
+ const NG_DEV_MODE$1 = typeof ngDevMode === 'undefined' || !!ngDevMode;
8824
+ /**
8825
+ * Internal token that specifies whether hydration is enabled.
8826
+ */
8827
+ const IS_HYDRATION_FEATURE_ENABLED = new InjectionToken(NG_DEV_MODE$1 ? 'IS_HYDRATION_FEATURE_ENABLED' : '');
8828
+ // By default (in client rendering mode), we remove all the contents
8829
+ // of the host element and render an application after that.
8830
+ const PRESERVE_HOST_CONTENT_DEFAULT = false;
8831
+ /**
8832
+ * Internal token that indicates whether host element content should be
8833
+ * retained during the bootstrap.
8834
+ */
8835
+ const PRESERVE_HOST_CONTENT = new InjectionToken(NG_DEV_MODE$1 ? 'PRESERVE_HOST_CONTENT' : '', {
8836
+ providedIn: 'root',
8837
+ factory: () => PRESERVE_HOST_CONTENT_DEFAULT,
8838
+ });
8839
+
8491
8840
  function normalizeDebugBindingName(name) {
8492
8841
  // Attribute names with `$` (eg `x-y$`) are valid per spec, but unsupported by some browsers
8493
8842
  name = camelCaseToDashCase(name.replace(/[$@]/g, '_'));
@@ -10186,7 +10535,7 @@ function renderChildComponents(hostLView, components) {
10186
10535
  renderComponent(hostLView, components[i]);
10187
10536
  }
10188
10537
  }
10189
- function createLView(parentLView, tView, context, flags, host, tHostNode, rendererFactory, renderer, sanitizer, injector, embeddedViewInjector) {
10538
+ function createLView(parentLView, tView, context, flags, host, tHostNode, rendererFactory, renderer, sanitizer, injector, embeddedViewInjector, hydrationInfo) {
10190
10539
  const lView = tView.blueprint.slice();
10191
10540
  lView[HOST] = host;
10192
10541
  lView[FLAGS] = flags | 4 /* LViewFlags.CreationMode */ | 64 /* LViewFlags.Attached */ | 8 /* LViewFlags.FirstLViewPass */;
@@ -10206,6 +10555,7 @@ function createLView(parentLView, tView, context, flags, host, tHostNode, render
10206
10555
  lView[INJECTOR$1] = injector || parentLView && parentLView[INJECTOR$1] || null;
10207
10556
  lView[T_HOST] = tHostNode;
10208
10557
  lView[ID] = getUniqueLViewId();
10558
+ lView[HYDRATION] = hydrationInfo;
10209
10559
  lView[EMBEDDED_VIEW_INJECTOR] = embeddedViewInjector;
10210
10560
  ngDevMode &&
10211
10561
  assertEqual(tView.type == 2 /* TViewType.Embedded */ ? parentLView !== null : true, true, 'Embedded views must have parentLView');
@@ -10647,10 +10997,19 @@ function createViewBlueprint(bindingStartIndex, initialViewLength) {
10647
10997
  * @param rendererFactory Factory function to create renderer instance.
10648
10998
  * @param elementOrSelector Render element or CSS selector to locate the element.
10649
10999
  * @param encapsulation View Encapsulation defined for component that requests host element.
10650
- */
10651
- function locateHostElement(renderer, elementOrSelector, encapsulation) {
10652
- // When using native Shadow DOM, do not clear host element to allow native slot projection
10653
- const preserveContent = encapsulation === ViewEncapsulation$1.ShadowDom;
11000
+ * @param injector Root view injector instance.
11001
+ */
11002
+ function locateHostElement(renderer, elementOrSelector, encapsulation, injector) {
11003
+ // Note: we use default value for the `PRESERVE_HOST_CONTENT` here even though it's a
11004
+ // tree-shakable one (providedIn:'root'). This code path can be triggered during dynamic component
11005
+ // creation (after calling ViewContainerRef.createComponent) when an injector instance can be
11006
+ // provided. The injector instance might be disconnected from the main DI tree, thus the
11007
+ // `PRESERVE_HOST_CONTENT` woild not be able to instantiate. In this case, the default value will
11008
+ // be used.
11009
+ const preserveHostContent = injector.get(PRESERVE_HOST_CONTENT, PRESERVE_HOST_CONTENT_DEFAULT);
11010
+ // When using native Shadow DOM, do not clear host element to allow native slot
11011
+ // projection.
11012
+ const preserveContent = preserveHostContent || encapsulation === ViewEncapsulation$1.ShadowDom;
10654
11013
  return renderer.selectRootElement(elementOrSelector, preserveContent);
10655
11014
  }
10656
11015
  /**
@@ -10707,7 +11066,7 @@ function createTNode(tView, tParent, type, index, value, attrs) {
10707
11066
  initialInputs: undefined,
10708
11067
  inputs: null,
10709
11068
  outputs: null,
10710
- tViews: null,
11069
+ tView: null,
10711
11070
  next: null,
10712
11071
  prev: null,
10713
11072
  projectionNext: null,
@@ -11250,7 +11609,7 @@ function addComponentLogic(lView, hostTNode, def) {
11250
11609
  // Only component views should be added to the view tree directly. Embedded views are
11251
11610
  // accessed through their containers because they may be removed / re-added later.
11252
11611
  const rendererFactory = lView[RENDERER_FACTORY];
11253
- 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));
11612
+ 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));
11254
11613
  // Component view will always be created before any injected LContainers,
11255
11614
  // so this is a regular element, wrap it with the component view
11256
11615
  lView[hostTNode.index] = componentView;
@@ -11495,6 +11854,11 @@ function renderComponent(hostLView, componentHostIdx) {
11495
11854
  const componentView = getComponentLViewByIndex(componentHostIdx, hostLView);
11496
11855
  const componentTView = componentView[TVIEW];
11497
11856
  syncViewWithBlueprint(componentTView, componentView);
11857
+ const hostRNode = componentView[HOST];
11858
+ // Populate an LView with hydration info retrieved from the DOM via TransferState.
11859
+ if (hostRNode !== null && componentView[HYDRATION] === null) {
11860
+ componentView[HYDRATION] = retrieveHydrationInfo(hostRNode, componentView[INJECTOR$1]);
11861
+ }
11498
11862
  renderView(componentTView, componentView, componentView[CONTEXT]);
11499
11863
  }
11500
11864
  /**
@@ -12195,13 +12559,13 @@ class ComponentFactory extends ComponentFactory$1 {
12195
12559
  // dynamically. Default to 'div' if this component did not specify any tag name in its selector.
12196
12560
  const elementName = this.componentDef.selectors[0][0] || 'div';
12197
12561
  const hostRNode = rootSelectorOrNode ?
12198
- locateHostElement(hostRenderer, rootSelectorOrNode, this.componentDef.encapsulation) :
12562
+ locateHostElement(hostRenderer, rootSelectorOrNode, this.componentDef.encapsulation, rootViewInjector) :
12199
12563
  createElementNode(hostRenderer, elementName, getNamespace(elementName));
12200
12564
  const rootFlags = this.componentDef.onPush ? 32 /* LViewFlags.Dirty */ | 256 /* LViewFlags.IsRoot */ :
12201
12565
  16 /* LViewFlags.CheckAlways */ | 256 /* LViewFlags.IsRoot */;
12202
12566
  // Create the root view. Uses empty TView and ContentTemplate.
12203
12567
  const rootTView = createTView(0 /* TViewType.Root */, null, null, 1, 0, null, null, null, null, null);
12204
- const rootLView = createLView(null, rootTView, null, rootFlags, null, null, rendererFactory, hostRenderer, sanitizer, rootViewInjector, null);
12568
+ const rootLView = createLView(null, rootTView, null, rootFlags, null, null, rendererFactory, hostRenderer, sanitizer, rootViewInjector, null, null);
12205
12569
  // rootView is the parent when bootstrapping
12206
12570
  // TODO(misko): it looks like we are entering view here but we don't really need to as
12207
12571
  // `renderView` does that. However as the code is written it is needed because
@@ -12312,7 +12676,7 @@ function createRootComponentTNode(lView, rNode) {
12312
12676
  /**
12313
12677
  * Creates the root component view and the root component node.
12314
12678
  *
12315
- * @param rNode Render host element.
12679
+ * @param hostRNode Render host element.
12316
12680
  * @param rootComponentDef ComponentDef
12317
12681
  * @param rootView The parent view where the host node is stored
12318
12682
  * @param rendererFactory Factory to be used for creating child renderers.
@@ -12321,11 +12685,17 @@ function createRootComponentTNode(lView, rNode) {
12321
12685
  *
12322
12686
  * @returns Component view created
12323
12687
  */
12324
- function createRootComponentView(tNode, rNode, rootComponentDef, rootDirectives, rootView, rendererFactory, hostRenderer, sanitizer) {
12688
+ function createRootComponentView(tNode, hostRNode, rootComponentDef, rootDirectives, rootView, rendererFactory, hostRenderer, sanitizer) {
12325
12689
  const tView = rootView[TVIEW];
12326
- applyRootComponentStyling(rootDirectives, tNode, rNode, hostRenderer);
12327
- const viewRenderer = rendererFactory.createRenderer(rNode, rootComponentDef);
12328
- 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);
12690
+ applyRootComponentStyling(rootDirectives, tNode, hostRNode, hostRenderer);
12691
+ // Hydration info is on the host element and needs to be retreived
12692
+ // and passed to the component LView.
12693
+ let hydrationInfo = null;
12694
+ if (hostRNode !== null) {
12695
+ hydrationInfo = retrieveHydrationInfo(hostRNode, rootView[INJECTOR$1]);
12696
+ }
12697
+ const viewRenderer = rendererFactory.createRenderer(hostRNode, rootComponentDef);
12698
+ 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);
12329
12699
  if (tView.firstCreatePass) {
12330
12700
  markAsComponentHost(tView, tNode, rootDirectives.length - 1);
12331
12701
  }
@@ -13487,7 +13857,7 @@ function templateFirstCreatePass(index, tView, lView, templateFn, decls, vars, t
13487
13857
  const tNode = getOrCreateTNode(tView, index, 4 /* TNodeType.Container */, tagName || null, getConstant(tViewConsts, attrsIndex));
13488
13858
  resolveDirectives(tView, lView, tNode, getConstant(tViewConsts, localRefsIndex));
13489
13859
  registerPostOrderHooks(tView, tNode);
13490
- const embeddedTView = tNode.tViews = createTView(2 /* TViewType.Embedded */, tNode, templateFn, decls, vars, tView.directiveRegistry, tView.pipeRegistry, null, tView.schemas, tViewConsts);
13860
+ const embeddedTView = tNode.tView = createTView(2 /* TViewType.Embedded */, tNode, templateFn, decls, vars, tView.directiveRegistry, tView.pipeRegistry, null, tView.schemas, tViewConsts);
13491
13861
  if (tView.queries !== null) {
13492
13862
  tView.queries.template(tView, tNode);
13493
13863
  embeddedTView.queries = tView.queries.embeddedTView(tNode);
@@ -13557,6 +13927,119 @@ function ɵɵreference(index) {
13557
13927
  return load(contextLView, HEADER_OFFSET + index);
13558
13928
  }
13559
13929
 
13930
+ /**
13931
+ * Verifies whether a given node matches an expected criteria,
13932
+ * based on internal data structure state.
13933
+ */
13934
+ function validateMatchingNode(node, nodeType, tagName, lView, tNode) {
13935
+ if (node.nodeType !== nodeType ||
13936
+ (node.nodeType === Node.ELEMENT_NODE &&
13937
+ node.tagName.toLowerCase() !== tagName?.toLowerCase())) {
13938
+ // TODO: improve error message and use RuntimeError instead.
13939
+ throw new Error(`Unexpected node found during hydration.`);
13940
+ }
13941
+ }
13942
+ /**
13943
+ * Verifies whether next sibling node exists.
13944
+ */
13945
+ function validateSiblingNodeExists(node) {
13946
+ if (!node.nextSibling) {
13947
+ // TODO: improve error message and use RuntimeError instead.
13948
+ throw new Error(`Unexpected state: insufficient number of sibling nodes.`);
13949
+ }
13950
+ }
13951
+
13952
+ /** Whether current TNode is a first node in an <ng-container>. */
13953
+ function isFirstElementInNgContainer(tNode) {
13954
+ return !tNode.prev && tNode.parent?.type === 8 /* TNodeType.ElementContainer */;
13955
+ }
13956
+ /** Returns first element from a DOM segment that corresponds to this <ng-container>. */
13957
+ function getDehydratedNgContainer(hydrationInfo, tContainerNode) {
13958
+ const noOffsetIndex = tContainerNode.index - HEADER_OFFSET;
13959
+ const ngContainer = hydrationInfo.ngContainers?.[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
+ let native = null;
13976
+ if (tView.firstChild === tNode) {
13977
+ // We create a first node in this view, so we use a reference
13978
+ // to the first child in this DOM segment.
13979
+ native = hydrationInfo.firstChild;
13980
+ }
13981
+ else {
13982
+ // Locate a node based on a previous sibling or a parent node.
13983
+ const previousTNodeParent = tNode.prev === null;
13984
+ const previousTNode = (tNode.prev ?? tNode.parent);
13985
+ ngDevMode &&
13986
+ assertDefined(previousTNode, 'Unexpected state: current TNode does not have a connection ' +
13987
+ 'to the previous node or a parent node.');
13988
+ const previousRElement = getNativeByTNode(previousTNode, lView);
13989
+ if (isFirstElementInNgContainer(tNode)) {
13990
+ const ngContainer = getDehydratedNgContainer(hydrationInfo, tNode.parent);
13991
+ native = ngContainer.firstChild ?? null;
13992
+ }
13993
+ else {
13994
+ if (previousTNodeParent) {
13995
+ native = previousRElement.firstChild;
13996
+ }
13997
+ else {
13998
+ native = previousRElement.nextSibling;
13999
+ }
14000
+ }
14001
+ }
14002
+ return native;
14003
+ }
14004
+ /**
14005
+ * Skips over a specified number of nodes and returns the next sibling node after that.
14006
+ */
14007
+ function siblingAfter(skip, from) {
14008
+ let currentNode = from;
14009
+ for (let i = 0; i < skip; i++) {
14010
+ ngDevMode && validateSiblingNodeExists(currentNode);
14011
+ currentNode = currentNode.nextSibling;
14012
+ }
14013
+ return currentNode;
14014
+ }
14015
+
14016
+ /**
14017
+ * The name of an attribute that can be added to the hydration boundary node
14018
+ * (component host node) to disable hydration for the content within that boundary.
14019
+ */
14020
+ const SKIP_HYDRATION_ATTR_NAME = 'ngSkipHydration';
14021
+ /**
14022
+ * Helper function to check if a given node has the 'ngSkipHydration' attribute
14023
+ */
14024
+ function hasNgSkipHydrationAttr(tNode) {
14025
+ const SKIP_HYDRATION_ATTR_NAME_LOWER_CASE = SKIP_HYDRATION_ATTR_NAME.toLowerCase();
14026
+ const attrs = tNode.mergedAttrs;
14027
+ if (attrs === null)
14028
+ return false;
14029
+ // only ever look at the attribute name and skip the values
14030
+ for (let i = 0; i < attrs.length; i += 2) {
14031
+ const value = attrs[i];
14032
+ // This is a marker, which means that the static attributes section is over,
14033
+ // so we can exit early.
14034
+ if (typeof value === 'number')
14035
+ return false;
14036
+ if (typeof value === 'string' && value.toLowerCase() === SKIP_HYDRATION_ATTR_NAME_LOWER_CASE) {
14037
+ return true;
14038
+ }
14039
+ }
14040
+ return false;
14041
+ }
14042
+
13560
14043
  /**
13561
14044
  * Update a property on a selected element.
13562
14045
  *
@@ -13641,14 +14124,15 @@ function ɵɵelementStart(index, name, attrsIndex, localRefsIndex) {
13641
14124
  const tNode = tView.firstCreatePass ?
13642
14125
  elementStartFirstCreatePass(adjustedIndex, tView, lView, name, attrsIndex, localRefsIndex) :
13643
14126
  tView.data[adjustedIndex];
13644
- const native = lView[adjustedIndex] = createElementNode(renderer, name, getNamespace$1());
14127
+ const native = _locateOrCreateElementNode(tView, lView, tNode, renderer, name);
14128
+ lView[adjustedIndex] = native;
13645
14129
  const hasDirectives = isDirectiveHost(tNode);
13646
14130
  if (ngDevMode && tView.firstCreatePass) {
13647
14131
  validateElementIsKnown(native, lView, tNode.value, tView.schemas, hasDirectives);
13648
14132
  }
13649
14133
  setCurrentTNode(tNode, true);
13650
14134
  setupStaticAttributes(renderer, native, tNode);
13651
- if ((tNode.flags & 32 /* TNodeFlags.isDetached */) !== 32 /* TNodeFlags.isDetached */) {
14135
+ if ((tNode.flags & 32 /* TNodeFlags.isDetached */) !== 32 /* TNodeFlags.isDetached */ && wasLastNodeCreated()) {
13652
14136
  // In the i18n case, the translation may have removed this element, so only add it if it is not
13653
14137
  // detached. See `TNodeType.Placeholder` and `LFrame.inI18n` for more context.
13654
14138
  appendChild(tView, lView, native, tNode);
@@ -13688,6 +14172,9 @@ function ɵɵelementEnd() {
13688
14172
  }
13689
14173
  const tNode = currentTNode;
13690
14174
  ngDevMode && assertTNodeType(tNode, 3 /* TNodeType.AnyRNode */);
14175
+ if (isSkipHydrationRootTNode(tNode)) {
14176
+ leaveSkipHydrationBlock();
14177
+ }
13691
14178
  decreaseElementDepthCount();
13692
14179
  const tView = getTView();
13693
14180
  if (tView.firstCreatePass) {
@@ -13720,6 +14207,40 @@ function ɵɵelement(index, name, attrsIndex, localRefsIndex) {
13720
14207
  ɵɵelementEnd();
13721
14208
  return ɵɵelement;
13722
14209
  }
14210
+ let _locateOrCreateElementNode = (tView, lView, tNode, renderer, name) => {
14211
+ lastNodeWasCreated(true);
14212
+ return createElementNode(renderer, name, getNamespace$1());
14213
+ };
14214
+ /**
14215
+ * Enables hydration code path (to lookup existing elements in DOM)
14216
+ * in addition to the regular creation mode of element nodes.
14217
+ */
14218
+ function locateOrCreateElementNodeImpl(tView, lView, tNode, renderer, name) {
14219
+ const hydrationInfo = lView[HYDRATION];
14220
+ const isNodeCreationMode = !hydrationInfo || isInSkipHydrationBlock();
14221
+ lastNodeWasCreated(isNodeCreationMode);
14222
+ // Regular creation mode.
14223
+ if (isNodeCreationMode) {
14224
+ return createElementNode(renderer, name, getNamespace$1());
14225
+ }
14226
+ // Hydration mode, looking up an existing element in DOM.
14227
+ const native = locateNextRNode(hydrationInfo, tView, lView, tNode);
14228
+ ngDevMode &&
14229
+ validateMatchingNode(native, Node.ELEMENT_NODE, name, lView, tNode);
14230
+ ngDevMode && markRNodeAsClaimedByHydration(native);
14231
+ // Checks if the skip hydration attribute is present during hydration so we know to
14232
+ // skip attempting to hydrate this block.
14233
+ if (hydrationInfo && hasNgSkipHydrationAttr(tNode)) {
14234
+ enterSkipHydrationBlock(tNode);
14235
+ // Since this isn't hydratable, we need to empty the node
14236
+ // so there's no duplicate content after render
14237
+ clearElementContents(renderer, native);
14238
+ }
14239
+ return native;
14240
+ }
14241
+ function enableLocateOrCreateElementNodeImpl() {
14242
+ _locateOrCreateElementNode = locateOrCreateElementNodeImpl;
14243
+ }
13723
14244
 
13724
14245
  function elementContainerStartFirstCreatePass(index, tView, lView, attrsIndex, localRefsIndex) {
13725
14246
  ngDevMode && ngDevMode.firstCreatePass++;
@@ -13765,10 +14286,12 @@ function ɵɵelementContainerStart(index, attrsIndex, localRefsIndex) {
13765
14286
  tView.data[adjustedIndex];
13766
14287
  setCurrentTNode(tNode, true);
13767
14288
  ngDevMode && ngDevMode.rendererCreateComment++;
13768
- const native = lView[adjustedIndex] =
13769
- lView[RENDERER].createComment(ngDevMode ? 'ng-container' : '');
13770
- appendChild(tView, lView, native, tNode);
13771
- attachPatchData(native, lView);
14289
+ const comment = _locateOrCreateElementContainerNode(tView, lView, tNode, index);
14290
+ lView[adjustedIndex] = comment;
14291
+ if (wasLastNodeCreated()) {
14292
+ appendChild(tView, lView, comment, tNode);
14293
+ }
14294
+ attachPatchData(comment, lView);
13772
14295
  if (isDirectiveHost(tNode)) {
13773
14296
  createDirectivesInstances(tView, lView, tNode);
13774
14297
  executeContentQueries(tView, tNode, lView);
@@ -13820,6 +14343,46 @@ function ɵɵelementContainer(index, attrsIndex, localRefsIndex) {
13820
14343
  ɵɵelementContainerEnd();
13821
14344
  return ɵɵelementContainer;
13822
14345
  }
14346
+ let _locateOrCreateElementContainerNode = (tView, lView, tNode, index) => {
14347
+ lastNodeWasCreated(true);
14348
+ return createCommentNode(lView[RENDERER], ngDevMode ? 'ng-container' : '');
14349
+ };
14350
+ /**
14351
+ * Enables hydration code path (to lookup existing elements in DOM)
14352
+ * in addition to the regular creation mode of comment nodes that
14353
+ * represent <ng-container>'s anchor.
14354
+ */
14355
+ function locateOrCreateElementContainerNode(tView, lView, tNode, index) {
14356
+ let comment;
14357
+ const hydrationInfo = lView[HYDRATION];
14358
+ const isNodeCreationMode = !hydrationInfo || isInSkipHydrationBlock();
14359
+ lastNodeWasCreated(isNodeCreationMode);
14360
+ // Regular creation mode.
14361
+ if (isNodeCreationMode) {
14362
+ return createCommentNode(lView[RENDERER], ngDevMode ? 'ng-container' : '');
14363
+ }
14364
+ // Hydration mode, looking up existing elements in DOM.
14365
+ const currentRNode = locateNextRNode(hydrationInfo, tView, lView, tNode);
14366
+ const ngContainerSize = getNgContainerSize(hydrationInfo, index);
14367
+ ngDevMode &&
14368
+ assertNumber(ngContainerSize, 'Unexpected state: hydrating an <ng-container>, ' +
14369
+ 'but no hydration info is available.');
14370
+ if (ngContainerSize > 0) {
14371
+ storeNgContainerInfo(hydrationInfo, index, currentRNode);
14372
+ comment = siblingAfter(ngContainerSize, currentRNode);
14373
+ }
14374
+ else {
14375
+ // If <ng-container> has no nodes,
14376
+ // the current node is an anchor (comment) node.
14377
+ comment = currentRNode;
14378
+ }
14379
+ ngDevMode && validateMatchingNode(comment, Node.COMMENT_NODE, null, lView, tNode);
14380
+ ngDevMode && markRNodeAsClaimedByHydration(comment);
14381
+ return comment;
14382
+ }
14383
+ function enableLocateOrCreateElementContainerNodeImpl() {
14384
+ _locateOrCreateElementContainerNode = locateOrCreateElementContainerNode;
14385
+ }
13823
14386
 
13824
14387
  /**
13825
14388
  * Returns the current OpaqueViewState instance.
@@ -13848,16 +14411,6 @@ function isPromise(obj) {
13848
14411
  function isSubscribable(obj) {
13849
14412
  return !!obj && typeof obj.subscribe === 'function';
13850
14413
  }
13851
- /**
13852
- * Determine if the argument is an Observable
13853
- *
13854
- * Strictly this tests that the `obj` is `Subscribable`, since `Observable`
13855
- * types need additional methods, such as `lift()`. But it is adequate for our
13856
- * needs since within the Angular framework code we only ever need to use the
13857
- * `subscribe()` method, and RxJS has mechanisms to wrap `Subscribable` objects
13858
- * into `Observable` as needed.
13859
- */
13860
- const isObservable = isSubscribable;
13861
14414
 
13862
14415
  /**
13863
14416
  * Adds an event listener to the current node.
@@ -14020,7 +14573,7 @@ function listenerInternal(tView, lView, renderer, tNode, eventName, listenerFn,
14020
14573
  const minifiedName = props[i + 1];
14021
14574
  const directiveInstance = lView[index];
14022
14575
  const output = directiveInstance[minifiedName];
14023
- if (ngDevMode && !isObservable(output)) {
14576
+ if (ngDevMode && !isSubscribable(output)) {
14024
14577
  throw new Error(`@Output ${minifiedName} not initialized in '${directiveInstance.constructor.name}'.`);
14025
14578
  }
14026
14579
  const subscription = output.subscribe(listenerFn);
@@ -16164,11 +16717,39 @@ function ɵɵtext(index, value = '') {
16164
16717
  const tNode = tView.firstCreatePass ?
16165
16718
  getOrCreateTNode(tView, adjustedIndex, 1 /* TNodeType.Text */, value, null) :
16166
16719
  tView.data[adjustedIndex];
16167
- const textNative = lView[adjustedIndex] = createTextNode(lView[RENDERER], value);
16168
- appendChild(tView, lView, textNative, tNode);
16720
+ const textNative = _locateOrCreateTextNode(tView, lView, tNode, value);
16721
+ lView[adjustedIndex] = textNative;
16722
+ if (wasLastNodeCreated()) {
16723
+ appendChild(tView, lView, textNative, tNode);
16724
+ }
16169
16725
  // Text nodes are self closing.
16170
16726
  setCurrentTNode(tNode, false);
16171
16727
  }
16728
+ let _locateOrCreateTextNode = (tView, lView, tNode, value) => {
16729
+ lastNodeWasCreated(true);
16730
+ return createTextNode(lView[RENDERER], value);
16731
+ };
16732
+ /**
16733
+ * Enables hydration code path (to lookup existing elements in DOM)
16734
+ * in addition to the regular creation mode of text nodes.
16735
+ */
16736
+ function locateOrCreateTextNodeImpl(tView, lView, tNode, value) {
16737
+ const hydrationInfo = lView[HYDRATION];
16738
+ const isNodeCreationMode = !hydrationInfo || isInSkipHydrationBlock();
16739
+ lastNodeWasCreated(isNodeCreationMode);
16740
+ // Regular creation mode.
16741
+ if (isNodeCreationMode) {
16742
+ return createTextNode(lView[RENDERER], value);
16743
+ }
16744
+ // Hydration mode, looking up an existing element in DOM.
16745
+ const textNative = locateNextRNode(hydrationInfo, tView, lView, tNode);
16746
+ ngDevMode && validateMatchingNode(textNative, Node.TEXT_NODE, null, lView, tNode);
16747
+ ngDevMode && markRNodeAsClaimedByHydration(textNative);
16748
+ return textNative;
16749
+ }
16750
+ function enableLocateOrCreateTextNodeImpl() {
16751
+ _locateOrCreateTextNode = locateOrCreateTextNodeImpl;
16752
+ }
16172
16753
 
16173
16754
  /**
16174
16755
  *
@@ -17846,7 +18427,7 @@ function getTIcu(tView, index) {
17846
18427
  if (value === null || typeof value === 'string')
17847
18428
  return null;
17848
18429
  if (ngDevMode &&
17849
- !(value.hasOwnProperty('tViews') || value.hasOwnProperty('currentCaseLViewIndex'))) {
18430
+ !(value.hasOwnProperty('tView') || value.hasOwnProperty('currentCaseLViewIndex'))) {
17850
18431
  throwError('We expect to get \'null\'|\'TIcu\'|\'TIcuContainer\', but got: ' + value);
17851
18432
  }
17852
18433
  // Here the `value.hasOwnProperty('currentCaseLViewIndex')` is a polymorphic read as it can be
@@ -17875,7 +18456,7 @@ function getTIcu(tView, index) {
17875
18456
  function setTIcu(tView, index, tIcu) {
17876
18457
  const tNode = tView.data[index];
17877
18458
  ngDevMode &&
17878
- assertEqual(tNode === null || tNode.hasOwnProperty('tViews'), true, 'We expect to get \'null\'|\'TIcuContainer\'');
18459
+ assertEqual(tNode === null || tNode.hasOwnProperty('tView'), true, 'We expect to get \'null\'|\'TIcuContainer\'');
17879
18460
  if (tNode === null) {
17880
18461
  tView.data[index] = tIcu;
17881
18462
  }
@@ -21170,8 +21751,8 @@ const R3TemplateRef = class TemplateRef extends ViewEngineTemplateRef {
21170
21751
  this.elementRef = elementRef;
21171
21752
  }
21172
21753
  createEmbeddedView(context, injector) {
21173
- const embeddedTView = this._declarationTContainer.tViews;
21174
- const embeddedLView = createLView(this._declarationLView, embeddedTView, context, 16 /* LViewFlags.CheckAlways */, null, embeddedTView.declTNode, null, null, null, null, injector || null);
21754
+ const embeddedTView = this._declarationTContainer.tView;
21755
+ const embeddedLView = createLView(this._declarationLView, embeddedTView, context, 16 /* LViewFlags.CheckAlways */, null, embeddedTView.declTNode, null, null, null, null, injector || null, null);
21175
21756
  const declarationLContainer = this._declarationLView[this._declarationTContainer.index];
21176
21757
  ngDevMode && assertLContainer(declarationLContainer);
21177
21758
  embeddedLView[DECLARATION_LCONTAINER] = declarationLContainer;
@@ -21200,7 +21781,7 @@ function injectTemplateRef() {
21200
21781
  */
21201
21782
  function createTemplateRef(hostTNode, hostLView) {
21202
21783
  if (hostTNode.type & 4 /* TNodeType.Container */) {
21203
- ngDevMode && assertDefined(hostTNode.tViews, 'TView must be allocated');
21784
+ ngDevMode && assertDefined(hostTNode.tView, 'TView must be allocated');
21204
21785
  return new R3TemplateRef(hostLView, hostTNode, createElementRef(hostTNode, hostLView));
21205
21786
  }
21206
21787
  return null;
@@ -22768,7 +23349,6 @@ function compileComponent(type, metadata) {
22768
23349
  encapsulation,
22769
23350
  interpolation: metadata.interpolation,
22770
23351
  viewProviders: metadata.viewProviders || null,
22771
- isStandalone: !!metadata.standalone,
22772
23352
  };
22773
23353
  compilationDepth++;
22774
23354
  try {
@@ -23293,10 +23873,6 @@ const NgModule = makeDecorator('NgModule', (ngModule) => ngModule, undefined, un
23293
23873
  * to be used by the decorator versions of these annotations.
23294
23874
  */
23295
23875
 
23296
- function noop(...args) {
23297
- // Do nothing.
23298
- }
23299
-
23300
23876
  /*
23301
23877
  * This file exists to support compilation of @angular/core in Ivy mode.
23302
23878
  *
@@ -23389,141 +23965,63 @@ const ITS_JUST_ANGULAR = true;
23389
23965
  */
23390
23966
  const APP_INITIALIZER = new InjectionToken('Application Initializer');
23391
23967
  /**
23392
- * A class that reflects the state of running {@link APP_INITIALIZER} functions.
23393
- *
23394
- * @publicApi
23395
- */
23396
- class ApplicationInitStatus {
23397
- constructor(appInits) {
23398
- this.appInits = appInits;
23399
- this.resolve = noop;
23400
- this.reject = noop;
23401
- this.initialized = false;
23402
- this.done = false;
23403
- // TODO: Throw RuntimeErrorCode.INVALID_MULTI_PROVIDER if appInits is not an array
23404
- this.donePromise = new Promise((res, rej) => {
23405
- this.resolve = res;
23406
- this.reject = rej;
23407
- });
23408
- }
23409
- /** @internal */
23410
- runInitializers() {
23411
- if (this.initialized) {
23412
- return;
23413
- }
23414
- const asyncInitPromises = [];
23415
- const complete = () => {
23416
- this.done = true;
23417
- this.resolve();
23418
- };
23419
- if (this.appInits) {
23420
- for (let i = 0; i < this.appInits.length; i++) {
23421
- const initResult = this.appInits[i]();
23422
- if (isPromise(initResult)) {
23423
- asyncInitPromises.push(initResult);
23424
- }
23425
- else if (isObservable(initResult)) {
23426
- const observableAsPromise = new Promise((resolve, reject) => {
23427
- initResult.subscribe({ complete: resolve, error: reject });
23428
- });
23429
- asyncInitPromises.push(observableAsPromise);
23430
- }
23431
- }
23432
- }
23433
- Promise.all(asyncInitPromises)
23434
- .then(() => {
23435
- complete();
23436
- })
23437
- .catch(e => {
23438
- this.reject(e);
23439
- });
23440
- if (asyncInitPromises.length === 0) {
23441
- complete();
23442
- }
23443
- this.initialized = true;
23444
- }
23445
- }
23446
- ApplicationInitStatus.ɵfac = function ApplicationInitStatus_Factory(t) { return new (t || ApplicationInitStatus)(ɵɵinject(APP_INITIALIZER, 8)); };
23447
- ApplicationInitStatus.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: ApplicationInitStatus, factory: ApplicationInitStatus.ɵfac, providedIn: 'root' });
23448
- (function () { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ApplicationInitStatus, [{
23449
- type: Injectable,
23450
- args: [{ providedIn: 'root' }]
23451
- }], function () { return [{ type: undefined, decorators: [{
23452
- type: Inject,
23453
- args: [APP_INITIALIZER]
23454
- }, {
23455
- type: Optional
23456
- }] }]; }, null); })();
23457
-
23458
- /**
23459
- * A [DI token](guide/glossary#di-token "DI token definition") representing a unique string ID, used
23460
- * primarily for prefixing application attributes and CSS styles when
23461
- * {@link ViewEncapsulation#Emulated ViewEncapsulation.Emulated} is being used.
23462
- *
23463
- * BY default, the value is randomly generated and assigned to the application by Angular.
23464
- * To provide a custom ID value, use a DI provider <!-- TODO: provider --> to configure
23465
- * the root {@link Injector} that uses this token.
23466
- *
23467
- * @publicApi
23468
- */
23469
- const APP_ID = new InjectionToken('AppId', {
23470
- providedIn: 'root',
23471
- factory: _appIdRandomProviderFactory,
23472
- });
23473
- function _appIdRandomProviderFactory() {
23474
- return `${_randomChar()}${_randomChar()}${_randomChar()}`;
23475
- }
23476
- /**
23477
- * Providers that generate a random `APP_ID_TOKEN`.
23478
- * @publicApi
23479
- */
23480
- const APP_ID_RANDOM_PROVIDER = {
23481
- provide: APP_ID,
23482
- useFactory: _appIdRandomProviderFactory,
23483
- deps: [],
23484
- };
23485
- function _randomChar() {
23486
- return String.fromCharCode(97 + Math.floor(Math.random() * 25));
23487
- }
23488
- /**
23489
- * A function that is executed when a platform is initialized.
23490
- * @publicApi
23491
- */
23492
- const PLATFORM_INITIALIZER = new InjectionToken('Platform Initializer');
23493
- /**
23494
- * A token that indicates an opaque platform ID.
23495
- * @publicApi
23496
- */
23497
- const PLATFORM_ID = new InjectionToken('Platform ID', {
23498
- providedIn: 'platform',
23499
- factory: () => 'unknown', // set a default platform name, when none set explicitly
23500
- });
23501
- /**
23502
- * A [DI token](guide/glossary#di-token "DI token definition") that provides a set of callbacks to
23503
- * be called for every component that is bootstrapped.
23504
- *
23505
- * Each callback must take a `ComponentRef` instance and return nothing.
23506
- *
23507
- * `(componentRef: ComponentRef) => void`
23508
- *
23509
- * @publicApi
23510
- */
23511
- const APP_BOOTSTRAP_LISTENER = new InjectionToken('appBootstrapListener');
23512
- /**
23513
- * A [DI token](guide/glossary#di-token "DI token definition") that indicates the root directory of
23514
- * the application
23515
- * @publicApi
23516
- */
23517
- const PACKAGE_ROOT_URL = new InjectionToken('Application Packages Root URL');
23518
- // We keep this token here, rather than the animations package, so that modules that only care
23519
- // about which animations module is loaded (e.g. the CDK) can retrieve it without having to
23520
- // include extra dependencies. See #44970 for more context.
23521
- /**
23522
- * A [DI token](guide/glossary#di-token "DI token definition") that indicates which animations
23523
- * module has been loaded.
23968
+ * A class that reflects the state of running {@link APP_INITIALIZER} functions.
23969
+ *
23524
23970
  * @publicApi
23525
23971
  */
23526
- const ANIMATION_MODULE_TYPE = new InjectionToken('AnimationModuleType');
23972
+ class ApplicationInitStatus {
23973
+ constructor() {
23974
+ this.initialized = false;
23975
+ this.done = false;
23976
+ this.donePromise = new Promise((res, rej) => {
23977
+ this.resolve = res;
23978
+ this.reject = rej;
23979
+ });
23980
+ // TODO: Throw RuntimeErrorCode.INVALID_MULTI_PROVIDER if appInits is not an array
23981
+ this.appInits = inject(APP_INITIALIZER, { optional: true }) ?? [];
23982
+ }
23983
+ /** @internal */
23984
+ runInitializers() {
23985
+ if (this.initialized) {
23986
+ return;
23987
+ }
23988
+ const asyncInitPromises = [];
23989
+ for (const appInits of this.appInits) {
23990
+ const initResult = appInits();
23991
+ if (isPromise(initResult)) {
23992
+ asyncInitPromises.push(initResult);
23993
+ }
23994
+ else if (isSubscribable(initResult)) {
23995
+ const observableAsPromise = new Promise((resolve, reject) => {
23996
+ initResult.subscribe({ complete: resolve, error: reject });
23997
+ });
23998
+ asyncInitPromises.push(observableAsPromise);
23999
+ }
24000
+ }
24001
+ const complete = () => {
24002
+ // @ts-expect-error overwriting a readonly
24003
+ this.done = true;
24004
+ this.resolve();
24005
+ };
24006
+ Promise.all(asyncInitPromises)
24007
+ .then(() => {
24008
+ complete();
24009
+ })
24010
+ .catch(e => {
24011
+ this.reject(e);
24012
+ });
24013
+ if (asyncInitPromises.length === 0) {
24014
+ complete();
24015
+ }
24016
+ this.initialized = true;
24017
+ }
24018
+ }
24019
+ ApplicationInitStatus.ɵfac = function ApplicationInitStatus_Factory(t) { return new (t || ApplicationInitStatus)(); };
24020
+ ApplicationInitStatus.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: ApplicationInitStatus, factory: ApplicationInitStatus.ɵfac, providedIn: 'root' });
24021
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ApplicationInitStatus, [{
24022
+ type: Injectable,
24023
+ args: [{ providedIn: 'root' }]
24024
+ }], null, null); })();
23527
24025
 
23528
24026
  class Console {
23529
24027
  log(message) {
@@ -23914,6 +24412,10 @@ function scheduleMicroTask(fn) {
23914
24412
  }
23915
24413
  }
23916
24414
 
24415
+ function noop(...args) {
24416
+ // Do nothing.
24417
+ }
24418
+
23917
24419
  function getNativeRequestAnimationFrame() {
23918
24420
  let nativeRequestAnimationFrame = _global['requestAnimationFrame'];
23919
24421
  let nativeCancelAnimationFrame = _global['cancelAnimationFrame'];
@@ -24634,6 +25136,7 @@ function setTestabilityGetter(getter) {
24634
25136
  }
24635
25137
  let _testabilityGetter;
24636
25138
 
25139
+ const NG_DEV_MODE = typeof ngDevMode === 'undefined' || ngDevMode;
24637
25140
  let _platformInjector = null;
24638
25141
  /**
24639
25142
  * Internal token to indicate whether having multiple bootstrapped platform should be allowed (only
@@ -24647,7 +25150,17 @@ const ALLOW_MULTIPLE_PLATFORMS = new InjectionToken('AllowMultipleToken');
24647
25150
  * entire class tree-shakeable.
24648
25151
  */
24649
25152
  const PLATFORM_DESTROY_LISTENERS = new InjectionToken('PlatformDestroyListeners');
24650
- const NG_DEV_MODE = typeof ngDevMode === 'undefined' || ngDevMode;
25153
+ /**
25154
+ * A [DI token](guide/glossary#di-token "DI token definition") that provides a set of callbacks to
25155
+ * be called for every component that is bootstrapped.
25156
+ *
25157
+ * Each callback must take a `ComponentRef` instance and return nothing.
25158
+ *
25159
+ * `(componentRef: ComponentRef) => void`
25160
+ *
25161
+ * @publicApi
25162
+ */
25163
+ const APP_BOOTSTRAP_LISTENER = new InjectionToken('appBootstrapListener');
24651
25164
  function compileNgModuleFactory(injector, options, moduleType) {
24652
25165
  ngDevMode && assertNgModuleType(moduleType);
24653
25166
  const moduleFactory = new NgModuleFactory(moduleType);
@@ -24666,7 +25179,7 @@ function compileNgModuleFactory(injector, options, moduleType) {
24666
25179
  if (isComponentResourceResolutionQueueEmpty()) {
24667
25180
  return Promise.resolve(moduleFactory);
24668
25181
  }
24669
- const compilerProviders = _mergeArrays(compilerOptions.map(o => o.providers));
25182
+ const compilerProviders = compilerOptions.flatMap((option) => option.providers ?? []);
24670
25183
  // In case there are no compiler providers, we just return the module factory as
24671
25184
  // there won't be any resource loader. This can happen with Ivy, because AOT compiled
24672
25185
  // modules can be still passed through "bootstrapModule". In that case we shouldn't
@@ -24739,9 +25252,7 @@ function createOrReusePlatformInjector(providers = []) {
24739
25252
  }
24740
25253
  function runPlatformInitializers(injector) {
24741
25254
  const inits = injector.get(PLATFORM_INITIALIZER, null);
24742
- if (inits) {
24743
- inits.forEach((init) => init());
24744
- }
25255
+ inits?.forEach((init) => init());
24745
25256
  }
24746
25257
  /**
24747
25258
  * Internal create application API that implements the core application creation logic and optional
@@ -24766,7 +25277,7 @@ function internalCreateApplication(config) {
24766
25277
  // bootstrap level as well as providers passed to the bootstrap call by a user.
24767
25278
  const allAppProviders = [
24768
25279
  { provide: NgZone, useValue: ngZone },
24769
- ...(appProviders || []), //
25280
+ ...(appProviders || []),
24770
25281
  ];
24771
25282
  const envInjector = createEnvironmentInjector(allAppProviders, platformInjector, 'Environment Injector');
24772
25283
  const exceptionHandler = envInjector.get(ErrorHandler, null);
@@ -25035,19 +25546,18 @@ PlatformRef.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: PlatformRef, fa
25035
25546
  function getNgZoneOptions(options) {
25036
25547
  return {
25037
25548
  enableLongStackTrace: typeof ngDevMode === 'undefined' ? false : !!ngDevMode,
25038
- shouldCoalesceEventChangeDetection: !!(options && options.ngZoneEventCoalescing) || false,
25039
- shouldCoalesceRunChangeDetection: !!(options && options.ngZoneRunCoalescing) || false,
25549
+ shouldCoalesceEventChangeDetection: options?.ngZoneEventCoalescing ?? false,
25550
+ shouldCoalesceRunChangeDetection: options?.ngZoneRunCoalescing ?? false,
25040
25551
  };
25041
25552
  }
25042
- function getNgZone(ngZoneToUse, options) {
25043
- let ngZone;
25553
+ function getNgZone(ngZoneToUse = 'zone.js', options) {
25044
25554
  if (ngZoneToUse === 'noop') {
25045
- ngZone = new NoopNgZone();
25555
+ return new NoopNgZone();
25046
25556
  }
25047
- else {
25048
- ngZone = (ngZoneToUse === 'zone.js' ? undefined : ngZoneToUse) || new NgZone(options);
25557
+ if (ngZoneToUse === 'zone.js') {
25558
+ return new NgZone(options);
25049
25559
  }
25050
- return ngZone;
25560
+ return ngZoneToUse;
25051
25561
  }
25052
25562
  function _callAndReportToErrorHandler(errorHandler, ngZone, callback) {
25053
25563
  try {
@@ -25069,12 +25579,9 @@ function _callAndReportToErrorHandler(errorHandler, ngZone, callback) {
25069
25579
  }
25070
25580
  function optionsReducer(dst, objs) {
25071
25581
  if (Array.isArray(objs)) {
25072
- dst = objs.reduce(optionsReducer, dst);
25073
- }
25074
- else {
25075
- dst = { ...dst, ...objs };
25582
+ return objs.reduce(optionsReducer, dst);
25076
25583
  }
25077
- return dst;
25584
+ return { ...dst, ...objs };
25078
25585
  }
25079
25586
  /**
25080
25587
  * A reference to an Angular application running on a page.
@@ -25189,11 +25696,12 @@ class ApplicationRef {
25189
25696
  this._exceptionHandler = _exceptionHandler;
25190
25697
  /** @internal */
25191
25698
  this._bootstrapListeners = [];
25192
- this._views = [];
25193
25699
  this._runningTick = false;
25194
25700
  this._stable = true;
25195
25701
  this._destroyed = false;
25196
25702
  this._destroyListeners = [];
25703
+ /** @internal */
25704
+ this._views = [];
25197
25705
  /**
25198
25706
  * Get a list of component types registered to this application.
25199
25707
  * This list is populated even before the component is created.
@@ -25250,8 +25758,7 @@ class ApplicationRef {
25250
25758
  unstableSub.unsubscribe();
25251
25759
  };
25252
25760
  });
25253
- this.isStable =
25254
- merge$1(isCurrentlyStable, isStable.pipe(share()));
25761
+ this.isStable = merge$1(isCurrentlyStable, isStable.pipe(share()));
25255
25762
  }
25256
25763
  /**
25257
25764
  * Bootstrap a component onto the element identified by its selector or, optionally, to a
@@ -25480,11 +25987,6 @@ function _lastDefined(args) {
25480
25987
  }
25481
25988
  return undefined;
25482
25989
  }
25483
- function _mergeArrays(parts) {
25484
- const result = [];
25485
- parts.forEach((part) => part && result.push(...part));
25486
- return result;
25487
- }
25488
25990
 
25489
25991
  /**
25490
25992
  * Returns whether Angular is in development mode.
@@ -26291,10 +26793,6 @@ function getDebugNode(nativeNode) {
26291
26793
  }
26292
26794
  return null;
26293
26795
  }
26294
- // TODO: cleanup all references to this function and remove it.
26295
- function getDebugNodeR2(_nativeNode) {
26296
- return null;
26297
- }
26298
26796
  function getAllDebugNodes() {
26299
26797
  return Array.from(_nativeNodeToDebugNode.values());
26300
26798
  }
@@ -27382,139 +27880,234 @@ ApplicationModule.ɵinj = /*@__PURE__*/ ɵɵdefineInjector({});
27382
27880
  type: NgModule
27383
27881
  }], function () { return [{ type: ApplicationRef }]; }, null); })();
27384
27882
 
27385
- function escapeTransferStateContent(text) {
27386
- const escapedText = {
27387
- '&': '&a;',
27388
- '"': '&q;',
27389
- '\'': '&s;',
27390
- '<': '&l;',
27391
- '>': '&g;',
27392
- };
27393
- return text.replace(/[&"'<>]/g, s => escapedText[s]);
27883
+ /**
27884
+ * A collection that tracks all serialized views (`ngh` DOM annotations)
27885
+ * to avoid duplication. An attempt to add a duplicate view results in the
27886
+ * collection returning the index of the previously collected serialized view.
27887
+ * This reduces the number of annotations needed for a given page.
27888
+ */
27889
+ class SerializedViewCollection {
27890
+ constructor() {
27891
+ this.views = [];
27892
+ this.indexByContent = new Map();
27893
+ }
27894
+ add(serializedView) {
27895
+ const viewAsString = JSON.stringify(serializedView);
27896
+ if (!this.indexByContent.has(viewAsString)) {
27897
+ const index = this.views.length;
27898
+ this.views.push(serializedView);
27899
+ this.indexByContent.set(viewAsString, index);
27900
+ return index;
27901
+ }
27902
+ return this.indexByContent.get(viewAsString);
27903
+ }
27904
+ getAll() {
27905
+ return this.views;
27906
+ }
27394
27907
  }
27395
- function unescapeTransferStateContent(text) {
27396
- const unescapedText = {
27397
- '&a;': '&',
27398
- '&q;': '"',
27399
- '&s;': '\'',
27400
- '&l;': '<',
27401
- '&g;': '>',
27402
- };
27403
- return text.replace(/&[^;]+;/g, s => unescapedText[s]);
27908
+ /**
27909
+ * Computes the number of root nodes in a given view
27910
+ * (or child nodes in a given container if a tNode is provided).
27911
+ */
27912
+ function calcNumRootNodes(tView, lView, tNode) {
27913
+ const rootNodes = [];
27914
+ collectNativeNodes(tView, lView, tNode, rootNodes);
27915
+ return rootNodes.length;
27404
27916
  }
27405
27917
  /**
27406
- * Create a `StateKey<T>` that can be used to store value of type T with `TransferState`.
27918
+ * Annotates all components bootstrapped in a given ApplicationRef
27919
+ * with info needed for hydration.
27407
27920
  *
27408
- * Example:
27921
+ * @param appRef An instance of an ApplicationRef.
27922
+ * @param doc A reference to the current Document instance.
27923
+ */
27924
+ function annotateForHydration(appRef, doc) {
27925
+ const serializedViewCollection = new SerializedViewCollection();
27926
+ const viewRefs = appRef._views;
27927
+ for (const viewRef of viewRefs) {
27928
+ const lView = getComponentLViewForHydration(viewRef);
27929
+ // An `lView` might be `null` if a `ViewRef` represents
27930
+ // an embedded view (not a component view).
27931
+ if (lView !== null) {
27932
+ const hostElement = lView[HOST];
27933
+ if (hostElement) {
27934
+ const context = {
27935
+ serializedViewCollection,
27936
+ };
27937
+ annotateHostElementForHydration(hostElement, lView, context);
27938
+ }
27939
+ }
27940
+ }
27941
+ const allSerializedViews = serializedViewCollection.getAll();
27942
+ if (allSerializedViews.length > 0) {
27943
+ const transferState = appRef.injector.get(TransferState);
27944
+ transferState.set(NGH_DATA_KEY, allSerializedViews);
27945
+ }
27946
+ }
27947
+ /**
27948
+ * Serializes the lView data into a SerializedView object that will later be added
27949
+ * to the TransferState storage and referenced using the `ngh` attribute on a host
27950
+ * element.
27409
27951
  *
27410
- * ```
27411
- * const COUNTER_KEY = makeStateKey<number>('counter');
27412
- * let value = 10;
27952
+ * @param lView the lView we are serializing
27953
+ * @param context the hydration context
27954
+ * @returns the `SerializedView` object containing the data to be added to the host node
27955
+ */
27956
+ function serializeLView(lView, context) {
27957
+ const ngh = {};
27958
+ const tView = lView[TVIEW];
27959
+ // Iterate over DOM element references in an LView.
27960
+ for (let i = HEADER_OFFSET; i < tView.bindingStartIndex; i++) {
27961
+ const tNode = tView.data[i];
27962
+ const noOffsetIndex = i - HEADER_OFFSET;
27963
+ // Local refs (e.g. <div #localRef>) take up an extra slot in LViews
27964
+ // to store the same element. In this case, there is no information in
27965
+ // a corresponding slot in TNode data structure. If that's the case, just
27966
+ // skip this slot and move to the next one.
27967
+ if (!tNode) {
27968
+ continue;
27969
+ }
27970
+ if (isLContainer(lView[i])) {
27971
+ // TODO: serialization of LContainers will be added
27972
+ // in followup PRs.
27973
+ }
27974
+ else if (Array.isArray(lView[i])) {
27975
+ // This is a component, annotate the host node with an `ngh` attribute.
27976
+ const targetNode = unwrapRNode(lView[i][HOST]);
27977
+ if (!targetNode.hasAttribute(SKIP_HYDRATION_ATTR_NAME)) {
27978
+ annotateHostElementForHydration(targetNode, lView[i], context);
27979
+ }
27980
+ }
27981
+ else {
27982
+ // <ng-container> case
27983
+ if (tNode.type & 8 /* TNodeType.ElementContainer */) {
27984
+ // An <ng-container> is represented by the number of
27985
+ // top-level nodes. This information is needed to skip over
27986
+ // those nodes to reach a corresponding anchor node (comment node).
27987
+ ngh[ELEMENT_CONTAINERS] ?? (ngh[ELEMENT_CONTAINERS] = {});
27988
+ ngh[ELEMENT_CONTAINERS][noOffsetIndex] = calcNumRootNodes(tView, lView, tNode.child);
27989
+ }
27990
+ }
27991
+ }
27992
+ return ngh;
27993
+ }
27994
+ /**
27995
+ * Physically adds the `ngh` attribute and serialized data to the host element.
27413
27996
  *
27414
- * transferState.set(COUNTER_KEY, value);
27415
- * ```
27997
+ * @param element The Host element to be annotated
27998
+ * @param lView The associated LView
27999
+ * @param context The hydration context
28000
+ */
28001
+ function annotateHostElementForHydration(element, lView, context) {
28002
+ const ngh = serializeLView(lView, context);
28003
+ const index = context.serializedViewCollection.add(ngh);
28004
+ const renderer = lView[RENDERER];
28005
+ renderer.setAttribute(element, NGH_ATTR_NAME, index.toString());
28006
+ }
28007
+
28008
+ /**
28009
+ * Indicates whether the hydration-related code was added,
28010
+ * prevents adding it multiple times.
28011
+ */
28012
+ let isHydrationSupportEnabled = false;
28013
+ /**
28014
+ * Brings the necessary hydration code in tree-shakable manner.
28015
+ * The code is only present when the `provideHydrationSupport` is
28016
+ * invoked. Otherwise, this code is tree-shaken away during the
28017
+ * build optimization step.
27416
28018
  *
27417
- * @publicApi
28019
+ * This technique allows us to swap implementations of methods so
28020
+ * tree shaking works appropriately when hydration is disabled or
28021
+ * enabled. It brings in the appropriate version of the method that
28022
+ * supports hydration only when enabled.
27418
28023
  */
27419
- function makeStateKey(key) {
27420
- return key;
28024
+ function enableHydrationRuntimeSupport() {
28025
+ if (!isHydrationSupportEnabled) {
28026
+ isHydrationSupportEnabled = true;
28027
+ enableRetrieveHydrationInfoImpl();
28028
+ enableLocateOrCreateElementNodeImpl();
28029
+ enableLocateOrCreateTextNodeImpl();
28030
+ enableLocateOrCreateElementContainerNodeImpl();
28031
+ }
27421
28032
  }
27422
28033
  /**
27423
- * A key value store that is transferred from the application on the server side to the application
27424
- * on the client side.
28034
+ * Detects whether the code is invoked in a browser.
28035
+ * Later on, this check should be replaced with a tree-shakable
28036
+ * flag (e.g. `!isServer`).
28037
+ */
28038
+ function isBrowser() {
28039
+ return inject(PLATFORM_ID) === 'browser';
28040
+ }
28041
+ /**
28042
+ * Returns a set of providers required to setup hydration support
28043
+ * for an application that is server side rendered.
27425
28044
  *
27426
- * The `TransferState` is available as an injectable token.
27427
- * On the client, just inject this token using DI and use it, it will be lazily initialized.
27428
- * On the server it's already included if `renderApplication` function is used. Otherwise, import
27429
- * the `ServerTransferStateModule` module to make the `TransferState` available.
28045
+ * ## NgModule-based bootstrap
27430
28046
  *
27431
- * The values in the store are serialized/deserialized using JSON.stringify/JSON.parse. So only
27432
- * boolean, number, string, null and non-class objects will be serialized and deserialized in a
27433
- * non-lossy manner.
28047
+ * You can add the function call to the root AppModule of an application:
28048
+ * ```
28049
+ * import {provideHydrationSupport} from '@angular/core';
28050
+ *
28051
+ * @NgModule({
28052
+ * providers: [
28053
+ * // ... other providers ...
28054
+ * provideHydrationSupport()
28055
+ * ],
28056
+ * declarations: [AppComponent],
28057
+ * bootstrap: [AppComponent]
28058
+ * })
28059
+ * class AppModule {}
28060
+ * ```
28061
+ *
28062
+ * ## Standalone-based bootstrap
28063
+ *
28064
+ * Add the function to the `bootstrapApplication` call:
28065
+ * ```
28066
+ * import {provideHydrationSupport} from '@angular/core';
28067
+ *
28068
+ * bootstrapApplication(RootComponent, {
28069
+ * providers: [
28070
+ * // ... other providers ...
28071
+ * provideHydrationSupport()
28072
+ * ]
28073
+ * });
28074
+ * ```
28075
+ *
28076
+ * The function sets up an internal flag that would be recognized during
28077
+ * the server side rendering time as well, so there is no need to
28078
+ * configure or change anything in NgUniversal to enable the feature.
27434
28079
  *
27435
28080
  * @publicApi
28081
+ * @developerPreview
27436
28082
  */
27437
- class TransferState {
27438
- constructor() {
27439
- this.store = {};
27440
- this.onSerializeCallbacks = {};
27441
- this.store = retrieveTransferredState(getDocument(), inject(APP_ID));
27442
- }
27443
- /**
27444
- * Get the value corresponding to a key. Return `defaultValue` if key is not found.
27445
- */
27446
- get(key, defaultValue) {
27447
- return this.store[key] !== undefined ? this.store[key] : defaultValue;
27448
- }
27449
- /**
27450
- * Set the value corresponding to a key.
27451
- */
27452
- set(key, value) {
27453
- this.store[key] = value;
27454
- }
27455
- /**
27456
- * Remove a key from the store.
27457
- */
27458
- remove(key) {
27459
- delete this.store[key];
27460
- }
27461
- /**
27462
- * Test whether a key exists in the store.
27463
- */
27464
- hasKey(key) {
27465
- return this.store.hasOwnProperty(key);
27466
- }
27467
- /**
27468
- * Indicates whether the state is empty.
27469
- */
27470
- get isEmpty() {
27471
- return Object.keys(this.store).length === 0;
27472
- }
27473
- /**
27474
- * Register a callback to provide the value for a key when `toJson` is called.
27475
- */
27476
- onSerialize(key, callback) {
27477
- this.onSerializeCallbacks[key] = callback;
27478
- }
27479
- /**
27480
- * Serialize the current state of the store to JSON.
27481
- */
27482
- toJson() {
27483
- // Call the onSerialize callbacks and put those values into the store.
27484
- for (const key in this.onSerializeCallbacks) {
27485
- if (this.onSerializeCallbacks.hasOwnProperty(key)) {
27486
- try {
27487
- this.store[key] = this.onSerializeCallbacks[key]();
27488
- }
27489
- catch (e) {
27490
- console.warn('Exception in onSerialize callback: ', e);
28083
+ function provideHydrationSupport() {
28084
+ return makeEnvironmentProviders([
28085
+ {
28086
+ provide: ENVIRONMENT_INITIALIZER,
28087
+ useValue: () => {
28088
+ // Since this function is used across both server and client,
28089
+ // make sure that the runtime code is only added when invoked
28090
+ // on the client. Moving forward, the `isBrowser` check should
28091
+ // be replaced with a tree-shakable alternative (e.g. `isServer`
28092
+ // flag).
28093
+ if (isBrowser()) {
28094
+ enableHydrationRuntimeSupport();
27491
28095
  }
27492
- }
27493
- }
27494
- return JSON.stringify(this.store);
27495
- }
27496
- }
27497
- TransferState.ɵfac = function TransferState_Factory(t) { return new (t || TransferState)(); };
27498
- TransferState.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: TransferState, factory: TransferState.ɵfac, providedIn: 'root' });
27499
- (function () { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(TransferState, [{
27500
- type: Injectable,
27501
- args: [{ providedIn: 'root' }]
27502
- }], function () { return []; }, null); })();
27503
- function retrieveTransferredState(doc, appId) {
27504
- // Locate the script tag with the JSON data transferred from the server.
27505
- // The id of the script tag is set to the Angular appId + 'state'.
27506
- const script = doc.getElementById(appId + '-state');
27507
- let initialState = {};
27508
- if (script && script.textContent) {
27509
- try {
27510
- // Avoid using any here as it triggers lint errors in google3 (any is not allowed).
27511
- initialState = JSON.parse(unescapeTransferStateContent(script.textContent));
27512
- }
27513
- catch (e) {
27514
- console.warn('Exception while restoring TransferState for app ' + appId, e);
28096
+ },
28097
+ multi: true,
28098
+ },
28099
+ {
28100
+ provide: IS_HYDRATION_FEATURE_ENABLED,
28101
+ useValue: true,
28102
+ },
28103
+ {
28104
+ provide: PRESERVE_HOST_CONTENT,
28105
+ // Preserve host element content only in a browser
28106
+ // environment. On a server, an application is rendered
28107
+ // from scratch, so the host content needs to be empty.
28108
+ useFactory: () => isBrowser(),
27515
28109
  }
27516
- }
27517
- return initialState;
28110
+ ]);
27518
28111
  }
27519
28112
 
27520
28113
  /** Coerces a value (typically a string) to a boolean. */
@@ -27522,9 +28115,6 @@ function coerceToBoolean(value) {
27522
28115
  return typeof value === 'boolean' ? value : (value != null && value !== 'false');
27523
28116
  }
27524
28117
 
27525
- // TODO(alxhub): allows tests to compile, can be removed when tests have been updated.
27526
- const ɵivyEnabled = true;
27527
-
27528
28118
  /**
27529
28119
  * Compiles a partial directive declaration object into a full directive definition object.
27530
28120
  *
@@ -28225,6 +28815,20 @@ function reflectComponentType(component) {
28225
28815
  };
28226
28816
  }
28227
28817
 
28818
+ /**
28819
+ * Merge multiple application configurations from left to right.
28820
+ *
28821
+ * @param configs Two or more configurations to be merged.
28822
+ * @returns A merged [ApplicationConfig](api/core/ApplicationConfig).
28823
+ *
28824
+ * @publicApi
28825
+ */
28826
+ function mergeApplicationConfig(...configs) {
28827
+ return configs.reduce((prev, curr) => {
28828
+ return Object.assign(prev, curr, { providers: [...prev.providers, ...curr.providers] });
28829
+ }, { providers: [] });
28830
+ }
28831
+
28228
28832
  /**
28229
28833
  * @module
28230
28834
  * @description
@@ -28260,5 +28864,5 @@ if (typeof ngDevMode !== 'undefined' && ngDevMode) {
28260
28864
  * Generated bundle index. Do not edit.
28261
28865
  */
28262
28866
 
28263
- 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, 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, TransferState as ɵTransferState, 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, escapeTransferStateContent as ɵescapeTransferStateContent, 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, isNgModule as ɵisNgModule, isObservable as ɵisObservable, isPromise as ɵisPromise, isSubscribable as ɵisSubscribable, ɵivyEnabled, makeDecorator as ɵmakeDecorator, makeStateKey as ɵmakeStateKey, 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, 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 };
28867
+ 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 };
28264
28868
  //# sourceMappingURL=core.mjs.map