@angular/core 17.0.0-next.3 → 17.0.0-next.5

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/esm2022/src/core.mjs +2 -2
  2. package/esm2022/src/core_private_export.mjs +3 -1
  3. package/esm2022/src/core_reactivity_export_internal.mjs +3 -3
  4. package/esm2022/src/core_render3_private_export.mjs +3 -2
  5. package/esm2022/src/di/initializer_token.mjs +1 -1
  6. package/esm2022/src/di/internal_tokens.mjs +1 -1
  7. package/esm2022/src/di/r3_injector.mjs +3 -4
  8. package/esm2022/src/errors.mjs +1 -1
  9. package/esm2022/src/metadata/directives.mjs +1 -1
  10. package/esm2022/src/metadata/ng_module_def.mjs +1 -1
  11. package/esm2022/src/metadata/resource_loading.mjs +27 -14
  12. package/esm2022/src/render3/after_render_hooks.mjs +123 -30
  13. package/esm2022/src/render3/component_ref.mjs +3 -4
  14. package/esm2022/src/render3/deps_tracker/api.mjs +1 -1
  15. package/esm2022/src/render3/deps_tracker/deps_tracker.mjs +13 -3
  16. package/esm2022/src/render3/index.mjs +2 -2
  17. package/esm2022/src/render3/instructions/change_detection.mjs +3 -3
  18. package/esm2022/src/render3/instructions/defer.mjs +121 -40
  19. package/esm2022/src/render3/interfaces/defer.mjs +66 -1
  20. package/esm2022/src/render3/interfaces/definition.mjs +1 -1
  21. package/esm2022/src/render3/interfaces/view.mjs +1 -1
  22. package/esm2022/src/render3/jit/directive.mjs +6 -2
  23. package/esm2022/src/render3/local_compilation.mjs +8 -2
  24. package/esm2022/src/render3/pipe.mjs +2 -1
  25. package/esm2022/src/render3/reactive_lview_consumer.mjs +1 -1
  26. package/esm2022/src/render3/reactivity/effect.mjs +134 -43
  27. package/esm2022/src/render3/scope.mjs +10 -4
  28. package/esm2022/src/signals/index.mjs +2 -2
  29. package/esm2022/src/signals/src/api.mjs +2 -2
  30. package/esm2022/src/signals/src/computed.mjs +50 -45
  31. package/esm2022/src/signals/src/graph.mjs +10 -2
  32. package/esm2022/src/signals/src/signal.mjs +11 -6
  33. package/esm2022/src/signals/src/watch.mjs +40 -12
  34. package/esm2022/src/version.mjs +1 -1
  35. package/esm2022/testing/src/component_fixture.mjs +20 -3
  36. package/esm2022/testing/src/defer.mjs +84 -0
  37. package/esm2022/testing/src/logger.mjs +3 -3
  38. package/esm2022/testing/src/test_bed.mjs +24 -3
  39. package/esm2022/testing/src/test_bed_common.mjs +1 -1
  40. package/esm2022/testing/src/test_bed_compiler.mjs +7 -4
  41. package/esm2022/testing/src/testing.mjs +3 -1
  42. package/fesm2022/core.mjs +694 -285
  43. package/fesm2022/core.mjs.map +1 -1
  44. package/fesm2022/rxjs-interop.mjs +1 -1
  45. package/fesm2022/testing.mjs +124 -7
  46. package/fesm2022/testing.mjs.map +1 -1
  47. package/index.d.ts +260 -25
  48. package/package.json +3 -3
  49. package/rxjs-interop/index.d.ts +1 -1
  50. package/schematics/migrations/guard-and-resolve-interfaces/bundle.js +13 -13
  51. package/schematics/migrations/remove-module-id/bundle.js +14 -14
  52. package/schematics/ng-generate/standalone-migration/bundle.js +1962 -1303
  53. package/schematics/ng-generate/standalone-migration/bundle.js.map +4 -4
  54. package/testing/index.d.ts +50 -2
package/fesm2022/core.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v17.0.0-next.3
2
+ * @license Angular v17.0.0-next.5
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -2264,7 +2264,7 @@ function getFactoryDef(type, throwNotFound) {
2264
2264
  *
2265
2265
  * This can be used to auto-unwrap signals in various cases, or to auto-wrap non-signal values.
2266
2266
  */
2267
- const SIGNAL = Symbol('SIGNAL');
2267
+ const SIGNAL = /* @__PURE__ */ Symbol('SIGNAL');
2268
2268
  /**
2269
2269
  * Checks if the given `value` is a reactive `Signal`.
2270
2270
  *
@@ -2304,6 +2304,9 @@ function setActiveConsumer(consumer) {
2304
2304
  activeConsumer = consumer;
2305
2305
  return prev;
2306
2306
  }
2307
+ function isInNotificationPhase() {
2308
+ return inNotificationPhase;
2309
+ }
2307
2310
  const REACTIVE_NODE = {
2308
2311
  version: 0,
2309
2312
  dirty: false,
@@ -2442,7 +2445,9 @@ function consumerAfterComputation(node, prevConsumer) {
2442
2445
  }
2443
2446
  }
2444
2447
  // Truncate the producer tracking arrays.
2445
- for (let i = node.nextProducerIndex; i < node.producerNode.length; i++) {
2448
+ // Perf note: this is essentially truncating the length to `node.nextProducerIndex`, but
2449
+ // benchmarking has shown that individual pop operations are faster.
2450
+ while (node.producerNode.length > node.nextProducerIndex) {
2446
2451
  node.producerNode.pop();
2447
2452
  node.producerLastReadVersion.pop();
2448
2453
  node.producerIndexOfThis.pop();
@@ -2516,6 +2521,9 @@ function producerAddLiveConsumer(node, consumer, indexOfThis) {
2516
2521
  function producerRemoveLiveConsumerAtIndex(node, idx) {
2517
2522
  assertProducerNode(node);
2518
2523
  assertConsumerNode(node);
2524
+ if (typeof ngDevMode !== 'undefined' && ngDevMode && idx >= node.liveConsumerNode.length) {
2525
+ throw new Error(`Assertion error: active consumer index ${idx} is out of bounds of ${node.liveConsumerNode.length} consumers)`);
2526
+ }
2519
2527
  if (node.liveConsumerNode.length === 1) {
2520
2528
  // When removing the last live consumer, we will no longer be live. We need to remove
2521
2529
  // ourselves from our producers' tracking (which may cause consumer-producers to lose
@@ -2580,60 +2588,65 @@ function computed(computation, options) {
2580
2588
  * A dedicated symbol used before a computed value has been calculated for the first time.
2581
2589
  * Explicitly typed as `any` so we can use it as signal's value.
2582
2590
  */
2583
- const UNSET = Symbol('UNSET');
2591
+ const UNSET = /* @__PURE__ */ Symbol('UNSET');
2584
2592
  /**
2585
2593
  * A dedicated symbol used in place of a computed signal value to indicate that a given computation
2586
2594
  * is in progress. Used to detect cycles in computation chains.
2587
2595
  * Explicitly typed as `any` so we can use it as signal's value.
2588
2596
  */
2589
- const COMPUTING = Symbol('COMPUTING');
2597
+ const COMPUTING = /* @__PURE__ */ Symbol('COMPUTING');
2590
2598
  /**
2591
2599
  * A dedicated symbol used in place of a computed signal value to indicate that a given computation
2592
2600
  * failed. The thrown error is cached until the computation gets dirty again.
2593
2601
  * Explicitly typed as `any` so we can use it as signal's value.
2594
2602
  */
2595
- const ERRORED = Symbol('ERRORED');
2596
- const COMPUTED_NODE = {
2597
- ...REACTIVE_NODE,
2598
- value: UNSET,
2599
- dirty: true,
2600
- error: null,
2601
- equal: defaultEquals,
2602
- producerMustRecompute(node) {
2603
- // Force a recomputation if there's no current value, or if the current value is in the process
2604
- // of being calculated (which should throw an error).
2605
- return node.value === UNSET || node.value === COMPUTING;
2606
- },
2607
- producerRecomputeValue(node) {
2608
- if (node.value === COMPUTING) {
2609
- // Our computation somehow led to a cyclic read of itself.
2610
- throw new Error('Detected cycle in computations.');
2611
- }
2612
- const oldValue = node.value;
2613
- node.value = COMPUTING;
2614
- const prevConsumer = consumerBeforeComputation(node);
2615
- let newValue;
2616
- try {
2617
- newValue = node.computation();
2618
- }
2619
- catch (err) {
2620
- newValue = ERRORED;
2621
- node.error = err;
2622
- }
2623
- finally {
2624
- consumerAfterComputation(node, prevConsumer);
2625
- }
2626
- if (oldValue !== UNSET && oldValue !== ERRORED && newValue !== ERRORED &&
2627
- node.equal(oldValue, newValue)) {
2628
- // No change to `valueVersion` - old and new values are
2629
- // semantically equivalent.
2630
- node.value = oldValue;
2631
- return;
2632
- }
2633
- node.value = newValue;
2634
- node.version++;
2635
- },
2636
- };
2603
+ const ERRORED = /* @__PURE__ */ Symbol('ERRORED');
2604
+ // Note: Using an IIFE here to ensure that the spread assignment is not considered
2605
+ // a side-effect, ending up preserving `COMPUTED_NODE` and `REACTIVE_NODE`.
2606
+ // TODO: remove when https://github.com/evanw/esbuild/issues/3392 is resolved.
2607
+ const COMPUTED_NODE = /* @__PURE__ */ (() => {
2608
+ return {
2609
+ ...REACTIVE_NODE,
2610
+ value: UNSET,
2611
+ dirty: true,
2612
+ error: null,
2613
+ equal: defaultEquals,
2614
+ producerMustRecompute(node) {
2615
+ // Force a recomputation if there's no current value, or if the current value is in the
2616
+ // process of being calculated (which should throw an error).
2617
+ return node.value === UNSET || node.value === COMPUTING;
2618
+ },
2619
+ producerRecomputeValue(node) {
2620
+ if (node.value === COMPUTING) {
2621
+ // Our computation somehow led to a cyclic read of itself.
2622
+ throw new Error('Detected cycle in computations.');
2623
+ }
2624
+ const oldValue = node.value;
2625
+ node.value = COMPUTING;
2626
+ const prevConsumer = consumerBeforeComputation(node);
2627
+ let newValue;
2628
+ try {
2629
+ newValue = node.computation();
2630
+ }
2631
+ catch (err) {
2632
+ newValue = ERRORED;
2633
+ node.error = err;
2634
+ }
2635
+ finally {
2636
+ consumerAfterComputation(node, prevConsumer);
2637
+ }
2638
+ if (oldValue !== UNSET && oldValue !== ERRORED && newValue !== ERRORED &&
2639
+ node.equal(oldValue, newValue)) {
2640
+ // No change to `valueVersion` - old and new values are
2641
+ // semantically equivalent.
2642
+ node.value = oldValue;
2643
+ return;
2644
+ }
2645
+ node.value = newValue;
2646
+ node.version++;
2647
+ },
2648
+ };
2649
+ })();
2637
2650
 
2638
2651
  function defaultThrowError() {
2639
2652
  throw new Error();
@@ -2678,11 +2691,16 @@ function setPostSignalSetFn(fn) {
2678
2691
  postSignalSetFn = fn;
2679
2692
  return prev;
2680
2693
  }
2681
- const SIGNAL_NODE = {
2682
- ...REACTIVE_NODE,
2683
- equal: defaultEquals,
2684
- readonlyFn: undefined,
2685
- };
2694
+ // Note: Using an IIFE here to ensure that the spread assignment is not considered
2695
+ // a side-effect, ending up preserving `COMPUTED_NODE` and `REACTIVE_NODE`.
2696
+ // TODO: remove when https://github.com/evanw/esbuild/issues/3392 is resolved.
2697
+ const SIGNAL_NODE = /* @__PURE__ */ (() => {
2698
+ return {
2699
+ ...REACTIVE_NODE,
2700
+ equal: defaultEquals,
2701
+ readonlyFn: undefined,
2702
+ };
2703
+ })();
2686
2704
  function signalValueChanged(node) {
2687
2705
  node.version++;
2688
2706
  producerNotifyConsumers(node);
@@ -2751,7 +2769,27 @@ function watch(fn, schedule, allowSignalWrites) {
2751
2769
  const registerOnCleanup = (cleanupFn) => {
2752
2770
  node.cleanupFn = cleanupFn;
2753
2771
  };
2772
+ function isWatchNodeDestroyed(node) {
2773
+ return node.fn === null && node.schedule === null;
2774
+ }
2775
+ function destroyWatchNode(node) {
2776
+ if (!isWatchNodeDestroyed(node)) {
2777
+ consumerDestroy(node); // disconnect watcher from the reactive graph
2778
+ node.cleanupFn();
2779
+ // nullify references to the integration functions to mark node as destroyed
2780
+ node.fn = null;
2781
+ node.schedule = null;
2782
+ node.cleanupFn = NOOP_CLEANUP_FN;
2783
+ }
2784
+ }
2754
2785
  const run = () => {
2786
+ if (node.fn === null) {
2787
+ // trying to run a destroyed watch is noop
2788
+ return;
2789
+ }
2790
+ if (isInNotificationPhase()) {
2791
+ throw new Error(`Schedulers cannot synchronously execute watches while scheduling.`);
2792
+ }
2755
2793
  node.dirty = false;
2756
2794
  if (node.hasRun && !consumerPollProducersForChange(node)) {
2757
2795
  return;
@@ -2771,20 +2809,28 @@ function watch(fn, schedule, allowSignalWrites) {
2771
2809
  notify: () => consumerMarkDirty(node),
2772
2810
  run,
2773
2811
  cleanup: () => node.cleanupFn(),
2812
+ destroy: () => destroyWatchNode(node),
2774
2813
  };
2775
2814
  return node.ref;
2776
2815
  }
2777
2816
  const NOOP_CLEANUP_FN = () => { };
2778
- const WATCH_NODE = {
2779
- ...REACTIVE_NODE,
2780
- consumerIsAlwaysLive: true,
2781
- consumerAllowSignalWrites: false,
2782
- consumerMarkedDirty: (node) => {
2783
- node.schedule(node.ref);
2784
- },
2785
- hasRun: false,
2786
- cleanupFn: NOOP_CLEANUP_FN,
2787
- };
2817
+ // Note: Using an IIFE here to ensure that the spread assignment is not considered
2818
+ // a side-effect, ending up preserving `COMPUTED_NODE` and `REACTIVE_NODE`.
2819
+ // TODO: remove when https://github.com/evanw/esbuild/issues/3392 is resolved.
2820
+ const WATCH_NODE = /* @__PURE__ */ (() => {
2821
+ return {
2822
+ ...REACTIVE_NODE,
2823
+ consumerIsAlwaysLive: true,
2824
+ consumerAllowSignalWrites: false,
2825
+ consumerMarkedDirty: (node) => {
2826
+ if (node.schedule !== null) {
2827
+ node.schedule(node.ref);
2828
+ }
2829
+ },
2830
+ hasRun: false,
2831
+ cleanupFn: NOOP_CLEANUP_FN,
2832
+ };
2833
+ })();
2788
2834
 
2789
2835
  function setAlternateWeakRefImpl(impl) {
2790
2836
  // TODO: remove this function
@@ -5861,19 +5907,32 @@ function resolveComponentResources(resourceResolver) {
5861
5907
  component.template = template;
5862
5908
  }));
5863
5909
  }
5864
- const styleUrls = component.styleUrls;
5865
- const styles = component.styles || (component.styles = []);
5866
- const styleOffset = component.styles.length;
5867
- styleUrls && styleUrls.forEach((styleUrl, index) => {
5868
- styles.push(''); // pre-allocate array.
5869
- promises.push(cachedResourceResolve(styleUrl).then((style) => {
5870
- styles[styleOffset + index] = style;
5871
- styleUrls.splice(styleUrls.indexOf(styleUrl), 1);
5872
- if (styleUrls.length == 0) {
5873
- component.styleUrls = undefined;
5874
- }
5910
+ const styles = typeof component.styles === 'string' ? [component.styles] : (component.styles || []);
5911
+ component.styles = styles;
5912
+ if (component.styleUrl && component.styleUrls?.length) {
5913
+ throw new Error('@Component cannot define both `styleUrl` and `styleUrls`. ' +
5914
+ 'Use `styleUrl` if the component has one stylesheet, or `styleUrls` if it has multiple');
5915
+ }
5916
+ else if (component.styleUrls?.length) {
5917
+ const styleOffset = component.styles.length;
5918
+ const styleUrls = component.styleUrls;
5919
+ component.styleUrls.forEach((styleUrl, index) => {
5920
+ styles.push(''); // pre-allocate array.
5921
+ promises.push(cachedResourceResolve(styleUrl).then((style) => {
5922
+ styles[styleOffset + index] = style;
5923
+ styleUrls.splice(styleUrls.indexOf(styleUrl), 1);
5924
+ if (styleUrls.length == 0) {
5925
+ component.styleUrls = undefined;
5926
+ }
5927
+ }));
5928
+ });
5929
+ }
5930
+ else if (component.styleUrl) {
5931
+ promises.push(cachedResourceResolve(component.styleUrl).then((style) => {
5932
+ styles.push(style);
5933
+ component.styleUrl = undefined;
5875
5934
  }));
5876
- });
5935
+ }
5877
5936
  const fullyResolved = Promise.all(promises).then(() => componentDefResolved(type));
5878
5937
  componentResolved.push(fullyResolved);
5879
5938
  });
@@ -5894,7 +5953,7 @@ function isComponentDefPendingResolution(type) {
5894
5953
  }
5895
5954
  function componentNeedsResolution(component) {
5896
5955
  return !!((component.templateUrl && !component.hasOwnProperty('template')) ||
5897
- component.styleUrls && component.styleUrls.length);
5956
+ (component.styleUrls && component.styleUrls.length) || component.styleUrl);
5898
5957
  }
5899
5958
  function clearResolutionOfComponentResourcesQueue() {
5900
5959
  const old = componentResourceResolutionQueue;
@@ -6368,8 +6427,7 @@ class R3Injector extends EnvironmentInjector {
6368
6427
  if (record != null && typeof record.value === 'string') {
6369
6428
  this.scopes.add(record.value);
6370
6429
  }
6371
- this.injectorDefTypes =
6372
- new Set(this.get(INJECTOR_DEF_TYPES.multi, EMPTY_ARRAY, InjectFlags.Self));
6430
+ this.injectorDefTypes = new Set(this.get(INJECTOR_DEF_TYPES, EMPTY_ARRAY, InjectFlags.Self));
6373
6431
  }
6374
6432
  /**
6375
6433
  * Destroy the injector and release references to every instance or provider associated with it.
@@ -6503,7 +6561,7 @@ class R3Injector extends EnvironmentInjector {
6503
6561
  prevInjectContext = setInjectorProfilerContext({ injector: this, token: null });
6504
6562
  }
6505
6563
  try {
6506
- const initializers = this.get(ENVIRONMENT_INITIALIZER.multi, EMPTY_ARRAY, InjectFlags.Self);
6564
+ const initializers = this.get(ENVIRONMENT_INITIALIZER, EMPTY_ARRAY, InjectFlags.Self);
6507
6565
  if (ngDevMode && !Array.isArray(initializers)) {
6508
6566
  throw new RuntimeError(-209 /* RuntimeErrorCode.INVALID_MULTI_PROVIDER */, 'Unexpected type of the `ENVIRONMENT_INITIALIZER` token value ' +
6509
6567
  `(expected an array, but got ${typeof initializers}). ` +
@@ -7305,12 +7363,13 @@ class DepsTracker {
7305
7363
  dependencies: [
7306
7364
  ...scope.compilation.directives,
7307
7365
  ...scope.compilation.pipes,
7366
+ ...scope.compilation.ngModules,
7308
7367
  ]
7309
7368
  };
7310
7369
  }
7311
7370
  else {
7312
7371
  if (!this.ownerNgModule.has(type)) {
7313
- return { dependencies: [] };
7372
+ throw new RuntimeError(1001 /* RuntimeErrorCode.RUNTIME_DEPS_ORPHAN_COMPONENT */, `Orphan component found! Trying to render the component ${type.name} without first loading the NgModule that declares it. Make sure that you import the component's NgModule in the NgModule or the standalone component in which you are trying to render this component. Also make sure the way the app is bundled and served always includes the component's NgModule before the component.`);
7314
7373
  }
7315
7374
  const scope = this.getNgModuleScope(this.ownerNgModule.get(type));
7316
7375
  if (scope.compilation.isPoisoned) {
@@ -7417,6 +7476,12 @@ class DepsTracker {
7417
7476
  // check for it.
7418
7477
  addSet(exportedScope.exported.directives, scope.exported.directives);
7419
7478
  addSet(exportedScope.exported.pipes, scope.exported.pipes);
7479
+ // Some test toolings which run in JIT mode depend on this behavior that the exported scope
7480
+ // should also be present in the compilation scope, even though AoT does not support this
7481
+ // and it is also in odds with NgModule metadata definitions. Without this some tests in
7482
+ // Google will fail.
7483
+ addSet(exportedScope.exported.directives, scope.compilation.directives);
7484
+ addSet(exportedScope.exported.pipes, scope.compilation.pipes);
7420
7485
  }
7421
7486
  else if (isPipe(exported)) {
7422
7487
  scope.exported.pipes.add(exported);
@@ -7442,9 +7507,10 @@ class DepsTracker {
7442
7507
  // Standalone components are always able to self-reference.
7443
7508
  directives: new Set([type]),
7444
7509
  pipes: new Set(),
7510
+ ngModules: new Set(),
7445
7511
  },
7446
7512
  };
7447
- for (const rawImport of rawImports ?? []) {
7513
+ for (const rawImport of flatten(rawImports ?? [])) {
7448
7514
  const imported = resolveForwardRef(rawImport);
7449
7515
  try {
7450
7516
  verifyStandaloneImport(imported, type);
@@ -7455,6 +7521,7 @@ class DepsTracker {
7455
7521
  return ans;
7456
7522
  }
7457
7523
  if (isNgModule(imported)) {
7524
+ ans.compilation.ngModules.add(imported);
7458
7525
  const importedScope = this.getNgModuleScope(imported);
7459
7526
  // Short-circuit if an imported NgModule has corrupted exported scope.
7460
7527
  if (importedScope.exported.isPoisoned) {
@@ -10834,7 +10901,7 @@ class Version {
10834
10901
  /**
10835
10902
  * @publicApi
10836
10903
  */
10837
- const VERSION = new Version('17.0.0-next.3');
10904
+ const VERSION = new Version('17.0.0-next.5');
10838
10905
 
10839
10906
  // This default value is when checking the hierarchy for a token.
10840
10907
  //
@@ -10855,6 +10922,66 @@ const VERSION = new Version('17.0.0-next.3');
10855
10922
  // - mod2.injector.get(token, default)
10856
10923
  const NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR = {};
10857
10924
 
10925
+ const ERROR_ORIGINAL_ERROR = 'ngOriginalError';
10926
+ function wrappedError(message, originalError) {
10927
+ const msg = `${message} caused by: ${originalError instanceof Error ? originalError.message : originalError}`;
10928
+ const error = Error(msg);
10929
+ error[ERROR_ORIGINAL_ERROR] = originalError;
10930
+ return error;
10931
+ }
10932
+ function getOriginalError(error) {
10933
+ return error[ERROR_ORIGINAL_ERROR];
10934
+ }
10935
+
10936
+ /**
10937
+ * Provides a hook for centralized exception handling.
10938
+ *
10939
+ * The default implementation of `ErrorHandler` prints error messages to the `console`. To
10940
+ * intercept error handling, write a custom exception handler that replaces this default as
10941
+ * appropriate for your app.
10942
+ *
10943
+ * @usageNotes
10944
+ * ### Example
10945
+ *
10946
+ * ```
10947
+ * class MyErrorHandler implements ErrorHandler {
10948
+ * handleError(error) {
10949
+ * // do something with the exception
10950
+ * }
10951
+ * }
10952
+ *
10953
+ * @NgModule({
10954
+ * providers: [{provide: ErrorHandler, useClass: MyErrorHandler}]
10955
+ * })
10956
+ * class MyModule {}
10957
+ * ```
10958
+ *
10959
+ * @publicApi
10960
+ */
10961
+ class ErrorHandler {
10962
+ constructor() {
10963
+ /**
10964
+ * @internal
10965
+ */
10966
+ this._console = console;
10967
+ }
10968
+ handleError(error) {
10969
+ const originalError = this._findOriginalError(error);
10970
+ this._console.error('ERROR', error);
10971
+ if (originalError) {
10972
+ this._console.error('ORIGINAL ERROR', originalError);
10973
+ }
10974
+ }
10975
+ /** @internal */
10976
+ _findOriginalError(error) {
10977
+ let e = error && getOriginalError(error);
10978
+ while (e && getOriginalError(e)) {
10979
+ e = getOriginalError(e);
10980
+ }
10981
+ return e || null;
10982
+ }
10983
+ }
10984
+
10858
10985
  /**
10859
10986
  * `DestroyRef` lets you set callbacks to run for any cleanup or destruction behavior.
10860
10987
  * The scope of this destruction depends on where `DestroyRef` is injected. If `DestroyRef`
@@ -11460,10 +11587,77 @@ function shouldBeIgnoredByZone(applyArgs) {
11460
11587
 
11461
11588
  // Public API for Zone
11462
11589
 
11590
+ /**
11591
+ * The phase to run an `afterRender` or `afterNextRender` callback in.
11592
+ *
11593
+ * Callbacks in the same phase run in the order they are registered. Phases run in the
11594
+ * following order after each render:
11595
+ *
11596
+ * 1. `AfterRenderPhase.EarlyRead`
11597
+ * 2. `AfterRenderPhase.Write`
11598
+ * 3. `AfterRenderPhase.MixedReadWrite`
11599
+ * 4. `AfterRenderPhase.Read`
11600
+ *
11601
+ * Angular is unable to verify or enforce that phases are used correctly, and instead
11602
+ * relies on each developer to follow the guidelines documented for each value and
11603
+ * carefully choose the appropriate one, refactoring their code if necessary. By doing
11604
+ * so, Angular is better able to minimize the performance degradation associated with
11605
+ * manual DOM access, ensuring the best experience for the end users of your application
11606
+ * or library.
11607
+ *
11608
+ * @developerPreview
11609
+ */
11610
+ var AfterRenderPhase;
11611
+ (function (AfterRenderPhase) {
11612
+ /**
11613
+ * Use `AfterRenderPhase.EarlyRead` for callbacks that only need to **read** from the
11614
+ * DOM before a subsequent `AfterRenderPhase.Write` callback, for example to perform
11615
+ * custom layout that the browser doesn't natively support. **Never** use this phase
11616
+ * for callbacks that can write to the DOM or when `AfterRenderPhase.Read` is adequate.
11617
+ *
11618
+ * <div class="alert is-important">
11619
+ *
11620
+ * Using this value can degrade performance.
11621
+ * Instead, prefer using built-in browser functionality when possible.
11622
+ *
11623
+ * </div>
11624
+ */
11625
+ AfterRenderPhase[AfterRenderPhase["EarlyRead"] = 0] = "EarlyRead";
11626
+ /**
11627
+ * Use `AfterRenderPhase.Write` for callbacks that only **write** to the DOM. **Never**
11628
+ * use this phase for callbacks that can read from the DOM.
11629
+ */
11630
+ AfterRenderPhase[AfterRenderPhase["Write"] = 1] = "Write";
11631
+ /**
11632
+ * Use `AfterRenderPhase.MixedReadWrite` for callbacks that read from or write to the
11633
+ * DOM, that haven't been refactored to use a different phase. **Never** use this phase
11634
+ * for callbacks that can use a different phase instead.
11635
+ *
11636
+ * <div class="alert is-critical">
11637
+ *
11638
+ * Using this value can **significantly** degrade performance.
11639
+ * Instead, prefer refactoring into multiple callbacks using a more specific phase.
11640
+ *
11641
+ * </div>
11642
+ */
11643
+ AfterRenderPhase[AfterRenderPhase["MixedReadWrite"] = 2] = "MixedReadWrite";
11644
+ /**
11645
+ * Use `AfterRenderPhase.Read` for callbacks that only **read** from the DOM. **Never**
11646
+ * use this phase for callbacks that can write to the DOM.
11647
+ */
11648
+ AfterRenderPhase[AfterRenderPhase["Read"] = 3] = "Read";
11649
+ })(AfterRenderPhase || (AfterRenderPhase = {}));
11463
11650
  /**
11464
11651
  * Register a callback to be invoked each time the application
11465
11652
  * finishes rendering.
11466
11653
  *
11654
+ * <div class="alert is-critical">
11655
+ *
11656
+ * You should always explicitly specify a non-default [phase](api/core/AfterRenderPhase), or you
11657
+ * risk significant performance degradation.
11658
+ *
11659
+ * </div>
11660
+ *
11467
11661
  * Note that the callback will run
11468
11662
  * - in the order it was registered
11469
11663
  * - once per render
@@ -11494,7 +11688,7 @@ function shouldBeIgnoredByZone(applyArgs) {
11494
11688
  * constructor() {
11495
11689
  * afterRender(() => {
11496
11690
  * console.log('content height: ' + this.contentRef.nativeElement.scrollHeight);
11497
- * });
11691
+ * }, {phase: AfterRenderPhase.Read});
11498
11692
  * }
11499
11693
  * }
11500
11694
  * ```
@@ -11509,23 +11703,32 @@ function afterRender(callback, options) {
11509
11703
  }
11510
11704
  let destroy;
11511
11705
  const unregisterFn = injector.get(DestroyRef).onDestroy(() => destroy?.());
11512
- const manager = injector.get(AfterRenderEventManager);
11706
+ const afterRenderEventManager = injector.get(AfterRenderEventManager);
11513
11707
  // Lazily initialize the handler implementation, if necessary. This is so that it can be
11514
11708
  // tree-shaken if `afterRender` and `afterNextRender` aren't used.
11515
- const handler = manager.handler ??= new AfterRenderCallbackHandlerImpl();
11709
+ const callbackHandler = afterRenderEventManager.handler ??= new AfterRenderCallbackHandlerImpl();
11516
11710
  const ngZone = injector.get(NgZone);
11517
- const instance = new AfterRenderCallback(() => ngZone.runOutsideAngular(callback));
11711
+ const errorHandler = injector.get(ErrorHandler, null, { optional: true });
11712
+ const phase = options?.phase ?? AfterRenderPhase.MixedReadWrite;
11713
+ const instance = new AfterRenderCallback(ngZone, errorHandler, phase, callback);
11518
11714
  destroy = () => {
11519
- handler.unregister(instance);
11715
+ callbackHandler.unregister(instance);
11520
11716
  unregisterFn();
11521
11717
  };
11522
- handler.register(instance);
11718
+ callbackHandler.register(instance);
11523
11719
  return { destroy };
11524
11720
  }
11525
11721
  /**
11526
11722
  * Register a callback to be invoked the next time the application
11527
11723
  * finishes rendering.
11528
11724
  *
11725
+ * <div class="alert is-critical">
11726
+ *
11727
+ * You should always explicitly specify a non-default [phase](api/core/AfterRenderPhase), or you
11728
+ * risk significant performance degradation.
11729
+ *
11730
+ * </div>
11731
+ *
11529
11732
  * Note that the callback will run
11530
11733
  * - in the order it was registered
11531
11734
  * - on browser platforms only
@@ -11557,7 +11760,7 @@ function afterRender(callback, options) {
11557
11760
  * constructor() {
11558
11761
  * afterNextRender(() => {
11559
11762
  * this.chart = new MyChart(this.chartRef.nativeElement);
11560
- * });
11763
+ * }, {phase: AfterRenderPhase.Write});
11561
11764
  * }
11562
11765
  * }
11563
11766
  * ```
@@ -11572,31 +11775,41 @@ function afterNextRender(callback, options) {
11572
11775
  }
11573
11776
  let destroy;
11574
11777
  const unregisterFn = injector.get(DestroyRef).onDestroy(() => destroy?.());
11575
- const manager = injector.get(AfterRenderEventManager);
11778
+ const afterRenderEventManager = injector.get(AfterRenderEventManager);
11576
11779
  // Lazily initialize the handler implementation, if necessary. This is so that it can be
11577
11780
  // tree-shaken if `afterRender` and `afterNextRender` aren't used.
11578
- const handler = manager.handler ??= new AfterRenderCallbackHandlerImpl();
11781
+ const callbackHandler = afterRenderEventManager.handler ??= new AfterRenderCallbackHandlerImpl();
11579
11782
  const ngZone = injector.get(NgZone);
11580
- const instance = new AfterRenderCallback(() => {
11783
+ const errorHandler = injector.get(ErrorHandler, null, { optional: true });
11784
+ const phase = options?.phase ?? AfterRenderPhase.MixedReadWrite;
11785
+ const instance = new AfterRenderCallback(ngZone, errorHandler, phase, () => {
11581
11786
  destroy?.();
11582
- ngZone.runOutsideAngular(callback);
11787
+ callback();
11583
11788
  });
11584
11789
  destroy = () => {
11585
- handler.unregister(instance);
11790
+ callbackHandler.unregister(instance);
11586
11791
  unregisterFn();
11587
11792
  };
11588
- handler.register(instance);
11793
+ callbackHandler.register(instance);
11589
11794
  return { destroy };
11590
11795
  }
11591
11796
  /**
11592
11797
  * A wrapper around a function to be used as an after render callback.
11593
11798
  */
11594
11799
  class AfterRenderCallback {
11595
- constructor(callback) {
11596
- this.callback = callback;
11800
+ constructor(zone, errorHandler, phase, callbackFn) {
11801
+ this.zone = zone;
11802
+ this.errorHandler = errorHandler;
11803
+ this.phase = phase;
11804
+ this.callbackFn = callbackFn;
11597
11805
  }
11598
11806
  invoke() {
11599
- this.callback();
11807
+ try {
11808
+ this.zone.runOutsideAngular(this.callbackFn);
11809
+ }
11810
+ catch (err) {
11811
+ this.errorHandler?.handleError(err);
11812
+ }
11600
11813
  }
11601
11814
  }
11602
11815
  /**
@@ -11606,7 +11819,13 @@ class AfterRenderCallback {
11606
11819
  class AfterRenderCallbackHandlerImpl {
11607
11820
  constructor() {
11608
11821
  this.executingCallbacks = false;
11609
- this.callbacks = new Set();
11822
+ this.buckets = {
11823
+ // Note: the order of these keys controls the order the phases are run.
11824
+ [AfterRenderPhase.EarlyRead]: new Set(),
11825
+ [AfterRenderPhase.Write]: new Set(),
11826
+ [AfterRenderPhase.MixedReadWrite]: new Set(),
11827
+ [AfterRenderPhase.Read]: new Set(),
11828
+ };
11610
11829
  this.deferredCallbacks = new Set();
11611
11830
  }
11612
11831
  validateBegin() {
@@ -11619,30 +11838,30 @@ class AfterRenderCallbackHandlerImpl {
11619
11838
  register(callback) {
11620
11839
  // If we're currently running callbacks, new callbacks should be deferred
11621
11840
  // until the next render operation.
11622
- const target = this.executingCallbacks ? this.deferredCallbacks : this.callbacks;
11841
+ const target = this.executingCallbacks ? this.deferredCallbacks : this.buckets[callback.phase];
11623
11842
  target.add(callback);
11624
11843
  }
11625
11844
  unregister(callback) {
11626
- this.callbacks.delete(callback);
11845
+ this.buckets[callback.phase].delete(callback);
11627
11846
  this.deferredCallbacks.delete(callback);
11628
11847
  }
11629
11848
  execute() {
11630
- try {
11631
- this.executingCallbacks = true;
11632
- for (const callback of this.callbacks) {
11849
+ this.executingCallbacks = true;
11850
+ for (const bucket of Object.values(this.buckets)) {
11851
+ for (const callback of bucket) {
11633
11852
  callback.invoke();
11634
11853
  }
11635
11854
  }
11636
- finally {
11637
- this.executingCallbacks = false;
11638
- for (const callback of this.deferredCallbacks) {
11639
- this.callbacks.add(callback);
11640
- }
11641
- this.deferredCallbacks.clear();
11855
+ this.executingCallbacks = false;
11856
+ for (const callback of this.deferredCallbacks) {
11857
+ this.buckets[callback.phase].add(callback);
11642
11858
  }
11859
+ this.deferredCallbacks.clear();
11643
11860
  }
11644
11861
  destroy() {
11645
- this.callbacks.clear();
11862
+ for (const bucket of Object.values(this.buckets)) {
11863
+ bucket.clear();
11864
+ }
11646
11865
  this.deferredCallbacks.clear();
11647
11866
  }
11648
11867
  }
@@ -11712,66 +11931,6 @@ function markViewDirty(lView) {
11712
11931
  return null;
11713
11932
  }
11714
11933
 
11715
- const ERROR_ORIGINAL_ERROR = 'ngOriginalError';
11716
- function wrappedError(message, originalError) {
11717
- const msg = `${message} caused by: ${originalError instanceof Error ? originalError.message : originalError}`;
11718
- const error = Error(msg);
11719
- error[ERROR_ORIGINAL_ERROR] = originalError;
11720
- return error;
11721
- }
11722
- function getOriginalError(error) {
11723
- return error[ERROR_ORIGINAL_ERROR];
11724
- }
11725
-
11726
- /**
11727
- * Provides a hook for centralized exception handling.
11728
- *
11729
- * The default implementation of `ErrorHandler` prints error messages to the `console`. To
11730
- * intercept error handling, write a custom exception handler that replaces this default as
11731
- * appropriate for your app.
11732
- *
11733
- * @usageNotes
11734
- * ### Example
11735
- *
11736
- * ```
11737
- * class MyErrorHandler implements ErrorHandler {
11738
- * handleError(error) {
11739
- * // do something with the exception
11740
- * }
11741
- * }
11742
- *
11743
- * @NgModule({
11744
- * providers: [{provide: ErrorHandler, useClass: MyErrorHandler}]
11745
- * })
11746
- * class MyModule {}
11747
- * ```
11748
- *
11749
- * @publicApi
11750
- */
11751
- class ErrorHandler {
11752
- constructor() {
11753
- /**
11754
- * @internal
11755
- */
11756
- this._console = console;
11757
- }
11758
- handleError(error) {
11759
- const originalError = this._findOriginalError(error);
11760
- this._console.error('ERROR', error);
11761
- if (originalError) {
11762
- this._console.error('ORIGINAL ERROR', originalError);
11763
- }
11764
- }
11765
- /** @internal */
11766
- _findOriginalError(error) {
11767
- let e = error && getOriginalError(error);
11768
- while (e && getOriginalError(e)) {
11769
- e = getOriginalError(e);
11770
- }
11771
- return e || null;
11772
- }
11773
- }
11774
-
11775
11934
  /**
11776
11935
  * Internal token that specifies whether DOM reuse logic
11777
11936
  * during hydration is enabled.
@@ -13480,74 +13639,6 @@ function renderChildComponents(hostLView, components) {
13480
13639
  }
13481
13640
  }
13482
13641
 
13483
- /**
13484
- * Tracks all effects registered within a given application and runs them via `flush`.
13485
- */
13486
- class EffectManager {
13487
- constructor() {
13488
- this.all = new Set();
13489
- this.queue = new Map();
13490
- }
13491
- create(effectFn, destroyRef, allowSignalWrites) {
13492
- const zone = (typeof Zone === 'undefined') ? null : Zone.current;
13493
- const w = watch(effectFn, (watch) => {
13494
- if (!this.all.has(watch)) {
13495
- return;
13496
- }
13497
- this.queue.set(watch, zone);
13498
- }, allowSignalWrites);
13499
- this.all.add(w);
13500
- // Effects start dirty.
13501
- w.notify();
13502
- let unregisterOnDestroy;
13503
- const destroy = () => {
13504
- w.cleanup();
13505
- unregisterOnDestroy?.();
13506
- this.all.delete(w);
13507
- this.queue.delete(w);
13508
- };
13509
- unregisterOnDestroy = destroyRef?.onDestroy(destroy);
13510
- return {
13511
- destroy,
13512
- };
13513
- }
13514
- flush() {
13515
- if (this.queue.size === 0) {
13516
- return;
13517
- }
13518
- for (const [watch, zone] of this.queue) {
13519
- this.queue.delete(watch);
13520
- if (zone) {
13521
- zone.run(() => watch.run());
13522
- }
13523
- else {
13524
- watch.run();
13525
- }
13526
- }
13527
- }
13528
- get isQueueEmpty() {
13529
- return this.queue.size === 0;
13530
- }
13531
- /** @nocollapse */
13532
- static { this.ɵprov = ɵɵdefineInjectable({
13533
- token: EffectManager,
13534
- providedIn: 'root',
13535
- factory: () => new EffectManager(),
13536
- }); }
13537
- }
13538
- /**
13539
- * Create a global `Effect` for the given reactive function.
13540
- *
13541
- * @developerPreview
13542
- */
13543
- function effect(effectFn, options) {
13544
- !options?.injector && assertInInjectionContext(effect);
13545
- const injector = options?.injector ?? inject(Injector);
13546
- const effectManager = injector.get(EffectManager);
13547
- const destroyRef = options?.manualCleanup !== true ? injector.get(DestroyRef) : null;
13548
- return effectManager.create(effectFn, destroyRef, !!options?.allowSignalWrites);
13549
- }
13550
-
13551
13642
  /**
13552
13643
  * Compute the static styling (class/style) from `TAttributes`.
13553
13644
  *
@@ -13680,7 +13771,7 @@ function detectChangesInternal(tView, lView, context, notifyErrorHandler = true)
13680
13771
  rendererFactory.end?.();
13681
13772
  // One final flush of the effects queue to catch any effects created in `ngAfterViewInit` or
13682
13773
  // other post-order hooks.
13683
- environment.effectManager?.flush();
13774
+ environment.inlineEffectRunner?.flush();
13684
13775
  // Invoke all callbacks registered via `after*Render`, if needed.
13685
13776
  afterRenderEventManager?.end();
13686
13777
  }
@@ -13722,7 +13813,7 @@ function refreshView(tView, lView, templateFn, context) {
13722
13813
  // Check no changes mode is a dev only mode used to verify that bindings have not changed
13723
13814
  // since they were assigned. We do not want to execute lifecycle hooks in that mode.
13724
13815
  const isInCheckNoChangesPass = ngDevMode && isInCheckNoChangesMode();
13725
- !isInCheckNoChangesPass && lView[ENVIRONMENT].effectManager?.flush();
13816
+ !isInCheckNoChangesPass && lView[ENVIRONMENT].inlineEffectRunner?.flush();
13726
13817
  enterView(lView);
13727
13818
  try {
13728
13819
  resetPreOrderHookFlags(lView);
@@ -14302,12 +14393,12 @@ class ComponentFactory extends ComponentFactory$1 {
14302
14393
  'Make sure that any injector used to create this component has a correct parent.');
14303
14394
  }
14304
14395
  const sanitizer = rootViewInjector.get(Sanitizer, null);
14305
- const effectManager = rootViewInjector.get(EffectManager, null);
14306
14396
  const afterRenderEventManager = rootViewInjector.get(AfterRenderEventManager, null);
14307
14397
  const environment = {
14308
14398
  rendererFactory,
14309
14399
  sanitizer,
14310
- effectManager,
14400
+ // We don't use inline effects (yet).
14401
+ inlineEffectRunner: null,
14311
14402
  afterRenderEventManager,
14312
14403
  };
14313
14404
  const hostRenderer = rendererFactory.createRenderer(null, this.componentDef);
@@ -20281,7 +20372,72 @@ function enableLocateOrCreateContainerRefImpl() {
20281
20372
  _populateDehydratedViewsInContainer = populateDehydratedViewsInContainerImpl;
20282
20373
  }
20283
20374
 
20375
+ /**
20376
+ * Describes the state of defer block dependency loading.
20377
+ */
20378
+ var DeferDependenciesLoadingState;
20379
+ (function (DeferDependenciesLoadingState) {
20380
+ /** Initial state, dependency loading is not yet triggered */
20381
+ DeferDependenciesLoadingState[DeferDependenciesLoadingState["NOT_STARTED"] = 0] = "NOT_STARTED";
20382
+ /** Dependency loading was scheduled (e.g. `on idle`), but has not started yet */
20383
+ DeferDependenciesLoadingState[DeferDependenciesLoadingState["SCHEDULED"] = 1] = "SCHEDULED";
20384
+ /** Dependency loading is in progress */
20385
+ DeferDependenciesLoadingState[DeferDependenciesLoadingState["IN_PROGRESS"] = 2] = "IN_PROGRESS";
20386
+ /** Dependency loading has completed successfully */
20387
+ DeferDependenciesLoadingState[DeferDependenciesLoadingState["COMPLETE"] = 3] = "COMPLETE";
20388
+ /** Dependency loading has failed */
20389
+ DeferDependenciesLoadingState[DeferDependenciesLoadingState["FAILED"] = 4] = "FAILED";
20390
+ })(DeferDependenciesLoadingState || (DeferDependenciesLoadingState = {}));
20391
+ /**
20392
+ * Describes the current state of this {#defer} block instance.
20393
+ *
20394
+ * @publicApi
20395
+ * @developerPreview
20396
+ */
20397
+ var DeferBlockState;
20398
+ (function (DeferBlockState) {
20399
+ /** The {:placeholder} block content is rendered */
20400
+ DeferBlockState[DeferBlockState["Placeholder"] = 0] = "Placeholder";
20401
+ /** The {:loading} block content is rendered */
20402
+ DeferBlockState[DeferBlockState["Loading"] = 1] = "Loading";
20403
+ /** The main content block content is rendered */
20404
+ DeferBlockState[DeferBlockState["Complete"] = 2] = "Complete";
20405
+ /** The {:error} block content is rendered */
20406
+ DeferBlockState[DeferBlockState["Error"] = 3] = "Error";
20407
+ })(DeferBlockState || (DeferBlockState = {}));
20408
+ /**
20409
+ * Describes the initial state of this {#defer} block instance.
20410
+ *
20411
+ * Note: this state is internal only and *must* be represented
20412
+ * with a number lower than any value in the `DeferBlockState` enum.
20413
+ */
20414
+ var DeferBlockInternalState;
20415
+ (function (DeferBlockInternalState) {
20416
+ /** Initial state. Nothing is rendered yet. */
20417
+ DeferBlockInternalState[DeferBlockInternalState["Initial"] = -1] = "Initial";
20418
+ })(DeferBlockInternalState || (DeferBlockInternalState = {}));
20419
+ /**
20420
+ * A slot in the `LDeferBlockDetails` array that contains a number
20421
+ * that represent a current block state that is being rendered.
20422
+ */
20284
20423
  const DEFER_BLOCK_STATE = 0;
20424
+ /**
20425
+ * Options for configuring defer blocks behavior.
20426
+ * @publicApi
20427
+ * @developerPreview
20428
+ */
20429
+ var DeferBlockBehavior;
20430
+ (function (DeferBlockBehavior) {
20431
+ /**
20432
+ * Manual triggering mode for defer blocks. Provides control over when defer blocks render
20433
+ * and which state they render. This is the default behavior in test environments.
20434
+ */
20435
+ DeferBlockBehavior[DeferBlockBehavior["Manual"] = 0] = "Manual";
20436
+ /**
20437
+ * Playthrough mode for defer blocks. This mode behaves like defer blocks would in a browser.
20438
+ */
20439
+ DeferBlockBehavior[DeferBlockBehavior["Playthrough"] = 1] = "Playthrough";
20440
+ })(DeferBlockBehavior || (DeferBlockBehavior = {}));
20285
20441
 
20286
20442
  /**
20287
20443
  * Returns whether defer blocks should be triggered.
@@ -20290,6 +20446,10 @@ const DEFER_BLOCK_STATE = 0;
20290
20446
  * only placeholder content is rendered (if provided).
20291
20447
  */
20292
20448
  function shouldTriggerDeferBlock(injector) {
20449
+ const config = injector.get(DEFER_BLOCK_CONFIG, { optional: true });
20450
+ if (config?.behavior === DeferBlockBehavior.Manual) {
20451
+ return false;
20452
+ }
20293
20453
  return isPlatformBrowser(injector);
20294
20454
  }
20295
20455
  /**
@@ -20333,7 +20493,7 @@ function ɵɵdefer(index, primaryTmplIndex, dependencyResolverFn, loadingTmplInd
20333
20493
  getConstant(tViewConsts, loadingConfigIndex) :
20334
20494
  null,
20335
20495
  dependencyResolverFn: dependencyResolverFn ?? null,
20336
- loadingState: 0 /* DeferDependenciesLoadingState.NOT_STARTED */,
20496
+ loadingState: DeferDependenciesLoadingState.NOT_STARTED,
20337
20497
  loadingPromise: null,
20338
20498
  };
20339
20499
  setTDeferBlockDetails(tView, adjustedIndex, deferBlockConfig);
@@ -20344,7 +20504,7 @@ function ɵɵdefer(index, primaryTmplIndex, dependencyResolverFn, loadingTmplInd
20344
20504
  populateDehydratedViewsInContainer(lContainer);
20345
20505
  // Init instance-specific defer details and store it.
20346
20506
  const lDetails = [];
20347
- lDetails[DEFER_BLOCK_STATE] = 0 /* DeferBlockInstanceState.INITIAL */;
20507
+ lDetails[DEFER_BLOCK_STATE] = DeferBlockInternalState.Initial;
20348
20508
  setLDeferBlockDetails(lView, adjustedIndex, lDetails);
20349
20509
  }
20350
20510
  /**
@@ -20359,13 +20519,13 @@ function ɵɵdeferWhen(rawValue) {
20359
20519
  const tNode = getSelectedTNode();
20360
20520
  const lDetails = getLDeferBlockDetails(lView, tNode);
20361
20521
  const renderedState = lDetails[DEFER_BLOCK_STATE];
20362
- if (value === false && renderedState === 0 /* DeferBlockInstanceState.INITIAL */) {
20522
+ if (value === false && renderedState === DeferBlockInternalState.Initial) {
20363
20523
  // If nothing is rendered yet, render a placeholder (if defined).
20364
20524
  renderPlaceholder(lView, tNode);
20365
20525
  }
20366
20526
  else if (value === true &&
20367
- (renderedState === 0 /* DeferBlockInstanceState.INITIAL */ ||
20368
- renderedState === 1 /* DeferBlockInstanceState.PLACEHOLDER */)) {
20527
+ (renderedState === DeferBlockInternalState.Initial ||
20528
+ renderedState === DeferBlockState.Placeholder)) {
20369
20529
  // The `when` condition has changed to `true`, trigger defer block loading
20370
20530
  // if the block is either in initial (nothing is rendered) or a placeholder
20371
20531
  // state.
@@ -20385,9 +20545,9 @@ function ɵɵdeferPrefetchWhen(rawValue) {
20385
20545
  const tView = lView[TVIEW];
20386
20546
  const tNode = getSelectedTNode();
20387
20547
  const tDetails = getTDeferBlockDetails(tView, tNode);
20388
- if (value === true && tDetails.loadingState === 0 /* DeferDependenciesLoadingState.NOT_STARTED */) {
20548
+ if (value === true && tDetails.loadingState === DeferDependenciesLoadingState.NOT_STARTED) {
20389
20549
  // If loading has not been started yet, trigger it now.
20390
- triggerResourceLoading(tDetails, tView, lView);
20550
+ triggerPrefetching(tDetails, lView);
20391
20551
  }
20392
20552
  }
20393
20553
  }
@@ -20413,14 +20573,14 @@ function ɵɵdeferPrefetchOnIdle() {
20413
20573
  const tNode = getCurrentTNode();
20414
20574
  const tView = lView[TVIEW];
20415
20575
  const tDetails = getTDeferBlockDetails(tView, tNode);
20416
- if (tDetails.loadingState === 0 /* DeferDependenciesLoadingState.NOT_STARTED */) {
20576
+ if (tDetails.loadingState === DeferDependenciesLoadingState.NOT_STARTED) {
20417
20577
  // Set loading to the scheduled state, so that we don't register it again.
20418
- tDetails.loadingState = 1 /* DeferDependenciesLoadingState.SCHEDULED */;
20578
+ tDetails.loadingState = DeferDependenciesLoadingState.SCHEDULED;
20419
20579
  // In case of prefetching, we intentionally avoid cancelling prefetching if
20420
20580
  // an underlying LView get destroyed (thus passing `null` as a second argument),
20421
20581
  // because there might be other LViews (that represent embedded views) that
20422
20582
  // depend on resource loading.
20423
- onIdle(() => triggerResourceLoading(tDetails, tView, lView), null /* LView */);
20583
+ onIdle(() => triggerPrefetching(tDetails, lView), null /* LView */);
20424
20584
  }
20425
20585
  }
20426
20586
  /**
@@ -20544,6 +20704,23 @@ function setTDeferBlockDetails(tView, deferBlockIndex, deferBlockConfig) {
20544
20704
  ngDevMode && assertIndexInDeclRange(tView, slotIndex);
20545
20705
  tView.data[slotIndex] = deferBlockConfig;
20546
20706
  }
20707
+ function getTemplateIndexForState(newState, hostLView, tNode) {
20708
+ const tView = hostLView[TVIEW];
20709
+ const tDetails = getTDeferBlockDetails(tView, tNode);
20710
+ switch (newState) {
20711
+ case DeferBlockState.Complete:
20712
+ return tDetails.primaryTmplIndex;
20713
+ case DeferBlockState.Loading:
20714
+ return tDetails.loadingTmplIndex;
20715
+ case DeferBlockState.Error:
20716
+ return tDetails.errorTmplIndex;
20717
+ case DeferBlockState.Placeholder:
20718
+ return tDetails.placeholderTmplIndex;
20719
+ default:
20720
+ ngDevMode && throwError(`Unexpected defer block state: ${newState}`);
20721
+ return null;
20722
+ }
20723
+ }
20547
20724
  /**
20548
20725
  * Transitions a defer block to the new state. Updates the necessary
20549
20726
  * data structures and renders corresponding block.
@@ -20551,9 +20728,8 @@ function setTDeferBlockDetails(tView, deferBlockIndex, deferBlockConfig) {
20551
20728
  * @param newState New state that should be applied to the defer block.
20552
20729
  * @param tNode TNode that represents a defer block.
20553
20730
  * @param lContainer Represents an instance of a defer block.
20554
- * @param stateTmplIndex Index of a template that should be rendered.
20555
20731
  */
20556
- function renderDeferBlockState(newState, tNode, lContainer, stateTmplIndex) {
20732
+ function renderDeferBlockState(newState, tNode, lContainer) {
20557
20733
  const hostLView = lContainer[PARENT];
20558
20734
  // Check if this view is not destroyed. Since the loading process was async,
20559
20735
  // the view might end up being destroyed by the time rendering happens.
@@ -20563,6 +20739,7 @@ function renderDeferBlockState(newState, tNode, lContainer, stateTmplIndex) {
20563
20739
  ngDevMode && assertTNodeForLView(tNode, hostLView);
20564
20740
  const lDetails = getLDeferBlockDetails(hostLView, tNode);
20565
20741
  ngDevMode && assertDefined(lDetails, 'Expected a defer block state defined');
20742
+ const stateTmplIndex = getTemplateIndexForState(newState, hostLView, tNode);
20566
20743
  // Note: we transition to the next state if the previous state was represented
20567
20744
  // with a number that is less than the next state. For example, if the current
20568
20745
  // state is "loading" (represented as `2`), we should not show a placeholder
@@ -20581,18 +20758,28 @@ function renderDeferBlockState(newState, tNode, lContainer, stateTmplIndex) {
20581
20758
  addLViewToLContainer(lContainer, embeddedLView, viewIndex, shouldAddViewToDom(tNode, dehydratedView));
20582
20759
  }
20583
20760
  }
20761
+ /**
20762
+ * Trigger prefetching of dependencies for a defer block.
20763
+ *
20764
+ * @param tDetails Static information about this defer block.
20765
+ * @param lView LView of a host view.
20766
+ */
20767
+ function triggerPrefetching(tDetails, lView) {
20768
+ if (lView[INJECTOR$1] && shouldTriggerDeferBlock(lView[INJECTOR$1])) {
20769
+ triggerResourceLoading(tDetails, lView);
20770
+ }
20771
+ }
20584
20772
  /**
20585
20773
  * Trigger loading of defer block dependencies if the process hasn't started yet.
20586
20774
  *
20587
20775
  * @param tDetails Static information about this defer block.
20588
- * @param tView TView of a host view.
20589
20776
  * @param lView LView of a host view.
20590
20777
  */
20591
- function triggerResourceLoading(tDetails, tView, lView) {
20778
+ function triggerResourceLoading(tDetails, lView) {
20592
20779
  const injector = lView[INJECTOR$1];
20593
- if (!shouldTriggerDeferBlock(injector) ||
20594
- (tDetails.loadingState !== 0 /* DeferDependenciesLoadingState.NOT_STARTED */ &&
20595
- tDetails.loadingState !== 1 /* DeferDependenciesLoadingState.SCHEDULED */)) {
20780
+ const tView = lView[TVIEW];
20781
+ if (tDetails.loadingState !== DeferDependenciesLoadingState.NOT_STARTED &&
20782
+ tDetails.loadingState !== DeferDependenciesLoadingState.SCHEDULED) {
20596
20783
  // If the loading status is different from initial one, it means that
20597
20784
  // the loading of dependencies is in progress and there is nothing to do
20598
20785
  // in this function. All details can be obtained from the `tDetails` object.
@@ -20600,7 +20787,7 @@ function triggerResourceLoading(tDetails, tView, lView) {
20600
20787
  }
20601
20788
  const primaryBlockTNode = getPrimaryBlockTNode(tView, tDetails);
20602
20789
  // Switch from NOT_STARTED -> IN_PROGRESS state.
20603
- tDetails.loadingState = 2 /* DeferDependenciesLoadingState.IN_PROGRESS */;
20790
+ tDetails.loadingState = DeferDependenciesLoadingState.IN_PROGRESS;
20604
20791
  // Check if dependency function interceptor is configured.
20605
20792
  const deferDependencyInterceptor = injector.get(DEFER_BLOCK_DEPENDENCY_INTERCEPTOR, null, { optional: true });
20606
20793
  const dependenciesFn = deferDependencyInterceptor ?
@@ -20611,7 +20798,7 @@ function triggerResourceLoading(tDetails, tView, lView) {
20611
20798
  // thus no dynamic `import()`s were produced.
20612
20799
  if (!dependenciesFn) {
20613
20800
  tDetails.loadingPromise = Promise.resolve().then(() => {
20614
- tDetails.loadingState = 3 /* DeferDependenciesLoadingState.COMPLETE */;
20801
+ tDetails.loadingState = DeferDependenciesLoadingState.COMPLETE;
20615
20802
  });
20616
20803
  return;
20617
20804
  }
@@ -20642,10 +20829,10 @@ function triggerResourceLoading(tDetails, tView, lView) {
20642
20829
  // Loading is completed, we no longer need this Promise.
20643
20830
  tDetails.loadingPromise = null;
20644
20831
  if (failed) {
20645
- tDetails.loadingState = 4 /* DeferDependenciesLoadingState.FAILED */;
20832
+ tDetails.loadingState = DeferDependenciesLoadingState.FAILED;
20646
20833
  }
20647
20834
  else {
20648
- tDetails.loadingState = 3 /* DeferDependenciesLoadingState.COMPLETE */;
20835
+ tDetails.loadingState = DeferDependenciesLoadingState.COMPLETE;
20649
20836
  // Update directive and pipe registries to add newly downloaded dependencies.
20650
20837
  const primaryBlockTView = primaryBlockTNode.tView;
20651
20838
  if (directiveDefs.length > 0) {
@@ -20667,7 +20854,7 @@ function renderPlaceholder(lView, tNode) {
20667
20854
  const lContainer = lView[tNode.index];
20668
20855
  ngDevMode && assertLContainer(lContainer);
20669
20856
  const tDetails = getTDeferBlockDetails(tView, tNode);
20670
- renderDeferBlockState(1 /* DeferBlockInstanceState.PLACEHOLDER */, tNode, lContainer, tDetails.placeholderTmplIndex);
20857
+ renderDeferBlockState(DeferBlockState.Placeholder, tNode, lContainer);
20671
20858
  }
20672
20859
  /**
20673
20860
  * Subscribes to the "loading" Promise and renders corresponding defer sub-block,
@@ -20680,13 +20867,13 @@ function renderDeferStateAfterResourceLoading(tDetails, tNode, lContainer) {
20680
20867
  ngDevMode &&
20681
20868
  assertDefined(tDetails.loadingPromise, 'Expected loading Promise to exist on this defer block');
20682
20869
  tDetails.loadingPromise.then(() => {
20683
- if (tDetails.loadingState === 3 /* DeferDependenciesLoadingState.COMPLETE */) {
20870
+ if (tDetails.loadingState === DeferDependenciesLoadingState.COMPLETE) {
20684
20871
  ngDevMode && assertDeferredDependenciesLoaded(tDetails);
20685
20872
  // Everything is loaded, show the primary block content
20686
- renderDeferBlockState(3 /* DeferBlockInstanceState.COMPLETE */, tNode, lContainer, tDetails.primaryTmplIndex);
20873
+ renderDeferBlockState(DeferBlockState.Complete, tNode, lContainer);
20687
20874
  }
20688
- else if (tDetails.loadingState === 4 /* DeferDependenciesLoadingState.FAILED */) {
20689
- renderDeferBlockState(4 /* DeferBlockInstanceState.ERROR */, tNode, lContainer, tDetails.errorTmplIndex);
20875
+ else if (tDetails.loadingState === DeferDependenciesLoadingState.FAILED) {
20876
+ renderDeferBlockState(DeferBlockState.Error, tNode, lContainer);
20690
20877
  }
20691
20878
  });
20692
20879
  }
@@ -20710,26 +20897,26 @@ function triggerDeferBlock(lView, tNode) {
20710
20897
  const tDetails = getTDeferBlockDetails(tView, tNode);
20711
20898
  // Condition is triggered, try to render loading state and start downloading.
20712
20899
  // Note: if a block is in a loading, completed or an error state, this call would be a noop.
20713
- renderDeferBlockState(2 /* DeferBlockInstanceState.LOADING */, tNode, lContainer, tDetails.loadingTmplIndex);
20900
+ renderDeferBlockState(DeferBlockState.Loading, tNode, lContainer);
20714
20901
  switch (tDetails.loadingState) {
20715
- case 0 /* DeferDependenciesLoadingState.NOT_STARTED */:
20716
- case 1 /* DeferDependenciesLoadingState.SCHEDULED */:
20717
- triggerResourceLoading(tDetails, lView[TVIEW], lView);
20902
+ case DeferDependenciesLoadingState.NOT_STARTED:
20903
+ case DeferDependenciesLoadingState.SCHEDULED:
20904
+ triggerResourceLoading(tDetails, lView);
20718
20905
  // The `loadingState` might have changed to "loading".
20719
20906
  if (tDetails.loadingState ===
20720
- 2 /* DeferDependenciesLoadingState.IN_PROGRESS */) {
20907
+ DeferDependenciesLoadingState.IN_PROGRESS) {
20721
20908
  renderDeferStateAfterResourceLoading(tDetails, tNode, lContainer);
20722
20909
  }
20723
20910
  break;
20724
- case 2 /* DeferDependenciesLoadingState.IN_PROGRESS */:
20911
+ case DeferDependenciesLoadingState.IN_PROGRESS:
20725
20912
  renderDeferStateAfterResourceLoading(tDetails, tNode, lContainer);
20726
20913
  break;
20727
- case 3 /* DeferDependenciesLoadingState.COMPLETE */:
20914
+ case DeferDependenciesLoadingState.COMPLETE:
20728
20915
  ngDevMode && assertDeferredDependenciesLoaded(tDetails);
20729
- renderDeferBlockState(3 /* DeferBlockInstanceState.COMPLETE */, tNode, lContainer, tDetails.primaryTmplIndex);
20916
+ renderDeferBlockState(DeferBlockState.Complete, tNode, lContainer);
20730
20917
  break;
20731
- case 4 /* DeferDependenciesLoadingState.FAILED */:
20732
- renderDeferBlockState(4 /* DeferBlockInstanceState.ERROR */, tNode, lContainer, tDetails.errorTmplIndex);
20918
+ case DeferDependenciesLoadingState.FAILED:
20919
+ renderDeferBlockState(DeferBlockState.Error, tNode, lContainer);
20733
20920
  break;
20734
20921
  default:
20735
20922
  if (ngDevMode) {
@@ -20743,7 +20930,7 @@ function triggerDeferBlock(lView, tNode) {
20743
20930
  * block in completed state.
20744
20931
  */
20745
20932
  function assertDeferredDependenciesLoaded(tDetails) {
20746
- assertEqual(tDetails.loadingState, 3 /* DeferDependenciesLoadingState.COMPLETE */, 'Expecting all deferred dependencies to be loaded.');
20933
+ assertEqual(tDetails.loadingState, DeferDependenciesLoadingState.COMPLETE, 'Expecting all deferred dependencies to be loaded.');
20747
20934
  }
20748
20935
  /**
20749
20936
  * **INTERNAL**, avoid referencing it in application code.
@@ -20752,6 +20939,55 @@ function assertDeferredDependenciesLoaded(tDetails) {
20752
20939
  * implementation.
20753
20940
  */
20754
20941
  const DEFER_BLOCK_DEPENDENCY_INTERCEPTOR = new InjectionToken(ngDevMode ? 'DEFER_BLOCK_DEPENDENCY_INTERCEPTOR' : '');
20942
+ /**
20943
+ * Determines if a given value matches the expected structure of a defer block
20944
+ *
20945
+ * We can safely rely on the primaryTmplIndex because every defer block requires
20946
+ * that a primary template exists. All the other template options are optional.
20947
+ */
20948
+ function isTDeferBlockDetails(value) {
20949
+ return (typeof value === 'object') &&
20950
+ (typeof value.primaryTmplIndex === 'number');
20951
+ }
20952
+ /**
20953
+ * Internal token used for configuring defer block behavior.
20954
+ */
20955
+ const DEFER_BLOCK_CONFIG = new InjectionToken(ngDevMode ? 'DEFER_BLOCK_CONFIG' : '');
20956
+ /**
20957
+ * Retrieves all defer blocks in a given LView.
20958
+ *
20959
+ * @param lView lView with defer blocks
20960
+ * @param deferBlocks defer block aggregator array
20961
+ */
20962
+ function getDeferBlocks(lView, deferBlocks) {
20963
+ const tView = lView[TVIEW];
20964
+ for (let i = HEADER_OFFSET; i < tView.bindingStartIndex; i++) {
20965
+ if (isLContainer(lView[i])) {
20966
+ const lContainer = lView[i];
20967
+ // An LContainer may represent an instance of a defer block, in which case
20968
+ // we store it as a result. Otherwise, keep iterating over LContainer views and
20969
+ // look for defer blocks.
20970
+ const isLast = i === tView.bindingStartIndex - 1;
20971
+ if (!isLast) {
20972
+ const tNode = tView.data[i];
20973
+ const tDetails = getTDeferBlockDetails(tView, tNode);
20974
+ if (isTDeferBlockDetails(tDetails)) {
20975
+ deferBlocks.push({ lContainer, lView, tNode, tDetails });
20976
+ // This LContainer represents a defer block, so we exit
20977
+ // this iteration and don't inspect views in this LContainer.
20978
+ continue;
20979
+ }
20980
+ }
20981
+ for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {
20982
+ getDeferBlocks(lContainer[i], deferBlocks);
20983
+ }
20984
+ }
20985
+ else if (isLView(lView[i])) {
20986
+ // This is a component, enter the `getDeferBlocks` recursively.
20987
+ getDeferBlocks(lView[i], deferBlocks);
20988
+ }
20989
+ }
20990
+ }
20755
20991
 
20756
20992
  function elementStartFirstCreatePass(index, tView, lView, name, attrsIndex, localRefsIndex) {
20757
20993
  ngDevMode && assertFirstCreatePass(tView);
@@ -25555,6 +25791,10 @@ function ɵɵsetNgModuleScope(type, scope) {
25555
25791
  ngModuleDef.declarations = convertToTypeArray(scope.declarations || EMPTY_ARRAY);
25556
25792
  ngModuleDef.imports = convertToTypeArray(scope.imports || EMPTY_ARRAY);
25557
25793
  ngModuleDef.exports = convertToTypeArray(scope.exports || EMPTY_ARRAY);
25794
+ if (scope.bootstrap) {
25795
+ // This only happens in local compilation mode.
25796
+ ngModuleDef.bootstrap = convertToTypeArray(scope.bootstrap);
25797
+ }
25558
25798
  depsTracker.registerNgModule(type, scope);
25559
25799
  });
25560
25800
  }
@@ -25562,11 +25802,12 @@ function convertToTypeArray(values) {
25562
25802
  if (typeof values === 'function') {
25563
25803
  return values;
25564
25804
  }
25565
- if (values.some(isForwardRef)) {
25566
- return () => values.map(resolveForwardRef).map(maybeUnwrapModuleWithProviders);
25805
+ const flattenValues = flatten(values);
25806
+ if (flattenValues.some(isForwardRef)) {
25807
+ return () => flattenValues.map(resolveForwardRef).map(maybeUnwrapModuleWithProviders);
25567
25808
  }
25568
25809
  else {
25569
- return values.map(maybeUnwrapModuleWithProviders);
25810
+ return flattenValues.map(maybeUnwrapModuleWithProviders);
25570
25811
  }
25571
25812
  }
25572
25813
  function maybeUnwrapModuleWithProviders(value) {
@@ -26444,6 +26685,7 @@ function getPipeDef(name, registry) {
26444
26685
  if (ngDevMode) {
26445
26686
  throw new RuntimeError(-302 /* RuntimeErrorCode.PIPE_NOT_FOUND */, getPipeNotFoundErrorMessage(name));
26446
26687
  }
26688
+ return;
26447
26689
  }
26448
26690
  /**
26449
26691
  * Generates a helpful error message for the user when multiple pipes match the name.
@@ -27291,7 +27533,13 @@ function ɵɵtemplateRefExtractor(tNode, lView) {
27291
27533
 
27292
27534
  function ɵɵgetComponentDepsFactory(type, rawImports) {
27293
27535
  return () => {
27294
- return depsTracker.getComponentDependencies(type, rawImports).dependencies;
27536
+ try {
27537
+ return depsTracker.getComponentDependencies(type, rawImports).dependencies;
27538
+ }
27539
+ catch (e) {
27540
+ console.error(`Computing dependencies in local compilation mode for the component "${type.name}" failed with the exception:`, e);
27541
+ throw e;
27542
+ }
27295
27543
  };
27296
27544
  }
27297
27545
 
@@ -28068,6 +28316,9 @@ function compileComponent(type, metadata) {
28068
28316
  if (metadata.styleUrls && metadata.styleUrls.length) {
28069
28317
  error.push(` - styleUrls: ${JSON.stringify(metadata.styleUrls)}`);
28070
28318
  }
28319
+ if (metadata.styleUrl) {
28320
+ error.push(` - styleUrl: ${metadata.styleUrl}`);
28321
+ }
28071
28322
  error.push(`Did you run and wait for 'resolveComponentResources()'?`);
28072
28323
  throw new Error(error.join('\n'));
28073
28324
  }
@@ -28100,7 +28351,8 @@ function compileComponent(type, metadata) {
28100
28351
  typeSourceSpan: compiler.createParseSourceSpan('Component', type.name, templateUrl),
28101
28352
  template: metadata.template || '',
28102
28353
  preserveWhitespaces,
28103
- styles: metadata.styles || EMPTY_ARRAY,
28354
+ styles: typeof metadata.styles === 'string' ? [metadata.styles] :
28355
+ (metadata.styles || EMPTY_ARRAY),
28104
28356
  animations: metadata.animations,
28105
28357
  // JIT components are always compiled against an empty set of `declarations`. Instead, the
28106
28358
  // `directiveDefs` and `pipeDefs` are updated at a later point:
@@ -32619,6 +32871,163 @@ function ɵɵngDeclarePipe(decl) {
32619
32871
  // clang-format off
32620
32872
  // clang-format on
32621
32873
 
32874
+ /**
32875
+ * Not public API, which guarantees `EffectScheduler` only ever comes from the application root
32876
+ * injector.
32877
+ */
32878
+ const APP_EFFECT_SCHEDULER = new InjectionToken('', {
32879
+ providedIn: 'root',
32880
+ factory: () => inject(EffectScheduler),
32881
+ });
32882
+ /**
32883
+ * A scheduler which manages the execution of effects.
32884
+ */
32885
+ class EffectScheduler {
32886
+ /** @nocollapse */
32887
+ static { this.ɵprov = ɵɵdefineInjectable({
32888
+ token: EffectScheduler,
32889
+ providedIn: 'root',
32890
+ factory: () => new ZoneAwareMicrotaskScheduler(),
32891
+ }); }
32892
+ }
32893
+ /**
32894
+ * An `EffectScheduler` which is capable of queueing scheduled effects per-zone, and flushing them
32895
+ * as an explicit operation.
32896
+ */
32897
+ class ZoneAwareQueueingScheduler {
32898
+ constructor() {
32899
+ this.queuedEffectCount = 0;
32900
+ this.queues = new Map();
32901
+ }
32902
+ scheduleEffect(handle) {
32903
+ const zone = handle.creationZone;
32904
+ if (!this.queues.has(zone)) {
32905
+ this.queues.set(zone, new Set());
32906
+ }
32907
+ const queue = this.queues.get(zone);
32908
+ if (queue.has(handle)) {
32909
+ return;
32910
+ }
32911
+ this.queuedEffectCount++;
32912
+ queue.add(handle);
32913
+ }
32914
+ /**
32915
+ * Run all scheduled effects.
32916
+ *
32917
+ * Execution order of effects within the same zone is guaranteed to be FIFO, but there is no
32918
+ * ordering guarantee between effects scheduled in different zones.
32919
+ */
32920
+ flush() {
32921
+ while (this.queuedEffectCount > 0) {
32922
+ for (const [zone, queue] of this.queues) {
32923
+ // `zone` here must be defined.
32924
+ if (zone === null) {
32925
+ this.flushQueue(queue);
32926
+ }
32927
+ else {
32928
+ zone.run(() => this.flushQueue(queue));
32929
+ }
32930
+ }
32931
+ }
32932
+ }
32933
+ flushQueue(queue) {
32934
+ for (const handle of queue) {
32935
+ queue.delete(handle);
32936
+ this.queuedEffectCount--;
32937
+ // TODO: what happens if this throws an error?
32938
+ handle.run();
32939
+ }
32940
+ }
32941
+ /** @nocollapse */
32942
+ static { this.ɵprov = ɵɵdefineInjectable({
32943
+ token: ZoneAwareQueueingScheduler,
32944
+ providedIn: 'root',
32945
+ factory: () => new ZoneAwareQueueingScheduler(),
32946
+ }); }
32947
+ }
32948
+ /**
32949
+ * A wrapper around `ZoneAwareQueueingScheduler` that schedules flushing via the microtask queue
32950
+ * when.
32951
+ */
32952
+ class ZoneAwareMicrotaskScheduler {
32953
+ constructor() {
32954
+ this.hasQueuedFlush = false;
32955
+ this.delegate = new ZoneAwareQueueingScheduler();
32956
+ this.flushTask = () => {
32957
+ // Leave `hasQueuedFlush` as `true` so we don't queue another microtask if more effects are
32958
+ // scheduled during flushing. The flush of the `ZoneAwareQueueingScheduler` delegate is
32959
+ // guaranteed to empty the queue.
32960
+ this.delegate.flush();
32961
+ this.hasQueuedFlush = false;
32962
+ // This is a variable initialization, not a method.
32963
+ // tslint:disable-next-line:semicolon
32964
+ };
32965
+ }
32966
+ scheduleEffect(handle) {
32967
+ this.delegate.scheduleEffect(handle);
32968
+ if (!this.hasQueuedFlush) {
32969
+ queueMicrotask(this.flushTask);
32970
+ this.hasQueuedFlush = true;
32971
+ }
32972
+ }
32973
+ }
32974
+ /**
32975
+ * Core reactive node for an Angular effect.
32976
+ *
32977
+ * `EffectHandle` combines the reactive graph's `Watch` base node for effects with the framework's
32978
+ * scheduling abstraction (`EffectScheduler`) as well as automatic cleanup via `DestroyRef` if
32979
+ * available/requested.
32980
+ */
32981
+ class EffectHandle {
32982
+ constructor(scheduler, effectFn, creationZone, destroyRef, errorHandler, allowSignalWrites) {
32983
+ this.scheduler = scheduler;
32984
+ this.effectFn = effectFn;
32985
+ this.creationZone = creationZone;
32986
+ this.errorHandler = errorHandler;
32987
+ this.watcher =
32988
+ watch((onCleanup) => this.runEffect(onCleanup), () => this.schedule(), allowSignalWrites);
32989
+ this.unregisterOnDestroy = destroyRef?.onDestroy(() => this.destroy());
32990
+ }
32991
+ runEffect(onCleanup) {
32992
+ try {
32993
+ this.effectFn(onCleanup);
32994
+ }
32995
+ catch (err) {
32996
+ this.errorHandler?.handleError(err);
32997
+ }
32998
+ }
32999
+ run() {
33000
+ this.watcher.run();
33001
+ }
33002
+ schedule() {
33003
+ this.scheduler.scheduleEffect(this);
33004
+ }
33005
+ notify() {
33006
+ this.watcher.notify();
33007
+ }
33008
+ destroy() {
33009
+ this.watcher.destroy();
33010
+ this.unregisterOnDestroy?.();
33011
+ // Note: if the effect is currently scheduled, it's not un-scheduled, and so the scheduler will
33012
+ // retain a reference to it. Attempting to execute it will be a no-op.
33013
+ }
33014
+ }
33015
+ /**
33016
+ * Create a global `Effect` for the given reactive function.
33017
+ *
33018
+ * @developerPreview
33019
+ */
33020
+ function effect(effectFn, options) {
33021
+ !options?.injector && assertInInjectionContext(effect);
33022
+ const injector = options?.injector ?? inject(Injector);
33023
+ const errorHandler = injector.get(ErrorHandler, null, { optional: true });
33024
+ const destroyRef = options?.manualCleanup !== true ? injector.get(DestroyRef) : null;
33025
+ const handle = new EffectHandle(injector.get(APP_EFFECT_SCHEDULER), effectFn, (typeof Zone === 'undefined') ? null : Zone.current, destroyRef, errorHandler, options?.allowSignalWrites ?? false);
33026
+ // Effects start dirty.
33027
+ handle.notify();
33028
+ return handle;
33029
+ }
33030
+
32622
33031
  // clang-format off
32623
33032
  // clang-format on
32624
33033
 
@@ -32809,5 +33218,5 @@ if (typeof ngDevMode !== 'undefined' && ngDevMode) {
32809
33218
  * Generated bundle index. Do not edit.
32810
33219
  */
32811
33220
 
32812
- export { ANIMATION_MODULE_TYPE, APP_BOOTSTRAP_LISTENER, APP_ID, APP_INITIALIZER, ApplicationInitStatus, ApplicationModule, ApplicationRef, Attribute, COMPILER_OPTIONS, CSP_NONCE, 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, Renderer2, RendererFactory2, RendererStyleFlags2, Sanitizer, SecurityContext, Self, SimpleChange, SkipSelf, TRANSLATIONS, TRANSLATIONS_FORMAT, TemplateRef, Testability, TestabilityRegistry, TransferState, Type, VERSION, Version, ViewChild, ViewChildren, ViewContainerRef, ViewEncapsulation$1 as ViewEncapsulation, ViewRef, afterNextRender, afterRender, asNativeElements, assertInInjectionContext, assertPlatform, booleanAttribute, computed, createComponent, createEnvironmentInjector, createNgModule, createNgModuleRef, createPlatform, createPlatformFactory, defineInjectable, destroyPlatform, effect, enableProdMode, forwardRef, getDebugNode, getModuleFactory, getNgModuleById, getPlatform, importProvidersFrom, inject, isDevMode, isSignal, isStandalone, makeEnvironmentProviders, makeStateKey, mergeApplicationConfig, numberAttribute, platformCore, provideZoneChangeDetection, reflectComponentType, resolveForwardRef, runInInjectionContext, setTestabilityGetter, signal, untracked, ALLOW_MULTIPLE_PLATFORMS as ɵALLOW_MULTIPLE_PLATFORMS, AfterRenderEventManager as ɵAfterRenderEventManager, ComponentFactory$1 as ɵComponentFactory, Console as ɵConsole, DEFAULT_LOCALE_ID as ɵDEFAULT_LOCALE_ID, DEFER_BLOCK_DEPENDENCY_INTERCEPTOR as ɵDEFER_BLOCK_DEPENDENCY_INTERCEPTOR, ENABLED_SSR_FEATURES as ɵENABLED_SSR_FEATURES, INJECTOR_SCOPE as ɵINJECTOR_SCOPE, IS_HYDRATION_DOM_REUSE_ENABLED as ɵIS_HYDRATION_DOM_REUSE_ENABLED, InitialRenderPendingTasks as ɵInitialRenderPendingTasks, 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, SSR_CONTENT_INTEGRITY_MARKER as ɵSSR_CONTENT_INTEGRITY_MARKER, TESTABILITY as ɵTESTABILITY, TESTABILITY_GETTER as ɵTESTABILITY_GETTER, USE_RUNTIME_DEPS_TRACKER_FOR_JIT as ɵUSE_RUNTIME_DEPS_TRACKER_FOR_JIT, 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, 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, depsTracker as ɵdepsTracker, detectChanges as ɵdetectChanges, devModeEqual as ɵdevModeEqual, findLocaleData as ɵfindLocaleData, flushModuleScopingQueueAsMuchAsPossible as ɵflushModuleScopingQueueAsMuchAsPossible, formatRuntimeError as ɵformatRuntimeError, generateStandaloneInDeclarationsError as ɵgenerateStandaloneInDeclarationsError, getAsyncClassMetadata as ɵgetAsyncClassMetadata, 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, isComponentDefPendingResolution as ɵisComponentDefPendingResolution, isEnvironmentProviders as ɵisEnvironmentProviders, isInjectable as ɵisInjectable, isNgModule as ɵisNgModule, isPromise as ɵisPromise, isSubscribable as ɵisSubscribable, 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, restoreComponentResolutionQueue as ɵrestoreComponentResolutionQueue, setAllowDuplicateNgModuleIdsForTest as ɵsetAllowDuplicateNgModuleIdsForTest, setAlternateWeakRefImpl as ɵsetAlternateWeakRefImpl, setClassMetadata as ɵsetClassMetadata, setClassMetadataAsync as ɵsetClassMetadataAsync, setCurrentInjector as ɵsetCurrentInjector, setDocument as ɵsetDocument, setInjectorProfilerContext as ɵsetInjectorProfilerContext, setLocaleId as ɵsetLocaleId, ɵsetUnknownElementStrictMode, ɵsetUnknownPropertyStrictMode, store as ɵstore, stringify as ɵstringify, transitiveScopesFor as ɵtransitiveScopesFor, unregisterAllLocaleData as ɵunregisterLocaleData, unwrapSafeValue as ɵunwrapSafeValue, withDomHydration as ɵwithDomHydration, ɵɵCopyDefinitionFeature, FactoryTarget as ɵɵFactoryTarget, ɵɵHostDirectivesFeature, ɵɵInheritDefinitionFeature, ɵɵInputTransformsFeature, ɵɵ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, ɵɵcomponentInstance, ɵɵconditional, ɵɵcontentQuery, ɵɵdefer, ɵɵdeferOnHover, ɵɵdeferOnIdle, ɵɵdeferOnImmediate, ɵɵdeferOnInteraction, ɵɵdeferOnTimer, ɵɵdeferOnViewport, ɵɵdeferPrefetchOnHover, ɵɵdeferPrefetchOnIdle, ɵɵdeferPrefetchOnImmediate, ɵɵdeferPrefetchOnInteraction, ɵɵdeferPrefetchOnTimer, ɵɵdeferPrefetchOnViewport, ɵɵdeferPrefetchWhen, ɵɵdeferWhen, ɵɵdefineComponent, ɵɵdefineDirective, ɵɵdefineInjectable, ɵɵdefineInjector, ɵɵdefineNgModule, ɵɵdefinePipe, ɵɵdirectiveInject, ɵɵdisableBindings, ɵɵelement, ɵɵelementContainer, ɵɵelementContainerEnd, ɵɵelementContainerStart, ɵɵelementEnd, ɵɵelementStart, ɵɵenableBindings, ɵɵgetComponentDepsFactory, ɵɵ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, ɵɵrepeater, ɵɵrepeaterCreate, ɵɵrepeaterTrackByIdentity, ɵɵrepeaterTrackByIndex, ɵɵ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 };
33221
+ export { ANIMATION_MODULE_TYPE, APP_BOOTSTRAP_LISTENER, APP_ID, APP_INITIALIZER, AfterRenderPhase, ApplicationInitStatus, ApplicationModule, ApplicationRef, Attribute, COMPILER_OPTIONS, CSP_NONCE, 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, Renderer2, RendererFactory2, RendererStyleFlags2, Sanitizer, SecurityContext, Self, SimpleChange, SkipSelf, TRANSLATIONS, TRANSLATIONS_FORMAT, TemplateRef, Testability, TestabilityRegistry, TransferState, Type, VERSION, Version, ViewChild, ViewChildren, ViewContainerRef, ViewEncapsulation$1 as ViewEncapsulation, ViewRef, afterNextRender, afterRender, asNativeElements, assertInInjectionContext, assertPlatform, booleanAttribute, computed, createComponent, createEnvironmentInjector, createNgModule, createNgModuleRef, createPlatform, createPlatformFactory, defineInjectable, destroyPlatform, effect, enableProdMode, forwardRef, getDebugNode, getModuleFactory, getNgModuleById, getPlatform, importProvidersFrom, inject, isDevMode, isSignal, isStandalone, makeEnvironmentProviders, makeStateKey, mergeApplicationConfig, numberAttribute, platformCore, provideZoneChangeDetection, reflectComponentType, resolveForwardRef, runInInjectionContext, setTestabilityGetter, signal, untracked, ALLOW_MULTIPLE_PLATFORMS as ɵALLOW_MULTIPLE_PLATFORMS, AfterRenderEventManager as ɵAfterRenderEventManager, CONTAINER_HEADER_OFFSET as ɵCONTAINER_HEADER_OFFSET, ComponentFactory$1 as ɵComponentFactory, Console as ɵConsole, DEFAULT_LOCALE_ID as ɵDEFAULT_LOCALE_ID, DEFER_BLOCK_CONFIG as ɵDEFER_BLOCK_CONFIG, DEFER_BLOCK_DEPENDENCY_INTERCEPTOR as ɵDEFER_BLOCK_DEPENDENCY_INTERCEPTOR, DeferBlockBehavior as ɵDeferBlockBehavior, DeferBlockState as ɵDeferBlockState, ENABLED_SSR_FEATURES as ɵENABLED_SSR_FEATURES, EffectScheduler as ɵEffectScheduler, INJECTOR_SCOPE as ɵINJECTOR_SCOPE, IS_HYDRATION_DOM_REUSE_ENABLED as ɵIS_HYDRATION_DOM_REUSE_ENABLED, InitialRenderPendingTasks as ɵInitialRenderPendingTasks, 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, SSR_CONTENT_INTEGRITY_MARKER as ɵSSR_CONTENT_INTEGRITY_MARKER, TESTABILITY as ɵTESTABILITY, TESTABILITY_GETTER as ɵTESTABILITY_GETTER, USE_RUNTIME_DEPS_TRACKER_FOR_JIT as ɵUSE_RUNTIME_DEPS_TRACKER_FOR_JIT, ViewRef$1 as ɵViewRef, XSS_SECURITY_URL as ɵXSS_SECURITY_URL, ZoneAwareQueueingScheduler as ɵZoneAwareQueueingScheduler, _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, 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, depsTracker as ɵdepsTracker, detectChanges as ɵdetectChanges, devModeEqual as ɵdevModeEqual, findLocaleData as ɵfindLocaleData, flushModuleScopingQueueAsMuchAsPossible as ɵflushModuleScopingQueueAsMuchAsPossible, formatRuntimeError as ɵformatRuntimeError, generateStandaloneInDeclarationsError as ɵgenerateStandaloneInDeclarationsError, getAsyncClassMetadata as ɵgetAsyncClassMetadata, getDebugNode as ɵgetDebugNode, getDeferBlocks as ɵgetDeferBlocks, 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, isComponentDefPendingResolution as ɵisComponentDefPendingResolution, isEnvironmentProviders as ɵisEnvironmentProviders, isInjectable as ɵisInjectable, isNgModule as ɵisNgModule, isPromise as ɵisPromise, isSubscribable as ɵisSubscribable, noSideEffects as ɵnoSideEffects, patchComponentDefWithScope as ɵpatchComponentDefWithScope, publishDefaultGlobalUtils$1 as ɵpublishDefaultGlobalUtils, publishGlobalUtil as ɵpublishGlobalUtil, registerLocaleData as ɵregisterLocaleData, renderDeferBlockState as ɵrenderDeferBlockState, resetCompiledComponents as ɵresetCompiledComponents, resetJitOptions as ɵresetJitOptions, resolveComponentResources as ɵresolveComponentResources, restoreComponentResolutionQueue as ɵrestoreComponentResolutionQueue, setAllowDuplicateNgModuleIdsForTest as ɵsetAllowDuplicateNgModuleIdsForTest, setAlternateWeakRefImpl as ɵsetAlternateWeakRefImpl, setClassMetadata as ɵsetClassMetadata, setClassMetadataAsync as ɵsetClassMetadataAsync, setCurrentInjector as ɵsetCurrentInjector, setDocument as ɵsetDocument, setInjectorProfilerContext as ɵsetInjectorProfilerContext, setLocaleId as ɵsetLocaleId, ɵsetUnknownElementStrictMode, ɵsetUnknownPropertyStrictMode, store as ɵstore, stringify as ɵstringify, transitiveScopesFor as ɵtransitiveScopesFor, triggerResourceLoading as ɵtriggerResourceLoading, unregisterAllLocaleData as ɵunregisterLocaleData, unwrapSafeValue as ɵunwrapSafeValue, withDomHydration as ɵwithDomHydration, ɵɵCopyDefinitionFeature, FactoryTarget as ɵɵFactoryTarget, ɵɵHostDirectivesFeature, ɵɵInheritDefinitionFeature, ɵɵInputTransformsFeature, ɵɵ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, ɵɵcomponentInstance, ɵɵconditional, ɵɵcontentQuery, ɵɵdefer, ɵɵdeferOnHover, ɵɵdeferOnIdle, ɵɵdeferOnImmediate, ɵɵdeferOnInteraction, ɵɵdeferOnTimer, ɵɵdeferOnViewport, ɵɵdeferPrefetchOnHover, ɵɵdeferPrefetchOnIdle, ɵɵdeferPrefetchOnImmediate, ɵɵdeferPrefetchOnInteraction, ɵɵdeferPrefetchOnTimer, ɵɵdeferPrefetchOnViewport, ɵɵdeferPrefetchWhen, ɵɵdeferWhen, ɵɵdefineComponent, ɵɵdefineDirective, ɵɵdefineInjectable, ɵɵdefineInjector, ɵɵdefineNgModule, ɵɵdefinePipe, ɵɵdirectiveInject, ɵɵdisableBindings, ɵɵelement, ɵɵelementContainer, ɵɵelementContainerEnd, ɵɵelementContainerStart, ɵɵelementEnd, ɵɵelementStart, ɵɵenableBindings, ɵɵgetComponentDepsFactory, ɵɵ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, ɵɵrepeater, ɵɵrepeaterCreate, ɵɵrepeaterTrackByIdentity, ɵɵrepeaterTrackByIndex, ɵɵ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 };
32813
33222
  //# sourceMappingURL=core.mjs.map