@angular/core 15.0.0-next.3 → 15.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 (40) hide show
  1. package/esm2020/src/core_private_export.mjs +2 -2
  2. package/esm2020/src/di/index.mjs +1 -1
  3. package/esm2020/src/di/injectable.mjs +1 -1
  4. package/esm2020/src/di/injection_token.mjs +6 -3
  5. package/esm2020/src/di/injector.mjs +1 -1
  6. package/esm2020/src/di/injector_compatibility.mjs +15 -11
  7. package/esm2020/src/di/interface/injector.mjs +1 -1
  8. package/esm2020/src/di/r3_injector.mjs +3 -2
  9. package/esm2020/src/errors.mjs +1 -1
  10. package/esm2020/src/metadata/directives.mjs +1 -1
  11. package/esm2020/src/render3/component_ref.mjs +113 -84
  12. package/esm2020/src/render3/context_discovery.mjs +7 -7
  13. package/esm2020/src/render3/di.mjs +3 -2
  14. package/esm2020/src/render3/features/host_directives_feature.mjs +101 -10
  15. package/esm2020/src/render3/features/ng_onchanges_feature.mjs +4 -2
  16. package/esm2020/src/render3/instructions/element.mjs +3 -15
  17. package/esm2020/src/render3/instructions/shared.mjs +151 -128
  18. package/esm2020/src/render3/interfaces/definition.mjs +1 -1
  19. package/esm2020/src/render3/jit/module.mjs +2 -2
  20. package/esm2020/src/render3/ng_module_ref.mjs +1 -1
  21. package/esm2020/src/render3/node_manipulation.mjs +15 -1
  22. package/esm2020/src/render3/util/discovery_utils.mjs +2 -2
  23. package/esm2020/src/util/is_dev_mode.mjs +11 -19
  24. package/esm2020/src/version.mjs +1 -1
  25. package/esm2020/src/zone/async-stack-tagging.mjs +28 -0
  26. package/esm2020/src/zone/ng_zone.mjs +8 -3
  27. package/esm2020/testing/src/logger.mjs +3 -3
  28. package/esm2020/testing/src/ng_zone_mock.mjs +3 -3
  29. package/esm2020/testing/src/test_bed.mjs +4 -4
  30. package/fesm2015/core.mjs +1789 -1613
  31. package/fesm2015/core.mjs.map +1 -1
  32. package/fesm2015/testing.mjs +1055 -904
  33. package/fesm2015/testing.mjs.map +1 -1
  34. package/fesm2020/core.mjs +1788 -1614
  35. package/fesm2020/core.mjs.map +1 -1
  36. package/fesm2020/testing.mjs +1052 -902
  37. package/fesm2020/testing.mjs.map +1 -1
  38. package/index.d.ts +105 -24
  39. package/package.json +1 -1
  40. package/testing/index.d.ts +9 -1
package/fesm2015/core.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v15.0.0-next.3
2
+ * @license Angular v15.0.0-next.5
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -582,152 +582,6 @@ function assertInjectImplementationNotEqual(fn) {
582
582
  assertNotEqual(_injectImplementation, fn, 'Calling ɵɵinject would cause infinite recursion');
583
583
  }
584
584
 
585
- /**
586
- * @license
587
- * Copyright Google LLC All Rights Reserved.
588
- *
589
- * Use of this source code is governed by an MIT-style license that can be
590
- * found in the LICENSE file at https://angular.io/license
591
- */
592
- /**
593
- * Convince closure compiler that the wrapped function has no side-effects.
594
- *
595
- * Closure compiler always assumes that `toString` has no side-effects. We use this quirk to
596
- * allow us to execute a function but have closure compiler mark the call as no-side-effects.
597
- * It is important that the return value for the `noSideEffects` function be assigned
598
- * to something which is retained otherwise the call to `noSideEffects` will be removed by closure
599
- * compiler.
600
- */
601
- function noSideEffects(fn) {
602
- return { toString: fn }.toString();
603
- }
604
-
605
- /**
606
- * @license
607
- * Copyright Google LLC All Rights Reserved.
608
- *
609
- * Use of this source code is governed by an MIT-style license that can be
610
- * found in the LICENSE file at https://angular.io/license
611
- */
612
- /**
613
- * The strategy that the default change detector uses to detect changes.
614
- * When set, takes effect the next time change detection is triggered.
615
- *
616
- * @see {@link ChangeDetectorRef#usage-notes Change detection usage}
617
- *
618
- * @publicApi
619
- */
620
- var ChangeDetectionStrategy;
621
- (function (ChangeDetectionStrategy) {
622
- /**
623
- * Use the `CheckOnce` strategy, meaning that automatic change detection is deactivated
624
- * until reactivated by setting the strategy to `Default` (`CheckAlways`).
625
- * Change detection can still be explicitly invoked.
626
- * This strategy applies to all child directives and cannot be overridden.
627
- */
628
- ChangeDetectionStrategy[ChangeDetectionStrategy["OnPush"] = 0] = "OnPush";
629
- /**
630
- * Use the default `CheckAlways` strategy, in which change detection is automatic until
631
- * explicitly deactivated.
632
- */
633
- ChangeDetectionStrategy[ChangeDetectionStrategy["Default"] = 1] = "Default";
634
- })(ChangeDetectionStrategy || (ChangeDetectionStrategy = {}));
635
- /**
636
- * Defines the possible states of the default change detector.
637
- * @see `ChangeDetectorRef`
638
- */
639
- var ChangeDetectorStatus;
640
- (function (ChangeDetectorStatus) {
641
- /**
642
- * A state in which, after calling `detectChanges()`, the change detector
643
- * state becomes `Checked`, and must be explicitly invoked or reactivated.
644
- */
645
- ChangeDetectorStatus[ChangeDetectorStatus["CheckOnce"] = 0] = "CheckOnce";
646
- /**
647
- * A state in which change detection is skipped until the change detector mode
648
- * becomes `CheckOnce`.
649
- */
650
- ChangeDetectorStatus[ChangeDetectorStatus["Checked"] = 1] = "Checked";
651
- /**
652
- * A state in which change detection continues automatically until explicitly
653
- * deactivated.
654
- */
655
- ChangeDetectorStatus[ChangeDetectorStatus["CheckAlways"] = 2] = "CheckAlways";
656
- /**
657
- * A state in which a change detector sub tree is not a part of the main tree and
658
- * should be skipped.
659
- */
660
- ChangeDetectorStatus[ChangeDetectorStatus["Detached"] = 3] = "Detached";
661
- /**
662
- * Indicates that the change detector encountered an error checking a binding
663
- * or calling a directive lifecycle method and is now in an inconsistent state. Change
664
- * detectors in this state do not detect changes.
665
- */
666
- ChangeDetectorStatus[ChangeDetectorStatus["Errored"] = 4] = "Errored";
667
- /**
668
- * Indicates that the change detector has been destroyed.
669
- */
670
- ChangeDetectorStatus[ChangeDetectorStatus["Destroyed"] = 5] = "Destroyed";
671
- })(ChangeDetectorStatus || (ChangeDetectorStatus = {}));
672
- /**
673
- * Reports whether a given strategy is currently the default for change detection.
674
- * @param changeDetectionStrategy The strategy to check.
675
- * @returns True if the given strategy is the current default, false otherwise.
676
- * @see `ChangeDetectorStatus`
677
- * @see `ChangeDetectorRef`
678
- */
679
- function isDefaultChangeDetectionStrategy(changeDetectionStrategy) {
680
- return changeDetectionStrategy == null ||
681
- changeDetectionStrategy === ChangeDetectionStrategy.Default;
682
- }
683
-
684
- /**
685
- * @license
686
- * Copyright Google LLC All Rights Reserved.
687
- *
688
- * Use of this source code is governed by an MIT-style license that can be
689
- * found in the LICENSE file at https://angular.io/license
690
- */
691
- /**
692
- * Defines the CSS styles encapsulation policies for the {@link Component} decorator's
693
- * `encapsulation` option.
694
- *
695
- * See {@link Component#encapsulation encapsulation}.
696
- *
697
- * @usageNotes
698
- * ### Example
699
- *
700
- * {@example core/ts/metadata/encapsulation.ts region='longform'}
701
- *
702
- * @publicApi
703
- */
704
- var ViewEncapsulation$1;
705
- (function (ViewEncapsulation) {
706
- // TODO: consider making `ViewEncapsulation` a `const enum` instead. See
707
- // https://github.com/angular/angular/issues/44119 for additional information.
708
- /**
709
- * Emulates a native Shadow DOM encapsulation behavior by adding a specific attribute to the
710
- * component's host element and applying the same attribute to all the CSS selectors provided
711
- * via {@link Component#styles styles} or {@link Component#styleUrls styleUrls}.
712
- *
713
- * This is the default option.
714
- */
715
- ViewEncapsulation[ViewEncapsulation["Emulated"] = 0] = "Emulated";
716
- // Historically the 1 value was for `Native` encapsulation which has been removed as of v11.
717
- /**
718
- * Doesn't provide any sort of CSS style encapsulation, meaning that all the styles provided
719
- * via {@link Component#styles styles} or {@link Component#styleUrls styleUrls} are applicable
720
- * to any HTML element of the application regardless of their host Component.
721
- */
722
- ViewEncapsulation[ViewEncapsulation["None"] = 2] = "None";
723
- /**
724
- * Uses the browser's native Shadow DOM API to encapsulate CSS styles, meaning that it creates
725
- * a ShadowRoot for the component's host element which is then used to encapsulate
726
- * all the Component's styling.
727
- */
728
- ViewEncapsulation[ViewEncapsulation["ShadowDom"] = 3] = "ShadowDom";
729
- })(ViewEncapsulation$1 || (ViewEncapsulation$1 = {}));
730
-
731
585
  /**
732
586
  * @license
733
587
  * Copyright Google LLC All Rights Reserved.
@@ -826,61 +680,437 @@ function initNgDevMode() {
826
680
  * Use of this source code is governed by an MIT-style license that can be
827
681
  * found in the LICENSE file at https://angular.io/license
828
682
  */
683
+ const _THROW_IF_NOT_FOUND = {};
684
+ const THROW_IF_NOT_FOUND = _THROW_IF_NOT_FOUND;
685
+ /*
686
+ * Name of a property (that we patch onto DI decorator), which is used as an annotation of which
687
+ * InjectFlag this decorator represents. This allows to avoid direct references to the DI decorators
688
+ * in the code, thus making them tree-shakable.
689
+ */
690
+ const DI_DECORATOR_FLAG = '__NG_DI_FLAG__';
691
+ const NG_TEMP_TOKEN_PATH = 'ngTempTokenPath';
692
+ const NG_TOKEN_PATH = 'ngTokenPath';
693
+ const NEW_LINE = /\n/gm;
694
+ const NO_NEW_LINE = 'ɵ';
695
+ const SOURCE = '__source';
829
696
  /**
830
- * This file contains reuseable "empty" symbols that can be used as default return values
831
- * in different parts of the rendering code. Because the same symbols are returned, this
832
- * allows for identity checks against these values to be consistently used by the framework
833
- * code.
697
+ * Current injector value used by `inject`.
698
+ * - `undefined`: it is an error to call `inject`
699
+ * - `null`: `inject` can be called but there is no injector (limp-mode).
700
+ * - Injector instance: Use the injector for resolution.
834
701
  */
835
- const EMPTY_OBJ = {};
836
- const EMPTY_ARRAY = [];
837
- // freezing the values prevents any code from accidentally inserting new values in
838
- if ((typeof ngDevMode === 'undefined' || ngDevMode) && initNgDevMode()) {
839
- // These property accesses can be ignored because ngDevMode will be set to false
840
- // when optimizing code and the whole if statement will be dropped.
841
- // tslint:disable-next-line:no-toplevel-property-access
842
- Object.freeze(EMPTY_OBJ);
843
- // tslint:disable-next-line:no-toplevel-property-access
844
- Object.freeze(EMPTY_ARRAY);
702
+ let _currentInjector = undefined;
703
+ function setCurrentInjector(injector) {
704
+ const former = _currentInjector;
705
+ _currentInjector = injector;
706
+ return former;
707
+ }
708
+ function injectInjectorOnly(token, flags = InjectFlags.Default) {
709
+ if (_currentInjector === undefined) {
710
+ throw new RuntimeError(-203 /* RuntimeErrorCode.MISSING_INJECTION_CONTEXT */, ngDevMode &&
711
+ `inject() must be called from an injection context such as a constructor, a factory function, a field initializer, or a function used with \`EnvironmentInjector#runInContext\`.`);
712
+ }
713
+ else if (_currentInjector === null) {
714
+ return injectRootLimpMode(token, undefined, flags);
715
+ }
716
+ else {
717
+ return _currentInjector.get(token, flags & InjectFlags.Optional ? null : undefined, flags);
718
+ }
719
+ }
720
+ function ɵɵinject(token, flags = InjectFlags.Default) {
721
+ return (getInjectImplementation() || injectInjectorOnly)(resolveForwardRef(token), flags);
845
722
  }
846
-
847
723
  /**
848
- * @license
849
- * Copyright Google LLC All Rights Reserved.
724
+ * Throws an error indicating that a factory function could not be generated by the compiler for a
725
+ * particular class.
850
726
  *
851
- * Use of this source code is governed by an MIT-style license that can be
852
- * found in the LICENSE file at https://angular.io/license
853
- */
854
- const NG_COMP_DEF = getClosureSafeProperty({ ɵcmp: getClosureSafeProperty });
855
- const NG_DIR_DEF = getClosureSafeProperty({ ɵdir: getClosureSafeProperty });
856
- const NG_PIPE_DEF = getClosureSafeProperty({ ɵpipe: getClosureSafeProperty });
857
- const NG_MOD_DEF = getClosureSafeProperty({ ɵmod: getClosureSafeProperty });
858
- const NG_FACTORY_DEF = getClosureSafeProperty({ ɵfac: getClosureSafeProperty });
859
- /**
860
- * If a directive is diPublic, bloomAdd sets a property on the type with this constant as
861
- * the key and the directive's unique ID as the value. This allows us to map directives to their
862
- * bloom filter bit for DI.
727
+ * The name of the class is not mentioned here, but will be in the generated factory function name
728
+ * and thus in the stack trace.
729
+ *
730
+ * @codeGenApi
863
731
  */
864
- // TODO(misko): This is wrong. The NG_ELEMENT_ID should never be minified.
865
- const NG_ELEMENT_ID = getClosureSafeProperty({ __NG_ELEMENT_ID__: getClosureSafeProperty });
732
+ function ɵɵinvalidFactoryDep(index) {
733
+ throw new RuntimeError(202 /* RuntimeErrorCode.INVALID_FACTORY_DEPENDENCY */, ngDevMode &&
734
+ `This constructor is not compatible with Angular Dependency Injection because its dependency at index ${index} of the parameter list is invalid.
735
+ This can happen if the dependency type is a primitive like a string or if an ancestor of this class is missing an Angular decorator.
866
736
 
737
+ Please check that 1) the type for the parameter at index ${index} is correct and 2) the correct Angular decorators are defined for this class and its ancestors.`);
738
+ }
867
739
  /**
868
- * @license
869
- * Copyright Google LLC All Rights Reserved.
740
+ * Injects a token from the currently active injector.
741
+ * `inject` is only supported during instantiation of a dependency by the DI system. It can be used
742
+ * during:
743
+ * - Construction (via the `constructor`) of a class being instantiated by the DI system, such
744
+ * as an `@Injectable` or `@Component`.
745
+ * - In the initializer for fields of such classes.
746
+ * - In the factory function specified for `useFactory` of a `Provider` or an `@Injectable`.
747
+ * - In the `factory` function specified for an `InjectionToken`.
870
748
  *
871
- * Use of this source code is governed by an MIT-style license that can be
872
- * found in the LICENSE file at https://angular.io/license
873
- */
874
- /** Counter used to generate unique IDs for component definitions. */
875
- let componentDefCount = 0;
876
- /**
877
- * Create a component definition object.
749
+ * @param token A token that represents a dependency that should be injected.
750
+ * @param flags Optional flags that control how injection is executed.
751
+ * The flags correspond to injection strategies that can be specified with
752
+ * parameter decorators `@Host`, `@Self`, `@SkipSef`, and `@Optional`.
753
+ * @returns the injected value if operation is successful, `null` otherwise.
754
+ * @throws if called outside of a supported context.
878
755
  *
756
+ * @usageNotes
757
+ * In practice the `inject()` calls are allowed in a constructor, a constructor parameter and a
758
+ * field initializer:
879
759
  *
880
- * # Example
881
- * ```
882
- * class MyDirective {
883
- * // Generated by Angular Template Compiler
760
+ * ```typescript
761
+ * @Injectable({providedIn: 'root'})
762
+ * export class Car {
763
+ * radio: Radio|undefined;
764
+ * // OK: field initializer
765
+ * spareTyre = inject(Tyre);
766
+ *
767
+ * constructor() {
768
+ * // OK: constructor body
769
+ * this.radio = inject(Radio);
770
+ * }
771
+ * }
772
+ * ```
773
+ *
774
+ * It is also legal to call `inject` from a provider's factory:
775
+ *
776
+ * ```typescript
777
+ * providers: [
778
+ * {provide: Car, useFactory: () => {
779
+ * // OK: a class factory
780
+ * const engine = inject(Engine);
781
+ * return new Car(engine);
782
+ * }}
783
+ * ]
784
+ * ```
785
+ *
786
+ * Calls to the `inject()` function outside of the class creation context will result in error. Most
787
+ * notably, calls to `inject()` are disallowed after a class instance was created, in methods
788
+ * (including lifecycle hooks):
789
+ *
790
+ * ```typescript
791
+ * @Component({ ... })
792
+ * export class CarComponent {
793
+ * ngOnInit() {
794
+ * // ERROR: too late, the component instance was already created
795
+ * const engine = inject(Engine);
796
+ * engine.start();
797
+ * }
798
+ * }
799
+ * ```
800
+ *
801
+ * @publicApi
802
+ */
803
+ function inject(token, flags = InjectFlags.Default) {
804
+ return ɵɵinject(token, convertToBitFlags(flags));
805
+ }
806
+ // Converts object-based DI flags (`InjectOptions`) to bit flags (`InjectFlags`).
807
+ function convertToBitFlags(flags) {
808
+ if (typeof flags === 'undefined' || typeof flags === 'number') {
809
+ return flags;
810
+ }
811
+ // While TypeScript doesn't accept it without a cast, bitwise OR with false-y values in
812
+ // JavaScript is a no-op. We can use that for a very codesize-efficient conversion from
813
+ // `InjectOptions` to `InjectFlags`.
814
+ return (0 /* InternalInjectFlags.Default */ | // comment to force a line break in the formatter
815
+ (flags.optional && 8 /* InternalInjectFlags.Optional */) |
816
+ (flags.host && 1 /* InternalInjectFlags.Host */) |
817
+ (flags.self && 2 /* InternalInjectFlags.Self */) |
818
+ (flags.skipSelf && 4 /* InternalInjectFlags.SkipSelf */));
819
+ }
820
+ function injectArgs(types) {
821
+ const args = [];
822
+ for (let i = 0; i < types.length; i++) {
823
+ const arg = resolveForwardRef(types[i]);
824
+ if (Array.isArray(arg)) {
825
+ if (arg.length === 0) {
826
+ throw new RuntimeError(900 /* RuntimeErrorCode.INVALID_DIFFER_INPUT */, ngDevMode && 'Arguments array must have arguments.');
827
+ }
828
+ let type = undefined;
829
+ let flags = InjectFlags.Default;
830
+ for (let j = 0; j < arg.length; j++) {
831
+ const meta = arg[j];
832
+ const flag = getInjectFlag(meta);
833
+ if (typeof flag === 'number') {
834
+ // Special case when we handle @Inject decorator.
835
+ if (flag === -1 /* DecoratorFlags.Inject */) {
836
+ type = meta.token;
837
+ }
838
+ else {
839
+ flags |= flag;
840
+ }
841
+ }
842
+ else {
843
+ type = meta;
844
+ }
845
+ }
846
+ args.push(ɵɵinject(type, flags));
847
+ }
848
+ else {
849
+ args.push(ɵɵinject(arg));
850
+ }
851
+ }
852
+ return args;
853
+ }
854
+ /**
855
+ * Attaches a given InjectFlag to a given decorator using monkey-patching.
856
+ * Since DI decorators can be used in providers `deps` array (when provider is configured using
857
+ * `useFactory`) without initialization (e.g. `Host`) and as an instance (e.g. `new Host()`), we
858
+ * attach the flag to make it available both as a static property and as a field on decorator
859
+ * instance.
860
+ *
861
+ * @param decorator Provided DI decorator.
862
+ * @param flag InjectFlag that should be applied.
863
+ */
864
+ function attachInjectFlag(decorator, flag) {
865
+ decorator[DI_DECORATOR_FLAG] = flag;
866
+ decorator.prototype[DI_DECORATOR_FLAG] = flag;
867
+ return decorator;
868
+ }
869
+ /**
870
+ * Reads monkey-patched property that contains InjectFlag attached to a decorator.
871
+ *
872
+ * @param token Token that may contain monkey-patched DI flags property.
873
+ */
874
+ function getInjectFlag(token) {
875
+ return token[DI_DECORATOR_FLAG];
876
+ }
877
+ function catchInjectorError(e, token, injectorErrorName, source) {
878
+ const tokenPath = e[NG_TEMP_TOKEN_PATH];
879
+ if (token[SOURCE]) {
880
+ tokenPath.unshift(token[SOURCE]);
881
+ }
882
+ e.message = formatError('\n' + e.message, tokenPath, injectorErrorName, source);
883
+ e[NG_TOKEN_PATH] = tokenPath;
884
+ e[NG_TEMP_TOKEN_PATH] = null;
885
+ throw e;
886
+ }
887
+ function formatError(text, obj, injectorErrorName, source = null) {
888
+ text = text && text.charAt(0) === '\n' && text.charAt(1) == NO_NEW_LINE ? text.slice(2) : text;
889
+ let context = stringify(obj);
890
+ if (Array.isArray(obj)) {
891
+ context = obj.map(stringify).join(' -> ');
892
+ }
893
+ else if (typeof obj === 'object') {
894
+ let parts = [];
895
+ for (let key in obj) {
896
+ if (obj.hasOwnProperty(key)) {
897
+ let value = obj[key];
898
+ parts.push(key + ':' + (typeof value === 'string' ? JSON.stringify(value) : stringify(value)));
899
+ }
900
+ }
901
+ context = `{${parts.join(', ')}}`;
902
+ }
903
+ return `${injectorErrorName}${source ? '(' + source + ')' : ''}[${context}]: ${text.replace(NEW_LINE, '\n ')}`;
904
+ }
905
+
906
+ /**
907
+ * @license
908
+ * Copyright Google LLC All Rights Reserved.
909
+ *
910
+ * Use of this source code is governed by an MIT-style license that can be
911
+ * found in the LICENSE file at https://angular.io/license
912
+ */
913
+ /**
914
+ * Convince closure compiler that the wrapped function has no side-effects.
915
+ *
916
+ * Closure compiler always assumes that `toString` has no side-effects. We use this quirk to
917
+ * allow us to execute a function but have closure compiler mark the call as no-side-effects.
918
+ * It is important that the return value for the `noSideEffects` function be assigned
919
+ * to something which is retained otherwise the call to `noSideEffects` will be removed by closure
920
+ * compiler.
921
+ */
922
+ function noSideEffects(fn) {
923
+ return { toString: fn }.toString();
924
+ }
925
+
926
+ /**
927
+ * @license
928
+ * Copyright Google LLC All Rights Reserved.
929
+ *
930
+ * Use of this source code is governed by an MIT-style license that can be
931
+ * found in the LICENSE file at https://angular.io/license
932
+ */
933
+ /**
934
+ * The strategy that the default change detector uses to detect changes.
935
+ * When set, takes effect the next time change detection is triggered.
936
+ *
937
+ * @see {@link ChangeDetectorRef#usage-notes Change detection usage}
938
+ *
939
+ * @publicApi
940
+ */
941
+ var ChangeDetectionStrategy;
942
+ (function (ChangeDetectionStrategy) {
943
+ /**
944
+ * Use the `CheckOnce` strategy, meaning that automatic change detection is deactivated
945
+ * until reactivated by setting the strategy to `Default` (`CheckAlways`).
946
+ * Change detection can still be explicitly invoked.
947
+ * This strategy applies to all child directives and cannot be overridden.
948
+ */
949
+ ChangeDetectionStrategy[ChangeDetectionStrategy["OnPush"] = 0] = "OnPush";
950
+ /**
951
+ * Use the default `CheckAlways` strategy, in which change detection is automatic until
952
+ * explicitly deactivated.
953
+ */
954
+ ChangeDetectionStrategy[ChangeDetectionStrategy["Default"] = 1] = "Default";
955
+ })(ChangeDetectionStrategy || (ChangeDetectionStrategy = {}));
956
+ /**
957
+ * Defines the possible states of the default change detector.
958
+ * @see `ChangeDetectorRef`
959
+ */
960
+ var ChangeDetectorStatus;
961
+ (function (ChangeDetectorStatus) {
962
+ /**
963
+ * A state in which, after calling `detectChanges()`, the change detector
964
+ * state becomes `Checked`, and must be explicitly invoked or reactivated.
965
+ */
966
+ ChangeDetectorStatus[ChangeDetectorStatus["CheckOnce"] = 0] = "CheckOnce";
967
+ /**
968
+ * A state in which change detection is skipped until the change detector mode
969
+ * becomes `CheckOnce`.
970
+ */
971
+ ChangeDetectorStatus[ChangeDetectorStatus["Checked"] = 1] = "Checked";
972
+ /**
973
+ * A state in which change detection continues automatically until explicitly
974
+ * deactivated.
975
+ */
976
+ ChangeDetectorStatus[ChangeDetectorStatus["CheckAlways"] = 2] = "CheckAlways";
977
+ /**
978
+ * A state in which a change detector sub tree is not a part of the main tree and
979
+ * should be skipped.
980
+ */
981
+ ChangeDetectorStatus[ChangeDetectorStatus["Detached"] = 3] = "Detached";
982
+ /**
983
+ * Indicates that the change detector encountered an error checking a binding
984
+ * or calling a directive lifecycle method and is now in an inconsistent state. Change
985
+ * detectors in this state do not detect changes.
986
+ */
987
+ ChangeDetectorStatus[ChangeDetectorStatus["Errored"] = 4] = "Errored";
988
+ /**
989
+ * Indicates that the change detector has been destroyed.
990
+ */
991
+ ChangeDetectorStatus[ChangeDetectorStatus["Destroyed"] = 5] = "Destroyed";
992
+ })(ChangeDetectorStatus || (ChangeDetectorStatus = {}));
993
+ /**
994
+ * Reports whether a given strategy is currently the default for change detection.
995
+ * @param changeDetectionStrategy The strategy to check.
996
+ * @returns True if the given strategy is the current default, false otherwise.
997
+ * @see `ChangeDetectorStatus`
998
+ * @see `ChangeDetectorRef`
999
+ */
1000
+ function isDefaultChangeDetectionStrategy(changeDetectionStrategy) {
1001
+ return changeDetectionStrategy == null ||
1002
+ changeDetectionStrategy === ChangeDetectionStrategy.Default;
1003
+ }
1004
+
1005
+ /**
1006
+ * @license
1007
+ * Copyright Google LLC All Rights Reserved.
1008
+ *
1009
+ * Use of this source code is governed by an MIT-style license that can be
1010
+ * found in the LICENSE file at https://angular.io/license
1011
+ */
1012
+ /**
1013
+ * Defines the CSS styles encapsulation policies for the {@link Component} decorator's
1014
+ * `encapsulation` option.
1015
+ *
1016
+ * See {@link Component#encapsulation encapsulation}.
1017
+ *
1018
+ * @usageNotes
1019
+ * ### Example
1020
+ *
1021
+ * {@example core/ts/metadata/encapsulation.ts region='longform'}
1022
+ *
1023
+ * @publicApi
1024
+ */
1025
+ var ViewEncapsulation$1;
1026
+ (function (ViewEncapsulation) {
1027
+ // TODO: consider making `ViewEncapsulation` a `const enum` instead. See
1028
+ // https://github.com/angular/angular/issues/44119 for additional information.
1029
+ /**
1030
+ * Emulates a native Shadow DOM encapsulation behavior by adding a specific attribute to the
1031
+ * component's host element and applying the same attribute to all the CSS selectors provided
1032
+ * via {@link Component#styles styles} or {@link Component#styleUrls styleUrls}.
1033
+ *
1034
+ * This is the default option.
1035
+ */
1036
+ ViewEncapsulation[ViewEncapsulation["Emulated"] = 0] = "Emulated";
1037
+ // Historically the 1 value was for `Native` encapsulation which has been removed as of v11.
1038
+ /**
1039
+ * Doesn't provide any sort of CSS style encapsulation, meaning that all the styles provided
1040
+ * via {@link Component#styles styles} or {@link Component#styleUrls styleUrls} are applicable
1041
+ * to any HTML element of the application regardless of their host Component.
1042
+ */
1043
+ ViewEncapsulation[ViewEncapsulation["None"] = 2] = "None";
1044
+ /**
1045
+ * Uses the browser's native Shadow DOM API to encapsulate CSS styles, meaning that it creates
1046
+ * a ShadowRoot for the component's host element which is then used to encapsulate
1047
+ * all the Component's styling.
1048
+ */
1049
+ ViewEncapsulation[ViewEncapsulation["ShadowDom"] = 3] = "ShadowDom";
1050
+ })(ViewEncapsulation$1 || (ViewEncapsulation$1 = {}));
1051
+
1052
+ /**
1053
+ * @license
1054
+ * Copyright Google LLC All Rights Reserved.
1055
+ *
1056
+ * Use of this source code is governed by an MIT-style license that can be
1057
+ * found in the LICENSE file at https://angular.io/license
1058
+ */
1059
+ /**
1060
+ * This file contains reuseable "empty" symbols that can be used as default return values
1061
+ * in different parts of the rendering code. Because the same symbols are returned, this
1062
+ * allows for identity checks against these values to be consistently used by the framework
1063
+ * code.
1064
+ */
1065
+ const EMPTY_OBJ = {};
1066
+ const EMPTY_ARRAY = [];
1067
+ // freezing the values prevents any code from accidentally inserting new values in
1068
+ if ((typeof ngDevMode === 'undefined' || ngDevMode) && initNgDevMode()) {
1069
+ // These property accesses can be ignored because ngDevMode will be set to false
1070
+ // when optimizing code and the whole if statement will be dropped.
1071
+ // tslint:disable-next-line:no-toplevel-property-access
1072
+ Object.freeze(EMPTY_OBJ);
1073
+ // tslint:disable-next-line:no-toplevel-property-access
1074
+ Object.freeze(EMPTY_ARRAY);
1075
+ }
1076
+
1077
+ /**
1078
+ * @license
1079
+ * Copyright Google LLC All Rights Reserved.
1080
+ *
1081
+ * Use of this source code is governed by an MIT-style license that can be
1082
+ * found in the LICENSE file at https://angular.io/license
1083
+ */
1084
+ const NG_COMP_DEF = getClosureSafeProperty({ ɵcmp: getClosureSafeProperty });
1085
+ const NG_DIR_DEF = getClosureSafeProperty({ ɵdir: getClosureSafeProperty });
1086
+ const NG_PIPE_DEF = getClosureSafeProperty({ ɵpipe: getClosureSafeProperty });
1087
+ const NG_MOD_DEF = getClosureSafeProperty({ ɵmod: getClosureSafeProperty });
1088
+ const NG_FACTORY_DEF = getClosureSafeProperty({ ɵfac: getClosureSafeProperty });
1089
+ /**
1090
+ * If a directive is diPublic, bloomAdd sets a property on the type with this constant as
1091
+ * the key and the directive's unique ID as the value. This allows us to map directives to their
1092
+ * bloom filter bit for DI.
1093
+ */
1094
+ // TODO(misko): This is wrong. The NG_ELEMENT_ID should never be minified.
1095
+ const NG_ELEMENT_ID = getClosureSafeProperty({ __NG_ELEMENT_ID__: getClosureSafeProperty });
1096
+
1097
+ /**
1098
+ * @license
1099
+ * Copyright Google LLC All Rights Reserved.
1100
+ *
1101
+ * Use of this source code is governed by an MIT-style license that can be
1102
+ * found in the LICENSE file at https://angular.io/license
1103
+ */
1104
+ /** Counter used to generate unique IDs for component definitions. */
1105
+ let componentDefCount = 0;
1106
+ /**
1107
+ * Create a component definition object.
1108
+ *
1109
+ *
1110
+ * # Example
1111
+ * ```
1112
+ * class MyDirective {
1113
+ * // Generated by Angular Template Compiler
884
1114
  * // [Symbol] syntax will not be supported by TypeScript until v2.7
885
1115
  * static ɵcmp = defineComponent({
886
1116
  * ...
@@ -1522,11 +1752,12 @@ function rememberChangeHistoryAndInvokeOnChangesHook() {
1522
1752
  }
1523
1753
  }
1524
1754
  function ngOnChangesSetInput(instance, value, publicName, privateName) {
1755
+ const declaredName = this.declaredInputs[publicName];
1756
+ ngDevMode && assertString(declaredName, 'Name of input in ngOnChanges has to be a string');
1525
1757
  const simpleChangesStore = getSimpleChangesStore(instance) ||
1526
1758
  setSimpleChangesStore(instance, { previous: EMPTY_OBJ, current: null });
1527
1759
  const current = simpleChangesStore.current || (simpleChangesStore.current = {});
1528
1760
  const previous = simpleChangesStore.previous;
1529
- const declaredName = this.declaredInputs[publicName];
1530
1761
  const previousChange = previous[declaredName];
1531
1762
  current[declaredName] = new SimpleChange(previousChange && previousChange.currentValue, value, previous === EMPTY_OBJ);
1532
1763
  instance[privateName] = value;
@@ -3595,7 +3826,7 @@ class NodeInjector {
3595
3826
  this._lView = _lView;
3596
3827
  }
3597
3828
  get(token, notFoundValue, flags) {
3598
- return getOrCreateInjectable(this._tNode, this._lView, token, flags, notFoundValue);
3829
+ return getOrCreateInjectable(this._tNode, this._lView, token, convertToBitFlags(flags), notFoundValue);
3599
3830
  }
3600
3831
  }
3601
3832
  /** Creates a `NodeInjector` for the current node. */
@@ -3890,8 +4121,11 @@ const Attribute = makeParamDecorator('Attribute', (attributeName) => ({ attribut
3890
4121
  * As you can see in the Tree-shakable InjectionToken example below.
3891
4122
  *
3892
4123
  * Additionally, if a `factory` is specified you can also specify the `providedIn` option, which
3893
- * overrides the above behavior and marks the token as belonging to a particular `@NgModule`. As
3894
- * mentioned above, `'root'` is the default value for `providedIn`.
4124
+ * overrides the above behavior and marks the token as belonging to a particular `@NgModule` (note:
4125
+ * this option is now deprecated). As mentioned above, `'root'` is the default value for
4126
+ * `providedIn`.
4127
+ *
4128
+ * The `providedIn: NgModule` and `providedIn: 'any'` options are deprecated.
3895
4129
  *
3896
4130
  * @usageNotes
3897
4131
  * ### Basic Examples
@@ -4643,306 +4877,80 @@ class ReflectionCapabilities {
4643
4877
  // Prefer the direct API.
4644
4878
  if (typeOrFunc.propMetadata &&
4645
4879
  typeOrFunc.propMetadata !== parentCtor.propMetadata) {
4646
- let propMetadata = typeOrFunc.propMetadata;
4647
- if (typeof propMetadata === 'function' && propMetadata.propMetadata) {
4648
- propMetadata = propMetadata.propMetadata;
4649
- }
4650
- return propMetadata;
4651
- }
4652
- // API of tsickle for lowering decorators to properties on the class.
4653
- if (typeOrFunc.propDecorators &&
4654
- typeOrFunc.propDecorators !== parentCtor.propDecorators) {
4655
- const propDecorators = typeOrFunc.propDecorators;
4656
- const propMetadata = {};
4657
- Object.keys(propDecorators).forEach(prop => {
4658
- propMetadata[prop] = convertTsickleDecoratorIntoMetadata(propDecorators[prop]);
4659
- });
4660
- return propMetadata;
4661
- }
4662
- // API for metadata created by invoking the decorators.
4663
- if (typeOrFunc.hasOwnProperty(PROP_METADATA)) {
4664
- return typeOrFunc[PROP_METADATA];
4665
- }
4666
- return null;
4667
- }
4668
- propMetadata(typeOrFunc) {
4669
- if (!isType(typeOrFunc)) {
4670
- return {};
4671
- }
4672
- const parentCtor = getParentCtor(typeOrFunc);
4673
- const propMetadata = {};
4674
- if (parentCtor !== Object) {
4675
- const parentPropMetadata = this.propMetadata(parentCtor);
4676
- Object.keys(parentPropMetadata).forEach((propName) => {
4677
- propMetadata[propName] = parentPropMetadata[propName];
4678
- });
4679
- }
4680
- const ownPropMetadata = this._ownPropMetadata(typeOrFunc, parentCtor);
4681
- if (ownPropMetadata) {
4682
- Object.keys(ownPropMetadata).forEach((propName) => {
4683
- const decorators = [];
4684
- if (propMetadata.hasOwnProperty(propName)) {
4685
- decorators.push(...propMetadata[propName]);
4686
- }
4687
- decorators.push(...ownPropMetadata[propName]);
4688
- propMetadata[propName] = decorators;
4689
- });
4690
- }
4691
- return propMetadata;
4692
- }
4693
- ownPropMetadata(typeOrFunc) {
4694
- if (!isType(typeOrFunc)) {
4695
- return {};
4696
- }
4697
- return this._ownPropMetadata(typeOrFunc, getParentCtor(typeOrFunc)) || {};
4698
- }
4699
- hasLifecycleHook(type, lcProperty) {
4700
- return type instanceof Type && lcProperty in type.prototype;
4701
- }
4702
- }
4703
- function convertTsickleDecoratorIntoMetadata(decoratorInvocations) {
4704
- if (!decoratorInvocations) {
4705
- return [];
4706
- }
4707
- return decoratorInvocations.map(decoratorInvocation => {
4708
- const decoratorType = decoratorInvocation.type;
4709
- const annotationCls = decoratorType.annotationCls;
4710
- const annotationArgs = decoratorInvocation.args ? decoratorInvocation.args : [];
4711
- return new annotationCls(...annotationArgs);
4712
- });
4713
- }
4714
- function getParentCtor(ctor) {
4715
- const parentProto = ctor.prototype ? Object.getPrototypeOf(ctor.prototype) : null;
4716
- const parentCtor = parentProto ? parentProto.constructor : null;
4717
- // Note: We always use `Object` as the null value
4718
- // to simplify checking later on.
4719
- return parentCtor || Object;
4720
- }
4721
-
4722
- /**
4723
- * @license
4724
- * Copyright Google LLC All Rights Reserved.
4725
- *
4726
- * Use of this source code is governed by an MIT-style license that can be
4727
- * found in the LICENSE file at https://angular.io/license
4728
- */
4729
- const _THROW_IF_NOT_FOUND = {};
4730
- const THROW_IF_NOT_FOUND = _THROW_IF_NOT_FOUND;
4731
- /*
4732
- * Name of a property (that we patch onto DI decorator), which is used as an annotation of which
4733
- * InjectFlag this decorator represents. This allows to avoid direct references to the DI decorators
4734
- * in the code, thus making them tree-shakable.
4735
- */
4736
- const DI_DECORATOR_FLAG = '__NG_DI_FLAG__';
4737
- const NG_TEMP_TOKEN_PATH = 'ngTempTokenPath';
4738
- const NG_TOKEN_PATH = 'ngTokenPath';
4739
- const NEW_LINE = /\n/gm;
4740
- const NO_NEW_LINE = 'ɵ';
4741
- const SOURCE = '__source';
4742
- /**
4743
- * Current injector value used by `inject`.
4744
- * - `undefined`: it is an error to call `inject`
4745
- * - `null`: `inject` can be called but there is no injector (limp-mode).
4746
- * - Injector instance: Use the injector for resolution.
4747
- */
4748
- let _currentInjector = undefined;
4749
- function setCurrentInjector(injector) {
4750
- const former = _currentInjector;
4751
- _currentInjector = injector;
4752
- return former;
4753
- }
4754
- function injectInjectorOnly(token, flags = InjectFlags.Default) {
4755
- if (_currentInjector === undefined) {
4756
- throw new RuntimeError(-203 /* RuntimeErrorCode.MISSING_INJECTION_CONTEXT */, ngDevMode &&
4757
- `inject() must be called from an injection context such as a constructor, a factory function, a field initializer, or a function used with \`EnvironmentInjector#runInContext\`.`);
4758
- }
4759
- else if (_currentInjector === null) {
4760
- return injectRootLimpMode(token, undefined, flags);
4761
- }
4762
- else {
4763
- return _currentInjector.get(token, flags & InjectFlags.Optional ? null : undefined, flags);
4764
- }
4765
- }
4766
- function ɵɵinject(token, flags = InjectFlags.Default) {
4767
- return (getInjectImplementation() || injectInjectorOnly)(resolveForwardRef(token), flags);
4768
- }
4769
- /**
4770
- * Throws an error indicating that a factory function could not be generated by the compiler for a
4771
- * particular class.
4772
- *
4773
- * The name of the class is not mentioned here, but will be in the generated factory function name
4774
- * and thus in the stack trace.
4775
- *
4776
- * @codeGenApi
4777
- */
4778
- function ɵɵinvalidFactoryDep(index) {
4779
- throw new RuntimeError(202 /* RuntimeErrorCode.INVALID_FACTORY_DEPENDENCY */, ngDevMode &&
4780
- `This constructor is not compatible with Angular Dependency Injection because its dependency at index ${index} of the parameter list is invalid.
4781
- This can happen if the dependency type is a primitive like a string or if an ancestor of this class is missing an Angular decorator.
4782
-
4783
- Please check that 1) the type for the parameter at index ${index} is correct and 2) the correct Angular decorators are defined for this class and its ancestors.`);
4784
- }
4785
- /**
4786
- * Injects a token from the currently active injector.
4787
- * `inject` is only supported during instantiation of a dependency by the DI system. It can be used
4788
- * during:
4789
- * - Construction (via the `constructor`) of a class being instantiated by the DI system, such
4790
- * as an `@Injectable` or `@Component`.
4791
- * - In the initializer for fields of such classes.
4792
- * - In the factory function specified for `useFactory` of a `Provider` or an `@Injectable`.
4793
- * - In the `factory` function specified for an `InjectionToken`.
4794
- *
4795
- * @param token A token that represents a dependency that should be injected.
4796
- * @param flags Optional flags that control how injection is executed.
4797
- * The flags correspond to injection strategies that can be specified with
4798
- * parameter decorators `@Host`, `@Self`, `@SkipSef`, and `@Optional`.
4799
- * @returns the injected value if operation is successful, `null` otherwise.
4800
- * @throws if called outside of a supported context.
4801
- *
4802
- * @usageNotes
4803
- * In practice the `inject()` calls are allowed in a constructor, a constructor parameter and a
4804
- * field initializer:
4805
- *
4806
- * ```typescript
4807
- * @Injectable({providedIn: 'root'})
4808
- * export class Car {
4809
- * radio: Radio|undefined;
4810
- * // OK: field initializer
4811
- * spareTyre = inject(Tyre);
4812
- *
4813
- * constructor() {
4814
- * // OK: constructor body
4815
- * this.radio = inject(Radio);
4816
- * }
4817
- * }
4818
- * ```
4819
- *
4820
- * It is also legal to call `inject` from a provider's factory:
4821
- *
4822
- * ```typescript
4823
- * providers: [
4824
- * {provide: Car, useFactory: () => {
4825
- * // OK: a class factory
4826
- * const engine = inject(Engine);
4827
- * return new Car(engine);
4828
- * }}
4829
- * ]
4830
- * ```
4831
- *
4832
- * Calls to the `inject()` function outside of the class creation context will result in error. Most
4833
- * notably, calls to `inject()` are disallowed after a class instance was created, in methods
4834
- * (including lifecycle hooks):
4835
- *
4836
- * ```typescript
4837
- * @Component({ ... })
4838
- * export class CarComponent {
4839
- * ngOnInit() {
4840
- * // ERROR: too late, the component instance was already created
4841
- * const engine = inject(Engine);
4842
- * engine.start();
4843
- * }
4844
- * }
4845
- * ```
4846
- *
4847
- * @publicApi
4848
- */
4849
- function inject(token, flags = InjectFlags.Default) {
4850
- if (typeof flags !== 'number') {
4851
- // While TypeScript doesn't accept it without a cast, bitwise OR with false-y values in
4852
- // JavaScript is a no-op. We can use that for a very codesize-efficient conversion from
4853
- // `InjectOptions` to `InjectFlags`.
4854
- flags = (0 /* InternalInjectFlags.Default */ | // comment to force a line break in the formatter
4855
- (flags.optional && 8 /* InternalInjectFlags.Optional */) |
4856
- (flags.host && 1 /* InternalInjectFlags.Host */) |
4857
- (flags.self && 2 /* InternalInjectFlags.Self */) |
4858
- (flags.skipSelf && 4 /* InternalInjectFlags.SkipSelf */));
4859
- }
4860
- return ɵɵinject(token, flags);
4861
- }
4862
- function injectArgs(types) {
4863
- const args = [];
4864
- for (let i = 0; i < types.length; i++) {
4865
- const arg = resolveForwardRef(types[i]);
4866
- if (Array.isArray(arg)) {
4867
- if (arg.length === 0) {
4868
- throw new RuntimeError(900 /* RuntimeErrorCode.INVALID_DIFFER_INPUT */, ngDevMode && 'Arguments array must have arguments.');
4880
+ let propMetadata = typeOrFunc.propMetadata;
4881
+ if (typeof propMetadata === 'function' && propMetadata.propMetadata) {
4882
+ propMetadata = propMetadata.propMetadata;
4869
4883
  }
4870
- let type = undefined;
4871
- let flags = InjectFlags.Default;
4872
- for (let j = 0; j < arg.length; j++) {
4873
- const meta = arg[j];
4874
- const flag = getInjectFlag(meta);
4875
- if (typeof flag === 'number') {
4876
- // Special case when we handle @Inject decorator.
4877
- if (flag === -1 /* DecoratorFlags.Inject */) {
4878
- type = meta.token;
4879
- }
4880
- else {
4881
- flags |= flag;
4882
- }
4883
- }
4884
- else {
4885
- type = meta;
4884
+ return propMetadata;
4885
+ }
4886
+ // API of tsickle for lowering decorators to properties on the class.
4887
+ if (typeOrFunc.propDecorators &&
4888
+ typeOrFunc.propDecorators !== parentCtor.propDecorators) {
4889
+ const propDecorators = typeOrFunc.propDecorators;
4890
+ const propMetadata = {};
4891
+ Object.keys(propDecorators).forEach(prop => {
4892
+ propMetadata[prop] = convertTsickleDecoratorIntoMetadata(propDecorators[prop]);
4893
+ });
4894
+ return propMetadata;
4895
+ }
4896
+ // API for metadata created by invoking the decorators.
4897
+ if (typeOrFunc.hasOwnProperty(PROP_METADATA)) {
4898
+ return typeOrFunc[PROP_METADATA];
4899
+ }
4900
+ return null;
4901
+ }
4902
+ propMetadata(typeOrFunc) {
4903
+ if (!isType(typeOrFunc)) {
4904
+ return {};
4905
+ }
4906
+ const parentCtor = getParentCtor(typeOrFunc);
4907
+ const propMetadata = {};
4908
+ if (parentCtor !== Object) {
4909
+ const parentPropMetadata = this.propMetadata(parentCtor);
4910
+ Object.keys(parentPropMetadata).forEach((propName) => {
4911
+ propMetadata[propName] = parentPropMetadata[propName];
4912
+ });
4913
+ }
4914
+ const ownPropMetadata = this._ownPropMetadata(typeOrFunc, parentCtor);
4915
+ if (ownPropMetadata) {
4916
+ Object.keys(ownPropMetadata).forEach((propName) => {
4917
+ const decorators = [];
4918
+ if (propMetadata.hasOwnProperty(propName)) {
4919
+ decorators.push(...propMetadata[propName]);
4886
4920
  }
4887
- }
4888
- args.push(ɵɵinject(type, flags));
4921
+ decorators.push(...ownPropMetadata[propName]);
4922
+ propMetadata[propName] = decorators;
4923
+ });
4889
4924
  }
4890
- else {
4891
- args.push(ɵɵinject(arg));
4925
+ return propMetadata;
4926
+ }
4927
+ ownPropMetadata(typeOrFunc) {
4928
+ if (!isType(typeOrFunc)) {
4929
+ return {};
4892
4930
  }
4931
+ return this._ownPropMetadata(typeOrFunc, getParentCtor(typeOrFunc)) || {};
4893
4932
  }
4894
- return args;
4895
- }
4896
- /**
4897
- * Attaches a given InjectFlag to a given decorator using monkey-patching.
4898
- * Since DI decorators can be used in providers `deps` array (when provider is configured using
4899
- * `useFactory`) without initialization (e.g. `Host`) and as an instance (e.g. `new Host()`), we
4900
- * attach the flag to make it available both as a static property and as a field on decorator
4901
- * instance.
4902
- *
4903
- * @param decorator Provided DI decorator.
4904
- * @param flag InjectFlag that should be applied.
4905
- */
4906
- function attachInjectFlag(decorator, flag) {
4907
- decorator[DI_DECORATOR_FLAG] = flag;
4908
- decorator.prototype[DI_DECORATOR_FLAG] = flag;
4909
- return decorator;
4910
- }
4911
- /**
4912
- * Reads monkey-patched property that contains InjectFlag attached to a decorator.
4913
- *
4914
- * @param token Token that may contain monkey-patched DI flags property.
4915
- */
4916
- function getInjectFlag(token) {
4917
- return token[DI_DECORATOR_FLAG];
4918
- }
4919
- function catchInjectorError(e, token, injectorErrorName, source) {
4920
- const tokenPath = e[NG_TEMP_TOKEN_PATH];
4921
- if (token[SOURCE]) {
4922
- tokenPath.unshift(token[SOURCE]);
4933
+ hasLifecycleHook(type, lcProperty) {
4934
+ return type instanceof Type && lcProperty in type.prototype;
4923
4935
  }
4924
- e.message = formatError('\n' + e.message, tokenPath, injectorErrorName, source);
4925
- e[NG_TOKEN_PATH] = tokenPath;
4926
- e[NG_TEMP_TOKEN_PATH] = null;
4927
- throw e;
4928
4936
  }
4929
- function formatError(text, obj, injectorErrorName, source = null) {
4930
- text = text && text.charAt(0) === '\n' && text.charAt(1) == NO_NEW_LINE ? text.slice(2) : text;
4931
- let context = stringify(obj);
4932
- if (Array.isArray(obj)) {
4933
- context = obj.map(stringify).join(' -> ');
4934
- }
4935
- else if (typeof obj === 'object') {
4936
- let parts = [];
4937
- for (let key in obj) {
4938
- if (obj.hasOwnProperty(key)) {
4939
- let value = obj[key];
4940
- parts.push(key + ':' + (typeof value === 'string' ? JSON.stringify(value) : stringify(value)));
4941
- }
4942
- }
4943
- context = `{${parts.join(', ')}}`;
4937
+ function convertTsickleDecoratorIntoMetadata(decoratorInvocations) {
4938
+ if (!decoratorInvocations) {
4939
+ return [];
4944
4940
  }
4945
- return `${injectorErrorName}${source ? '(' + source + ')' : ''}[${context}]: ${text.replace(NEW_LINE, '\n ')}`;
4941
+ return decoratorInvocations.map(decoratorInvocation => {
4942
+ const decoratorType = decoratorInvocation.type;
4943
+ const annotationCls = decoratorType.annotationCls;
4944
+ const annotationArgs = decoratorInvocation.args ? decoratorInvocation.args : [];
4945
+ return new annotationCls(...annotationArgs);
4946
+ });
4947
+ }
4948
+ function getParentCtor(ctor) {
4949
+ const parentProto = ctor.prototype ? Object.getPrototypeOf(ctor.prototype) : null;
4950
+ const parentCtor = parentProto ? parentProto.constructor : null;
4951
+ // Note: We always use `Object` as the null value
4952
+ // to simplify checking later on.
4953
+ return parentCtor || Object;
4946
4954
  }
4947
4955
 
4948
4956
  /**
@@ -6735,6 +6743,7 @@ class R3Injector extends EnvironmentInjector {
6735
6743
  }
6736
6744
  get(token, notFoundValue = THROW_IF_NOT_FOUND, flags = InjectFlags.Default) {
6737
6745
  this.assertNotDestroyed();
6746
+ flags = convertToBitFlags(flags);
6738
6747
  // Set the injection context.
6739
6748
  const previousInjector = setCurrentInjector(this);
6740
6749
  const previousInjectImplementation = setInjectImplementation(undefined);
@@ -7007,143 +7016,12 @@ function forEachSingleProvider(providers, fn) {
7007
7016
  }
7008
7017
  else if (isImportedNgModuleProviders(provider)) {
7009
7018
  forEachSingleProvider(provider.ɵproviders, fn);
7010
- }
7011
- else {
7012
- fn(provider);
7013
- }
7014
- }
7015
- }
7016
-
7017
- /**
7018
- * @license
7019
- * Copyright Google LLC All Rights Reserved.
7020
- *
7021
- * Use of this source code is governed by an MIT-style license that can be
7022
- * found in the LICENSE file at https://angular.io/license
7023
- */
7024
- /**
7025
- * Represents a component created by a `ComponentFactory`.
7026
- * Provides access to the component instance and related objects,
7027
- * and provides the means of destroying the instance.
7028
- *
7029
- * @publicApi
7030
- */
7031
- class ComponentRef$1 {
7032
- }
7033
- /**
7034
- * Base class for a factory that can create a component dynamically.
7035
- * Instantiate a factory for a given type of component with `resolveComponentFactory()`.
7036
- * Use the resulting `ComponentFactory.create()` method to create a component of that type.
7037
- *
7038
- * @see [Dynamic Components](guide/dynamic-component-loader)
7039
- *
7040
- * @publicApi
7041
- *
7042
- * @deprecated Angular no longer requires Component factories. Please use other APIs where
7043
- * Component class can be used directly.
7044
- */
7045
- class ComponentFactory$1 {
7046
- }
7047
-
7048
- /**
7049
- * @license
7050
- * Copyright Google LLC All Rights Reserved.
7051
- *
7052
- * Use of this source code is governed by an MIT-style license that can be
7053
- * found in the LICENSE file at https://angular.io/license
7054
- */
7055
- function noComponentFactoryError(component) {
7056
- const error = Error(`No component factory found for ${stringify(component)}. Did you add it to @NgModule.entryComponents?`);
7057
- error[ERROR_COMPONENT] = component;
7058
- return error;
7059
- }
7060
- const ERROR_COMPONENT = 'ngComponent';
7061
- function getComponent$1(error) {
7062
- return error[ERROR_COMPONENT];
7063
- }
7064
- class _NullComponentFactoryResolver {
7065
- resolveComponentFactory(component) {
7066
- throw noComponentFactoryError(component);
7067
- }
7068
- }
7069
- /**
7070
- * A simple registry that maps `Components` to generated `ComponentFactory` classes
7071
- * that can be used to create instances of components.
7072
- * Use to obtain the factory for a given component type,
7073
- * then use the factory's `create()` method to create a component of that type.
7074
- *
7075
- * Note: since v13, dynamic component creation via
7076
- * [`ViewContainerRef.createComponent`](api/core/ViewContainerRef#createComponent)
7077
- * does **not** require resolving component factory: component class can be used directly.
7078
- *
7079
- * @publicApi
7080
- *
7081
- * @deprecated Angular no longer requires Component factories. Please use other APIs where
7082
- * Component class can be used directly.
7083
- */
7084
- class ComponentFactoryResolver$1 {
7085
- }
7086
- ComponentFactoryResolver$1.NULL = ( /* @__PURE__ */new _NullComponentFactoryResolver());
7087
-
7088
- /**
7089
- * @license
7090
- * Copyright Google LLC All Rights Reserved.
7091
- *
7092
- * Use of this source code is governed by an MIT-style license that can be
7093
- * found in the LICENSE file at https://angular.io/license
7094
- */
7095
- /**
7096
- * Creates an ElementRef from the most recent node.
7097
- *
7098
- * @returns The ElementRef instance to use
7099
- */
7100
- function injectElementRef() {
7101
- return createElementRef(getCurrentTNode(), getLView());
7102
- }
7103
- /**
7104
- * Creates an ElementRef given a node.
7105
- *
7106
- * @param tNode The node for which you'd like an ElementRef
7107
- * @param lView The view to which the node belongs
7108
- * @returns The ElementRef instance to use
7109
- */
7110
- function createElementRef(tNode, lView) {
7111
- return new ElementRef(getNativeByTNode(tNode, lView));
7112
- }
7113
- /**
7114
- * A wrapper around a native element inside of a View.
7115
- *
7116
- * An `ElementRef` is backed by a render-specific element. In the browser, this is usually a DOM
7117
- * element.
7118
- *
7119
- * @security Permitting direct access to the DOM can make your application more vulnerable to
7120
- * XSS attacks. Carefully review any use of `ElementRef` in your code. For more detail, see the
7121
- * [Security Guide](https://g.co/ng/security).
7122
- *
7123
- * @publicApi
7124
- */
7125
- // Note: We don't expose things like `Injector`, `ViewContainer`, ... here,
7126
- // i.e. users have to ask for what they need. With that, we can build better analysis tools
7127
- // and could do better codegen in the future.
7128
- class ElementRef {
7129
- constructor(nativeElement) {
7130
- this.nativeElement = nativeElement;
7019
+ }
7020
+ else {
7021
+ fn(provider);
7022
+ }
7131
7023
  }
7132
7024
  }
7133
- /**
7134
- * @internal
7135
- * @nocollapse
7136
- */
7137
- ElementRef.__NG_ELEMENT_ID__ = injectElementRef;
7138
- /**
7139
- * Unwraps `ElementRef` and return the `nativeElement`.
7140
- *
7141
- * @param value value to unwrap
7142
- * @returns `nativeElement` if `ElementRef` otherwise returns value as is.
7143
- */
7144
- function unwrapElementRef(value) {
7145
- return value instanceof ElementRef ? value.nativeElement : value;
7146
- }
7147
7025
 
7148
7026
  /**
7149
7027
  * @license
@@ -7152,66 +7030,29 @@ function unwrapElementRef(value) {
7152
7030
  * Use of this source code is governed by an MIT-style license that can be
7153
7031
  * found in the LICENSE file at https://angular.io/license
7154
7032
  */
7155
- const Renderer2Interceptor = new InjectionToken('Renderer2Interceptor');
7156
7033
  /**
7157
- * Creates and initializes a custom renderer that implements the `Renderer2` base class.
7034
+ * Represents a component created by a `ComponentFactory`.
7035
+ * Provides access to the component instance and related objects,
7036
+ * and provides the means of destroying the instance.
7158
7037
  *
7159
7038
  * @publicApi
7160
7039
  */
7161
- class RendererFactory2 {
7040
+ class ComponentRef$1 {
7162
7041
  }
7163
7042
  /**
7164
- * Extend this base class to implement custom rendering. By default, Angular
7165
- * renders a template into DOM. You can use custom rendering to intercept
7166
- * rendering calls, or to render to something other than DOM.
7167
- *
7168
- * Create your custom renderer using `RendererFactory2`.
7043
+ * Base class for a factory that can create a component dynamically.
7044
+ * Instantiate a factory for a given type of component with `resolveComponentFactory()`.
7045
+ * Use the resulting `ComponentFactory.create()` method to create a component of that type.
7169
7046
  *
7170
- * Use a custom renderer to bypass Angular's templating and
7171
- * make custom UI changes that can't be expressed declaratively.
7172
- * For example if you need to set a property or an attribute whose name is
7173
- * not statically known, use the `setProperty()` or
7174
- * `setAttribute()` method.
7047
+ * @see [Dynamic Components](guide/dynamic-component-loader)
7175
7048
  *
7176
7049
  * @publicApi
7177
- */
7178
- class Renderer2 {
7179
- }
7180
- /**
7181
- * @internal
7182
- * @nocollapse
7183
- */
7184
- Renderer2.__NG_ELEMENT_ID__ = () => injectRenderer2();
7185
- /** Injects a Renderer2 for the current component. */
7186
- function injectRenderer2() {
7187
- // We need the Renderer to be based on the component that it's being injected into, however since
7188
- // DI happens before we've entered its view, `getLView` will return the parent view instead.
7189
- const lView = getLView();
7190
- const tNode = getCurrentTNode();
7191
- const nodeAtIndex = getComponentLViewByIndex(tNode.index, lView);
7192
- return (isLView(nodeAtIndex) ? nodeAtIndex : lView)[RENDERER];
7193
- }
7194
-
7195
- /**
7196
- * @license
7197
- * Copyright Google LLC All Rights Reserved.
7198
- *
7199
- * Use of this source code is governed by an MIT-style license that can be
7200
- * found in the LICENSE file at https://angular.io/license
7201
- */
7202
- /**
7203
- * Sanitizer is used by the views to sanitize potentially dangerous values.
7204
7050
  *
7205
- * @publicApi
7051
+ * @deprecated Angular no longer requires Component factories. Please use other APIs where
7052
+ * Component class can be used directly.
7206
7053
  */
7207
- class Sanitizer {
7054
+ class ComponentFactory$1 {
7208
7055
  }
7209
- /** @nocollapse */
7210
- Sanitizer.ɵprov = ɵɵdefineInjectable({
7211
- token: Sanitizer,
7212
- providedIn: 'root',
7213
- factory: () => null,
7214
- });
7215
7056
 
7216
7057
  /**
7217
7058
  * @license
@@ -7220,80 +7061,38 @@ Sanitizer.ɵprov = ɵɵdefineInjectable({
7220
7061
  * Use of this source code is governed by an MIT-style license that can be
7221
7062
  * found in the LICENSE file at https://angular.io/license
7222
7063
  */
7223
- /**
7224
- * @description Represents the version of Angular
7225
- *
7226
- * @publicApi
7227
- */
7228
- class Version {
7229
- constructor(full) {
7230
- this.full = full;
7231
- this.major = full.split('.')[0];
7232
- this.minor = full.split('.')[1];
7233
- this.patch = full.split('.').slice(2).join('.');
7064
+ function noComponentFactoryError(component) {
7065
+ const error = Error(`No component factory found for ${stringify(component)}. Did you add it to @NgModule.entryComponents?`);
7066
+ error[ERROR_COMPONENT] = component;
7067
+ return error;
7068
+ }
7069
+ const ERROR_COMPONENT = 'ngComponent';
7070
+ function getComponent$1(error) {
7071
+ return error[ERROR_COMPONENT];
7072
+ }
7073
+ class _NullComponentFactoryResolver {
7074
+ resolveComponentFactory(component) {
7075
+ throw noComponentFactoryError(component);
7234
7076
  }
7235
7077
  }
7236
7078
  /**
7237
- * @publicApi
7238
- */
7239
- const VERSION = new Version('15.0.0-next.3');
7240
-
7241
- /**
7242
- * @license
7243
- * Copyright Google LLC All Rights Reserved.
7244
- *
7245
- * Use of this source code is governed by an MIT-style license that can be
7246
- * found in the LICENSE file at https://angular.io/license
7247
- */
7248
- // This default value is when checking the hierarchy for a token.
7249
- //
7250
- // It means both:
7251
- // - the token is not provided by the current injector,
7252
- // - only the element injectors should be checked (ie do not check module injectors
7253
- //
7254
- // mod1
7255
- // /
7256
- // el1 mod2
7257
- // \ /
7258
- // el2
7259
- //
7260
- // When requesting el2.injector.get(token), we should check in the following order and return the
7261
- // first found value:
7262
- // - el2.injector.get(token, default)
7263
- // - el1.injector.get(token, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR) -> do not check the module
7264
- // - mod2.injector.get(token, default)
7265
- const NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR = {};
7266
-
7267
- /**
7268
- * @license
7269
- * Copyright Google LLC All Rights Reserved.
7079
+ * A simple registry that maps `Components` to generated `ComponentFactory` classes
7080
+ * that can be used to create instances of components.
7081
+ * Use to obtain the factory for a given component type,
7082
+ * then use the factory's `create()` method to create a component of that type.
7270
7083
  *
7271
- * Use of this source code is governed by an MIT-style license that can be
7272
- * found in the LICENSE file at https://angular.io/license
7273
- */
7274
- /**
7275
- * Defines a schema that allows an NgModule to contain the following:
7276
- * - Non-Angular elements named with dash case (`-`).
7277
- * - Element properties named with dash case (`-`).
7278
- * Dash case is the naming convention for custom elements.
7084
+ * Note: since v13, dynamic component creation via
7085
+ * [`ViewContainerRef.createComponent`](api/core/ViewContainerRef#createComponent)
7086
+ * does **not** require resolving component factory: component class can be used directly.
7279
7087
  *
7280
7088
  * @publicApi
7281
- */
7282
- const CUSTOM_ELEMENTS_SCHEMA = {
7283
- name: 'custom-elements'
7284
- };
7285
- /**
7286
- * Defines a schema that allows any property on any element.
7287
- *
7288
- * This schema allows you to ignore the errors related to any unknown elements or properties in a
7289
- * template. The usage of this schema is generally discouraged because it prevents useful validation
7290
- * and may hide real errors in your template. Consider using the `CUSTOM_ELEMENTS_SCHEMA` instead.
7291
7089
  *
7292
- * @publicApi
7090
+ * @deprecated Angular no longer requires Component factories. Please use other APIs where
7091
+ * Component class can be used directly.
7293
7092
  */
7294
- const NO_ERRORS_SCHEMA = {
7295
- name: 'no-errors-schema'
7296
- };
7093
+ class ComponentFactoryResolver$1 {
7094
+ }
7095
+ ComponentFactoryResolver$1.NULL = ( /* @__PURE__ */new _NullComponentFactoryResolver());
7297
7096
 
7298
7097
  /**
7299
7098
  * @license
@@ -7302,263 +7101,207 @@ const NO_ERRORS_SCHEMA = {
7302
7101
  * Use of this source code is governed by an MIT-style license that can be
7303
7102
  * found in the LICENSE file at https://angular.io/license
7304
7103
  */
7305
- let shouldThrowErrorOnUnknownElement = false;
7306
- /**
7307
- * Sets a strict mode for JIT-compiled components to throw an error on unknown elements,
7308
- * instead of just logging the error.
7309
- * (for AOT-compiled ones this check happens at build time).
7310
- */
7311
- function ɵsetUnknownElementStrictMode(shouldThrow) {
7312
- shouldThrowErrorOnUnknownElement = shouldThrow;
7313
- }
7314
- /**
7315
- * Gets the current value of the strict mode.
7316
- */
7317
- function ɵgetUnknownElementStrictMode() {
7318
- return shouldThrowErrorOnUnknownElement;
7319
- }
7320
- let shouldThrowErrorOnUnknownProperty = false;
7321
- /**
7322
- * Sets a strict mode for JIT-compiled components to throw an error on unknown properties,
7323
- * instead of just logging the error.
7324
- * (for AOT-compiled ones this check happens at build time).
7325
- */
7326
- function ɵsetUnknownPropertyStrictMode(shouldThrow) {
7327
- shouldThrowErrorOnUnknownProperty = shouldThrow;
7328
- }
7329
- /**
7330
- * Gets the current value of the strict mode.
7331
- */
7332
- function ɵgetUnknownPropertyStrictMode() {
7333
- return shouldThrowErrorOnUnknownProperty;
7334
- }
7335
7104
  /**
7336
- * Validates that the element is known at runtime and produces
7337
- * an error if it's not the case.
7338
- * This check is relevant for JIT-compiled components (for AOT-compiled
7339
- * ones this check happens at build time).
7340
- *
7341
- * The element is considered known if either:
7342
- * - it's a known HTML element
7343
- * - it's a known custom element
7344
- * - the element matches any directive
7345
- * - the element is allowed by one of the schemas
7346
- *
7347
- * @param element Element to validate
7348
- * @param lView An `LView` that represents a current component that is being rendered
7349
- * @param tagName Name of the tag to check
7350
- * @param schemas Array of schemas
7351
- * @param hasDirectives Boolean indicating that the element matches any directive
7352
- */
7353
- function validateElementIsKnown(element, lView, tagName, schemas, hasDirectives) {
7354
- // If `schemas` is set to `null`, that's an indication that this Component was compiled in AOT
7355
- // mode where this check happens at compile time. In JIT mode, `schemas` is always present and
7356
- // defined as an array (as an empty array in case `schemas` field is not defined) and we should
7357
- // execute the check below.
7358
- if (schemas === null)
7359
- return;
7360
- // If the element matches any directive, it's considered as valid.
7361
- if (!hasDirectives && tagName !== null) {
7362
- // The element is unknown if it's an instance of HTMLUnknownElement, or it isn't registered
7363
- // as a custom element. Note that unknown elements with a dash in their name won't be instances
7364
- // of HTMLUnknownElement in browsers that support web components.
7365
- const isUnknown =
7366
- // Note that we can't check for `typeof HTMLUnknownElement === 'function'`,
7367
- // because while most browsers return 'function', IE returns 'object'.
7368
- (typeof HTMLUnknownElement !== 'undefined' && HTMLUnknownElement &&
7369
- element instanceof HTMLUnknownElement) ||
7370
- (typeof customElements !== 'undefined' && tagName.indexOf('-') > -1 &&
7371
- !customElements.get(tagName));
7372
- if (isUnknown && !matchingSchemas(schemas, tagName)) {
7373
- const isHostStandalone = isHostComponentStandalone(lView);
7374
- const templateLocation = getTemplateLocationDetails(lView);
7375
- const schemas = `'${isHostStandalone ? '@Component' : '@NgModule'}.schemas'`;
7376
- let message = `'${tagName}' is not a known element${templateLocation}:\n`;
7377
- message += `1. If '${tagName}' is an Angular component, then verify that it is ${isHostStandalone ? 'included in the \'@Component.imports\' of this component' :
7378
- 'a part of an @NgModule where this component is declared'}.\n`;
7379
- if (tagName && tagName.indexOf('-') > -1) {
7380
- message +=
7381
- `2. If '${tagName}' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the ${schemas} of this component to suppress this message.`;
7382
- }
7383
- else {
7384
- message +=
7385
- `2. To allow any element add 'NO_ERRORS_SCHEMA' to the ${schemas} of this component.`;
7386
- }
7387
- if (shouldThrowErrorOnUnknownElement) {
7388
- throw new RuntimeError(304 /* RuntimeErrorCode.UNKNOWN_ELEMENT */, message);
7389
- }
7390
- else {
7391
- console.error(formatRuntimeError(304 /* RuntimeErrorCode.UNKNOWN_ELEMENT */, message));
7392
- }
7393
- }
7394
- }
7105
+ * Creates an ElementRef from the most recent node.
7106
+ *
7107
+ * @returns The ElementRef instance to use
7108
+ */
7109
+ function injectElementRef() {
7110
+ return createElementRef(getCurrentTNode(), getLView());
7395
7111
  }
7396
7112
  /**
7397
- * Validates that the property of the element is known at runtime and returns
7398
- * false if it's not the case.
7399
- * This check is relevant for JIT-compiled components (for AOT-compiled
7400
- * ones this check happens at build time).
7113
+ * Creates an ElementRef given a node.
7401
7114
  *
7402
- * The property is considered known if either:
7403
- * - it's a known property of the element
7404
- * - the element is allowed by one of the schemas
7405
- * - the property is used for animations
7115
+ * @param tNode The node for which you'd like an ElementRef
7116
+ * @param lView The view to which the node belongs
7117
+ * @returns The ElementRef instance to use
7118
+ */
7119
+ function createElementRef(tNode, lView) {
7120
+ return new ElementRef(getNativeByTNode(tNode, lView));
7121
+ }
7122
+ /**
7123
+ * A wrapper around a native element inside of a View.
7406
7124
  *
7407
- * @param element Element to validate
7408
- * @param propName Name of the property to check
7409
- * @param tagName Name of the tag hosting the property
7410
- * @param schemas Array of schemas
7125
+ * An `ElementRef` is backed by a render-specific element. In the browser, this is usually a DOM
7126
+ * element.
7127
+ *
7128
+ * @security Permitting direct access to the DOM can make your application more vulnerable to
7129
+ * XSS attacks. Carefully review any use of `ElementRef` in your code. For more detail, see the
7130
+ * [Security Guide](https://g.co/ng/security).
7131
+ *
7132
+ * @publicApi
7411
7133
  */
7412
- function isPropertyValid(element, propName, tagName, schemas) {
7413
- // If `schemas` is set to `null`, that's an indication that this Component was compiled in AOT
7414
- // mode where this check happens at compile time. In JIT mode, `schemas` is always present and
7415
- // defined as an array (as an empty array in case `schemas` field is not defined) and we should
7416
- // execute the check below.
7417
- if (schemas === null)
7418
- return true;
7419
- // The property is considered valid if the element matches the schema, it exists on the element,
7420
- // or it is synthetic, and we are in a browser context (web worker nodes should be skipped).
7421
- if (matchingSchemas(schemas, tagName) || propName in element || isAnimationProp(propName)) {
7422
- return true;
7134
+ // Note: We don't expose things like `Injector`, `ViewContainer`, ... here,
7135
+ // i.e. users have to ask for what they need. With that, we can build better analysis tools
7136
+ // and could do better codegen in the future.
7137
+ class ElementRef {
7138
+ constructor(nativeElement) {
7139
+ this.nativeElement = nativeElement;
7423
7140
  }
7424
- // Note: `typeof Node` returns 'function' in most browsers, but on IE it is 'object' so we
7425
- // need to account for both here, while being careful with `typeof null` also returning 'object'.
7426
- return typeof Node === 'undefined' || Node === null || !(element instanceof Node);
7427
7141
  }
7428
7142
  /**
7429
- * Logs or throws an error that a property is not supported on an element.
7143
+ * @internal
7144
+ * @nocollapse
7145
+ */
7146
+ ElementRef.__NG_ELEMENT_ID__ = injectElementRef;
7147
+ /**
7148
+ * Unwraps `ElementRef` and return the `nativeElement`.
7430
7149
  *
7431
- * @param propName Name of the invalid property
7432
- * @param tagName Name of the tag hosting the property
7433
- * @param nodeType Type of the node hosting the property
7434
- * @param lView An `LView` that represents a current component
7150
+ * @param value value to unwrap
7151
+ * @returns `nativeElement` if `ElementRef` otherwise returns value as is.
7435
7152
  */
7436
- function handleUnknownPropertyError(propName, tagName, nodeType, lView) {
7437
- // Special-case a situation when a structural directive is applied to
7438
- // an `<ng-template>` element, for example: `<ng-template *ngIf="true">`.
7439
- // In this case the compiler generates the `ɵɵtemplate` instruction with
7440
- // the `null` as the tagName. The directive matching logic at runtime relies
7441
- // on this effect (see `isInlineTemplate`), thus using the 'ng-template' as
7442
- // a default value of the `tNode.value` is not feasible at this moment.
7443
- if (!tagName && nodeType === 4 /* TNodeType.Container */) {
7444
- tagName = 'ng-template';
7445
- }
7446
- const isHostStandalone = isHostComponentStandalone(lView);
7447
- const templateLocation = getTemplateLocationDetails(lView);
7448
- let message = `Can't bind to '${propName}' since it isn't a known property of '${tagName}'${templateLocation}.`;
7449
- const schemas = `'${isHostStandalone ? '@Component' : '@NgModule'}.schemas'`;
7450
- const importLocation = isHostStandalone ?
7451
- 'included in the \'@Component.imports\' of this component' :
7452
- 'a part of an @NgModule where this component is declared';
7453
- if (KNOWN_CONTROL_FLOW_DIRECTIVES.has(propName)) {
7454
- // Most likely this is a control flow directive (such as `*ngIf`) used in
7455
- // a template, but the directive or the `CommonModule` is not imported.
7456
- const correspondingImport = KNOWN_CONTROL_FLOW_DIRECTIVES.get(propName);
7457
- message += `\nIf the '${propName}' is an Angular control flow directive, ` +
7458
- `please make sure that either the '${correspondingImport}' directive or the 'CommonModule' is ${importLocation}.`;
7459
- }
7460
- else {
7461
- // May be an Angular component, which is not imported/declared?
7462
- message += `\n1. If '${tagName}' is an Angular component and it has the ` +
7463
- `'${propName}' input, then verify that it is ${importLocation}.`;
7464
- // May be a Web Component?
7465
- if (tagName && tagName.indexOf('-') > -1) {
7466
- message += `\n2. If '${tagName}' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' ` +
7467
- `to the ${schemas} of this component to suppress this message.`;
7468
- message += `\n3. To allow any property add 'NO_ERRORS_SCHEMA' to ` +
7469
- `the ${schemas} of this component.`;
7470
- }
7471
- else {
7472
- // If it's expected, the error can be suppressed by the `NO_ERRORS_SCHEMA` schema.
7473
- message += `\n2. To allow any property add 'NO_ERRORS_SCHEMA' to ` +
7474
- `the ${schemas} of this component.`;
7475
- }
7476
- }
7477
- reportUnknownPropertyError(message);
7153
+ function unwrapElementRef(value) {
7154
+ return value instanceof ElementRef ? value.nativeElement : value;
7478
7155
  }
7479
- function reportUnknownPropertyError(message) {
7480
- if (shouldThrowErrorOnUnknownProperty) {
7481
- throw new RuntimeError(303 /* RuntimeErrorCode.UNKNOWN_BINDING */, message);
7482
- }
7483
- else {
7484
- console.error(formatRuntimeError(303 /* RuntimeErrorCode.UNKNOWN_BINDING */, message));
7485
- }
7156
+
7157
+ /**
7158
+ * @license
7159
+ * Copyright Google LLC All Rights Reserved.
7160
+ *
7161
+ * Use of this source code is governed by an MIT-style license that can be
7162
+ * found in the LICENSE file at https://angular.io/license
7163
+ */
7164
+ const Renderer2Interceptor = new InjectionToken('Renderer2Interceptor');
7165
+ /**
7166
+ * Creates and initializes a custom renderer that implements the `Renderer2` base class.
7167
+ *
7168
+ * @publicApi
7169
+ */
7170
+ class RendererFactory2 {
7486
7171
  }
7487
7172
  /**
7488
- * WARNING: this is a **dev-mode only** function (thus should always be guarded by the `ngDevMode`)
7489
- * and must **not** be used in production bundles. The function makes megamorphic reads, which might
7490
- * be too slow for production mode and also it relies on the constructor function being available.
7173
+ * Extend this base class to implement custom rendering. By default, Angular
7174
+ * renders a template into DOM. You can use custom rendering to intercept
7175
+ * rendering calls, or to render to something other than DOM.
7491
7176
  *
7492
- * Gets a reference to the host component def (where a current component is declared).
7177
+ * Create your custom renderer using `RendererFactory2`.
7493
7178
  *
7494
- * @param lView An `LView` that represents a current component that is being rendered.
7179
+ * Use a custom renderer to bypass Angular's templating and
7180
+ * make custom UI changes that can't be expressed declaratively.
7181
+ * For example if you need to set a property or an attribute whose name is
7182
+ * not statically known, use the `setProperty()` or
7183
+ * `setAttribute()` method.
7184
+ *
7185
+ * @publicApi
7495
7186
  */
7496
- function getDeclarationComponentDef(lView) {
7497
- !ngDevMode && throwError('Must never be called in production mode');
7498
- const declarationLView = lView[DECLARATION_COMPONENT_VIEW];
7499
- const context = declarationLView[CONTEXT];
7500
- // Unable to obtain a context.
7501
- if (!context)
7502
- return null;
7503
- return context.constructor ? getComponentDef(context.constructor) : null;
7187
+ class Renderer2 {
7504
7188
  }
7505
7189
  /**
7506
- * WARNING: this is a **dev-mode only** function (thus should always be guarded by the `ngDevMode`)
7507
- * and must **not** be used in production bundles. The function makes megamorphic reads, which might
7508
- * be too slow for production mode.
7190
+ * @internal
7191
+ * @nocollapse
7192
+ */
7193
+ Renderer2.__NG_ELEMENT_ID__ = () => injectRenderer2();
7194
+ /** Injects a Renderer2 for the current component. */
7195
+ function injectRenderer2() {
7196
+ // We need the Renderer to be based on the component that it's being injected into, however since
7197
+ // DI happens before we've entered its view, `getLView` will return the parent view instead.
7198
+ const lView = getLView();
7199
+ const tNode = getCurrentTNode();
7200
+ const nodeAtIndex = getComponentLViewByIndex(tNode.index, lView);
7201
+ return (isLView(nodeAtIndex) ? nodeAtIndex : lView)[RENDERER];
7202
+ }
7203
+
7204
+ /**
7205
+ * @license
7206
+ * Copyright Google LLC All Rights Reserved.
7509
7207
  *
7510
- * Checks if the current component is declared inside of a standalone component template.
7208
+ * Use of this source code is governed by an MIT-style license that can be
7209
+ * found in the LICENSE file at https://angular.io/license
7210
+ */
7211
+ /**
7212
+ * Sanitizer is used by the views to sanitize potentially dangerous values.
7511
7213
  *
7512
- * @param lView An `LView` that represents a current component that is being rendered.
7214
+ * @publicApi
7513
7215
  */
7514
- function isHostComponentStandalone(lView) {
7515
- !ngDevMode && throwError('Must never be called in production mode');
7516
- const componentDef = getDeclarationComponentDef(lView);
7517
- // Treat host component as non-standalone if we can't obtain the def.
7518
- return !!(componentDef === null || componentDef === void 0 ? void 0 : componentDef.standalone);
7216
+ class Sanitizer {
7519
7217
  }
7218
+ /** @nocollapse */
7219
+ Sanitizer.ɵprov = ɵɵdefineInjectable({
7220
+ token: Sanitizer,
7221
+ providedIn: 'root',
7222
+ factory: () => null,
7223
+ });
7224
+
7520
7225
  /**
7521
- * WARNING: this is a **dev-mode only** function (thus should always be guarded by the `ngDevMode`)
7522
- * and must **not** be used in production bundles. The function makes megamorphic reads, which might
7523
- * be too slow for production mode.
7226
+ * @license
7227
+ * Copyright Google LLC All Rights Reserved.
7524
7228
  *
7525
- * Constructs a string describing the location of the host component template. The function is used
7526
- * in dev mode to produce error messages.
7229
+ * Use of this source code is governed by an MIT-style license that can be
7230
+ * found in the LICENSE file at https://angular.io/license
7231
+ */
7232
+ /**
7233
+ * @description Represents the version of Angular
7527
7234
  *
7528
- * @param lView An `LView` that represents a current component that is being rendered.
7235
+ * @publicApi
7529
7236
  */
7530
- function getTemplateLocationDetails(lView) {
7531
- var _a;
7532
- !ngDevMode && throwError('Must never be called in production mode');
7533
- const hostComponentDef = getDeclarationComponentDef(lView);
7534
- const componentClassName = (_a = hostComponentDef === null || hostComponentDef === void 0 ? void 0 : hostComponentDef.type) === null || _a === void 0 ? void 0 : _a.name;
7535
- return componentClassName ? ` (used in the '${componentClassName}' component template)` : '';
7237
+ class Version {
7238
+ constructor(full) {
7239
+ this.full = full;
7240
+ this.major = full.split('.')[0];
7241
+ this.minor = full.split('.')[1];
7242
+ this.patch = full.split('.').slice(2).join('.');
7243
+ }
7536
7244
  }
7537
7245
  /**
7538
- * The set of known control flow directives and their corresponding imports.
7539
- * We use this set to produce a more precises error message with a note
7540
- * that the `CommonModule` should also be included.
7246
+ * @publicApi
7541
7247
  */
7542
- const KNOWN_CONTROL_FLOW_DIRECTIVES = new Map([
7543
- ['ngIf', 'NgIf'], ['ngFor', 'NgFor'], ['ngSwitchCase', 'NgSwitchCase'],
7544
- ['ngSwitchDefault', 'NgSwitchDefault']
7545
- ]);
7248
+ const VERSION = new Version('15.0.0-next.5');
7249
+
7250
+ /**
7251
+ * @license
7252
+ * Copyright Google LLC All Rights Reserved.
7253
+ *
7254
+ * Use of this source code is governed by an MIT-style license that can be
7255
+ * found in the LICENSE file at https://angular.io/license
7256
+ */
7257
+ // This default value is when checking the hierarchy for a token.
7258
+ //
7259
+ // It means both:
7260
+ // - the token is not provided by the current injector,
7261
+ // - only the element injectors should be checked (ie do not check module injectors
7262
+ //
7263
+ // mod1
7264
+ // /
7265
+ // el1 mod2
7266
+ // \ /
7267
+ // el2
7268
+ //
7269
+ // When requesting el2.injector.get(token), we should check in the following order and return the
7270
+ // first found value:
7271
+ // - el2.injector.get(token, default)
7272
+ // - el1.injector.get(token, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR) -> do not check the module
7273
+ // - mod2.injector.get(token, default)
7274
+ const NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR = {};
7275
+
7546
7276
  /**
7547
- * Returns true if the tag name is allowed by specified schemas.
7548
- * @param schemas Array of schemas
7549
- * @param tagName Name of the tag
7277
+ * @license
7278
+ * Copyright Google LLC All Rights Reserved.
7279
+ *
7280
+ * Use of this source code is governed by an MIT-style license that can be
7281
+ * found in the LICENSE file at https://angular.io/license
7550
7282
  */
7551
- function matchingSchemas(schemas, tagName) {
7552
- if (schemas !== null) {
7553
- for (let i = 0; i < schemas.length; i++) {
7554
- const schema = schemas[i];
7555
- if (schema === NO_ERRORS_SCHEMA ||
7556
- schema === CUSTOM_ELEMENTS_SCHEMA && tagName && tagName.indexOf('-') > -1) {
7557
- return true;
7558
- }
7559
- }
7560
- }
7561
- return false;
7283
+ // Keeps track of the currently-active LViews.
7284
+ const TRACKED_LVIEWS = new Map();
7285
+ // Used for generating unique IDs for LViews.
7286
+ let uniqueIdCounter = 0;
7287
+ /** Gets a unique ID that can be assigned to an LView. */
7288
+ function getUniqueLViewId() {
7289
+ return uniqueIdCounter++;
7290
+ }
7291
+ /** Starts tracking an LView. */
7292
+ function registerLView(lView) {
7293
+ ngDevMode && assertNumber(lView[ID], 'LView must have an ID in order to be registered');
7294
+ TRACKED_LVIEWS.set(lView[ID], lView);
7295
+ }
7296
+ /** Gets an LView by its unique ID. */
7297
+ function getLViewById(id) {
7298
+ ngDevMode && assertNumber(id, 'ID used for LView lookup must be a number');
7299
+ return TRACKED_LVIEWS.get(id) || null;
7300
+ }
7301
+ /** Stops tracking an LView. */
7302
+ function unregisterLView(lView) {
7303
+ ngDevMode && assertNumber(lView[ID], 'Cannot stop tracking an LView that does not have an ID');
7304
+ TRACKED_LVIEWS.delete(lView[ID]);
7562
7305
  }
7563
7306
 
7564
7307
  /**
@@ -7568,15 +7311,38 @@ function matchingSchemas(schemas, tagName) {
7568
7311
  * Use of this source code is governed by an MIT-style license that can be
7569
7312
  * found in the LICENSE file at https://angular.io/license
7570
7313
  */
7571
- const ERROR_ORIGINAL_ERROR = 'ngOriginalError';
7572
- function wrappedError(message, originalError) {
7573
- const msg = `${message} caused by: ${originalError instanceof Error ? originalError.message : originalError}`;
7574
- const error = Error(msg);
7575
- error[ERROR_ORIGINAL_ERROR] = originalError;
7576
- return error;
7577
- }
7578
- function getOriginalError(error) {
7579
- return error[ERROR_ORIGINAL_ERROR];
7314
+ /**
7315
+ * The internal view context which is specific to a given DOM element, directive or
7316
+ * component instance. Each value in here (besides the LView and element node details)
7317
+ * can be present, null or undefined. If undefined then it implies the value has not been
7318
+ * looked up yet, otherwise, if null, then a lookup was executed and nothing was found.
7319
+ *
7320
+ * Each value will get filled when the respective value is examined within the getContext
7321
+ * function. The component, element and each directive instance will share the same instance
7322
+ * of the context.
7323
+ */
7324
+ class LContext {
7325
+ constructor(
7326
+ /**
7327
+ * ID of the component's parent view data.
7328
+ */
7329
+ lViewId,
7330
+ /**
7331
+ * The index instance of the node.
7332
+ */
7333
+ nodeIndex,
7334
+ /**
7335
+ * The instance of the DOM node that is attached to the lNode.
7336
+ */
7337
+ native) {
7338
+ this.lViewId = lViewId;
7339
+ this.nodeIndex = nodeIndex;
7340
+ this.native = native;
7341
+ }
7342
+ /** Component's parent view data. */
7343
+ get lView() {
7344
+ return getLViewById(this.lViewId);
7345
+ }
7580
7346
  }
7581
7347
 
7582
7348
  /**
@@ -7587,158 +7353,304 @@ function getOriginalError(error) {
7587
7353
  * found in the LICENSE file at https://angular.io/license
7588
7354
  */
7589
7355
  /**
7590
- * Provides a hook for centralized exception handling.
7591
- *
7592
- * The default implementation of `ErrorHandler` prints error messages to the `console`. To
7593
- * intercept error handling, write a custom exception handler that replaces this default as
7594
- * appropriate for your app.
7356
+ * Returns the matching `LContext` data for a given DOM node, directive or component instance.
7595
7357
  *
7596
- * @usageNotes
7597
- * ### Example
7358
+ * This function will examine the provided DOM element, component, or directive instance\'s
7359
+ * monkey-patched property to derive the `LContext` data. Once called then the monkey-patched
7360
+ * value will be that of the newly created `LContext`.
7598
7361
  *
7599
- * ```
7600
- * class MyErrorHandler implements ErrorHandler {
7601
- * handleError(error) {
7602
- * // do something with the exception
7603
- * }
7604
- * }
7362
+ * If the monkey-patched value is the `LView` instance then the context value for that
7363
+ * target will be created and the monkey-patch reference will be updated. Therefore when this
7364
+ * function is called it may mutate the provided element\'s, component\'s or any of the associated
7365
+ * directive\'s monkey-patch values.
7605
7366
  *
7606
- * @NgModule({
7607
- * providers: [{provide: ErrorHandler, useClass: MyErrorHandler}]
7608
- * })
7609
- * class MyModule {}
7610
- * ```
7367
+ * If the monkey-patch value is not detected then the code will walk up the DOM until an element
7368
+ * is found which contains a monkey-patch reference. When that occurs then the provided element
7369
+ * will be updated with a new context (which is then returned). If the monkey-patch value is not
7370
+ * detected for a component/directive instance then it will throw an error (all components and
7371
+ * directives should be automatically monkey-patched by ivy).
7611
7372
  *
7612
- * @publicApi
7373
+ * @param target Component, Directive or DOM Node.
7613
7374
  */
7614
- class ErrorHandler {
7615
- constructor() {
7616
- /**
7617
- * @internal
7618
- */
7619
- this._console = console;
7375
+ function getLContext(target) {
7376
+ let mpValue = readPatchedData(target);
7377
+ if (mpValue) {
7378
+ // only when it's an array is it considered an LView instance
7379
+ // ... otherwise it's an already constructed LContext instance
7380
+ if (isLView(mpValue)) {
7381
+ const lView = mpValue;
7382
+ let nodeIndex;
7383
+ let component = undefined;
7384
+ let directives = undefined;
7385
+ if (isComponentInstance(target)) {
7386
+ nodeIndex = findViaComponent(lView, target);
7387
+ if (nodeIndex == -1) {
7388
+ throw new Error('The provided component was not found in the application');
7389
+ }
7390
+ component = target;
7391
+ }
7392
+ else if (isDirectiveInstance(target)) {
7393
+ nodeIndex = findViaDirective(lView, target);
7394
+ if (nodeIndex == -1) {
7395
+ throw new Error('The provided directive was not found in the application');
7396
+ }
7397
+ directives = getDirectivesAtNodeIndex(nodeIndex, lView);
7398
+ }
7399
+ else {
7400
+ nodeIndex = findViaNativeElement(lView, target);
7401
+ if (nodeIndex == -1) {
7402
+ return null;
7403
+ }
7404
+ }
7405
+ // the goal is not to fill the entire context full of data because the lookups
7406
+ // are expensive. Instead, only the target data (the element, component, container, ICU
7407
+ // expression or directive details) are filled into the context. If called multiple times
7408
+ // with different target values then the missing target data will be filled in.
7409
+ const native = unwrapRNode(lView[nodeIndex]);
7410
+ const existingCtx = readPatchedData(native);
7411
+ const context = (existingCtx && !Array.isArray(existingCtx)) ?
7412
+ existingCtx :
7413
+ createLContext(lView, nodeIndex, native);
7414
+ // only when the component has been discovered then update the monkey-patch
7415
+ if (component && context.component === undefined) {
7416
+ context.component = component;
7417
+ attachPatchData(context.component, context);
7418
+ }
7419
+ // only when the directives have been discovered then update the monkey-patch
7420
+ if (directives && context.directives === undefined) {
7421
+ context.directives = directives;
7422
+ for (let i = 0; i < directives.length; i++) {
7423
+ attachPatchData(directives[i], context);
7424
+ }
7425
+ }
7426
+ attachPatchData(context.native, context);
7427
+ mpValue = context;
7428
+ }
7620
7429
  }
7621
- handleError(error) {
7622
- const originalError = this._findOriginalError(error);
7623
- this._console.error('ERROR', error);
7624
- if (originalError) {
7625
- this._console.error('ORIGINAL ERROR', originalError);
7430
+ else {
7431
+ const rElement = target;
7432
+ ngDevMode && assertDomNode(rElement);
7433
+ // if the context is not found then we need to traverse upwards up the DOM
7434
+ // to find the nearest element that has already been monkey patched with data
7435
+ let parent = rElement;
7436
+ while (parent = parent.parentNode) {
7437
+ const parentContext = readPatchedData(parent);
7438
+ if (parentContext) {
7439
+ const lView = Array.isArray(parentContext) ? parentContext : parentContext.lView;
7440
+ // the edge of the app was also reached here through another means
7441
+ // (maybe because the DOM was changed manually).
7442
+ if (!lView) {
7443
+ return null;
7444
+ }
7445
+ const index = findViaNativeElement(lView, rElement);
7446
+ if (index >= 0) {
7447
+ const native = unwrapRNode(lView[index]);
7448
+ const context = createLContext(lView, index, native);
7449
+ attachPatchData(native, context);
7450
+ mpValue = context;
7451
+ break;
7452
+ }
7453
+ }
7626
7454
  }
7627
7455
  }
7628
- /** @internal */
7629
- _findOriginalError(error) {
7630
- let e = error && getOriginalError(error);
7631
- while (e && getOriginalError(e)) {
7632
- e = getOriginalError(e);
7633
- }
7634
- return e || null;
7456
+ return mpValue || null;
7457
+ }
7458
+ /**
7459
+ * Creates an empty instance of a `LContext` context
7460
+ */
7461
+ function createLContext(lView, nodeIndex, native) {
7462
+ return new LContext(lView[ID], nodeIndex, native);
7463
+ }
7464
+ /**
7465
+ * Takes a component instance and returns the view for that component.
7466
+ *
7467
+ * @param componentInstance
7468
+ * @returns The component's view
7469
+ */
7470
+ function getComponentViewByInstance(componentInstance) {
7471
+ let patchedData = readPatchedData(componentInstance);
7472
+ let lView;
7473
+ if (isLView(patchedData)) {
7474
+ const contextLView = patchedData;
7475
+ const nodeIndex = findViaComponent(contextLView, componentInstance);
7476
+ lView = getComponentLViewByIndex(nodeIndex, contextLView);
7477
+ const context = createLContext(contextLView, nodeIndex, lView[HOST]);
7478
+ context.component = componentInstance;
7479
+ attachPatchData(componentInstance, context);
7480
+ attachPatchData(context.native, context);
7481
+ }
7482
+ else {
7483
+ const context = patchedData;
7484
+ const contextLView = context.lView;
7485
+ ngDevMode && assertLView(contextLView);
7486
+ lView = getComponentLViewByIndex(context.nodeIndex, contextLView);
7487
+ }
7488
+ return lView;
7489
+ }
7490
+ /**
7491
+ * This property will be monkey-patched on elements, components and directives.
7492
+ */
7493
+ const MONKEY_PATCH_KEY_NAME = '__ngContext__';
7494
+ /**
7495
+ * Assigns the given data to the given target (which could be a component,
7496
+ * directive or DOM node instance) using monkey-patching.
7497
+ */
7498
+ function attachPatchData(target, data) {
7499
+ ngDevMode && assertDefined(target, 'Target expected');
7500
+ // Only attach the ID of the view in order to avoid memory leaks (see #41047). We only do this
7501
+ // for `LView`, because we have control over when an `LView` is created and destroyed, whereas
7502
+ // we can't know when to remove an `LContext`.
7503
+ if (isLView(data)) {
7504
+ target[MONKEY_PATCH_KEY_NAME] = data[ID];
7505
+ registerLView(data);
7506
+ }
7507
+ else {
7508
+ target[MONKEY_PATCH_KEY_NAME] = data;
7635
7509
  }
7636
7510
  }
7637
-
7638
7511
  /**
7639
- * @license
7640
- * Copyright Google LLC All Rights Reserved.
7641
- *
7642
- * Use of this source code is governed by an MIT-style license that can be
7643
- * found in the LICENSE file at https://angular.io/license
7512
+ * Returns the monkey-patch value data present on the target (which could be
7513
+ * a component, directive or a DOM node).
7644
7514
  */
7515
+ function readPatchedData(target) {
7516
+ ngDevMode && assertDefined(target, 'Target expected');
7517
+ const data = target[MONKEY_PATCH_KEY_NAME];
7518
+ return (typeof data === 'number') ? getLViewById(data) : data || null;
7519
+ }
7520
+ function readPatchedLView(target) {
7521
+ const value = readPatchedData(target);
7522
+ if (value) {
7523
+ return (isLView(value) ? value : value.lView);
7524
+ }
7525
+ return null;
7526
+ }
7527
+ function isComponentInstance(instance) {
7528
+ return instance && instance.constructor && instance.constructor.ɵcmp;
7529
+ }
7530
+ function isDirectiveInstance(instance) {
7531
+ return instance && instance.constructor && instance.constructor.ɵdir;
7532
+ }
7645
7533
  /**
7646
- * Disallowed strings in the comment.
7647
- *
7648
- * see: https://html.spec.whatwg.org/multipage/syntax.html#comments
7534
+ * Locates the element within the given LView and returns the matching index
7649
7535
  */
7650
- const COMMENT_DISALLOWED = /^>|^->|<!--|-->|--!>|<!-$/g;
7536
+ function findViaNativeElement(lView, target) {
7537
+ const tView = lView[TVIEW];
7538
+ for (let i = HEADER_OFFSET; i < tView.bindingStartIndex; i++) {
7539
+ if (unwrapRNode(lView[i]) === target) {
7540
+ return i;
7541
+ }
7542
+ }
7543
+ return -1;
7544
+ }
7651
7545
  /**
7652
- * Delimiter in the disallowed strings which needs to be wrapped with zero with character.
7546
+ * Locates the next tNode (child, sibling or parent).
7653
7547
  */
7654
- const COMMENT_DELIMITER = /(<|>)/;
7655
- const COMMENT_DELIMITER_ESCAPED = '\u200B$1\u200B';
7548
+ function traverseNextElement(tNode) {
7549
+ if (tNode.child) {
7550
+ return tNode.child;
7551
+ }
7552
+ else if (tNode.next) {
7553
+ return tNode.next;
7554
+ }
7555
+ else {
7556
+ // Let's take the following template: <div><span>text</span></div><component/>
7557
+ // After checking the text node, we need to find the next parent that has a "next" TNode,
7558
+ // in this case the parent `div`, so that we can find the component.
7559
+ while (tNode.parent && !tNode.parent.next) {
7560
+ tNode = tNode.parent;
7561
+ }
7562
+ return tNode.parent && tNode.parent.next;
7563
+ }
7564
+ }
7656
7565
  /**
7657
- * Escape the content of comment strings so that it can be safely inserted into a comment node.
7658
- *
7659
- * The issue is that HTML does not specify any way to escape comment end text inside the comment.
7660
- * Consider: `<!-- The way you close a comment is with ">", and "->" at the beginning or by "-->" or
7661
- * "--!>" at the end. -->`. Above the `"-->"` is meant to be text not an end to the comment. This
7662
- * can be created programmatically through DOM APIs. (`<!--` are also disallowed.)
7663
- *
7664
- * see: https://html.spec.whatwg.org/multipage/syntax.html#comments
7665
- *
7666
- * ```
7667
- * div.innerHTML = div.innerHTML
7668
- * ```
7669
- *
7670
- * One would expect that the above code would be safe to do, but it turns out that because comment
7671
- * text is not escaped, the comment may contain text which will prematurely close the comment
7672
- * opening up the application for XSS attack. (In SSR we programmatically create comment nodes which
7673
- * may contain such text and expect them to be safe.)
7674
- *
7675
- * This function escapes the comment text by looking for comment delimiters (`<` and `>`) and
7676
- * surrounding them with `_>_` where the `_` is a zero width space `\u200B`. The result is that if a
7677
- * comment contains any of the comment start/end delimiters (such as `<!--`, `-->` or `--!>`) the
7678
- * text it will render normally but it will not cause the HTML parser to close/open the comment.
7679
- *
7680
- * @param value text to make safe for comment node by escaping the comment open/close character
7681
- * sequence.
7566
+ * Locates the component within the given LView and returns the matching index
7682
7567
  */
7683
- function escapeCommentText(value) {
7684
- return value.replace(COMMENT_DISALLOWED, (text) => text.replace(COMMENT_DELIMITER, COMMENT_DELIMITER_ESCAPED));
7568
+ function findViaComponent(lView, componentInstance) {
7569
+ const componentIndices = lView[TVIEW].components;
7570
+ if (componentIndices) {
7571
+ for (let i = 0; i < componentIndices.length; i++) {
7572
+ const elementComponentIndex = componentIndices[i];
7573
+ const componentView = getComponentLViewByIndex(elementComponentIndex, lView);
7574
+ if (componentView[CONTEXT] === componentInstance) {
7575
+ return elementComponentIndex;
7576
+ }
7577
+ }
7578
+ }
7579
+ else {
7580
+ const rootComponentView = getComponentLViewByIndex(HEADER_OFFSET, lView);
7581
+ const rootComponent = rootComponentView[CONTEXT];
7582
+ if (rootComponent === componentInstance) {
7583
+ // we are dealing with the root element here therefore we know that the
7584
+ // element is the very first element after the HEADER data in the lView
7585
+ return HEADER_OFFSET;
7586
+ }
7587
+ }
7588
+ return -1;
7685
7589
  }
7686
-
7687
7590
  /**
7688
- * @license
7689
- * Copyright Google LLC All Rights Reserved.
7690
- *
7691
- * Use of this source code is governed by an MIT-style license that can be
7692
- * found in the LICENSE file at https://angular.io/license
7591
+ * Locates the directive within the given LView and returns the matching index
7693
7592
  */
7694
- function normalizeDebugBindingName(name) {
7695
- // Attribute names with `$` (eg `x-y$`) are valid per spec, but unsupported by some browsers
7696
- name = camelCaseToDashCase(name.replace(/[$@]/g, '_'));
7697
- return `ng-reflect-${name}`;
7698
- }
7699
- const CAMEL_CASE_REGEXP = /([A-Z])/g;
7700
- function camelCaseToDashCase(input) {
7701
- return input.replace(CAMEL_CASE_REGEXP, (...m) => '-' + m[1].toLowerCase());
7702
- }
7703
- function normalizeDebugBindingValue(value) {
7704
- try {
7705
- // Limit the size of the value as otherwise the DOM just gets polluted.
7706
- return value != null ? value.toString().slice(0, 30) : value;
7707
- }
7708
- catch (e) {
7709
- return '[ERROR] Exception while trying to serialize the value';
7593
+ function findViaDirective(lView, directiveInstance) {
7594
+ // if a directive is monkey patched then it will (by default)
7595
+ // have a reference to the LView of the current view. The
7596
+ // element bound to the directive being search lives somewhere
7597
+ // in the view data. We loop through the nodes and check their
7598
+ // list of directives for the instance.
7599
+ let tNode = lView[TVIEW].firstChild;
7600
+ while (tNode) {
7601
+ const directiveIndexStart = tNode.directiveStart;
7602
+ const directiveIndexEnd = tNode.directiveEnd;
7603
+ for (let i = directiveIndexStart; i < directiveIndexEnd; i++) {
7604
+ if (lView[i] === directiveInstance) {
7605
+ return tNode.index;
7606
+ }
7607
+ }
7608
+ tNode = traverseNextElement(tNode);
7710
7609
  }
7610
+ return -1;
7711
7611
  }
7712
-
7713
7612
  /**
7714
- * @license
7715
- * Copyright Google LLC All Rights Reserved.
7613
+ * Returns a list of directives applied to a node at a specific index. The list includes
7614
+ * directives matched by selector and any host directives, but it excludes components.
7615
+ * Use `getComponentAtNodeIndex` to find the component applied to a node.
7716
7616
  *
7717
- * Use of this source code is governed by an MIT-style license that can be
7718
- * found in the LICENSE file at https://angular.io/license
7617
+ * @param nodeIndex The node index
7618
+ * @param lView The target view data
7719
7619
  */
7720
- // Keeps track of the currently-active LViews.
7721
- const TRACKED_LVIEWS = new Map();
7722
- // Used for generating unique IDs for LViews.
7723
- let uniqueIdCounter = 0;
7724
- /** Gets a unique ID that can be assigned to an LView. */
7725
- function getUniqueLViewId() {
7726
- return uniqueIdCounter++;
7727
- }
7728
- /** Starts tracking an LView. */
7729
- function registerLView(lView) {
7730
- ngDevMode && assertNumber(lView[ID], 'LView must have an ID in order to be registered');
7731
- TRACKED_LVIEWS.set(lView[ID], lView);
7620
+ function getDirectivesAtNodeIndex(nodeIndex, lView) {
7621
+ const tNode = lView[TVIEW].data[nodeIndex];
7622
+ if (tNode.directiveStart === 0)
7623
+ return EMPTY_ARRAY;
7624
+ const results = [];
7625
+ for (let i = tNode.directiveStart; i < tNode.directiveEnd; i++) {
7626
+ const directiveInstance = lView[i];
7627
+ if (!isComponentInstance(directiveInstance)) {
7628
+ results.push(directiveInstance);
7629
+ }
7630
+ }
7631
+ return results;
7732
7632
  }
7733
- /** Gets an LView by its unique ID. */
7734
- function getLViewById(id) {
7735
- ngDevMode && assertNumber(id, 'ID used for LView lookup must be a number');
7736
- return TRACKED_LVIEWS.get(id) || null;
7633
+ function getComponentAtNodeIndex(nodeIndex, lView) {
7634
+ const tNode = lView[TVIEW].data[nodeIndex];
7635
+ const { directiveStart, componentOffset } = tNode;
7636
+ return componentOffset > -1 ? lView[directiveStart + componentOffset] : null;
7737
7637
  }
7738
- /** Stops tracking an LView. */
7739
- function unregisterLView(lView) {
7740
- ngDevMode && assertNumber(lView[ID], 'Cannot stop tracking an LView that does not have an ID');
7741
- TRACKED_LVIEWS.delete(lView[ID]);
7638
+ /**
7639
+ * Returns a map of local references (local reference name => element or directive instance) that
7640
+ * exist on a given element.
7641
+ */
7642
+ function discoverLocalRefs(lView, nodeIndex) {
7643
+ const tNode = lView[TVIEW].data[nodeIndex];
7644
+ if (tNode && tNode.localNames) {
7645
+ const result = {};
7646
+ let localIndex = tNode.index + 1;
7647
+ for (let i = 0; i < tNode.localNames.length; i += 2) {
7648
+ result[tNode.localNames[i]] = lView[localIndex];
7649
+ localIndex++;
7650
+ }
7651
+ return result;
7652
+ }
7653
+ return null;
7742
7654
  }
7743
7655
 
7744
7656
  /**
@@ -7749,38 +7661,28 @@ function unregisterLView(lView) {
7749
7661
  * found in the LICENSE file at https://angular.io/license
7750
7662
  */
7751
7663
  /**
7752
- * The internal view context which is specific to a given DOM element, directive or
7753
- * component instance. Each value in here (besides the LView and element node details)
7754
- * can be present, null or undefined. If undefined then it implies the value has not been
7755
- * looked up yet, otherwise, if null, then a lookup was executed and nothing was found.
7664
+ * Defines a schema that allows an NgModule to contain the following:
7665
+ * - Non-Angular elements named with dash case (`-`).
7666
+ * - Element properties named with dash case (`-`).
7667
+ * Dash case is the naming convention for custom elements.
7756
7668
  *
7757
- * Each value will get filled when the respective value is examined within the getContext
7758
- * function. The component, element and each directive instance will share the same instance
7759
- * of the context.
7669
+ * @publicApi
7760
7670
  */
7761
- class LContext {
7762
- constructor(
7763
- /**
7764
- * ID of the component's parent view data.
7765
- */
7766
- lViewId,
7767
- /**
7768
- * The index instance of the node.
7769
- */
7770
- nodeIndex,
7771
- /**
7772
- * The instance of the DOM node that is attached to the lNode.
7773
- */
7774
- native) {
7775
- this.lViewId = lViewId;
7776
- this.nodeIndex = nodeIndex;
7777
- this.native = native;
7778
- }
7779
- /** Component's parent view data. */
7780
- get lView() {
7781
- return getLViewById(this.lViewId);
7782
- }
7783
- }
7671
+ const CUSTOM_ELEMENTS_SCHEMA = {
7672
+ name: 'custom-elements'
7673
+ };
7674
+ /**
7675
+ * Defines a schema that allows any property on any element.
7676
+ *
7677
+ * This schema allows you to ignore the errors related to any unknown elements or properties in a
7678
+ * template. The usage of this schema is generally discouraged because it prevents useful validation
7679
+ * and may hide real errors in your template. Consider using the `CUSTOM_ELEMENTS_SCHEMA` instead.
7680
+ *
7681
+ * @publicApi
7682
+ */
7683
+ const NO_ERRORS_SCHEMA = {
7684
+ name: 'no-errors-schema'
7685
+ };
7784
7686
 
7785
7687
  /**
7786
7688
  * @license
@@ -7789,305 +7691,412 @@ class LContext {
7789
7691
  * Use of this source code is governed by an MIT-style license that can be
7790
7692
  * found in the LICENSE file at https://angular.io/license
7791
7693
  */
7694
+ let shouldThrowErrorOnUnknownElement = false;
7792
7695
  /**
7793
- * Returns the matching `LContext` data for a given DOM node, directive or component instance.
7794
- *
7795
- * This function will examine the provided DOM element, component, or directive instance\'s
7796
- * monkey-patched property to derive the `LContext` data. Once called then the monkey-patched
7797
- * value will be that of the newly created `LContext`.
7798
- *
7799
- * If the monkey-patched value is the `LView` instance then the context value for that
7800
- * target will be created and the monkey-patch reference will be updated. Therefore when this
7801
- * function is called it may mutate the provided element\'s, component\'s or any of the associated
7802
- * directive\'s monkey-patch values.
7696
+ * Sets a strict mode for JIT-compiled components to throw an error on unknown elements,
7697
+ * instead of just logging the error.
7698
+ * (for AOT-compiled ones this check happens at build time).
7699
+ */
7700
+ function ɵsetUnknownElementStrictMode(shouldThrow) {
7701
+ shouldThrowErrorOnUnknownElement = shouldThrow;
7702
+ }
7703
+ /**
7704
+ * Gets the current value of the strict mode.
7705
+ */
7706
+ function ɵgetUnknownElementStrictMode() {
7707
+ return shouldThrowErrorOnUnknownElement;
7708
+ }
7709
+ let shouldThrowErrorOnUnknownProperty = false;
7710
+ /**
7711
+ * Sets a strict mode for JIT-compiled components to throw an error on unknown properties,
7712
+ * instead of just logging the error.
7713
+ * (for AOT-compiled ones this check happens at build time).
7714
+ */
7715
+ function ɵsetUnknownPropertyStrictMode(shouldThrow) {
7716
+ shouldThrowErrorOnUnknownProperty = shouldThrow;
7717
+ }
7718
+ /**
7719
+ * Gets the current value of the strict mode.
7720
+ */
7721
+ function ɵgetUnknownPropertyStrictMode() {
7722
+ return shouldThrowErrorOnUnknownProperty;
7723
+ }
7724
+ /**
7725
+ * Validates that the element is known at runtime and produces
7726
+ * an error if it's not the case.
7727
+ * This check is relevant for JIT-compiled components (for AOT-compiled
7728
+ * ones this check happens at build time).
7803
7729
  *
7804
- * If the monkey-patch value is not detected then the code will walk up the DOM until an element
7805
- * is found which contains a monkey-patch reference. When that occurs then the provided element
7806
- * will be updated with a new context (which is then returned). If the monkey-patch value is not
7807
- * detected for a component/directive instance then it will throw an error (all components and
7808
- * directives should be automatically monkey-patched by ivy).
7730
+ * The element is considered known if either:
7731
+ * - it's a known HTML element
7732
+ * - it's a known custom element
7733
+ * - the element matches any directive
7734
+ * - the element is allowed by one of the schemas
7809
7735
  *
7810
- * @param target Component, Directive or DOM Node.
7736
+ * @param element Element to validate
7737
+ * @param lView An `LView` that represents a current component that is being rendered
7738
+ * @param tagName Name of the tag to check
7739
+ * @param schemas Array of schemas
7740
+ * @param hasDirectives Boolean indicating that the element matches any directive
7811
7741
  */
7812
- function getLContext(target) {
7813
- let mpValue = readPatchedData(target);
7814
- if (mpValue) {
7815
- // only when it's an array is it considered an LView instance
7816
- // ... otherwise it's an already constructed LContext instance
7817
- if (isLView(mpValue)) {
7818
- const lView = mpValue;
7819
- let nodeIndex;
7820
- let component = undefined;
7821
- let directives = undefined;
7822
- if (isComponentInstance(target)) {
7823
- nodeIndex = findViaComponent(lView, target);
7824
- if (nodeIndex == -1) {
7825
- throw new Error('The provided component was not found in the application');
7826
- }
7827
- component = target;
7828
- }
7829
- else if (isDirectiveInstance(target)) {
7830
- nodeIndex = findViaDirective(lView, target);
7831
- if (nodeIndex == -1) {
7832
- throw new Error('The provided directive was not found in the application');
7833
- }
7834
- directives = getDirectivesAtNodeIndex(nodeIndex, lView, false);
7742
+ function validateElementIsKnown(element, lView, tagName, schemas, hasDirectives) {
7743
+ // If `schemas` is set to `null`, that's an indication that this Component was compiled in AOT
7744
+ // mode where this check happens at compile time. In JIT mode, `schemas` is always present and
7745
+ // defined as an array (as an empty array in case `schemas` field is not defined) and we should
7746
+ // execute the check below.
7747
+ if (schemas === null)
7748
+ return;
7749
+ // If the element matches any directive, it's considered as valid.
7750
+ if (!hasDirectives && tagName !== null) {
7751
+ // The element is unknown if it's an instance of HTMLUnknownElement, or it isn't registered
7752
+ // as a custom element. Note that unknown elements with a dash in their name won't be instances
7753
+ // of HTMLUnknownElement in browsers that support web components.
7754
+ const isUnknown =
7755
+ // Note that we can't check for `typeof HTMLUnknownElement === 'function'`,
7756
+ // because while most browsers return 'function', IE returns 'object'.
7757
+ (typeof HTMLUnknownElement !== 'undefined' && HTMLUnknownElement &&
7758
+ element instanceof HTMLUnknownElement) ||
7759
+ (typeof customElements !== 'undefined' && tagName.indexOf('-') > -1 &&
7760
+ !customElements.get(tagName));
7761
+ if (isUnknown && !matchingSchemas(schemas, tagName)) {
7762
+ const isHostStandalone = isHostComponentStandalone(lView);
7763
+ const templateLocation = getTemplateLocationDetails(lView);
7764
+ const schemas = `'${isHostStandalone ? '@Component' : '@NgModule'}.schemas'`;
7765
+ let message = `'${tagName}' is not a known element${templateLocation}:\n`;
7766
+ message += `1. If '${tagName}' is an Angular component, then verify that it is ${isHostStandalone ? 'included in the \'@Component.imports\' of this component' :
7767
+ 'a part of an @NgModule where this component is declared'}.\n`;
7768
+ if (tagName && tagName.indexOf('-') > -1) {
7769
+ message +=
7770
+ `2. If '${tagName}' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the ${schemas} of this component to suppress this message.`;
7835
7771
  }
7836
7772
  else {
7837
- nodeIndex = findViaNativeElement(lView, target);
7838
- if (nodeIndex == -1) {
7839
- return null;
7840
- }
7773
+ message +=
7774
+ `2. To allow any element add 'NO_ERRORS_SCHEMA' to the ${schemas} of this component.`;
7841
7775
  }
7842
- // the goal is not to fill the entire context full of data because the lookups
7843
- // are expensive. Instead, only the target data (the element, component, container, ICU
7844
- // expression or directive details) are filled into the context. If called multiple times
7845
- // with different target values then the missing target data will be filled in.
7846
- const native = unwrapRNode(lView[nodeIndex]);
7847
- const existingCtx = readPatchedData(native);
7848
- const context = (existingCtx && !Array.isArray(existingCtx)) ?
7849
- existingCtx :
7850
- createLContext(lView, nodeIndex, native);
7851
- // only when the component has been discovered then update the monkey-patch
7852
- if (component && context.component === undefined) {
7853
- context.component = component;
7854
- attachPatchData(context.component, context);
7776
+ if (shouldThrowErrorOnUnknownElement) {
7777
+ throw new RuntimeError(304 /* RuntimeErrorCode.UNKNOWN_ELEMENT */, message);
7855
7778
  }
7856
- // only when the directives have been discovered then update the monkey-patch
7857
- if (directives && context.directives === undefined) {
7858
- context.directives = directives;
7859
- for (let i = 0; i < directives.length; i++) {
7860
- attachPatchData(directives[i], context);
7861
- }
7779
+ else {
7780
+ console.error(formatRuntimeError(304 /* RuntimeErrorCode.UNKNOWN_ELEMENT */, message));
7862
7781
  }
7863
- attachPatchData(context.native, context);
7864
- mpValue = context;
7865
7782
  }
7866
7783
  }
7784
+ }
7785
+ /**
7786
+ * Validates that the property of the element is known at runtime and returns
7787
+ * false if it's not the case.
7788
+ * This check is relevant for JIT-compiled components (for AOT-compiled
7789
+ * ones this check happens at build time).
7790
+ *
7791
+ * The property is considered known if either:
7792
+ * - it's a known property of the element
7793
+ * - the element is allowed by one of the schemas
7794
+ * - the property is used for animations
7795
+ *
7796
+ * @param element Element to validate
7797
+ * @param propName Name of the property to check
7798
+ * @param tagName Name of the tag hosting the property
7799
+ * @param schemas Array of schemas
7800
+ */
7801
+ function isPropertyValid(element, propName, tagName, schemas) {
7802
+ // If `schemas` is set to `null`, that's an indication that this Component was compiled in AOT
7803
+ // mode where this check happens at compile time. In JIT mode, `schemas` is always present and
7804
+ // defined as an array (as an empty array in case `schemas` field is not defined) and we should
7805
+ // execute the check below.
7806
+ if (schemas === null)
7807
+ return true;
7808
+ // The property is considered valid if the element matches the schema, it exists on the element,
7809
+ // or it is synthetic, and we are in a browser context (web worker nodes should be skipped).
7810
+ if (matchingSchemas(schemas, tagName) || propName in element || isAnimationProp(propName)) {
7811
+ return true;
7812
+ }
7813
+ // Note: `typeof Node` returns 'function' in most browsers, but on IE it is 'object' so we
7814
+ // need to account for both here, while being careful with `typeof null` also returning 'object'.
7815
+ return typeof Node === 'undefined' || Node === null || !(element instanceof Node);
7816
+ }
7817
+ /**
7818
+ * Logs or throws an error that a property is not supported on an element.
7819
+ *
7820
+ * @param propName Name of the invalid property
7821
+ * @param tagName Name of the tag hosting the property
7822
+ * @param nodeType Type of the node hosting the property
7823
+ * @param lView An `LView` that represents a current component
7824
+ */
7825
+ function handleUnknownPropertyError(propName, tagName, nodeType, lView) {
7826
+ // Special-case a situation when a structural directive is applied to
7827
+ // an `<ng-template>` element, for example: `<ng-template *ngIf="true">`.
7828
+ // In this case the compiler generates the `ɵɵtemplate` instruction with
7829
+ // the `null` as the tagName. The directive matching logic at runtime relies
7830
+ // on this effect (see `isInlineTemplate`), thus using the 'ng-template' as
7831
+ // a default value of the `tNode.value` is not feasible at this moment.
7832
+ if (!tagName && nodeType === 4 /* TNodeType.Container */) {
7833
+ tagName = 'ng-template';
7834
+ }
7835
+ const isHostStandalone = isHostComponentStandalone(lView);
7836
+ const templateLocation = getTemplateLocationDetails(lView);
7837
+ let message = `Can't bind to '${propName}' since it isn't a known property of '${tagName}'${templateLocation}.`;
7838
+ const schemas = `'${isHostStandalone ? '@Component' : '@NgModule'}.schemas'`;
7839
+ const importLocation = isHostStandalone ?
7840
+ 'included in the \'@Component.imports\' of this component' :
7841
+ 'a part of an @NgModule where this component is declared';
7842
+ if (KNOWN_CONTROL_FLOW_DIRECTIVES.has(propName)) {
7843
+ // Most likely this is a control flow directive (such as `*ngIf`) used in
7844
+ // a template, but the directive or the `CommonModule` is not imported.
7845
+ const correspondingImport = KNOWN_CONTROL_FLOW_DIRECTIVES.get(propName);
7846
+ message += `\nIf the '${propName}' is an Angular control flow directive, ` +
7847
+ `please make sure that either the '${correspondingImport}' directive or the 'CommonModule' is ${importLocation}.`;
7848
+ }
7867
7849
  else {
7868
- const rElement = target;
7869
- ngDevMode && assertDomNode(rElement);
7870
- // if the context is not found then we need to traverse upwards up the DOM
7871
- // to find the nearest element that has already been monkey patched with data
7872
- let parent = rElement;
7873
- while (parent = parent.parentNode) {
7874
- const parentContext = readPatchedData(parent);
7875
- if (parentContext) {
7876
- const lView = Array.isArray(parentContext) ? parentContext : parentContext.lView;
7877
- // the edge of the app was also reached here through another means
7878
- // (maybe because the DOM was changed manually).
7879
- if (!lView) {
7880
- return null;
7881
- }
7882
- const index = findViaNativeElement(lView, rElement);
7883
- if (index >= 0) {
7884
- const native = unwrapRNode(lView[index]);
7885
- const context = createLContext(lView, index, native);
7886
- attachPatchData(native, context);
7887
- mpValue = context;
7888
- break;
7889
- }
7890
- }
7850
+ // May be an Angular component, which is not imported/declared?
7851
+ message += `\n1. If '${tagName}' is an Angular component and it has the ` +
7852
+ `'${propName}' input, then verify that it is ${importLocation}.`;
7853
+ // May be a Web Component?
7854
+ if (tagName && tagName.indexOf('-') > -1) {
7855
+ message += `\n2. If '${tagName}' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' ` +
7856
+ `to the ${schemas} of this component to suppress this message.`;
7857
+ message += `\n3. To allow any property add 'NO_ERRORS_SCHEMA' to ` +
7858
+ `the ${schemas} of this component.`;
7859
+ }
7860
+ else {
7861
+ // If it's expected, the error can be suppressed by the `NO_ERRORS_SCHEMA` schema.
7862
+ message += `\n2. To allow any property add 'NO_ERRORS_SCHEMA' to ` +
7863
+ `the ${schemas} of this component.`;
7891
7864
  }
7892
7865
  }
7893
- return mpValue || null;
7866
+ reportUnknownPropertyError(message);
7867
+ }
7868
+ function reportUnknownPropertyError(message) {
7869
+ if (shouldThrowErrorOnUnknownProperty) {
7870
+ throw new RuntimeError(303 /* RuntimeErrorCode.UNKNOWN_BINDING */, message);
7871
+ }
7872
+ else {
7873
+ console.error(formatRuntimeError(303 /* RuntimeErrorCode.UNKNOWN_BINDING */, message));
7874
+ }
7894
7875
  }
7895
7876
  /**
7896
- * Creates an empty instance of a `LContext` context
7877
+ * WARNING: this is a **dev-mode only** function (thus should always be guarded by the `ngDevMode`)
7878
+ * and must **not** be used in production bundles. The function makes megamorphic reads, which might
7879
+ * be too slow for production mode and also it relies on the constructor function being available.
7880
+ *
7881
+ * Gets a reference to the host component def (where a current component is declared).
7882
+ *
7883
+ * @param lView An `LView` that represents a current component that is being rendered.
7897
7884
  */
7898
- function createLContext(lView, nodeIndex, native) {
7899
- return new LContext(lView[ID], nodeIndex, native);
7885
+ function getDeclarationComponentDef(lView) {
7886
+ !ngDevMode && throwError('Must never be called in production mode');
7887
+ const declarationLView = lView[DECLARATION_COMPONENT_VIEW];
7888
+ const context = declarationLView[CONTEXT];
7889
+ // Unable to obtain a context.
7890
+ if (!context)
7891
+ return null;
7892
+ return context.constructor ? getComponentDef(context.constructor) : null;
7900
7893
  }
7901
7894
  /**
7902
- * Takes a component instance and returns the view for that component.
7895
+ * WARNING: this is a **dev-mode only** function (thus should always be guarded by the `ngDevMode`)
7896
+ * and must **not** be used in production bundles. The function makes megamorphic reads, which might
7897
+ * be too slow for production mode.
7903
7898
  *
7904
- * @param componentInstance
7905
- * @returns The component's view
7899
+ * Checks if the current component is declared inside of a standalone component template.
7900
+ *
7901
+ * @param lView An `LView` that represents a current component that is being rendered.
7906
7902
  */
7907
- function getComponentViewByInstance(componentInstance) {
7908
- let patchedData = readPatchedData(componentInstance);
7909
- let lView;
7910
- if (isLView(patchedData)) {
7911
- const contextLView = patchedData;
7912
- const nodeIndex = findViaComponent(contextLView, componentInstance);
7913
- lView = getComponentLViewByIndex(nodeIndex, contextLView);
7914
- const context = createLContext(contextLView, nodeIndex, lView[HOST]);
7915
- context.component = componentInstance;
7916
- attachPatchData(componentInstance, context);
7917
- attachPatchData(context.native, context);
7918
- }
7919
- else {
7920
- const context = patchedData;
7921
- const contextLView = context.lView;
7922
- ngDevMode && assertLView(contextLView);
7923
- lView = getComponentLViewByIndex(context.nodeIndex, contextLView);
7924
- }
7925
- return lView;
7903
+ function isHostComponentStandalone(lView) {
7904
+ !ngDevMode && throwError('Must never be called in production mode');
7905
+ const componentDef = getDeclarationComponentDef(lView);
7906
+ // Treat host component as non-standalone if we can't obtain the def.
7907
+ return !!(componentDef === null || componentDef === void 0 ? void 0 : componentDef.standalone);
7926
7908
  }
7927
7909
  /**
7928
- * This property will be monkey-patched on elements, components and directives.
7910
+ * WARNING: this is a **dev-mode only** function (thus should always be guarded by the `ngDevMode`)
7911
+ * and must **not** be used in production bundles. The function makes megamorphic reads, which might
7912
+ * be too slow for production mode.
7913
+ *
7914
+ * Constructs a string describing the location of the host component template. The function is used
7915
+ * in dev mode to produce error messages.
7916
+ *
7917
+ * @param lView An `LView` that represents a current component that is being rendered.
7929
7918
  */
7930
- const MONKEY_PATCH_KEY_NAME = '__ngContext__';
7919
+ function getTemplateLocationDetails(lView) {
7920
+ var _a;
7921
+ !ngDevMode && throwError('Must never be called in production mode');
7922
+ const hostComponentDef = getDeclarationComponentDef(lView);
7923
+ const componentClassName = (_a = hostComponentDef === null || hostComponentDef === void 0 ? void 0 : hostComponentDef.type) === null || _a === void 0 ? void 0 : _a.name;
7924
+ return componentClassName ? ` (used in the '${componentClassName}' component template)` : '';
7925
+ }
7931
7926
  /**
7932
- * Assigns the given data to the given target (which could be a component,
7933
- * directive or DOM node instance) using monkey-patching.
7927
+ * The set of known control flow directives and their corresponding imports.
7928
+ * We use this set to produce a more precises error message with a note
7929
+ * that the `CommonModule` should also be included.
7934
7930
  */
7935
- function attachPatchData(target, data) {
7936
- ngDevMode && assertDefined(target, 'Target expected');
7937
- // Only attach the ID of the view in order to avoid memory leaks (see #41047). We only do this
7938
- // for `LView`, because we have control over when an `LView` is created and destroyed, whereas
7939
- // we can't know when to remove an `LContext`.
7940
- if (isLView(data)) {
7941
- target[MONKEY_PATCH_KEY_NAME] = data[ID];
7942
- registerLView(data);
7943
- }
7944
- else {
7945
- target[MONKEY_PATCH_KEY_NAME] = data;
7946
- }
7947
- }
7931
+ const KNOWN_CONTROL_FLOW_DIRECTIVES = new Map([
7932
+ ['ngIf', 'NgIf'], ['ngFor', 'NgFor'], ['ngSwitchCase', 'NgSwitchCase'],
7933
+ ['ngSwitchDefault', 'NgSwitchDefault']
7934
+ ]);
7948
7935
  /**
7949
- * Returns the monkey-patch value data present on the target (which could be
7950
- * a component, directive or a DOM node).
7936
+ * Returns true if the tag name is allowed by specified schemas.
7937
+ * @param schemas Array of schemas
7938
+ * @param tagName Name of the tag
7951
7939
  */
7952
- function readPatchedData(target) {
7953
- ngDevMode && assertDefined(target, 'Target expected');
7954
- const data = target[MONKEY_PATCH_KEY_NAME];
7955
- return (typeof data === 'number') ? getLViewById(data) : data || null;
7956
- }
7957
- function readPatchedLView(target) {
7958
- const value = readPatchedData(target);
7959
- if (value) {
7960
- return (isLView(value) ? value : value.lView);
7940
+ function matchingSchemas(schemas, tagName) {
7941
+ if (schemas !== null) {
7942
+ for (let i = 0; i < schemas.length; i++) {
7943
+ const schema = schemas[i];
7944
+ if (schema === NO_ERRORS_SCHEMA ||
7945
+ schema === CUSTOM_ELEMENTS_SCHEMA && tagName && tagName.indexOf('-') > -1) {
7946
+ return true;
7947
+ }
7948
+ }
7961
7949
  }
7962
- return null;
7950
+ return false;
7963
7951
  }
7964
- function isComponentInstance(instance) {
7965
- return instance && instance.constructor && instance.constructor.ɵcmp;
7952
+
7953
+ /**
7954
+ * @license
7955
+ * Copyright Google LLC All Rights Reserved.
7956
+ *
7957
+ * Use of this source code is governed by an MIT-style license that can be
7958
+ * found in the LICENSE file at https://angular.io/license
7959
+ */
7960
+ const ERROR_ORIGINAL_ERROR = 'ngOriginalError';
7961
+ function wrappedError(message, originalError) {
7962
+ const msg = `${message} caused by: ${originalError instanceof Error ? originalError.message : originalError}`;
7963
+ const error = Error(msg);
7964
+ error[ERROR_ORIGINAL_ERROR] = originalError;
7965
+ return error;
7966
7966
  }
7967
- function isDirectiveInstance(instance) {
7968
- return instance && instance.constructor && instance.constructor.ɵdir;
7967
+ function getOriginalError(error) {
7968
+ return error[ERROR_ORIGINAL_ERROR];
7969
7969
  }
7970
+
7970
7971
  /**
7971
- * Locates the element within the given LView and returns the matching index
7972
+ * @license
7973
+ * Copyright Google LLC All Rights Reserved.
7974
+ *
7975
+ * Use of this source code is governed by an MIT-style license that can be
7976
+ * found in the LICENSE file at https://angular.io/license
7972
7977
  */
7973
- function findViaNativeElement(lView, target) {
7974
- const tView = lView[TVIEW];
7975
- for (let i = HEADER_OFFSET; i < tView.bindingStartIndex; i++) {
7976
- if (unwrapRNode(lView[i]) === target) {
7977
- return i;
7978
- }
7979
- }
7980
- return -1;
7981
- }
7982
7978
  /**
7983
- * Locates the next tNode (child, sibling or parent).
7979
+ * Provides a hook for centralized exception handling.
7980
+ *
7981
+ * The default implementation of `ErrorHandler` prints error messages to the `console`. To
7982
+ * intercept error handling, write a custom exception handler that replaces this default as
7983
+ * appropriate for your app.
7984
+ *
7985
+ * @usageNotes
7986
+ * ### Example
7987
+ *
7988
+ * ```
7989
+ * class MyErrorHandler implements ErrorHandler {
7990
+ * handleError(error) {
7991
+ * // do something with the exception
7992
+ * }
7993
+ * }
7994
+ *
7995
+ * @NgModule({
7996
+ * providers: [{provide: ErrorHandler, useClass: MyErrorHandler}]
7997
+ * })
7998
+ * class MyModule {}
7999
+ * ```
8000
+ *
8001
+ * @publicApi
7984
8002
  */
7985
- function traverseNextElement(tNode) {
7986
- if (tNode.child) {
7987
- return tNode.child;
8003
+ class ErrorHandler {
8004
+ constructor() {
8005
+ /**
8006
+ * @internal
8007
+ */
8008
+ this._console = console;
7988
8009
  }
7989
- else if (tNode.next) {
7990
- return tNode.next;
8010
+ handleError(error) {
8011
+ const originalError = this._findOriginalError(error);
8012
+ this._console.error('ERROR', error);
8013
+ if (originalError) {
8014
+ this._console.error('ORIGINAL ERROR', originalError);
8015
+ }
7991
8016
  }
7992
- else {
7993
- // Let's take the following template: <div><span>text</span></div><component/>
7994
- // After checking the text node, we need to find the next parent that has a "next" TNode,
7995
- // in this case the parent `div`, so that we can find the component.
7996
- while (tNode.parent && !tNode.parent.next) {
7997
- tNode = tNode.parent;
8017
+ /** @internal */
8018
+ _findOriginalError(error) {
8019
+ let e = error && getOriginalError(error);
8020
+ while (e && getOriginalError(e)) {
8021
+ e = getOriginalError(e);
7998
8022
  }
7999
- return tNode.parent && tNode.parent.next;
8023
+ return e || null;
8000
8024
  }
8001
8025
  }
8026
+
8002
8027
  /**
8003
- * Locates the component within the given LView and returns the matching index
8028
+ * @license
8029
+ * Copyright Google LLC All Rights Reserved.
8030
+ *
8031
+ * Use of this source code is governed by an MIT-style license that can be
8032
+ * found in the LICENSE file at https://angular.io/license
8004
8033
  */
8005
- function findViaComponent(lView, componentInstance) {
8006
- const componentIndices = lView[TVIEW].components;
8007
- if (componentIndices) {
8008
- for (let i = 0; i < componentIndices.length; i++) {
8009
- const elementComponentIndex = componentIndices[i];
8010
- const componentView = getComponentLViewByIndex(elementComponentIndex, lView);
8011
- if (componentView[CONTEXT] === componentInstance) {
8012
- return elementComponentIndex;
8013
- }
8014
- }
8015
- }
8016
- else {
8017
- const rootComponentView = getComponentLViewByIndex(HEADER_OFFSET, lView);
8018
- const rootComponent = rootComponentView[CONTEXT];
8019
- if (rootComponent === componentInstance) {
8020
- // we are dealing with the root element here therefore we know that the
8021
- // element is the very first element after the HEADER data in the lView
8022
- return HEADER_OFFSET;
8023
- }
8024
- }
8025
- return -1;
8026
- }
8027
8034
  /**
8028
- * Locates the directive within the given LView and returns the matching index
8035
+ * Disallowed strings in the comment.
8036
+ *
8037
+ * see: https://html.spec.whatwg.org/multipage/syntax.html#comments
8038
+ */
8039
+ const COMMENT_DISALLOWED = /^>|^->|<!--|-->|--!>|<!-$/g;
8040
+ /**
8041
+ * Delimiter in the disallowed strings which needs to be wrapped with zero with character.
8042
+ */
8043
+ const COMMENT_DELIMITER = /(<|>)/;
8044
+ const COMMENT_DELIMITER_ESCAPED = '\u200B$1\u200B';
8045
+ /**
8046
+ * Escape the content of comment strings so that it can be safely inserted into a comment node.
8047
+ *
8048
+ * The issue is that HTML does not specify any way to escape comment end text inside the comment.
8049
+ * Consider: `<!-- The way you close a comment is with ">", and "->" at the beginning or by "-->" or
8050
+ * "--!>" at the end. -->`. Above the `"-->"` is meant to be text not an end to the comment. This
8051
+ * can be created programmatically through DOM APIs. (`<!--` are also disallowed.)
8052
+ *
8053
+ * see: https://html.spec.whatwg.org/multipage/syntax.html#comments
8054
+ *
8055
+ * ```
8056
+ * div.innerHTML = div.innerHTML
8057
+ * ```
8058
+ *
8059
+ * One would expect that the above code would be safe to do, but it turns out that because comment
8060
+ * text is not escaped, the comment may contain text which will prematurely close the comment
8061
+ * opening up the application for XSS attack. (In SSR we programmatically create comment nodes which
8062
+ * may contain such text and expect them to be safe.)
8063
+ *
8064
+ * This function escapes the comment text by looking for comment delimiters (`<` and `>`) and
8065
+ * surrounding them with `_>_` where the `_` is a zero width space `\u200B`. The result is that if a
8066
+ * comment contains any of the comment start/end delimiters (such as `<!--`, `-->` or `--!>`) the
8067
+ * text it will render normally but it will not cause the HTML parser to close/open the comment.
8068
+ *
8069
+ * @param value text to make safe for comment node by escaping the comment open/close character
8070
+ * sequence.
8029
8071
  */
8030
- function findViaDirective(lView, directiveInstance) {
8031
- // if a directive is monkey patched then it will (by default)
8032
- // have a reference to the LView of the current view. The
8033
- // element bound to the directive being search lives somewhere
8034
- // in the view data. We loop through the nodes and check their
8035
- // list of directives for the instance.
8036
- let tNode = lView[TVIEW].firstChild;
8037
- while (tNode) {
8038
- const directiveIndexStart = tNode.directiveStart;
8039
- const directiveIndexEnd = tNode.directiveEnd;
8040
- for (let i = directiveIndexStart; i < directiveIndexEnd; i++) {
8041
- if (lView[i] === directiveInstance) {
8042
- return tNode.index;
8043
- }
8044
- }
8045
- tNode = traverseNextElement(tNode);
8046
- }
8047
- return -1;
8072
+ function escapeCommentText(value) {
8073
+ return value.replace(COMMENT_DISALLOWED, (text) => text.replace(COMMENT_DELIMITER, COMMENT_DELIMITER_ESCAPED));
8048
8074
  }
8075
+
8049
8076
  /**
8050
- * Returns a list of directives extracted from the given view based on the
8051
- * provided list of directive index values.
8077
+ * @license
8078
+ * Copyright Google LLC All Rights Reserved.
8052
8079
  *
8053
- * @param nodeIndex The node index
8054
- * @param lView The target view data
8055
- * @param includeComponents Whether or not to include components in returned directives
8080
+ * Use of this source code is governed by an MIT-style license that can be
8081
+ * found in the LICENSE file at https://angular.io/license
8056
8082
  */
8057
- function getDirectivesAtNodeIndex(nodeIndex, lView, includeComponents) {
8058
- const tNode = lView[TVIEW].data[nodeIndex];
8059
- if (tNode.directiveStart === 0)
8060
- return EMPTY_ARRAY;
8061
- const results = [];
8062
- for (let i = tNode.directiveStart; i < tNode.directiveEnd; i++) {
8063
- const directiveInstance = lView[i];
8064
- if (!isComponentInstance(directiveInstance) || includeComponents) {
8065
- results.push(directiveInstance);
8066
- }
8067
- }
8068
- return results;
8083
+ function normalizeDebugBindingName(name) {
8084
+ // Attribute names with `$` (eg `x-y$`) are valid per spec, but unsupported by some browsers
8085
+ name = camelCaseToDashCase(name.replace(/[$@]/g, '_'));
8086
+ return `ng-reflect-${name}`;
8069
8087
  }
8070
- function getComponentAtNodeIndex(nodeIndex, lView) {
8071
- const tNode = lView[TVIEW].data[nodeIndex];
8072
- const { directiveStart, componentOffset } = tNode;
8073
- return componentOffset > -1 ? lView[directiveStart + componentOffset] : null;
8088
+ const CAMEL_CASE_REGEXP = /([A-Z])/g;
8089
+ function camelCaseToDashCase(input) {
8090
+ return input.replace(CAMEL_CASE_REGEXP, (...m) => '-' + m[1].toLowerCase());
8074
8091
  }
8075
- /**
8076
- * Returns a map of local references (local reference name => element or directive instance) that
8077
- * exist on a given element.
8078
- */
8079
- function discoverLocalRefs(lView, nodeIndex) {
8080
- const tNode = lView[TVIEW].data[nodeIndex];
8081
- if (tNode && tNode.localNames) {
8082
- const result = {};
8083
- let localIndex = tNode.index + 1;
8084
- for (let i = 0; i < tNode.localNames.length; i += 2) {
8085
- result[tNode.localNames[i]] = lView[localIndex];
8086
- localIndex++;
8087
- }
8088
- return result;
8092
+ function normalizeDebugBindingValue(value) {
8093
+ try {
8094
+ // Limit the size of the value as otherwise the DOM just gets polluted.
8095
+ return value != null ? value.toString().slice(0, 30) : value;
8096
+ }
8097
+ catch (e) {
8098
+ return '[ERROR] Exception while trying to serialize the value';
8089
8099
  }
8090
- return null;
8091
8100
  }
8092
8101
 
8093
8102
  /**
@@ -9306,6 +9315,19 @@ function writeDirectClass(renderer, element, newValue) {
9306
9315
  }
9307
9316
  ngDevMode && ngDevMode.rendererSetClassName++;
9308
9317
  }
9318
+ /** Sets up the static DOM attributes on an `RNode`. */
9319
+ function setupStaticAttributes(renderer, element, tNode) {
9320
+ const { mergedAttrs, classes, styles } = tNode;
9321
+ if (mergedAttrs !== null) {
9322
+ setUpAttributes(renderer, element, mergedAttrs);
9323
+ }
9324
+ if (classes !== null) {
9325
+ writeDirectClass(renderer, element, classes);
9326
+ }
9327
+ if (styles !== null) {
9328
+ writeDirectStyle(renderer, element, styles);
9329
+ }
9330
+ }
9309
9331
 
9310
9332
  /**
9311
9333
  * @license
@@ -12248,9 +12270,6 @@ function createViewBlueprint(bindingStartIndex, initialViewLength) {
12248
12270
  }
12249
12271
  return blueprint;
12250
12272
  }
12251
- function createError(text, token) {
12252
- return new Error(`Renderer: ${text} [${stringifyForError(token)}]`);
12253
- }
12254
12273
  /**
12255
12274
  * Locates the host native element, used for bootstrapping existing nodes into rendering pipeline.
12256
12275
  *
@@ -12374,26 +12393,49 @@ function createTNode(tView, tParent, type, index, value, attrs) {
12374
12393
  }
12375
12394
  return tNode;
12376
12395
  }
12377
- function generatePropertyAliases(inputAliasMap, directiveDefIdx, propStore) {
12378
- for (let publicName in inputAliasMap) {
12379
- if (inputAliasMap.hasOwnProperty(publicName)) {
12380
- propStore = propStore === null ? {} : propStore;
12381
- const internalName = inputAliasMap[publicName];
12382
- if (propStore.hasOwnProperty(publicName)) {
12383
- propStore[publicName].push(directiveDefIdx, internalName);
12396
+ /**
12397
+ * Generates the `PropertyAliases` data structure from the provided input/output mapping.
12398
+ * @param aliasMap Input/output mapping from the directive definition.
12399
+ * @param directiveIndex Index of the directive.
12400
+ * @param propertyAliases Object in which to store the results.
12401
+ * @param hostDirectiveAliasMap Object used to alias or filter out properties for host directives.
12402
+ * If the mapping is provided, it'll act as an allowlist, as well as a mapping of what public
12403
+ * name inputs/outputs should be exposed under.
12404
+ */
12405
+ function generatePropertyAliases(aliasMap, directiveIndex, propertyAliases, hostDirectiveAliasMap) {
12406
+ for (let publicName in aliasMap) {
12407
+ if (aliasMap.hasOwnProperty(publicName)) {
12408
+ propertyAliases = propertyAliases === null ? {} : propertyAliases;
12409
+ const internalName = aliasMap[publicName];
12410
+ // If there are no host directive mappings, we want to remap using the alias map from the
12411
+ // definition itself. If there is an alias map, it has two functions:
12412
+ // 1. It serves as an allowlist of bindings that are exposed by the host directives. Only the
12413
+ // ones inside the host directive map will be exposed on the host.
12414
+ // 2. The public name of the property is aliased using the host directive alias map, rather
12415
+ // than the alias map from the definition.
12416
+ if (hostDirectiveAliasMap === null) {
12417
+ addPropertyAlias(propertyAliases, directiveIndex, publicName, internalName);
12384
12418
  }
12385
- else {
12386
- (propStore[publicName] = [directiveDefIdx, internalName]);
12419
+ else if (hostDirectiveAliasMap.hasOwnProperty(publicName)) {
12420
+ addPropertyAlias(propertyAliases, directiveIndex, hostDirectiveAliasMap[publicName], internalName);
12387
12421
  }
12388
12422
  }
12389
12423
  }
12390
- return propStore;
12424
+ return propertyAliases;
12425
+ }
12426
+ function addPropertyAlias(propertyAliases, directiveIndex, publicName, internalName) {
12427
+ if (propertyAliases.hasOwnProperty(publicName)) {
12428
+ propertyAliases[publicName].push(directiveIndex, internalName);
12429
+ }
12430
+ else {
12431
+ propertyAliases[publicName] = [directiveIndex, internalName];
12432
+ }
12391
12433
  }
12392
12434
  /**
12393
12435
  * Initializes data structures required to work with directive inputs and outputs.
12394
12436
  * Initialization is done for all directives matched on a given TNode.
12395
12437
  */
12396
- function initializeInputAndOutputAliases(tView, tNode) {
12438
+ function initializeInputAndOutputAliases(tView, tNode, hostDirectiveDefinitionMap) {
12397
12439
  ngDevMode && assertFirstCreatePass(tView);
12398
12440
  const start = tNode.directiveStart;
12399
12441
  const end = tNode.directiveEnd;
@@ -12402,16 +12444,21 @@ function initializeInputAndOutputAliases(tView, tNode) {
12402
12444
  const inputsFromAttrs = ngDevMode ? new TNodeInitialInputs() : [];
12403
12445
  let inputsStore = null;
12404
12446
  let outputsStore = null;
12405
- for (let i = start; i < end; i++) {
12406
- const directiveDef = tViewData[i];
12407
- inputsStore = generatePropertyAliases(directiveDef.inputs, i, inputsStore);
12408
- outputsStore = generatePropertyAliases(directiveDef.outputs, i, outputsStore);
12447
+ for (let directiveIndex = start; directiveIndex < end; directiveIndex++) {
12448
+ const directiveDef = tViewData[directiveIndex];
12449
+ const aliasData = hostDirectiveDefinitionMap ? hostDirectiveDefinitionMap.get(directiveDef) : null;
12450
+ const aliasedInputs = aliasData ? aliasData.inputs : null;
12451
+ const aliasedOutputs = aliasData ? aliasData.outputs : null;
12452
+ inputsStore =
12453
+ generatePropertyAliases(directiveDef.inputs, directiveIndex, inputsStore, aliasedInputs);
12454
+ outputsStore =
12455
+ generatePropertyAliases(directiveDef.outputs, directiveIndex, outputsStore, aliasedOutputs);
12409
12456
  // Do not use unbound attributes as inputs to structural directives, since structural
12410
12457
  // directive inputs can only be set using microsyntax (e.g. `<div *dir="exp">`).
12411
12458
  // TODO(FW-1930): microsyntax expressions may also contain unbound/static attributes, which
12412
12459
  // should be set for inline templates.
12413
12460
  const initialInputs = (inputsStore !== null && tNodeAttrs !== null && !isInlineTemplate(tNode)) ?
12414
- generateInitialInputs(inputsStore, i, tNodeAttrs) :
12461
+ generateInitialInputs(inputsStore, directiveIndex, tNodeAttrs) :
12415
12462
  null;
12416
12463
  inputsFromAttrs.push(initialInputs);
12417
12464
  }
@@ -12527,28 +12574,6 @@ function setNgReflectProperties(lView, element, type, dataValue, value) {
12527
12574
  }
12528
12575
  }
12529
12576
  }
12530
- /**
12531
- * Instantiate a root component.
12532
- */
12533
- function instantiateRootComponent(tView, lView, def) {
12534
- const rootTNode = getCurrentTNode();
12535
- if (tView.firstCreatePass) {
12536
- if (def.providersResolver)
12537
- def.providersResolver(def);
12538
- const directiveIndex = allocExpando(tView, lView, 1, null);
12539
- ngDevMode &&
12540
- assertEqual(directiveIndex, rootTNode.directiveStart, 'Because this is a root component the allocated expando should match the TNode component.');
12541
- configureViewWithDirective(tView, rootTNode, lView, directiveIndex, def);
12542
- initializeInputAndOutputAliases(tView, rootTNode);
12543
- }
12544
- const directive = getNodeInjectable(lView, tView, rootTNode.directiveStart + rootTNode.componentOffset, rootTNode);
12545
- attachPatchData(directive, lView);
12546
- const native = getNativeByTNode(rootTNode, lView);
12547
- if (native) {
12548
- attachPatchData(native, lView);
12549
- }
12550
- return directive;
12551
- }
12552
12577
  /**
12553
12578
  * Resolve the matched directives on a node.
12554
12579
  */
@@ -12558,59 +12583,19 @@ function resolveDirectives(tView, lView, tNode, localRefs) {
12558
12583
  ngDevMode && assertFirstCreatePass(tView);
12559
12584
  let hasDirectives = false;
12560
12585
  if (getBindingsEnabled()) {
12561
- const directiveDefsMatchedBySelectors = findDirectiveDefMatches(tView, lView, tNode);
12562
- const directiveDefs = directiveDefsMatchedBySelectors ?
12563
- findHostDirectiveDefs$1(directiveDefsMatchedBySelectors, tView, lView, tNode) :
12564
- null;
12565
12586
  const exportsMap = localRefs === null ? null : { '': -1 };
12587
+ const matchResult = findDirectiveDefMatches(tView, tNode);
12588
+ let directiveDefs;
12589
+ let hostDirectiveDefs;
12590
+ if (matchResult === null) {
12591
+ directiveDefs = hostDirectiveDefs = null;
12592
+ }
12593
+ else {
12594
+ [directiveDefs, hostDirectiveDefs] = matchResult;
12595
+ }
12566
12596
  if (directiveDefs !== null) {
12567
12597
  hasDirectives = true;
12568
- initTNodeFlags(tNode, tView.data.length, directiveDefs.length);
12569
- // When the same token is provided by several directives on the same node, some rules apply in
12570
- // the viewEngine:
12571
- // - viewProviders have priority over providers
12572
- // - the last directive in NgModule.declarations has priority over the previous one
12573
- // So to match these rules, the order in which providers are added in the arrays is very
12574
- // important.
12575
- for (let i = 0; i < directiveDefs.length; i++) {
12576
- const def = directiveDefs[i];
12577
- if (def.providersResolver)
12578
- def.providersResolver(def);
12579
- }
12580
- let preOrderHooksFound = false;
12581
- let preOrderCheckHooksFound = false;
12582
- let directiveIdx = allocExpando(tView, lView, directiveDefs.length, null);
12583
- ngDevMode &&
12584
- assertSame(directiveIdx, tNode.directiveStart, 'TNode.directiveStart should point to just allocated space');
12585
- for (let i = 0; i < directiveDefs.length; i++) {
12586
- const def = directiveDefs[i];
12587
- // Merge the attrs in the order of matches. This assumes that the first directive is the
12588
- // component itself, so that the component has the least priority.
12589
- tNode.mergedAttrs = mergeHostAttrs(tNode.mergedAttrs, def.hostAttrs);
12590
- configureViewWithDirective(tView, tNode, lView, directiveIdx, def);
12591
- saveNameToExportMap(directiveIdx, def, exportsMap);
12592
- if (def.contentQueries !== null)
12593
- tNode.flags |= 4 /* TNodeFlags.hasContentQuery */;
12594
- if (def.hostBindings !== null || def.hostAttrs !== null || def.hostVars !== 0)
12595
- tNode.flags |= 64 /* TNodeFlags.hasHostBindings */;
12596
- const lifeCycleHooks = def.type.prototype;
12597
- // Only push a node index into the preOrderHooks array if this is the first
12598
- // pre-order hook found on this node.
12599
- if (!preOrderHooksFound &&
12600
- (lifeCycleHooks.ngOnChanges || lifeCycleHooks.ngOnInit || lifeCycleHooks.ngDoCheck)) {
12601
- // We will push the actual hook function into this array later during dir instantiation.
12602
- // We cannot do it now because we must ensure hooks are registered in the same
12603
- // order that directives are created (i.e. injection order).
12604
- (tView.preOrderHooks || (tView.preOrderHooks = [])).push(tNode.index);
12605
- preOrderHooksFound = true;
12606
- }
12607
- if (!preOrderCheckHooksFound && (lifeCycleHooks.ngOnChanges || lifeCycleHooks.ngDoCheck)) {
12608
- (tView.preOrderCheckHooks || (tView.preOrderCheckHooks = [])).push(tNode.index);
12609
- preOrderCheckHooksFound = true;
12610
- }
12611
- directiveIdx++;
12612
- }
12613
- initializeInputAndOutputAliases(tView, tNode);
12598
+ initializeDirectives(tView, lView, tNode, directiveDefs, exportsMap, hostDirectiveDefs);
12614
12599
  }
12615
12600
  if (exportsMap)
12616
12601
  cacheMatchingLocalNames(tNode, localRefs, exportsMap);
@@ -12619,17 +12604,71 @@ function resolveDirectives(tView, lView, tNode, localRefs) {
12619
12604
  tNode.mergedAttrs = mergeHostAttrs(tNode.mergedAttrs, tNode.attrs);
12620
12605
  return hasDirectives;
12621
12606
  }
12607
+ /** Initializes the data structures necessary for a list of directives to be instantiated. */
12608
+ function initializeDirectives(tView, lView, tNode, directives, exportsMap, hostDirectiveDefs) {
12609
+ ngDevMode && assertFirstCreatePass(tView);
12610
+ // Publishes the directive types to DI so they can be injected. Needs to
12611
+ // happen in a separate pass before the TNode flags have been initialized.
12612
+ for (let i = 0; i < directives.length; i++) {
12613
+ diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, lView), tView, directives[i].type);
12614
+ }
12615
+ initTNodeFlags(tNode, tView.data.length, directives.length);
12616
+ // When the same token is provided by several directives on the same node, some rules apply in
12617
+ // the viewEngine:
12618
+ // - viewProviders have priority over providers
12619
+ // - the last directive in NgModule.declarations has priority over the previous one
12620
+ // So to match these rules, the order in which providers are added in the arrays is very
12621
+ // important.
12622
+ for (let i = 0; i < directives.length; i++) {
12623
+ const def = directives[i];
12624
+ if (def.providersResolver)
12625
+ def.providersResolver(def);
12626
+ }
12627
+ let preOrderHooksFound = false;
12628
+ let preOrderCheckHooksFound = false;
12629
+ let directiveIdx = allocExpando(tView, lView, directives.length, null);
12630
+ ngDevMode &&
12631
+ assertSame(directiveIdx, tNode.directiveStart, 'TNode.directiveStart should point to just allocated space');
12632
+ for (let i = 0; i < directives.length; i++) {
12633
+ const def = directives[i];
12634
+ // Merge the attrs in the order of matches. This assumes that the first directive is the
12635
+ // component itself, so that the component has the least priority.
12636
+ tNode.mergedAttrs = mergeHostAttrs(tNode.mergedAttrs, def.hostAttrs);
12637
+ configureViewWithDirective(tView, tNode, lView, directiveIdx, def);
12638
+ saveNameToExportMap(directiveIdx, def, exportsMap);
12639
+ if (def.contentQueries !== null)
12640
+ tNode.flags |= 4 /* TNodeFlags.hasContentQuery */;
12641
+ if (def.hostBindings !== null || def.hostAttrs !== null || def.hostVars !== 0)
12642
+ tNode.flags |= 64 /* TNodeFlags.hasHostBindings */;
12643
+ const lifeCycleHooks = def.type.prototype;
12644
+ // Only push a node index into the preOrderHooks array if this is the first
12645
+ // pre-order hook found on this node.
12646
+ if (!preOrderHooksFound &&
12647
+ (lifeCycleHooks.ngOnChanges || lifeCycleHooks.ngOnInit || lifeCycleHooks.ngDoCheck)) {
12648
+ // We will push the actual hook function into this array later during dir instantiation.
12649
+ // We cannot do it now because we must ensure hooks are registered in the same
12650
+ // order that directives are created (i.e. injection order).
12651
+ (tView.preOrderHooks || (tView.preOrderHooks = [])).push(tNode.index);
12652
+ preOrderHooksFound = true;
12653
+ }
12654
+ if (!preOrderCheckHooksFound && (lifeCycleHooks.ngOnChanges || lifeCycleHooks.ngDoCheck)) {
12655
+ (tView.preOrderCheckHooks || (tView.preOrderCheckHooks = [])).push(tNode.index);
12656
+ preOrderCheckHooksFound = true;
12657
+ }
12658
+ directiveIdx++;
12659
+ }
12660
+ initializeInputAndOutputAliases(tView, tNode, hostDirectiveDefs);
12661
+ }
12622
12662
  /**
12623
12663
  * Add `hostBindings` to the `TView.hostBindingOpCodes`.
12624
12664
  *
12625
12665
  * @param tView `TView` to which the `hostBindings` should be added.
12626
12666
  * @param tNode `TNode` the element which contains the directive
12627
- * @param lView `LView` current `LView`
12628
12667
  * @param directiveIdx Directive index in view.
12629
12668
  * @param directiveVarsIdx Where will the directive's vars be stored
12630
12669
  * @param def `ComponentDef`/`DirectiveDef`, which contains the `hostVars`/`hostBindings` to add.
12631
12670
  */
12632
- function registerHostBindingOpCodes(tView, tNode, lView, directiveIdx, directiveVarsIdx, def) {
12671
+ function registerHostBindingOpCodes(tView, tNode, directiveIdx, directiveVarsIdx, def) {
12633
12672
  ngDevMode && assertFirstCreatePass(tView);
12634
12673
  const hostBindings = def.hostBindings;
12635
12674
  if (hostBindings) {
@@ -12730,38 +12769,65 @@ function invokeHostBindingsInCreationMode(def, directive) {
12730
12769
  * Matches the current node against all available selectors.
12731
12770
  * If a component is matched (at most one), it is returned in first position in the array.
12732
12771
  */
12733
- function findDirectiveDefMatches(tView, viewData, tNode) {
12772
+ function findDirectiveDefMatches(tView, tNode) {
12773
+ var _a;
12734
12774
  ngDevMode && assertFirstCreatePass(tView);
12735
12775
  ngDevMode && assertTNodeType(tNode, 3 /* TNodeType.AnyRNode */ | 12 /* TNodeType.AnyContainer */);
12736
12776
  const registry = tView.directiveRegistry;
12737
12777
  let matches = null;
12778
+ let hostDirectiveDefs = null;
12738
12779
  if (registry) {
12739
12780
  for (let i = 0; i < registry.length; i++) {
12740
12781
  const def = registry[i];
12741
12782
  if (isNodeMatchingSelectorList(tNode, def.selectors, /* isProjectionMode */ false)) {
12742
12783
  matches || (matches = ngDevMode ? new MatchesArray() : []);
12743
- diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, viewData), tView, def.type);
12744
12784
  if (isComponentDef(def)) {
12745
12785
  if (ngDevMode) {
12746
12786
  assertTNodeType(tNode, 2 /* TNodeType.Element */, `"${tNode.value}" tags cannot be used as component hosts. ` +
12747
12787
  `Please use a different tag to activate the ${stringify(def.type)} component.`);
12748
12788
  if (isComponentHost(tNode)) {
12749
- // If another component has been matched previously, it's the first element in the
12750
- // `matches` array, see how we store components/directives in `matches` below.
12751
- throwMultipleComponentError(tNode, matches[0].type, def.type);
12789
+ throwMultipleComponentError(tNode, matches.find(isComponentDef).type, def.type);
12752
12790
  }
12753
12791
  }
12754
- markAsComponentHost(tView, tNode, 0);
12755
- // The component is always stored first with directives after.
12756
- matches.unshift(def);
12792
+ // Components are inserted at the front of the matches array so that their lifecycle
12793
+ // hooks run before any directive lifecycle hooks. This appears to be for ViewEngine
12794
+ // compatibility. This logic doesn't make sense with host directives, because it
12795
+ // would allow the host directives to undo any overrides the host may have made.
12796
+ // To handle this case, the host directives of components are inserted at the beginning
12797
+ // of the array, followed by the component. As such, the insertion order is as follows:
12798
+ // 1. Host directives belonging to the selector-matched component.
12799
+ // 2. Selector-matched component.
12800
+ // 3. Host directives belonging to selector-matched directives.
12801
+ // 4. Selector-matched directives.
12802
+ if (def.findHostDirectiveDefs !== null) {
12803
+ const hostDirectiveMatches = [];
12804
+ hostDirectiveDefs = hostDirectiveDefs || new Map();
12805
+ def.findHostDirectiveDefs(def, hostDirectiveMatches, hostDirectiveDefs);
12806
+ // Add all host directives declared on this component, followed by the component itself.
12807
+ // Host directives should execute first so the host has a chance to override changes
12808
+ // to the DOM made by them.
12809
+ matches.unshift(...hostDirectiveMatches, def);
12810
+ // Component is offset starting from the beginning of the host directives array.
12811
+ const componentOffset = hostDirectiveMatches.length;
12812
+ markAsComponentHost(tView, tNode, componentOffset);
12813
+ }
12814
+ else {
12815
+ // No host directives on this component, just add the
12816
+ // component def to the beginning of the matches.
12817
+ matches.unshift(def);
12818
+ markAsComponentHost(tView, tNode, 0);
12819
+ }
12757
12820
  }
12758
12821
  else {
12822
+ // Append any host directives to the matches first.
12823
+ hostDirectiveDefs = hostDirectiveDefs || new Map();
12824
+ (_a = def.findHostDirectiveDefs) === null || _a === void 0 ? void 0 : _a.call(def, def, matches, hostDirectiveDefs);
12759
12825
  matches.push(def);
12760
12826
  }
12761
12827
  }
12762
12828
  }
12763
12829
  }
12764
- return matches;
12830
+ return matches === null ? null : [matches, hostDirectiveDefs];
12765
12831
  }
12766
12832
  /**
12767
12833
  * Marks a given TNode as a component's host. This consists of:
@@ -12775,26 +12841,6 @@ function markAsComponentHost(tView, hostTNode, componentOffset) {
12775
12841
  (tView.components || (tView.components = ngDevMode ? new TViewComponents() : []))
12776
12842
  .push(hostTNode.index);
12777
12843
  }
12778
- /**
12779
- * Given an array of directives that were matched by their selectors, this function
12780
- * produces a new array that also includes any host directives that have to be applied.
12781
- * @param selectorMatches Directives matched in a template based on their selectors.
12782
- * @param tView Current TView.
12783
- * @param lView Current LView.
12784
- * @param tNode Current TNode that is being matched.
12785
- */
12786
- function findHostDirectiveDefs$1(selectorMatches, tView, lView, tNode) {
12787
- const matches = [];
12788
- for (const def of selectorMatches) {
12789
- if (def.findHostDirectiveDefs === null) {
12790
- matches.push(def);
12791
- }
12792
- else {
12793
- def.findHostDirectiveDefs(matches, def, tView, lView, tNode);
12794
- }
12795
- }
12796
- return matches;
12797
- }
12798
12844
  /** Caches local names and their matching directive indices for query and template lookups. */
12799
12845
  function cacheMatchingLocalNames(tNode, localRefs, exportsMap) {
12800
12846
  if (localRefs) {
@@ -12862,7 +12908,7 @@ function configureViewWithDirective(tView, tNode, lView, directiveIndex, def) {
12862
12908
  const nodeInjectorFactory = new NodeInjectorFactory(directiveFactory, isComponentDef(def), ɵɵdirectiveInject);
12863
12909
  tView.blueprint[directiveIndex] = nodeInjectorFactory;
12864
12910
  lView[directiveIndex] = nodeInjectorFactory;
12865
- registerHostBindingOpCodes(tView, tNode, lView, directiveIndex, allocExpando(tView, lView, def.hostVars, NO_CHANGE), def);
12911
+ registerHostBindingOpCodes(tView, tNode, directiveIndex, allocExpando(tView, lView, def.hostVars, NO_CHANGE), def);
12866
12912
  }
12867
12913
  function addComponentLogic(lView, hostTNode, def) {
12868
12914
  const native = getNativeByTNode(hostTNode, lView);
@@ -13785,6 +13831,7 @@ class ChainedInjector {
13785
13831
  this.parentInjector = parentInjector;
13786
13832
  }
13787
13833
  get(token, notFoundValue, flags) {
13834
+ flags = convertToBitFlags(flags);
13788
13835
  const value = this.injector.get(token, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR, flags);
13789
13836
  if (value !== NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR ||
13790
13837
  notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR) {
@@ -13861,42 +13908,34 @@ class ComponentFactory extends ComponentFactory$1 {
13861
13908
  let component;
13862
13909
  let tElementNode;
13863
13910
  try {
13864
- const componentView = createRootComponentView(hostRNode, this.componentDef, rootLView, rendererFactory, hostRenderer);
13865
- if (hostRNode) {
13866
- if (rootSelectorOrNode) {
13867
- setUpAttributes(hostRenderer, hostRNode, ['ng-version', VERSION.full]);
13868
- }
13869
- else {
13870
- // If host element is created as a part of this function call (i.e. `rootSelectorOrNode`
13871
- // is not defined), also apply attributes and classes extracted from component selector.
13872
- // Extract attributes and classes from the first selector only to match VE behavior.
13873
- const { attrs, classes } = extractAttrsAndClassesFromSelector(this.componentDef.selectors[0]);
13874
- if (attrs) {
13875
- setUpAttributes(hostRenderer, hostRNode, attrs);
13876
- }
13877
- if (classes && classes.length > 0) {
13878
- writeDirectClass(hostRenderer, hostRNode, classes.join(' '));
13879
- }
13880
- }
13911
+ const rootComponentDef = this.componentDef;
13912
+ let rootDirectives;
13913
+ let hostDirectiveDefs = null;
13914
+ if (rootComponentDef.findHostDirectiveDefs) {
13915
+ rootDirectives = [];
13916
+ hostDirectiveDefs = new Map();
13917
+ rootComponentDef.findHostDirectiveDefs(rootComponentDef, rootDirectives, hostDirectiveDefs);
13918
+ rootDirectives.push(rootComponentDef);
13881
13919
  }
13920
+ else {
13921
+ rootDirectives = [rootComponentDef];
13922
+ }
13923
+ const hostTNode = createRootComponentTNode(rootLView, hostRNode);
13924
+ const componentView = createRootComponentView(hostTNode, hostRNode, rootComponentDef, rootDirectives, rootLView, rendererFactory, hostRenderer);
13882
13925
  tElementNode = getTNode(rootTView, HEADER_OFFSET);
13926
+ // TODO(crisbeto): in practice `hostRNode` should always be defined, but there are some tests
13927
+ // where the renderer is mocked out and `undefined` is returned. We should update the tests so
13928
+ // that this check can be removed.
13929
+ if (hostRNode) {
13930
+ setRootNodeAttributes(hostRenderer, rootComponentDef, hostRNode, rootSelectorOrNode);
13931
+ }
13883
13932
  if (projectableNodes !== undefined) {
13884
- const projection = tElementNode.projection = [];
13885
- for (let i = 0; i < this.ngContentSelectors.length; i++) {
13886
- const nodesforSlot = projectableNodes[i];
13887
- // Projectable nodes can be passed as array of arrays or an array of iterables (ngUpgrade
13888
- // case). Here we do normalize passed data structure to be an array of arrays to avoid
13889
- // complex checks down the line.
13890
- // We also normalize the length of the passed in projectable nodes (to match the number of
13891
- // <ng-container> slots defined by a component).
13892
- projection.push(nodesforSlot != null ? Array.from(nodesforSlot) : null);
13893
- }
13933
+ projectNodes(tElementNode, this.ngContentSelectors, projectableNodes);
13894
13934
  }
13895
13935
  // TODO: should LifecycleHooksFeature and other host features be generated by the compiler and
13896
13936
  // executed here?
13897
13937
  // Angular 5 reference: https://stackblitz.com/edit/lifecycle-hooks-vcref
13898
- component =
13899
- createRootComponent(componentView, this.componentDef, rootLView, [LifecycleHooksFeature]);
13938
+ component = createRootComponent(componentView, rootComponentDef, rootDirectives, hostDirectiveDefs, rootLView, [LifecycleHooksFeature]);
13900
13939
  renderView(rootTView, rootLView, null);
13901
13940
  }
13902
13941
  finally {
@@ -13967,11 +14006,22 @@ const NULL_INJECTOR = {
13967
14006
  throwProviderNotFoundError(token, 'NullInjector');
13968
14007
  }
13969
14008
  };
14009
+ /** Creates a TNode that can be used to instantiate a root component. */
14010
+ function createRootComponentTNode(lView, rNode) {
14011
+ const tView = lView[TVIEW];
14012
+ const index = HEADER_OFFSET;
14013
+ ngDevMode && assertIndexInRange(lView, index);
14014
+ lView[index] = rNode;
14015
+ // '#host' is added here as we don't know the real host DOM name (we don't want to read it) and at
14016
+ // the same time we want to communicate the debug `TNode` that this is a special `TNode`
14017
+ // representing a host element.
14018
+ return getOrCreateTNode(tView, index, 2 /* TNodeType.Element */, '#host', null);
14019
+ }
13970
14020
  /**
13971
14021
  * Creates the root component view and the root component node.
13972
14022
  *
13973
14023
  * @param rNode Render host element.
13974
- * @param def ComponentDef
14024
+ * @param rootComponentDef ComponentDef
13975
14025
  * @param rootView The parent view where the host node is stored
13976
14026
  * @param rendererFactory Factory to be used for creating child renderers.
13977
14027
  * @param hostRenderer The current renderer
@@ -13979,72 +14029,95 @@ const NULL_INJECTOR = {
13979
14029
  *
13980
14030
  * @returns Component view created
13981
14031
  */
13982
- function createRootComponentView(rNode, def, rootView, rendererFactory, hostRenderer, sanitizer) {
14032
+ function createRootComponentView(tNode, rNode, rootComponentDef, rootDirectives, rootView, rendererFactory, hostRenderer, sanitizer) {
13983
14033
  const tView = rootView[TVIEW];
13984
- const index = HEADER_OFFSET;
13985
- ngDevMode && assertIndexInRange(rootView, index);
13986
- rootView[index] = rNode;
13987
- // '#host' is added here as we don't know the real host DOM name (we don't want to read it) and at
13988
- // the same time we want to communicate the debug `TNode` that this is a special `TNode`
13989
- // representing a host element.
13990
- const tNode = getOrCreateTNode(tView, index, 2 /* TNodeType.Element */, '#host', null);
13991
- const mergedAttrs = tNode.mergedAttrs = def.hostAttrs;
13992
- if (mergedAttrs !== null) {
13993
- computeStaticStyling(tNode, mergedAttrs, true);
13994
- if (rNode !== null) {
13995
- setUpAttributes(hostRenderer, rNode, mergedAttrs);
13996
- if (tNode.classes !== null) {
13997
- writeDirectClass(hostRenderer, rNode, tNode.classes);
13998
- }
13999
- if (tNode.styles !== null) {
14000
- writeDirectStyle(hostRenderer, rNode, tNode.styles);
14001
- }
14002
- }
14003
- }
14004
- const viewRenderer = rendererFactory.createRenderer(rNode, def);
14005
- const componentView = createLView(rootView, getOrCreateComponentTView(def), null, def.onPush ? 32 /* LViewFlags.Dirty */ : 16 /* LViewFlags.CheckAlways */, rootView[index], tNode, rendererFactory, viewRenderer, sanitizer || null, null, null);
14034
+ applyRootComponentStyling(rootDirectives, tNode, rNode, hostRenderer);
14035
+ const viewRenderer = rendererFactory.createRenderer(rNode, rootComponentDef);
14036
+ 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);
14006
14037
  if (tView.firstCreatePass) {
14007
- diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, rootView), tView, def.type);
14008
- markAsComponentHost(tView, tNode, 0);
14009
- initTNodeFlags(tNode, rootView.length, 1);
14038
+ markAsComponentHost(tView, tNode, rootDirectives.length - 1);
14010
14039
  }
14011
14040
  addToViewTree(rootView, componentView);
14012
14041
  // Store component view at node index, with node as the HOST
14013
- return rootView[index] = componentView;
14042
+ return rootView[tNode.index] = componentView;
14043
+ }
14044
+ /** Sets up the styling information on a root component. */
14045
+ function applyRootComponentStyling(rootDirectives, tNode, rNode, hostRenderer) {
14046
+ for (const def of rootDirectives) {
14047
+ tNode.mergedAttrs = mergeHostAttrs(tNode.mergedAttrs, def.hostAttrs);
14048
+ }
14049
+ if (tNode.mergedAttrs !== null) {
14050
+ computeStaticStyling(tNode, tNode.mergedAttrs, true);
14051
+ if (rNode !== null) {
14052
+ setupStaticAttributes(hostRenderer, rNode, tNode);
14053
+ }
14054
+ }
14014
14055
  }
14015
14056
  /**
14016
14057
  * Creates a root component and sets it up with features and host bindings.Shared by
14017
14058
  * renderComponent() and ViewContainerRef.createComponent().
14018
14059
  */
14019
- function createRootComponent(componentView, componentDef, rootLView, hostFeatures) {
14060
+ function createRootComponent(componentView, rootComponentDef, rootDirectives, hostDirectiveDefs, rootLView, hostFeatures) {
14061
+ const rootTNode = getCurrentTNode();
14062
+ ngDevMode && assertDefined(rootTNode, 'tNode should have been already created');
14020
14063
  const tView = rootLView[TVIEW];
14021
- // Create directive instance with factory() and store at next index in viewData
14022
- const component = instantiateRootComponent(tView, rootLView, componentDef);
14023
- // Root view only contains an instance of this component,
14024
- // so we use a reference to that component instance as a context.
14064
+ const native = getNativeByTNode(rootTNode, rootLView);
14065
+ initializeDirectives(tView, rootLView, rootTNode, rootDirectives, null, hostDirectiveDefs);
14066
+ for (let i = 0; i < rootDirectives.length; i++) {
14067
+ const directiveIndex = rootTNode.directiveStart + i;
14068
+ const directiveInstance = getNodeInjectable(rootLView, tView, directiveIndex, rootTNode);
14069
+ attachPatchData(directiveInstance, rootLView);
14070
+ }
14071
+ invokeDirectivesHostBindings(tView, rootLView, rootTNode);
14072
+ if (native) {
14073
+ attachPatchData(native, rootLView);
14074
+ }
14075
+ // We're guaranteed for the `componentOffset` to be positive here
14076
+ // since a root component always matches a component def.
14077
+ ngDevMode &&
14078
+ assertGreaterThan(rootTNode.componentOffset, -1, 'componentOffset must be great than -1');
14079
+ const component = getNodeInjectable(rootLView, tView, rootTNode.directiveStart + rootTNode.componentOffset, rootTNode);
14025
14080
  componentView[CONTEXT] = rootLView[CONTEXT] = component;
14026
14081
  if (hostFeatures !== null) {
14027
14082
  for (const feature of hostFeatures) {
14028
- feature(component, componentDef);
14083
+ feature(component, rootComponentDef);
14029
14084
  }
14030
14085
  }
14031
14086
  // We want to generate an empty QueryList for root content queries for backwards
14032
14087
  // compatibility with ViewEngine.
14033
- if (componentDef.contentQueries) {
14034
- const tNode = getCurrentTNode();
14035
- ngDevMode && assertDefined(tNode, 'TNode expected');
14036
- componentDef.contentQueries(1 /* RenderFlags.Create */, component, tNode.directiveStart);
14088
+ executeContentQueries(tView, rootTNode, componentView);
14089
+ return component;
14090
+ }
14091
+ /** Sets the static attributes on a root component. */
14092
+ function setRootNodeAttributes(hostRenderer, componentDef, hostRNode, rootSelectorOrNode) {
14093
+ if (rootSelectorOrNode) {
14094
+ setUpAttributes(hostRenderer, hostRNode, ['ng-version', VERSION.full]);
14037
14095
  }
14038
- const rootTNode = getCurrentTNode();
14039
- ngDevMode && assertDefined(rootTNode, 'tNode should have been already created');
14040
- if (tView.firstCreatePass &&
14041
- (componentDef.hostBindings !== null || componentDef.hostAttrs !== null)) {
14042
- setSelectedIndex(rootTNode.index);
14043
- const rootTView = rootLView[TVIEW];
14044
- registerHostBindingOpCodes(rootTView, rootTNode, rootLView, rootTNode.directiveStart, rootTNode.directiveEnd, componentDef);
14045
- invokeHostBindingsInCreationMode(componentDef, component);
14096
+ else {
14097
+ // If host element is created as a part of this function call (i.e. `rootSelectorOrNode`
14098
+ // is not defined), also apply attributes and classes extracted from component selector.
14099
+ // Extract attributes and classes from the first selector only to match VE behavior.
14100
+ const { attrs, classes } = extractAttrsAndClassesFromSelector(componentDef.selectors[0]);
14101
+ if (attrs) {
14102
+ setUpAttributes(hostRenderer, hostRNode, attrs);
14103
+ }
14104
+ if (classes && classes.length > 0) {
14105
+ writeDirectClass(hostRenderer, hostRNode, classes.join(' '));
14106
+ }
14107
+ }
14108
+ }
14109
+ /** Projects the `projectableNodes` that were specified when creating a root component. */
14110
+ function projectNodes(tNode, ngContentSelectors, projectableNodes) {
14111
+ const projection = tNode.projection = [];
14112
+ for (let i = 0; i < ngContentSelectors.length; i++) {
14113
+ const nodesforSlot = projectableNodes[i];
14114
+ // Projectable nodes can be passed as array of arrays or an array of iterables (ngUpgrade
14115
+ // case). Here we do normalize passed data structure to be an array of arrays to avoid
14116
+ // complex checks down the line.
14117
+ // We also normalize the length of the passed in projectable nodes (to match the number of
14118
+ // <ng-container> slots defined by a component).
14119
+ projection.push(nodesforSlot != null ? Array.from(nodesforSlot) : null);
14046
14120
  }
14047
- return component;
14048
14121
  }
14049
14122
  /**
14050
14123
  * Used to enable lifecycle hooks on the root component.
@@ -14310,7 +14383,7 @@ function ɵɵCopyDefinitionFeature(definition) {
14310
14383
  * found in the LICENSE file at https://angular.io/license
14311
14384
  */
14312
14385
  /**
14313
- * This feature add the host directives behavior to a directive definition by patching a
14386
+ * This feature adds the host directives behavior to a directive definition by patching a
14314
14387
  * function onto it. The expectation is that the runtime will invoke the function during
14315
14388
  * directive matching.
14316
14389
  *
@@ -14344,17 +14417,22 @@ function ɵɵHostDirectivesFeature(rawHostDirectives) {
14344
14417
  });
14345
14418
  };
14346
14419
  }
14347
- function findHostDirectiveDefs(matches, def, tView, lView, tNode) {
14348
- if (def.hostDirectives !== null) {
14349
- for (const hostDirectiveConfig of def.hostDirectives) {
14420
+ function findHostDirectiveDefs(currentDef, matchedDefs, hostDirectiveDefs) {
14421
+ if (currentDef.hostDirectives !== null) {
14422
+ for (const hostDirectiveConfig of currentDef.hostDirectives) {
14350
14423
  const hostDirectiveDef = getDirectiveDef(hostDirectiveConfig.directive);
14351
- // TODO(crisbeto): assert that the def exists.
14424
+ if (typeof ngDevMode === 'undefined' || ngDevMode) {
14425
+ validateHostDirective(hostDirectiveConfig, hostDirectiveDef, matchedDefs);
14426
+ }
14427
+ // We need to patch the `declaredInputs` so that
14428
+ // `ngOnChanges` can map the properties correctly.
14429
+ patchDeclaredInputs(hostDirectiveDef.declaredInputs, hostDirectiveConfig.inputs);
14352
14430
  // Host directives execute before the host so that its host bindings can be overwritten.
14353
- findHostDirectiveDefs(matches, hostDirectiveDef, tView, lView, tNode);
14431
+ findHostDirectiveDefs(hostDirectiveDef, matchedDefs, hostDirectiveDefs);
14432
+ hostDirectiveDefs.set(hostDirectiveDef, hostDirectiveConfig);
14433
+ matchedDefs.push(hostDirectiveDef);
14354
14434
  }
14355
14435
  }
14356
- // Push the def itself at the end since it needs to execute after the host directives.
14357
- matches.push(def);
14358
14436
  }
14359
14437
  /**
14360
14438
  * Converts an array in the form of `['publicName', 'alias', 'otherPublicName', 'otherAlias']` into
@@ -14370,6 +14448,90 @@ function bindingArrayToMap(bindings) {
14370
14448
  }
14371
14449
  return result;
14372
14450
  }
14451
+ /**
14452
+ * `ngOnChanges` has some leftover legacy ViewEngine behavior where the keys inside the
14453
+ * `SimpleChanges` event refer to the *declared* name of the input, not its public name or its
14454
+ * minified name. E.g. in `@Input('alias') foo: string`, the name in the `SimpleChanges` object
14455
+ * will always be `foo`, and not `alias` or the minified name of `foo` in apps using property
14456
+ * minification.
14457
+ *
14458
+ * This is achieved through the `DirectiveDef.declaredInputs` map that is constructed when the
14459
+ * definition is declared. When a property is written to the directive instance, the
14460
+ * `NgOnChangesFeature` will try to remap the property name being written to using the
14461
+ * `declaredInputs`.
14462
+ *
14463
+ * Since the host directive input remapping happens during directive matching, `declaredInputs`
14464
+ * won't contain the new alias that the input is available under. This function addresses the
14465
+ * issue by patching the host directive aliases to the `declaredInputs`. There is *not* a risk of
14466
+ * this patching accidentally introducing new inputs to the host directive, because `declaredInputs`
14467
+ * is used *only* by the `NgOnChangesFeature` when determining what name is used in the
14468
+ * `SimpleChanges` object which won't be reached if an input doesn't exist.
14469
+ */
14470
+ function patchDeclaredInputs(declaredInputs, exposedInputs) {
14471
+ for (const publicName in exposedInputs) {
14472
+ if (exposedInputs.hasOwnProperty(publicName)) {
14473
+ const remappedPublicName = exposedInputs[publicName];
14474
+ const privateName = declaredInputs[publicName];
14475
+ // We *technically* shouldn't be able to hit this case because we can't have multiple
14476
+ // inputs on the same property and we have validations against conflicting aliases in
14477
+ // `validateMappings`. If we somehow did, it would lead to `ngOnChanges` being invoked
14478
+ // with the wrong name so we have a non-user-friendly assertion here just in case.
14479
+ if ((typeof ngDevMode === 'undefined' || ngDevMode) &&
14480
+ declaredInputs.hasOwnProperty(remappedPublicName)) {
14481
+ assertEqual(declaredInputs[remappedPublicName], declaredInputs[publicName], `Conflicting host directive input alias ${publicName}.`);
14482
+ }
14483
+ declaredInputs[remappedPublicName] = privateName;
14484
+ }
14485
+ }
14486
+ }
14487
+ /**
14488
+ * Verifies that the host directive has been configured correctly.
14489
+ * @param hostDirectiveConfig Host directive configuration object.
14490
+ * @param directiveDef Directive definition of the host directive.
14491
+ * @param matchedDefs Directives that have been matched so far.
14492
+ */
14493
+ function validateHostDirective(hostDirectiveConfig, directiveDef, matchedDefs) {
14494
+ // TODO(crisbeto): implement more of these checks in the compiler.
14495
+ const type = hostDirectiveConfig.directive;
14496
+ if (directiveDef === null) {
14497
+ if (getComponentDef(type) !== null) {
14498
+ throw new RuntimeError(310 /* RuntimeErrorCode.HOST_DIRECTIVE_COMPONENT */, `Host directive ${type.name} cannot be a component.`);
14499
+ }
14500
+ throw new RuntimeError(307 /* RuntimeErrorCode.HOST_DIRECTIVE_UNRESOLVABLE */, `Could not resolve metadata for host directive ${type.name}. ` +
14501
+ `Make sure that the ${type.name} class is annotated with an @Directive decorator.`);
14502
+ }
14503
+ if (!directiveDef.standalone) {
14504
+ throw new RuntimeError(308 /* RuntimeErrorCode.HOST_DIRECTIVE_NOT_STANDALONE */, `Host directive ${directiveDef.type.name} must be standalone.`);
14505
+ }
14506
+ if (matchedDefs.indexOf(directiveDef) > -1) {
14507
+ throw new RuntimeError(309 /* RuntimeErrorCode.DUPLICATE_DIRECTITVE */, `Directive ${directiveDef.type.name} matches multiple times on the same element. ` +
14508
+ `Directives can only match an element once.`);
14509
+ }
14510
+ validateMappings('input', directiveDef, hostDirectiveConfig.inputs);
14511
+ validateMappings('output', directiveDef, hostDirectiveConfig.outputs);
14512
+ }
14513
+ /**
14514
+ * Checks that the host directive inputs/outputs configuration is valid.
14515
+ * @param bindingType Kind of binding that is being validated. Used in the error message.
14516
+ * @param def Definition of the host directive that is being validated against.
14517
+ * @param hostDirectiveDefs Host directive mapping object that shold be validated.
14518
+ */
14519
+ function validateMappings(bindingType, def, hostDirectiveDefs) {
14520
+ const className = def.type.name;
14521
+ const bindings = bindingType === 'input' ? def.inputs : def.outputs;
14522
+ for (const publicName in hostDirectiveDefs) {
14523
+ if (hostDirectiveDefs.hasOwnProperty(publicName)) {
14524
+ if (!bindings.hasOwnProperty(publicName)) {
14525
+ throw new RuntimeError(311 /* RuntimeErrorCode.HOST_DIRECTIVE_UNDEFINED_BINDING */, `Directive ${className} does not have an ${bindingType} with a public name of ${publicName}.`);
14526
+ }
14527
+ const remappedPublicName = hostDirectiveDefs[publicName];
14528
+ if (bindings.hasOwnProperty(remappedPublicName) &&
14529
+ bindings[remappedPublicName] !== publicName) {
14530
+ throw new RuntimeError(312 /* RuntimeErrorCode.HOST_DIRECTIVE_CONFLICTING_ALIAS */, `Cannot alias ${bindingType} ${publicName} of host directive ${className} to ${remappedPublicName}, because it already has a different ${bindingType} with the same public name.`);
14531
+ }
14532
+ }
14533
+ }
14534
+ }
14373
14535
 
14374
14536
  /**
14375
14537
  * @license
@@ -15313,18 +15475,7 @@ function ɵɵelementStart(index, name, attrsIndex, localRefsIndex) {
15313
15475
  elementStartFirstCreatePass(adjustedIndex, tView, lView, native, name, attrsIndex, localRefsIndex) :
15314
15476
  tView.data[adjustedIndex];
15315
15477
  setCurrentTNode(tNode, true);
15316
- const mergedAttrs = tNode.mergedAttrs;
15317
- if (mergedAttrs !== null) {
15318
- setUpAttributes(renderer, native, mergedAttrs);
15319
- }
15320
- const classes = tNode.classes;
15321
- if (classes !== null) {
15322
- writeDirectClass(renderer, native, classes);
15323
- }
15324
- const styles = tNode.styles;
15325
- if (styles !== null) {
15326
- writeDirectStyle(renderer, native, styles);
15327
- }
15478
+ setupStaticAttributes(renderer, native, tNode);
15328
15479
  if ((tNode.flags & 32 /* TNodeFlags.isDetached */) !== 32 /* TNodeFlags.isDetached */) {
15329
15480
  // In the i18n case, the translation may have removed this element, so only add it if it is not
15330
15481
  // detached. See `TNodeType.Placeholder` and `LFrame.inI18n` for more context.
@@ -22014,7 +22165,7 @@ function getDirectives(node) {
22014
22165
  return [];
22015
22166
  }
22016
22167
  if (context.directives === undefined) {
22017
- context.directives = getDirectivesAtNodeIndex(nodeIndex, lView, false);
22168
+ context.directives = getDirectivesAtNodeIndex(nodeIndex, lView);
22018
22169
  }
22019
22170
  // The `directives` in this case are a named array called `LComponentView`. Clone the
22020
22171
  // result so we don't expose an internal data structure in the user's console.
@@ -24307,7 +24458,7 @@ function generateStandaloneInDeclarationsError(type, location) {
24307
24458
  function verifySemanticsOfNgModuleDef(moduleType, allowDuplicateDeclarationsInRoot, importingModule) {
24308
24459
  if (verifiedNgModule.get(moduleType))
24309
24460
  return;
24310
- // skip verifications of standalone components, directives and pipes
24461
+ // skip verifications of standalone components, directives, and pipes
24311
24462
  if (isStandalone(moduleType))
24312
24463
  return;
24313
24464
  verifiedNgModule.set(moduleType, true);
@@ -26013,6 +26164,35 @@ function getNativeRequestAnimationFrame() {
26013
26164
  return { nativeRequestAnimationFrame, nativeCancelAnimationFrame };
26014
26165
  }
26015
26166
 
26167
+ /**
26168
+ * @license
26169
+ * Copyright Google LLC All Rights Reserved.
26170
+ *
26171
+ * Use of this source code is governed by an MIT-style license that can be
26172
+ * found in the LICENSE file at https://angular.io/license
26173
+ */
26174
+ class AsyncStackTaggingZoneSpec {
26175
+ constructor(namePrefix, consoleAsyncStackTaggingImpl = console) {
26176
+ var _a;
26177
+ this.name = 'asyncStackTagging for ' + namePrefix;
26178
+ this.createTask = (_a = consoleAsyncStackTaggingImpl === null || consoleAsyncStackTaggingImpl === void 0 ? void 0 : consoleAsyncStackTaggingImpl.createTask) !== null && _a !== void 0 ? _a : (() => null);
26179
+ }
26180
+ onScheduleTask(delegate, _current, target, task) {
26181
+ task.consoleTask = this.createTask(`Zone - ${task.source || task.type}`);
26182
+ return delegate.scheduleTask(target, task);
26183
+ }
26184
+ onInvokeTask(delegate, _currentZone, targetZone, task, applyThis, applyArgs) {
26185
+ let ret;
26186
+ if (task.consoleTask) {
26187
+ ret = task.consoleTask.run(() => delegate.invokeTask(targetZone, task, applyThis, applyArgs));
26188
+ }
26189
+ else {
26190
+ ret = delegate.invokeTask(targetZone, task, applyThis, applyArgs);
26191
+ }
26192
+ return ret;
26193
+ }
26194
+ }
26195
+
26016
26196
  /**
26017
26197
  * @license
26018
26198
  * Copyright Google LLC All Rights Reserved.
@@ -26129,8 +26309,12 @@ class NgZone {
26129
26309
  const self = this;
26130
26310
  self._nesting = 0;
26131
26311
  self._outer = self._inner = Zone.current;
26132
- if (Zone['AsyncStackTaggingZoneSpec']) {
26133
- const AsyncStackTaggingZoneSpec = Zone['AsyncStackTaggingZoneSpec'];
26312
+ // AsyncStackTaggingZoneSpec provides `linked stack traces` to show
26313
+ // where the async operation is scheduled. For more details, refer
26314
+ // to this article, https://developer.chrome.com/blog/devtools-better-angular-debugging/
26315
+ // And we only import this AsyncStackTaggingZoneSpec in development mode,
26316
+ // in the production mode, the AsyncStackTaggingZoneSpec will be tree shaken away.
26317
+ if (ngDevMode) {
26134
26318
  self._inner = self._inner.fork(new AsyncStackTaggingZoneSpec('Angular'));
26135
26319
  }
26136
26320
  if (Zone['TaskTrackingZoneSpec']) {
@@ -27577,24 +27761,16 @@ function _mergeArrays(parts) {
27577
27761
  * found in the LICENSE file at https://angular.io/license
27578
27762
  */
27579
27763
  /**
27580
- * This file is used to control if the default rendering pipeline should be `ViewEngine` or `Ivy`.
27581
- *
27582
- * For more information on how to run and debug tests with either Ivy or View Engine (legacy),
27583
- * please see [BAZEL.md](./docs/BAZEL.md).
27584
- */
27585
- let _devMode = true;
27586
- let _runModeLocked = false;
27587
- /**
27588
- * Returns whether Angular is in development mode. After called once,
27589
- * the value is locked and won't change any more.
27764
+ * Returns whether Angular is in development mode.
27590
27765
  *
27591
- * By default, this is true, unless a user calls `enableProdMode` before calling this.
27766
+ * By default, this is true, unless `enableProdMode` is invoked prior to calling this method or the
27767
+ * application is built using the Angular CLI with the `optimization` option.
27768
+ * @see {@link cli/build ng build}
27592
27769
  *
27593
27770
  * @publicApi
27594
27771
  */
27595
27772
  function isDevMode() {
27596
- _runModeLocked = true;
27597
- return _devMode;
27773
+ return typeof ngDevMode === 'undefined' || !!ngDevMode;
27598
27774
  }
27599
27775
  /**
27600
27776
  * Disable Angular's development mode, which turns off assertions and other
@@ -27604,18 +27780,18 @@ function isDevMode() {
27604
27780
  * does not result in additional changes to any bindings (also known as
27605
27781
  * unidirectional data flow).
27606
27782
  *
27783
+ * Using this method is discouraged as the Angular CLI will set production mode when using the
27784
+ * `optimization` option.
27785
+ * @see {@link cli/build ng build}
27786
+ *
27607
27787
  * @publicApi
27608
27788
  */
27609
27789
  function enableProdMode() {
27610
- if (_runModeLocked) {
27611
- throw new Error('Cannot enable prod mode after platform setup.');
27612
- }
27613
27790
  // The below check is there so when ngDevMode is set via terser
27614
27791
  // `global['ngDevMode'] = false;` is also dropped.
27615
- if (typeof ngDevMode === undefined || !!ngDevMode) {
27792
+ if (typeof ngDevMode === 'undefined' || ngDevMode) {
27616
27793
  _global['ngDevMode'] = false;
27617
27794
  }
27618
- _devMode = false;
27619
27795
  }
27620
27796
 
27621
27797
  /**
@@ -29857,5 +30033,5 @@ if (typeof ngDevMode !== 'undefined' && ngDevMode) {
29857
30033
  * Generated bundle index. Do not edit.
29858
30034
  */
29859
30035
 
29860
- export { ANALYZE_FOR_ENTRY_COMPONENTS, ANIMATION_MODULE_TYPE, APP_BOOTSTRAP_LISTENER, APP_ID, APP_INITIALIZER, ApplicationInitStatus, ApplicationModule, ApplicationRef, Attribute, COMPILER_OPTIONS, CUSTOM_ELEMENTS_SCHEMA, ChangeDetectionStrategy, ChangeDetectorRef, Compiler, CompilerFactory, Component, ComponentFactory$1 as ComponentFactory, ComponentFactoryResolver$1 as ComponentFactoryResolver, ComponentRef$1 as ComponentRef, ContentChild, ContentChildren, DEFAULT_CURRENCY_CODE, DebugElement, DebugEventListener, DebugNode, DefaultIterableDiffer, Directive, ENVIRONMENT_INITIALIZER, ElementRef, EmbeddedViewRef, EnvironmentInjector, ErrorHandler, EventEmitter, Host, HostBinding, HostListener, INJECTOR, Inject, InjectFlags, Injectable, InjectionToken, Injector, Input, IterableDiffers, KeyValueDiffers, LOCALE_ID, MissingTranslationStrategy, ModuleWithComponentFactories, NO_ERRORS_SCHEMA, NgModule, NgModuleFactory$1 as NgModuleFactory, NgModuleRef$1 as NgModuleRef, NgProbeToken, NgZone, Optional, Output, PACKAGE_ROOT_URL, PLATFORM_ID, PLATFORM_INITIALIZER, Pipe, PlatformRef, Query, QueryList, ReflectiveInjector, ReflectiveKey, Renderer2, RendererFactory2, RendererStyleFlags2, ResolvedReflectiveFactory, Sanitizer, SecurityContext, Self, SimpleChange, SkipSelf, TRANSLATIONS, TRANSLATIONS_FORMAT, TemplateRef, Testability, TestabilityRegistry, Type, VERSION, Version, ViewChild, ViewChildren, ViewContainerRef, ViewEncapsulation$1 as ViewEncapsulation, ViewRef, asNativeElements, assertPlatform, createComponent, createEnvironmentInjector, createNgModule, createNgModuleRef, createPlatform, createPlatformFactory, defineInjectable, destroyPlatform, enableProdMode, forwardRef, getDebugNode, getModuleFactory, getNgModuleById, getPlatform, importProvidersFrom, inject, isDevMode, platformCore, reflectComponentType, resolveForwardRef, setTestabilityGetter, ALLOW_MULTIPLE_PLATFORMS as ɵALLOW_MULTIPLE_PLATFORMS, APP_ID_RANDOM_PROVIDER as ɵAPP_ID_RANDOM_PROVIDER, ChangeDetectorStatus as ɵChangeDetectorStatus, ComponentFactory$1 as ɵComponentFactory, Console as ɵConsole, DEFAULT_LOCALE_ID as ɵDEFAULT_LOCALE_ID, INJECTOR_SCOPE as ɵINJECTOR_SCOPE, LContext as ɵLContext, LifecycleHooksFeature as ɵLifecycleHooksFeature, LocaleDataIndex as ɵLocaleDataIndex, NG_COMP_DEF as ɵNG_COMP_DEF, NG_DIR_DEF as ɵNG_DIR_DEF, NG_ELEMENT_ID as ɵNG_ELEMENT_ID, NG_INJ_DEF as ɵNG_INJ_DEF, NG_MOD_DEF as ɵNG_MOD_DEF, NG_PIPE_DEF as ɵNG_PIPE_DEF, NG_PROV_DEF as ɵNG_PROV_DEF, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR as ɵNOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR, NO_CHANGE as ɵNO_CHANGE, NgModuleFactory as ɵNgModuleFactory, NoopNgZone as ɵNoopNgZone, ReflectionCapabilities as ɵReflectionCapabilities, ComponentFactory as ɵRender3ComponentFactory, ComponentRef as ɵRender3ComponentRef, NgModuleRef as ɵRender3NgModuleRef, RuntimeError as ɵRuntimeError, TESTABILITY as ɵTESTABILITY, TESTABILITY_GETTER as ɵTESTABILITY_GETTER, ViewRef$1 as ɵViewRef, _sanitizeHtml as ɵ_sanitizeHtml, _sanitizeUrl as ɵ_sanitizeUrl, allowSanitizationBypassAndThrow as ɵallowSanitizationBypassAndThrow, bypassSanitizationTrustHtml as ɵbypassSanitizationTrustHtml, bypassSanitizationTrustResourceUrl as ɵbypassSanitizationTrustResourceUrl, bypassSanitizationTrustScript as ɵbypassSanitizationTrustScript, bypassSanitizationTrustStyle as ɵbypassSanitizationTrustStyle, bypassSanitizationTrustUrl as ɵbypassSanitizationTrustUrl, clearResolutionOfComponentResourcesQueue as ɵclearResolutionOfComponentResourcesQueue, coerceToBoolean as ɵcoerceToBoolean, compileComponent as ɵcompileComponent, compileDirective as ɵcompileDirective, compileNgModule as ɵcompileNgModule, compileNgModuleDefs as ɵcompileNgModuleDefs, compileNgModuleFactory as ɵcompileNgModuleFactory, compilePipe as ɵcompilePipe, createInjector as ɵcreateInjector, defaultIterableDiffers as ɵdefaultIterableDiffers, defaultKeyValueDiffers as ɵdefaultKeyValueDiffers, detectChanges as ɵdetectChanges, devModeEqual as ɵdevModeEqual, findLocaleData as ɵfindLocaleData, flushModuleScopingQueueAsMuchAsPossible as ɵflushModuleScopingQueueAsMuchAsPossible, 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, isInjectable as ɵisInjectable, isListLikeIterable as ɵisListLikeIterable, isObservable as ɵisObservable, isPromise as ɵisPromise, isStandalone as ɵisStandalone, isSubscribable as ɵisSubscribable, ɵivyEnabled, makeDecorator as ɵmakeDecorator, noSideEffects as ɵnoSideEffects, patchComponentDefWithScope as ɵpatchComponentDefWithScope, publishDefaultGlobalUtils$1 as ɵpublishDefaultGlobalUtils, publishGlobalUtil as ɵpublishGlobalUtil, registerLocaleData as ɵregisterLocaleData, resetCompiledComponents as ɵresetCompiledComponents, resetJitOptions as ɵresetJitOptions, resolveComponentResources as ɵresolveComponentResources, setAllowDuplicateNgModuleIdsForTest as ɵsetAllowDuplicateNgModuleIdsForTest, setClassMetadata as ɵsetClassMetadata, setCurrentInjector as ɵsetCurrentInjector, setDocument as ɵsetDocument, setLocaleId as ɵsetLocaleId, ɵsetUnknownElementStrictMode, ɵsetUnknownPropertyStrictMode, store as ɵstore, stringify as ɵstringify, transitiveScopesFor as ɵtransitiveScopesFor, unregisterAllLocaleData as ɵunregisterLocaleData, unwrapSafeValue as ɵunwrapSafeValue, ɵɵCopyDefinitionFeature, FactoryTarget as ɵɵFactoryTarget, ɵɵHostDirectivesFeature, ɵɵInheritDefinitionFeature, ɵɵNgOnChangesFeature, ɵɵProvidersFeature, ɵɵStandaloneFeature, ɵɵadvance, ɵɵattribute, ɵɵattributeInterpolate1, ɵɵattributeInterpolate2, ɵɵattributeInterpolate3, ɵɵattributeInterpolate4, ɵɵattributeInterpolate5, ɵɵattributeInterpolate6, ɵɵattributeInterpolate7, ɵɵattributeInterpolate8, ɵɵattributeInterpolateV, ɵɵclassMap, ɵɵclassMapInterpolate1, ɵɵclassMapInterpolate2, ɵɵclassMapInterpolate3, ɵɵclassMapInterpolate4, ɵɵclassMapInterpolate5, ɵɵclassMapInterpolate6, ɵɵclassMapInterpolate7, ɵɵclassMapInterpolate8, ɵɵclassMapInterpolateV, ɵɵclassProp, ɵɵcontentQuery, ɵɵdefineComponent, ɵɵdefineDirective, ɵɵdefineInjectable, ɵɵdefineInjector, ɵɵdefineNgModule, ɵɵdefinePipe, ɵɵdirectiveInject, ɵɵdisableBindings, ɵɵelement, ɵɵelementContainer, ɵɵelementContainerEnd, ɵɵelementContainerStart, ɵɵelementEnd, ɵɵelementStart, ɵɵenableBindings, ɵɵgetCurrentView, ɵɵgetInheritedFactory, ɵɵhostProperty, ɵɵi18n, ɵɵi18nApply, ɵɵi18nAttributes, ɵɵi18nEnd, ɵɵi18nExp, ɵɵi18nPostprocess, ɵɵi18nStart, ɵɵinject, ɵɵinjectAttribute, ɵɵinvalidFactory, ɵɵinvalidFactoryDep, ɵɵlistener, ɵɵloadQuery, ɵɵnamespaceHTML, ɵɵnamespaceMathML, ɵɵnamespaceSVG, ɵɵnextContext, ɵɵngDeclareClassMetadata, ɵɵngDeclareComponent, ɵɵngDeclareDirective, ɵɵngDeclareFactory, ɵɵngDeclareInjectable, ɵɵngDeclareInjector, ɵɵngDeclareNgModule, ɵɵngDeclarePipe, ɵɵpipe, ɵɵpipeBind1, ɵɵpipeBind2, ɵɵpipeBind3, ɵɵpipeBind4, ɵɵpipeBindV, ɵɵprojection, ɵɵprojectionDef, ɵɵproperty, ɵɵpropertyInterpolate, ɵɵpropertyInterpolate1, ɵɵpropertyInterpolate2, ɵɵpropertyInterpolate3, ɵɵpropertyInterpolate4, ɵɵpropertyInterpolate5, ɵɵpropertyInterpolate6, ɵɵpropertyInterpolate7, ɵɵpropertyInterpolate8, ɵɵpropertyInterpolateV, ɵɵpureFunction0, ɵɵpureFunction1, ɵɵpureFunction2, ɵɵpureFunction3, ɵɵpureFunction4, ɵɵpureFunction5, ɵɵpureFunction6, ɵɵpureFunction7, ɵɵpureFunction8, ɵɵpureFunctionV, ɵɵqueryRefresh, ɵɵreference, registerNgModuleType as ɵɵregisterNgModuleType, ɵɵresetView, ɵɵresolveBody, ɵɵresolveDocument, ɵɵresolveWindow, ɵɵrestoreView, ɵɵsanitizeHtml, ɵɵsanitizeResourceUrl, ɵɵsanitizeScript, ɵɵsanitizeStyle, ɵɵsanitizeUrl, ɵɵsanitizeUrlOrResourceUrl, ɵɵsetComponentScope, ɵɵsetNgModuleScope, ɵɵstyleMap, ɵɵstyleMapInterpolate1, ɵɵstyleMapInterpolate2, ɵɵstyleMapInterpolate3, ɵɵstyleMapInterpolate4, ɵɵstyleMapInterpolate5, ɵɵstyleMapInterpolate6, ɵɵstyleMapInterpolate7, ɵɵstyleMapInterpolate8, ɵɵstyleMapInterpolateV, ɵɵstyleProp, ɵɵstylePropInterpolate1, ɵɵstylePropInterpolate2, ɵɵstylePropInterpolate3, ɵɵstylePropInterpolate4, ɵɵstylePropInterpolate5, ɵɵstylePropInterpolate6, ɵɵstylePropInterpolate7, ɵɵstylePropInterpolate8, ɵɵstylePropInterpolateV, ɵɵsyntheticHostListener, ɵɵsyntheticHostProperty, ɵɵtemplate, ɵɵtemplateRefExtractor, ɵɵtext, ɵɵtextInterpolate, ɵɵtextInterpolate1, ɵɵtextInterpolate2, ɵɵtextInterpolate3, ɵɵtextInterpolate4, ɵɵtextInterpolate5, ɵɵtextInterpolate6, ɵɵtextInterpolate7, ɵɵtextInterpolate8, ɵɵtextInterpolateV, ɵɵtrustConstantHtml, ɵɵtrustConstantResourceUrl, ɵɵviewQuery };
30036
+ export { ANALYZE_FOR_ENTRY_COMPONENTS, ANIMATION_MODULE_TYPE, APP_BOOTSTRAP_LISTENER, APP_ID, APP_INITIALIZER, ApplicationInitStatus, ApplicationModule, ApplicationRef, Attribute, COMPILER_OPTIONS, CUSTOM_ELEMENTS_SCHEMA, ChangeDetectionStrategy, ChangeDetectorRef, Compiler, CompilerFactory, Component, ComponentFactory$1 as ComponentFactory, ComponentFactoryResolver$1 as ComponentFactoryResolver, ComponentRef$1 as ComponentRef, ContentChild, ContentChildren, DEFAULT_CURRENCY_CODE, DebugElement, DebugEventListener, DebugNode, DefaultIterableDiffer, Directive, ENVIRONMENT_INITIALIZER, ElementRef, EmbeddedViewRef, EnvironmentInjector, ErrorHandler, EventEmitter, Host, HostBinding, HostListener, INJECTOR, Inject, InjectFlags, Injectable, InjectionToken, Injector, Input, IterableDiffers, KeyValueDiffers, LOCALE_ID, MissingTranslationStrategy, ModuleWithComponentFactories, NO_ERRORS_SCHEMA, NgModule, NgModuleFactory$1 as NgModuleFactory, NgModuleRef$1 as NgModuleRef, NgProbeToken, NgZone, Optional, Output, PACKAGE_ROOT_URL, PLATFORM_ID, PLATFORM_INITIALIZER, Pipe, PlatformRef, Query, QueryList, ReflectiveInjector, ReflectiveKey, Renderer2, RendererFactory2, RendererStyleFlags2, ResolvedReflectiveFactory, Sanitizer, SecurityContext, Self, SimpleChange, SkipSelf, TRANSLATIONS, TRANSLATIONS_FORMAT, TemplateRef, Testability, TestabilityRegistry, Type, VERSION, Version, ViewChild, ViewChildren, ViewContainerRef, ViewEncapsulation$1 as ViewEncapsulation, ViewRef, asNativeElements, assertPlatform, createComponent, createEnvironmentInjector, createNgModule, createNgModuleRef, createPlatform, createPlatformFactory, defineInjectable, destroyPlatform, enableProdMode, forwardRef, getDebugNode, getModuleFactory, getNgModuleById, getPlatform, importProvidersFrom, inject, isDevMode, platformCore, reflectComponentType, resolveForwardRef, setTestabilityGetter, ALLOW_MULTIPLE_PLATFORMS as ɵALLOW_MULTIPLE_PLATFORMS, APP_ID_RANDOM_PROVIDER as ɵAPP_ID_RANDOM_PROVIDER, ChangeDetectorStatus as ɵChangeDetectorStatus, ComponentFactory$1 as ɵComponentFactory, Console as ɵConsole, DEFAULT_LOCALE_ID as ɵDEFAULT_LOCALE_ID, INJECTOR_SCOPE as ɵINJECTOR_SCOPE, LContext as ɵLContext, LifecycleHooksFeature as ɵLifecycleHooksFeature, LocaleDataIndex as ɵLocaleDataIndex, NG_COMP_DEF as ɵNG_COMP_DEF, NG_DIR_DEF as ɵNG_DIR_DEF, NG_ELEMENT_ID as ɵNG_ELEMENT_ID, NG_INJ_DEF as ɵNG_INJ_DEF, NG_MOD_DEF as ɵNG_MOD_DEF, NG_PIPE_DEF as ɵNG_PIPE_DEF, NG_PROV_DEF as ɵNG_PROV_DEF, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR as ɵNOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR, NO_CHANGE as ɵNO_CHANGE, NgModuleFactory as ɵNgModuleFactory, NoopNgZone as ɵNoopNgZone, ReflectionCapabilities as ɵReflectionCapabilities, ComponentFactory as ɵRender3ComponentFactory, ComponentRef as ɵRender3ComponentRef, NgModuleRef as ɵRender3NgModuleRef, RuntimeError as ɵRuntimeError, TESTABILITY as ɵTESTABILITY, TESTABILITY_GETTER as ɵTESTABILITY_GETTER, ViewRef$1 as ɵViewRef, _sanitizeHtml as ɵ_sanitizeHtml, _sanitizeUrl as ɵ_sanitizeUrl, allowSanitizationBypassAndThrow as ɵallowSanitizationBypassAndThrow, bypassSanitizationTrustHtml as ɵbypassSanitizationTrustHtml, bypassSanitizationTrustResourceUrl as ɵbypassSanitizationTrustResourceUrl, bypassSanitizationTrustScript as ɵbypassSanitizationTrustScript, bypassSanitizationTrustStyle as ɵbypassSanitizationTrustStyle, bypassSanitizationTrustUrl as ɵbypassSanitizationTrustUrl, clearResolutionOfComponentResourcesQueue as ɵclearResolutionOfComponentResourcesQueue, coerceToBoolean as ɵcoerceToBoolean, compileComponent as ɵcompileComponent, compileDirective as ɵcompileDirective, compileNgModule as ɵcompileNgModule, compileNgModuleDefs as ɵcompileNgModuleDefs, compileNgModuleFactory as ɵcompileNgModuleFactory, compilePipe as ɵcompilePipe, convertToBitFlags as ɵconvertToBitFlags, createInjector as ɵcreateInjector, defaultIterableDiffers as ɵdefaultIterableDiffers, defaultKeyValueDiffers as ɵdefaultKeyValueDiffers, detectChanges as ɵdetectChanges, devModeEqual as ɵdevModeEqual, findLocaleData as ɵfindLocaleData, flushModuleScopingQueueAsMuchAsPossible as ɵflushModuleScopingQueueAsMuchAsPossible, formatRuntimeError as ɵformatRuntimeError, getDebugNode as ɵgetDebugNode, getDebugNodeR2 as ɵgetDebugNodeR2, getDirectives as ɵgetDirectives, getHostElement as ɵgetHostElement, getInjectableDef as ɵgetInjectableDef, getLContext as ɵgetLContext, getLocaleCurrencyCode as ɵgetLocaleCurrencyCode, getLocalePluralCase as ɵgetLocalePluralCase, getSanitizationBypassType as ɵgetSanitizationBypassType, ɵgetUnknownElementStrictMode, ɵgetUnknownPropertyStrictMode, _global as ɵglobal, injectChangeDetectorRef as ɵinjectChangeDetectorRef, internalCreateApplication as ɵinternalCreateApplication, isBoundToModule as ɵisBoundToModule, isDefaultChangeDetectionStrategy as ɵisDefaultChangeDetectionStrategy, isInjectable as ɵisInjectable, isListLikeIterable as ɵisListLikeIterable, isObservable as ɵisObservable, isPromise as ɵisPromise, isStandalone as ɵisStandalone, isSubscribable as ɵisSubscribable, ɵivyEnabled, makeDecorator as ɵmakeDecorator, noSideEffects as ɵnoSideEffects, patchComponentDefWithScope as ɵpatchComponentDefWithScope, publishDefaultGlobalUtils$1 as ɵpublishDefaultGlobalUtils, publishGlobalUtil as ɵpublishGlobalUtil, registerLocaleData as ɵregisterLocaleData, resetCompiledComponents as ɵresetCompiledComponents, resetJitOptions as ɵresetJitOptions, resolveComponentResources as ɵresolveComponentResources, setAllowDuplicateNgModuleIdsForTest as ɵsetAllowDuplicateNgModuleIdsForTest, setClassMetadata as ɵsetClassMetadata, setCurrentInjector as ɵsetCurrentInjector, setDocument as ɵsetDocument, setLocaleId as ɵsetLocaleId, ɵsetUnknownElementStrictMode, ɵsetUnknownPropertyStrictMode, store as ɵstore, stringify as ɵstringify, transitiveScopesFor as ɵtransitiveScopesFor, unregisterAllLocaleData as ɵunregisterLocaleData, unwrapSafeValue as ɵunwrapSafeValue, ɵɵCopyDefinitionFeature, FactoryTarget as ɵɵFactoryTarget, ɵɵHostDirectivesFeature, ɵɵInheritDefinitionFeature, ɵɵNgOnChangesFeature, ɵɵProvidersFeature, ɵɵStandaloneFeature, ɵɵadvance, ɵɵattribute, ɵɵattributeInterpolate1, ɵɵattributeInterpolate2, ɵɵattributeInterpolate3, ɵɵattributeInterpolate4, ɵɵattributeInterpolate5, ɵɵattributeInterpolate6, ɵɵattributeInterpolate7, ɵɵattributeInterpolate8, ɵɵattributeInterpolateV, ɵɵclassMap, ɵɵclassMapInterpolate1, ɵɵclassMapInterpolate2, ɵɵclassMapInterpolate3, ɵɵclassMapInterpolate4, ɵɵclassMapInterpolate5, ɵɵclassMapInterpolate6, ɵɵclassMapInterpolate7, ɵɵclassMapInterpolate8, ɵɵclassMapInterpolateV, ɵɵclassProp, ɵɵcontentQuery, ɵɵdefineComponent, ɵɵdefineDirective, ɵɵdefineInjectable, ɵɵdefineInjector, ɵɵdefineNgModule, ɵɵdefinePipe, ɵɵdirectiveInject, ɵɵdisableBindings, ɵɵelement, ɵɵelementContainer, ɵɵelementContainerEnd, ɵɵelementContainerStart, ɵɵelementEnd, ɵɵelementStart, ɵɵenableBindings, ɵɵgetCurrentView, ɵɵgetInheritedFactory, ɵɵhostProperty, ɵɵi18n, ɵɵi18nApply, ɵɵi18nAttributes, ɵɵi18nEnd, ɵɵi18nExp, ɵɵi18nPostprocess, ɵɵi18nStart, ɵɵinject, ɵɵinjectAttribute, ɵɵinvalidFactory, ɵɵinvalidFactoryDep, ɵɵlistener, ɵɵloadQuery, ɵɵnamespaceHTML, ɵɵnamespaceMathML, ɵɵnamespaceSVG, ɵɵnextContext, ɵɵngDeclareClassMetadata, ɵɵngDeclareComponent, ɵɵngDeclareDirective, ɵɵngDeclareFactory, ɵɵngDeclareInjectable, ɵɵngDeclareInjector, ɵɵngDeclareNgModule, ɵɵngDeclarePipe, ɵɵpipe, ɵɵpipeBind1, ɵɵpipeBind2, ɵɵpipeBind3, ɵɵpipeBind4, ɵɵpipeBindV, ɵɵprojection, ɵɵprojectionDef, ɵɵproperty, ɵɵpropertyInterpolate, ɵɵpropertyInterpolate1, ɵɵpropertyInterpolate2, ɵɵpropertyInterpolate3, ɵɵpropertyInterpolate4, ɵɵpropertyInterpolate5, ɵɵpropertyInterpolate6, ɵɵpropertyInterpolate7, ɵɵpropertyInterpolate8, ɵɵpropertyInterpolateV, ɵɵpureFunction0, ɵɵpureFunction1, ɵɵpureFunction2, ɵɵpureFunction3, ɵɵpureFunction4, ɵɵpureFunction5, ɵɵpureFunction6, ɵɵpureFunction7, ɵɵpureFunction8, ɵɵpureFunctionV, ɵɵqueryRefresh, ɵɵreference, registerNgModuleType as ɵɵregisterNgModuleType, ɵɵresetView, ɵɵresolveBody, ɵɵresolveDocument, ɵɵresolveWindow, ɵɵrestoreView, ɵɵsanitizeHtml, ɵɵsanitizeResourceUrl, ɵɵsanitizeScript, ɵɵsanitizeStyle, ɵɵsanitizeUrl, ɵɵsanitizeUrlOrResourceUrl, ɵɵsetComponentScope, ɵɵsetNgModuleScope, ɵɵstyleMap, ɵɵstyleMapInterpolate1, ɵɵstyleMapInterpolate2, ɵɵstyleMapInterpolate3, ɵɵstyleMapInterpolate4, ɵɵstyleMapInterpolate5, ɵɵstyleMapInterpolate6, ɵɵstyleMapInterpolate7, ɵɵstyleMapInterpolate8, ɵɵstyleMapInterpolateV, ɵɵstyleProp, ɵɵstylePropInterpolate1, ɵɵstylePropInterpolate2, ɵɵstylePropInterpolate3, ɵɵstylePropInterpolate4, ɵɵstylePropInterpolate5, ɵɵstylePropInterpolate6, ɵɵstylePropInterpolate7, ɵɵstylePropInterpolate8, ɵɵstylePropInterpolateV, ɵɵsyntheticHostListener, ɵɵsyntheticHostProperty, ɵɵtemplate, ɵɵtemplateRefExtractor, ɵɵtext, ɵɵtextInterpolate, ɵɵtextInterpolate1, ɵɵtextInterpolate2, ɵɵtextInterpolate3, ɵɵtextInterpolate4, ɵɵtextInterpolate5, ɵɵtextInterpolate6, ɵɵtextInterpolate7, ɵɵtextInterpolate8, ɵɵtextInterpolateV, ɵɵtrustConstantHtml, ɵɵtrustConstantResourceUrl, ɵɵviewQuery };
29861
30037
  //# sourceMappingURL=core.mjs.map