UNPKG

1.42 MBSource Map (JSON)View Raw
1{"version":3,"file":"core.js","sources":["../../../../../../packages/core/src/di/defs.ts","../../../../../../packages/core/src/di/injection_token.ts","../../../../../../packages/core/src/util/decorators.ts","../../../../../../packages/core/src/metadata/di.ts","../../../../../../packages/core/src/change_detection/constants.ts","../../../../../../packages/core/src/ivy_switch_legacy.ts","../../../../../../packages/core/src/metadata/directives.ts","../../../../../../packages/core/src/type.ts","../../../../../../packages/core/src/util.ts","../../../../../../packages/core/src/reflection/reflection_capabilities.ts","../../../../../../packages/core/src/util/property.ts","../../../../../../packages/core/src/di/forward_ref.ts","../../../../../../packages/core/src/di/metadata.ts","../../../../../../packages/core/src/di/injector.ts","../../../../../../packages/core/src/di/injectable.ts","../../../../../../packages/core/src/metadata/ng_module.ts","../../../../../../packages/core/src/metadata/view.ts","../../../../../../packages/core/src/metadata.ts","../../../../../../packages/core/src/version.ts","../../../../../../packages/core/src/errors.ts","../../../../../../packages/core/src/error_handler.ts","../../../../../../packages/core/src/di/reflective_errors.ts","../../../../../../packages/core/src/di/reflective_key.ts","../../../../../../packages/core/src/reflection/reflector.ts","../../../../../../packages/core/src/reflection/reflection.ts","../../../../../../packages/core/src/di/reflective_provider.ts","../../../../../../packages/core/src/di/reflective_injector.ts","../../../../../../packages/core/src/di/scope.ts","../../../../../../packages/core/src/di/r3_injector.ts","../../../../../../packages/core/src/di.ts","../../../../../../packages/core/src/util/lang.ts","../../../../../../packages/core/src/application_init.ts","../../../../../../packages/core/src/application_tokens.ts","../../../../../../packages/core/src/console.ts","../../../../../../packages/core/src/linker/compiler.ts","../../../../../../packages/core/src/linker/component_factory.ts","../../../../../../packages/core/src/linker/component_factory_resolver.ts","../../../../../../packages/core/src/linker/ng_module_factory.ts","../../../../../../packages/core/src/profile/wtf_impl.ts","../../../../../../packages/core/src/profile/profile.ts","../../../../../../packages/core/src/event_emitter.ts","../../../../../../packages/core/src/zone/ng_zone.ts","../../../../../../packages/core/src/testability/testability.ts","../../../../../../packages/core/src/application_ref.ts","../../../../../../packages/core/src/zone.ts","../../../../../../packages/core/src/render/api.ts","../../../../../../packages/core/src/render.ts","../../../../../../packages/core/src/linker/element_ref.ts","../../../../../../packages/core/src/linker/ng_module_factory_loader.ts","../../../../../../packages/core/src/linker/query_list.ts","../../../../../../packages/core/src/linker/system_js_ng_module_factory_loader.ts","../../../../../../packages/core/src/linker/template_ref.ts","../../../../../../packages/core/src/linker/view_container_ref.ts","../../../../../../packages/core/src/change_detection/change_detector_ref.ts","../../../../../../packages/core/src/linker/view_ref.ts","../../../../../../packages/core/src/linker.ts","../../../../../../packages/core/src/debug/debug_node.ts","../../../../../../packages/core/src/change_detection/change_detection_util.ts","../../../../../../packages/core/src/change_detection/differs/default_iterable_differ.ts","../../../../../../packages/core/src/change_detection/differs/default_keyvalue_differ.ts","../../../../../../packages/core/src/change_detection/differs/iterable_differs.ts","../../../../../../packages/core/src/change_detection/differs/keyvalue_differs.ts","../../../../../../packages/core/src/change_detection/change_detection.ts","../../../../../../packages/core/src/change_detection.ts","../../../../../../packages/core/src/platform_core_providers.ts","../../../../../../packages/core/src/i18n/tokens.ts","../../../../../../packages/core/src/application_module.ts","../../../../../../packages/core/src/metadata/resource_loading.ts","../../../../../../packages/core/src/sanitization/inert_body.ts","../../../../../../packages/core/src/sanitization/url_sanitizer.ts","../../../../../../packages/core/src/sanitization/html_sanitizer.ts","../../../../../../packages/core/src/sanitization/style_sanitizer.ts","../../../../../../packages/core/src/sanitization/security.ts","../../../../../../packages/core/src/view/types.ts","../../../../../../packages/core/src/view/errors.ts","../../../../../../packages/core/src/view/util.ts","../../../../../../packages/core/src/view/element.ts","../../../../../../packages/core/src/view/ng_module.ts","../../../../../../packages/core/src/view/view_attach.ts","../../../../../../packages/core/src/view/refs.ts","../../../../../../packages/core/src/view/provider.ts","../../../../../../packages/core/src/view/query.ts","../../../../../../packages/core/src/view/ng_content.ts","../../../../../../packages/core/src/view/pure_expression.ts","../../../../../../packages/core/src/view/text.ts","../../../../../../packages/core/src/view/view.ts","../../../../../../packages/core/src/view/services.ts","../../../../../../packages/core/src/view/entrypoint.ts","../../../../../../packages/core/src/view/index.ts","../../../../../../packages/core/src/core_private_export.ts","../../../../../../packages/core/src/render3/assert.ts","../../../../../../packages/core/src/render3/interfaces/view.ts","../../../../../../packages/core/src/render3/hooks.ts","../../../../../../packages/core/src/render3/ng_dev_mode.ts","../../../../../../packages/core/src/render3/errors.ts","../../../../../../packages/core/src/render3/interfaces/container.ts","../../../../../../packages/core/src/render3/interfaces/projection.ts","../../../../../../packages/core/src/render3/interfaces/renderer.ts","../../../../../../packages/core/src/render3/node_assert.ts","../../../../../../packages/core/src/render3/interfaces/node.ts","../../../../../../packages/core/src/render3/util.ts","../../../../../../packages/core/src/render3/node_manipulation.ts","../../../../../../packages/core/src/render3/node_selector_matcher.ts","../../../../../../packages/core/src/render3/styling.ts","../../../../../../packages/core/src/render3/instructions.ts","../../../../../../packages/core/src/render3/component.ts","../../../../../../packages/core/src/render3/definition.ts","../../../../../../packages/core/src/render3/features/inherit_definition_feature.ts","../../../../../../packages/core/src/render3/features/ng_onchanges_feature.ts","../../../../../../packages/core/src/render3/view_ref.ts","../../../../../../packages/core/src/render3/component_ref.ts","../../../../../../packages/core/src/render3/di.ts","../../../../../../packages/core/src/render3/features/public_feature.ts","../../../../../../packages/core/src/render3/i18n.ts","../../../../../../packages/core/src/render3/ng_module_ref.ts","../../../../../../packages/core/src/render3/pure_function.ts","../../../../../../packages/core/src/render3/pipe.ts","../../../../../../packages/core/src/render3/interfaces/definition.ts","../../../../../../packages/core/src/render3/interfaces/injector.ts","../../../../../../packages/core/src/render3/interfaces/query.ts","../../../../../../packages/core/src/render3/query.ts","../../../../../../packages/core/src/render3/index.ts","../../../../../../packages/core/src/sanitization/bypass.ts","../../../../../../packages/core/src/sanitization/sanitization.ts","../../../../../../packages/core/src/core_render3_private_export.ts","../../../../../../packages/core/src/codegen_private_exports.ts","../../../../../../packages/core/src/core.ts","../../../../../../packages/core/public_api.ts","../../../../../../packages/core/index.ts","../../../../../../packages/core/core.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Type} from '../type';\n\nimport {ClassProvider, ClassSansProvider, ConstructorProvider, ConstructorSansProvider, ExistingProvider, ExistingSansProvider, FactoryProvider, FactorySansProvider, StaticClassProvider, StaticClassSansProvider, ValueProvider, ValueSansProvider} from './provider';\n\n/**\n * Information about how a type or `InjectionToken` interfaces with the DI system.\n *\n * At a minimum, this includes a `factory` which defines how to create the given type `T`, possibly\n * requesting injection of other types if necessary.\n *\n * Optionally, a `providedIn` parameter specifies that the given type belongs to a particular\n * `InjectorDef`, `NgModule`, or a special scope (e.g. `'root'`). A value of `null` indicates\n * that the injectable does not belong to any scope.\n *\n * NOTE: This is a private type and should not be exported\n */\nexport interface InjectableDef<T> {\n /**\n * Specifies that the given type belongs to a particular injector:\n * - `InjectorType` such as `NgModule`,\n * - `'root'` the root injector\n * - `'any'` all injectors.\n * - `null`, does not belong to any injector. Must be explicitly listed in the injector\n * `providers`.\n */\n providedIn: InjectorType<any>|'root'|'any'|null;\n\n /**\n * Factory method to execute to create an instance of the injectable.\n */\n factory: () => T;\n\n /**\n * In a case of no explicit injector, a location where the instance of the injectable is stored.\n */\n value: T|undefined;\n}\n\n/**\n * Information about the providers to be included in an `Injector` as well as how the given type\n * which carries the information should be created by the DI system.\n *\n * An `InjectorDef` can import other types which have `InjectorDefs`, forming a deep nested\n * structure of providers with a defined priority (identically to how `NgModule`s also have\n * an import/dependency structure).\n *\n * NOTE: This is a private type and should not be exported\n */\nexport interface InjectorDef<T> {\n factory: () => T;\n\n // TODO(alxhub): Narrow down the type here once decorators properly change the return type of the\n // class they are decorating (to add the ngInjectableDef property for example).\n providers: (Type<any>|ValueProvider|ExistingProvider|FactoryProvider|ConstructorProvider|\n StaticClassProvider|ClassProvider|any[])[];\n\n imports: (InjectorType<any>|InjectorTypeWithProviders<any>)[];\n}\n\n/**\n * A `Type` which has an `InjectableDef` static field.\n *\n * `InjectableDefType`s contain their own Dependency Injection metadata and are usable in an\n * `InjectorDef`-based `StaticInjector.\n *\n * @experimental\n */\nexport interface InjectableType<T> extends Type<T> {\n /**\n * Opaque type whose structure is highly version dependent. Do not rely on any properties.\n */\n ngInjectableDef: never;\n}\n\n/**\n * A type which has an `InjectorDef` static field.\n *\n * `InjectorDefTypes` can be used to configure a `StaticInjector`.\n *\n * @experimental\n */\nexport interface InjectorType<T> extends Type<T> {\n /**\n * Opaque type whose structure is highly version dependent. Do not rely on any properties.\n */\n ngInjectorDef: never;\n}\n\n/**\n * Describes the `InjectorDef` equivalent of a `ModuleWithProviders`, an `InjectorDefType` with an\n * associated array of providers.\n *\n * Objects of this type can be listed in the imports section of an `InjectorDef`.\n *\n * NOTE: This is a private type and should not be exported\n */\nexport interface InjectorTypeWithProviders<T> {\n ngModule: InjectorType<T>;\n providers?: (Type<any>|ValueProvider|ExistingProvider|FactoryProvider|ConstructorProvider|\n StaticClassProvider|ClassProvider|any[])[];\n}\n\n\n/**\n * Construct an `InjectableDef` which defines how a token will be constructed by the DI system, and\n * in which injectors (if any) it will be available.\n *\n * This should be assigned to a static `ngInjectableDef` field on a type, which will then be an\n * `InjectableType`.\n *\n * Options:\n * * `providedIn` determines which injectors will include the injectable, by either associating it\n * with an `@NgModule` or other `InjectorType`, or by specifying that this injectable should be\n * provided in the `'root'` injector, which will be the application-level injector in most apps.\n * * `factory` gives the zero argument function which will create an instance of the injectable.\n * The factory can call `inject` to access the `Injector` and request injection of dependencies.\n *\n * @experimental\n */\nexport function defineInjectable<T>(opts: {\n providedIn?: Type<any>| 'root' | 'any' | null,\n factory: () => T,\n}): never {\n return ({\n providedIn: opts.providedIn as any || null, factory: opts.factory, value: undefined,\n } as InjectableDef<T>) as never;\n}\n\n/**\n * Construct an `InjectorDef` which configures an injector.\n *\n * This should be assigned to a static `ngInjectorDef` field on a type, which will then be an\n * `InjectorType`.\n *\n * Options:\n *\n * * `factory`: an `InjectorType` is an instantiable type, so a zero argument `factory` function to\n * create the type must be provided. If that factory function needs to inject arguments, it can\n * use the `inject` function.\n * * `providers`: an optional array of providers to add to the injector. Each provider must\n * either have a factory or point to a type which has an `ngInjectableDef` static property (the\n * type must be an `InjectableType`).\n * * `imports`: an optional array of imports of other `InjectorType`s or `InjectorTypeWithModule`s\n * whose providers will also be added to the injector. Locally provided types will override\n * providers from imports.\n *\n * @experimental\n */\nexport function defineInjector(options: {factory: () => any, providers?: any[], imports?: any[]}):\n never {\n return ({\n factory: options.factory, providers: options.providers || [], imports: options.imports || [],\n } as InjectorDef<any>) as never;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Type} from '../type';\n\nimport {InjectableDef, defineInjectable} from './defs';\n\n/**\n * Creates a token that can be used in a DI Provider.\n *\n * Use an `InjectionToken` whenever the type you are injecting is not reified (does not have a\n * runtime representation) such as when injecting an interface, callable type, array or\n * parametrized type.\n *\n * `InjectionToken` is parameterized on `T` which is the type of object which will be returned by\n * the `Injector`. This provides additional level of type safety.\n *\n * ```\n * interface MyInterface {...}\n * var myInterface = injector.get(new InjectionToken<MyInterface>('SomeToken'));\n * // myInterface is inferred to be MyInterface.\n * ```\n *\n * When creating an `InjectionToken`, you can optionally specify a factory function which returns\n * (possibly by creating) a default value of the parameterized type `T`. This sets up the\n * `InjectionToken` using this factory as a provider as if it was defined explicitly in the\n * application's root injector. If the factory function, which takes zero arguments, needs to inject\n * dependencies, it can do so using the `inject` function. See below for an example.\n *\n * Additionally, if a `factory` is specified you can also specify the `providedIn` option, which\n * overrides the above behavior and marks the token as belonging to a particular `@NgModule`. As\n * mentioned above, `'root'` is the default value for `providedIn`.\n *\n * @usageNotes\n * ### Basic Example\n *\n * ### Plain InjectionToken\n *\n * {@example core/di/ts/injector_spec.ts region='InjectionToken'}\n *\n * ### Tree-shakable InjectionToken\n *\n * {@example core/di/ts/injector_spec.ts region='ShakableInjectionToken'}\n *\n */\nexport class InjectionToken<T> {\n /** @internal */\n readonly ngMetadataName = 'InjectionToken';\n\n readonly ngInjectableDef: never|undefined;\n\n constructor(protected _desc: string, options?: {\n providedIn?: Type<any>| 'root' | null,\n factory: () => T\n }) {\n if (options !== undefined) {\n this.ngInjectableDef = defineInjectable({\n providedIn: options.providedIn || 'root',\n factory: options.factory,\n });\n } else {\n this.ngInjectableDef = undefined;\n }\n }\n\n toString(): string { return `InjectionToken ${this._desc}`; }\n}\n\nexport interface InjectableDefToken<T> extends InjectionToken<T> { ngInjectableDef: never; }\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Type} from '../type';\n\n/**\n * An interface implemented by all Angular type decorators, which allows them to be used as ES7\n * decorators as well as\n * Angular DSL syntax.\n *\n * ES7 syntax:\n *\n * ```\n * @ng.Component({...})\n * class MyClass {...}\n * ```\n *\n */\nexport interface TypeDecorator {\n /**\n * Invoke as ES7 decorator.\n */\n <T extends Type<any>>(type: T): T;\n\n // Make TypeDecorator assignable to built-in ParameterDecorator type.\n // ParameterDecorator is declared in lib.d.ts as a `declare type`\n // so we cannot declare this interface as a subtype.\n // see https://github.com/angular/angular/issues/3379#issuecomment-126169417\n (target: Object, propertyKey?: string|symbol, parameterIndex?: number): void;\n}\n\nexport const ANNOTATIONS = '__annotations__';\nexport const PARAMETERS = '__parameters__';\nexport const PROP_METADATA = '__prop__metadata__';\n\n/**\n * @suppress {globalThis}\n */\nexport function makeDecorator(\n name: string, props?: (...args: any[]) => any, parentClass?: any,\n chainFn?: (fn: Function) => void, typeFn?: (type: Type<any>, ...args: any[]) => void):\n {new (...args: any[]): any; (...args: any[]): any; (...args: any[]): (cls: any) => any;} {\n const metaCtor = makeMetadataCtor(props);\n\n function DecoratorFactory(...args: any[]): (cls: any) => any {\n if (this instanceof DecoratorFactory) {\n metaCtor.call(this, ...args);\n return this;\n }\n\n const annotationInstance = new (<any>DecoratorFactory)(...args);\n const TypeDecorator: TypeDecorator = <TypeDecorator>function TypeDecorator(cls: Type<any>) {\n typeFn && typeFn(cls, ...args);\n // Use of Object.defineProperty is important since it creates non-enumerable property which\n // prevents the property is copied during subclassing.\n const annotations = cls.hasOwnProperty(ANNOTATIONS) ?\n (cls as any)[ANNOTATIONS] :\n Object.defineProperty(cls, ANNOTATIONS, {value: []})[ANNOTATIONS];\n annotations.push(annotationInstance);\n return cls;\n };\n if (chainFn) chainFn(TypeDecorator);\n return TypeDecorator;\n }\n\n if (parentClass) {\n DecoratorFactory.prototype = Object.create(parentClass.prototype);\n }\n\n DecoratorFactory.prototype.ngMetadataName = name;\n (<any>DecoratorFactory).annotationCls = DecoratorFactory;\n return DecoratorFactory as any;\n}\n\nfunction makeMetadataCtor(props?: (...args: any[]) => any): any {\n return function ctor(...args: any[]) {\n if (props) {\n const values = props(...args);\n for (const propName in values) {\n this[propName] = values[propName];\n }\n }\n };\n}\n\nexport function makeParamDecorator(\n name: string, props?: (...args: any[]) => any, parentClass?: any): any {\n const metaCtor = makeMetadataCtor(props);\n function ParamDecoratorFactory(...args: any[]): any {\n if (this instanceof ParamDecoratorFactory) {\n metaCtor.apply(this, args);\n return this;\n }\n const annotationInstance = new (<any>ParamDecoratorFactory)(...args);\n\n (<any>ParamDecorator).annotation = annotationInstance;\n return ParamDecorator;\n\n function ParamDecorator(cls: any, unusedKey: any, index: number): any {\n // Use of Object.defineProperty is important since it creates non-enumerable property which\n // prevents the property is copied during subclassing.\n const parameters = cls.hasOwnProperty(PARAMETERS) ?\n (cls as any)[PARAMETERS] :\n Object.defineProperty(cls, PARAMETERS, {value: []})[PARAMETERS];\n\n // there might be gaps if some in between parameters do not have annotations.\n // we pad with nulls.\n while (parameters.length <= index) {\n parameters.push(null);\n }\n\n (parameters[index] = parameters[index] || []).push(annotationInstance);\n return cls;\n }\n }\n if (parentClass) {\n ParamDecoratorFactory.prototype = Object.create(parentClass.prototype);\n }\n ParamDecoratorFactory.prototype.ngMetadataName = name;\n (<any>ParamDecoratorFactory).annotationCls = ParamDecoratorFactory;\n return ParamDecoratorFactory;\n}\n\nexport function makePropDecorator(\n name: string, props?: (...args: any[]) => any, parentClass?: any): any {\n const metaCtor = makeMetadataCtor(props);\n\n function PropDecoratorFactory(...args: any[]): any {\n if (this instanceof PropDecoratorFactory) {\n metaCtor.apply(this, args);\n return this;\n }\n\n const decoratorInstance = new (<any>PropDecoratorFactory)(...args);\n\n return function PropDecorator(target: any, name: string) {\n const constructor = target.constructor;\n // Use of Object.defineProperty is important since it creates non-enumerable property which\n // prevents the property is copied during subclassing.\n const meta = constructor.hasOwnProperty(PROP_METADATA) ?\n (constructor as any)[PROP_METADATA] :\n Object.defineProperty(constructor, PROP_METADATA, {value: {}})[PROP_METADATA];\n meta[name] = meta.hasOwnProperty(name) && meta[name] || [];\n meta[name].unshift(decoratorInstance);\n };\n }\n\n if (parentClass) {\n PropDecoratorFactory.prototype = Object.create(parentClass.prototype);\n }\n\n PropDecoratorFactory.prototype.ngMetadataName = name;\n (<any>PropDecoratorFactory).annotationCls = PropDecoratorFactory;\n return PropDecoratorFactory;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {InjectionToken} from '../di/injection_token';\nimport {Type} from '../type';\nimport {makeParamDecorator, makePropDecorator} from '../util/decorators';\n\n/**\n * This token can be used to create a virtual provider that will populate the\n * `entryComponents` fields of components and ng modules based on its `useValue`.\n * All components that are referenced in the `useValue` value (either directly\n * or in a nested array or map) will be added to the `entryComponents` property.\n *\n * @usageNotes\n * ### Example\n * The following example shows how the router can populate the `entryComponents`\n * field of an NgModule based on the router configuration which refers\n * to components.\n *\n * ```typescript\n * // helper function inside the router\n * function provideRoutes(routes) {\n * return [\n * {provide: ROUTES, useValue: routes},\n * {provide: ANALYZE_FOR_ENTRY_COMPONENTS, useValue: routes, multi: true}\n * ];\n * }\n *\n * // user code\n * let routes = [\n * {path: '/root', component: RootComp},\n * {path: '/teams', component: TeamsComp}\n * ];\n *\n * @NgModule({\n * providers: [provideRoutes(routes)]\n * })\n * class ModuleWithRoutes {}\n * ```\n *\n * @experimental\n */\nexport const ANALYZE_FOR_ENTRY_COMPONENTS = new InjectionToken<any>('AnalyzeForEntryComponents');\n\n/**\n * Type of the Attribute decorator / constructor function.\n *\n *\n */\nexport interface AttributeDecorator {\n /**\n * Specifies that a constant attribute value should be injected.\n *\n * The directive can inject constant string literals of host element attributes.\n *\n * @usageNotes\n * ### Example\n *\n * Suppose we have an `<input>` element and want to know its `type`.\n *\n * ```html\n * <input type=\"text\">\n * ```\n *\n * A decorator can inject string literal `text` like so:\n *\n * {@example core/ts/metadata/metadata.ts region='attributeMetadata'}\n *\n * ### Example as TypeScript Decorator\n *\n * {@example core/ts/metadata/metadata.ts region='attributeFactory'}\n *\n * ### Example as ES5 annotation\n *\n * ```\n * var MyComponent = function(title) {\n * ...\n * };\n *\n * MyComponent.annotations = [\n * new ng.Component({...})\n * ]\n * MyComponent.parameters = [\n * [new ng.Attribute('title')]\n * ]\n * ```\n *\n *\n */\n (name: string): any;\n new (name: string): Attribute;\n}\n\n\n/**\n * Type of the Attribute metadata.\n */\nexport interface Attribute { attributeName?: string; }\n\n/**\n * Attribute decorator and metadata.\n *\n * @Annotation\n */\nexport const Attribute: AttributeDecorator =\n makeParamDecorator('Attribute', (attributeName?: string) => ({attributeName}));\n\n/**\n * Type of the Query metadata.\n */\nexport interface Query {\n descendants: boolean;\n first: boolean;\n read: any;\n isViewQuery: boolean;\n selector: any;\n}\n\n/**\n * Base class for query metadata.\n *\n * @see `ContentChildren`.\n * @see `ContentChild`.\n * @see `ViewChildren`.\n * @see `ViewChild`.\n */\nexport abstract class Query {}\n\n/**\n * Type of the ContentChildren decorator / constructor function.\n *\n * @see `ContentChildren`.\n */\nexport interface ContentChildrenDecorator {\n /**\n * Configures a content query.\n *\n * You can use ContentChildren to get the `QueryList` of elements or directives from the\n * content DOM. Any time a child element is added, removed, or moved, the query list will be\n * updated, and the changes observable of the query list will emit a new value.\n *\n * Content queries are set before the `ngAfterContentInit` callback is called.\n *\n * **Metadata Properties**:\n *\n * * **selector** - the directive type or the name used for querying.\n * * **descendants** - include only direct children or all descendants.\n * * **read** - read a different token from the queried elements.\n *\n * @usageNotes\n * ### Basic Example\n *\n * Here is a simple demonstration of how the `ContentChildren` decorator can be used.\n *\n * {@example core/di/ts/contentChildren/content_children_howto.ts region='HowTo'}\n *\n * ### Tab-pane Example\n *\n * Here is a slightly more realistic example that shows how `ContentChildren` decorators\n * can be used to implement a tab pane component.\n *\n * {@example core/di/ts/contentChildren/content_children_example.ts region='Component'}\n *\n * @Annotation\n */\n (selector: Type<any>|Function|string, opts?: {descendants?: boolean, read?: any}): any;\n new (selector: Type<any>|Function|string, opts?: {descendants?: boolean, read?: any}): Query;\n}\n\n/**\n * Type of the ContentChildren metadata.\n *\n *\n * @Annotation\n */\nexport type ContentChildren = Query;\n\n/**\n * ContentChildren decorator and metadata.\n *\n *\n * @Annotation\n */\nexport const ContentChildren: ContentChildrenDecorator = makePropDecorator(\n 'ContentChildren',\n (selector?: any, data: any = {}) =>\n ({selector, first: false, isViewQuery: false, descendants: false, ...data}),\n Query);\n\n/**\n * Type of the ContentChild decorator / constructor function.\n *\n *\n *\n */\nexport interface ContentChildDecorator {\n /**\n * Configures a content query.\n *\n * You can use ContentChild to get the first element or the directive matching the selector from\n * the content DOM. If the content DOM changes, and a new child matches the selector,\n * the property will be updated.\n *\n * Content queries are set before the `ngAfterContentInit` callback is called.\n *\n * **Metadata Properties**:\n *\n * * **selector** - the directive type or the name used for querying.\n * * **read** - read a different token from the queried element.\n *\n * @usageNotes\n * ### Example\n *\n * {@example core/di/ts/contentChild/content_child_howto.ts region='HowTo'}\n *\n * ### Example\n *\n * {@example core/di/ts/contentChild/content_child_example.ts region='Component'}\n *\n * @Annotation\n */\n (selector: Type<any>|Function|string, opts?: {read?: any}): any;\n new (selector: Type<any>|Function|string, opts?: {read?: any}): ContentChild;\n}\n\n/**\n * Type of the ContentChild metadata.\n *\n * @see `ContentChild`.\n *\n *\n */\nexport type ContentChild = Query;\n\n/**\n * ContentChild decorator and metadata.\n *\n *\n * @Annotation\n */\nexport const ContentChild: ContentChildDecorator = makePropDecorator(\n 'ContentChild', (selector?: any, data: any = {}) =>\n ({selector, first: true, isViewQuery: false, descendants: true, ...data}),\n Query);\n\n/**\n * Type of the ViewChildren decorator / constructor function.\n *\n * @see `ViewChildren`.\n *\n *\n */\nexport interface ViewChildrenDecorator {\n /**\n * Configures a view query.\n *\n * You can use ViewChildren to get the `QueryList` of elements or directives from the\n * view DOM. Any time a child element is added, removed, or moved, the query list will be updated,\n * and the changes observable of the query list will emit a new value.\n *\n * View queries are set before the `ngAfterViewInit` callback is called.\n *\n * **Metadata Properties**:\n *\n * * **selector** - the directive type or the name used for querying.\n * * **read** - read a different token from the queried elements.\n *\n * @usageNotes\n *\n * ### Example\n *\n * {@example core/di/ts/viewChildren/view_children_howto.ts region='HowTo'}\n *\n * ### Example\n *\n * {@example core/di/ts/viewChildren/view_children_example.ts region='Component'}\n *\n * @Annotation\n */\n (selector: Type<any>|Function|string, opts?: {read?: any}): any;\n new (selector: Type<any>|Function|string, opts?: {read?: any}): ViewChildren;\n}\n\n/**\n * Type of the ViewChildren metadata.\n */\nexport type ViewChildren = Query;\n\n/**\n * ViewChildren decorator and metadata.\n *\n * @Annotation\n */\nexport const ViewChildren: ViewChildrenDecorator = makePropDecorator(\n 'ViewChildren', (selector?: any, data: any = {}) =>\n ({selector, first: false, isViewQuery: true, descendants: true, ...data}),\n Query);\n\n/**\n * Type of the ViewChild decorator / constructor function.\n *\n * @see `ViewChild`.\n */\nexport interface ViewChildDecorator {\n /**\n * @description\n * Property decorator that configures a view query.\n * The change detector looks for the first element or the directive matching the selector\n * in the view DOM. If the view DOM changes, and a new child matches the selector,\n * the property is updated.\n *\n * View queries are set before the `ngAfterViewInit` callback is called.\n *\n * **Metadata Properties**:\n *\n * * **selector** - the directive type or the name used for querying.\n * * **read** - read a different token from the queried elements.\n *\n * Supported selectors include:\n * * any class with the `@Component` or `@Directive` decorator\n * * a template reference variable as a string (e.g. query `<my-component #cmp></my-component>\n * with `@ViewChild('cmp')`)\n * * any provider defined in the child component tree of the current component (e.g.\n * `@ViewChild(SomeService) someService: SomeService`)\n * * any provider defined through a string token (e.g. `@ViewChild('someToken') someTokenVal:\n * any`)\n * * a `TemplateRef` (e.g. query `<ng-template></ng-template>` with `@ViewChild(TemplateRef)\n * template;`)\n *\n * @usageNotes\n *\n * {@example core/di/ts/viewChild/view_child_example.ts region='Component'}\n *\n * ### Example\n *\n * {@example core/di/ts/viewChild/view_child_howto.ts region='HowTo'}\n *\n * ### Example\n *\n * {@example core/di/ts/viewChild/view_child_example.ts region='Component'}\n *\n * @Annotation\n */\n (selector: Type<any>|Function|string, opts?: {read?: any}): any;\n new (selector: Type<any>|Function|string, opts?: {read?: any}): ViewChild;\n}\n\n/**\n * Type of the ViewChild metadata.\n */\nexport type ViewChild = Query;\n\n/**\n * ViewChild decorator and metadata.\n *\n * @Annotation\n */\nexport const ViewChild: ViewChildDecorator = makePropDecorator(\n 'ViewChild', (selector: any, data: any) =>\n ({selector, first: true, isViewQuery: true, descendants: true, ...data}),\n Query);\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n\n/**\n * The strategy that the default change detector uses to detect changes.\n * When set, takes effect the next time change detection is triggered.\n *\n */\nexport enum ChangeDetectionStrategy {\n /**\n * Use the `CheckOnce` strategy, meaning that automatic change detection is deactivated\n * until reactivated by setting the strategy to `Default` (`CheckAlways`).\n * Change detection can still be explictly invoked.\n */\n OnPush = 0,\n\n /**\n * Use the default `CheckAlways` strategy, in which change detection is automatic until\n * explicitly deactivated.\n */\n Default = 1,\n}\n\n/**\n * Defines the possible states of the default change detector.\n * @see `ChangeDetectorRef`\n */\nexport enum ChangeDetectorStatus {\n /**\n * A state in which, after calling `detectChanges()`, the change detector\n * state becomes `Checked`, and must be explicitly invoked or reactivated.\n */\n CheckOnce,\n\n /**\n * A state in which change detection is skipped until the change detector mode\n * becomes `CheckOnce`.\n */\n Checked,\n\n /**\n * A state in which change detection continues automatically until explictly\n * deactivated.\n */\n CheckAlways,\n\n /**\n * A state in which a change detector sub tree is not a part of the main tree and\n * should be skipped.\n */\n Detached,\n\n /**\n * Indicates that the change detector encountered an error checking a binding\n * or calling a directive lifecycle method and is now in an inconsistent state. Change\n * detectors in this state do not detect changes.\n */\n Errored,\n\n /**\n * Indicates that the change detector has been destroyed.\n */\n Destroyed,\n}\n\n/**\n * Reports whether a given strategy is currently the default for change detection.\n * @param changeDetectionStrategy The strategy to check.\n * @returns True if the given strategy is the current default, false otherwise.\n * @see `ChangeDetectorStatus`\n * @see `ChangeDetectorRef` \n */\nexport function isDefaultChangeDetectionStrategy(changeDetectionStrategy: ChangeDetectionStrategy):\n boolean {\n return changeDetectionStrategy == null ||\n changeDetectionStrategy === ChangeDetectionStrategy.Default;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport const ivyEnabled = false;\nexport const R3_COMPILE_COMPONENT: ((type: any, meta: any) => void)|null = null;\nexport const R3_COMPILE_DIRECTIVE: ((type: any, meta: any) => void)|null = null;\nexport const R3_COMPILE_INJECTABLE: ((type: any, meta: any) => void)|null = null;\nexport const R3_COMPILE_NGMODULE: ((type: any, meta: any) => void)|null = null;\nexport const R3_COMPILE_PIPE: ((type: any, meta: any) => void)|null = null;\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ChangeDetectionStrategy} from '../change_detection/constants';\nimport {Provider} from '../di';\nimport {R3_COMPILE_COMPONENT, R3_COMPILE_DIRECTIVE, R3_COMPILE_PIPE} from '../ivy_switch';\nimport {Type} from '../type';\nimport {TypeDecorator, makeDecorator, makePropDecorator} from '../util/decorators';\nimport {ViewEncapsulation} from './view';\n\n\n/**\n * Type of the Directive decorator / constructor function.\n */\nexport interface DirectiveDecorator {\n /**\n * Marks a class as an Angular directive. You can define your own\n * directives to attach custom behavior to elements in the DOM.\n * The options provide configuration metadata that determines\n * how the directive should be processed, instantiated and used at\n * runtime.\n *\n * Directive classes, like component classes, can implement\n * [life-cycle hooks](guide/lifecycle-hooks) to influence their configuration and behavior.\n *\n *\n * @usageNotes\n * To define a directive, mark the class with the decorator and provide metadata.\n *\n * ```\n * import {Directive} from '@angular/core';\n *\n * @Directive({\n * selector: 'my-directive',\n * })\n * export class MyDirective {\n * ...\n * }\n * ```\n *\n * ### Declaring directives\n *\n * Directives are [declarables](guide/glossary#declarable).\n * They must be declared by an NgModule\n * in order to be usable in an app.\n *\n * A directive must belong to exactly one NgModule. Do not re-declare\n * a directive imported from another module.\n * List the directive class in the `declarations` field of an NgModule.\n *\n * ```\n * declarations: [\n * AppComponent,\n * MyDirective\n * ],\n * ```\n *\n * @Annotation\n */\n (obj: Directive): TypeDecorator;\n\n /**\n * See the `Directive` decorator.\n */\n new (obj: Directive): Directive;\n}\n\nexport interface Directive {\n /**\n * The CSS selector that triggers the instantiation of a directive.\n *\n * Declare as one of the following:\n *\n * - `element-name`: select by element name.\n * - `.class`: select by class name.\n * - `[attribute]`: select by attribute name.\n * - `[attribute=value]`: select by attribute name and value.\n * - `:not(sub_selector)`: select only if the element does not match the `sub_selector`.\n * - `selector1, selector2`: select if either `selector1` or `selector2` matches.\n *\n * Angular only allows directives to trigger on CSS selectors that do not cross element\n * boundaries. For example, consider a directive with an `input[type=text]` selector.\n * For the following HTML, the directive is instantiated only on the\n * `<input type=\"text\">` element.\n *\n * ```html\n * <form>\n * <input type=\"text\">\n * <input type=\"radio\">\n * <form>\n * ```\n *\n */\n selector?: string;\n\n /**\n * Enumerates the set of data-bound input properties for a directive\n *\n * Angular automatically updates input properties during change detection.\n * The `inputs` property defines a set of `directiveProperty` to `bindingProperty`\n * configuration:\n *\n * - `directiveProperty` specifies the component property where the value is written.\n * - `bindingProperty` specifies the DOM property where the value is read from.\n *\n * When `bindingProperty` is not provided, it is assumed to be equal to `directiveProperty`.\n * @usageNotes\n *\n * ### Example\n *\n * The following example creates a component with two data-bound properties.\n *\n * ```typescript\n * @Component({\n * selector: 'bank-account',\n * inputs: ['bankName', 'id: account-id'],\n * template: `\n * Bank Name: {{bankName}}\n * Account Id: {{id}}\n * `\n * })\n * class BankAccount {\n * bankName: string;\n * id: string;\n *\n * ```\n */\n inputs?: string[];\n\n /**\n * Enumerates the set of event-bound output properties.\n *\n * When an output property emits an event, an event handler attached to that event\n * in the template is invoked.\n *\n * The `outputs` property defines a set of `directiveProperty` to `bindingProperty`\n * configuration:\n *\n * - `directiveProperty` specifies the component property that emits events.\n * - `bindingProperty` specifies the DOM property the event handler is attached to.\n *\n * @usageNotes\n *\n * ### Example\n *\n * ```typescript\n * @Directive({\n * selector: 'child-dir',\n * exportAs: 'child'\n * })\n * class ChildDir {\n * }\n *\n * @Component({\n * selector: 'main',\n * template: `<child-dir #c=\"child\"></child-dir>`\n * })\n * class MainComponent {\n * }\n * ```\n */\n outputs?: string[];\n\n /**\n * A set of injection tokens that allow the DI system to\n * provide a dependency to this directive or component.\n */\n providers?: Provider[];\n\n /**\n * Defines the name that can be used in the template to assign this directive to a variable.\n *\n * @usageNotes\n *\n * ### Simple Example\n *\n * ```\n * @Directive({\n * selector: 'child-dir',\n * exportAs: 'child'\n * })\n * class ChildDir {\n * }\n *\n * @Component({\n * selector: 'main',\n * template: `<child-dir #c=\"child\"></child-dir>`\n * })\n * class MainComponent {\n * }\n * ```\n */\n exportAs?: string;\n\n /**\n * Configures the queries that will be injected into the directive.\n *\n * Content queries are set before the `ngAfterContentInit` callback is called.\n * View queries are set before the `ngAfterViewInit` callback is called.\n *\n * @usageNotes\n *\n * ### Example\n *\n * The following example shows how queries are defined\n * and when their results are available in lifecycle hooks:\n *\n * ```\n * @Component({\n * selector: 'someDir',\n * queries: {\n * contentChildren: new ContentChildren(ChildDirective),\n * viewChildren: new ViewChildren(ChildDirective)\n * },\n * template: '<child-directive></child-directive>'\n * })\n * class SomeDir {\n * contentChildren: QueryList<ChildDirective>,\n * viewChildren: QueryList<ChildDirective>\n *\n * ngAfterContentInit() {\n * // contentChildren is set\n * }\n *\n * ngAfterViewInit() {\n * // viewChildren is set\n * }\n * }\n * ```\n *\n * @Annotation\n */\n queries?: {[key: string]: any};\n\n /**\n * If true, this directive/component will be skipped by the AOT compiler and so will always be\n * compiled using JIT.\n *\n * This exists to support future Ivy work and has no effect currently.\n */\n jit?: true;\n}\n\n/**\n * Directive decorator and metadata.\n *\n * @Annotation\n */\nexport interface Directive {\n /**\n * The CSS selector that identifies this directive in a template\n * and triggers instantiation of the directive.\n *\n * Declare as one of the following:\n *\n * - `element-name`: Select by element name.\n * - `.class`: Select by class name.\n * - `[attribute]`: Select by attribute name.\n * - `[attribute=value]`: Select by attribute name and value.\n * - `:not(sub_selector)`: Select only if the element does not match the `sub_selector`.\n * - `selector1, selector2`: Select if either `selector1` or `selector2` matches.\n *\n * Angular only allows directives to apply on CSS selectors that do not cross\n * element boundaries.\n *\n * For the following template HTML, a directive with an `input[type=text]` selector,\n * would be instantiated only on the `<input type=\"text\">` element.\n *\n * ```html\n * <form>\n * <input type=\"text\">\n * <input type=\"radio\">\n * <form>\n * ```\n *\n */\n selector?: string;\n\n /**\n * The set of event-bound output properties.\n * When an output property emits an event, an event handler attached\n * to that event in the template is invoked.\n *\n * Each output property maps a `directiveProperty` to a `bindingProperty`:\n * - `directiveProperty` specifies the component property that emits events.\n * - `bindingProperty` specifies the HTML attribute the event handler is attached to.\n *\n */\n outputs?: string[];\n\n /**\n * Maps class properties to host element bindings for properties,\n * attributes, and events, using a set of key-value pairs.\n *\n * Angular automatically checks host property bindings during change detection.\n * If a binding changes, Angular updates the directive's host element.\n *\n * When the key is a property of the host element, the property value is\n * the propagated to the specified DOM property.\n *\n * When the key is a static attribute in the DOM, the attribute value\n * is propagated to the specified property in the host element.\n *\n * For event handling:\n * - The key is the DOM event that the directive listens to.\n * To listen to global events, add the target to the event name.\n * The target can be `window`, `document` or `body`.\n * - The value is the statement to execute when the event occurs. If the\n * statement evalueates to `false`, then `preventDefault` is applied on the DOM\n * event. A handler method can refer to the `$event` local variable.\n *\n */\n host?: {[key: string]: string};\n\n /**\n * Configures the [injector](guide/glossary#injector) of this\n * directive or component with a [token](guide/glossary#di-token)\n * that maps to a [provider](guide/glossary#provider) of a dependency.\n */\n providers?: Provider[];\n\n /**\n * The name or names that can be used in the template to assign this directive to a variable.\n * For multiple names, use a comma-separated string.\n *\n */\n exportAs?: string;\n\n /**\n * Configures the queries that will be injected into the directive.\n *\n * Content queries are set before the `ngAfterContentInit` callback is called.\n * View queries are set before the `ngAfterViewInit` callback is called.\n *\n */\n queries?: {[key: string]: any};\n}\n\n/**\n * Type of the Directive metadata.\n */\nexport const Directive: DirectiveDecorator = makeDecorator(\n 'Directive', (dir: Directive = {}) => dir, undefined, undefined,\n (type: Type<any>, meta: Directive) => (R3_COMPILE_DIRECTIVE || (() => {}))(type, meta));\n\n/**\n * Component decorator interface\n *\n */\nexport interface ComponentDecorator {\n /**\n * Decorator that marks a class as an Angular component and provides configuration\n * metadata that determines how the component should be processed,\n * instantiated, and used at runtime.\n *\n * Components are the most basic UI building block of an Angular app.\n * An Angular app contains a tree of Angular components.\n *\n * Angular components are a subset of directives, always associated with a template.\n * Unlike other directives, only one component can be instantiated per an element in a template.\n *\n * A component must belong to an NgModule in order for it to be available\n * to another component or application. To make it a member of an NgModule,\n * list it in the `declarations` field of the `@NgModule` metadata.\n *\n * Note that, in addition to these options for configuring a directive,\n * you can control a component's runtime behavior by implementing\n * life-cycle hooks. For more information, see the\n * [Lifecycle Hooks](guide/lifecycle-hooks) guide.\n *\n * @usageNotes\n *\n * ### Setting component inputs\n *\n * The following example creates a component with two data-bound properties,\n * specified by the `inputs` value.\n *\n * <code-example path=\"core/ts/metadata/directives.ts\" region=\"component-input\">\n * </code-example>\n *\n *\n * ### Setting component outputs\n *\n * The following example shows two event emitters that emit on an interval. One\n * emits an output every second, while the other emits every five seconds.\n *\n * {@example core/ts/metadata/directives.ts region='component-output-interval'}\n *\n * ### Injecting a class with a view provider\n *\n * The following simple example injects a class into a component\n * using the view provider specified in component metadata:\n *\n * ```\n * class Greeter {\n * greet(name:string) {\n * return 'Hello ' + name + '!';\n * }\n * }\n *\n * @Directive({\n * selector: 'needs-greeter'\n * })\n * class NeedsGreeter {\n * greeter:Greeter;\n *\n * constructor(greeter:Greeter) {\n * this.greeter = greeter;\n * }\n * }\n *\n * @Component({\n * selector: 'greet',\n * viewProviders: [\n * Greeter\n * ],\n * template: `<needs-greeter></needs-greeter>`\n * })\n * class HelloWorld {\n * }\n *\n * ```\n *\n *\n * @Annotation\n */\n (obj: Component): TypeDecorator;\n /**\n * See the `@Component` decorator.\n */\n new (obj: Component): Component;\n}\n\n/**\n * Supplies configuration metadata for an Angular component.\n */\nexport interface Component extends Directive {\n /**\n * The change-detection strategy to use for this component.\n *\n * When a component is instantiated, Angular creates a change detector,\n * which is responsible for propagating the component's bindings.\n * The strategy is one of:\n * - `ChangeDetectionStrategy#OnPush` sets the strategy to `CheckOnce` (on demand).\n * - `ChangeDetectionStrategy#Default` sets the strategy to `CheckAlways`.\n */\n changeDetection?: ChangeDetectionStrategy;\n\n /**\n * Defines the set of injectable objects that are visible to its view DOM children.\n * See [example](#injecting-a-class-with-a-view-provider).\n *\n */\n viewProviders?: Provider[];\n\n /**\n * The module ID of the module that contains the component.\n * The component must be able to resolve relative URLs for templates and styles.\n * SystemJS exposes the `__moduleName` variable within each module.\n * In CommonJS, this can be set to `module.id`.\n *\n */\n moduleId?: string;\n\n /**\n * The URL of a template file for an Angular component. If provided,\n * do not supply an inline template using `template`.\n *\n */\n templateUrl?: string;\n\n /**\n * An inline template for an Angular component. If provided,\n * do not supply a template file using `templateUrl`.\n *\n */\n template?: string;\n\n /**\n * One or more URLs for files containing CSS stylesheets to use\n * in this component.\n */\n styleUrls?: string[];\n\n /**\n * One or more inline CSS stylesheets to use\n * in this component.\n */\n styles?: string[];\n\n /**\n * One or more animation `trigger()` calls, containing\n * `state()` and `transition()` definitions.\n * See the [Animations guide](/guide/animations) and animations API documentation.\n *\n */\n animations?: any[];\n\n /**\n * An encapsulation policy for the template and CSS styles. One of:\n * - `ViewEncapsulation.Native`: Use shadow roots. This works\n * only if natively available on the platform.\n * - `ViewEncapsulation.Emulated`: Use shimmed CSS that\n * emulates the native behavior.\n * - `ViewEncapsulation.None`: Use global CSS without any\n * encapsulation.\n *\n * If not supplied, the value is taken from `CompilerOptions`. The default compiler option is\n * `ViewEncapsulation.Emulated`.\n *\n * If the policy is set to `ViewEncapsulation.Emulated` and the component has no `styles`\n * or `styleUrls` specified, the policy is automatically switched to `ViewEncapsulation.None`.\n */\n encapsulation?: ViewEncapsulation;\n\n /**\n * Overrides the default encapsulation start and end delimiters (`{{` and `}}`)\n */\n interpolation?: [string, string];\n\n /**\n * A set of components that should be compiled along with\n * this component. For each component listed here,\n * Angular creates a {@link ComponentFactory} and stores it in the\n * {@link ComponentFactoryResolver}.\n */\n entryComponents?: Array<Type<any>|any[]>;\n\n /**\n * True to preserve or false to remove potentially superfluous whitespace characters\n * from the compiled template. Whitespace characters are those matching the `\\s`\n * character class in JavaScript regular expressions. Default is false, unless\n * overridden in compiler options.\n */\n preserveWhitespaces?: boolean;\n}\n\n/**\n * Component decorator and metadata.\n *\n * @usageNotes\n *\n * ### Using animations\n *\n * The following snippet shows an animation trigger in a component's\n * metadata. The trigger is attached to an element in the component's\n * template, using \"@_trigger_name_\", and a state expression that is evaluated\n * at run time to determine whether the animation should start.\n *\n * ```typescript\n * @Component({\n * selector: 'animation-cmp',\n * templateUrl: 'animation-cmp.html',\n * animations: [\n * trigger('myTriggerName', [\n * state('on', style({ opacity: 1 }),\n * state('off', style({ opacity: 0 }),\n * transition('on => off', [\n * animate(\"1s\")\n * ])\n * ])\n * ]\n * })\n * ```\n *\n * ```html\n * <!-- animation-cmp.html -->\n * <div @myTriggerName=\"expression\">...</div>\n * ```\n *\n * ### Preserving whitespace\n *\n * Removing whitespace can greatly reduce AOT-generated code size, and speed up view creation.\n * As of Angular 6, default for `preserveWhitespaces` is false (whitespace is removed).\n * To change the default setting for all components in your application, set\n * the `preserveWhitespaces` option of the AOT compiler.\n *\n * Current implementation removes whitespace characters as follows:\n * - Trims all whitespaces at the beginning and the end of a template.\n * - Removes whitespace-only text nodes. For example,\n * `<button>Action 1</button> <button>Action 2</button>` becomes\n * `<button>Action 1</button><button>Action 2</button>`.\n * - Replaces a series of whitespace characters in text nodes with a single space.\n * For example, `<span>\\n some text\\n</span>` becomes `<span> some text </span>`.\n * - Does NOT alter text nodes inside HTML tags such as `<pre>` or `<textarea>`,\n * where whitespace characters are significant.\n *\n * Note that these transformations can influence DOM nodes layout, although impact\n * should be minimal.\n *\n * You can override the default behavior to preserve whitespace characters\n * in certain fragments of a template. For example, you can exclude an entire\n * DOM sub-tree by using the `ngPreserveWhitespaces` attribute:\n *\n * ```html\n * <div ngPreserveWhitespaces>\n * whitespaces are preserved here\n * <span> and here </span>\n * </div>\n * ```\n *\n * You can force a single space to be preserved in a text node by using `&ngsp;`,\n * which is replaced with a space character by Angular's template\n * compiler:\n *\n * ```html\n * <a>Spaces</a>&ngsp;<a>between</a>&ngsp;<a>links.</a>\n * <!-->compiled to be equivalent to:</>\n * <a>Spaces</a> <a>between</a> <a>links.</a>\n * ```\n *\n * Note that sequences of `&ngsp;` are still collapsed to just one space character when\n * the `preserveWhitespaces` option is set to `false`.\n *\n * ```html\n * <a>before</a>&ngsp;&ngsp;&ngsp;<a>after</a>\n * <!-->compiled to be equivalent to:</>\n * <a>Spaces</a> <a>between</a> <a>links.</a>\n * ```\n *\n * To preserve sequences of whitespace characters, use the\n * `ngPreserveWhitespaces` attribute.\n *\n * @Annotation\n */\nexport const Component: ComponentDecorator = makeDecorator(\n 'Component', (c: Component = {}) => ({changeDetection: ChangeDetectionStrategy.Default, ...c}),\n Directive, undefined,\n (type: Type<any>, meta: Component) => (R3_COMPILE_COMPONENT || (() => {}))(type, meta));\n\n/**\n * Type of the Pipe decorator / constructor function.\n */\nexport interface PipeDecorator {\n /**\n * Declares a reusable pipe function, and supplies configuration metadata.\n *\n */\n (obj: Pipe): TypeDecorator;\n\n /**\n * See the `Pipe` decorator.\n */\n new (obj: Pipe): Pipe;\n}\n\n/**\n * Type of the Pipe metadata.\n */\nexport interface Pipe {\n /**\n * The pipe name to use in template bindings.\n *\n */\n name: string;\n\n /**\n * When true, the pipe is pure, meaning that the\n * `transform()` method is invoked only when its input arguments\n * change. Pipes are pure by default.\n *\n * If the pipe has internal state (that is, the result\n * depends on state other than its arguments), set `pure` to false.\n * In this case, the pipe is invoked on each change-detection cycle,\n * even if the arguments have not changed.\n */\n pure?: boolean;\n}\n\n/**\n *\n *\n * @Annotation\n */\nexport const Pipe: PipeDecorator = makeDecorator(\n 'Pipe', (p: Pipe) => ({pure: true, ...p}), undefined, undefined,\n (type: Type<any>, meta: Pipe) => (R3_COMPILE_PIPE || (() => {}))(type, meta));\n\n\n/**\n *\n */\nexport interface InputDecorator {\n /**\n * Decorator that marks a class as pipe and supplies configuration metadata.\n *\n * A pipe class must implement the `PipeTransform` interface.\n * For example, if the name is \"myPipe\", use a template binding expression\n * such as the following:\n *\n * ```\n * {{ exp | myPipe }}\n * ```\n *\n * The result of the expression is passed to the pipe's `transform()` method.\n *\n * A pipe must belong to an NgModule in order for it to be available\n * to a template. To make it a member of an NgModule,\n * list it in the `declarations` field of the `@NgModule` metadata.\n *\n */\n (bindingPropertyName?: string): any;\n new (bindingPropertyName?: string): any;\n}\n\n/**\n * Type of metadata for an `Input` property.\n *\n *\n */\nexport interface Input {\n /**\n * Decorator that marks a class field as an input property and supplies configuration metadata.\n * Declares a data-bound input property, which Angular automatically updates\n * during change detection.\n *\n * @usageNotes\n *\n * You can supply an optional name to use in templates when the\n * component is instantiated, that maps to the\n * name of the bound property. By default, the original\n * name of the bound property is used for input binding.\n *\n * The following example creates a component with two input properties,\n * one of which is given a special binding name.\n *\n * ```typescript\n * @Component({\n * selector: 'bank-account',\n * template: `\n * Bank Name: {{bankName}}\n * Account Id: {{id}}\n * `\n * })\n * class BankAccount {\n * // This property is bound using its original name.\n * @Input() bankName: string;\n * // this property value is bound to a different property name\n * // when this component is instantiated in a template.\n * @Input('account-id') id: string;\n *\n * // this property is not bound, and is not automatically updated by Angular\n * normalizedBankName: string;\n * }\n *\n * @Component({\n * selector: 'app',\n * template: `\n * <bank-account bankName=\"RBC\" account-id=\"4747\"></bank-account>\n * `\n * })\n *\n * class App {}\n * ```\n */\n bindingPropertyName?: string;\n}\n\n/**\n *\n * @Annotation\n */\nexport const Input: InputDecorator =\n makePropDecorator('Input', (bindingPropertyName?: string) => ({bindingPropertyName}));\n\n/**\n * Type of the Output decorator / constructor function.\n */\nexport interface OutputDecorator {\n /**\n * Decorator that marks a class field as an output property and supplies configuration metadata.\n * Declares a data-bound output property, which Angular automatically updates\n * during change detection.\n *\n * @usageNotes\n *\n * You can supply an optional name to use in templates when the\n * component is instantiated, that maps to the\n * name of the bound property. By default, the original\n * name of the bound property is used for output binding.\n *\n * See `@Input` decorator for an example of providing a binding name.\n *\n */\n (bindingPropertyName?: string): any;\n new (bindingPropertyName?: string): any;\n}\n\n/**\n * Type of the Output metadata.\n */\nexport interface Output { bindingPropertyName?: string; }\n\n/**\n *\n * @Annotation\n */\nexport const Output: OutputDecorator =\n makePropDecorator('Output', (bindingPropertyName?: string) => ({bindingPropertyName}));\n\n\n/**\n * Type of the HostBinding decorator / constructor function.\n */\nexport interface HostBindingDecorator {\n /**\n * Decorator that marks a DOM property as a host-binding property and supplies configuration\n * metadata.\n * Angular automatically checks host property bindings during change detection, and\n * if a binding changes it updates the host element of the directive.\n *\n * @usageNotes\n *\n * The following example creates a directive that sets the `valid` and `invalid`\n * properties on the DOM element that has an `ngModel` directive on it.\n *\n * ```typescript\n * @Directive({selector: '[ngModel]'})\n * class NgModelStatus {\n * constructor(public control: NgModel) {}\n * @HostBinding('class.valid') get valid() { return this.control.valid; }\n * @HostBinding('class.invalid') get invalid() { return this.control.invalid; }\n * }\n *\n * @Component({\n * selector: 'app',\n * template: `<input [(ngModel)]=\"prop\">`,\n * })\n * class App {\n * prop;\n * }\n * ```\n */\n (hostPropertyName?: string): any;\n new (hostPropertyName?: string): any;\n}\n\n/**\n * Type of the HostBinding metadata.\n *\n */\nexport interface HostBinding { hostPropertyName?: string; }\n\n/**\n *\n * @Annotation\n */\nexport const HostBinding: HostBindingDecorator =\n makePropDecorator('HostBinding', (hostPropertyName?: string) => ({hostPropertyName}));\n\n\n/**\n * Type of the HostListener decorator / constructor function.\n */\nexport interface HostListenerDecorator {\n (eventName: string, args?: string[]): any;\n new (eventName: string, args?: string[]): any;\n}\n\n/**\n * Type of the HostListener metadata.\n */\nexport interface HostListener {\n /**\n * The CSS event to listen for.\n */\n eventName?: string;\n /**\n * A set of arguments to pass to the handler method when the event occurs.\n */\n args?: string[];\n}\n\n/**\n * Binds a CSS event to a host listener and supplies configuration metadata.\n * Angular invokes the supplied handler method when the host element emits the specified event,\n * and updates the bound element with the result.\n * If the handler method returns false, applies `preventDefault` on the bound element.\n *\n * @usageNotes\n *\n * The following example declares a directive\n * that attaches a click listener to a button and counts clicks.\n *\n * ```\n * @Directive({selector: 'button[counting]'})\n * class CountClicks {\n * numberOfClicks = 0;\n *\n * @HostListener('click', ['$event.target'])\n * onClick(btn) {\n * console.log('button', btn, 'number of clicks:', this.numberOfClicks++);\n * }\n * }\n *\n * @Component({\n * selector: 'app',\n * template: '<button counting>Increment</button>',\n * })\n * class App {}\n * ```\n *\n * @Annotation\n */\nexport const HostListener: HostListenerDecorator =\n makePropDecorator('HostListener', (eventName?: string, args?: string[]) => ({eventName, args}));\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @description\n *\n * Represents a type that a Component or other object is instances of.\n *\n * An example of a `Type` is `MyCustomComponent` class, which in JavaScript is be represented by\n * the `MyCustomComponent` constructor function.\n *\n *\n */\nexport const Type = Function;\n\nexport function isType(v: any): v is Type<any> {\n return typeof v === 'function';\n}\n\nexport interface Type<T> extends Function { new (...args: any[]): T; }\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n// TODO(jteplitz602): Load WorkerGlobalScope from lib.webworker.d.ts file #3492\ndeclare var WorkerGlobalScope: any /** TODO #9100 */;\n// CommonJS / Node have global context exposed as \"global\" variable.\n// We don't want to include the whole node.d.ts this this compilation unit so we'll just fake\n// the global \"global\" var for now.\ndeclare var global: any /** TODO #9100 */;\nconst __window = typeof window !== 'undefined' && window;\nconst __self = typeof self !== 'undefined' && typeof WorkerGlobalScope !== 'undefined' &&\n self instanceof WorkerGlobalScope && self;\nconst __global = typeof global !== 'undefined' && global;\n\n// Check __global first, because in Node tests both __global and __window may be defined and _global\n// should be __global in that case.\nconst _global: {[name: string]: any} = __global || __window || __self;\n\nconst promise: Promise<any> = Promise.resolve(0);\n/**\n * Attention: whenever providing a new value, be sure to add an\n * entry into the corresponding `....externs.js` file,\n * so that closure won't use that global for its purposes.\n */\nexport {_global as global};\n\n// When Symbol.iterator doesn't exist, retrieves the key used in es6-shim\ndeclare const Symbol: any;\nlet _symbolIterator: any = null;\nexport function getSymbolIterator(): string|symbol {\n if (!_symbolIterator) {\n const Symbol = _global['Symbol'];\n if (Symbol && Symbol.iterator) {\n _symbolIterator = Symbol.iterator;\n } else {\n // es6-shim specific logic\n const keys = Object.getOwnPropertyNames(Map.prototype);\n for (let i = 0; i < keys.length; ++i) {\n const key = keys[i];\n if (key !== 'entries' && key !== 'size' &&\n (Map as any).prototype[key] === Map.prototype['entries']) {\n _symbolIterator = key;\n }\n }\n }\n }\n return _symbolIterator;\n}\n\nexport function scheduleMicroTask(fn: Function) {\n if (typeof Zone === 'undefined') {\n // use promise to schedule microTask instead of use Zone\n promise.then(() => { fn && fn.apply(null, null); });\n } else {\n Zone.current.scheduleMicroTask('scheduleMicrotask', fn);\n }\n}\n\n// JS has NaN !== NaN\nexport function looseIdentical(a: any, b: any): boolean {\n return a === b || typeof a === 'number' && typeof b === 'number' && isNaN(a) && isNaN(b);\n}\n\nexport function stringify(token: any): string {\n if (typeof token === 'string') {\n return token;\n }\n\n if (token instanceof Array) {\n return '[' + token.map(stringify).join(', ') + ']';\n }\n\n if (token == null) {\n return '' + token;\n }\n\n if (token.overriddenName) {\n return `${token.overriddenName}`;\n }\n\n if (token.name) {\n return `${token.name}`;\n }\n\n const res = token.toString();\n\n if (res == null) {\n return '' + res;\n }\n\n const newLineIndex = res.indexOf('\\n');\n return newLineIndex === -1 ? res : res.substring(0, newLineIndex);\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Type, isType} from '../type';\nimport {global, stringify} from '../util';\nimport {ANNOTATIONS, PARAMETERS, PROP_METADATA} from '../util/decorators';\n\nimport {PlatformReflectionCapabilities} from './platform_reflection_capabilities';\nimport {GetterFn, MethodFn, SetterFn} from './types';\n\n\n/**\n * Attention: These regex has to hold even if the code is minified!\n */\nexport const DELEGATE_CTOR = /^function\\s+\\S+\\(\\)\\s*{[\\s\\S]+\\.apply\\(this,\\s*arguments\\)/;\nexport const INHERITED_CLASS = /^class\\s+[A-Za-z\\d$_]*\\s*extends\\s+[A-Za-z\\d$_]+\\s*{/;\nexport const INHERITED_CLASS_WITH_CTOR =\n /^class\\s+[A-Za-z\\d$_]*\\s*extends\\s+[A-Za-z\\d$_]+\\s*{[\\s\\S]*constructor\\s*\\(/;\n\nexport class ReflectionCapabilities implements PlatformReflectionCapabilities {\n private _reflect: any;\n\n constructor(reflect?: any) { this._reflect = reflect || global['Reflect']; }\n\n isReflectionEnabled(): boolean { return true; }\n\n factory<T>(t: Type<T>): (args: any[]) => T { return (...args: any[]) => new t(...args); }\n\n /** @internal */\n _zipTypesAndAnnotations(paramTypes: any[], paramAnnotations: any[]): any[][] {\n let result: any[][];\n\n if (typeof paramTypes === 'undefined') {\n result = new Array(paramAnnotations.length);\n } else {\n result = new Array(paramTypes.length);\n }\n\n for (let i = 0; i < result.length; i++) {\n // TS outputs Object for parameters without types, while Traceur omits\n // the annotations. For now we preserve the Traceur behavior to aid\n // migration, but this can be revisited.\n if (typeof paramTypes === 'undefined') {\n result[i] = [];\n } else if (paramTypes[i] != Object) {\n result[i] = [paramTypes[i]];\n } else {\n result[i] = [];\n }\n if (paramAnnotations && paramAnnotations[i] != null) {\n result[i] = result[i].concat(paramAnnotations[i]);\n }\n }\n return result;\n }\n\n private _ownParameters(type: Type<any>, parentCtor: any): any[][]|null {\n const typeStr = type.toString();\n // If we have no decorators, we only have function.length as metadata.\n // In that case, to detect whether a child class declared an own constructor or not,\n // we need to look inside of that constructor to check whether it is\n // just calling the parent.\n // This also helps to work around for https://github.com/Microsoft/TypeScript/issues/12439\n // that sets 'design:paramtypes' to []\n // if a class inherits from another class but has no ctor declared itself.\n if (DELEGATE_CTOR.exec(typeStr) ||\n (INHERITED_CLASS.exec(typeStr) && !INHERITED_CLASS_WITH_CTOR.exec(typeStr))) {\n return null;\n }\n\n // Prefer the direct API.\n if ((<any>type).parameters && (<any>type).parameters !== parentCtor.parameters) {\n return (<any>type).parameters;\n }\n\n // API of tsickle for lowering decorators to properties on the class.\n const tsickleCtorParams = (<any>type).ctorParameters;\n if (tsickleCtorParams && tsickleCtorParams !== parentCtor.ctorParameters) {\n // Newer tsickle uses a function closure\n // Retain the non-function case for compatibility with older tsickle\n const ctorParameters =\n typeof tsickleCtorParams === 'function' ? tsickleCtorParams() : tsickleCtorParams;\n const paramTypes = ctorParameters.map((ctorParam: any) => ctorParam && ctorParam.type);\n const paramAnnotations = ctorParameters.map(\n (ctorParam: any) =>\n ctorParam && convertTsickleDecoratorIntoMetadata(ctorParam.decorators));\n return this._zipTypesAndAnnotations(paramTypes, paramAnnotations);\n }\n\n // API for metadata created by invoking the decorators.\n const paramAnnotations = type.hasOwnProperty(PARAMETERS) && (type as any)[PARAMETERS];\n const paramTypes = this._reflect && this._reflect.getOwnMetadata &&\n this._reflect.getOwnMetadata('design:paramtypes', type);\n if (paramTypes || paramAnnotations) {\n return this._zipTypesAndAnnotations(paramTypes, paramAnnotations);\n }\n\n // If a class has no decorators, at least create metadata\n // based on function.length.\n // Note: We know that this is a real constructor as we checked\n // the content of the constructor above.\n return new Array((<any>type.length)).fill(undefined);\n }\n\n parameters(type: Type<any>): any[][] {\n // Note: only report metadata if we have at least one class decorator\n // to stay in sync with the static reflector.\n if (!isType(type)) {\n return [];\n }\n const parentCtor = getParentCtor(type);\n let parameters = this._ownParameters(type, parentCtor);\n if (!parameters && parentCtor !== Object) {\n parameters = this.parameters(parentCtor);\n }\n return parameters || [];\n }\n\n private _ownAnnotations(typeOrFunc: Type<any>, parentCtor: any): any[]|null {\n // Prefer the direct API.\n if ((<any>typeOrFunc).annotations && (<any>typeOrFunc).annotations !== parentCtor.annotations) {\n let annotations = (<any>typeOrFunc).annotations;\n if (typeof annotations === 'function' && annotations.annotations) {\n annotations = annotations.annotations;\n }\n return annotations;\n }\n\n // API of tsickle for lowering decorators to properties on the class.\n if ((<any>typeOrFunc).decorators && (<any>typeOrFunc).decorators !== parentCtor.decorators) {\n return convertTsickleDecoratorIntoMetadata((<any>typeOrFunc).decorators);\n }\n\n // API for metadata created by invoking the decorators.\n if (typeOrFunc.hasOwnProperty(ANNOTATIONS)) {\n return (typeOrFunc as any)[ANNOTATIONS];\n }\n return null;\n }\n\n annotations(typeOrFunc: Type<any>): any[] {\n if (!isType(typeOrFunc)) {\n return [];\n }\n const parentCtor = getParentCtor(typeOrFunc);\n const ownAnnotations = this._ownAnnotations(typeOrFunc, parentCtor) || [];\n const parentAnnotations = parentCtor !== Object ? this.annotations(parentCtor) : [];\n return parentAnnotations.concat(ownAnnotations);\n }\n\n private _ownPropMetadata(typeOrFunc: any, parentCtor: any): {[key: string]: any[]}|null {\n // Prefer the direct API.\n if ((<any>typeOrFunc).propMetadata &&\n (<any>typeOrFunc).propMetadata !== parentCtor.propMetadata) {\n let propMetadata = (<any>typeOrFunc).propMetadata;\n if (typeof propMetadata === 'function' && propMetadata.propMetadata) {\n propMetadata = propMetadata.propMetadata;\n }\n return propMetadata;\n }\n\n // API of tsickle for lowering decorators to properties on the class.\n if ((<any>typeOrFunc).propDecorators &&\n (<any>typeOrFunc).propDecorators !== parentCtor.propDecorators) {\n const propDecorators = (<any>typeOrFunc).propDecorators;\n const propMetadata = <{[key: string]: any[]}>{};\n Object.keys(propDecorators).forEach(prop => {\n propMetadata[prop] = convertTsickleDecoratorIntoMetadata(propDecorators[prop]);\n });\n return propMetadata;\n }\n\n // API for metadata created by invoking the decorators.\n if (typeOrFunc.hasOwnProperty(PROP_METADATA)) {\n return (typeOrFunc as any)[PROP_METADATA];\n }\n return null;\n }\n\n propMetadata(typeOrFunc: any): {[key: string]: any[]} {\n if (!isType(typeOrFunc)) {\n return {};\n }\n const parentCtor = getParentCtor(typeOrFunc);\n const propMetadata: {[key: string]: any[]} = {};\n if (parentCtor !== Object) {\n const parentPropMetadata = this.propMetadata(parentCtor);\n Object.keys(parentPropMetadata).forEach((propName) => {\n propMetadata[propName] = parentPropMetadata[propName];\n });\n }\n const ownPropMetadata = this._ownPropMetadata(typeOrFunc, parentCtor);\n if (ownPropMetadata) {\n Object.keys(ownPropMetadata).forEach((propName) => {\n const decorators: any[] = [];\n if (propMetadata.hasOwnProperty(propName)) {\n decorators.push(...propMetadata[propName]);\n }\n decorators.push(...ownPropMetadata[propName]);\n propMetadata[propName] = decorators;\n });\n }\n return propMetadata;\n }\n\n hasLifecycleHook(type: any, lcProperty: string): boolean {\n return type instanceof Type && lcProperty in type.prototype;\n }\n\n guards(type: any): {[key: string]: any} { return {}; }\n\n getter(name: string): GetterFn { return <GetterFn>new Function('o', 'return o.' + name + ';'); }\n\n setter(name: string): SetterFn {\n return <SetterFn>new Function('o', 'v', 'return o.' + name + ' = v;');\n }\n\n method(name: string): MethodFn {\n const functionBody = `if (!o.${name}) throw new Error('\"${name}\" is undefined');\n return o.${name}.apply(o, args);`;\n return <MethodFn>new Function('o', 'args', functionBody);\n }\n\n // There is not a concept of import uri in Js, but this is useful in developing Dart applications.\n importUri(type: any): string {\n // StaticSymbol\n if (typeof type === 'object' && type['filePath']) {\n return type['filePath'];\n }\n // Runtime type\n return `./${stringify(type)}`;\n }\n\n resourceUri(type: any): string { return `./${stringify(type)}`; }\n\n resolveIdentifier(name: string, moduleUrl: string, members: string[], runtime: any): any {\n return runtime;\n }\n resolveEnum(enumIdentifier: any, name: string): any { return enumIdentifier[name]; }\n}\n\nfunction convertTsickleDecoratorIntoMetadata(decoratorInvocations: any[]): any[] {\n if (!decoratorInvocations) {\n return [];\n }\n return decoratorInvocations.map(decoratorInvocation => {\n const decoratorType = decoratorInvocation.type;\n const annotationCls = decoratorType.annotationCls;\n const annotationArgs = decoratorInvocation.args ? decoratorInvocation.args : [];\n return new annotationCls(...annotationArgs);\n });\n}\n\nfunction getParentCtor(ctor: Function): Type<any> {\n const parentProto = ctor.prototype ? Object.getPrototypeOf(ctor.prototype) : null;\n const parentCtor = parentProto ? parentProto.constructor : null;\n // Note: We always use `Object` as the null value\n // to simplify checking later on.\n return parentCtor || Object;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport function getClosureSafeProperty<T>(objWithPropertyToExtract: T, target: any): string {\n for (let key in objWithPropertyToExtract) {\n if (objWithPropertyToExtract[key] === target) {\n return key;\n }\n }\n throw Error('Could not find renamed property on target object.');\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Type} from '../type';\nimport {stringify} from '../util';\n\n\n\n/**\n * An interface that a function passed into {@link forwardRef} has to implement.\n *\n * @usageNotes\n * ### Example\n *\n * {@example core/di/ts/forward_ref/forward_ref_spec.ts region='forward_ref_fn'}\n * @experimental\n */\nexport interface ForwardRefFn { (): any; }\n\n/**\n * Allows to refer to references which are not yet defined.\n *\n * For instance, `forwardRef` is used when the `token` which we need to refer to for the purposes of\n * DI is declared, but not yet defined. It is also used when the `token` which we use when creating\n * a query is not yet defined.\n *\n * @usageNotes\n * ### Example\n * {@example core/di/ts/forward_ref/forward_ref_spec.ts region='forward_ref'}\n * @experimental\n */\nexport function forwardRef(forwardRefFn: ForwardRefFn): Type<any> {\n (<any>forwardRefFn).__forward_ref__ = forwardRef;\n (<any>forwardRefFn).toString = function() { return stringify(this()); };\n return (<Type<any>><any>forwardRefFn);\n}\n\n/**\n * Lazily retrieves the reference value from a forwardRef.\n *\n * Acts as the identity function when given a non-forward-ref value.\n *\n * @usageNotes\n * ### Example\n *\n * {@example core/di/ts/forward_ref/forward_ref_spec.ts region='resolve_forward_ref'}\n *\n * @see `forwardRef`\n * @experimental\n */\nexport function resolveForwardRef(type: any): any {\n if (typeof type === 'function' && type.hasOwnProperty('__forward_ref__') &&\n type.__forward_ref__ === forwardRef) {\n return (<ForwardRefFn>type)();\n } else {\n return type;\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ClassSansProvider, ConstructorProvider, ConstructorSansProvider, ExistingProvider, ExistingSansProvider, FactoryProvider, FactorySansProvider, StaticClassProvider, StaticClassSansProvider, ValueProvider, ValueSansProvider} from '../di/provider';\nimport {ReflectionCapabilities} from '../reflection/reflection_capabilities';\nimport {Type} from '../type';\nimport {makeDecorator, makeParamDecorator} from '../util/decorators';\nimport {EMPTY_ARRAY} from '../view/util';\n\n\n/**\n * Type of the Inject decorator / constructor function.\n */\nexport interface InjectDecorator {\n /**\n * A constructor parameter decorator that specifies a\n * custom provider of a dependency.\n *\n * @see [\"Dependency Injection Guide\"](guide/dependency-injection).\n *\n * @usageNotes\n * The following example shows a class constructor that specifies a\n * custom provider of a dependency using the parameter decorator.\n *\n * {@example core/di/ts/metadata_spec.ts region='Inject'}\n *\n * When `@Inject()` is not present, the `Injector` uses the type annotation of the\n * parameter as the provider.\n *\n * {@example core/di/ts/metadata_spec.ts region='InjectWithoutDecorator'}\n */\n (token: any): any;\n new (token: any): Inject;\n}\n\n/**\n * Type of the Inject metadata.\n */\nexport interface Inject {\n /**\n * Injector token that maps to the dependency to be injected.\n */\n token: any;\n}\n\n/**\n * Inject decorator and metadata.\n *\n * @Annotation\n */\nexport const Inject: InjectDecorator = makeParamDecorator('Inject', (token: any) => ({token}));\n\n\n/**\n * Type of the Optional decorator / constructor function.\n */\nexport interface OptionalDecorator {\n /**\n * A constructor parameter decorator that marks a dependency as optional.\n *\n * The DI framework provides null if the dependency is not found.\n * For example, the following code allows the possibility of a null result: \n *\n * {@example core/di/ts/metadata_spec.ts region='Optional'}\n *\n * @see [\"Dependency Injection Guide\"](guide/dependency-injection).\n */\n (): any;\n new (): Optional;\n}\n\n/**\n * Type of the Optional metadata.\n */\nexport interface Optional {}\n\n/**\n * Optional decorator and metadata.\n *\n * @Annotation\n */\nexport const Optional: OptionalDecorator = makeParamDecorator('Optional');\n\n/**\n * Type of the Self decorator / constructor function.\n */\nexport interface SelfDecorator {\n /**\n * A constructor parameter decorator that tells the DI framework\n * to retrieve a dependency only from the local injector.\n *\n * In the following example, the dependency can be resolved\n * by the local injector when instantiating the class itself, but not\n * when instantiating a child.\n *\n * {@example core/di/ts/metadata_spec.ts region='Self'}\n *\n * @see [\"Dependency Injection Guide\"](guide/dependency-injection).\n *\n *\n */\n (): any;\n new (): Self;\n}\n\n/**\n * Type of the Self metadata.\n */\nexport interface Self {}\n\n/**\n * Self decorator and metadata.\n *\n * @Annotation\n */\nexport const Self: SelfDecorator = makeParamDecorator('Self');\n\n\n/**\n * Type of the SkipSelf decorator / constructor function.\n */\nexport interface SkipSelfDecorator {\n /**\n * A constructor parameter decorator that tells the DI framework\n * that dependency resolution should start from the parent injector.\n *\n * In the following example, the dependency can be resolved when\n * instantiating a child, but not when instantiating the class itself.\n *\n * {@example core/di/ts/metadata_spec.ts region='SkipSelf'}\n *\n * @see [\"Dependency Injection Guide\"](guide/dependency-injection).\n *\n *\n */\n (): any;\n new (): SkipSelf;\n}\n\n/**\n * Type of the SkipSelf metadata.\n *\n *\n */\nexport interface SkipSelf {}\n\n/**\n * SkipSelf decorator and metadata.\n *\n * @Annotation\n */\nexport const SkipSelf: SkipSelfDecorator = makeParamDecorator('SkipSelf');\n\n/**\n * Type of the Host decorator / constructor function.\n */\nexport interface HostDecorator {\n /**\n * A constructor parameter decorator that tells the DI framework\n * to retrieve a dependency from any injector until\n * reaching the host element of the current component.\n *\n * @see [\"Dependency Injection Guide\"](guide/dependency-injection).\n *\n * @usageNotes \n *\n * {@example core/di/ts/metadata_spec.ts region='Host'}\n */\n (): any;\n new (): Host;\n}\n\n/**\n * Type of the Host metadata.\n */\nexport interface Host {}\n\n/**\n * Host decorator and metadata.\n *\n * @Annotation\n */\nexport const Host: HostDecorator = makeParamDecorator('Host');\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Type} from '../type';\nimport {stringify} from '../util';\n\nimport {InjectableDef, defineInjectable} from './defs';\nimport {resolveForwardRef} from './forward_ref';\nimport {InjectionToken} from './injection_token';\nimport {Inject, Optional, Self, SkipSelf} from './metadata';\nimport {ConstructorProvider, ExistingProvider, FactoryProvider, StaticClassProvider, StaticProvider, ValueProvider} from './provider';\n\nexport const SOURCE = '__source';\nconst _THROW_IF_NOT_FOUND = new Object();\nexport const THROW_IF_NOT_FOUND = _THROW_IF_NOT_FOUND;\n\n/**\n * An InjectionToken that gets the current `Injector` for `createInjector()`-style injectors.\n *\n * Requesting this token instead of `Injector` allows `StaticInjector` to be tree-shaken from a\n * project.\n *\n * @experimental\n */\nexport const INJECTOR = new InjectionToken<Injector>('INJECTOR');\n\nexport class NullInjector implements Injector {\n get(token: any, notFoundValue: any = _THROW_IF_NOT_FOUND): any {\n if (notFoundValue === _THROW_IF_NOT_FOUND) {\n // Intentionally left behind: With dev tools open the debugger will stop here. There is no\n // reason why correctly written application should cause this exception.\n // TODO(misko): uncomment the next line once `ngDevMode` works with closure.\n // if(ngDevMode) debugger;\n throw new Error(`NullInjectorError: No provider for ${stringify(token)}!`);\n }\n return notFoundValue;\n }\n}\n\n/**\n * Concrete injectors implement this interface.\n *\n * For more details, see the [\"Dependency Injection Guide\"](guide/dependency-injection).\n *\n * @usageNotes\n * ### Example\n *\n * {@example core/di/ts/injector_spec.ts region='Injector'}\n *\n * `Injector` returns itself when given `Injector` as a token:\n *\n * {@example core/di/ts/injector_spec.ts region='injectInjector'}\n *\n *\n */\nexport abstract class Injector {\n static THROW_IF_NOT_FOUND = _THROW_IF_NOT_FOUND;\n static NULL: Injector = new NullInjector();\n\n /**\n * Retrieves an instance from the injector based on the provided token.\n * @returns The instance from the injector if defined, otherwise the `notFoundValue`.\n * @throws When the `notFoundValue` is `undefined` or `Injector.THROW_IF_NOT_FOUND`.\n */\n abstract get<T>(token: Type<T>|InjectionToken<T>, notFoundValue?: T, flags?: InjectFlags): T;\n /**\n * @deprecated from v4.0.0 use Type<T> or InjectionToken<T>\n * @suppress {duplicate}\n */\n abstract get(token: any, notFoundValue?: any): any;\n\n /**\n * @deprecated from v5 use the new signature Injector.create(options)\n */\n static create(providers: StaticProvider[], parent?: Injector): Injector;\n\n static create(options: {providers: StaticProvider[], parent?: Injector, name?: string}): Injector;\n\n /**\n * Create a new Injector which is configure using `StaticProvider`s.\n *\n * @usageNotes\n * ### Example\n *\n * {@example core/di/ts/provider_spec.ts region='ConstructorProvider'}\n */\n static create(\n options: StaticProvider[]|{providers: StaticProvider[], parent?: Injector, name?: string},\n parent?: Injector): Injector {\n if (Array.isArray(options)) {\n return new StaticInjector(options, parent);\n } else {\n return new StaticInjector(options.providers, options.parent, options.name || null);\n }\n }\n\n static ngInjectableDef = defineInjectable({\n providedIn: 'any' as any,\n factory: () => inject(INJECTOR),\n });\n}\n\n\n\nconst IDENT = function<T>(value: T): T {\n return value;\n};\nconst EMPTY = <any[]>[];\nconst CIRCULAR = IDENT;\nconst MULTI_PROVIDER_FN = function(): any[] {\n return Array.prototype.slice.call(arguments);\n};\nconst GET_PROPERTY_NAME = {} as any;\nexport const USE_VALUE =\n getClosureSafeProperty<ValueProvider>({provide: String, useValue: GET_PROPERTY_NAME});\nconst NG_TOKEN_PATH = 'ngTokenPath';\nconst NG_TEMP_TOKEN_PATH = 'ngTempTokenPath';\nconst enum OptionFlags {\n Optional = 1 << 0,\n CheckSelf = 1 << 1,\n CheckParent = 1 << 2,\n Default = CheckSelf | CheckParent\n}\nconst NULL_INJECTOR = Injector.NULL;\nconst NEW_LINE = /\\n/gm;\nconst NO_NEW_LINE = 'ɵ';\n\nexport class StaticInjector implements Injector {\n readonly parent: Injector;\n readonly source: string|null;\n\n private _records: Map<any, Record>;\n\n constructor(\n providers: StaticProvider[], parent: Injector = NULL_INJECTOR, source: string|null = null) {\n this.parent = parent;\n this.source = source;\n const records = this._records = new Map<any, Record>();\n records.set(\n Injector, <Record>{token: Injector, fn: IDENT, deps: EMPTY, value: this, useNew: false});\n records.set(\n INJECTOR, <Record>{token: INJECTOR, fn: IDENT, deps: EMPTY, value: this, useNew: false});\n recursivelyProcessProviders(records, providers);\n }\n\n get<T>(token: Type<T>|InjectionToken<T>, notFoundValue?: T, flags?: InjectFlags): T;\n get(token: any, notFoundValue?: any): any;\n get(token: any, notFoundValue?: any, flags: InjectFlags = InjectFlags.Default): any {\n const record = this._records.get(token);\n try {\n return tryResolveToken(token, record, this._records, this.parent, notFoundValue, flags);\n } catch (e) {\n const tokenPath: any[] = e[NG_TEMP_TOKEN_PATH];\n if (token[SOURCE]) {\n tokenPath.unshift(token[SOURCE]);\n }\n e.message = formatError('\\n' + e.message, tokenPath, this.source);\n e[NG_TOKEN_PATH] = tokenPath;\n e[NG_TEMP_TOKEN_PATH] = null;\n throw e;\n }\n }\n\n toString() {\n const tokens = <string[]>[], records = this._records;\n records.forEach((v, token) => tokens.push(stringify(token)));\n return `StaticInjector[${tokens.join(', ')}]`;\n }\n}\n\ntype SupportedProvider =\n ValueProvider | ExistingProvider | StaticClassProvider | ConstructorProvider | FactoryProvider;\n\ninterface Record {\n fn: Function;\n useNew: boolean;\n deps: DependencyRecord[];\n value: any;\n}\n\ninterface DependencyRecord {\n token: any;\n options: number;\n}\n\ntype TokenPath = Array<any>;\n\nfunction resolveProvider(provider: SupportedProvider): Record {\n const deps = computeDeps(provider);\n let fn: Function = IDENT;\n let value: any = EMPTY;\n let useNew: boolean = false;\n let provide = resolveForwardRef(provider.provide);\n if (USE_VALUE in provider) {\n // We need to use USE_VALUE in provider since provider.useValue could be defined as undefined.\n value = (provider as ValueProvider).useValue;\n } else if ((provider as FactoryProvider).useFactory) {\n fn = (provider as FactoryProvider).useFactory;\n } else if ((provider as ExistingProvider).useExisting) {\n // Just use IDENT\n } else if ((provider as StaticClassProvider).useClass) {\n useNew = true;\n fn = resolveForwardRef((provider as StaticClassProvider).useClass);\n } else if (typeof provide == 'function') {\n useNew = true;\n fn = provide;\n } else {\n throw staticError(\n 'StaticProvider does not have [useValue|useFactory|useExisting|useClass] or [provide] is not newable',\n provider);\n }\n return {deps, fn, useNew, value};\n}\n\nfunction multiProviderMixError(token: any) {\n return staticError('Cannot mix multi providers and regular providers', token);\n}\n\nfunction recursivelyProcessProviders(records: Map<any, Record>, provider: StaticProvider) {\n if (provider) {\n provider = resolveForwardRef(provider);\n if (provider instanceof Array) {\n // if we have an array recurse into the array\n for (let i = 0; i < provider.length; i++) {\n recursivelyProcessProviders(records, provider[i]);\n }\n } else if (typeof provider === 'function') {\n // Functions were supported in ReflectiveInjector, but are not here. For safety give useful\n // error messages\n throw staticError('Function/Class not supported', provider);\n } else if (provider && typeof provider === 'object' && provider.provide) {\n // At this point we have what looks like a provider: {provide: ?, ....}\n let token = resolveForwardRef(provider.provide);\n const resolvedProvider = resolveProvider(provider);\n if (provider.multi === true) {\n // This is a multi provider.\n let multiProvider: Record|undefined = records.get(token);\n if (multiProvider) {\n if (multiProvider.fn !== MULTI_PROVIDER_FN) {\n throw multiProviderMixError(token);\n }\n } else {\n // Create a placeholder factory which will look up the constituents of the multi provider.\n records.set(token, multiProvider = <Record>{\n token: provider.provide,\n deps: [],\n useNew: false,\n fn: MULTI_PROVIDER_FN,\n value: EMPTY\n });\n }\n // Treat the provider as the token.\n token = provider;\n multiProvider.deps.push({token, options: OptionFlags.Default});\n }\n const record = records.get(token);\n if (record && record.fn == MULTI_PROVIDER_FN) {\n throw multiProviderMixError(token);\n }\n records.set(token, resolvedProvider);\n } else {\n throw staticError('Unexpected provider', provider);\n }\n }\n}\n\nfunction tryResolveToken(\n token: any, record: Record | undefined, records: Map<any, Record>, parent: Injector,\n notFoundValue: any, flags: InjectFlags): any {\n try {\n return resolveToken(token, record, records, parent, notFoundValue, flags);\n } catch (e) {\n // ensure that 'e' is of type Error.\n if (!(e instanceof Error)) {\n e = new Error(e);\n }\n const path: any[] = e[NG_TEMP_TOKEN_PATH] = e[NG_TEMP_TOKEN_PATH] || [];\n path.unshift(token);\n if (record && record.value == CIRCULAR) {\n // Reset the Circular flag.\n record.value = EMPTY;\n }\n throw e;\n }\n}\n\nfunction resolveToken(\n token: any, record: Record | undefined, records: Map<any, Record>, parent: Injector,\n notFoundValue: any, flags: InjectFlags): any {\n let value;\n if (record && !(flags & InjectFlags.SkipSelf)) {\n // If we don't have a record, this implies that we don't own the provider hence don't know how\n // to resolve it.\n value = record.value;\n if (value == CIRCULAR) {\n throw Error(NO_NEW_LINE + 'Circular dependency');\n } else if (value === EMPTY) {\n record.value = CIRCULAR;\n let obj = undefined;\n let useNew = record.useNew;\n let fn = record.fn;\n let depRecords = record.deps;\n let deps = EMPTY;\n if (depRecords.length) {\n deps = [];\n for (let i = 0; i < depRecords.length; i++) {\n const depRecord: DependencyRecord = depRecords[i];\n const options = depRecord.options;\n const childRecord =\n options & OptionFlags.CheckSelf ? records.get(depRecord.token) : undefined;\n deps.push(tryResolveToken(\n // Current Token to resolve\n depRecord.token,\n // A record which describes how to resolve the token.\n // If undefined, this means we don't have such a record\n childRecord,\n // Other records we know about.\n records,\n // If we don't know how to resolve dependency and we should not check parent for it,\n // than pass in Null injector.\n !childRecord && !(options & OptionFlags.CheckParent) ? NULL_INJECTOR : parent,\n options & OptionFlags.Optional ? null : Injector.THROW_IF_NOT_FOUND,\n InjectFlags.Default));\n }\n }\n record.value = value = useNew ? new (fn as any)(...deps) : fn.apply(obj, deps);\n }\n } else if (!(flags & InjectFlags.Self)) {\n value = parent.get(token, notFoundValue, InjectFlags.Default);\n }\n return value;\n}\n\n\nfunction computeDeps(provider: StaticProvider): DependencyRecord[] {\n let deps: DependencyRecord[] = EMPTY;\n const providerDeps: any[] =\n (provider as ExistingProvider & StaticClassProvider & ConstructorProvider).deps;\n if (providerDeps && providerDeps.length) {\n deps = [];\n for (let i = 0; i < providerDeps.length; i++) {\n let options = OptionFlags.Default;\n let token = resolveForwardRef(providerDeps[i]);\n if (token instanceof Array) {\n for (let j = 0, annotations = token; j < annotations.length; j++) {\n const annotation = annotations[j];\n if (annotation instanceof Optional || annotation == Optional) {\n options = options | OptionFlags.Optional;\n } else if (annotation instanceof SkipSelf || annotation == SkipSelf) {\n options = options & ~OptionFlags.CheckSelf;\n } else if (annotation instanceof Self || annotation == Self) {\n options = options & ~OptionFlags.CheckParent;\n } else if (annotation instanceof Inject) {\n token = (annotation as Inject).token;\n } else {\n token = resolveForwardRef(annotation);\n }\n }\n }\n deps.push({token, options});\n }\n } else if ((provider as ExistingProvider).useExisting) {\n const token = resolveForwardRef((provider as ExistingProvider).useExisting);\n deps = [{token, options: OptionFlags.Default}];\n } else if (!providerDeps && !(USE_VALUE in provider)) {\n // useValue & useExisting are the only ones which are exempt from deps all others need it.\n throw staticError('\\'deps\\' required', provider);\n }\n return deps;\n}\n\nfunction formatError(text: string, obj: any, source: string | null = null): string {\n text = text && text.charAt(0) === '\\n' && text.charAt(1) == NO_NEW_LINE ? text.substr(2) : text;\n let context = stringify(obj);\n if (obj instanceof Array) {\n context = obj.map(stringify).join(' -> ');\n } else if (typeof obj === 'object') {\n let parts = <string[]>[];\n for (let key in obj) {\n if (obj.hasOwnProperty(key)) {\n let value = obj[key];\n parts.push(\n key + ':' + (typeof value === 'string' ? JSON.stringify(value) : stringify(value)));\n }\n }\n context = `{${parts.join(', ')}}`;\n }\n return `StaticInjectorError${source ? '(' + source + ')' : ''}[${context}]: ${text.replace(NEW_LINE, '\\n ')}`;\n}\n\nfunction staticError(text: string, obj: any): Error {\n return new Error(formatError(text, obj));\n}\n\nfunction getClosureSafeProperty<T>(objWithPropertyToExtract: T): string {\n for (let key in objWithPropertyToExtract) {\n if (objWithPropertyToExtract[key] === GET_PROPERTY_NAME) {\n return key;\n }\n }\n throw Error('!prop');\n}\n\n/**\n * Injection flags for DI.\n */\nexport const enum InjectFlags {\n Default = 0b0000,\n\n /**\n * Specifies that an injector should retrieve a dependency from any injector until reaching the\n * host element of the current component. (Only used with Element Injector)\n */\n Host = 0b0001,\n /** Don't descend into ancestors of the node requesting injection. */\n Self = 0b0010,\n /** Skip the node that is requesting injection. */\n SkipSelf = 0b0100,\n /** Inject `defaultValue` instead if token not found. */\n Optional = 0b1000,\n}\n\n/**\n * Current injector value used by `inject`.\n * - `undefined`: it is an error to call `inject`\n * - `null`: `inject` can be called but there is no injector (limp-mode).\n * - Injector instance: Use the injector for resolution.\n */\nlet _currentInjector: Injector|undefined|null = undefined;\n\nexport function setCurrentInjector(injector: Injector | null | undefined): Injector|undefined|null {\n const former = _currentInjector;\n _currentInjector = injector;\n return former;\n}\n\n/**\n * Injects a token from the currently active injector.\n *\n * This function must be used in the context of a factory function such as one defined for an\n * `InjectionToken`, and will throw an error if not called from such a context.\n *\n * @usageNotes\n * ### Example\n *\n * {@example core/di/ts/injector_spec.ts region='ShakeableInjectionToken'}\n *\n * Within such a factory function `inject` is utilized to request injection of a dependency, instead\n * of providing an additional array of dependencies as was common to do with `useFactory` providers.\n * `inject` is faster and more type-safe.\n *\n * @experimental\n */\nexport function inject<T>(token: Type<T>| InjectionToken<T>): T;\nexport function inject<T>(token: Type<T>| InjectionToken<T>, flags?: InjectFlags): T|null;\nexport function inject<T>(token: Type<T>| InjectionToken<T>, flags = InjectFlags.Default): T|null {\n if (_currentInjector === undefined) {\n throw new Error(`inject() must be called from an injection context`);\n } else if (_currentInjector === null) {\n const injectableDef: InjectableDef<T> = (token as any).ngInjectableDef;\n if (injectableDef && injectableDef.providedIn == 'root') {\n return injectableDef.value === undefined ? injectableDef.value = injectableDef.factory() :\n injectableDef.value;\n }\n if (flags & InjectFlags.Optional) return null;\n throw new Error(`Injector: NOT_FOUND [${stringify(token)}]`);\n } else {\n return _currentInjector.get(token, flags & InjectFlags.Optional ? null : undefined, flags);\n }\n}\n\nexport function injectArgs(types: (Type<any>| InjectionToken<any>| any[])[]): any[] {\n const args: any[] = [];\n for (let i = 0; i < types.length; i++) {\n const arg = types[i];\n if (Array.isArray(arg)) {\n if (arg.length === 0) {\n throw new Error('Arguments array must have arguments.');\n }\n let type: Type<any>|undefined = undefined;\n let flags: InjectFlags = InjectFlags.Default;\n\n for (let j = 0; j < arg.length; j++) {\n const meta = arg[j];\n if (meta instanceof Optional || meta.ngMetadataName === 'Optional') {\n flags |= InjectFlags.Optional;\n } else if (meta instanceof SkipSelf || meta.ngMetadataName === 'SkipSelf') {\n flags |= InjectFlags.SkipSelf;\n } else if (meta instanceof Self || meta.ngMetadataName === 'Self') {\n flags |= InjectFlags.Self;\n } else if (meta instanceof Inject) {\n type = meta.token;\n } else {\n type = meta;\n }\n }\n\n args.push(inject(type !, flags));\n } else {\n args.push(inject(arg));\n }\n }\n return args;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {R3_COMPILE_INJECTABLE} from '../ivy_switch';\nimport {ReflectionCapabilities} from '../reflection/reflection_capabilities';\nimport {Type} from '../type';\nimport {makeDecorator, makeParamDecorator} from '../util/decorators';\nimport {getClosureSafeProperty} from '../util/property';\n\nimport {InjectableDef, InjectableType, defineInjectable} from './defs';\nimport {inject, injectArgs} from './injector';\nimport {ClassSansProvider, ConstructorProvider, ConstructorSansProvider, ExistingProvider, ExistingSansProvider, FactoryProvider, FactorySansProvider, StaticClassProvider, StaticClassSansProvider, ValueProvider, ValueSansProvider} from './provider';\n\nconst GET_PROPERTY_NAME = {} as any;\nconst USE_VALUE = getClosureSafeProperty<ValueProvider>(\n {provide: String, useValue: GET_PROPERTY_NAME}, GET_PROPERTY_NAME);\n\n/**\n * Injectable providers used in `@Injectable` decorator.\n *\n * @experimental\n */\nexport type InjectableProvider = ValueSansProvider | ExistingSansProvider |\n StaticClassSansProvider | ConstructorSansProvider | FactorySansProvider | ClassSansProvider;\n\n/**\n * Type of the Injectable decorator / constructor function.\n */\nexport interface InjectableDecorator {\n /**\n * A marker metadata that marks a class as available to `Injector` for creation.\n *\n * For more details, see the [\"Dependency Injection Guide\"](guide/dependency-injection).\n *\n * @usageNotes\n * ### Example\n *\n * {@example core/di/ts/metadata_spec.ts region='Injectable'}\n *\n * `Injector` will throw an error when trying to instantiate a class that\n * does not have `@Injectable` marker, as shown in the example below.\n *\n * {@example core/di/ts/metadata_spec.ts region='InjectableThrows'}\n *\n */\n (): any;\n (options?: {providedIn: Type<any>| 'root' | null}&InjectableProvider): any;\n new (): Injectable;\n new (options?: {providedIn: Type<any>| 'root' | null}&InjectableProvider): Injectable;\n}\n\n/**\n * Type of the Injectable metadata.\n *\n * @experimental\n */\nexport interface Injectable { providedIn?: Type<any>|'root'|null; }\n\nconst EMPTY_ARRAY: any[] = [];\n\nexport function convertInjectableProviderToFactory(\n type: Type<any>, provider?: InjectableProvider): () => any {\n if (!provider) {\n const reflectionCapabilities = new ReflectionCapabilities();\n const deps = reflectionCapabilities.parameters(type);\n // TODO - convert to flags.\n return () => new type(...injectArgs(deps as any[]));\n }\n\n if (USE_VALUE in provider) {\n const valueProvider = (provider as ValueSansProvider);\n return () => valueProvider.useValue;\n } else if ((provider as ExistingSansProvider).useExisting) {\n const existingProvider = (provider as ExistingSansProvider);\n return () => inject(existingProvider.useExisting);\n } else if ((provider as FactorySansProvider).useFactory) {\n const factoryProvider = (provider as FactorySansProvider);\n return () => factoryProvider.useFactory(...injectArgs(factoryProvider.deps || EMPTY_ARRAY));\n } else if ((provider as StaticClassSansProvider | ClassSansProvider).useClass) {\n const classProvider = (provider as StaticClassSansProvider | ClassSansProvider);\n let deps = (provider as StaticClassSansProvider).deps;\n if (!deps) {\n const reflectionCapabilities = new ReflectionCapabilities();\n deps = reflectionCapabilities.parameters(type);\n }\n return () => new classProvider.useClass(...injectArgs(deps));\n } else {\n let deps = (provider as ConstructorSansProvider).deps;\n if (!deps) {\n const reflectionCapabilities = new ReflectionCapabilities();\n deps = reflectionCapabilities.parameters(type);\n }\n return () => new type(...injectArgs(deps !));\n }\n}\n\n/**\n * Supports @Injectable() in JIT mode for Render2.\n */\nfunction preR3InjectableCompile(\n injectableType: InjectableType<any>,\n options: {providedIn?: Type<any>| 'root' | null} & InjectableProvider): void {\n if (options && options.providedIn !== undefined && injectableType.ngInjectableDef === undefined) {\n injectableType.ngInjectableDef = defineInjectable({\n providedIn: options.providedIn,\n factory: convertInjectableProviderToFactory(injectableType, options),\n });\n }\n}\n\n/**\n* Injectable decorator and metadata.\n*\n* @Annotation\n*/\nexport const Injectable: InjectableDecorator = makeDecorator(\n 'Injectable', undefined, undefined, undefined,\n (type: Type<any>, meta: Injectable) =>\n (R3_COMPILE_INJECTABLE || preR3InjectableCompile)(type, meta));\n\n/**\n * Type representing injectable service.\n *\n * @experimental\n */\nexport interface InjectableType<T> extends Type<T> { ngInjectableDef: InjectableDef<T>; }\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {InjectorDef, InjectorType, defineInjector} from '../di/defs';\nimport {convertInjectableProviderToFactory} from '../di/injectable';\nimport {Provider} from '../di/provider';\nimport {R3_COMPILE_NGMODULE} from '../ivy_switch';\nimport {Type} from '../type';\nimport {TypeDecorator, makeDecorator} from '../util/decorators';\n\n/**\n * Represents the expansion of an `NgModule` into its scopes.\n *\n * A scope is a set of directives and pipes that are visible in a particular context. Each\n * `NgModule` has two scopes. The `compilation` scope is the set of directives and pipes that will\n * be recognized in the templates of components declared by the module. The `exported` scope is the\n * set of directives and pipes exported by a module (that is, module B's exported scope gets added\n * to module A's compilation scope when module A imports B).\n */\nexport interface NgModuleTransitiveScopes {\n compilation: {directives: Set<any>; pipes: Set<any>;};\n exported: {directives: Set<any>; pipes: Set<any>;};\n}\n\n/**\n * A version of {@link NgModuleDef} that represents the runtime type shape only, and excludes\n * metadata parameters.\n */\nexport type NgModuleDefInternal<T> = NgModuleDef<T, any, any, any>;\n\n/**\n * Runtime link information for NgModules.\n *\n * This is the internal data structure used by the runtime to assemble components, directives,\n * pipes, and injectors.\n *\n * NOTE: Always use `defineNgModule` function to create this object,\n * never create the object directly since the shape of this object\n * can change between versions.\n */\nexport interface NgModuleDef<T, Declarations, Imports, Exports> {\n /** Token representing the module. Used by DI. */\n type: T;\n\n /** List of components to bootstrap. */\n bootstrap: Type<any>[];\n\n /** List of components, directives, and pipes declared by this module. */\n declarations: Type<any>[];\n\n /** List of modules or `ModuleWithProviders` imported by this module. */\n imports: Type<any>[];\n\n /**\n * List of modules, `ModuleWithProviders`, components, directives, or pipes exported by this\n * module.\n */\n exports: Type<any>[];\n\n /**\n * Cached value of computed `transitiveCompileScopes` for this module.\n *\n * This should never be read directly, but accessed via `transitiveScopesFor`.\n */\n transitiveCompileScopes: NgModuleTransitiveScopes|null;\n}\n\n/**\n * A wrapper around an NgModule that associates it with the providers.\n *\n * @param T the module type. In Ivy applications, this must be explicitly\n * provided.\n */\nexport interface ModuleWithProviders<T = any> {\n ngModule: Type<T>;\n providers?: Provider[];\n}\n\n/**\n * A schema definition associated with an NgModule.\n * \n * @see `@NgModule`, `CUSTOM_ELEMENTS_SCHEMA`, `NO_ERRORS_SCHEMA`\n * \n * @param name The name of a defined schema.\n *\n * @experimental\n */\nexport interface SchemaMetadata { name: string; }\n\n/**\n * Defines a schema that allows an NgModule to contain the following:\n * - Non-Angular elements named with dash case (`-`).\n * - Element properties named with dash case (`-`).\n * Dash case is the naming convention for custom elements.\n *\n *\n */\nexport const CUSTOM_ELEMENTS_SCHEMA: SchemaMetadata = {\n name: 'custom-elements'\n};\n\n/**\n * Defines a schema that allows any property on any element.\n *\n * @experimental\n */\nexport const NO_ERRORS_SCHEMA: SchemaMetadata = {\n name: 'no-errors-schema'\n};\n\n\n/**\n * Type of the NgModule decorator / constructor function.\n *\n *\n */\nexport interface NgModuleDecorator {\n /**\n * Marks a class as an NgModule and supplies configuration metadata.\n */\n (obj?: NgModule): TypeDecorator;\n new (obj?: NgModule): NgModule;\n}\n\n/**\n * Type of the NgModule metadata.\n *\n *\n */\nexport interface NgModule {\n /**\n * The set of injectable objects that are available in the injector\n * of this module.\n * \n * @see [Dependency Injection guide](guide/dependency-injection)\n * @see [NgModule guide](guide/providers)\n *\n * @usageNotes\n *\n * Dependencies whose providers are listed here become available for injection\n * into any component, directive, pipe or service that is a child of this injector.\n * The NgModule used for bootstrapping uses the root injector, and can provide dependencies\n * to any part of the app.\n * \n * A lazy-loaded module has its own injector, typically a child of the app root injector.\n * Lazy-loaded services are scoped to the lazy-loaded module's injector.\n * If a lazy-loaded module also provides the `UserService`, any component created\n * within that module's context (such as by router navigation) gets the local instance\n * of the service, not the instance in the root injector. \n * Components in external modules continue to receive the instance provided by their injectors.\n * \n * ### Example\n *\n * The following example defines a class that is injected in\n * the HelloWorld NgModule:\n *\n * ```\n * class Greeter {\n * greet(name:string) {\n * return 'Hello ' + name + '!';\n * }\n * }\n *\n * @NgModule({\n * providers: [\n * Greeter\n * ]\n * })\n * class HelloWorld {\n * greeter:Greeter;\n *\n * constructor(greeter:Greeter) {\n * this.greeter = greeter;\n * }\n * }\n * ```\n */\n providers?: Provider[];\n\n /**\n * The set of components, directives, and pipes ([declarables](guide/glossary#declarable))\n * that belong to this module.\n *\n * @usageNotes\n *\n * The set of selectors that are available to a template include those declared here, and\n * those that are exported from imported NgModules.\n *\n * Declarables must belong to exactly one module.\n * The compiler emits an error if you try to declare the same class in more than one module.\n * Be careful not to declare a class that is imported from another module.\n *\n * ### Example\n *\n * The following example allows the CommonModule to use the `NgFor`\n * directive.\n *\n * ```javascript\n * @NgModule({\n * declarations: [NgFor]\n * })\n * class CommonModule {\n * }\n * ```\n */\n declarations?: Array<Type<any>|any[]>;\n\n /**\n * The set of NgModules whose exported [declarables](guide/glossary#declarable)\n * are available to templates in this module.\n *\n * @usageNotes\n *\n * A template can use exported declarables from any\n * imported module, including those from modules that are imported indirectly\n * and re-exported.\n * For example, `ModuleA` imports `ModuleB`, and also exports\n * it, which makes the declarables from `ModuleB` available\n * wherever `ModuleA` is imported.\n *\n * ### Example\n *\n * The following example allows MainModule to use anthing exported by\n * `CommonModule`:\n *\n * ```javascript\n * @NgModule({\n * imports: [CommonModule]\n * })\n * class MainModule {\n * }\n * ```\n *\n */\n imports?: Array<Type<any>|ModuleWithProviders|any[]>;\n\n /**\n * The set of components, directives, and pipes declared in this\n * NgModule that can be used in the template of any component that is part of an\n * NgModule that imports this NgModule. Exported declarations are the module's public API.\n *\n * A declarable belongs to one and only one NgModule.\n * A module can list another module among its exports, in which case all of that module's\n * public declaration are exported.\n *\n * @usageNotes\n *\n * Declarations are private by default.\n * If this ModuleA does not export UserComponent, then only the components within this\n * ModuleA can use UserComponent.\n *\n * ModuleA can import ModuleB and also export it, making exports from ModuleB\n * available to an NgModule that imports ModuleA.\n *\n * ### Example\n *\n * The following example exports the `NgFor` directive from CommonModule.\n *\n * ```javascript\n * @NgModule({\n * exports: [NgFor]\n * })\n * class CommonModule {\n * }\n * ```\n */\n exports?: Array<Type<any>|any[]>;\n\n /**\n * The set of components to compile when this NgModule is defined,\n * so that they can be dynamically loaded into the view.\n *\n * For each component listed here, Angular creates a `ComponentFactory`\n * and stores it in the `ComponentFactoryResolver`.\n *\n * Angular automatically adds components in the module's bootstrap\n * and route definitions into the `entryComponents` list. Use this\n * option to add components that are bootstrapped\n * using one of the imperative techniques, such as `ViewContainerRef.createComponent()`.\n *\n * @see [Entry Components](guide/entry-components)\n */\n entryComponents?: Array<Type<any>|any[]>;\n\n /**\n * The set of components that are bootstrapped when\n * this module is bootstrapped. The components listed here\n * are automatically added to `entryComponents`.\n */\n bootstrap?: Array<Type<any>|any[]>;\n\n /**\n * The set of schemas that declare elements to be allowed in the NgModule.\n * Elements and properties that are neither Angular components nor directives\n * must be declared in a schema.\n *\n * Allowed value are `NO_ERRORS_SCHEMA` and `CUSTOM_ELEMENTS_SCHEMA`.\n *\n * @security When using one of `NO_ERRORS_SCHEMA` or `CUSTOM_ELEMENTS_SCHEMA`\n * you must ensure that allowed elements and properties securely escape inputs.\n */\n schemas?: Array<SchemaMetadata|any[]>;\n\n /**\n * A name or path that uniquely identifies this NgModule in `getModuleFactory`.\n * If left `undefined`, the NgModule is not registered with\n * `getModuleFactory`.\n */\n id?: string;\n\n /**\n * If true, this module will be skipped by the AOT compiler and so will always be compiled\n * using JIT.\n *\n * This exists to support future Ivy work and has no effect currently.\n */\n jit?: true;\n}\n\nfunction preR3NgModuleCompile(moduleType: InjectorType<any>, metadata: NgModule): void {\n let imports = (metadata && metadata.imports) || [];\n if (metadata && metadata.exports) {\n imports = [...imports, metadata.exports];\n }\n\n moduleType.ngInjectorDef = defineInjector({\n factory: convertInjectableProviderToFactory(moduleType, {useClass: moduleType}),\n providers: metadata && metadata.providers,\n imports: imports,\n });\n}\n\n/**\n * @Annotation\n */\nexport const NgModule: NgModuleDecorator = makeDecorator(\n 'NgModule', (ngModule: NgModule) => ngModule, undefined, undefined,\n /**\n * Decorator that marks the following class as an NgModule, and supplies\n * configuration metadata for it.\n *\n * * The `declarations` and `entryComponents` options configure the compiler\n * with information about what belongs to the NgModule.\n * * The `providers` options configures the NgModule's injector to provide\n * dependencies the NgModule members.\n * * The `imports` and `exports` options bring in members from other modules, and make\n * this module's members available to others.\n */\n (type: Type<any>, meta: NgModule) => (R3_COMPILE_NGMODULE || preR3NgModuleCompile)(type, meta));\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * Defines template and style encapsulation options available for Component's {@link Component}.\n *\n * See {@link Component#encapsulation encapsulation}.\n *\n * @usageNotes\n * ### Example\n * {@example core/ts/metadata/encapsulation.ts region='longform'}\n */\nexport enum ViewEncapsulation {\n /**\n * Emulate `Native` scoping of styles by adding an attribute containing surrogate id to the Host\n * Element and pre-processing the style rules provided via {@link Component#styles styles} or\n * {@link Component#styleUrls styleUrls}, and adding the new Host Element attribute to all\n * selectors.\n *\n * This is the default option.\n */\n Emulated = 0,\n /**\n * @deprecated v6.1.0 - use {ViewEncapsulation.ShadowDom} instead.\n * Use the native encapsulation mechanism of the renderer.\n *\n * For the DOM this means using the deprecated [Shadow DOM\n * v0](https://w3c.github.io/webcomponents/spec/shadow/) and\n * creating a ShadowRoot for Component's Host Element.\n */\n Native = 1,\n /**\n * Don't provide any template or style encapsulation.\n */\n None = 2,\n\n /**\n * Use Shadow DOM to encapsulate styles.\n *\n * For the DOM this means using modern [Shadow\n * DOM](https://w3c.github.io/webcomponents/spec/shadow/) and\n * creating a ShadowRoot for Component's Host Element.\n */\n ShadowDom = 3\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * This indirection is needed to free up Component, etc symbols in the public API\n * to be used by the decorator versions of these annotations.\n */\n\nimport {Attribute, ContentChild, ContentChildren, Query, ViewChild, ViewChildren} from './metadata/di';\nimport {Component, Directive, HostBinding, HostListener, Input, Output, Pipe} from './metadata/directives';\nimport {ModuleWithProviders, NgModule, SchemaMetadata} from './metadata/ng_module';\nimport {ViewEncapsulation} from './metadata/view';\n\nexport {ANALYZE_FOR_ENTRY_COMPONENTS, Attribute, ContentChild, ContentChildDecorator, ContentChildren, ContentChildrenDecorator, Query, ViewChild, ViewChildDecorator, ViewChildren, ViewChildrenDecorator} from './metadata/di';\nexport {Component, ComponentDecorator, Directive, DirectiveDecorator, HostBinding, HostListener, Input, Output, Pipe} from './metadata/directives';\nexport {AfterContentChecked, AfterContentInit, AfterViewChecked, AfterViewInit, DoCheck, OnChanges, OnDestroy, OnInit} from './metadata/lifecycle_hooks';\nexport {CUSTOM_ELEMENTS_SCHEMA, ModuleWithProviders, NO_ERRORS_SCHEMA, NgModule, SchemaMetadata} from './metadata/ng_module';\nexport {ViewEncapsulation} from './metadata/view';\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @description Represents the version of Angular\n *\n *\n */\nexport class Version {\n public readonly major: string;\n public readonly minor: string;\n public readonly patch: string;\n\n constructor(public full: string) {\n this.major = full.split('.')[0];\n this.minor = full.split('.')[1];\n this.patch = full.split('.').slice(2).join('.');\n }\n}\n\nexport const VERSION = new Version('6.1.9');\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {DebugContext} from './view';\n\nexport const ERROR_TYPE = 'ngType';\nexport const ERROR_DEBUG_CONTEXT = 'ngDebugContext';\nexport const ERROR_ORIGINAL_ERROR = 'ngOriginalError';\nexport const ERROR_LOGGER = 'ngErrorLogger';\n\n\nexport function getType(error: Error): Function {\n return (error as any)[ERROR_TYPE];\n}\n\nexport function getDebugContext(error: Error): DebugContext {\n return (error as any)[ERROR_DEBUG_CONTEXT];\n}\n\nexport function getOriginalError(error: Error): Error {\n return (error as any)[ERROR_ORIGINAL_ERROR];\n}\n\nexport function getErrorLogger(error: Error): (console: Console, ...values: any[]) => void {\n return (error as any)[ERROR_LOGGER] || defaultErrorLogger;\n}\n\n\nfunction defaultErrorLogger(console: Console, ...values: any[]) {\n (<any>console.error)(...values);\n}","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ERROR_ORIGINAL_ERROR, getDebugContext, getErrorLogger, getOriginalError} from './errors';\n\n\n\n/**\n * Provides a hook for centralized exception handling.\n *\n * The default implementation of `ErrorHandler` prints error messages to the `console`. To\n * intercept error handling, write a custom exception handler that replaces this default as\n * appropriate for your app.\n *\n * @usageNotes\n * ### Example\n *\n * ```\n * class MyErrorHandler implements ErrorHandler {\n * handleError(error) {\n * // do something with the exception\n * }\n * }\n *\n * @NgModule({\n * providers: [{provide: ErrorHandler, useClass: MyErrorHandler}]\n * })\n * class MyModule {}\n * ```\n */\nexport class ErrorHandler {\n /**\n * @internal\n */\n _console: Console = console;\n\n handleError(error: any): void {\n const originalError = this._findOriginalError(error);\n const context = this._findContext(error);\n // Note: Browser consoles show the place from where console.error was called.\n // We can use this to give users additional information about the error.\n const errorLogger = getErrorLogger(error);\n\n errorLogger(this._console, `ERROR`, error);\n if (originalError) {\n errorLogger(this._console, `ORIGINAL ERROR`, originalError);\n }\n if (context) {\n errorLogger(this._console, 'ERROR CONTEXT', context);\n }\n }\n\n /** @internal */\n _findContext(error: any): any {\n if (error) {\n return getDebugContext(error) ? getDebugContext(error) :\n this._findContext(getOriginalError(error));\n }\n\n return null;\n }\n\n /** @internal */\n _findOriginalError(error: Error): any {\n let e = getOriginalError(error);\n while (e && getOriginalError(e)) {\n e = getOriginalError(e);\n }\n\n return e;\n }\n}\n\nexport function wrappedError(message: string, originalError: any): Error {\n const msg =\n `${message} caused by: ${originalError instanceof Error ? originalError.message: originalError }`;\n const error = Error(msg);\n (error as any)[ERROR_ORIGINAL_ERROR] = originalError;\n return error;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {wrappedError} from '../error_handler';\nimport {ERROR_ORIGINAL_ERROR, getOriginalError} from '../errors';\nimport {Type} from '../type';\nimport {stringify} from '../util';\n\nimport {ReflectiveInjector} from './reflective_injector';\nimport {ReflectiveKey} from './reflective_key';\n\nfunction findFirstClosedCycle(keys: any[]): any[] {\n const res: any[] = [];\n for (let i = 0; i < keys.length; ++i) {\n if (res.indexOf(keys[i]) > -1) {\n res.push(keys[i]);\n return res;\n }\n res.push(keys[i]);\n }\n return res;\n}\n\nfunction constructResolvingPath(keys: any[]): string {\n if (keys.length > 1) {\n const reversed = findFirstClosedCycle(keys.slice().reverse());\n const tokenStrs = reversed.map(k => stringify(k.token));\n return ' (' + tokenStrs.join(' -> ') + ')';\n }\n\n return '';\n}\n\nexport interface InjectionError extends Error {\n keys: ReflectiveKey[];\n injectors: ReflectiveInjector[];\n constructResolvingMessage: (keys: ReflectiveKey[]) => string;\n addKey(injector: ReflectiveInjector, key: ReflectiveKey): void;\n}\n\nfunction injectionError(\n injector: ReflectiveInjector, key: ReflectiveKey,\n constructResolvingMessage: (keys: ReflectiveKey[]) => string,\n originalError?: Error): InjectionError {\n const keys = [key];\n const errMsg = constructResolvingMessage(keys);\n const error =\n (originalError ? wrappedError(errMsg, originalError) : Error(errMsg)) as InjectionError;\n error.addKey = addKey;\n error.keys = keys;\n error.injectors = [injector];\n error.constructResolvingMessage = constructResolvingMessage;\n (error as any)[ERROR_ORIGINAL_ERROR] = originalError;\n return error;\n}\n\nfunction addKey(this: InjectionError, injector: ReflectiveInjector, key: ReflectiveKey): void {\n this.injectors.push(injector);\n this.keys.push(key);\n // Note: This updated message won't be reflected in the `.stack` property\n this.message = this.constructResolvingMessage(this.keys);\n}\n\n/**\n * Thrown when trying to retrieve a dependency by key from {@link Injector}, but the\n * {@link Injector} does not have a {@link Provider} for the given key.\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * class A {\n * constructor(b:B) {}\n * }\n *\n * expect(() => Injector.resolveAndCreate([A])).toThrowError();\n * ```\n */\nexport function noProviderError(injector: ReflectiveInjector, key: ReflectiveKey): InjectionError {\n return injectionError(injector, key, function(keys: ReflectiveKey[]) {\n const first = stringify(keys[0].token);\n return `No provider for ${first}!${constructResolvingPath(keys)}`;\n });\n}\n\n/**\n * Thrown when dependencies form a cycle.\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * var injector = Injector.resolveAndCreate([\n * {provide: \"one\", useFactory: (two) => \"two\", deps: [[new Inject(\"two\")]]},\n * {provide: \"two\", useFactory: (one) => \"one\", deps: [[new Inject(\"one\")]]}\n * ]);\n *\n * expect(() => injector.get(\"one\")).toThrowError();\n * ```\n *\n * Retrieving `A` or `B` throws a `CyclicDependencyError` as the graph above cannot be constructed.\n */\nexport function cyclicDependencyError(\n injector: ReflectiveInjector, key: ReflectiveKey): InjectionError {\n return injectionError(injector, key, function(keys: ReflectiveKey[]) {\n return `Cannot instantiate cyclic dependency!${constructResolvingPath(keys)}`;\n });\n}\n\n/**\n * Thrown when a constructing type returns with an Error.\n *\n * The `InstantiationError` class contains the original error plus the dependency graph which caused\n * this object to be instantiated.\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * class A {\n * constructor() {\n * throw new Error('message');\n * }\n * }\n *\n * var injector = Injector.resolveAndCreate([A]);\n\n * try {\n * injector.get(A);\n * } catch (e) {\n * expect(e instanceof InstantiationError).toBe(true);\n * expect(e.originalException.message).toEqual(\"message\");\n * expect(e.originalStack).toBeDefined();\n * }\n * ```\n */\nexport function instantiationError(\n injector: ReflectiveInjector, originalException: any, originalStack: any,\n key: ReflectiveKey): InjectionError {\n return injectionError(injector, key, function(keys: ReflectiveKey[]) {\n const first = stringify(keys[0].token);\n return `${originalException.message}: Error during instantiation of ${first}!${constructResolvingPath(keys)}.`;\n }, originalException);\n}\n\n/**\n * Thrown when an object other then {@link Provider} (or `Type`) is passed to {@link Injector}\n * creation.\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * expect(() => Injector.resolveAndCreate([\"not a type\"])).toThrowError();\n * ```\n */\nexport function invalidProviderError(provider: any) {\n return Error(\n `Invalid provider - only instances of Provider and Type are allowed, got: ${provider}`);\n}\n\n/**\n * Thrown when the class has no annotation information.\n *\n * Lack of annotation information prevents the {@link Injector} from determining which dependencies\n * need to be injected into the constructor.\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * class A {\n * constructor(b) {}\n * }\n *\n * expect(() => Injector.resolveAndCreate([A])).toThrowError();\n * ```\n *\n * This error is also thrown when the class not marked with {@link Injectable} has parameter types.\n *\n * ```typescript\n * class B {}\n *\n * class A {\n * constructor(b:B) {} // no information about the parameter types of A is available at runtime.\n * }\n *\n * expect(() => Injector.resolveAndCreate([A,B])).toThrowError();\n * ```\n *\n */\nexport function noAnnotationError(typeOrFunc: Type<any>| Function, params: any[][]): Error {\n const signature: string[] = [];\n for (let i = 0, ii = params.length; i < ii; i++) {\n const parameter = params[i];\n if (!parameter || parameter.length == 0) {\n signature.push('?');\n } else {\n signature.push(parameter.map(stringify).join(' '));\n }\n }\n return Error(\n 'Cannot resolve all parameters for \\'' + stringify(typeOrFunc) + '\\'(' +\n signature.join(', ') + '). ' +\n 'Make sure that all the parameters are decorated with Inject or have valid type annotations and that \\'' +\n stringify(typeOrFunc) + '\\' is decorated with Injectable.');\n}\n\n/**\n * Thrown when getting an object by index.\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * class A {}\n *\n * var injector = Injector.resolveAndCreate([A]);\n *\n * expect(() => injector.getAt(100)).toThrowError();\n * ```\n *\n */\nexport function outOfBoundsError(index: number) {\n return Error(`Index ${index} is out-of-bounds.`);\n}\n\n// TODO: add a working example after alpha38 is released\n/**\n * Thrown when a multi provider and a regular provider are bound to the same token.\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * expect(() => Injector.resolveAndCreate([\n * { provide: \"Strings\", useValue: \"string1\", multi: true},\n * { provide: \"Strings\", useValue: \"string2\", multi: false}\n * ])).toThrowError();\n * ```\n */\nexport function mixingMultiProvidersWithRegularProvidersError(\n provider1: any, provider2: any): Error {\n return Error(`Cannot mix multi providers and regular providers, got: ${provider1} ${provider2}`);\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {stringify} from '../util';\nimport {resolveForwardRef} from './forward_ref';\n\n\n/**\n * A unique object used for retrieving items from the {@link ReflectiveInjector}.\n *\n * Keys have:\n * - a system-wide unique `id`.\n * - a `token`.\n *\n * `Key` is used internally by {@link ReflectiveInjector} because its system-wide unique `id` allows\n * the\n * injector to store created objects in a more efficient way.\n *\n * `Key` should not be created directly. {@link ReflectiveInjector} creates keys automatically when\n * resolving\n * providers.\n * @deprecated No replacement\n */\nexport class ReflectiveKey {\n public readonly displayName: string;\n /**\n * Private\n */\n constructor(public token: Object, public id: number) {\n if (!token) {\n throw new Error('Token must be defined!');\n }\n this.displayName = stringify(this.token);\n }\n\n /**\n * Retrieves a `Key` for a token.\n */\n static get(token: Object): ReflectiveKey {\n return _globalKeyRegistry.get(resolveForwardRef(token));\n }\n\n /**\n * @returns the number of keys registered in the system.\n */\n static get numberOfKeys(): number { return _globalKeyRegistry.numberOfKeys; }\n}\n\nexport class KeyRegistry {\n private _allKeys = new Map<Object, ReflectiveKey>();\n\n get(token: Object): ReflectiveKey {\n if (token instanceof ReflectiveKey) return token;\n\n if (this._allKeys.has(token)) {\n return this._allKeys.get(token) !;\n }\n\n const newKey = new ReflectiveKey(token, ReflectiveKey.numberOfKeys);\n this._allKeys.set(token, newKey);\n return newKey;\n }\n\n get numberOfKeys(): number { return this._allKeys.size; }\n}\n\nconst _globalKeyRegistry = new KeyRegistry();\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Type} from '../type';\nimport {PlatformReflectionCapabilities} from './platform_reflection_capabilities';\nimport {GetterFn, MethodFn, SetterFn} from './types';\n\nexport {PlatformReflectionCapabilities};\nexport {GetterFn, MethodFn, SetterFn};\n\n/**\n * Provides access to reflection data about symbols. Used internally by Angular\n * to power dependency injection and compilation.\n */\nexport class Reflector {\n constructor(public reflectionCapabilities: PlatformReflectionCapabilities) {}\n\n updateCapabilities(caps: PlatformReflectionCapabilities) { this.reflectionCapabilities = caps; }\n\n factory(type: Type<any>): Function { return this.reflectionCapabilities.factory(type); }\n\n parameters(typeOrFunc: Type<any>): any[][] {\n return this.reflectionCapabilities.parameters(typeOrFunc);\n }\n\n annotations(typeOrFunc: Type<any>): any[] {\n return this.reflectionCapabilities.annotations(typeOrFunc);\n }\n\n propMetadata(typeOrFunc: Type<any>): {[key: string]: any[]} {\n return this.reflectionCapabilities.propMetadata(typeOrFunc);\n }\n\n hasLifecycleHook(type: any, lcProperty: string): boolean {\n return this.reflectionCapabilities.hasLifecycleHook(type, lcProperty);\n }\n\n getter(name: string): GetterFn { return this.reflectionCapabilities.getter(name); }\n\n setter(name: string): SetterFn { return this.reflectionCapabilities.setter(name); }\n\n method(name: string): MethodFn { return this.reflectionCapabilities.method(name); }\n\n importUri(type: any): string { return this.reflectionCapabilities.importUri(type); }\n\n resourceUri(type: any): string { return this.reflectionCapabilities.resourceUri(type); }\n\n resolveIdentifier(name: string, moduleUrl: string, members: string[], runtime: any): any {\n return this.reflectionCapabilities.resolveIdentifier(name, moduleUrl, members, runtime);\n }\n\n resolveEnum(identifier: any, name: string): any {\n return this.reflectionCapabilities.resolveEnum(identifier, name);\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ReflectionCapabilities} from './reflection_capabilities';\nimport {Reflector} from './reflector';\n\nexport {Reflector} from './reflector';\n\n/**\n * The {@link Reflector} used internally in Angular to access metadata\n * about symbols.\n */\nexport const reflector = new Reflector(new ReflectionCapabilities());\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {reflector} from '../reflection/reflection';\nimport {Type} from '../type';\n\nimport {resolveForwardRef} from './forward_ref';\nimport {InjectionToken} from './injection_token';\nimport {Inject, Optional, Self, SkipSelf} from './metadata';\nimport {ClassProvider, ExistingProvider, FactoryProvider, Provider, TypeProvider, ValueProvider} from './provider';\nimport {invalidProviderError, mixingMultiProvidersWithRegularProvidersError, noAnnotationError} from './reflective_errors';\nimport {ReflectiveKey} from './reflective_key';\n\n\ninterface NormalizedProvider extends TypeProvider, ValueProvider, ClassProvider, ExistingProvider,\n FactoryProvider {}\n\n/**\n * `Dependency` is used by the framework to extend DI.\n * This is internal to Angular and should not be used directly.\n */\nexport class ReflectiveDependency {\n constructor(\n public key: ReflectiveKey, public optional: boolean, public visibility: Self|SkipSelf|null) {}\n\n static fromKey(key: ReflectiveKey): ReflectiveDependency {\n return new ReflectiveDependency(key, false, null);\n }\n}\n\nconst _EMPTY_LIST: any[] = [];\n\n/**\n * An internal resolved representation of a `Provider` used by the `Injector`.\n *\n * @usageNotes\n * This is usually created automatically by `Injector.resolveAndCreate`.\n *\n * It can be created manually, as follows:\n *\n * ### Example\n *\n * ```typescript\n * var resolvedProviders = Injector.resolve([{ provide: 'message', useValue: 'Hello' }]);\n * var injector = Injector.fromResolvedProviders(resolvedProviders);\n *\n * expect(injector.get('message')).toEqual('Hello');\n * ```\n *\n * @experimental\n */\nexport interface ResolvedReflectiveProvider {\n /**\n * A key, usually a `Type<any>`.\n */\n key: ReflectiveKey;\n\n /**\n * Factory function which can return an instance of an object represented by a key.\n */\n resolvedFactories: ResolvedReflectiveFactory[];\n\n /**\n * Indicates if the provider is a multi-provider or a regular provider.\n */\n multiProvider: boolean;\n}\n\nexport class ResolvedReflectiveProvider_ implements ResolvedReflectiveProvider {\n readonly resolvedFactory: ResolvedReflectiveFactory;\n\n constructor(\n public key: ReflectiveKey, public resolvedFactories: ResolvedReflectiveFactory[],\n public multiProvider: boolean) {\n this.resolvedFactory = this.resolvedFactories[0];\n }\n}\n\n/**\n * An internal resolved representation of a factory function created by resolving `Provider`.\n * @experimental\n */\nexport class ResolvedReflectiveFactory {\n constructor(\n /**\n * Factory function which can return an instance of an object represented by a key.\n */\n public factory: Function,\n\n /**\n * Arguments (dependencies) to the `factory` function.\n */\n public dependencies: ReflectiveDependency[]) {}\n}\n\n\n/**\n * Resolve a single provider.\n */\nfunction resolveReflectiveFactory(provider: NormalizedProvider): ResolvedReflectiveFactory {\n let factoryFn: Function;\n let resolvedDeps: ReflectiveDependency[];\n if (provider.useClass) {\n const useClass = resolveForwardRef(provider.useClass);\n factoryFn = reflector.factory(useClass);\n resolvedDeps = _dependenciesFor(useClass);\n } else if (provider.useExisting) {\n factoryFn = (aliasInstance: any) => aliasInstance;\n resolvedDeps = [ReflectiveDependency.fromKey(ReflectiveKey.get(provider.useExisting))];\n } else if (provider.useFactory) {\n factoryFn = provider.useFactory;\n resolvedDeps = constructDependencies(provider.useFactory, provider.deps);\n } else {\n factoryFn = () => provider.useValue;\n resolvedDeps = _EMPTY_LIST;\n }\n return new ResolvedReflectiveFactory(factoryFn, resolvedDeps);\n}\n\n/**\n * Converts the `Provider` into `ResolvedProvider`.\n *\n * `Injector` internally only uses `ResolvedProvider`, `Provider` contains convenience provider\n * syntax.\n */\nfunction resolveReflectiveProvider(provider: NormalizedProvider): ResolvedReflectiveProvider {\n return new ResolvedReflectiveProvider_(\n ReflectiveKey.get(provider.provide), [resolveReflectiveFactory(provider)],\n provider.multi || false);\n}\n\n/**\n * Resolve a list of Providers.\n */\nexport function resolveReflectiveProviders(providers: Provider[]): ResolvedReflectiveProvider[] {\n const normalized = _normalizeProviders(providers, []);\n const resolved = normalized.map(resolveReflectiveProvider);\n const resolvedProviderMap = mergeResolvedReflectiveProviders(resolved, new Map());\n return Array.from(resolvedProviderMap.values());\n}\n\n/**\n * Merges a list of ResolvedProviders into a list where each key is contained exactly once and\n * multi providers have been merged.\n */\nexport function mergeResolvedReflectiveProviders(\n providers: ResolvedReflectiveProvider[],\n normalizedProvidersMap: Map<number, ResolvedReflectiveProvider>):\n Map<number, ResolvedReflectiveProvider> {\n for (let i = 0; i < providers.length; i++) {\n const provider = providers[i];\n const existing = normalizedProvidersMap.get(provider.key.id);\n if (existing) {\n if (provider.multiProvider !== existing.multiProvider) {\n throw mixingMultiProvidersWithRegularProvidersError(existing, provider);\n }\n if (provider.multiProvider) {\n for (let j = 0; j < provider.resolvedFactories.length; j++) {\n existing.resolvedFactories.push(provider.resolvedFactories[j]);\n }\n } else {\n normalizedProvidersMap.set(provider.key.id, provider);\n }\n } else {\n let resolvedProvider: ResolvedReflectiveProvider;\n if (provider.multiProvider) {\n resolvedProvider = new ResolvedReflectiveProvider_(\n provider.key, provider.resolvedFactories.slice(), provider.multiProvider);\n } else {\n resolvedProvider = provider;\n }\n normalizedProvidersMap.set(provider.key.id, resolvedProvider);\n }\n }\n return normalizedProvidersMap;\n}\n\nfunction _normalizeProviders(providers: Provider[], res: Provider[]): Provider[] {\n providers.forEach(b => {\n if (b instanceof Type) {\n res.push({provide: b, useClass: b});\n\n } else if (b && typeof b == 'object' && (b as any).provide !== undefined) {\n res.push(b as NormalizedProvider);\n\n } else if (b instanceof Array) {\n _normalizeProviders(b, res);\n\n } else {\n throw invalidProviderError(b);\n }\n });\n\n return res;\n}\n\nexport function constructDependencies(\n typeOrFunc: any, dependencies?: any[]): ReflectiveDependency[] {\n if (!dependencies) {\n return _dependenciesFor(typeOrFunc);\n } else {\n const params: any[][] = dependencies.map(t => [t]);\n return dependencies.map(t => _extractToken(typeOrFunc, t, params));\n }\n}\n\nfunction _dependenciesFor(typeOrFunc: any): ReflectiveDependency[] {\n const params = reflector.parameters(typeOrFunc);\n\n if (!params) return [];\n if (params.some(p => p == null)) {\n throw noAnnotationError(typeOrFunc, params);\n }\n return params.map(p => _extractToken(typeOrFunc, p, params));\n}\n\nfunction _extractToken(\n typeOrFunc: any, metadata: any[] | any, params: any[][]): ReflectiveDependency {\n let token: any = null;\n let optional = false;\n\n if (!Array.isArray(metadata)) {\n if (metadata instanceof Inject) {\n return _createDependency(metadata.token, optional, null);\n } else {\n return _createDependency(metadata, optional, null);\n }\n }\n\n let visibility: Self|SkipSelf|null = null;\n\n for (let i = 0; i < metadata.length; ++i) {\n const paramMetadata = metadata[i];\n\n if (paramMetadata instanceof Type) {\n token = paramMetadata;\n\n } else if (paramMetadata instanceof Inject) {\n token = paramMetadata.token;\n\n } else if (paramMetadata instanceof Optional) {\n optional = true;\n\n } else if (paramMetadata instanceof Self || paramMetadata instanceof SkipSelf) {\n visibility = paramMetadata;\n } else if (paramMetadata instanceof InjectionToken) {\n token = paramMetadata;\n }\n }\n\n token = resolveForwardRef(token);\n\n if (token != null) {\n return _createDependency(token, optional, visibility);\n } else {\n throw noAnnotationError(typeOrFunc, params);\n }\n}\n\nfunction _createDependency(\n token: any, optional: boolean, visibility: Self | SkipSelf | null): ReflectiveDependency {\n return new ReflectiveDependency(ReflectiveKey.get(token), optional, visibility);\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Injector, THROW_IF_NOT_FOUND} from './injector';\nimport {Self, SkipSelf} from './metadata';\nimport {Provider} from './provider';\nimport {cyclicDependencyError, instantiationError, noProviderError, outOfBoundsError} from './reflective_errors';\nimport {ReflectiveKey} from './reflective_key';\nimport {ReflectiveDependency, ResolvedReflectiveFactory, ResolvedReflectiveProvider, resolveReflectiveProviders} from './reflective_provider';\n\n// Threshold for the dynamic version\nconst UNDEFINED = new Object();\n\n/**\n * A ReflectiveDependency injection container used for instantiating objects and resolving\n * dependencies.\n *\n * An `Injector` is a replacement for a `new` operator, which can automatically resolve the\n * constructor dependencies.\n *\n * In typical use, application code asks for the dependencies in the constructor and they are\n * resolved by the `Injector`.\n *\n * @usageNotes\n * ### Example\n *\n * The following example creates an `Injector` configured to create `Engine` and `Car`.\n *\n * ```typescript\n * @Injectable()\n * class Engine {\n * }\n *\n * @Injectable()\n * class Car {\n * constructor(public engine:Engine) {}\n * }\n *\n * var injector = ReflectiveInjector.resolveAndCreate([Car, Engine]);\n * var car = injector.get(Car);\n * expect(car instanceof Car).toBe(true);\n * expect(car.engine instanceof Engine).toBe(true);\n * ```\n *\n * Notice, we don't use the `new` operator because we explicitly want to have the `Injector`\n * resolve all of the object's dependencies automatically.\n *\n * @deprecated from v5 - slow and brings in a lot of code, Use `Injector.create` instead.\n */\nexport abstract class ReflectiveInjector implements Injector {\n /**\n * Turns an array of provider definitions into an array of resolved providers.\n *\n * A resolution is a process of flattening multiple nested arrays and converting individual\n * providers into an array of `ResolvedReflectiveProvider`s.\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * @Injectable()\n * class Engine {\n * }\n *\n * @Injectable()\n * class Car {\n * constructor(public engine:Engine) {}\n * }\n *\n * var providers = ReflectiveInjector.resolve([Car, [[Engine]]]);\n *\n * expect(providers.length).toEqual(2);\n *\n * expect(providers[0] instanceof ResolvedReflectiveProvider).toBe(true);\n * expect(providers[0].key.displayName).toBe(\"Car\");\n * expect(providers[0].dependencies.length).toEqual(1);\n * expect(providers[0].factory).toBeDefined();\n *\n * expect(providers[1].key.displayName).toBe(\"Engine\");\n * });\n * ```\n *\n */\n static resolve(providers: Provider[]): ResolvedReflectiveProvider[] {\n return resolveReflectiveProviders(providers);\n }\n\n /**\n * Resolves an array of providers and creates an injector from those providers.\n *\n * The passed-in providers can be an array of `Type`, `Provider`,\n * or a recursive array of more providers.\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * @Injectable()\n * class Engine {\n * }\n *\n * @Injectable()\n * class Car {\n * constructor(public engine:Engine) {}\n * }\n *\n * var injector = ReflectiveInjector.resolveAndCreate([Car, Engine]);\n * expect(injector.get(Car) instanceof Car).toBe(true);\n * ```\n */\n static resolveAndCreate(providers: Provider[], parent?: Injector): ReflectiveInjector {\n const ResolvedReflectiveProviders = ReflectiveInjector.resolve(providers);\n return ReflectiveInjector.fromResolvedProviders(ResolvedReflectiveProviders, parent);\n }\n\n /**\n * Creates an injector from previously resolved providers.\n *\n * This API is the recommended way to construct injectors in performance-sensitive parts.\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * @Injectable()\n * class Engine {\n * }\n *\n * @Injectable()\n * class Car {\n * constructor(public engine:Engine) {}\n * }\n *\n * var providers = ReflectiveInjector.resolve([Car, Engine]);\n * var injector = ReflectiveInjector.fromResolvedProviders(providers);\n * expect(injector.get(Car) instanceof Car).toBe(true);\n * ```\n * @experimental\n */\n static fromResolvedProviders(providers: ResolvedReflectiveProvider[], parent?: Injector):\n ReflectiveInjector {\n return new ReflectiveInjector_(providers, parent);\n }\n\n\n /**\n * Parent of this injector.\n *\n * <!-- TODO: Add a link to the section of the user guide talking about hierarchical injection.\n * -->\n */\n abstract get parent(): Injector|null;\n\n /**\n * Resolves an array of providers and creates a child injector from those providers.\n *\n * <!-- TODO: Add a link to the section of the user guide talking about hierarchical injection.\n * -->\n *\n * The passed-in providers can be an array of `Type`, `Provider`,\n * or a recursive array of more providers.\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * class ParentProvider {}\n * class ChildProvider {}\n *\n * var parent = ReflectiveInjector.resolveAndCreate([ParentProvider]);\n * var child = parent.resolveAndCreateChild([ChildProvider]);\n *\n * expect(child.get(ParentProvider) instanceof ParentProvider).toBe(true);\n * expect(child.get(ChildProvider) instanceof ChildProvider).toBe(true);\n * expect(child.get(ParentProvider)).toBe(parent.get(ParentProvider));\n * ```\n */\n abstract resolveAndCreateChild(providers: Provider[]): ReflectiveInjector;\n\n /**\n * Creates a child injector from previously resolved providers.\n *\n * <!-- TODO: Add a link to the section of the user guide talking about hierarchical injection.\n * -->\n *\n * This API is the recommended way to construct injectors in performance-sensitive parts.\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * class ParentProvider {}\n * class ChildProvider {}\n *\n * var parentProviders = ReflectiveInjector.resolve([ParentProvider]);\n * var childProviders = ReflectiveInjector.resolve([ChildProvider]);\n *\n * var parent = ReflectiveInjector.fromResolvedProviders(parentProviders);\n * var child = parent.createChildFromResolved(childProviders);\n *\n * expect(child.get(ParentProvider) instanceof ParentProvider).toBe(true);\n * expect(child.get(ChildProvider) instanceof ChildProvider).toBe(true);\n * expect(child.get(ParentProvider)).toBe(parent.get(ParentProvider));\n * ```\n */\n abstract createChildFromResolved(providers: ResolvedReflectiveProvider[]): ReflectiveInjector;\n\n /**\n * Resolves a provider and instantiates an object in the context of the injector.\n *\n * The created object does not get cached by the injector.\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * @Injectable()\n * class Engine {\n * }\n *\n * @Injectable()\n * class Car {\n * constructor(public engine:Engine) {}\n * }\n *\n * var injector = ReflectiveInjector.resolveAndCreate([Engine]);\n *\n * var car = injector.resolveAndInstantiate(Car);\n * expect(car.engine).toBe(injector.get(Engine));\n * expect(car).not.toBe(injector.resolveAndInstantiate(Car));\n * ```\n */\n abstract resolveAndInstantiate(provider: Provider): any;\n\n /**\n * Instantiates an object using a resolved provider in the context of the injector.\n *\n * The created object does not get cached by the injector.\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * @Injectable()\n * class Engine {\n * }\n *\n * @Injectable()\n * class Car {\n * constructor(public engine:Engine) {}\n * }\n *\n * var injector = ReflectiveInjector.resolveAndCreate([Engine]);\n * var carProvider = ReflectiveInjector.resolve([Car])[0];\n * var car = injector.instantiateResolved(carProvider);\n * expect(car.engine).toBe(injector.get(Engine));\n * expect(car).not.toBe(injector.instantiateResolved(carProvider));\n * ```\n */\n abstract instantiateResolved(provider: ResolvedReflectiveProvider): any;\n\n abstract get(token: any, notFoundValue?: any): any;\n}\n\nexport class ReflectiveInjector_ implements ReflectiveInjector {\n private static INJECTOR_KEY = ReflectiveKey.get(Injector);\n /** @internal */\n _constructionCounter: number = 0;\n /** @internal */\n public _providers: ResolvedReflectiveProvider[];\n public readonly parent: Injector|null;\n\n keyIds: number[];\n objs: any[];\n /**\n * Private\n */\n constructor(_providers: ResolvedReflectiveProvider[], _parent?: Injector) {\n this._providers = _providers;\n this.parent = _parent || null;\n\n const len = _providers.length;\n\n this.keyIds = new Array(len);\n this.objs = new Array(len);\n\n for (let i = 0; i < len; i++) {\n this.keyIds[i] = _providers[i].key.id;\n this.objs[i] = UNDEFINED;\n }\n }\n\n get(token: any, notFoundValue: any = THROW_IF_NOT_FOUND): any {\n return this._getByKey(ReflectiveKey.get(token), null, notFoundValue);\n }\n\n resolveAndCreateChild(providers: Provider[]): ReflectiveInjector {\n const ResolvedReflectiveProviders = ReflectiveInjector.resolve(providers);\n return this.createChildFromResolved(ResolvedReflectiveProviders);\n }\n\n createChildFromResolved(providers: ResolvedReflectiveProvider[]): ReflectiveInjector {\n const inj = new ReflectiveInjector_(providers);\n (inj as{parent: Injector | null}).parent = this;\n return inj;\n }\n\n resolveAndInstantiate(provider: Provider): any {\n return this.instantiateResolved(ReflectiveInjector.resolve([provider])[0]);\n }\n\n instantiateResolved(provider: ResolvedReflectiveProvider): any {\n return this._instantiateProvider(provider);\n }\n\n getProviderAtIndex(index: number): ResolvedReflectiveProvider {\n if (index < 0 || index >= this._providers.length) {\n throw outOfBoundsError(index);\n }\n return this._providers[index];\n }\n\n /** @internal */\n _new(provider: ResolvedReflectiveProvider): any {\n if (this._constructionCounter++ > this._getMaxNumberOfObjects()) {\n throw cyclicDependencyError(this, provider.key);\n }\n return this._instantiateProvider(provider);\n }\n\n private _getMaxNumberOfObjects(): number { return this.objs.length; }\n\n private _instantiateProvider(provider: ResolvedReflectiveProvider): any {\n if (provider.multiProvider) {\n const res = new Array(provider.resolvedFactories.length);\n for (let i = 0; i < provider.resolvedFactories.length; ++i) {\n res[i] = this._instantiate(provider, provider.resolvedFactories[i]);\n }\n return res;\n } else {\n return this._instantiate(provider, provider.resolvedFactories[0]);\n }\n }\n\n private _instantiate(\n provider: ResolvedReflectiveProvider,\n ResolvedReflectiveFactory: ResolvedReflectiveFactory): any {\n const factory = ResolvedReflectiveFactory.factory;\n\n let deps: any[];\n try {\n deps =\n ResolvedReflectiveFactory.dependencies.map(dep => this._getByReflectiveDependency(dep));\n } catch (e) {\n if (e.addKey) {\n e.addKey(this, provider.key);\n }\n throw e;\n }\n\n let obj: any;\n try {\n obj = factory(...deps);\n } catch (e) {\n throw instantiationError(this, e, e.stack, provider.key);\n }\n\n return obj;\n }\n\n private _getByReflectiveDependency(dep: ReflectiveDependency): any {\n return this._getByKey(dep.key, dep.visibility, dep.optional ? null : THROW_IF_NOT_FOUND);\n }\n\n private _getByKey(key: ReflectiveKey, visibility: Self|SkipSelf|null, notFoundValue: any): any {\n if (key === ReflectiveInjector_.INJECTOR_KEY) {\n return this;\n }\n\n if (visibility instanceof Self) {\n return this._getByKeySelf(key, notFoundValue);\n\n } else {\n return this._getByKeyDefault(key, notFoundValue, visibility);\n }\n }\n\n private _getObjByKeyId(keyId: number): any {\n for (let i = 0; i < this.keyIds.length; i++) {\n if (this.keyIds[i] === keyId) {\n if (this.objs[i] === UNDEFINED) {\n this.objs[i] = this._new(this._providers[i]);\n }\n\n return this.objs[i];\n }\n }\n\n return UNDEFINED;\n }\n\n /** @internal */\n _throwOrNull(key: ReflectiveKey, notFoundValue: any): any {\n if (notFoundValue !== THROW_IF_NOT_FOUND) {\n return notFoundValue;\n } else {\n throw noProviderError(this, key);\n }\n }\n\n /** @internal */\n _getByKeySelf(key: ReflectiveKey, notFoundValue: any): any {\n const obj = this._getObjByKeyId(key.id);\n return (obj !== UNDEFINED) ? obj : this._throwOrNull(key, notFoundValue);\n }\n\n /** @internal */\n _getByKeyDefault(key: ReflectiveKey, notFoundValue: any, visibility: Self|SkipSelf|null): any {\n let inj: Injector|null;\n\n if (visibility instanceof SkipSelf) {\n inj = this.parent;\n } else {\n inj = this;\n }\n\n while (inj instanceof ReflectiveInjector_) {\n const inj_ = <ReflectiveInjector_>inj;\n const obj = inj_._getObjByKeyId(key.id);\n if (obj !== UNDEFINED) return obj;\n inj = inj_.parent;\n }\n if (inj !== null) {\n return inj.get(key.token, notFoundValue);\n } else {\n return this._throwOrNull(key, notFoundValue);\n }\n }\n\n get displayName(): string {\n const providers =\n _mapProviders(this, (b: ResolvedReflectiveProvider) => ' \"' + b.key.displayName + '\" ')\n .join(', ');\n return `ReflectiveInjector(providers: [${providers}])`;\n }\n\n toString(): string { return this.displayName; }\n}\n\nfunction _mapProviders(injector: ReflectiveInjector_, fn: Function): any[] {\n const res: any[] = new Array(injector._providers.length);\n for (let i = 0; i < injector._providers.length; ++i) {\n res[i] = fn(injector.getProviderAtIndex(i));\n }\n return res;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Type} from '../type';\nimport {InjectionToken} from './injection_token';\n\n\n/**\n * An internal token whose presence in an injector indicates that the injector should treat itself\n * as a root scoped injector when processing requests for unknown tokens which may indicate\n * they are provided in the root scope.\n */\nexport const APP_ROOT = new InjectionToken<boolean>(\n 'The presence of this token marks an injector as being the root injector.');\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {OnDestroy} from '../metadata/lifecycle_hooks';\nimport {Type} from '../type';\nimport {stringify} from '../util';\n\nimport {InjectableDef, InjectableType, InjectorDef, InjectorType, InjectorTypeWithProviders} from './defs';\nimport {resolveForwardRef} from './forward_ref';\nimport {InjectableDefToken, InjectionToken} from './injection_token';\nimport {INJECTOR, InjectFlags, Injector, NullInjector, THROW_IF_NOT_FOUND, USE_VALUE, inject, injectArgs, setCurrentInjector} from './injector';\nimport {ClassProvider, ConstructorProvider, ExistingProvider, FactoryProvider, Provider, StaticClassProvider, StaticProvider, TypeProvider, ValueProvider} from './provider';\nimport {APP_ROOT} from './scope';\n\n\n\n/**\n * Internal type for a single provider in a deep provider array.\n */\ntype SingleProvider = TypeProvider | ValueProvider | ClassProvider | ConstructorProvider |\n ExistingProvider | FactoryProvider | StaticClassProvider;\n\n/**\n * Marker which indicates that a value has not yet been created from the factory function.\n */\nconst NOT_YET = {};\n\n/**\n * Marker which indicates that the factory function for a token is in the process of being called.\n *\n * If the injector is asked to inject a token with its value set to CIRCULAR, that indicates\n * injection of a dependency has recursively attempted to inject the original token, and there is\n * a circular dependency among the providers.\n */\nconst CIRCULAR = {};\n\nconst EMPTY_ARRAY = [] as any[];\n\n/**\n * A lazily initialized NullInjector.\n */\nlet NULL_INJECTOR: Injector|undefined = undefined;\n\nfunction getNullInjector(): Injector {\n if (NULL_INJECTOR === undefined) {\n NULL_INJECTOR = new NullInjector();\n }\n return NULL_INJECTOR;\n}\n\n/**\n * An entry in the injector which tracks information about the given token, including a possible\n * current value.\n */\ninterface Record<T> {\n factory: (() => T)|undefined;\n value: T|{};\n multi: any[]|undefined;\n}\n\n/**\n * Create a new `Injector` which is configured using a `defType` of `InjectorType<any>`s.\n *\n * @experimental\n */\nexport function createInjector(\n defType: /* InjectorType<any> */ any, parent: Injector | null = null,\n additionalProviders: StaticProvider[] | null = null): Injector {\n parent = parent || getNullInjector();\n return new R3Injector(defType, additionalProviders, parent);\n}\n\nexport class R3Injector {\n /**\n * Map of tokens to records which contain the instances of those tokens.\n */\n private records = new Map<Type<any>|InjectionToken<any>, Record<any>>();\n\n /**\n * The transitive set of `InjectorType`s which define this injector.\n */\n private injectorDefTypes = new Set<InjectorType<any>>();\n\n /**\n * Set of values instantiated by this injector which contain `ngOnDestroy` lifecycle hooks.\n */\n private onDestroy = new Set<OnDestroy>();\n\n /**\n * Flag indicating this injector provides the APP_ROOT_SCOPE token, and thus counts as the\n * root scope.\n */\n private readonly isRootInjector: boolean;\n\n /**\n * Flag indicating that this injector was previously destroyed.\n */\n private destroyed = false;\n\n constructor(\n def: InjectorType<any>, additionalProviders: StaticProvider[]|null,\n readonly parent: Injector) {\n // Start off by creating Records for every provider declared in every InjectorType\n // included transitively in `def`.\n deepForEach(\n [def], injectorDef => this.processInjectorType(injectorDef, new Set<InjectorType<any>>()));\n\n additionalProviders &&\n deepForEach(additionalProviders, provider => this.processProvider(provider));\n\n\n // Make sure the INJECTOR token provides this injector.\n this.records.set(INJECTOR, makeRecord(undefined, this));\n\n // Detect whether this injector has the APP_ROOT_SCOPE token and thus should provide\n // any injectable scoped to APP_ROOT_SCOPE.\n this.isRootInjector = this.records.has(APP_ROOT);\n\n // Eagerly instantiate the InjectorType classes themselves.\n this.injectorDefTypes.forEach(defType => this.get(defType));\n }\n\n /**\n * Destroy the injector and release references to every instance or provider associated with it.\n *\n * Also calls the `OnDestroy` lifecycle hooks of every instance that was created for which a\n * hook was found.\n */\n destroy(): void {\n this.assertNotDestroyed();\n\n // Set destroyed = true first, in case lifecycle hooks re-enter destroy().\n this.destroyed = true;\n try {\n // Call all the lifecycle hooks.\n this.onDestroy.forEach(service => service.ngOnDestroy());\n } finally {\n // Release all references.\n this.records.clear();\n this.onDestroy.clear();\n this.injectorDefTypes.clear();\n }\n }\n\n get<T>(\n token: Type<T>|InjectionToken<T>, notFoundValue: any = THROW_IF_NOT_FOUND,\n flags = InjectFlags.Default): T {\n this.assertNotDestroyed();\n // Set the injection context.\n const previousInjector = setCurrentInjector(this);\n try {\n // Check for the SkipSelf flag.\n if (!(flags & InjectFlags.SkipSelf)) {\n // SkipSelf isn't set, check if the record belongs to this injector.\n let record: Record<T>|undefined = this.records.get(token);\n if (record === undefined) {\n // No record, but maybe the token is scoped to this injector. Look for an ngInjectableDef\n // with a scope matching this injector.\n const def = couldBeInjectableType(token) &&\n (token as InjectableType<any>| InjectableDefToken<any>).ngInjectableDef ||\n undefined;\n if (def !== undefined && this.injectableDefInScope(def)) {\n // Found an ngInjectableDef and it's scoped to this injector. Pretend as if it was here\n // all along.\n record = injectableDefRecord(token);\n this.records.set(token, record);\n }\n }\n // If a record was found, get the instance for it and return it.\n if (record !== undefined) {\n return this.hydrate(token, record);\n }\n }\n\n // Select the next injector based on the Self flag - if self is set, the next injector is\n // the NullInjector, otherwise it's the parent.\n let next = !(flags & InjectFlags.Self) ? this.parent : getNullInjector();\n return this.parent.get(token, notFoundValue);\n } finally {\n // Lastly, clean up the state by restoring the previous injector.\n setCurrentInjector(previousInjector);\n }\n }\n\n private assertNotDestroyed(): void {\n if (this.destroyed) {\n throw new Error('Injector has already been destroyed.');\n }\n }\n\n /**\n * Add an `InjectorType` or `InjectorDefTypeWithProviders` and all of its transitive providers\n * to this injector.\n */\n private processInjectorType(\n defOrWrappedDef: InjectorType<any>|InjectorTypeWithProviders<any>,\n parents: Set<InjectorType<any>>) {\n defOrWrappedDef = resolveForwardRef(defOrWrappedDef);\n\n // Either the defOrWrappedDef is an InjectorType (with ngInjectorDef) or an\n // InjectorDefTypeWithProviders (aka ModuleWithProviders). Detecting either is a megamorphic\n // read, so care is taken to only do the read once.\n\n // First attempt to read the ngInjectorDef.\n let def = (defOrWrappedDef as InjectorType<any>).ngInjectorDef as(InjectorDef<any>| undefined);\n\n // If that's not present, then attempt to read ngModule from the InjectorDefTypeWithProviders.\n const ngModule =\n (def == null) && (defOrWrappedDef as InjectorTypeWithProviders<any>).ngModule || undefined;\n\n // Determine the InjectorType. In the case where `defOrWrappedDef` is an `InjectorType`,\n // then this is easy. In the case of an InjectorDefTypeWithProviders, then the definition type\n // is the `ngModule`.\n const defType: InjectorType<any> =\n (ngModule === undefined) ? (defOrWrappedDef as InjectorType<any>) : ngModule;\n\n // If defOrWrappedType was an InjectorDefTypeWithProviders, then .providers may hold some\n // extra providers.\n const providers =\n (ngModule !== undefined) && (defOrWrappedDef as InjectorTypeWithProviders<any>).providers ||\n EMPTY_ARRAY;\n\n // Finally, if defOrWrappedType was an `InjectorDefTypeWithProviders`, then the actual\n // `InjectorDef` is on its `ngModule`.\n if (ngModule !== undefined) {\n def = ngModule.ngInjectorDef;\n }\n\n // If no definition was found, it might be from exports. Remove it.\n if (def == null) {\n return;\n }\n\n // Check for circular dependencies.\n if (parents.has(defType)) {\n throw new Error(`Circular dependency: type ${stringify(defType)} ends up importing itself.`);\n }\n\n // Track the InjectorType and add a provider for it.\n this.injectorDefTypes.add(defType);\n this.records.set(defType, makeRecord(def.factory));\n\n // Add providers in the same way that @NgModule resolution did:\n\n // First, include providers from any imports.\n if (def.imports != null) {\n // Before processing defType's imports, add it to the set of parents. This way, if it ends\n // up deeply importing itself, this can be detected.\n parents.add(defType);\n try {\n deepForEach(def.imports, imported => this.processInjectorType(imported, parents));\n } finally {\n // Remove it from the parents set when finished.\n parents.delete(defType);\n }\n }\n\n // Next, include providers listed on the definition itself.\n if (def.providers != null) {\n deepForEach(def.providers, provider => this.processProvider(provider));\n }\n\n // Finally, include providers from an InjectorDefTypeWithProviders if there was one.\n deepForEach(providers, provider => this.processProvider(provider));\n }\n\n /**\n * Process a `SingleProvider` and add it.\n */\n private processProvider(provider: SingleProvider): void {\n // Determine the token from the provider. Either it's its own token, or has a {provide: ...}\n // property.\n provider = resolveForwardRef(provider);\n let token: any = isTypeProvider(provider) ? provider : resolveForwardRef(provider.provide);\n\n // Construct a `Record` for the provider.\n const record = providerToRecord(provider);\n\n if (!isTypeProvider(provider) && provider.multi === true) {\n // If the provider indicates that it's a multi-provider, process it specially.\n // First check whether it's been defined already.\n let multiRecord = this.records.get(token);\n if (multiRecord) {\n // It has. Throw a nice error if\n if (multiRecord.multi === undefined) {\n throw new Error(`Mixed multi-provider for ${token}.`);\n }\n } else {\n multiRecord = makeRecord(undefined, NOT_YET, true);\n multiRecord.factory = () => injectArgs(multiRecord !.multi !);\n this.records.set(token, multiRecord);\n }\n token = provider;\n multiRecord.multi !.push(provider);\n } else {\n const existing = this.records.get(token);\n if (existing && existing.multi !== undefined) {\n throw new Error(`Mixed multi-provider for ${stringify(token)}`);\n }\n }\n this.records.set(token, record);\n }\n\n private hydrate<T>(token: Type<T>|InjectionToken<T>, record: Record<T>): T {\n if (record.value === CIRCULAR) {\n throw new Error(`Circular dep for ${stringify(token)}`);\n } else if (record.value === NOT_YET) {\n record.value = CIRCULAR;\n record.value = record.factory !();\n }\n if (typeof record.value === 'object' && record.value && hasOnDestroy(record.value)) {\n this.onDestroy.add(record.value);\n }\n return record.value as T;\n }\n\n private injectableDefInScope(def: InjectableDef<any>): boolean {\n if (!def.providedIn) {\n return false;\n } else if (typeof def.providedIn === 'string') {\n return def.providedIn === 'any' || (def.providedIn === 'root' && this.isRootInjector);\n } else {\n return this.injectorDefTypes.has(def.providedIn);\n }\n }\n}\n\nfunction injectableDefRecord(token: Type<any>| InjectionToken<any>): Record<any> {\n const def = (token as InjectableType<any>).ngInjectableDef as InjectableDef<any>;\n if (def === undefined) {\n if (token instanceof InjectionToken) {\n throw new Error(`Token ${stringify(token)} is missing an ngInjectableDef definition.`);\n }\n // TODO(alxhub): there should probably be a strict mode which throws here instead of assuming a\n // no-args constructor.\n return makeRecord(() => new (token as Type<any>)());\n }\n return makeRecord(def.factory);\n}\n\nfunction providerToRecord(provider: SingleProvider): Record<any> {\n let token = resolveForwardRef(provider);\n let value: any = NOT_YET;\n let factory: (() => any)|undefined = undefined;\n if (isTypeProvider(provider)) {\n return injectableDefRecord(provider);\n } else {\n token = resolveForwardRef(provider.provide);\n if (isValueProvider(provider)) {\n value = provider.useValue;\n } else if (isExistingProvider(provider)) {\n factory = () => inject(provider.useExisting);\n } else if (isFactoryProvider(provider)) {\n factory = () => provider.useFactory(...injectArgs(provider.deps || []));\n } else {\n const classRef = (provider as StaticClassProvider | ClassProvider).useClass || token;\n if (hasDeps(provider)) {\n factory = () => new (classRef)(...injectArgs(provider.deps));\n } else {\n return injectableDefRecord(classRef);\n }\n }\n }\n return makeRecord(factory, value);\n}\n\nfunction makeRecord<T>(\n factory: (() => T) | undefined, value: T | {} = NOT_YET, multi: boolean = false): Record<T> {\n return {\n factory: factory,\n value: value,\n multi: multi ? [] : undefined,\n };\n}\n\nfunction deepForEach<T>(input: (T | any[])[], fn: (value: T) => void): void {\n input.forEach(value => Array.isArray(value) ? deepForEach(value, fn) : fn(value));\n}\n\nfunction isValueProvider(value: SingleProvider): value is ValueProvider {\n return USE_VALUE in value;\n}\n\nfunction isExistingProvider(value: SingleProvider): value is ExistingProvider {\n return !!(value as ExistingProvider).useExisting;\n}\n\nfunction isFactoryProvider(value: SingleProvider): value is FactoryProvider {\n return !!(value as FactoryProvider).useFactory;\n}\n\nfunction isClassProvider(value: SingleProvider): value is ClassProvider {\n return !!(value as ClassProvider).useClass;\n}\n\nfunction isTypeProvider(value: SingleProvider): value is TypeProvider {\n return typeof value === 'function';\n}\n\nfunction hasDeps(value: ClassProvider | ConstructorProvider | StaticClassProvider):\n value is ClassProvider&{deps: any[]} {\n return !!(value as any).deps;\n}\n\nfunction hasOnDestroy(value: any): value is OnDestroy {\n return typeof value === 'object' && value != null && (value as OnDestroy).ngOnDestroy &&\n typeof(value as OnDestroy).ngOnDestroy === 'function';\n}\n\nfunction couldBeInjectableType(value: any): value is Type<any>|InjectionToken<any> {\n return (typeof value === 'function') ||\n (typeof value === 'object' && value instanceof InjectionToken);\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @module\n * @description\n * The `di` module provides dependency injection container services.\n */\n\nexport * from './di/metadata';\nexport {InjectableType, InjectorType, defineInjectable, defineInjector} from './di/defs';\nexport {forwardRef, resolveForwardRef, ForwardRefFn} from './di/forward_ref';\nexport {Injectable, InjectableDecorator, InjectableProvider} from './di/injectable';\nexport {inject, InjectFlags, INJECTOR, Injector} from './di/injector';\nexport {ReflectiveInjector} from './di/reflective_injector';\nexport {StaticProvider, ValueProvider, ConstructorSansProvider, ExistingProvider, FactoryProvider, Provider, TypeProvider, ClassProvider} from './di/provider';\nexport {createInjector} from './di/r3_injector';\nexport {ResolvedReflectiveFactory, ResolvedReflectiveProvider} from './di/reflective_provider';\nexport {ReflectiveKey} from './di/reflective_key';\nexport {InjectionToken} from './di/injection_token';\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Observable} from 'rxjs';\n\n/**\n * Determine if the argument is shaped like a Promise\n */\nexport function isPromise(obj: any): obj is Promise<any> {\n // allow any Promise/A+ compliant thenable.\n // It's up to the caller to ensure that obj.then conforms to the spec\n return !!obj && typeof obj.then === 'function';\n}\n\n/**\n * Determine if the argument is an Observable\n */\nexport function isObservable(obj: any | Observable<any>): obj is Observable<any> {\n // TODO: use Symbol.observable when https://github.com/ReactiveX/rxjs/issues/2415 will be resolved\n return !!obj && typeof obj.subscribe === 'function';\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {isPromise} from '../src/util/lang';\n\nimport {Inject, Injectable, InjectionToken, Optional} from './di';\n\n\n/**\n * A function that will be executed when an application is initialized.\n */\nexport const APP_INITIALIZER = new InjectionToken<Array<() => void>>('Application Initializer');\n\n/**\n * A class that reflects the state of running {@link APP_INITIALIZER}s.\n */\n@Injectable()\nexport class ApplicationInitStatus {\n // TODO(issue/24571): remove '!'.\n private resolve !: Function;\n // TODO(issue/24571): remove '!'.\n private reject !: Function;\n private initialized = false;\n public readonly donePromise: Promise<any>;\n public readonly done = false;\n\n constructor(@Inject(APP_INITIALIZER) @Optional() private appInits: (() => any)[]) {\n this.donePromise = new Promise((res, rej) => {\n this.resolve = res;\n this.reject = rej;\n });\n }\n\n /** @internal */\n runInitializers() {\n if (this.initialized) {\n return;\n }\n\n const asyncInitPromises: Promise<any>[] = [];\n\n const complete = () => {\n (this as{done: boolean}).done = true;\n this.resolve();\n };\n\n if (this.appInits) {\n for (let i = 0; i < this.appInits.length; i++) {\n const initResult = this.appInits[i]();\n if (isPromise(initResult)) {\n asyncInitPromises.push(initResult);\n }\n }\n }\n\n Promise.all(asyncInitPromises).then(() => { complete(); }).catch(e => { this.reject(e); });\n\n if (asyncInitPromises.length === 0) {\n complete();\n }\n this.initialized = true;\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {InjectionToken} from './di';\nimport {ComponentRef} from './linker/component_factory';\n\n\n/**\n * A DI Token representing a unique string id assigned to the application by Angular and used\n * primarily for prefixing application attributes and CSS styles when\n * {@link ViewEncapsulation#Emulated ViewEncapsulation.Emulated} is being used.\n *\n * If you need to avoid randomly generated value to be used as an application id, you can provide\n * a custom value via a DI provider <!-- TODO: provider --> configuring the root {@link Injector}\n * using this token.\n * @experimental\n */\nexport const APP_ID = new InjectionToken<string>('AppId');\n\nexport function _appIdRandomProviderFactory() {\n return `${_randomChar()}${_randomChar()}${_randomChar()}`;\n}\n\n/**\n * Providers that will generate a random APP_ID_TOKEN.\n * @experimental\n */\nexport const APP_ID_RANDOM_PROVIDER = {\n provide: APP_ID,\n useFactory: _appIdRandomProviderFactory,\n deps: <any[]>[],\n};\n\nfunction _randomChar(): string {\n return String.fromCharCode(97 + Math.floor(Math.random() * 25));\n}\n\n/**\n * A function that will be executed when a platform is initialized.\n * @experimental\n */\nexport const PLATFORM_INITIALIZER = new InjectionToken<Array<() => void>>('Platform Initializer');\n\n/**\n * A token that indicates an opaque platform id.\n * @experimental\n */\nexport const PLATFORM_ID = new InjectionToken<Object>('Platform ID');\n\n/**\n * All callbacks provided via this token will be called for every component that is bootstrapped.\n * Signature of the callback:\n *\n * `(componentRef: ComponentRef) => void`.\n *\n * @experimental\n */\nexport const APP_BOOTSTRAP_LISTENER =\n new InjectionToken<Array<(compRef: ComponentRef<any>) => void>>('appBootstrapListener');\n\n/**\n * A token which indicates the root directory of the application\n * @experimental\n */\nexport const PACKAGE_ROOT_URL = new InjectionToken<string>('Application Packages Root URL');\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Injectable} from './di';\n\n@Injectable()\nexport class Console {\n log(message: string): void {\n // tslint:disable-next-line:no-console\n console.log(message);\n }\n // Note: for reporting errors use `DOM.logError()` as it is platform specific\n warn(message: string): void {\n // tslint:disable-next-line:no-console\n console.warn(message);\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Injectable, InjectionToken, StaticProvider} from '../di';\nimport {MissingTranslationStrategy} from '../i18n/tokens';\nimport {ViewEncapsulation} from '../metadata';\nimport {Type} from '../type';\n\nimport {ComponentFactory} from './component_factory';\nimport {NgModuleFactory} from './ng_module_factory';\n\n\n/**\n * Combination of NgModuleFactory and ComponentFactorys.\n *\n * @experimental\n */\nexport class ModuleWithComponentFactories<T> {\n constructor(\n public ngModuleFactory: NgModuleFactory<T>,\n public componentFactories: ComponentFactory<any>[]) {}\n}\n\n\nfunction _throwError() {\n throw new Error(`Runtime compiler is not loaded`);\n}\n\n/**\n * Low-level service for running the angular compiler during runtime\n * to create {@link ComponentFactory}s, which\n * can later be used to create and render a Component instance.\n *\n * Each `@NgModule` provides an own `Compiler` to its injector,\n * that will use the directives/pipes of the ng module for compilation\n * of components.\n *\n */\n@Injectable()\nexport class Compiler {\n /**\n * Compiles the given NgModule and all of its components. All templates of the components listed\n * in `entryComponents` have to be inlined.\n */\n compileModuleSync<T>(moduleType: Type<T>): NgModuleFactory<T> { throw _throwError(); }\n\n /**\n * Compiles the given NgModule and all of its components\n */\n compileModuleAsync<T>(moduleType: Type<T>): Promise<NgModuleFactory<T>> { throw _throwError(); }\n\n /**\n * Same as {@link #compileModuleSync} but also creates ComponentFactories for all components.\n */\n compileModuleAndAllComponentsSync<T>(moduleType: Type<T>): ModuleWithComponentFactories<T> {\n throw _throwError();\n }\n\n /**\n * Same as {@link #compileModuleAsync} but also creates ComponentFactories for all components.\n */\n compileModuleAndAllComponentsAsync<T>(moduleType: Type<T>):\n Promise<ModuleWithComponentFactories<T>> {\n throw _throwError();\n }\n\n /**\n * Clears all caches.\n */\n clearCache(): void {}\n\n /**\n * Clears the cache for the given component/ngModule.\n */\n clearCacheFor(type: Type<any>) {}\n\n /**\n * Returns the id for a given NgModule, if one is defined and known to the compiler.\n */\n getModuleId(moduleType: Type<any>): string|undefined { return undefined; }\n}\n\n/**\n * Options for creating a compiler\n *\n * @experimental\n */\nexport type CompilerOptions = {\n useJit?: boolean,\n defaultEncapsulation?: ViewEncapsulation,\n providers?: StaticProvider[],\n missingTranslation?: MissingTranslationStrategy,\n preserveWhitespaces?: boolean,\n};\n\n/**\n * Token to provide CompilerOptions in the platform injector.\n *\n * @experimental\n */\nexport const COMPILER_OPTIONS = new InjectionToken<CompilerOptions[]>('compilerOptions');\n\n/**\n * A factory for creating a Compiler\n *\n * @experimental\n */\nexport abstract class CompilerFactory {\n abstract createCompiler(options?: CompilerOptions[]): Compiler;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ChangeDetectorRef} from '../change_detection/change_detection';\nimport {Injector} from '../di/injector';\nimport {Type} from '../type';\n\nimport {ElementRef} from './element_ref';\nimport {NgModuleRef} from './ng_module_factory';\nimport {ViewRef} from './view_ref';\n\n/**\n * Represents a component created by a `ComponentFactory`.\n * Provides access to the component instance and related objects,\n * and provides the means of destroying the instance.\n *\n */\nexport abstract class ComponentRef<C> {\n /**\n * The host or anchor [element](guide/glossary#element) for this component instance.\n */\n abstract get location(): ElementRef;\n\n /**\n * The [dependency injector](guide/glossary#injector) for this component instance.\n */\n abstract get injector(): Injector;\n\n /**\n * This component instance.\n */\n abstract get instance(): C;\n\n /**\n * The [host view](guide/glossary#view-tree) defined by the template\n * for this component instance.\n */\n abstract get hostView(): ViewRef;\n\n /**\n * The change detector for this component instance.\n */\n abstract get changeDetectorRef(): ChangeDetectorRef;\n\n /**\n * The component type.\n */\n abstract get componentType(): Type<any>;\n\n /**\n * Destroys the component instance and all of the data structures associated with it.\n */\n abstract destroy(): void;\n\n /**\n * A lifecycle hook that provides additional developer-defined cleanup\n * functionality for the component.\n * @param callback A handler function that cleans up developer-defined data\n * associated with this component. Called when the `destroy()` method is invoked.\n */\n abstract onDestroy(callback: Function): void;\n}\n\nexport abstract class ComponentFactory<C> {\n /**\n * The comonent's HTML selector.\n */\n abstract get selector(): string;\n /**\n * The component's type\n */\n abstract get componentType(): Type<any>;\n /**\n * Selector for all <ng-content> elements in the component.\n */\n abstract get ngContentSelectors(): string[];\n /**\n * The inputs of the component.\n */\n abstract get inputs(): {propName: string, templateName: string}[];\n /**\n * The outputs of the component.\n */\n abstract get outputs(): {propName: string, templateName: string}[];\n /**\n * Creates a new component.\n */\n abstract create(\n injector: Injector, projectableNodes?: any[][], rootSelectorOrNode?: string|any,\n ngModule?: NgModuleRef<any>): ComponentRef<C>;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Injector} from '../di/injector';\nimport {Type} from '../type';\nimport {stringify} from '../util';\n\nimport {ComponentFactory, ComponentRef} from './component_factory';\nimport {NgModuleRef} from './ng_module_factory';\n\nexport function noComponentFactoryError(component: Function) {\n const error = Error(\n `No component factory found for ${stringify(component)}. Did you add it to @NgModule.entryComponents?`);\n (error as any)[ERROR_COMPONENT] = component;\n return error;\n}\n\nconst ERROR_COMPONENT = 'ngComponent';\n\nexport function getComponent(error: Error): Type<any> {\n return (error as any)[ERROR_COMPONENT];\n}\n\n\nclass _NullComponentFactoryResolver implements ComponentFactoryResolver {\n resolveComponentFactory<T>(component: {new (...args: any[]): T}): ComponentFactory<T> {\n throw noComponentFactoryError(component);\n }\n}\n\nexport abstract class ComponentFactoryResolver {\n static NULL: ComponentFactoryResolver = new _NullComponentFactoryResolver();\n abstract resolveComponentFactory<T>(component: Type<T>): ComponentFactory<T>;\n}\n\nexport class CodegenComponentFactoryResolver implements ComponentFactoryResolver {\n private _factories = new Map<any, ComponentFactory<any>>();\n\n constructor(\n factories: ComponentFactory<any>[], private _parent: ComponentFactoryResolver,\n private _ngModule: NgModuleRef<any>) {\n for (let i = 0; i < factories.length; i++) {\n const factory = factories[i];\n this._factories.set(factory.componentType, factory);\n }\n }\n\n resolveComponentFactory<T>(component: {new (...args: any[]): T}): ComponentFactory<T> {\n let factory = this._factories.get(component);\n if (!factory && this._parent) {\n factory = this._parent.resolveComponentFactory(component);\n }\n if (!factory) {\n throw noComponentFactoryError(component);\n }\n return new ComponentFactoryBoundToModule(factory, this._ngModule);\n }\n}\n\nexport class ComponentFactoryBoundToModule<C> extends ComponentFactory<C> {\n readonly selector: string;\n readonly componentType: Type<any>;\n readonly ngContentSelectors: string[];\n readonly inputs: {propName: string, templateName: string}[];\n readonly outputs: {propName: string, templateName: string}[];\n\n constructor(private factory: ComponentFactory<C>, private ngModule: NgModuleRef<any>) {\n super();\n this.selector = factory.selector;\n this.componentType = factory.componentType;\n this.ngContentSelectors = factory.ngContentSelectors;\n this.inputs = factory.inputs;\n this.outputs = factory.outputs;\n }\n\n create(\n injector: Injector, projectableNodes?: any[][], rootSelectorOrNode?: string|any,\n ngModule?: NgModuleRef<any>): ComponentRef<C> {\n return this.factory.create(\n injector, projectableNodes, rootSelectorOrNode, ngModule || this.ngModule);\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Injector} from '../di/injector';\nimport {Type} from '../type';\n\nimport {ComponentFactoryResolver} from './component_factory_resolver';\n\n\n/**\n * Represents an instance of an NgModule created via a {@link NgModuleFactory}.\n *\n * `NgModuleRef` provides access to the NgModule Instance as well other objects related to this\n * NgModule Instance.\n *\n *\n */\nexport abstract class NgModuleRef<T> {\n /**\n * The injector that contains all of the providers of the NgModule.\n */\n abstract get injector(): Injector;\n\n /**\n * The ComponentFactoryResolver to get hold of the ComponentFactories\n * declared in the `entryComponents` property of the module.\n */\n abstract get componentFactoryResolver(): ComponentFactoryResolver;\n\n /**\n * The NgModule instance.\n */\n abstract get instance(): T;\n\n /**\n * Destroys the module instance and all of the data structures associated with it.\n */\n abstract destroy(): void;\n\n /**\n * Allows to register a callback that will be called when the module is destroyed.\n */\n abstract onDestroy(callback: () => void): void;\n}\n\nexport interface InternalNgModuleRef<T> extends NgModuleRef<T> {\n // Note: we are using the prefix _ as NgModuleData is an NgModuleRef and therefore directly\n // exposed to the user.\n _bootstrapComponents: Type<any>[];\n}\n\n/**\n * @experimental\n */\nexport abstract class NgModuleFactory<T> {\n abstract get moduleType(): Type<T>;\n abstract create(parentInjector: Injector|null): NgModuleRef<T>;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {global} from '../util';\n\n/**\n * A scope function for the Web Tracing Framework (WTF).\n *\n * @experimental\n */\nexport interface WtfScopeFn { (arg0?: any, arg1?: any): any; }\n\ninterface WTF {\n trace: Trace;\n}\n\ninterface Trace {\n events: Events;\n leaveScope(scope: Scope, returnValue: any): any /** TODO #9100 */;\n beginTimeRange(rangeType: string, action: string): Range;\n endTimeRange(range: Range): any /** TODO #9100 */;\n}\n\nexport interface Range {}\n\ninterface Events {\n createScope(signature: string, flags: any): Scope;\n}\n\nexport interface Scope { (...args: any[] /** TODO #9100 */): any; }\n\nlet trace: Trace;\nlet events: Events;\n\nexport function detectWTF(): boolean {\n const wtf: WTF = (global as any /** TODO #9100 */)['wtf'];\n if (wtf) {\n trace = wtf['trace'];\n if (trace) {\n events = trace['events'];\n return true;\n }\n }\n return false;\n}\n\nexport function createScope(signature: string, flags: any = null): any {\n return events.createScope(signature, flags);\n}\n\nexport function leave<T>(scope: Scope): void;\nexport function leave<T>(scope: Scope, returnValue?: T): T;\nexport function leave<T>(scope: Scope, returnValue?: any): any {\n trace.leaveScope(scope, returnValue);\n return returnValue;\n}\n\nexport function startTimeRange(rangeType: string, action: string): Range {\n return trace.beginTimeRange(rangeType, action);\n}\n\nexport function endTimeRange(range: Range): void {\n trace.endTimeRange(range);\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {WtfScopeFn, createScope, detectWTF, endTimeRange, leave, startTimeRange} from './wtf_impl';\n\nexport {WtfScopeFn} from './wtf_impl';\n\n\n/**\n * True if WTF is enabled.\n */\nexport const wtfEnabled = detectWTF();\n\nfunction noopScope(arg0?: any, arg1?: any): any {\n return null;\n}\n\n/**\n * Create trace scope.\n *\n * Scopes must be strictly nested and are analogous to stack frames, but\n * do not have to follow the stack frames. Instead it is recommended that they follow logical\n * nesting. You may want to use\n * [Event\n * Signatures](http://google.github.io/tracing-framework/instrumenting-code.html#custom-events)\n * as they are defined in WTF.\n *\n * Used to mark scope entry. The return value is used to leave the scope.\n *\n * var myScope = wtfCreateScope('MyClass#myMethod(ascii someVal)');\n *\n * someMethod() {\n * var s = myScope('Foo'); // 'Foo' gets stored in tracing UI\n * // DO SOME WORK HERE\n * return wtfLeave(s, 123); // Return value 123\n * }\n *\n * Note, adding try-finally block around the work to ensure that `wtfLeave` gets called can\n * negatively impact the performance of your application. For this reason we recommend that\n * you don't add them to ensure that `wtfLeave` gets called. In production `wtfLeave` is a noop and\n * so try-finally block has no value. When debugging perf issues, skipping `wtfLeave`, do to\n * exception, will produce incorrect trace, but presence of exception signifies logic error which\n * needs to be fixed before the app should be profiled. Add try-finally only when you expect that\n * an exception is expected during normal execution while profiling.\n *\n * @experimental\n */\nexport const wtfCreateScope: (signature: string, flags?: any) => WtfScopeFn =\n wtfEnabled ? createScope : (signature: string, flags?: any) => noopScope;\n\n/**\n * Used to mark end of Scope.\n *\n * - `scope` to end.\n * - `returnValue` (optional) to be passed to the WTF.\n *\n * Returns the `returnValue for easy chaining.\n * @experimental\n */\nexport const wtfLeave: <T>(scope: any, returnValue?: T) => T =\n wtfEnabled ? leave : (s: any, r?: any) => r;\n\n/**\n * Used to mark Async start. Async are similar to scope but they don't have to be strictly nested.\n * The return value is used in the call to [endAsync]. Async ranges only work if WTF has been\n * enabled.\n *\n * someMethod() {\n * var s = wtfStartTimeRange('HTTP:GET', 'some.url');\n * var future = new Future.delay(5).then((_) {\n * wtfEndTimeRange(s);\n * });\n * }\n * @experimental\n */\nexport const wtfStartTimeRange: (rangeType: string, action: string) => any =\n wtfEnabled ? startTimeRange : (rangeType: string, action: string) => null;\n\n/**\n * Ends a async time range operation.\n * [range] is the return value from [wtfStartTimeRange] Async ranges only work if WTF has been\n * enabled.\n * @experimental\n */\nexport const wtfEndTimeRange: (range: any) => void = wtfEnabled ? endTimeRange : (r: any) => null;\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Subject, Subscription} from 'rxjs';\n\n/**\n * Use in directives and components to emit custom events synchronously\n * or asynchronously, and register handlers for those events by subscribing\n * to an instance.\n *\n * @usageNotes\n *\n * In the following example, a component defines two output properties\n * that create event emitters. When the title is clicked, the emitter\n * emits an open or close event to toggle the current visibility state.\n *\n * ```\n * @Component({\n * selector: 'zippy',\n * template: `\n * <div class=\"zippy\">\n * <div (click)=\"toggle()\">Toggle</div>\n * <div [hidden]=\"!visible\">\n * <ng-content></ng-content>\n * </div>\n * </div>`})\n * export class Zippy {\n * visible: boolean = true;\n * @Output() open: EventEmitter<any> = new EventEmitter();\n * @Output() close: EventEmitter<any> = new EventEmitter();\n *\n * toggle() {\n * this.visible = !this.visible;\n * if (this.visible) {\n * this.open.emit(null);\n * } else {\n * this.close.emit(null);\n * }\n * }\n * }\n * ```\n *\n * Access the event object with the `$event` argument passed to the output event\n * handler:\n *\n * ```\n * <zippy (open)=\"onOpen($event)\" (close)=\"onClose($event)\"></zippy>\n * ```\n *\n * ### Notes\n *\n * Uses Rx.Observable but provides an adapter to make it work as specified here:\n * https://github.com/jhusain/observable-spec\n *\n * Once a reference implementation of the spec is available, switch to it.\n *\n */\nexport class EventEmitter<T> extends Subject<T> {\n // TODO: mark this as internal once all the facades are gone\n // we can't mark it as internal now because EventEmitter exported via @angular/core would not\n // contain this property making it incompatible with all the code that uses EventEmitter via\n // facades, which are local to the code and do not have this property stripped.\n /**\n * Internal\n */\n __isAsync: boolean; // tslint:disable-line\n\n /**\n * Creates an instance of this class that can\n * deliver events synchronously or asynchronously.\n *\n * @param isAsync When true, deliver events asynchronously.\n *\n */\n constructor(isAsync: boolean = false) {\n super();\n this.__isAsync = isAsync;\n }\n\n /**\n * Emits an event containing a given value.\n * @param value The value to emit.\n */\n emit(value?: T) { super.next(value); }\n\n /**\n * Registers handlers for events emitted by this instance.\n * @param generatorOrNext When supplied, a custom handler for emitted events.\n * @param error When supplied, a custom handler for an error notification\n * from this emitter.\n * @param complete When supplied, a custom handler for a completion\n * notification from this emitter.\n */\n subscribe(generatorOrNext?: any, error?: any, complete?: any): any {\n let schedulerFn: (t: any) => any;\n let errorFn = (err: any): any => null;\n let completeFn = (): any => null;\n\n if (generatorOrNext && typeof generatorOrNext === 'object') {\n schedulerFn = this.__isAsync ? (value: any) => {\n setTimeout(() => generatorOrNext.next(value));\n } : (value: any) => { generatorOrNext.next(value); };\n\n if (generatorOrNext.error) {\n errorFn = this.__isAsync ? (err) => { setTimeout(() => generatorOrNext.error(err)); } :\n (err) => { generatorOrNext.error(err); };\n }\n\n if (generatorOrNext.complete) {\n completeFn = this.__isAsync ? () => { setTimeout(() => generatorOrNext.complete()); } :\n () => { generatorOrNext.complete(); };\n }\n } else {\n schedulerFn = this.__isAsync ? (value: any) => { setTimeout(() => generatorOrNext(value)); } :\n (value: any) => { generatorOrNext(value); };\n\n if (error) {\n errorFn =\n this.__isAsync ? (err) => { setTimeout(() => error(err)); } : (err) => { error(err); };\n }\n\n if (complete) {\n completeFn =\n this.__isAsync ? () => { setTimeout(() => complete()); } : () => { complete(); };\n }\n }\n\n const sink = super.subscribe(schedulerFn, errorFn, completeFn);\n\n if (generatorOrNext instanceof Subscription) {\n generatorOrNext.add(sink);\n }\n\n return sink;\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {EventEmitter} from '../event_emitter';\n\n/**\n * An injectable service for executing work inside or outside of the Angular zone.\n *\n * The most common use of this service is to optimize performance when starting a work consisting of\n * one or more asynchronous tasks that don't require UI updates or error handling to be handled by\n * Angular. Such tasks can be kicked off via {@link #runOutsideAngular} and if needed, these tasks\n * can reenter the Angular zone via {@link #run}.\n *\n * <!-- TODO: add/fix links to:\n * - docs explaining zones and the use of zones in Angular and change-detection\n * - link to runOutsideAngular/run (throughout this file!)\n * -->\n *\n * @usageNotes\n * ### Example\n *\n * ```\n * import {Component, NgZone} from '@angular/core';\n * import {NgIf} from '@angular/common';\n *\n * @Component({\n * selector: 'ng-zone-demo',\n * template: `\n * <h2>Demo: NgZone</h2>\n *\n * <p>Progress: {{progress}}%</p>\n * <p *ngIf=\"progress >= 100\">Done processing {{label}} of Angular zone!</p>\n *\n * <button (click)=\"processWithinAngularZone()\">Process within Angular zone</button>\n * <button (click)=\"processOutsideOfAngularZone()\">Process outside of Angular zone</button>\n * `,\n * })\n * export class NgZoneDemo {\n * progress: number = 0;\n * label: string;\n *\n * constructor(private _ngZone: NgZone) {}\n *\n * // Loop inside the Angular zone\n * // so the UI DOES refresh after each setTimeout cycle\n * processWithinAngularZone() {\n * this.label = 'inside';\n * this.progress = 0;\n * this._increaseProgress(() => console.log('Inside Done!'));\n * }\n *\n * // Loop outside of the Angular zone\n * // so the UI DOES NOT refresh after each setTimeout cycle\n * processOutsideOfAngularZone() {\n * this.label = 'outside';\n * this.progress = 0;\n * this._ngZone.runOutsideAngular(() => {\n * this._increaseProgress(() => {\n * // reenter the Angular zone and display done\n * this._ngZone.run(() => { console.log('Outside Done!'); });\n * });\n * });\n * }\n *\n * _increaseProgress(doneCallback: () => void) {\n * this.progress += 1;\n * console.log(`Current progress: ${this.progress}%`);\n *\n * if (this.progress < 100) {\n * window.setTimeout(() => this._increaseProgress(doneCallback), 10);\n * } else {\n * doneCallback();\n * }\n * }\n * }\n * ```\n *\n * @experimental\n */\nexport class NgZone {\n readonly hasPendingMicrotasks: boolean = false;\n readonly hasPendingMacrotasks: boolean = false;\n\n /**\n * Whether there are no outstanding microtasks or macrotasks.\n */\n readonly isStable: boolean = true;\n\n /**\n * Notifies when code enters Angular Zone. This gets fired first on VM Turn.\n */\n readonly onUnstable: EventEmitter<any> = new EventEmitter(false);\n\n /**\n * Notifies when there is no more microtasks enqueued in the current VM Turn.\n * This is a hint for Angular to do change detection, which may enqueue more microtasks.\n * For this reason this event can fire multiple times per VM Turn.\n */\n readonly onMicrotaskEmpty: EventEmitter<any> = new EventEmitter(false);\n\n /**\n * Notifies when the last `onMicrotaskEmpty` has run and there are no more microtasks, which\n * implies we are about to relinquish VM turn.\n * This event gets called just once.\n */\n readonly onStable: EventEmitter<any> = new EventEmitter(false);\n\n /**\n * Notifies that an error has been delivered.\n */\n readonly onError: EventEmitter<any> = new EventEmitter(false);\n\n constructor({enableLongStackTrace = false}) {\n if (typeof Zone == 'undefined') {\n throw new Error(`In this configuration Angular requires Zone.js`);\n }\n\n Zone.assertZonePatched();\n const self = this as any as NgZonePrivate;\n self._nesting = 0;\n\n self._outer = self._inner = Zone.current;\n\n if ((Zone as any)['wtfZoneSpec']) {\n self._inner = self._inner.fork((Zone as any)['wtfZoneSpec']);\n }\n\n if ((Zone as any)['TaskTrackingZoneSpec']) {\n self._inner = self._inner.fork(new ((Zone as any)['TaskTrackingZoneSpec'] as any));\n }\n\n if (enableLongStackTrace && (Zone as any)['longStackTraceZoneSpec']) {\n self._inner = self._inner.fork((Zone as any)['longStackTraceZoneSpec']);\n }\n\n forkInnerZoneWithAngularBehavior(self);\n }\n\n static isInAngularZone(): boolean { return Zone.current.get('isAngularZone') === true; }\n\n static assertInAngularZone(): void {\n if (!NgZone.isInAngularZone()) {\n throw new Error('Expected to be in Angular Zone, but it is not!');\n }\n }\n\n static assertNotInAngularZone(): void {\n if (NgZone.isInAngularZone()) {\n throw new Error('Expected to not be in Angular Zone, but it is!');\n }\n }\n\n /**\n * Executes the `fn` function synchronously within the Angular zone and returns value returned by\n * the function.\n *\n * Running functions via `run` allows you to reenter Angular zone from a task that was executed\n * outside of the Angular zone (typically started via {@link #runOutsideAngular}).\n *\n * Any future tasks or microtasks scheduled from within this function will continue executing from\n * within the Angular zone.\n *\n * If a synchronous error happens it will be rethrown and not reported via `onError`.\n */\n run<T>(fn: (...args: any[]) => T, applyThis?: any, applyArgs?: any[]): T {\n return (this as any as NgZonePrivate)._inner.run(fn, applyThis, applyArgs) as T;\n }\n\n /**\n * Executes the `fn` function synchronously within the Angular zone as a task and returns value\n * returned by the function.\n *\n * Running functions via `run` allows you to reenter Angular zone from a task that was executed\n * outside of the Angular zone (typically started via {@link #runOutsideAngular}).\n *\n * Any future tasks or microtasks scheduled from within this function will continue executing from\n * within the Angular zone.\n *\n * If a synchronous error happens it will be rethrown and not reported via `onError`.\n */\n runTask<T>(fn: (...args: any[]) => T, applyThis?: any, applyArgs?: any[], name?: string): T {\n const zone = (this as any as NgZonePrivate)._inner;\n const task = zone.scheduleEventTask('NgZoneEvent: ' + name, fn, EMPTY_PAYLOAD, noop, noop);\n try {\n return zone.runTask(task, applyThis, applyArgs) as T;\n } finally {\n zone.cancelTask(task);\n }\n }\n\n /**\n * Same as `run`, except that synchronous errors are caught and forwarded via `onError` and not\n * rethrown.\n */\n runGuarded<T>(fn: (...args: any[]) => T, applyThis?: any, applyArgs?: any[]): T {\n return (this as any as NgZonePrivate)._inner.runGuarded(fn, applyThis, applyArgs) as T;\n }\n\n /**\n * Executes the `fn` function synchronously in Angular's parent zone and returns value returned by\n * the function.\n *\n * Running functions via {@link #runOutsideAngular} allows you to escape Angular's zone and do\n * work that\n * doesn't trigger Angular change-detection or is subject to Angular's error handling.\n *\n * Any future tasks or microtasks scheduled from within this function will continue executing from\n * outside of the Angular zone.\n *\n * Use {@link #run} to reenter the Angular zone and do work that updates the application model.\n */\n runOutsideAngular<T>(fn: (...args: any[]) => T): T {\n return (this as any as NgZonePrivate)._outer.run(fn) as T;\n }\n}\n\nfunction noop() {}\nconst EMPTY_PAYLOAD = {};\n\n\ninterface NgZonePrivate extends NgZone {\n _outer: Zone;\n _inner: Zone;\n _nesting: number;\n\n hasPendingMicrotasks: boolean;\n hasPendingMacrotasks: boolean;\n isStable: boolean;\n}\n\nfunction checkStable(zone: NgZonePrivate) {\n if (zone._nesting == 0 && !zone.hasPendingMicrotasks && !zone.isStable) {\n try {\n zone._nesting++;\n zone.onMicrotaskEmpty.emit(null);\n } finally {\n zone._nesting--;\n if (!zone.hasPendingMicrotasks) {\n try {\n zone.runOutsideAngular(() => zone.onStable.emit(null));\n } finally {\n zone.isStable = true;\n }\n }\n }\n }\n}\n\nfunction forkInnerZoneWithAngularBehavior(zone: NgZonePrivate) {\n zone._inner = zone._inner.fork({\n name: 'angular',\n properties: <any>{'isAngularZone': true},\n onInvokeTask: (delegate: ZoneDelegate, current: Zone, target: Zone, task: Task, applyThis: any,\n applyArgs: any): any => {\n try {\n onEnter(zone);\n return delegate.invokeTask(target, task, applyThis, applyArgs);\n } finally {\n onLeave(zone);\n }\n },\n\n\n onInvoke: (delegate: ZoneDelegate, current: Zone, target: Zone, callback: Function,\n applyThis: any, applyArgs: any[], source: string): any => {\n try {\n onEnter(zone);\n return delegate.invoke(target, callback, applyThis, applyArgs, source);\n } finally {\n onLeave(zone);\n }\n },\n\n onHasTask:\n (delegate: ZoneDelegate, current: Zone, target: Zone, hasTaskState: HasTaskState) => {\n delegate.hasTask(target, hasTaskState);\n if (current === target) {\n // We are only interested in hasTask events which originate from our zone\n // (A child hasTask event is not interesting to us)\n if (hasTaskState.change == 'microTask') {\n zone.hasPendingMicrotasks = hasTaskState.microTask;\n checkStable(zone);\n } else if (hasTaskState.change == 'macroTask') {\n zone.hasPendingMacrotasks = hasTaskState.macroTask;\n }\n }\n },\n\n onHandleError: (delegate: ZoneDelegate, current: Zone, target: Zone, error: any): boolean => {\n delegate.handleError(target, error);\n zone.runOutsideAngular(() => zone.onError.emit(error));\n return false;\n }\n });\n}\n\nfunction onEnter(zone: NgZonePrivate) {\n zone._nesting++;\n if (zone.isStable) {\n zone.isStable = false;\n zone.onUnstable.emit(null);\n }\n}\n\nfunction onLeave(zone: NgZonePrivate) {\n zone._nesting--;\n checkStable(zone);\n}\n\n/**\n * Provides a noop implementation of `NgZone` which does nothing. This zone requires explicit calls\n * to framework to perform rendering.\n */\nexport class NoopNgZone implements NgZone {\n readonly hasPendingMicrotasks: boolean = false;\n readonly hasPendingMacrotasks: boolean = false;\n readonly isStable: boolean = true;\n readonly onUnstable: EventEmitter<any> = new EventEmitter();\n readonly onMicrotaskEmpty: EventEmitter<any> = new EventEmitter();\n readonly onStable: EventEmitter<any> = new EventEmitter();\n readonly onError: EventEmitter<any> = new EventEmitter();\n\n run(fn: () => any): any { return fn(); }\n\n runGuarded(fn: () => any): any { return fn(); }\n\n runOutsideAngular(fn: () => any): any { return fn(); }\n\n runTask<T>(fn: () => any): any { return fn(); }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Injectable} from '../di';\nimport {scheduleMicroTask} from '../util';\nimport {NgZone} from '../zone/ng_zone';\n\n/**\n * Testability API.\n * `declare` keyword causes tsickle to generate externs, so these methods are\n * not renamed by Closure Compiler.\n * @experimental\n */\nexport declare interface PublicTestability {\n isStable(): boolean;\n whenStable(callback: Function, timeout?: number, updateCallback?: Function): void;\n findProviders(using: any, provider: string, exactMatch: boolean): any[];\n}\n\n// Angular internal, not intended for public API.\nexport interface PendingMacrotask {\n source: string;\n isPeriodic: boolean;\n delay?: number;\n creationLocation: Error;\n xhr?: XMLHttpRequest;\n}\n\n// Angular internal, not intended for public API.\nexport type DoneCallback = (didWork: boolean, tasks?: PendingMacrotask[]) => void;\nexport type UpdateCallback = (tasks: PendingMacrotask[]) => boolean;\n\ninterface WaitCallback {\n // Needs to be 'any' - setTimeout returns a number according to ES6, but\n // on NodeJS it returns a Timer.\n timeoutId: any;\n doneCb: DoneCallback;\n updateCb?: UpdateCallback;\n}\n\n/**\n * The Testability service provides testing hooks that can be accessed from\n * the browser and by services such as Protractor. Each bootstrapped Angular\n * application on the page will have an instance of Testability.\n * @experimental\n */\n@Injectable()\nexport class Testability implements PublicTestability {\n private _pendingCount: number = 0;\n private _isZoneStable: boolean = true;\n /**\n * Whether any work was done since the last 'whenStable' callback. This is\n * useful to detect if this could have potentially destabilized another\n * component while it is stabilizing.\n * @internal\n */\n private _didWork: boolean = false;\n private _callbacks: WaitCallback[] = [];\n\n private taskTrackingZone: any;\n\n constructor(private _ngZone: NgZone) {\n this._watchAngularEvents();\n _ngZone.run(() => { this.taskTrackingZone = Zone.current.get('TaskTrackingZone'); });\n }\n\n private _watchAngularEvents(): void {\n this._ngZone.onUnstable.subscribe({\n next: () => {\n this._didWork = true;\n this._isZoneStable = false;\n }\n });\n\n this._ngZone.runOutsideAngular(() => {\n this._ngZone.onStable.subscribe({\n next: () => {\n NgZone.assertNotInAngularZone();\n scheduleMicroTask(() => {\n this._isZoneStable = true;\n this._runCallbacksIfReady();\n });\n }\n });\n });\n }\n\n /**\n * Increases the number of pending request\n * @deprecated pending requests are now tracked with zones.\n */\n increasePendingRequestCount(): number {\n this._pendingCount += 1;\n this._didWork = true;\n return this._pendingCount;\n }\n\n /**\n * Decreases the number of pending request\n * @deprecated pending requests are now tracked with zones\n */\n decreasePendingRequestCount(): number {\n this._pendingCount -= 1;\n if (this._pendingCount < 0) {\n throw new Error('pending async requests below zero');\n }\n this._runCallbacksIfReady();\n return this._pendingCount;\n }\n\n /**\n * Whether an associated application is stable\n */\n isStable(): boolean {\n return this._isZoneStable && this._pendingCount === 0 && !this._ngZone.hasPendingMacrotasks;\n }\n\n private _runCallbacksIfReady(): void {\n if (this.isStable()) {\n // Schedules the call backs in a new frame so that it is always async.\n scheduleMicroTask(() => {\n while (this._callbacks.length !== 0) {\n let cb = this._callbacks.pop() !;\n clearTimeout(cb.timeoutId);\n cb.doneCb(this._didWork);\n }\n this._didWork = false;\n });\n } else {\n // Still not stable, send updates.\n let pending = this.getPendingTasks();\n this._callbacks = this._callbacks.filter((cb) => {\n if (cb.updateCb && cb.updateCb(pending)) {\n clearTimeout(cb.timeoutId);\n return false;\n }\n\n return true;\n });\n\n this._didWork = true;\n }\n }\n\n private getPendingTasks(): PendingMacrotask[] {\n if (!this.taskTrackingZone) {\n return [];\n }\n\n return this.taskTrackingZone.macroTasks.map((t: Task) => {\n return {\n source: t.source,\n isPeriodic: t.data.isPeriodic,\n delay: t.data.delay,\n // From TaskTrackingZone:\n // https://github.com/angular/zone.js/blob/master/lib/zone-spec/task-tracking.ts#L40\n creationLocation: (t as any).creationLocation as Error,\n // Added by Zones for XHRs\n // https://github.com/angular/zone.js/blob/master/lib/browser/browser.ts#L133\n xhr: (t.data as any).target\n };\n });\n }\n\n private addCallback(cb: DoneCallback, timeout?: number, updateCb?: UpdateCallback) {\n let timeoutId: any = -1;\n if (timeout && timeout > 0) {\n timeoutId = setTimeout(() => {\n this._callbacks = this._callbacks.filter((cb) => cb.timeoutId !== timeoutId);\n cb(this._didWork, this.getPendingTasks());\n }, timeout);\n }\n this._callbacks.push(<WaitCallback>{doneCb: cb, timeoutId: timeoutId, updateCb: updateCb});\n }\n\n /**\n * Wait for the application to be stable with a timeout. If the timeout is reached before that\n * happens, the callback receives a list of the macro tasks that were pending, otherwise null.\n *\n * @param doneCb The callback to invoke when Angular is stable or the timeout expires\n * whichever comes first.\n * @param timeout Optional. The maximum time to wait for Angular to become stable. If not\n * specified, whenStable() will wait forever.\n * @param updateCb Optional. If specified, this callback will be invoked whenever the set of\n * pending macrotasks changes. If this callback returns true doneCb will not be invoked\n * and no further updates will be issued.\n */\n whenStable(doneCb: Function, timeout?: number, updateCb?: Function): void {\n if (updateCb && !this.taskTrackingZone) {\n throw new Error(\n 'Task tracking zone is required when passing an update callback to ' +\n 'whenStable(). Is \"zone.js/dist/task-tracking.js\" loaded?');\n }\n // These arguments are 'Function' above to keep the public API simple.\n this.addCallback(doneCb as DoneCallback, timeout, updateCb as UpdateCallback);\n this._runCallbacksIfReady();\n }\n\n /**\n * Get the number of pending requests\n * @deprecated pending requests are now tracked with zones\n */\n getPendingRequestCount(): number { return this._pendingCount; }\n\n /**\n * Find providers by name\n * @param using The root element to search from\n * @param provider The name of binding variable\n * @param exactMatch Whether using exactMatch\n */\n findProviders(using: any, provider: string, exactMatch: boolean): any[] {\n // TODO(juliemr): implement.\n return [];\n }\n}\n\n/**\n * A global registry of {@link Testability} instances for specific elements.\n * @experimental\n */\n@Injectable()\nexport class TestabilityRegistry {\n /** @internal */\n _applications = new Map<any, Testability>();\n\n constructor() { _testabilityGetter.addToWindow(this); }\n\n /**\n * Registers an application with a testability hook so that it can be tracked\n * @param token token of application, root element\n * @param testability Testability hook\n */\n registerApplication(token: any, testability: Testability) {\n this._applications.set(token, testability);\n }\n\n /**\n * Unregisters an application.\n * @param token token of application, root element\n */\n unregisterApplication(token: any) { this._applications.delete(token); }\n\n /**\n * Unregisters all applications\n */\n unregisterAllApplications() { this._applications.clear(); }\n\n /**\n * Get a testability hook associated with the application\n * @param elem root element\n */\n getTestability(elem: any): Testability|null { return this._applications.get(elem) || null; }\n\n /**\n * Get all registered testabilities\n */\n getAllTestabilities(): Testability[] { return Array.from(this._applications.values()); }\n\n /**\n * Get all registered applications(root elements)\n */\n getAllRootElements(): any[] { return Array.from(this._applications.keys()); }\n\n /**\n * Find testability of a node in the Tree\n * @param elem node\n * @param findInAncestors whether finding testability in ancestors if testability was not found in\n * current node\n */\n findTestabilityInTree(elem: Node, findInAncestors: boolean = true): Testability|null {\n return _testabilityGetter.findTestabilityInTree(this, elem, findInAncestors);\n }\n}\n\n/**\n * Adapter interface for retrieving the `Testability` service associated for a\n * particular context.\n *\n * @experimental Testability apis are primarily intended to be used by e2e test tool vendors like\n * the Protractor team.\n */\nexport interface GetTestability {\n addToWindow(registry: TestabilityRegistry): void;\n findTestabilityInTree(registry: TestabilityRegistry, elem: any, findInAncestors: boolean):\n Testability|null;\n}\n\nclass _NoopGetTestability implements GetTestability {\n addToWindow(registry: TestabilityRegistry): void {}\n findTestabilityInTree(registry: TestabilityRegistry, elem: any, findInAncestors: boolean):\n Testability|null {\n return null;\n }\n}\n\n/**\n * Set the {@link GetTestability} implementation used by the Angular testing framework.\n * @experimental\n */\nexport function setTestabilityGetter(getter: GetTestability): void {\n _testabilityGetter = getter;\n}\n\nlet _testabilityGetter: GetTestability = new _NoopGetTestability();\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Observable, Observer, Subscription, merge} from 'rxjs';\nimport {share} from 'rxjs/operators';\n\nimport {ErrorHandler} from '../src/error_handler';\nimport {scheduleMicroTask, stringify} from '../src/util';\nimport {isPromise} from '../src/util/lang';\n\nimport {ApplicationInitStatus} from './application_init';\nimport {APP_BOOTSTRAP_LISTENER, PLATFORM_INITIALIZER} from './application_tokens';\nimport {Console} from './console';\nimport {Injectable, InjectionToken, Injector, StaticProvider} from './di';\nimport {CompilerFactory, CompilerOptions} from './linker/compiler';\nimport {ComponentFactory, ComponentRef} from './linker/component_factory';\nimport {ComponentFactoryBoundToModule, ComponentFactoryResolver} from './linker/component_factory_resolver';\nimport {InternalNgModuleRef, NgModuleFactory, NgModuleRef} from './linker/ng_module_factory';\nimport {InternalViewRef, ViewRef} from './linker/view_ref';\nimport {WtfScopeFn, wtfCreateScope, wtfLeave} from './profile/profile';\nimport {Testability, TestabilityRegistry} from './testability/testability';\nimport {Type} from './type';\nimport {NgZone, NoopNgZone} from './zone/ng_zone';\n\nlet _devMode: boolean = true;\nlet _runModeLocked: boolean = false;\nlet _platform: PlatformRef;\n\nexport const ALLOW_MULTIPLE_PLATFORMS = new InjectionToken<boolean>('AllowMultipleToken');\n\n/**\n * Disable Angular's development mode, which turns off assertions and other\n * checks within the framework.\n *\n * One important assertion this disables verifies that a change detection pass\n * does not result in additional changes to any bindings (also known as\n * unidirectional data flow).\n *\n *\n */\nexport function enableProdMode(): void {\n if (_runModeLocked) {\n throw new Error('Cannot enable prod mode after platform setup.');\n }\n _devMode = false;\n}\n\n/**\n * Returns whether Angular is in development mode. After called once,\n * the value is locked and won't change any more.\n *\n * By default, this is true, unless a user calls `enableProdMode` before calling this.\n *\n * @experimental APIs related to application bootstrap are currently under review.\n */\nexport function isDevMode(): boolean {\n _runModeLocked = true;\n return _devMode;\n}\n\n/**\n * A token for third-party components that can register themselves with NgProbe.\n *\n * @experimental\n */\nexport class NgProbeToken {\n constructor(public name: string, public token: any) {}\n}\n\n/**\n * Creates a platform.\n * Platforms have to be eagerly created via this function.\n *\n * @experimental APIs related to application bootstrap are currently under review.\n */\nexport function createPlatform(injector: Injector): PlatformRef {\n if (_platform && !_platform.destroyed &&\n !_platform.injector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {\n throw new Error(\n 'There can be only one platform. Destroy the previous one to create a new one.');\n }\n _platform = injector.get(PlatformRef);\n const inits = injector.get(PLATFORM_INITIALIZER, null);\n if (inits) inits.forEach((init: any) => init());\n return _platform;\n}\n\n/**\n * Creates a factory for a platform\n *\n * @experimental APIs related to application bootstrap are currently under review.\n */\nexport function createPlatformFactory(\n parentPlatformFactory: ((extraProviders?: StaticProvider[]) => PlatformRef) | null,\n name: string, providers: StaticProvider[] = []): (extraProviders?: StaticProvider[]) =>\n PlatformRef {\n const desc = `Platform: ${name}`;\n const marker = new InjectionToken(desc);\n return (extraProviders: StaticProvider[] = []) => {\n let platform = getPlatform();\n if (!platform || platform.injector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {\n if (parentPlatformFactory) {\n parentPlatformFactory(\n providers.concat(extraProviders).concat({provide: marker, useValue: true}));\n } else {\n const injectedProviders: StaticProvider[] =\n providers.concat(extraProviders).concat({provide: marker, useValue: true});\n createPlatform(Injector.create({providers: injectedProviders, name: desc}));\n }\n }\n return assertPlatform(marker);\n };\n}\n\n/**\n * Checks that there currently is a platform which contains the given token as a provider.\n *\n * @experimental APIs related to application bootstrap are currently under review.\n */\nexport function assertPlatform(requiredToken: any): PlatformRef {\n const platform = getPlatform();\n\n if (!platform) {\n throw new Error('No platform exists!');\n }\n\n if (!platform.injector.get(requiredToken, null)) {\n throw new Error(\n 'A platform with a different configuration has been created. Please destroy it first.');\n }\n\n return platform;\n}\n\n/**\n * Destroy the existing platform.\n *\n * @experimental APIs related to application bootstrap are currently under review.\n */\nexport function destroyPlatform(): void {\n if (_platform && !_platform.destroyed) {\n _platform.destroy();\n }\n}\n\n/**\n * Returns the current platform.\n *\n * @experimental APIs related to application bootstrap are currently under review.\n */\nexport function getPlatform(): PlatformRef|null {\n return _platform && !_platform.destroyed ? _platform : null;\n}\n\n/**\n * Provides additional options to the bootstraping process.\n *\n *\n */\nexport interface BootstrapOptions {\n /**\n * Optionally specify which `NgZone` should be used.\n *\n * - Provide your own `NgZone` instance.\n * - `zone.js` - Use default `NgZone` which requires `Zone.js`.\n * - `noop` - Use `NoopNgZone` which does nothing.\n */\n ngZone?: NgZone|'zone.js'|'noop';\n}\n\n/**\n * The Angular platform is the entry point for Angular on a web page. Each page\n * has exactly one platform, and services (such as reflection) which are common\n * to every Angular application running on the page are bound in its scope.\n *\n * A page's platform is initialized implicitly when a platform is created via a platform factory\n * (e.g. {@link platformBrowser}), or explicitly by calling the {@link createPlatform} function.\n */\n@Injectable()\nexport class PlatformRef {\n private _modules: NgModuleRef<any>[] = [];\n private _destroyListeners: Function[] = [];\n private _destroyed: boolean = false;\n\n /** @internal */\n constructor(private _injector: Injector) {}\n\n /**\n * Creates an instance of an `@NgModule` for the given platform\n * for offline compilation.\n *\n * @usageNotes\n * ### Simple Example\n *\n * ```typescript\n * my_module.ts:\n *\n * @NgModule({\n * imports: [BrowserModule]\n * })\n * class MyModule {}\n *\n * main.ts:\n * import {MyModuleNgFactory} from './my_module.ngfactory';\n * import {platformBrowser} from '@angular/platform-browser';\n *\n * let moduleRef = platformBrowser().bootstrapModuleFactory(MyModuleNgFactory);\n * ```\n *\n * @experimental APIs related to application bootstrap are currently under review.\n */\n bootstrapModuleFactory<M>(moduleFactory: NgModuleFactory<M>, options?: BootstrapOptions):\n Promise<NgModuleRef<M>> {\n // Note: We need to create the NgZone _before_ we instantiate the module,\n // as instantiating the module creates some providers eagerly.\n // So we create a mini parent injector that just contains the new NgZone and\n // pass that as parent to the NgModuleFactory.\n const ngZoneOption = options ? options.ngZone : undefined;\n const ngZone = getNgZone(ngZoneOption);\n const providers: StaticProvider[] = [{provide: NgZone, useValue: ngZone}];\n // Attention: Don't use ApplicationRef.run here,\n // as we want to be sure that all possible constructor calls are inside `ngZone.run`!\n return ngZone.run(() => {\n const ngZoneInjector = Injector.create(\n {providers: providers, parent: this.injector, name: moduleFactory.moduleType.name});\n const moduleRef = <InternalNgModuleRef<M>>moduleFactory.create(ngZoneInjector);\n const exceptionHandler: ErrorHandler = moduleRef.injector.get(ErrorHandler, null);\n if (!exceptionHandler) {\n throw new Error('No ErrorHandler. Is platform module (BrowserModule) included?');\n }\n moduleRef.onDestroy(() => remove(this._modules, moduleRef));\n ngZone !.runOutsideAngular(\n () => ngZone !.onError.subscribe(\n {next: (error: any) => { exceptionHandler.handleError(error); }}));\n return _callAndReportToErrorHandler(exceptionHandler, ngZone !, () => {\n const initStatus: ApplicationInitStatus = moduleRef.injector.get(ApplicationInitStatus);\n initStatus.runInitializers();\n return initStatus.donePromise.then(() => {\n this._moduleDoBootstrap(moduleRef);\n return moduleRef;\n });\n });\n });\n }\n\n /**\n * Creates an instance of an `@NgModule` for a given platform using the given runtime compiler.\n *\n * @usageNotes\n * ### Simple Example\n *\n * ```typescript\n * @NgModule({\n * imports: [BrowserModule]\n * })\n * class MyModule {}\n *\n * let moduleRef = platformBrowser().bootstrapModule(MyModule);\n * ```\n *\n */\n bootstrapModule<M>(\n moduleType: Type<M>, compilerOptions: (CompilerOptions&BootstrapOptions)|\n Array<CompilerOptions&BootstrapOptions> = []): Promise<NgModuleRef<M>> {\n const compilerFactory: CompilerFactory = this.injector.get(CompilerFactory);\n const options = optionsReducer({}, compilerOptions);\n const compiler = compilerFactory.createCompiler([options]);\n\n return compiler.compileModuleAsync(moduleType)\n .then((moduleFactory) => this.bootstrapModuleFactory(moduleFactory, options));\n }\n\n private _moduleDoBootstrap(moduleRef: InternalNgModuleRef<any>): void {\n const appRef = moduleRef.injector.get(ApplicationRef) as ApplicationRef;\n if (moduleRef._bootstrapComponents.length > 0) {\n moduleRef._bootstrapComponents.forEach(f => appRef.bootstrap(f));\n } else if (moduleRef.instance.ngDoBootstrap) {\n moduleRef.instance.ngDoBootstrap(appRef);\n } else {\n throw new Error(\n `The module ${stringify(moduleRef.instance.constructor)} was bootstrapped, but it does not declare \"@NgModule.bootstrap\" components nor a \"ngDoBootstrap\" method. ` +\n `Please define one of these.`);\n }\n this._modules.push(moduleRef);\n }\n\n /**\n * Register a listener to be called when the platform is disposed.\n */\n onDestroy(callback: () => void): void { this._destroyListeners.push(callback); }\n\n /**\n * Retrieve the platform {@link Injector}, which is the parent injector for\n * every Angular application on the page and provides singleton providers.\n */\n get injector(): Injector { return this._injector; }\n\n /**\n * Destroy the Angular platform and all Angular applications on the page.\n */\n destroy() {\n if (this._destroyed) {\n throw new Error('The platform has already been destroyed!');\n }\n this._modules.slice().forEach(module => module.destroy());\n this._destroyListeners.forEach(listener => listener());\n this._destroyed = true;\n }\n\n get destroyed() { return this._destroyed; }\n}\n\nfunction getNgZone(ngZoneOption?: NgZone | 'zone.js' | 'noop'): NgZone {\n let ngZone: NgZone;\n\n if (ngZoneOption === 'noop') {\n ngZone = new NoopNgZone();\n } else {\n ngZone = (ngZoneOption === 'zone.js' ? undefined : ngZoneOption) ||\n new NgZone({enableLongStackTrace: isDevMode()});\n }\n return ngZone;\n}\n\nfunction _callAndReportToErrorHandler(\n errorHandler: ErrorHandler, ngZone: NgZone, callback: () => any): any {\n try {\n const result = callback();\n if (isPromise(result)) {\n return result.catch((e: any) => {\n ngZone.runOutsideAngular(() => errorHandler.handleError(e));\n // rethrow as the exception handler might not do it\n throw e;\n });\n }\n\n return result;\n } catch (e) {\n ngZone.runOutsideAngular(() => errorHandler.handleError(e));\n // rethrow as the exception handler might not do it\n throw e;\n }\n}\n\nfunction optionsReducer<T extends Object>(dst: any, objs: T | T[]): T {\n if (Array.isArray(objs)) {\n dst = objs.reduce(optionsReducer, dst);\n } else {\n dst = {...dst, ...(objs as any)};\n }\n return dst;\n}\n\n/**\n * A reference to an Angular application running on a page.\n */\n@Injectable()\nexport class ApplicationRef {\n /** @internal */\n static _tickScope: WtfScopeFn = wtfCreateScope('ApplicationRef#tick()');\n private _bootstrapListeners: ((compRef: ComponentRef<any>) => void)[] = [];\n private _views: InternalViewRef[] = [];\n private _runningTick: boolean = false;\n private _enforceNoNewChanges: boolean = false;\n private _stable = true;\n\n /**\n * Get a list of component types registered to this application.\n * This list is populated even before the component is created.\n */\n public readonly componentTypes: Type<any>[] = [];\n\n /**\n * Get a list of components registered to this application.\n */\n public readonly components: ComponentRef<any>[] = [];\n\n /**\n * Returns an Observable that indicates when the application is stable or unstable.\n */\n // TODO(issue/24571): remove '!'.\n public readonly isStable !: Observable<boolean>;\n\n /** @internal */\n constructor(\n private _zone: NgZone, private _console: Console, private _injector: Injector,\n private _exceptionHandler: ErrorHandler,\n private _componentFactoryResolver: ComponentFactoryResolver,\n private _initStatus: ApplicationInitStatus) {\n this._enforceNoNewChanges = isDevMode();\n\n this._zone.onMicrotaskEmpty.subscribe(\n {next: () => { this._zone.run(() => { this.tick(); }); }});\n\n const isCurrentlyStable = new Observable<boolean>((observer: Observer<boolean>) => {\n this._stable = this._zone.isStable && !this._zone.hasPendingMacrotasks &&\n !this._zone.hasPendingMicrotasks;\n this._zone.runOutsideAngular(() => {\n observer.next(this._stable);\n observer.complete();\n });\n });\n\n const isStable = new Observable<boolean>((observer: Observer<boolean>) => {\n // Create the subscription to onStable outside the Angular Zone so that\n // the callback is run outside the Angular Zone.\n let stableSub: Subscription;\n this._zone.runOutsideAngular(() => {\n stableSub = this._zone.onStable.subscribe(() => {\n NgZone.assertNotInAngularZone();\n\n // Check whether there are no pending macro/micro tasks in the next tick\n // to allow for NgZone to update the state.\n scheduleMicroTask(() => {\n if (!this._stable && !this._zone.hasPendingMacrotasks &&\n !this._zone.hasPendingMicrotasks) {\n this._stable = true;\n observer.next(true);\n }\n });\n });\n });\n\n const unstableSub: Subscription = this._zone.onUnstable.subscribe(() => {\n NgZone.assertInAngularZone();\n if (this._stable) {\n this._stable = false;\n this._zone.runOutsideAngular(() => { observer.next(false); });\n }\n });\n\n return () => {\n stableSub.unsubscribe();\n unstableSub.unsubscribe();\n };\n });\n\n (this as{isStable: Observable<boolean>}).isStable =\n merge(isCurrentlyStable, isStable.pipe(share()));\n }\n\n /**\n * Bootstrap a new component at the root level of the application.\n *\n * @usageNotes\n * ### Bootstrap process\n *\n * When bootstrapping a new root component into an application, Angular mounts the\n * specified application component onto DOM elements identified by the componentType's\n * selector and kicks off automatic change detection to finish initializing the component.\n *\n * Optionally, a component can be mounted onto a DOM element that does not match the\n * componentType's selector.\n *\n * ### Example\n * {@example core/ts/platform/platform.ts region='longform'}\n */\n bootstrap<C>(componentOrFactory: ComponentFactory<C>|Type<C>, rootSelectorOrNode?: string|any):\n ComponentRef<C> {\n if (!this._initStatus.done) {\n throw new Error(\n 'Cannot bootstrap as there are still asynchronous initializers running. Bootstrap components in the `ngDoBootstrap` method of the root module.');\n }\n let componentFactory: ComponentFactory<C>;\n if (componentOrFactory instanceof ComponentFactory) {\n componentFactory = componentOrFactory;\n } else {\n componentFactory =\n this._componentFactoryResolver.resolveComponentFactory(componentOrFactory) !;\n }\n this.componentTypes.push(componentFactory.componentType);\n\n // Create a factory associated with the current module if it's not bound to some other\n const ngModule = componentFactory instanceof ComponentFactoryBoundToModule ?\n null :\n this._injector.get(NgModuleRef);\n const selectorOrNode = rootSelectorOrNode || componentFactory.selector;\n const compRef = componentFactory.create(Injector.NULL, [], selectorOrNode, ngModule);\n\n compRef.onDestroy(() => { this._unloadComponent(compRef); });\n const testability = compRef.injector.get(Testability, null);\n if (testability) {\n compRef.injector.get(TestabilityRegistry)\n .registerApplication(compRef.location.nativeElement, testability);\n }\n\n this._loadComponent(compRef);\n if (isDevMode()) {\n this._console.log(\n `Angular is running in the development mode. Call enableProdMode() to enable the production mode.`);\n }\n return compRef;\n }\n\n /**\n * Invoke this method to explicitly process change detection and its side-effects.\n *\n * In development mode, `tick()` also performs a second change detection cycle to ensure that no\n * further changes are detected. If additional changes are picked up during this second cycle,\n * bindings in the app have side-effects that cannot be resolved in a single change detection\n * pass.\n * In this case, Angular throws an error, since an Angular application can only have one change\n * detection pass during which all change detection must complete.\n */\n tick(): void {\n if (this._runningTick) {\n throw new Error('ApplicationRef.tick is called recursively');\n }\n\n const scope = ApplicationRef._tickScope();\n try {\n this._runningTick = true;\n this._views.forEach((view) => view.detectChanges());\n if (this._enforceNoNewChanges) {\n this._views.forEach((view) => view.checkNoChanges());\n }\n } catch (e) {\n // Attention: Don't rethrow as it could cancel subscriptions to Observables!\n this._zone.runOutsideAngular(() => this._exceptionHandler.handleError(e));\n } finally {\n this._runningTick = false;\n wtfLeave(scope);\n }\n }\n\n /**\n * Attaches a view so that it will be dirty checked.\n * The view will be automatically detached when it is destroyed.\n * This will throw if the view is already attached to a ViewContainer.\n */\n attachView(viewRef: ViewRef): void {\n const view = (viewRef as InternalViewRef);\n this._views.push(view);\n view.attachToAppRef(this);\n }\n\n /**\n * Detaches a view from dirty checking again.\n */\n detachView(viewRef: ViewRef): void {\n const view = (viewRef as InternalViewRef);\n remove(this._views, view);\n view.detachFromAppRef();\n }\n\n private _loadComponent(componentRef: ComponentRef<any>): void {\n this.attachView(componentRef.hostView);\n this.tick();\n this.components.push(componentRef);\n // Get the listeners lazily to prevent DI cycles.\n const listeners =\n this._injector.get(APP_BOOTSTRAP_LISTENER, []).concat(this._bootstrapListeners);\n listeners.forEach((listener) => listener(componentRef));\n }\n\n private _unloadComponent(componentRef: ComponentRef<any>): void {\n this.detachView(componentRef.hostView);\n remove(this.components, componentRef);\n }\n\n /** @internal */\n ngOnDestroy() {\n // TODO(alxhub): Dispose of the NgZone.\n this._views.slice().forEach((view) => view.destroy());\n }\n\n /**\n * Returns the number of attached views.\n */\n get viewCount() { return this._views.length; }\n}\n\nfunction remove<T>(list: T[], el: T): void {\n const index = list.indexOf(el);\n if (index > -1) {\n list.splice(index, 1);\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n// Public API for Zone\nexport {NgZone, NoopNgZone as ɵNoopNgZone} from './zone/ng_zone';\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {InjectionToken, Injector} from '../di';\nimport {ViewEncapsulation} from '../metadata/view';\n\n/**\n * @deprecated Use `RendererType2` (and `Renderer2`) instead.\n */\nexport class RenderComponentType {\n constructor(\n public id: string, public templateUrl: string, public slotCount: number,\n public encapsulation: ViewEncapsulation, public styles: Array<string|any[]>,\n public animations: any) {}\n}\n\n/**\n * @deprecated Debug info is handeled internally in the view engine now.\n */\nexport abstract class RenderDebugInfo {\n abstract get injector(): Injector;\n abstract get component(): any;\n abstract get providerTokens(): any[];\n abstract get references(): {[key: string]: any};\n abstract get context(): any;\n abstract get source(): string;\n}\n\n/**\n * @deprecated Use the `Renderer2` instead.\n */\nexport interface DirectRenderer {\n remove(node: any): void;\n appendChild(node: any, parent: any): void;\n insertBefore(node: any, refNode: any): void;\n nextSibling(node: any): any;\n parentElement(node: any): any;\n}\n\n/**\n * @deprecated Use the `Renderer2` instead.\n */\nexport abstract class Renderer {\n abstract selectRootElement(selectorOrNode: string|any, debugInfo?: RenderDebugInfo): any;\n\n abstract createElement(parentElement: any, name: string, debugInfo?: RenderDebugInfo): any;\n\n abstract createViewRoot(hostElement: any): any;\n\n abstract createTemplateAnchor(parentElement: any, debugInfo?: RenderDebugInfo): any;\n\n abstract createText(parentElement: any, value: string, debugInfo?: RenderDebugInfo): any;\n\n abstract projectNodes(parentElement: any, nodes: any[]): void;\n\n abstract attachViewAfter(node: any, viewRootNodes: any[]): void;\n\n abstract detachView(viewRootNodes: any[]): void;\n\n abstract destroyView(hostElement: any, viewAllNodes: any[]): void;\n\n abstract listen(renderElement: any, name: string, callback: Function): Function;\n\n abstract listenGlobal(target: string, name: string, callback: Function): Function;\n\n abstract setElementProperty(renderElement: any, propertyName: string, propertyValue: any): void;\n\n abstract setElementAttribute(renderElement: any, attributeName: string, attributeValue: string):\n void;\n\n /**\n * Used only in debug mode to serialize property changes to dom nodes as attributes.\n */\n abstract setBindingDebugInfo(renderElement: any, propertyName: string, propertyValue: string):\n void;\n\n abstract setElementClass(renderElement: any, className: string, isAdd: boolean): void;\n\n abstract setElementStyle(renderElement: any, styleName: string, styleValue: string): void;\n\n abstract invokeElementMethod(renderElement: any, methodName: string, args?: any[]): void;\n\n abstract setText(renderNode: any, text: string): void;\n\n abstract animate(\n element: any, startingStyles: any, keyframes: any[], duration: number, delay: number,\n easing: string, previousPlayers?: any[]): any;\n}\n\nexport const Renderer2Interceptor = new InjectionToken<Renderer2[]>('Renderer2Interceptor');\n\n/**\n * Injectable service that provides a low-level interface for modifying the UI.\n *\n * Use this service to bypass Angular's templating and make custom UI changes that can't be\n * expressed declaratively. For example if you need to set a property or an attribute whose name is\n * not statically known, use {@link Renderer#setElementProperty setElementProperty} or\n * {@link Renderer#setElementAttribute setElementAttribute} respectively.\n *\n * If you are implementing a custom renderer, you must implement this interface.\n *\n * The default Renderer implementation is `DomRenderer`. Also available is `WebWorkerRenderer`.\n *\n * @deprecated Use `RendererFactory2` instead.\n */\nexport abstract class RootRenderer {\n abstract renderComponent(componentType: RenderComponentType): Renderer;\n}\n\n/**\n * Used by `RendererFactory2` to associate custom rendering data and styles\n * with a rendering implementation.\n * @experimental\n */\nexport interface RendererType2 {\n /**\n * A unique identifying string for the new renderer, used when creating\n * unique styles for encapsulation.\n */\n id: string;\n /**\n * The view encapsulation type, which determines how styles are applied to\n * DOM elements. One of\n * - `Emulated` (default): Emulate native scoping of styles.\n * - `Native`: Use the native encapsulation mechanism of the renderer.\n * - `ShadowDom`: Use modern [Shadow\n * DOM](https://w3c.github.io/webcomponents/spec/shadow/) and\n * create a ShadowRoot for component's host element.\n * - `None`: Do not provide any template or style encapsulation.\n */\n encapsulation: ViewEncapsulation;\n /**\n * Defines CSS styles to be stored on a renderer instance.\n */\n styles: (string|any[])[];\n /**\n * Defines arbitrary developer-defined data to be stored on a renderer instance.\n * This is useful for renderers that delegate to other renderers.\n */\n data: {[kind: string]: any};\n}\n\n/**\n * Creates and initializes a custom renderer that implements the `Renderer2` base class.\n *\n * @experimental\n */\nexport abstract class RendererFactory2 {\n /**\n * Creates and initializes a custom renderer for a host DOM element.\n * @param hostElement The element to render.\n * @param type The base class to implement.\n * @returns The new custom renderer instance.\n */\n abstract createRenderer(hostElement: any, type: RendererType2|null): Renderer2;\n /**\n * A callback invoked when rendering has begun.\n */\n abstract begin?(): void;\n /**\n * A callback invoked when rendering has completed.\n */\n abstract end?(): void;\n /**\n * Use with animations test-only mode. Notifies the test when rendering has completed.\n * @returns The asynchronous result of the developer-defined function.\n */\n abstract whenRenderingDone?(): Promise<any>;\n}\n\n/**\n * Flags for renderer-specific style modifiers.\n * @experimental\n */\nexport enum RendererStyleFlags2 {\n /**\n * Marks a style as important.\n */\n Important = 1 << 0,\n /**\n * Marks a style as using dash case naming (this-is-dash-case).\n */\n DashCase = 1 << 1\n}\n\n/**\n * Extend this base class to implement custom rendering. By default, Angular\n * renders a template into DOM. You can use custom rendering to intercept\n * rendering calls, or to render to something other than DOM.\n *\n * Create your custom renderer using `RendererFactory2`.\n *\n * Use a custom renderer to bypass Angular's templating and\n * make custom UI changes that can't be expressed declaratively.\n * For example if you need to set a property or an attribute whose name is\n * not statically known, use the `setProperty()` or\n * `setAttribute()` method.\n *\n * @experimental\n */\nexport abstract class Renderer2 {\n /**\n * Use to store arbitrary developer-defined data on a renderer instance,\n * as an object containing key-value pairs.\n * This is useful for renderers that delegate to other renderers.\n */\n abstract get data(): {[key: string]: any};\n\n /**\n * Implement this callback to destroy the renderer or the host element.\n */\n abstract destroy(): void;\n /**\n * Implement this callback to create an instance of the host element.\n * @param name An identifying name for the new element, unique within the namespace.\n * @param namespace The namespace for the new element.\n * @returns The new element.\n */\n abstract createElement(name: string, namespace?: string|null): any;\n /**\n * Implement this callback to add a comment to the DOM of the host element.\n * @param value The comment text.\n * @returns The modified element.\n */\n abstract createComment(value: string): any;\n\n /**\n * Implement this callback to add text to the DOM of the host element.\n * @param value The text string.\n * @returns The modified element.\n */\n abstract createText(value: string): any;\n /**\n * If null or undefined, the view engine won't call it.\n * This is used as a performance optimization for production mode.\n */\n // TODO(issue/24571): remove '!'.\n destroyNode !: ((node: any) => void) | null;\n /**\n * Appends a child to a given parent node in the host element DOM.\n * @param parent The parent node.\n * @param newChild The new child node.\n */\n abstract appendChild(parent: any, newChild: any): void;\n /**\n * Implement this callback to insert a child node at a given position in a parent node\n * in the host element DOM.\n * @param parent The parent node.\n * @param newChild The new child nodes.\n * @param refChild The existing child node that should precede the new node.\n */\n abstract insertBefore(parent: any, newChild: any, refChild: any): void;\n /**\n * Implement this callback to remove a child node from the host element's DOM.\n * @param parent The parent node.\n * @param oldChild The child node to remove.\n */\n abstract removeChild(parent: any, oldChild: any): void;\n /**\n * Implement this callback to prepare an element to be bootstrapped\n * as a root element, and return the element instance.\n * @param selectorOrNode The DOM element.\n * @returns The root element.\n */\n abstract selectRootElement(selectorOrNode: string|any): any;\n /**\n * Implement this callback to get the parent of a given node\n * in the host element's DOM.\n * @param node The child node to query.\n * @returns The parent node, or null if there is no parent.\n * For WebWorkers, always returns true.\n * This is because the check is synchronous,\n * and the caller can't rely on checking for null.\n */\n abstract parentNode(node: any): any;\n /**\n * Implement this callback to get the next sibling node of a given node\n * in the host element's DOM.\n * @returns The sibling node, or null if there is no sibling.\n * For WebWorkers, always returns a value.\n * This is because the check is synchronous,\n * and the caller can't rely on checking for null.\n */\n abstract nextSibling(node: any): any;\n /**\n * Implement this callback to set an attribute value for an element in the DOM.\n * @param el The element.\n * @param name The attribute name.\n * @param value The new value.\n * @param namespace The namespace.\n */\n abstract setAttribute(el: any, name: string, value: string, namespace?: string|null): void;\n\n /**\n * Implement this callback to remove an attribute from an element in the DOM.\n * @param el The element.\n * @param name The attribute name.\n * @param namespace The namespace.\n */\n abstract removeAttribute(el: any, name: string, namespace?: string|null): void;\n /**\n * Implement this callback to add a class to an element in the DOM.\n * @param el The element.\n * @param name The class name.\n */\n abstract addClass(el: any, name: string): void;\n\n /**\n * Implement this callback to remove a class from an element in the DOM.\n * @param el The element.\n * @param name The class name.\n */\n abstract removeClass(el: any, name: string): void;\n\n /**\n * Implement this callback to set a CSS style for an element in the DOM.\n * @param el The element.\n * @param style The name of the style.\n * @param value The new value.\n * @param flags Flags for style variations. No flags are set by default.\n */\n abstract setStyle(el: any, style: string, value: any, flags?: RendererStyleFlags2): void;\n\n /**\n * Implement this callback to remove the value from a CSS style for an element in the DOM.\n * @param el The element.\n * @param style The name of the style.\n * @param flags Flags for style variations to remove, if set. ???\n */\n abstract removeStyle(el: any, style: string, flags?: RendererStyleFlags2): void;\n\n /**\n * Implement this callback to set the value of a property of an element in the DOM.\n * @param el The element.\n * @param name The property name.\n * @param value The new value.\n */\n abstract setProperty(el: any, name: string, value: any): void;\n\n /**\n * Implement this callback to set the value of a node in the host element.\n * @param node The node.\n * @param value The new value.\n */\n abstract setValue(node: any, value: string): void;\n\n /**\n * Implement this callback to start an event listener.\n * @param target The context in which to listen for events. Can be\n * the entire window or document, the body of the document, or a specific\n * DOM element.\n * @param eventName The event to listen for.\n * @param callback A handler function to invoke when the event occurs.\n * @returns An \"unlisten\" function for disposing of this handler.\n */\n abstract listen(\n target: 'window'|'document'|'body'|any, eventName: string,\n callback: (event: any) => boolean | void): () => void;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n// Public API for render\nexport {RenderComponentType, Renderer, Renderer2, RendererFactory2, RendererStyleFlags2, RendererType2, RootRenderer} from './render/api';\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * A wrapper around a native element inside of a View.\n *\n * An `ElementRef` is backed by a render-specific element. In the browser, this is usually a DOM\n * element.\n *\n * @security Permitting direct access to the DOM can make your application more vulnerable to\n * XSS attacks. Carefully review any use of `ElementRef` in your code. For more detail, see the\n * [Security Guide](http://g.co/ng/security).\n *\n *\n */\n// Note: We don't expose things like `Injector`, `ViewContainer`, ... here,\n// i.e. users have to ask for what they need. With that, we can build better analysis tools\n// and could do better codegen in the future.\nexport class ElementRef<T = any> {\n /**\n * The underlying native element or `null` if direct access to native elements is not supported\n * (e.g. when the application runs in a web worker).\n *\n * <div class=\"callout is-critical\">\n * <header>Use with caution</header>\n * <p>\n * Use this API as the last resort when direct access to DOM is needed. Use templating and\n * data-binding provided by Angular instead. Alternatively you can take a look at {@link\n * Renderer2}\n * which provides API that can safely be used even when direct access to native elements is not\n * supported.\n * </p>\n * <p>\n * Relying on direct DOM access creates tight coupling between your application and rendering\n * layers which will make it impossible to separate the two and deploy your application into a\n * web worker.\n * </p>\n * </div>\n *\n */\n public nativeElement: T;\n\n constructor(nativeElement: T) { this.nativeElement = nativeElement; }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {NgModuleFactory} from './ng_module_factory';\n\n/**\n * Used to load ng module factories.\n *\n */\nexport abstract class NgModuleFactoryLoader {\n abstract load(path: string): Promise<NgModuleFactory<any>>;\n}\n\nlet moduleFactories = new Map<string, NgModuleFactory<any>>();\n\n/**\n * Registers a loaded module. Should only be called from generated NgModuleFactory code.\n * @experimental\n */\nexport function registerModuleFactory(id: string, factory: NgModuleFactory<any>) {\n const existing = moduleFactories.get(id);\n if (existing) {\n throw new Error(`Duplicate module registered for ${id\n } - ${existing.moduleType.name} vs ${factory.moduleType.name}`);\n }\n moduleFactories.set(id, factory);\n}\n\nexport function clearModulesForTest() {\n moduleFactories = new Map<string, NgModuleFactory<any>>();\n}\n\n/**\n * Returns the NgModuleFactory with the given id, if it exists and has been loaded.\n * Factories for modules that do not specify an `id` cannot be retrieved. Throws if the module\n * cannot be found.\n * @experimental\n */\nexport function getModuleFactory(id: string): NgModuleFactory<any> {\n const factory = moduleFactories.get(id);\n if (!factory) throw new Error(`No module with ID ${id} loaded`);\n return factory;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Observable} from 'rxjs';\n\nimport {EventEmitter} from '../event_emitter';\nimport {getSymbolIterator} from '../util';\n\n\n/**\n * An unmodifiable list of items that Angular keeps up to date when the state\n * of the application changes.\n *\n * The type of object that {@link ViewChildren}, {@link ContentChildren}, and {@link QueryList}\n * provide.\n *\n * Implements an iterable interface, therefore it can be used in both ES6\n * javascript `for (var i of items)` loops as well as in Angular templates with\n * `*ngFor=\"let i of myList\"`.\n *\n * Changes can be observed by subscribing to the changes `Observable`.\n *\n * NOTE: In the future this class will implement an `Observable` interface.\n *\n * @usageNotes\n * ### Example\n * ```typescript\n * @Component({...})\n * class Container {\n * @ViewChildren(Item) items:QueryList<Item>;\n * }\n * ```\n */\nexport class QueryList<T>/* implements Iterable<T> */ {\n public readonly dirty = true;\n private _results: Array<T> = [];\n public readonly changes: Observable<any> = new EventEmitter();\n\n readonly length: number = 0;\n // TODO(issue/24571): remove '!'.\n readonly first !: T;\n // TODO(issue/24571): remove '!'.\n readonly last !: T;\n\n /**\n * See\n * [Array.map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)\n */\n map<U>(fn: (item: T, index: number, array: T[]) => U): U[] { return this._results.map(fn); }\n\n /**\n * See\n * [Array.filter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter)\n */\n filter(fn: (item: T, index: number, array: T[]) => boolean): T[] {\n return this._results.filter(fn);\n }\n\n /**\n * See\n * [Array.find](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find)\n */\n find(fn: (item: T, index: number, array: T[]) => boolean): T|undefined {\n return this._results.find(fn);\n }\n\n /**\n * See\n * [Array.reduce](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce)\n */\n reduce<U>(fn: (prevValue: U, curValue: T, curIndex: number, array: T[]) => U, init: U): U {\n return this._results.reduce(fn, init);\n }\n\n /**\n * See\n * [Array.forEach](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach)\n */\n forEach(fn: (item: T, index: number, array: T[]) => void): void { this._results.forEach(fn); }\n\n /**\n * See\n * [Array.some](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some)\n */\n some(fn: (value: T, index: number, array: T[]) => boolean): boolean {\n return this._results.some(fn);\n }\n\n toArray(): T[] { return this._results.slice(); }\n\n [getSymbolIterator()](): Iterator<T> { return (this._results as any)[getSymbolIterator()](); }\n\n toString(): string { return this._results.toString(); }\n\n reset(res: Array<T|any[]>): void {\n this._results = flatten(res);\n (this as{dirty: boolean}).dirty = false;\n (this as{length: number}).length = this._results.length;\n (this as{last: T}).last = this._results[this.length - 1];\n (this as{first: T}).first = this._results[0];\n }\n\n notifyOnChanges(): void { (this.changes as EventEmitter<any>).emit(this); }\n\n /** internal */\n setDirty() { (this as{dirty: boolean}).dirty = true; }\n\n /** internal */\n destroy(): void {\n (this.changes as EventEmitter<any>).complete();\n (this.changes as EventEmitter<any>).unsubscribe();\n }\n}\n\nfunction flatten<T>(list: Array<T|T[]>): T[] {\n return list.reduce((flat: any[], item: T | T[]): T[] => {\n const flatItem = Array.isArray(item) ? flatten(item) : item;\n return (<T[]>flat).concat(flatItem);\n }, []);\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n\nimport {Injectable, Optional} from '../di';\n\nimport {Compiler} from './compiler';\nimport {NgModuleFactory} from './ng_module_factory';\nimport {NgModuleFactoryLoader} from './ng_module_factory_loader';\n\nconst _SEPARATOR = '#';\n\nconst FACTORY_CLASS_SUFFIX = 'NgFactory';\ndeclare var System: any;\n\n/**\n * Configuration for SystemJsNgModuleLoader.\n * token.\n *\n * @experimental\n */\nexport abstract class SystemJsNgModuleLoaderConfig {\n /**\n * Prefix to add when computing the name of the factory module for a given module name.\n */\n // TODO(issue/24571): remove '!'.\n factoryPathPrefix !: string;\n\n /**\n * Suffix to add when computing the name of the factory module for a given module name.\n */\n // TODO(issue/24571): remove '!'.\n factoryPathSuffix !: string;\n}\n\nconst DEFAULT_CONFIG: SystemJsNgModuleLoaderConfig = {\n factoryPathPrefix: '',\n factoryPathSuffix: '.ngfactory',\n};\n\n/**\n * NgModuleFactoryLoader that uses SystemJS to load NgModuleFactory\n * @experimental\n */\n@Injectable()\nexport class SystemJsNgModuleLoader implements NgModuleFactoryLoader {\n private _config: SystemJsNgModuleLoaderConfig;\n\n constructor(private _compiler: Compiler, @Optional() config?: SystemJsNgModuleLoaderConfig) {\n this._config = config || DEFAULT_CONFIG;\n }\n\n load(path: string): Promise<NgModuleFactory<any>> {\n const offlineMode = this._compiler instanceof Compiler;\n return offlineMode ? this.loadFactory(path) : this.loadAndCompile(path);\n }\n\n private loadAndCompile(path: string): Promise<NgModuleFactory<any>> {\n let [module, exportName] = path.split(_SEPARATOR);\n if (exportName === undefined) {\n exportName = 'default';\n }\n\n return System.import(module)\n .then((module: any) => module[exportName])\n .then((type: any) => checkNotEmpty(type, module, exportName))\n .then((type: any) => this._compiler.compileModuleAsync(type));\n }\n\n private loadFactory(path: string): Promise<NgModuleFactory<any>> {\n let [module, exportName] = path.split(_SEPARATOR);\n let factoryClassSuffix = FACTORY_CLASS_SUFFIX;\n if (exportName === undefined) {\n exportName = 'default';\n factoryClassSuffix = '';\n }\n\n return System.import(this._config.factoryPathPrefix + module + this._config.factoryPathSuffix)\n .then((module: any) => module[exportName + factoryClassSuffix])\n .then((factory: any) => checkNotEmpty(factory, module, exportName));\n }\n}\n\nfunction checkNotEmpty(value: any, modulePath: string, exportName: string): any {\n if (!value) {\n throw new Error(`Cannot find '${exportName}' in '${modulePath}'`);\n }\n return value;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ElementRef} from './element_ref';\nimport {EmbeddedViewRef} from './view_ref';\n\n\n/**\n * Represents an embedded template that can be used to instantiate embedded views.\n * To instantiate embedded views based on a template, use the `ViewContainerRef`\n * method `createEmbeddedView()`.\n * \n * Access a `TemplateRef` instance by placing a directive on an `<ng-template>`\n * element (or directive prefixed with `*`). The `TemplateRef` for the embedded view\n * is injected into the constructor of the directive,\n * using the `TemplateRef` token.\n * \n * You can also use a `Query` to find a `TemplateRef` associated with\n * a component or a directive.\n *\n * @see `ViewContainerRef`\n * @see [Navigate the Component Tree with DI](guide/dependency-injection-navtree)\n *\n */\nexport abstract class TemplateRef<C> {\n /**\n * The anchor element in the parent view for this embedded view.\n *\n * The data-binding and injection contexts of embedded views created from this `TemplateRef`\n * inherit from the contexts of this location.\n *\n * Typically new embedded views are attached to the view container of this location, but in\n * advanced use-cases, the view can be attached to a different container while keeping the\n * data-binding and injection context from the original location.\n *\n */\n // TODO(i): rename to anchor or location\n abstract get elementRef(): ElementRef;\n\n /**\n * Creates a view object and attaches it to the view container of the parent view.\n * @param context The context for the new view, inherited from the anchor element.\n * @returns The new view object.\n */\n abstract createEmbeddedView(context: C): EmbeddedViewRef<C>;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Injector} from '../di/injector';\nimport {ComponentFactory, ComponentRef} from './component_factory';\nimport {ElementRef} from './element_ref';\nimport {NgModuleRef} from './ng_module_factory';\nimport {TemplateRef} from './template_ref';\nimport {EmbeddedViewRef, ViewRef} from './view_ref';\n\n\n/**\n * Represents a container where one or more views can be attached to a component.\n *\n * Can contain *host views* (created by instantiating a\n * component with the `createComponent()` method), and *embedded views*\n * (created by instantiating a `TemplateRef` with the `createEmbeddedView()` method).\n *\n * A view container instance can contain other view containers,\n * creating a [view hierarchy](guide/glossary#view-tree).\n *\n * @see `ComponentRef`\n * @see `EmbeddedViewRef`\n *\n */\nexport abstract class ViewContainerRef {\n /**\n * Anchor element that specifies the location of this container in the containing view.\n * Each view container can have only one anchor element, and each anchor element\n * can have only a single view container.\n *\n * Root elements of views attached to this container become siblings of the anchor element in\n * the rendered view.\n *\n * Access the `ViewContainerRef` of an element by placing a `Directive` injected\n * with `ViewContainerRef` on the element, or use a `ViewChild` query.\n *\n * <!-- TODO: rename to anchorElement -->\n */\n abstract get element(): ElementRef;\n\n /**\n * The [dependency injector](guide/glossary#injector) for this view container.\n */\n abstract get injector(): Injector;\n\n abstract get parentInjector(): Injector;\n\n /**\n * Destroys all views in this container.\n */\n abstract clear(): void;\n\n /**\n * Retrieves a view from this container.\n * @param index The 0-based index of the view to retrieve.\n * @returns The `ViewRef` instance, or null if the index is out of range.\n */\n abstract get(index: number): ViewRef|null;\n\n /**\n * Reports how many views are currently attached to this container.\n * @returns The number of views.\n */\n abstract get length(): number;\n\n /**\n * Instantiates an embedded view and inserts it\n * into this container.\n * @param templateRef The HTML template that defines the view.\n * @param index The 0-based index at which to insert the new view into this container.\n * If not specified, appends the new view as the last entry.\n *\n * @returns The `ViewRef` instance for the newly created view.\n */\n abstract createEmbeddedView<C>(templateRef: TemplateRef<C>, context?: C, index?: number):\n EmbeddedViewRef<C>;\n\n /**\n * Instantiates a single component and inserts its host view into this container.\n *\n * @param componentFactory The factory to use.\n * @param index The index at which to insert the new component's host view into this container.\n * If not specified, appends the new view as the last entry.\n * @param injector The injector to use as the parent for the new component.\n * @param projectableNodes\n * @param ngModule\n *\n * @returns The new component instance, containing the host view.\n *\n */\n abstract createComponent<C>(\n componentFactory: ComponentFactory<C>, index?: number, injector?: Injector,\n projectableNodes?: any[][], ngModule?: NgModuleRef<any>): ComponentRef<C>;\n\n /**\n * Inserts a view into this container.\n * @param viewRef The view to insert.\n * @param index The 0-based index at which to insert the view.\n * If not specified, appends the new view as the last entry.\n * @returns The inserted `ViewRef` instance.\n *\n */\n abstract insert(viewRef: ViewRef, index?: number): ViewRef;\n\n /**\n * Moves a view to a new location in this container.\n * @param viewRef The view to move.\n * @param index The 0-based index of the new location.\n * @returns The moved `ViewRef` instance.\n */\n abstract move(viewRef: ViewRef, currentIndex: number): ViewRef;\n\n /**\n * Returns the index of a view within the current container.\n * @param viewRef The view to query.\n * @returns The 0-based index of the view's position in this container,\n * or `-1` if this container doesn't contain the view.\n */\n abstract indexOf(viewRef: ViewRef): number;\n\n /**\n * Destroys a view attached to this container\n * @param index The 0-based index of the view to destroy.\n * If not specified, the last view in the container is removed.\n */\n abstract remove(index?: number): void;\n\n /**\n * Detaches a view from this container without destroying it.\n * Use along with `insert()` to move a view within the current container.\n * @param index The 0-based index of the view to detach.\n * If not specified, the last view in the container is detached.\n */\n abstract detach(index?: number): ViewRef|null;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * Base class for Angular Views, provides change detection functionality.\n * A change-detection tree collects all views that are to be checked for changes.\n * Use the methods to add and remove views from the tree, initiate change-detection,\n * and explicitly mark views as _dirty_, meaning that they have changed and need to be rerendered.\n *\n * @usageNotes\n *\n * The following examples demonstrate how to modify default change-detection behavior\n * to perform explicit detection when needed.\n *\n * ### Use `markForCheck()` with `CheckOnce` strategy\n *\n * The following example sets the `OnPush` change-detection strategy for a component\n * (`CheckOnce`, rather than the default `CheckAlways`), then forces a second check\n * after an interval. See [live demo](http://plnkr.co/edit/GC512b?p=preview).\n *\n * <code-example path=\"core/ts/change_detect/change-detection.ts\"\n * region=\"mark-for-check\"></code-example>\n *\n * ### Detach change detector to limit how often check occurs\n *\n * The following example defines a component with a large list of read-only data\n * that is expected to change constantly, many times per second.\n * To improve performance, we want to check and update the list\n * less often than the changes actually occur. To do that, we detach\n * the component's change detector and perform an explicit local check every five seconds.\n *\n * <code-example path=\"core/ts/change_detect/change-detection.ts\" region=\"detach\"></code-example>\n *\n *\n * ### Reattaching a detached component\n *\n * The following example creates a component displaying live data.\n * The component detaches its change detector from the main change detector tree\n * when the `live` property is set to false, and reattaches it when the property\n * becomes true.\n *\n * <code-example path=\"core/ts/change_detect/change-detection.ts\" region=\"reattach\"></code-example>\n *\n */\nexport abstract class ChangeDetectorRef {\n /**\n * When a view uses the {@link ChangeDetectionStrategy#OnPush OnPush} (checkOnce)\n * change detection strategy, explicitly marks the view as changed so that\n * it can be checked again.\n *\n * Components are normally marked as dirty (in need of rerendering) when inputs\n * have changed or events have fired in the view. Call this method to ensure that\n * a component is checked even if these triggers have not occured.\n *\n * <!-- TODO: Add a link to a chapter on OnPush components -->\n *\n */\n abstract markForCheck(): void;\n\n /**\n * Detaches this view from the change-detection tree.\n * A detached view is not checked until it is reattached.\n * Use in combination with `detectChanges()` to implement local change detection checks.\n *\n * Detached views are not checked during change detection runs until they are\n * re-attached, even if they are marked as dirty.\n *\n * <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->\n * <!-- TODO: Add a live demo once ref.detectChanges is merged into master -->\n *\n */\n abstract detach(): void;\n\n /**\n * Checks this view and its children. Use in combination with {@link ChangeDetectorRef#detach\n * detach}\n * to implement local change detection checks.\n *\n * <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->\n * <!-- TODO: Add a live demo once ref.detectChanges is merged into master -->\n *\n */\n abstract detectChanges(): void;\n\n /**\n * Checks the change detector and its children, and throws if any changes are detected.\n *\n * Use in development mode to verify that running change detection doesn't introduce\n * other changes.\n */\n abstract checkNoChanges(): void;\n\n /**\n * Re-attaches the previously detached view to the change detection tree.\n * Views are attached to the tree by default.\n *\n * <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->\n *\n */\n abstract reattach(): void;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ApplicationRef} from '../application_ref';\nimport {ChangeDetectorRef} from '../change_detection/change_detector_ref';\n\n/**\n * Represents an Angular [view](guide/glossary#view),\n * specifically the [host view](guide/glossary#view-tree) that is defined by a component.\n * Also serves as the base class\n * that adds destroy methods for [embedded views](guide/glossary#view-tree). \n * \n * @see `EmbeddedViewRef` \n */\nexport abstract class ViewRef extends ChangeDetectorRef {\n /**\n * Destroys this view and all of the data structures associated with it.\n */\n abstract destroy(): void;\n\n /**\n * Reports whether this view has been destroyed.\n * @returns True after the `destroy()` method has been called, false otherwise.\n */\n abstract get destroyed(): boolean;\n\n /**\n * A lifecycle hook that provides additional developer-defined cleanup\n * functionality for views.\n * @param callback A handler function that cleans up developer-defined data\n * associated with a view. Called when the `destroy()` method is invoked.\n */\n abstract onDestroy(callback: Function): any /** TODO #9100 */;\n}\n\n/**\n * Represents an Angular [view](guide/glossary#view) in a view container.\n * An [embedded view](guide/glossary#view-tree) can be referenced from a component\n * other than the hosting component whose template defines it, or it can be defined\n * independently by a `TemplateRef`.\n *\n * Properties of elements in a view can change, but the structure (number and order) of elements in\n * a view cannot. Change the structure of elements by inserting, moving, or\n * removing nested views in a view container.\n *\n * @see `ViewContainerRef`\n *\n * @usageNotes\n *\n * The following template breaks down into two separate `TemplateRef` instances,\n * an outer one and an inner one.\n *\n * ```\n * Count: {{items.length}}\n * <ul>\n * <li *ngFor=\"let item of items\">{{item}}</li>\n * </ul>\n * ```\n *\n * This is the outer `TemplateRef`:\n *\n * ```\n * Count: {{items.length}}\n * <ul>\n * <ng-template ngFor let-item [ngForOf]=\"items\"></ng-template>\n * </ul>\n * ```\n *\n * This is the inner `TemplateRef`:\n *\n * ```\n * <li>{{item}}</li>\n * ```\n *\n * The outer and inner `TemplateRef` instances are assembled into views as follows:\n *\n * ```\n * <!-- ViewRef: outer-0 -->\n * Count: 2\n * <ul>\n * <ng-template view-container-ref></ng-template>\n * <!-- ViewRef: inner-1 --><li>first</li><!-- /ViewRef: inner-1 -->\n * <!-- ViewRef: inner-2 --><li>second</li><!-- /ViewRef: inner-2 -->\n * </ul>\n * <!-- /ViewRef: outer-0 -->\n * ```\n * @experimental\n */\nexport abstract class EmbeddedViewRef<C> extends ViewRef {\n /**\n * The context for this view, inherited from the anchor element.\n */\n abstract get context(): C;\n\n /**\n * The root nodes for this embedded view.\n */\n abstract get rootNodes(): any[];\n}\n\nexport interface InternalViewRef extends ViewRef {\n detachFromAppRef(): void;\n attachToAppRef(appRef: ApplicationRef): void;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n// Public API for compiler\nexport {COMPILER_OPTIONS, Compiler, CompilerFactory, CompilerOptions, ModuleWithComponentFactories} from './linker/compiler';\nexport {ComponentFactory, ComponentRef} from './linker/component_factory';\nexport {ComponentFactoryResolver} from './linker/component_factory_resolver';\nexport {ElementRef} from './linker/element_ref';\nexport {NgModuleFactory, NgModuleRef} from './linker/ng_module_factory';\nexport {NgModuleFactoryLoader, getModuleFactory} from './linker/ng_module_factory_loader';\nexport {QueryList} from './linker/query_list';\nexport {SystemJsNgModuleLoader, SystemJsNgModuleLoaderConfig} from './linker/system_js_ng_module_factory_loader';\nexport {TemplateRef} from './linker/template_ref';\nexport {ViewContainerRef} from './linker/view_container_ref';\nexport {EmbeddedViewRef, ViewRef} from './linker/view_ref';\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Injector} from '../di';\nimport {DebugContext} from '../view/index';\n\nexport class EventListener {\n constructor(public name: string, public callback: Function) {}\n}\n\n/**\n * @experimental All debugging apis are currently experimental.\n */\nexport class DebugNode {\n nativeNode: any;\n listeners: EventListener[];\n // TODO(issue/24571): remove '!'.\n parent !: DebugElement | null;\n\n constructor(nativeNode: any, parent: DebugNode|null, private _debugContext: DebugContext) {\n this.nativeNode = nativeNode;\n if (parent && parent instanceof DebugElement) {\n parent.addChild(this);\n } else {\n this.parent = null;\n }\n this.listeners = [];\n }\n\n get injector(): Injector { return this._debugContext.injector; }\n\n get componentInstance(): any { return this._debugContext.component; }\n\n get context(): any { return this._debugContext.context; }\n\n get references(): {[key: string]: any} { return this._debugContext.references; }\n\n get providerTokens(): any[] { return this._debugContext.providerTokens; }\n}\n\n/**\n * @experimental All debugging apis are currently experimental.\n */\nexport class DebugElement extends DebugNode {\n // TODO(issue/24571): remove '!'.\n name !: string;\n properties: {[key: string]: any};\n attributes: {[key: string]: string | null};\n classes: {[key: string]: boolean};\n styles: {[key: string]: string | null};\n childNodes: DebugNode[];\n nativeElement: any;\n\n constructor(nativeNode: any, parent: any, _debugContext: DebugContext) {\n super(nativeNode, parent, _debugContext);\n this.properties = {};\n this.attributes = {};\n this.classes = {};\n this.styles = {};\n this.childNodes = [];\n this.nativeElement = nativeNode;\n }\n\n addChild(child: DebugNode) {\n if (child) {\n this.childNodes.push(child);\n child.parent = this;\n }\n }\n\n removeChild(child: DebugNode) {\n const childIndex = this.childNodes.indexOf(child);\n if (childIndex !== -1) {\n child.parent = null;\n this.childNodes.splice(childIndex, 1);\n }\n }\n\n insertChildrenAfter(child: DebugNode, newChildren: DebugNode[]) {\n const siblingIndex = this.childNodes.indexOf(child);\n if (siblingIndex !== -1) {\n this.childNodes.splice(siblingIndex + 1, 0, ...newChildren);\n newChildren.forEach(c => {\n if (c.parent) {\n c.parent.removeChild(c);\n }\n c.parent = this;\n });\n }\n }\n\n insertBefore(refChild: DebugNode, newChild: DebugNode): void {\n const refIndex = this.childNodes.indexOf(refChild);\n if (refIndex === -1) {\n this.addChild(newChild);\n } else {\n if (newChild.parent) {\n newChild.parent.removeChild(newChild);\n }\n newChild.parent = this;\n this.childNodes.splice(refIndex, 0, newChild);\n }\n }\n\n query(predicate: Predicate<DebugElement>): DebugElement {\n const results = this.queryAll(predicate);\n return results[0] || null;\n }\n\n queryAll(predicate: Predicate<DebugElement>): DebugElement[] {\n const matches: DebugElement[] = [];\n _queryElementChildren(this, predicate, matches);\n return matches;\n }\n\n queryAllNodes(predicate: Predicate<DebugNode>): DebugNode[] {\n const matches: DebugNode[] = [];\n _queryNodeChildren(this, predicate, matches);\n return matches;\n }\n\n get children(): DebugElement[] {\n return this.childNodes.filter((node) => node instanceof DebugElement) as DebugElement[];\n }\n\n triggerEventHandler(eventName: string, eventObj: any) {\n this.listeners.forEach((listener) => {\n if (listener.name == eventName) {\n listener.callback(eventObj);\n }\n });\n }\n}\n\n/**\n * @experimental\n */\nexport function asNativeElements(debugEls: DebugElement[]): any {\n return debugEls.map((el) => el.nativeElement);\n}\n\nfunction _queryElementChildren(\n element: DebugElement, predicate: Predicate<DebugElement>, matches: DebugElement[]) {\n element.childNodes.forEach(node => {\n if (node instanceof DebugElement) {\n if (predicate(node)) {\n matches.push(node);\n }\n _queryElementChildren(node, predicate, matches);\n }\n });\n}\n\nfunction _queryNodeChildren(\n parentNode: DebugNode, predicate: Predicate<DebugNode>, matches: DebugNode[]) {\n if (parentNode instanceof DebugElement) {\n parentNode.childNodes.forEach(node => {\n if (predicate(node)) {\n matches.push(node);\n }\n if (node instanceof DebugElement) {\n _queryNodeChildren(node, predicate, matches);\n }\n });\n }\n}\n\n// Need to keep the nodes in a global Map so that multiple angular apps are supported.\nconst _nativeNodeToDebugNode = new Map<any, DebugNode>();\n\n/**\n * @experimental\n */\nexport function getDebugNode(nativeNode: any): DebugNode|null {\n return _nativeNodeToDebugNode.get(nativeNode) || null;\n}\n\nexport function getAllDebugNodes(): DebugNode[] {\n return Array.from(_nativeNodeToDebugNode.values());\n}\n\nexport function indexDebugNode(node: DebugNode) {\n _nativeNodeToDebugNode.set(node.nativeNode, node);\n}\n\nexport function removeDebugNodeFromIndex(node: DebugNode) {\n _nativeNodeToDebugNode.delete(node.nativeNode);\n}\n\n/**\n * A boolean-valued function over a value, possibly including context information\n * regarding that value's position in an array.\n *\n * @experimental All debugging apis are currently experimental.\n */\nexport interface Predicate<T> { (value: T): boolean; }\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {getSymbolIterator, looseIdentical} from '../util';\n\nexport function devModeEqual(a: any, b: any): boolean {\n const isListLikeIterableA = isListLikeIterable(a);\n const isListLikeIterableB = isListLikeIterable(b);\n if (isListLikeIterableA && isListLikeIterableB) {\n return areIterablesEqual(a, b, devModeEqual);\n } else {\n const isAObject = a && (typeof a === 'object' || typeof a === 'function');\n const isBObject = b && (typeof b === 'object' || typeof b === 'function');\n if (!isListLikeIterableA && isAObject && !isListLikeIterableB && isBObject) {\n return true;\n } else {\n return looseIdentical(a, b);\n }\n }\n}\n\n/**\n * Indicates that the result of a {@link Pipe} transformation has changed even though the\n * reference has not changed.\n *\n * Wrapped values are unwrapped automatically during the change detection, and the unwrapped value\n * is stored.\n *\n * Example:\n *\n * ```\n * if (this._latestValue === this._latestReturnedValue) {\n * return this._latestReturnedValue;\n * } else {\n * this._latestReturnedValue = this._latestValue;\n * return WrappedValue.wrap(this._latestValue); // this will force update\n * }\n * ```\n *\n */\nexport class WrappedValue {\n /** @deprecated from 5.3, use `unwrap()` instead - will switch to protected */\n wrapped: any;\n\n constructor(value: any) { this.wrapped = value; }\n\n /** Creates a wrapped value. */\n static wrap(value: any): WrappedValue { return new WrappedValue(value); }\n\n /**\n * Returns the underlying value of a wrapped value.\n * Returns the given `value` when it is not wrapped.\n **/\n static unwrap(value: any): any { return WrappedValue.isWrapped(value) ? value.wrapped : value; }\n\n /** Returns true if `value` is a wrapped value. */\n static isWrapped(value: any): value is WrappedValue { return value instanceof WrappedValue; }\n}\n\n/**\n * Represents a basic change from a previous to a new value.\n *\n */\nexport class SimpleChange {\n constructor(public previousValue: any, public currentValue: any, public firstChange: boolean) {}\n\n /**\n * Check whether the new value is the first value assigned.\n */\n isFirstChange(): boolean { return this.firstChange; }\n}\n\nexport function isListLikeIterable(obj: any): boolean {\n if (!isJsObject(obj)) return false;\n return Array.isArray(obj) ||\n (!(obj instanceof Map) && // JS Map are iterables but return entries as [k, v]\n getSymbolIterator() in obj); // JS Iterable have a Symbol.iterator prop\n}\n\nexport function areIterablesEqual(\n a: any, b: any, comparator: (a: any, b: any) => boolean): boolean {\n const iterator1 = a[getSymbolIterator()]();\n const iterator2 = b[getSymbolIterator()]();\n\n while (true) {\n const item1 = iterator1.next();\n const item2 = iterator2.next();\n if (item1.done && item2.done) return true;\n if (item1.done || item2.done) return false;\n if (!comparator(item1.value, item2.value)) return false;\n }\n}\n\nexport function iterateListLike(obj: any, fn: (p: any) => any) {\n if (Array.isArray(obj)) {\n for (let i = 0; i < obj.length; i++) {\n fn(obj[i]);\n }\n } else {\n const iterator = obj[getSymbolIterator()]();\n let item: any;\n while (!((item = iterator.next()).done)) {\n fn(item.value);\n }\n }\n}\n\nexport function isJsObject(o: any): boolean {\n return o !== null && (typeof o === 'function' || typeof o === 'object');\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {looseIdentical, stringify} from '../../util';\nimport {isListLikeIterable, iterateListLike} from '../change_detection_util';\nimport {IterableChangeRecord, IterableChanges, IterableDiffer, IterableDifferFactory, NgIterable, TrackByFunction} from './iterable_differs';\n\n\nexport class DefaultIterableDifferFactory implements IterableDifferFactory {\n constructor() {}\n supports(obj: Object|null|undefined): boolean { return isListLikeIterable(obj); }\n\n create<V>(trackByFn?: TrackByFunction<V>): DefaultIterableDiffer<V> {\n return new DefaultIterableDiffer<V>(trackByFn);\n }\n}\n\nconst trackByIdentity = (index: number, item: any) => item;\n\n/**\n * @deprecated v4.0.0 - Should not be part of public API.\n */\nexport class DefaultIterableDiffer<V> implements IterableDiffer<V>, IterableChanges<V> {\n public readonly length: number = 0;\n // TODO(issue/24571): remove '!'.\n public readonly collection !: V[] | Iterable<V>| null;\n // Keeps track of the used records at any point in time (during & across `_check()` calls)\n private _linkedRecords: _DuplicateMap<V>|null = null;\n // Keeps track of the removed records at any point in time during `_check()` calls.\n private _unlinkedRecords: _DuplicateMap<V>|null = null;\n private _previousItHead: IterableChangeRecord_<V>|null = null;\n private _itHead: IterableChangeRecord_<V>|null = null;\n private _itTail: IterableChangeRecord_<V>|null = null;\n private _additionsHead: IterableChangeRecord_<V>|null = null;\n private _additionsTail: IterableChangeRecord_<V>|null = null;\n private _movesHead: IterableChangeRecord_<V>|null = null;\n private _movesTail: IterableChangeRecord_<V>|null = null;\n private _removalsHead: IterableChangeRecord_<V>|null = null;\n private _removalsTail: IterableChangeRecord_<V>|null = null;\n // Keeps track of records where custom track by is the same, but item identity has changed\n private _identityChangesHead: IterableChangeRecord_<V>|null = null;\n private _identityChangesTail: IterableChangeRecord_<V>|null = null;\n private _trackByFn: TrackByFunction<V>;\n\n constructor(trackByFn?: TrackByFunction<V>) { this._trackByFn = trackByFn || trackByIdentity; }\n\n forEachItem(fn: (record: IterableChangeRecord_<V>) => void) {\n let record: IterableChangeRecord_<V>|null;\n for (record = this._itHead; record !== null; record = record._next) {\n fn(record);\n }\n }\n\n forEachOperation(\n fn: (item: IterableChangeRecord<V>, previousIndex: number|null, currentIndex: number|null) =>\n void) {\n let nextIt = this._itHead;\n let nextRemove = this._removalsHead;\n let addRemoveOffset = 0;\n let moveOffsets: number[]|null = null;\n while (nextIt || nextRemove) {\n // Figure out which is the next record to process\n // Order: remove, add, move\n const record: IterableChangeRecord<V> = !nextRemove ||\n nextIt &&\n nextIt.currentIndex ! <\n getPreviousIndex(nextRemove, addRemoveOffset, moveOffsets) ?\n nextIt ! :\n nextRemove;\n const adjPreviousIndex = getPreviousIndex(record, addRemoveOffset, moveOffsets);\n const currentIndex = record.currentIndex;\n\n // consume the item, and adjust the addRemoveOffset and update moveDistance if necessary\n if (record === nextRemove) {\n addRemoveOffset--;\n nextRemove = nextRemove._nextRemoved;\n } else {\n nextIt = nextIt !._next;\n if (record.previousIndex == null) {\n addRemoveOffset++;\n } else {\n // INVARIANT: currentIndex < previousIndex\n if (!moveOffsets) moveOffsets = [];\n const localMovePreviousIndex = adjPreviousIndex - addRemoveOffset;\n const localCurrentIndex = currentIndex ! - addRemoveOffset;\n if (localMovePreviousIndex != localCurrentIndex) {\n for (let i = 0; i < localMovePreviousIndex; i++) {\n const offset = i < moveOffsets.length ? moveOffsets[i] : (moveOffsets[i] = 0);\n const index = offset + i;\n if (localCurrentIndex <= index && index < localMovePreviousIndex) {\n moveOffsets[i] = offset + 1;\n }\n }\n const previousIndex = record.previousIndex;\n moveOffsets[previousIndex] = localCurrentIndex - localMovePreviousIndex;\n }\n }\n }\n\n if (adjPreviousIndex !== currentIndex) {\n fn(record, adjPreviousIndex, currentIndex);\n }\n }\n }\n\n forEachPreviousItem(fn: (record: IterableChangeRecord_<V>) => void) {\n let record: IterableChangeRecord_<V>|null;\n for (record = this._previousItHead; record !== null; record = record._nextPrevious) {\n fn(record);\n }\n }\n\n forEachAddedItem(fn: (record: IterableChangeRecord_<V>) => void) {\n let record: IterableChangeRecord_<V>|null;\n for (record = this._additionsHead; record !== null; record = record._nextAdded) {\n fn(record);\n }\n }\n\n forEachMovedItem(fn: (record: IterableChangeRecord_<V>) => void) {\n let record: IterableChangeRecord_<V>|null;\n for (record = this._movesHead; record !== null; record = record._nextMoved) {\n fn(record);\n }\n }\n\n forEachRemovedItem(fn: (record: IterableChangeRecord_<V>) => void) {\n let record: IterableChangeRecord_<V>|null;\n for (record = this._removalsHead; record !== null; record = record._nextRemoved) {\n fn(record);\n }\n }\n\n forEachIdentityChange(fn: (record: IterableChangeRecord_<V>) => void) {\n let record: IterableChangeRecord_<V>|null;\n for (record = this._identityChangesHead; record !== null; record = record._nextIdentityChange) {\n fn(record);\n }\n }\n\n diff(collection: NgIterable<V>): DefaultIterableDiffer<V>|null {\n if (collection == null) collection = [];\n if (!isListLikeIterable(collection)) {\n throw new Error(\n `Error trying to diff '${stringify(collection)}'. Only arrays and iterables are allowed`);\n }\n\n if (this.check(collection)) {\n return this;\n } else {\n return null;\n }\n }\n\n onDestroy() {}\n\n check(collection: NgIterable<V>): boolean {\n this._reset();\n\n let record: IterableChangeRecord_<V>|null = this._itHead;\n let mayBeDirty: boolean = false;\n let index: number;\n let item: V;\n let itemTrackBy: any;\n if (Array.isArray(collection)) {\n (this as{length: number}).length = collection.length;\n\n for (let index = 0; index < this.length; index++) {\n item = collection[index];\n itemTrackBy = this._trackByFn(index, item);\n if (record === null || !looseIdentical(record.trackById, itemTrackBy)) {\n record = this._mismatch(record, item, itemTrackBy, index);\n mayBeDirty = true;\n } else {\n if (mayBeDirty) {\n // TODO(misko): can we limit this to duplicates only?\n record = this._verifyReinsertion(record, item, itemTrackBy, index);\n }\n if (!looseIdentical(record.item, item)) this._addIdentityChange(record, item);\n }\n\n record = record._next;\n }\n } else {\n index = 0;\n iterateListLike(collection, (item: V) => {\n itemTrackBy = this._trackByFn(index, item);\n if (record === null || !looseIdentical(record.trackById, itemTrackBy)) {\n record = this._mismatch(record, item, itemTrackBy, index);\n mayBeDirty = true;\n } else {\n if (mayBeDirty) {\n // TODO(misko): can we limit this to duplicates only?\n record = this._verifyReinsertion(record, item, itemTrackBy, index);\n }\n if (!looseIdentical(record.item, item)) this._addIdentityChange(record, item);\n }\n record = record._next;\n index++;\n });\n (this as{length: number}).length = index;\n }\n\n this._truncate(record);\n (this as{collection: V[] | Iterable<V>}).collection = collection;\n return this.isDirty;\n }\n\n /* CollectionChanges is considered dirty if it has any additions, moves, removals, or identity\n * changes.\n */\n get isDirty(): boolean {\n return this._additionsHead !== null || this._movesHead !== null ||\n this._removalsHead !== null || this._identityChangesHead !== null;\n }\n\n /**\n * Reset the state of the change objects to show no changes. This means set previousKey to\n * currentKey, and clear all of the queues (additions, moves, removals).\n * Set the previousIndexes of moved and added items to their currentIndexes\n * Reset the list of additions, moves and removals\n *\n * @internal\n */\n _reset() {\n if (this.isDirty) {\n let record: IterableChangeRecord_<V>|null;\n let nextRecord: IterableChangeRecord_<V>|null;\n\n for (record = this._previousItHead = this._itHead; record !== null; record = record._next) {\n record._nextPrevious = record._next;\n }\n\n for (record = this._additionsHead; record !== null; record = record._nextAdded) {\n record.previousIndex = record.currentIndex;\n }\n this._additionsHead = this._additionsTail = null;\n\n for (record = this._movesHead; record !== null; record = nextRecord) {\n record.previousIndex = record.currentIndex;\n nextRecord = record._nextMoved;\n }\n this._movesHead = this._movesTail = null;\n this._removalsHead = this._removalsTail = null;\n this._identityChangesHead = this._identityChangesTail = null;\n\n // TODO(vicb): when assert gets supported\n // assert(!this.isDirty);\n }\n }\n\n /**\n * This is the core function which handles differences between collections.\n *\n * - `record` is the record which we saw at this position last time. If null then it is a new\n * item.\n * - `item` is the current item in the collection\n * - `index` is the position of the item in the collection\n *\n * @internal\n */\n _mismatch(record: IterableChangeRecord_<V>|null, item: V, itemTrackBy: any, index: number):\n IterableChangeRecord_<V> {\n // The previous record after which we will append the current one.\n let previousRecord: IterableChangeRecord_<V>|null;\n\n if (record === null) {\n previousRecord = this._itTail;\n } else {\n previousRecord = record._prev;\n // Remove the record from the collection since we know it does not match the item.\n this._remove(record);\n }\n\n // Attempt to see if we have seen the item before.\n record = this._linkedRecords === null ? null : this._linkedRecords.get(itemTrackBy, index);\n if (record !== null) {\n // We have seen this before, we need to move it forward in the collection.\n // But first we need to check if identity changed, so we can update in view if necessary\n if (!looseIdentical(record.item, item)) this._addIdentityChange(record, item);\n\n this._moveAfter(record, previousRecord, index);\n } else {\n // Never seen it, check evicted list.\n record = this._unlinkedRecords === null ? null : this._unlinkedRecords.get(itemTrackBy, null);\n if (record !== null) {\n // It is an item which we have evicted earlier: reinsert it back into the list.\n // But first we need to check if identity changed, so we can update in view if necessary\n if (!looseIdentical(record.item, item)) this._addIdentityChange(record, item);\n\n this._reinsertAfter(record, previousRecord, index);\n } else {\n // It is a new item: add it.\n record =\n this._addAfter(new IterableChangeRecord_<V>(item, itemTrackBy), previousRecord, index);\n }\n }\n return record;\n }\n\n /**\n * This check is only needed if an array contains duplicates. (Short circuit of nothing dirty)\n *\n * Use case: `[a, a]` => `[b, a, a]`\n *\n * If we did not have this check then the insertion of `b` would:\n * 1) evict first `a`\n * 2) insert `b` at `0` index.\n * 3) leave `a` at index `1` as is. <-- this is wrong!\n * 3) reinsert `a` at index 2. <-- this is wrong!\n *\n * The correct behavior is:\n * 1) evict first `a`\n * 2) insert `b` at `0` index.\n * 3) reinsert `a` at index 1.\n * 3) move `a` at from `1` to `2`.\n *\n *\n * Double check that we have not evicted a duplicate item. We need to check if the item type may\n * have already been removed:\n * The insertion of b will evict the first 'a'. If we don't reinsert it now it will be reinserted\n * at the end. Which will show up as the two 'a's switching position. This is incorrect, since a\n * better way to think of it is as insert of 'b' rather then switch 'a' with 'b' and then add 'a'\n * at the end.\n *\n * @internal\n */\n _verifyReinsertion(record: IterableChangeRecord_<V>, item: V, itemTrackBy: any, index: number):\n IterableChangeRecord_<V> {\n let reinsertRecord: IterableChangeRecord_<V>|null =\n this._unlinkedRecords === null ? null : this._unlinkedRecords.get(itemTrackBy, null);\n if (reinsertRecord !== null) {\n record = this._reinsertAfter(reinsertRecord, record._prev !, index);\n } else if (record.currentIndex != index) {\n record.currentIndex = index;\n this._addToMoves(record, index);\n }\n return record;\n }\n\n /**\n * Get rid of any excess {@link IterableChangeRecord_}s from the previous collection\n *\n * - `record` The first excess {@link IterableChangeRecord_}.\n *\n * @internal\n */\n _truncate(record: IterableChangeRecord_<V>|null) {\n // Anything after that needs to be removed;\n while (record !== null) {\n const nextRecord: IterableChangeRecord_<V>|null = record._next;\n this._addToRemovals(this._unlink(record));\n record = nextRecord;\n }\n if (this._unlinkedRecords !== null) {\n this._unlinkedRecords.clear();\n }\n\n if (this._additionsTail !== null) {\n this._additionsTail._nextAdded = null;\n }\n if (this._movesTail !== null) {\n this._movesTail._nextMoved = null;\n }\n if (this._itTail !== null) {\n this._itTail._next = null;\n }\n if (this._removalsTail !== null) {\n this._removalsTail._nextRemoved = null;\n }\n if (this._identityChangesTail !== null) {\n this._identityChangesTail._nextIdentityChange = null;\n }\n }\n\n /** @internal */\n _reinsertAfter(\n record: IterableChangeRecord_<V>, prevRecord: IterableChangeRecord_<V>|null,\n index: number): IterableChangeRecord_<V> {\n if (this._unlinkedRecords !== null) {\n this._unlinkedRecords.remove(record);\n }\n const prev = record._prevRemoved;\n const next = record._nextRemoved;\n\n if (prev === null) {\n this._removalsHead = next;\n } else {\n prev._nextRemoved = next;\n }\n if (next === null) {\n this._removalsTail = prev;\n } else {\n next._prevRemoved = prev;\n }\n\n this._insertAfter(record, prevRecord, index);\n this._addToMoves(record, index);\n return record;\n }\n\n /** @internal */\n _moveAfter(\n record: IterableChangeRecord_<V>, prevRecord: IterableChangeRecord_<V>|null,\n index: number): IterableChangeRecord_<V> {\n this._unlink(record);\n this._insertAfter(record, prevRecord, index);\n this._addToMoves(record, index);\n return record;\n }\n\n /** @internal */\n _addAfter(\n record: IterableChangeRecord_<V>, prevRecord: IterableChangeRecord_<V>|null,\n index: number): IterableChangeRecord_<V> {\n this._insertAfter(record, prevRecord, index);\n\n if (this._additionsTail === null) {\n // TODO(vicb):\n // assert(this._additionsHead === null);\n this._additionsTail = this._additionsHead = record;\n } else {\n // TODO(vicb):\n // assert(_additionsTail._nextAdded === null);\n // assert(record._nextAdded === null);\n this._additionsTail = this._additionsTail._nextAdded = record;\n }\n return record;\n }\n\n /** @internal */\n _insertAfter(\n record: IterableChangeRecord_<V>, prevRecord: IterableChangeRecord_<V>|null,\n index: number): IterableChangeRecord_<V> {\n // TODO(vicb):\n // assert(record != prevRecord);\n // assert(record._next === null);\n // assert(record._prev === null);\n\n const next: IterableChangeRecord_<V>|null =\n prevRecord === null ? this._itHead : prevRecord._next;\n // TODO(vicb):\n // assert(next != record);\n // assert(prevRecord != record);\n record._next = next;\n record._prev = prevRecord;\n if (next === null) {\n this._itTail = record;\n } else {\n next._prev = record;\n }\n if (prevRecord === null) {\n this._itHead = record;\n } else {\n prevRecord._next = record;\n }\n\n if (this._linkedRecords === null) {\n this._linkedRecords = new _DuplicateMap<V>();\n }\n this._linkedRecords.put(record);\n\n record.currentIndex = index;\n return record;\n }\n\n /** @internal */\n _remove(record: IterableChangeRecord_<V>): IterableChangeRecord_<V> {\n return this._addToRemovals(this._unlink(record));\n }\n\n /** @internal */\n _unlink(record: IterableChangeRecord_<V>): IterableChangeRecord_<V> {\n if (this._linkedRecords !== null) {\n this._linkedRecords.remove(record);\n }\n\n const prev = record._prev;\n const next = record._next;\n\n // TODO(vicb):\n // assert((record._prev = null) === null);\n // assert((record._next = null) === null);\n\n if (prev === null) {\n this._itHead = next;\n } else {\n prev._next = next;\n }\n if (next === null) {\n this._itTail = prev;\n } else {\n next._prev = prev;\n }\n\n return record;\n }\n\n /** @internal */\n _addToMoves(record: IterableChangeRecord_<V>, toIndex: number): IterableChangeRecord_<V> {\n // TODO(vicb):\n // assert(record._nextMoved === null);\n\n if (record.previousIndex === toIndex) {\n return record;\n }\n\n if (this._movesTail === null) {\n // TODO(vicb):\n // assert(_movesHead === null);\n this._movesTail = this._movesHead = record;\n } else {\n // TODO(vicb):\n // assert(_movesTail._nextMoved === null);\n this._movesTail = this._movesTail._nextMoved = record;\n }\n\n return record;\n }\n\n private _addToRemovals(record: IterableChangeRecord_<V>): IterableChangeRecord_<V> {\n if (this._unlinkedRecords === null) {\n this._unlinkedRecords = new _DuplicateMap<V>();\n }\n this._unlinkedRecords.put(record);\n record.currentIndex = null;\n record._nextRemoved = null;\n\n if (this._removalsTail === null) {\n // TODO(vicb):\n // assert(_removalsHead === null);\n this._removalsTail = this._removalsHead = record;\n record._prevRemoved = null;\n } else {\n // TODO(vicb):\n // assert(_removalsTail._nextRemoved === null);\n // assert(record._nextRemoved === null);\n record._prevRemoved = this._removalsTail;\n this._removalsTail = this._removalsTail._nextRemoved = record;\n }\n return record;\n }\n\n /** @internal */\n _addIdentityChange(record: IterableChangeRecord_<V>, item: V) {\n record.item = item;\n if (this._identityChangesTail === null) {\n this._identityChangesTail = this._identityChangesHead = record;\n } else {\n this._identityChangesTail = this._identityChangesTail._nextIdentityChange = record;\n }\n return record;\n }\n}\n\nexport class IterableChangeRecord_<V> implements IterableChangeRecord<V> {\n currentIndex: number|null = null;\n previousIndex: number|null = null;\n\n /** @internal */\n _nextPrevious: IterableChangeRecord_<V>|null = null;\n /** @internal */\n _prev: IterableChangeRecord_<V>|null = null;\n /** @internal */\n _next: IterableChangeRecord_<V>|null = null;\n /** @internal */\n _prevDup: IterableChangeRecord_<V>|null = null;\n /** @internal */\n _nextDup: IterableChangeRecord_<V>|null = null;\n /** @internal */\n _prevRemoved: IterableChangeRecord_<V>|null = null;\n /** @internal */\n _nextRemoved: IterableChangeRecord_<V>|null = null;\n /** @internal */\n _nextAdded: IterableChangeRecord_<V>|null = null;\n /** @internal */\n _nextMoved: IterableChangeRecord_<V>|null = null;\n /** @internal */\n _nextIdentityChange: IterableChangeRecord_<V>|null = null;\n\n\n constructor(public item: V, public trackById: any) {}\n}\n\n// A linked list of CollectionChangeRecords with the same IterableChangeRecord_.item\nclass _DuplicateItemRecordList<V> {\n /** @internal */\n _head: IterableChangeRecord_<V>|null = null;\n /** @internal */\n _tail: IterableChangeRecord_<V>|null = null;\n\n /**\n * Append the record to the list of duplicates.\n *\n * Note: by design all records in the list of duplicates hold the same value in record.item.\n */\n add(record: IterableChangeRecord_<V>): void {\n if (this._head === null) {\n this._head = this._tail = record;\n record._nextDup = null;\n record._prevDup = null;\n } else {\n // TODO(vicb):\n // assert(record.item == _head.item ||\n // record.item is num && record.item.isNaN && _head.item is num && _head.item.isNaN);\n this._tail !._nextDup = record;\n record._prevDup = this._tail;\n record._nextDup = null;\n this._tail = record;\n }\n }\n\n // Returns a IterableChangeRecord_ having IterableChangeRecord_.trackById == trackById and\n // IterableChangeRecord_.currentIndex >= atOrAfterIndex\n get(trackById: any, atOrAfterIndex: number|null): IterableChangeRecord_<V>|null {\n let record: IterableChangeRecord_<V>|null;\n for (record = this._head; record !== null; record = record._nextDup) {\n if ((atOrAfterIndex === null || atOrAfterIndex <= record.currentIndex !) &&\n looseIdentical(record.trackById, trackById)) {\n return record;\n }\n }\n return null;\n }\n\n /**\n * Remove one {@link IterableChangeRecord_} from the list of duplicates.\n *\n * Returns whether the list of duplicates is empty.\n */\n remove(record: IterableChangeRecord_<V>): boolean {\n // TODO(vicb):\n // assert(() {\n // // verify that the record being removed is in the list.\n // for (IterableChangeRecord_ cursor = _head; cursor != null; cursor = cursor._nextDup) {\n // if (identical(cursor, record)) return true;\n // }\n // return false;\n //});\n\n const prev: IterableChangeRecord_<V>|null = record._prevDup;\n const next: IterableChangeRecord_<V>|null = record._nextDup;\n if (prev === null) {\n this._head = next;\n } else {\n prev._nextDup = next;\n }\n if (next === null) {\n this._tail = prev;\n } else {\n next._prevDup = prev;\n }\n return this._head === null;\n }\n}\n\nclass _DuplicateMap<V> {\n map = new Map<any, _DuplicateItemRecordList<V>>();\n\n put(record: IterableChangeRecord_<V>) {\n const key = record.trackById;\n\n let duplicates = this.map.get(key);\n if (!duplicates) {\n duplicates = new _DuplicateItemRecordList<V>();\n this.map.set(key, duplicates);\n }\n duplicates.add(record);\n }\n\n /**\n * Retrieve the `value` using key. Because the IterableChangeRecord_ value may be one which we\n * have already iterated over, we use the `atOrAfterIndex` to pretend it is not there.\n *\n * Use case: `[a, b, c, a, a]` if we are at index `3` which is the second `a` then asking if we\n * have any more `a`s needs to return the second `a`.\n */\n get(trackById: any, atOrAfterIndex: number|null): IterableChangeRecord_<V>|null {\n const key = trackById;\n const recordList = this.map.get(key);\n return recordList ? recordList.get(trackById, atOrAfterIndex) : null;\n }\n\n /**\n * Removes a {@link IterableChangeRecord_} from the list of duplicates.\n *\n * The list of duplicates also is removed from the map if it gets empty.\n */\n remove(record: IterableChangeRecord_<V>): IterableChangeRecord_<V> {\n const key = record.trackById;\n const recordList: _DuplicateItemRecordList<V> = this.map.get(key) !;\n // Remove the list of duplicates when it gets empty\n if (recordList.remove(record)) {\n this.map.delete(key);\n }\n return record;\n }\n\n get isEmpty(): boolean { return this.map.size === 0; }\n\n clear() { this.map.clear(); }\n}\n\nfunction getPreviousIndex(\n item: any, addRemoveOffset: number, moveOffsets: number[] | null): number {\n const previousIndex = item.previousIndex;\n if (previousIndex === null) return previousIndex;\n let moveOffset = 0;\n if (moveOffsets && previousIndex < moveOffsets.length) {\n moveOffset = moveOffsets[previousIndex];\n }\n return previousIndex + addRemoveOffset + moveOffset;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {looseIdentical, stringify} from '../../util';\nimport {isJsObject} from '../change_detection_util';\nimport {KeyValueChangeRecord, KeyValueChanges, KeyValueDiffer, KeyValueDifferFactory} from './keyvalue_differs';\n\n\nexport class DefaultKeyValueDifferFactory<K, V> implements KeyValueDifferFactory {\n constructor() {}\n supports(obj: any): boolean { return obj instanceof Map || isJsObject(obj); }\n\n create<K, V>(): KeyValueDiffer<K, V> { return new DefaultKeyValueDiffer<K, V>(); }\n}\n\nexport class DefaultKeyValueDiffer<K, V> implements KeyValueDiffer<K, V>, KeyValueChanges<K, V> {\n private _records = new Map<K, KeyValueChangeRecord_<K, V>>();\n private _mapHead: KeyValueChangeRecord_<K, V>|null = null;\n // _appendAfter is used in the check loop\n private _appendAfter: KeyValueChangeRecord_<K, V>|null = null;\n private _previousMapHead: KeyValueChangeRecord_<K, V>|null = null;\n private _changesHead: KeyValueChangeRecord_<K, V>|null = null;\n private _changesTail: KeyValueChangeRecord_<K, V>|null = null;\n private _additionsHead: KeyValueChangeRecord_<K, V>|null = null;\n private _additionsTail: KeyValueChangeRecord_<K, V>|null = null;\n private _removalsHead: KeyValueChangeRecord_<K, V>|null = null;\n private _removalsTail: KeyValueChangeRecord_<K, V>|null = null;\n\n get isDirty(): boolean {\n return this._additionsHead !== null || this._changesHead !== null ||\n this._removalsHead !== null;\n }\n\n forEachItem(fn: (r: KeyValueChangeRecord<K, V>) => void) {\n let record: KeyValueChangeRecord_<K, V>|null;\n for (record = this._mapHead; record !== null; record = record._next) {\n fn(record);\n }\n }\n\n forEachPreviousItem(fn: (r: KeyValueChangeRecord<K, V>) => void) {\n let record: KeyValueChangeRecord_<K, V>|null;\n for (record = this._previousMapHead; record !== null; record = record._nextPrevious) {\n fn(record);\n }\n }\n\n forEachChangedItem(fn: (r: KeyValueChangeRecord<K, V>) => void) {\n let record: KeyValueChangeRecord_<K, V>|null;\n for (record = this._changesHead; record !== null; record = record._nextChanged) {\n fn(record);\n }\n }\n\n forEachAddedItem(fn: (r: KeyValueChangeRecord<K, V>) => void) {\n let record: KeyValueChangeRecord_<K, V>|null;\n for (record = this._additionsHead; record !== null; record = record._nextAdded) {\n fn(record);\n }\n }\n\n forEachRemovedItem(fn: (r: KeyValueChangeRecord<K, V>) => void) {\n let record: KeyValueChangeRecord_<K, V>|null;\n for (record = this._removalsHead; record !== null; record = record._nextRemoved) {\n fn(record);\n }\n }\n\n diff(map?: Map<any, any>|{[k: string]: any}|null): any {\n if (!map) {\n map = new Map();\n } else if (!(map instanceof Map || isJsObject(map))) {\n throw new Error(\n `Error trying to diff '${stringify(map)}'. Only maps and objects are allowed`);\n }\n\n return this.check(map) ? this : null;\n }\n\n onDestroy() {}\n\n /**\n * Check the current state of the map vs the previous.\n * The algorithm is optimised for when the keys do no change.\n */\n check(map: Map<any, any>|{[k: string]: any}): boolean {\n this._reset();\n\n let insertBefore = this._mapHead;\n this._appendAfter = null;\n\n this._forEach(map, (value: any, key: any) => {\n if (insertBefore && insertBefore.key === key) {\n this._maybeAddToChanges(insertBefore, value);\n this._appendAfter = insertBefore;\n insertBefore = insertBefore._next;\n } else {\n const record = this._getOrCreateRecordForKey(key, value);\n insertBefore = this._insertBeforeOrAppend(insertBefore, record);\n }\n });\n\n // Items remaining at the end of the list have been deleted\n if (insertBefore) {\n if (insertBefore._prev) {\n insertBefore._prev._next = null;\n }\n\n this._removalsHead = insertBefore;\n\n for (let record: KeyValueChangeRecord_<K, V>|null = insertBefore; record !== null;\n record = record._nextRemoved) {\n if (record === this._mapHead) {\n this._mapHead = null;\n }\n this._records.delete(record.key);\n record._nextRemoved = record._next;\n record.previousValue = record.currentValue;\n record.currentValue = null;\n record._prev = null;\n record._next = null;\n }\n }\n\n // Make sure tails have no next records from previous runs\n if (this._changesTail) this._changesTail._nextChanged = null;\n if (this._additionsTail) this._additionsTail._nextAdded = null;\n\n return this.isDirty;\n }\n\n /**\n * Inserts a record before `before` or append at the end of the list when `before` is null.\n *\n * Notes:\n * - This method appends at `this._appendAfter`,\n * - This method updates `this._appendAfter`,\n * - The return value is the new value for the insertion pointer.\n */\n private _insertBeforeOrAppend(\n before: KeyValueChangeRecord_<K, V>|null,\n record: KeyValueChangeRecord_<K, V>): KeyValueChangeRecord_<K, V>|null {\n if (before) {\n const prev = before._prev;\n record._next = before;\n record._prev = prev;\n before._prev = record;\n if (prev) {\n prev._next = record;\n }\n if (before === this._mapHead) {\n this._mapHead = record;\n }\n\n this._appendAfter = before;\n return before;\n }\n\n if (this._appendAfter) {\n this._appendAfter._next = record;\n record._prev = this._appendAfter;\n } else {\n this._mapHead = record;\n }\n\n this._appendAfter = record;\n return null;\n }\n\n private _getOrCreateRecordForKey(key: K, value: V): KeyValueChangeRecord_<K, V> {\n if (this._records.has(key)) {\n const record = this._records.get(key) !;\n this._maybeAddToChanges(record, value);\n const prev = record._prev;\n const next = record._next;\n if (prev) {\n prev._next = next;\n }\n if (next) {\n next._prev = prev;\n }\n record._next = null;\n record._prev = null;\n\n return record;\n }\n\n const record = new KeyValueChangeRecord_<K, V>(key);\n this._records.set(key, record);\n record.currentValue = value;\n this._addToAdditions(record);\n return record;\n }\n\n /** @internal */\n _reset() {\n if (this.isDirty) {\n let record: KeyValueChangeRecord_<K, V>|null;\n // let `_previousMapHead` contain the state of the map before the changes\n this._previousMapHead = this._mapHead;\n for (record = this._previousMapHead; record !== null; record = record._next) {\n record._nextPrevious = record._next;\n }\n\n // Update `record.previousValue` with the value of the item before the changes\n // We need to update all changed items (that's those which have been added and changed)\n for (record = this._changesHead; record !== null; record = record._nextChanged) {\n record.previousValue = record.currentValue;\n }\n for (record = this._additionsHead; record != null; record = record._nextAdded) {\n record.previousValue = record.currentValue;\n }\n\n this._changesHead = this._changesTail = null;\n this._additionsHead = this._additionsTail = null;\n this._removalsHead = null;\n }\n }\n\n // Add the record or a given key to the list of changes only when the value has actually changed\n private _maybeAddToChanges(record: KeyValueChangeRecord_<K, V>, newValue: any): void {\n if (!looseIdentical(newValue, record.currentValue)) {\n record.previousValue = record.currentValue;\n record.currentValue = newValue;\n this._addToChanges(record);\n }\n }\n\n private _addToAdditions(record: KeyValueChangeRecord_<K, V>) {\n if (this._additionsHead === null) {\n this._additionsHead = this._additionsTail = record;\n } else {\n this._additionsTail !._nextAdded = record;\n this._additionsTail = record;\n }\n }\n\n private _addToChanges(record: KeyValueChangeRecord_<K, V>) {\n if (this._changesHead === null) {\n this._changesHead = this._changesTail = record;\n } else {\n this._changesTail !._nextChanged = record;\n this._changesTail = record;\n }\n }\n\n /** @internal */\n private _forEach<K, V>(obj: Map<K, V>|{[k: string]: V}, fn: (v: V, k: any) => void) {\n if (obj instanceof Map) {\n obj.forEach(fn);\n } else {\n Object.keys(obj).forEach(k => fn(obj[k], k));\n }\n }\n}\n\nclass KeyValueChangeRecord_<K, V> implements KeyValueChangeRecord<K, V> {\n previousValue: V|null = null;\n currentValue: V|null = null;\n\n /** @internal */\n _nextPrevious: KeyValueChangeRecord_<K, V>|null = null;\n /** @internal */\n _next: KeyValueChangeRecord_<K, V>|null = null;\n /** @internal */\n _prev: KeyValueChangeRecord_<K, V>|null = null;\n /** @internal */\n _nextAdded: KeyValueChangeRecord_<K, V>|null = null;\n /** @internal */\n _nextRemoved: KeyValueChangeRecord_<K, V>|null = null;\n /** @internal */\n _nextChanged: KeyValueChangeRecord_<K, V>|null = null;\n\n constructor(public key: K) {}\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {defineInjectable} from '../../di/defs';\nimport {Optional, SkipSelf} from '../../di/metadata';\nimport {StaticProvider} from '../../di/provider';\nimport {DefaultIterableDifferFactory} from '../differs/default_iterable_differ';\n\n\n/**\n * A type describing supported iterable types.\n *\n *\n */\nexport type NgIterable<T> = Array<T>| Iterable<T>;\n\n/**\n * A strategy for tracking changes over time to an iterable. Used by {@link NgForOf} to\n * respond to changes in an iterable by effecting equivalent changes in the DOM.\n *\n *\n */\nexport interface IterableDiffer<V> {\n /**\n * Compute a difference between the previous state and the new `object` state.\n *\n * @param object containing the new value.\n * @returns an object describing the difference. The return value is only valid until the next\n * `diff()` invocation.\n */\n diff(object: NgIterable<V>): IterableChanges<V>|null;\n}\n\n/**\n * An object describing the changes in the `Iterable` collection since last time\n * `IterableDiffer#diff()` was invoked.\n *\n *\n */\nexport interface IterableChanges<V> {\n /**\n * Iterate over all changes. `IterableChangeRecord` will contain information about changes\n * to each item.\n */\n forEachItem(fn: (record: IterableChangeRecord<V>) => void): void;\n\n /**\n * Iterate over a set of operations which when applied to the original `Iterable` will produce the\n * new `Iterable`.\n *\n * NOTE: These are not necessarily the actual operations which were applied to the original\n * `Iterable`, rather these are a set of computed operations which may not be the same as the\n * ones applied.\n *\n * @param record A change which needs to be applied\n * @param previousIndex The `IterableChangeRecord#previousIndex` of the `record` refers to the\n * original `Iterable` location, where as `previousIndex` refers to the transient location\n * of the item, after applying the operations up to this point.\n * @param currentIndex The `IterableChangeRecord#currentIndex` of the `record` refers to the\n * original `Iterable` location, where as `currentIndex` refers to the transient location\n * of the item, after applying the operations up to this point.\n */\n forEachOperation(\n fn:\n (record: IterableChangeRecord<V>, previousIndex: number|null,\n currentIndex: number|null) => void): void;\n\n /**\n * Iterate over changes in the order of original `Iterable` showing where the original items\n * have moved.\n */\n forEachPreviousItem(fn: (record: IterableChangeRecord<V>) => void): void;\n\n /** Iterate over all added items. */\n forEachAddedItem(fn: (record: IterableChangeRecord<V>) => void): void;\n\n /** Iterate over all moved items. */\n forEachMovedItem(fn: (record: IterableChangeRecord<V>) => void): void;\n\n /** Iterate over all removed items. */\n forEachRemovedItem(fn: (record: IterableChangeRecord<V>) => void): void;\n\n /** Iterate over all items which had their identity (as computed by the `TrackByFunction`)\n * changed. */\n forEachIdentityChange(fn: (record: IterableChangeRecord<V>) => void): void;\n}\n\n/**\n * Record representing the item change information.\n *\n *\n */\nexport interface IterableChangeRecord<V> {\n /** Current index of the item in `Iterable` or null if removed. */\n readonly currentIndex: number|null;\n\n /** Previous index of the item in `Iterable` or null if added. */\n readonly previousIndex: number|null;\n\n /** The item. */\n readonly item: V;\n\n /** Track by identity as computed by the `TrackByFunction`. */\n readonly trackById: any;\n}\n\n/**\n * @deprecated v4.0.0 - Use IterableChangeRecord instead.\n */\nexport interface CollectionChangeRecord<V> extends IterableChangeRecord<V> {}\n\n/**\n * An optional function passed into {@link NgForOf} that defines how to track\n * items in an iterable (e.g. fby index or id)\n *\n *\n */\nexport interface TrackByFunction<T> { (index: number, item: T): any; }\n\n/**\n * Provides a factory for {@link IterableDiffer}.\n *\n *\n */\nexport interface IterableDifferFactory {\n supports(objects: any): boolean;\n create<V>(trackByFn?: TrackByFunction<V>): IterableDiffer<V>;\n}\n\n/**\n * A repository of different iterable diffing strategies used by NgFor, NgClass, and others.\n *\n */\nexport class IterableDiffers {\n static ngInjectableDef = defineInjectable({\n providedIn: 'root',\n factory: () => new IterableDiffers([new DefaultIterableDifferFactory()])\n });\n\n /**\n * @deprecated v4.0.0 - Should be private\n */\n factories: IterableDifferFactory[];\n constructor(factories: IterableDifferFactory[]) { this.factories = factories; }\n\n static create(factories: IterableDifferFactory[], parent?: IterableDiffers): IterableDiffers {\n if (parent != null) {\n const copied = parent.factories.slice();\n factories = factories.concat(copied);\n }\n\n return new IterableDiffers(factories);\n }\n\n /**\n * Takes an array of {@link IterableDifferFactory} and returns a provider used to extend the\n * inherited {@link IterableDiffers} instance with the provided factories and return a new\n * {@link IterableDiffers} instance.\n *\n * @usageNotes\n * ### Example\n *\n * The following example shows how to extend an existing list of factories,\n * which will only be applied to the injector for this component and its children.\n * This step is all that's required to make a new {@link IterableDiffer} available.\n *\n * ```\n * @Component({\n * viewProviders: [\n * IterableDiffers.extend([new ImmutableListDiffer()])\n * ]\n * })\n * ```\n */\n static extend(factories: IterableDifferFactory[]): StaticProvider {\n return {\n provide: IterableDiffers,\n useFactory: (parent: IterableDiffers) => {\n if (!parent) {\n // Typically would occur when calling IterableDiffers.extend inside of dependencies passed\n // to\n // bootstrap(), which would override default pipes instead of extending them.\n throw new Error('Cannot extend IterableDiffers without a parent injector');\n }\n return IterableDiffers.create(factories, parent);\n },\n // Dependency technically isn't optional, but we can provide a better error message this way.\n deps: [[IterableDiffers, new SkipSelf(), new Optional()]]\n };\n }\n\n find(iterable: any): IterableDifferFactory {\n const factory = this.factories.find(f => f.supports(iterable));\n if (factory != null) {\n return factory;\n } else {\n throw new Error(\n `Cannot find a differ supporting object '${iterable}' of type '${getTypeNameForDebugging(iterable)}'`);\n }\n }\n}\n\nexport function getTypeNameForDebugging(type: any): string {\n return type['name'] || typeof type;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Optional, SkipSelf, StaticProvider} from '../../di';\n\n\n/**\n * A differ that tracks changes made to an object over time.\n *\n *\n */\nexport interface KeyValueDiffer<K, V> {\n /**\n * Compute a difference between the previous state and the new `object` state.\n *\n * @param object containing the new value.\n * @returns an object describing the difference. The return value is only valid until the next\n * `diff()` invocation.\n */\n diff(object: Map<K, V>): KeyValueChanges<K, V>|null;\n\n /**\n * Compute a difference between the previous state and the new `object` state.\n *\n * @param object containing the new value.\n * @returns an object describing the difference. The return value is only valid until the next\n * `diff()` invocation.\n */\n diff(object: {[key: string]: V}): KeyValueChanges<string, V>|null;\n // TODO(TS2.1): diff<KP extends string>(this: KeyValueDiffer<KP, V>, object: Record<KP, V>):\n // KeyValueDiffer<KP, V>;\n}\n\n/**\n * An object describing the changes in the `Map` or `{[k:string]: string}` since last time\n * `KeyValueDiffer#diff()` was invoked.\n *\n *\n */\nexport interface KeyValueChanges<K, V> {\n /**\n * Iterate over all changes. `KeyValueChangeRecord` will contain information about changes\n * to each item.\n */\n forEachItem(fn: (r: KeyValueChangeRecord<K, V>) => void): void;\n\n /**\n * Iterate over changes in the order of original Map showing where the original items\n * have moved.\n */\n forEachPreviousItem(fn: (r: KeyValueChangeRecord<K, V>) => void): void;\n\n /**\n * Iterate over all keys for which values have changed.\n */\n forEachChangedItem(fn: (r: KeyValueChangeRecord<K, V>) => void): void;\n\n /**\n * Iterate over all added items.\n */\n forEachAddedItem(fn: (r: KeyValueChangeRecord<K, V>) => void): void;\n\n /**\n * Iterate over all removed items.\n */\n forEachRemovedItem(fn: (r: KeyValueChangeRecord<K, V>) => void): void;\n}\n\n/**\n * Record representing the item change information.\n *\n *\n */\nexport interface KeyValueChangeRecord<K, V> {\n /**\n * Current key in the Map.\n */\n readonly key: K;\n\n /**\n * Current value for the key or `null` if removed.\n */\n readonly currentValue: V|null;\n\n /**\n * Previous value for the key or `null` if added.\n */\n readonly previousValue: V|null;\n}\n\n/**\n * Provides a factory for {@link KeyValueDiffer}.\n *\n *\n */\nexport interface KeyValueDifferFactory {\n /**\n * Test to see if the differ knows how to diff this kind of object.\n */\n supports(objects: any): boolean;\n\n /**\n * Create a `KeyValueDiffer`.\n */\n create<K, V>(): KeyValueDiffer<K, V>;\n}\n\n/**\n * A repository of different Map diffing strategies used by NgClass, NgStyle, and others.\n *\n */\nexport class KeyValueDiffers {\n /**\n * @deprecated v4.0.0 - Should be private.\n */\n factories: KeyValueDifferFactory[];\n\n constructor(factories: KeyValueDifferFactory[]) { this.factories = factories; }\n\n static create<S>(factories: KeyValueDifferFactory[], parent?: KeyValueDiffers): KeyValueDiffers {\n if (parent) {\n const copied = parent.factories.slice();\n factories = factories.concat(copied);\n }\n return new KeyValueDiffers(factories);\n }\n\n /**\n * Takes an array of {@link KeyValueDifferFactory} and returns a provider used to extend the\n * inherited {@link KeyValueDiffers} instance with the provided factories and return a new\n * {@link KeyValueDiffers} instance.\n *\n * @usageNotes\n * ### Example\n *\n * The following example shows how to extend an existing list of factories,\n * which will only be applied to the injector for this component and its children.\n * This step is all that's required to make a new {@link KeyValueDiffer} available.\n *\n * ```\n * @Component({\n * viewProviders: [\n * KeyValueDiffers.extend([new ImmutableMapDiffer()])\n * ]\n * })\n * ```\n */\n static extend<S>(factories: KeyValueDifferFactory[]): StaticProvider {\n return {\n provide: KeyValueDiffers,\n useFactory: (parent: KeyValueDiffers) => {\n if (!parent) {\n // Typically would occur when calling KeyValueDiffers.extend inside of dependencies passed\n // to bootstrap(), which would override default pipes instead of extending them.\n throw new Error('Cannot extend KeyValueDiffers without a parent injector');\n }\n return KeyValueDiffers.create(factories, parent);\n },\n // Dependency technically isn't optional, but we can provide a better error message this way.\n deps: [[KeyValueDiffers, new SkipSelf(), new Optional()]]\n };\n }\n\n find(kv: any): KeyValueDifferFactory {\n const factory = this.factories.find(f => f.supports(kv));\n if (factory) {\n return factory;\n }\n throw new Error(`Cannot find a differ supporting object '${kv}'`);\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {DefaultIterableDifferFactory} from './differs/default_iterable_differ';\nimport {DefaultKeyValueDifferFactory} from './differs/default_keyvalue_differ';\nimport {IterableDifferFactory, IterableDiffers} from './differs/iterable_differs';\nimport {KeyValueDifferFactory, KeyValueDiffers} from './differs/keyvalue_differs';\n\nexport {SimpleChanges} from '../metadata/lifecycle_hooks';\nexport {SimpleChange, WrappedValue, devModeEqual} from './change_detection_util';\nexport {ChangeDetectorRef} from './change_detector_ref';\nexport {ChangeDetectionStrategy, ChangeDetectorStatus, isDefaultChangeDetectionStrategy} from './constants';\nexport {DefaultIterableDifferFactory} from './differs/default_iterable_differ';\nexport {DefaultIterableDiffer} from './differs/default_iterable_differ';\nexport {DefaultKeyValueDifferFactory} from './differs/default_keyvalue_differ';\nexport {CollectionChangeRecord, IterableChangeRecord, IterableChanges, IterableDiffer, IterableDifferFactory, IterableDiffers, NgIterable, TrackByFunction} from './differs/iterable_differs';\nexport {KeyValueChangeRecord, KeyValueChanges, KeyValueDiffer, KeyValueDifferFactory, KeyValueDiffers} from './differs/keyvalue_differs';\nexport {PipeTransform} from './pipe_transform';\n\n\n\n/**\n * Structural diffing for `Object`s and `Map`s.\n */\nconst keyValDiff: KeyValueDifferFactory[] = [new DefaultKeyValueDifferFactory()];\n\n/**\n * Structural diffing for `Iterable` types such as `Array`s.\n */\nconst iterableDiff: IterableDifferFactory[] = [new DefaultIterableDifferFactory()];\n\nexport const defaultIterableDiffers = new IterableDiffers(iterableDiff);\n\nexport const defaultKeyValueDiffers = new KeyValueDiffers(keyValDiff);\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @module\n * @description\n * Change detection enables data binding in Angular.\n */\n\nexport {ChangeDetectionStrategy, ChangeDetectorRef, CollectionChangeRecord, DefaultIterableDiffer, IterableChangeRecord, IterableChanges, IterableDiffer, IterableDifferFactory, IterableDiffers, KeyValueChangeRecord, KeyValueChanges, KeyValueDiffer, KeyValueDifferFactory, KeyValueDiffers, NgIterable, PipeTransform, SimpleChange, SimpleChanges, TrackByFunction, WrappedValue} from './change_detection/change_detection';\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {PlatformRef, createPlatformFactory} from './application_ref';\nimport {PLATFORM_ID} from './application_tokens';\nimport {Console} from './console';\nimport {Injector, StaticProvider} from './di';\nimport {TestabilityRegistry} from './testability/testability';\n\nconst _CORE_PLATFORM_PROVIDERS: StaticProvider[] = [\n // Set a default platform name for platforms that don't set it explicitly.\n {provide: PLATFORM_ID, useValue: 'unknown'},\n {provide: PlatformRef, deps: [Injector]},\n {provide: TestabilityRegistry, deps: []},\n {provide: Console, deps: []},\n];\n\n/**\n * This platform has to be included in any other platform\n *\n * @experimental\n */\nexport const platformCore = createPlatformFactory(null, 'core', _CORE_PLATFORM_PROVIDERS);\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {InjectionToken} from '../di/injection_token';\n\n/**\n * Provide this token to set the locale of your application.\n * It is used for i18n extraction, by i18n pipes (DatePipe, I18nPluralPipe, CurrencyPipe,\n * DecimalPipe and PercentPipe) and by ICU expressions.\n *\n * See the [i18n guide](guide/i18n#setting-up-locale) for more information.\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * import { LOCALE_ID } from '@angular/core';\n * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\n * import { AppModule } from './app/app.module';\n *\n * platformBrowserDynamic().bootstrapModule(AppModule, {\n * providers: [{provide: LOCALE_ID, useValue: 'en-US' }]\n * });\n * ```\n *\n * @experimental i18n support is experimental.\n */\nexport const LOCALE_ID = new InjectionToken<string>('LocaleId');\n\n/**\n * Use this token at bootstrap to provide the content of your translation file (`xtb`,\n * `xlf` or `xlf2`) when you want to translate your application in another language.\n *\n * See the [i18n guide](guide/i18n#merge) for more information.\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * import { TRANSLATIONS } from '@angular/core';\n * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\n * import { AppModule } from './app/app.module';\n *\n * // content of your translation file\n * const translations = '....';\n *\n * platformBrowserDynamic().bootstrapModule(AppModule, {\n * providers: [{provide: TRANSLATIONS, useValue: translations }]\n * });\n * ```\n *\n * @experimental i18n support is experimental.\n */\nexport const TRANSLATIONS = new InjectionToken<string>('Translations');\n\n/**\n * Provide this token at bootstrap to set the format of your {@link TRANSLATIONS}: `xtb`,\n * `xlf` or `xlf2`.\n *\n * See the [i18n guide](guide/i18n#merge) for more information.\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * import { TRANSLATIONS_FORMAT } from '@angular/core';\n * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\n * import { AppModule } from './app/app.module';\n *\n * platformBrowserDynamic().bootstrapModule(AppModule, {\n * providers: [{provide: TRANSLATIONS_FORMAT, useValue: 'xlf' }]\n * });\n * ```\n *\n * @experimental i18n support is experimental.\n */\nexport const TRANSLATIONS_FORMAT = new InjectionToken<string>('TranslationsFormat');\n\n/**\n * Use this enum at bootstrap as an option of `bootstrapModule` to define the strategy\n * that the compiler should use in case of missing translations:\n * - Error: throw if you have missing translations.\n * - Warning (default): show a warning in the console and/or shell.\n * - Ignore: do nothing.\n *\n * See the [i18n guide](guide/i18n#missing-translation) for more information.\n *\n * @usageNotes\n * ### Example\n * ```typescript\n * import { MissingTranslationStrategy } from '@angular/core';\n * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\n * import { AppModule } from './app/app.module';\n *\n * platformBrowserDynamic().bootstrapModule(AppModule, {\n * missingTranslation: MissingTranslationStrategy.Error\n * });\n * ```\n *\n * @experimental i18n support is experimental.\n */\nexport enum MissingTranslationStrategy {\n Error = 0,\n Warning = 1,\n Ignore = 2,\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {APP_INITIALIZER, ApplicationInitStatus} from './application_init';\nimport {ApplicationRef} from './application_ref';\nimport {APP_ID_RANDOM_PROVIDER} from './application_tokens';\nimport {IterableDiffers, KeyValueDiffers, defaultIterableDiffers, defaultKeyValueDiffers} from './change_detection/change_detection';\nimport {Console} from './console';\nimport {InjectionToken, Injector, StaticProvider} from './di';\nimport {Inject, Optional, SkipSelf} from './di/metadata';\nimport {ErrorHandler} from './error_handler';\nimport {LOCALE_ID} from './i18n/tokens';\nimport {ComponentFactoryResolver} from './linker';\nimport {Compiler} from './linker/compiler';\nimport {NgModule} from './metadata';\nimport {NgZone} from './zone';\n\nexport function _iterableDiffersFactory() {\n return defaultIterableDiffers;\n}\n\nexport function _keyValueDiffersFactory() {\n return defaultKeyValueDiffers;\n}\n\nexport function _localeFactory(locale?: string): string {\n return locale || 'en-US';\n}\n\n/**\n * A built-in [dependency injection token](guide/glossary#di-token)\n * that is used to configure the root injector for bootstrapping.\n */\nexport const APPLICATION_MODULE_PROVIDERS: StaticProvider[] = [\n {\n provide: ApplicationRef,\n useClass: ApplicationRef,\n deps:\n [NgZone, Console, Injector, ErrorHandler, ComponentFactoryResolver, ApplicationInitStatus]\n },\n {\n provide: ApplicationInitStatus,\n useClass: ApplicationInitStatus,\n deps: [[new Optional(), APP_INITIALIZER]]\n },\n {provide: Compiler, useClass: Compiler, deps: []},\n APP_ID_RANDOM_PROVIDER,\n {provide: IterableDiffers, useFactory: _iterableDiffersFactory, deps: []},\n {provide: KeyValueDiffers, useFactory: _keyValueDiffersFactory, deps: []},\n {\n provide: LOCALE_ID,\n useFactory: _localeFactory,\n deps: [[new Inject(LOCALE_ID), new Optional(), new SkipSelf()]]\n },\n];\n\n/**\n * Configures the root injector for an app with\n * providers of `@angular/core` dependencies that `ApplicationRef` needs\n * to bootstrap components.\n *\n * Re-exported by `BrowserModule`, which is included automatically in the root\n * `AppModule` when you create a new app with the CLI `new` command.\n *\n * @experimental\n */\n@NgModule({providers: APPLICATION_MODULE_PROVIDERS})\nexport class ApplicationModule {\n // Inject ApplicationRef to make it eager...\n constructor(appRef: ApplicationRef) {}\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Component} from './directives';\n\n\n/**\n * Used to resolve resource URLs on `@Component` when used with JIT compilation.\n *\n * Example:\n * ```\n * @Component({\n * selector: 'my-comp',\n * templateUrl: 'my-comp.html', // This requires asynchronous resolution\n * })\n * class MyComponnent{\n * }\n *\n * // Calling `renderComponent` will fail because `MyComponent`'s `@Compenent.templateUrl`\n * // needs to be resolved because `renderComponent` is synchronous process.\n * // renderComponent(MyComponent);\n *\n * // Calling `resolveComponentResources` will resolve `@Compenent.templateUrl` into\n * // `@Compenent.template`, which would allow `renderComponent` to proceed in synchronous manner.\n * // Use browser's `fetch` function as the default resource resolution strategy.\n * resolveComponentResources(fetch).then(() => {\n * // After resolution all URLs have been converted into strings.\n * renderComponent(MyComponent);\n * });\n *\n * ```\n *\n * NOTE: In AOT the resolution happens during compilation, and so there should be no need\n * to call this method outside JIT mode.\n *\n * @param resourceResolver a function which is responsible to returning a `Promise` of the resolved\n * URL. Browser's `fetch` method is a good default implementation.\n */\nexport function resolveComponentResources(\n resourceResolver: (url: string) => (Promise<string|{text(): Promise<string>}>)): Promise<null> {\n // Store all promises which are fetching the resources.\n const urlFetches: Promise<string>[] = [];\n\n // Cache so that we don't fetch the same resource more than once.\n const urlMap = new Map<string, Promise<string>>();\n function cachedResourceResolve(url: string): Promise<string> {\n let promise = urlMap.get(url);\n if (!promise) {\n const resp = resourceResolver(url);\n urlMap.set(url, promise = resp.then(unwrapResponse));\n urlFetches.push(promise);\n }\n return promise;\n }\n\n componentResourceResolutionQueue.forEach((component: Component) => {\n if (component.templateUrl) {\n cachedResourceResolve(component.templateUrl).then((template) => {\n component.template = template;\n component.templateUrl = undefined;\n });\n }\n const styleUrls = component.styleUrls;\n const styles = component.styles || (component.styles = []);\n const styleOffset = component.styles.length;\n styleUrls && styleUrls.forEach((styleUrl, index) => {\n styles.push(''); // pre-allocate array.\n cachedResourceResolve(styleUrl).then((style) => {\n styles[styleOffset + index] = style;\n styleUrls.splice(styleUrls.indexOf(styleUrl), 1);\n if (styleUrls.length == 0) {\n component.styleUrls = undefined;\n }\n });\n });\n });\n componentResourceResolutionQueue.clear();\n return Promise.all(urlFetches).then(() => null);\n}\n\nconst componentResourceResolutionQueue: Set<Component> = new Set();\n\nexport function maybeQueueResolutionOfComponentResources(metadata: Component) {\n if (componentNeedsResolution(metadata)) {\n componentResourceResolutionQueue.add(metadata);\n }\n}\n\nexport function componentNeedsResolution(component: Component) {\n return component.templateUrl || component.styleUrls && component.styleUrls.length;\n}\nexport function clearResolutionOfComponentResourcesQueue() {\n componentResourceResolutionQueue.clear();\n}\n\nfunction unwrapResponse(response: string | {text(): Promise<string>}): string|Promise<string> {\n return typeof response == 'string' ? response : response.text();\n}","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * This helper class is used to get hold of an inert tree of DOM elements containing dirty HTML\n * that needs sanitizing.\n * Depending upon browser support we must use one of three strategies for doing this.\n * Support: Safari 10.x -> XHR strategy\n * Support: Firefox -> DomParser strategy\n * Default: InertDocument strategy\n */\nexport class InertBodyHelper {\n private inertBodyElement: HTMLElement;\n private inertDocument: Document;\n\n constructor(private defaultDoc: Document) {\n this.inertDocument = this.defaultDoc.implementation.createHTMLDocument('sanitization-inert');\n this.inertBodyElement = this.inertDocument.body;\n\n if (this.inertBodyElement == null) {\n // usually there should be only one body element in the document, but IE doesn't have any, so\n // we need to create one.\n const inertHtml = this.inertDocument.createElement('html');\n this.inertDocument.appendChild(inertHtml);\n this.inertBodyElement = this.inertDocument.createElement('body');\n inertHtml.appendChild(this.inertBodyElement);\n }\n\n this.inertBodyElement.innerHTML = '<svg><g onload=\"this.parentNode.remove()\"></g></svg>';\n if (this.inertBodyElement.querySelector && !this.inertBodyElement.querySelector('svg')) {\n // We just hit the Safari 10.1 bug - which allows JS to run inside the SVG G element\n // so use the XHR strategy.\n this.getInertBodyElement = this.getInertBodyElement_XHR;\n return;\n }\n\n this.inertBodyElement.innerHTML =\n '<svg><p><style><img src=\"</style><img src=x onerror=alert(1)//\">';\n if (this.inertBodyElement.querySelector && this.inertBodyElement.querySelector('svg img')) {\n // We just hit the Firefox bug - which prevents the inner img JS from being sanitized\n // so use the DOMParser strategy, if it is available.\n // If the DOMParser is not available then we are not in Firefox (Server/WebWorker?) so we\n // fall through to the default strategy below.\n if (isDOMParserAvailable()) {\n this.getInertBodyElement = this.getInertBodyElement_DOMParser;\n return;\n }\n }\n\n // None of the bugs were hit so it is safe for us to use the default InertDocument strategy\n this.getInertBodyElement = this.getInertBodyElement_InertDocument;\n }\n\n /**\n * Get an inert DOM element containing DOM created from the dirty HTML string provided.\n * The implementation of this is determined in the constructor, when the class is instantiated.\n */\n getInertBodyElement: (html: string) => HTMLElement | null;\n\n /**\n * Use XHR to create and fill an inert body element (on Safari 10.1)\n * See\n * https://github.com/cure53/DOMPurify/blob/a992d3a75031cb8bb032e5ea8399ba972bdf9a65/src/purify.js#L439-L449\n */\n private getInertBodyElement_XHR(html: string) {\n // We add these extra elements to ensure that the rest of the content is parsed as expected\n // e.g. leading whitespace is maintained and tags like `<meta>` do not get hoisted to the\n // `<head>` tag.\n html = '<body><remove></remove>' + html + '</body>';\n try {\n html = encodeURI(html);\n } catch (e) {\n return null;\n }\n const xhr = new XMLHttpRequest();\n xhr.responseType = 'document';\n xhr.open('GET', 'data:text/html;charset=utf-8,' + html, false);\n xhr.send(null);\n const body: HTMLBodyElement = xhr.response.body;\n body.removeChild(body.firstChild !);\n return body;\n }\n\n /**\n * Use DOMParser to create and fill an inert body element (on Firefox)\n * See https://github.com/cure53/DOMPurify/releases/tag/0.6.7\n *\n */\n private getInertBodyElement_DOMParser(html: string) {\n // We add these extra elements to ensure that the rest of the content is parsed as expected\n // e.g. leading whitespace is maintained and tags like `<meta>` do not get hoisted to the\n // `<head>` tag.\n html = '<body><remove></remove>' + html + '</body>';\n try {\n const body = new (window as any)\n .DOMParser()\n .parseFromString(html, 'text/html')\n .body as HTMLBodyElement;\n body.removeChild(body.firstChild !);\n return body;\n } catch (e) {\n return null;\n }\n }\n\n /**\n * Use an HTML5 `template` element, if supported, or an inert body element created via\n * `createHtmlDocument` to create and fill an inert DOM element.\n * This is the default sane strategy to use if the browser does not require one of the specialised\n * strategies above.\n */\n private getInertBodyElement_InertDocument(html: string) {\n // Prefer using <template> element if supported.\n const templateEl = this.inertDocument.createElement('template');\n if ('content' in templateEl) {\n templateEl.innerHTML = html;\n return templateEl;\n }\n\n this.inertBodyElement.innerHTML = html;\n\n // Support: IE 9-11 only\n // strip custom-namespaced attributes on IE<=11\n if ((this.defaultDoc as any).documentMode) {\n this.stripCustomNsAttrs(this.inertBodyElement);\n }\n\n return this.inertBodyElement;\n }\n\n /**\n * When IE9-11 comes across an unknown namespaced attribute e.g. 'xlink:foo' it adds 'xmlns:ns1'\n * attribute to declare ns1 namespace and prefixes the attribute with 'ns1' (e.g.\n * 'ns1:xlink:foo').\n *\n * This is undesirable since we don't want to allow any of these custom attributes. This method\n * strips them all.\n */\n private stripCustomNsAttrs(el: Element) {\n const elAttrs = el.attributes;\n // loop backwards so that we can support removals.\n for (let i = elAttrs.length - 1; 0 < i; i--) {\n const attrib = elAttrs.item(i);\n const attrName = attrib !.name;\n if (attrName === 'xmlns:ns1' || attrName.indexOf('ns1:') === 0) {\n el.removeAttribute(attrName);\n }\n }\n let childNode = el.firstChild;\n while (childNode) {\n if (childNode.nodeType === Node.ELEMENT_NODE) this.stripCustomNsAttrs(childNode as Element);\n childNode = childNode.nextSibling;\n }\n }\n}\n\n/**\n * We need to determine whether the DOMParser exists in the global context.\n * The try-catch is because, on some browsers, trying to access this property\n * on window can actually throw an error.\n *\n * @suppress {uselessCode}\n */\nfunction isDOMParserAvailable() {\n try {\n return !!(window as any).DOMParser;\n } catch (e) {\n return false;\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {isDevMode} from '../application_ref';\n\n/**\n * A pattern that recognizes a commonly useful subset of URLs that are safe.\n *\n * This regular expression matches a subset of URLs that will not cause script\n * execution if used in URL context within a HTML document. Specifically, this\n * regular expression matches if (comment from here on and regex copied from\n * Soy's EscapingConventions):\n * (1) Either a protocol in a whitelist (http, https, mailto or ftp).\n * (2) or no protocol. A protocol must be followed by a colon. The below\n * allows that by allowing colons only after one of the characters [/?#].\n * A colon after a hash (#) must be in the fragment.\n * Otherwise, a colon after a (?) must be in a query.\n * Otherwise, a colon after a single solidus (/) must be in a path.\n * Otherwise, a colon after a double solidus (//) must be in the authority\n * (before port).\n *\n * The pattern disallows &, used in HTML entity declarations before\n * one of the characters in [/?#]. This disallows HTML entities used in the\n * protocol name, which should never happen, e.g. \"h&#116;tp\" for \"http\".\n * It also disallows HTML entities in the first path part of a relative path,\n * e.g. \"foo&lt;bar/baz\". Our existing escaping functions should not produce\n * that. More importantly, it disallows masking of a colon,\n * e.g. \"javascript&#58;...\".\n *\n * This regular expression was taken from the Closure sanitization library.\n */\nconst SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi;\n\n/* A pattern that matches safe srcset values */\nconst SAFE_SRCSET_PATTERN = /^(?:(?:https?|file):|[^&:/?#]*(?:[/?#]|$))/gi;\n\n/** A pattern that matches safe data URLs. Only matches image, video and audio types. */\nconst DATA_URL_PATTERN =\n /^data:(?:image\\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\\/(?:mpeg|mp4|ogg|webm)|audio\\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+\\/]+=*$/i;\n\nexport function _sanitizeUrl(url: string): string {\n url = String(url);\n if (url.match(SAFE_URL_PATTERN) || url.match(DATA_URL_PATTERN)) return url;\n\n if (isDevMode()) {\n console.warn(`WARNING: sanitizing unsafe URL value ${url} (see http://g.co/ng/security#xss)`);\n }\n\n return 'unsafe:' + url;\n}\n\nexport function sanitizeSrcset(srcset: string): string {\n srcset = String(srcset);\n return srcset.split(',').map((srcset) => _sanitizeUrl(srcset.trim())).join(', ');\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {isDevMode} from '../application_ref';\nimport {InertBodyHelper} from './inert_body';\nimport {_sanitizeUrl, sanitizeSrcset} from './url_sanitizer';\n\nfunction tagSet(tags: string): {[k: string]: boolean} {\n const res: {[k: string]: boolean} = {};\n for (const t of tags.split(',')) res[t] = true;\n return res;\n}\n\nfunction merge(...sets: {[k: string]: boolean}[]): {[k: string]: boolean} {\n const res: {[k: string]: boolean} = {};\n for (const s of sets) {\n for (const v in s) {\n if (s.hasOwnProperty(v)) res[v] = true;\n }\n }\n return res;\n}\n\n// Good source of info about elements and attributes\n// http://dev.w3.org/html5/spec/Overview.html#semantics\n// http://simon.html5.org/html-elements\n\n// Safe Void Elements - HTML5\n// http://dev.w3.org/html5/spec/Overview.html#void-elements\nconst VOID_ELEMENTS = tagSet('area,br,col,hr,img,wbr');\n\n// Elements that you can, intentionally, leave open (and which close themselves)\n// http://dev.w3.org/html5/spec/Overview.html#optional-tags\nconst OPTIONAL_END_TAG_BLOCK_ELEMENTS = tagSet('colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr');\nconst OPTIONAL_END_TAG_INLINE_ELEMENTS = tagSet('rp,rt');\nconst OPTIONAL_END_TAG_ELEMENTS =\n merge(OPTIONAL_END_TAG_INLINE_ELEMENTS, OPTIONAL_END_TAG_BLOCK_ELEMENTS);\n\n// Safe Block Elements - HTML5\nconst BLOCK_ELEMENTS = merge(\n OPTIONAL_END_TAG_BLOCK_ELEMENTS,\n tagSet(\n 'address,article,' +\n 'aside,blockquote,caption,center,del,details,dialog,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,' +\n 'h6,header,hgroup,hr,ins,main,map,menu,nav,ol,pre,section,summary,table,ul'));\n\n// Inline Elements - HTML5\nconst INLINE_ELEMENTS = merge(\n OPTIONAL_END_TAG_INLINE_ELEMENTS,\n tagSet(\n 'a,abbr,acronym,audio,b,' +\n 'bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,picture,q,ruby,rp,rt,s,' +\n 'samp,small,source,span,strike,strong,sub,sup,time,track,tt,u,var,video'));\n\nconst VALID_ELEMENTS =\n merge(VOID_ELEMENTS, BLOCK_ELEMENTS, INLINE_ELEMENTS, OPTIONAL_END_TAG_ELEMENTS);\n\n// Attributes that have href and hence need to be sanitized\nconst URI_ATTRS = tagSet('background,cite,href,itemtype,longdesc,poster,src,xlink:href');\n\n// Attributes that have special href set hence need to be sanitized\nconst SRCSET_ATTRS = tagSet('srcset');\n\nconst HTML_ATTRS = tagSet(\n 'abbr,accesskey,align,alt,autoplay,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,' +\n 'compact,controls,coords,datetime,default,dir,download,face,headers,height,hidden,hreflang,hspace,' +\n 'ismap,itemscope,itemprop,kind,label,lang,language,loop,media,muted,nohref,nowrap,open,preload,rel,rev,role,rows,rowspan,rules,' +\n 'scope,scrolling,shape,size,sizes,span,srclang,start,summary,tabindex,target,title,translate,type,usemap,' +\n 'valign,value,vspace,width');\n\n// NB: This currently consciously doesn't support SVG. SVG sanitization has had several security\n// issues in the past, so it seems safer to leave it out if possible. If support for binding SVG via\n// innerHTML is required, SVG attributes should be added here.\n\n// NB: Sanitization does not allow <form> elements or other active elements (<button> etc). Those\n// can be sanitized, but they increase security surface area without a legitimate use case, so they\n// are left out here.\n\nconst VALID_ATTRS = merge(URI_ATTRS, SRCSET_ATTRS, HTML_ATTRS);\n\n/**\n * SanitizingHtmlSerializer serializes a DOM fragment, stripping out any unsafe elements and unsafe\n * attributes.\n */\nclass SanitizingHtmlSerializer {\n // Explicitly track if something was stripped, to avoid accidentally warning of sanitization just\n // because characters were re-encoded.\n public sanitizedSomething = false;\n private buf: string[] = [];\n\n sanitizeChildren(el: Element): string {\n // This cannot use a TreeWalker, as it has to run on Angular's various DOM adapters.\n // However this code never accesses properties off of `document` before deleting its contents\n // again, so it shouldn't be vulnerable to DOM clobbering.\n let current: Node = el.firstChild !;\n while (current) {\n if (current.nodeType === Node.ELEMENT_NODE) {\n this.startElement(current as Element);\n } else if (current.nodeType === Node.TEXT_NODE) {\n this.chars(current.nodeValue !);\n } else {\n // Strip non-element, non-text nodes.\n this.sanitizedSomething = true;\n }\n if (current.firstChild) {\n current = current.firstChild !;\n continue;\n }\n while (current) {\n // Leaving the element. Walk up and to the right, closing tags as we go.\n if (current.nodeType === Node.ELEMENT_NODE) {\n this.endElement(current as Element);\n }\n\n let next = this.checkClobberedElement(current, current.nextSibling !);\n\n if (next) {\n current = next;\n break;\n }\n\n current = this.checkClobberedElement(current, current.parentNode !);\n }\n }\n return this.buf.join('');\n }\n\n private startElement(element: Element) {\n const tagName = element.nodeName.toLowerCase();\n if (!VALID_ELEMENTS.hasOwnProperty(tagName)) {\n this.sanitizedSomething = true;\n return;\n }\n this.buf.push('<');\n this.buf.push(tagName);\n const elAttrs = element.attributes;\n for (let i = 0; i < elAttrs.length; i++) {\n const elAttr = elAttrs.item(i);\n const attrName = elAttr !.name;\n const lower = attrName.toLowerCase();\n if (!VALID_ATTRS.hasOwnProperty(lower)) {\n this.sanitizedSomething = true;\n continue;\n }\n let value = elAttr !.value;\n // TODO(martinprobst): Special case image URIs for data:image/...\n if (URI_ATTRS[lower]) value = _sanitizeUrl(value);\n if (SRCSET_ATTRS[lower]) value = sanitizeSrcset(value);\n this.buf.push(' ', attrName, '=\"', encodeEntities(value), '\"');\n }\n this.buf.push('>');\n }\n\n private endElement(current: Element) {\n const tagName = current.nodeName.toLowerCase();\n if (VALID_ELEMENTS.hasOwnProperty(tagName) && !VOID_ELEMENTS.hasOwnProperty(tagName)) {\n this.buf.push('</');\n this.buf.push(tagName);\n this.buf.push('>');\n }\n }\n\n private chars(chars: string) { this.buf.push(encodeEntities(chars)); }\n\n checkClobberedElement(node: Node, nextNode: Node): Node {\n if (nextNode &&\n (node.compareDocumentPosition(nextNode) &\n Node.DOCUMENT_POSITION_CONTAINED_BY) === Node.DOCUMENT_POSITION_CONTAINED_BY) {\n throw new Error(\n `Failed to sanitize html because the element is clobbered: ${(node as Element).outerHTML}`);\n }\n return nextNode;\n }\n}\n\n// Regular Expressions for parsing tags and attributes\nconst SURROGATE_PAIR_REGEXP = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g;\n// ! to ~ is the ASCII range.\nconst NON_ALPHANUMERIC_REGEXP = /([^\\#-~ |!])/g;\n\n/**\n * Escapes all potentially dangerous characters, so that the\n * resulting string can be safely inserted into attribute or\n * element text.\n * @param value\n */\nfunction encodeEntities(value: string) {\n return value.replace(/&/g, '&amp;')\n .replace(\n SURROGATE_PAIR_REGEXP,\n function(match: string) {\n const hi = match.charCodeAt(0);\n const low = match.charCodeAt(1);\n return '&#' + (((hi - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000) + ';';\n })\n .replace(\n NON_ALPHANUMERIC_REGEXP,\n function(match: string) { return '&#' + match.charCodeAt(0) + ';'; })\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;');\n}\n\nlet inertBodyHelper: InertBodyHelper;\n\n/**\n * Sanitizes the given unsafe, untrusted HTML fragment, and returns HTML text that is safe to add to\n * the DOM in a browser environment.\n */\nexport function _sanitizeHtml(defaultDoc: any, unsafeHtmlInput: string): string {\n let inertBodyElement: HTMLElement|null = null;\n try {\n inertBodyHelper = inertBodyHelper || new InertBodyHelper(defaultDoc);\n // Make sure unsafeHtml is actually a string (TypeScript types are not enforced at runtime).\n let unsafeHtml = unsafeHtmlInput ? String(unsafeHtmlInput) : '';\n inertBodyElement = inertBodyHelper.getInertBodyElement(unsafeHtml);\n\n // mXSS protection. Repeatedly parse the document to make sure it stabilizes, so that a browser\n // trying to auto-correct incorrect HTML cannot cause formerly inert HTML to become dangerous.\n let mXSSAttempts = 5;\n let parsedHtml = unsafeHtml;\n\n do {\n if (mXSSAttempts === 0) {\n throw new Error('Failed to sanitize html because the input is unstable');\n }\n mXSSAttempts--;\n\n unsafeHtml = parsedHtml;\n parsedHtml = inertBodyElement !.innerHTML;\n inertBodyElement = inertBodyHelper.getInertBodyElement(unsafeHtml);\n } while (unsafeHtml !== parsedHtml);\n\n const sanitizer = new SanitizingHtmlSerializer();\n const safeHtml = sanitizer.sanitizeChildren(\n getTemplateContent(inertBodyElement !) as Element || inertBodyElement);\n if (isDevMode() && sanitizer.sanitizedSomething) {\n console.warn(\n 'WARNING: sanitizing HTML stripped some content (see http://g.co/ng/security#xss).');\n }\n\n return safeHtml;\n } finally {\n // In case anything goes wrong, clear out inertElement to reset the entire DOM structure.\n if (inertBodyElement) {\n const parent = getTemplateContent(inertBodyElement) || inertBodyElement;\n while (parent.firstChild) {\n parent.removeChild(parent.firstChild);\n }\n }\n }\n}\n\nfunction getTemplateContent(el: Node): Node|null {\n return 'content' in (el as any /** Microsoft/TypeScript#21517 */) && isTemplateElement(el) ?\n el.content :\n null;\n}\nfunction isTemplateElement(el: Node): el is HTMLTemplateElement {\n return el.nodeType === Node.ELEMENT_NODE && el.nodeName === 'TEMPLATE';\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {isDevMode} from '../application_ref';\nimport {_sanitizeUrl} from './url_sanitizer';\n\n\n/**\n * Regular expression for safe style values.\n *\n * Quotes (\" and ') are allowed, but a check must be done elsewhere to ensure they're balanced.\n *\n * ',' allows multiple values to be assigned to the same property (e.g. background-attachment or\n * font-family) and hence could allow multiple values to get injected, but that should pose no risk\n * of XSS.\n *\n * The function expression checks only for XSS safety, not for CSS validity.\n *\n * This regular expression was taken from the Closure sanitization library, and augmented for\n * transformation values.\n */\nconst VALUES = '[-,.\"\\'%_!# a-zA-Z0-9]+';\nconst TRANSFORMATION_FNS = '(?:matrix|translate|scale|rotate|skew|perspective)(?:X|Y|3d)?';\nconst COLOR_FNS = '(?:rgb|hsl)a?';\nconst GRADIENTS = '(?:repeating-)?(?:linear|radial)-gradient';\nconst CSS3_FNS = '(?:calc|attr)';\nconst FN_ARGS = '\\\\([-0-9.%, #a-zA-Z]+\\\\)';\nconst SAFE_STYLE_VALUE = new RegExp(\n `^(${VALUES}|` +\n `(?:${TRANSFORMATION_FNS}|${COLOR_FNS}|${GRADIENTS}|${CSS3_FNS})` +\n `${FN_ARGS})$`,\n 'g');\n\n/**\n * Matches a `url(...)` value with an arbitrary argument as long as it does\n * not contain parentheses.\n *\n * The URL value still needs to be sanitized separately.\n *\n * `url(...)` values are a very common use case, e.g. for `background-image`. With carefully crafted\n * CSS style rules, it is possible to construct an information leak with `url` values in CSS, e.g.\n * by observing whether scroll bars are displayed, or character ranges used by a font face\n * definition.\n *\n * Angular only allows binding CSS values (as opposed to entire CSS rules), so it is unlikely that\n * binding a URL value without further cooperation from the page will cause an information leak, and\n * if so, it is just a leak, not a full blown XSS vulnerability.\n *\n * Given the common use case, low likelihood of attack vector, and low impact of an attack, this\n * code is permissive and allows URLs that sanitize otherwise.\n */\nconst URL_RE = /^url\\(([^)]+)\\)$/;\n\n/**\n * Checks that quotes (\" and ') are properly balanced inside a string. Assumes\n * that neither escape (\\) nor any other character that could result in\n * breaking out of a string parsing context are allowed;\n * see http://www.w3.org/TR/css3-syntax/#string-token-diagram.\n *\n * This code was taken from the Closure sanitization library.\n */\nfunction hasBalancedQuotes(value: string) {\n let outsideSingle = true;\n let outsideDouble = true;\n for (let i = 0; i < value.length; i++) {\n const c = value.charAt(i);\n if (c === '\\'' && outsideDouble) {\n outsideSingle = !outsideSingle;\n } else if (c === '\"' && outsideSingle) {\n outsideDouble = !outsideDouble;\n }\n }\n return outsideSingle && outsideDouble;\n}\n\n/**\n * Sanitizes the given untrusted CSS style property value (i.e. not an entire object, just a single\n * value) and returns a value that is safe to use in a browser environment.\n */\nexport function _sanitizeStyle(value: string): string {\n value = String(value).trim(); // Make sure it's actually a string.\n if (!value) return '';\n\n // Single url(...) values are supported, but only for URLs that sanitize cleanly. See above for\n // reasoning behind this.\n const urlMatch = value.match(URL_RE);\n if ((urlMatch && _sanitizeUrl(urlMatch[1]) === urlMatch[1]) ||\n value.match(SAFE_STYLE_VALUE) && hasBalancedQuotes(value)) {\n return value; // Safe style values.\n }\n\n if (isDevMode()) {\n console.warn(\n `WARNING: sanitizing unsafe style value ${value} (see http://g.co/ng/security#xss).`);\n }\n\n return 'unsafe';\n}\n\n\n/**\n * Used to intercept and sanitize style values before they are written to the renderer.\n *\n * This function is designed to be called in two modes. When a value is not provided\n * then the function will return a boolean whether a property will be sanitized later.\n * If a value is provided then the sanitized version of that will be returned.\n */\nexport interface StyleSanitizeFn {\n /** This mode is designed to instruct whether the property will be used for sanitization\n * at a later point */\n (prop: string): boolean;\n /** This mode is designed to sanitize the provided value */\n (prop: string, value: string): string;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * A SecurityContext marks a location that has dangerous security implications, e.g. a DOM property\n * like `innerHTML` that could cause Cross Site Scripting (XSS) security bugs when improperly\n * handled.\n *\n * See DomSanitizer for more details on security in Angular applications.\n *\n *\n */\nexport enum SecurityContext {\n NONE = 0,\n HTML = 1,\n STYLE = 2,\n SCRIPT = 3,\n URL = 4,\n RESOURCE_URL = 5,\n}\n\n/**\n * Sanitizer is used by the views to sanitize potentially dangerous values.\n *\n *\n */\nexport abstract class Sanitizer {\n abstract sanitize(context: SecurityContext, value: {}|string|null): string|null;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Injector} from '../di';\nimport {ErrorHandler} from '../error_handler';\nimport {ComponentFactory} from '../linker/component_factory';\nimport {NgModuleRef} from '../linker/ng_module_factory';\nimport {QueryList} from '../linker/query_list';\nimport {TemplateRef} from '../linker/template_ref';\nimport {ViewContainerRef} from '../linker/view_container_ref';\nimport {Renderer2, RendererFactory2, RendererType2} from '../render/api';\nimport {Sanitizer, SecurityContext} from '../sanitization/security';\nimport {Type} from '../type';\n\n\n// -------------------------------------\n// Defs\n// -------------------------------------\n\n/**\n * Factory for ViewDefinitions/NgModuleDefinitions.\n * We use a function so we can reexeute it in case an error happens and use the given logger\n * function to log the error from the definition of the node, which is shown in all browser\n * logs.\n */\nexport interface DefinitionFactory<D extends Definition<any>> { (logger: NodeLogger): D; }\n\n/**\n * Function to call console.error at the right source location. This is an indirection\n * via another function as browser will log the location that actually called\n * `console.error`.\n */\nexport interface NodeLogger { (): () => void; }\n\nexport interface Definition<DF extends DefinitionFactory<any>> { factory: DF|null; }\n\nexport interface NgModuleDefinition extends Definition<NgModuleDefinitionFactory> {\n providers: NgModuleProviderDef[];\n providersByKey: {[tokenKey: string]: NgModuleProviderDef};\n modules: any[];\n isRoot: boolean;\n}\n\nexport interface NgModuleDefinitionFactory extends DefinitionFactory<NgModuleDefinition> {}\n\nexport interface ViewDefinition extends Definition<ViewDefinitionFactory> {\n flags: ViewFlags;\n updateDirectives: ViewUpdateFn;\n updateRenderer: ViewUpdateFn;\n handleEvent: ViewHandleEventFn;\n /**\n * Order: Depth first.\n * Especially providers are before elements / anchors.\n */\n nodes: NodeDef[];\n /** aggregated NodeFlags for all nodes **/\n nodeFlags: NodeFlags;\n rootNodeFlags: NodeFlags;\n lastRenderRootNode: NodeDef|null;\n bindingCount: number;\n outputCount: number;\n /**\n * Binary or of all query ids that are matched by one of the nodes.\n * This includes query ids from templates as well.\n * Used as a bloom filter.\n */\n nodeMatchedQueries: number;\n}\n\nexport interface ViewDefinitionFactory extends DefinitionFactory<ViewDefinition> {}\n\n\nexport interface ViewUpdateFn { (check: NodeCheckFn, view: ViewData): void; }\n\n// helper functions to create an overloaded function type.\nexport interface NodeCheckFn {\n (view: ViewData, nodeIndex: number, argStyle: ArgumentType.Dynamic, values: any[]): any;\n\n (view: ViewData, nodeIndex: number, argStyle: ArgumentType.Inline, v0?: any, v1?: any, v2?: any,\n v3?: any, v4?: any, v5?: any, v6?: any, v7?: any, v8?: any, v9?: any): any;\n}\n\nexport const enum ArgumentType {Inline = 0, Dynamic = 1}\n\nexport interface ViewHandleEventFn {\n (view: ViewData, nodeIndex: number, eventName: string, event: any): boolean;\n}\n\n/**\n * Bitmask for ViewDefinition.flags.\n */\nexport const enum ViewFlags {\n None = 0,\n OnPush = 1 << 1,\n}\n\n/**\n * A node definition in the view.\n *\n * Note: We use one type for all nodes so that loops that loop over all nodes\n * of a ViewDefinition stay monomorphic!\n */\nexport interface NodeDef {\n flags: NodeFlags;\n // Index of the node in view data and view definition (those are the same)\n nodeIndex: number;\n // Index of the node in the check functions\n // Differ from nodeIndex when nodes are added or removed at runtime (ie after compilation)\n checkIndex: number;\n parent: NodeDef|null;\n renderParent: NodeDef|null;\n /** this is checked against NgContentDef.index to find matched nodes */\n ngContentIndex: number|null;\n /** number of transitive children */\n childCount: number;\n /** aggregated NodeFlags for all transitive children (does not include self) **/\n childFlags: NodeFlags;\n /** aggregated NodeFlags for all direct children (does not include self) **/\n directChildFlags: NodeFlags;\n\n bindingIndex: number;\n bindings: BindingDef[];\n bindingFlags: BindingFlags;\n outputIndex: number;\n outputs: OutputDef[];\n /**\n * references that the user placed on the element\n */\n references: {[refId: string]: QueryValueType};\n /**\n * ids and value types of all queries that are matched by this node.\n */\n matchedQueries: {[queryId: number]: QueryValueType};\n /** Binary or of all matched query ids of this node. */\n matchedQueryIds: number;\n /**\n * Binary or of all query ids that are matched by one of the children.\n * This includes query ids from templates as well.\n * Used as a bloom filter.\n */\n childMatchedQueries: number;\n element: ElementDef|null;\n provider: ProviderDef|null;\n text: TextDef|null;\n query: QueryDef|null;\n ngContent: NgContentDef|null;\n}\n\n/**\n * Bitmask for NodeDef.flags.\n * Naming convention:\n * - `Type...`: flags that are mutually exclusive\n * - `Cat...`: union of multiple `Type...` (short for category).\n */\nexport const enum NodeFlags {\n None = 0,\n TypeElement = 1 << 0,\n TypeText = 1 << 1,\n ProjectedTemplate = 1 << 2,\n CatRenderNode = TypeElement | TypeText,\n TypeNgContent = 1 << 3,\n TypePipe = 1 << 4,\n TypePureArray = 1 << 5,\n TypePureObject = 1 << 6,\n TypePurePipe = 1 << 7,\n CatPureExpression = TypePureArray | TypePureObject | TypePurePipe,\n TypeValueProvider = 1 << 8,\n TypeClassProvider = 1 << 9,\n TypeFactoryProvider = 1 << 10,\n TypeUseExistingProvider = 1 << 11,\n LazyProvider = 1 << 12,\n PrivateProvider = 1 << 13,\n TypeDirective = 1 << 14,\n Component = 1 << 15,\n CatProviderNoDirective =\n TypeValueProvider | TypeClassProvider | TypeFactoryProvider | TypeUseExistingProvider,\n CatProvider = CatProviderNoDirective | TypeDirective,\n OnInit = 1 << 16,\n OnDestroy = 1 << 17,\n DoCheck = 1 << 18,\n OnChanges = 1 << 19,\n AfterContentInit = 1 << 20,\n AfterContentChecked = 1 << 21,\n AfterViewInit = 1 << 22,\n AfterViewChecked = 1 << 23,\n EmbeddedViews = 1 << 24,\n ComponentView = 1 << 25,\n TypeContentQuery = 1 << 26,\n TypeViewQuery = 1 << 27,\n StaticQuery = 1 << 28,\n DynamicQuery = 1 << 29,\n TypeNgModule = 1 << 30,\n CatQuery = TypeContentQuery | TypeViewQuery,\n\n // mutually exclusive values...\n Types = CatRenderNode | TypeNgContent | TypePipe | CatPureExpression | CatProvider | CatQuery\n}\n\nexport interface BindingDef {\n flags: BindingFlags;\n ns: string|null;\n name: string|null;\n nonMinifiedName: string|null;\n securityContext: SecurityContext|null;\n suffix: string|null;\n}\n\nexport const enum BindingFlags {\n TypeElementAttribute = 1 << 0,\n TypeElementClass = 1 << 1,\n TypeElementStyle = 1 << 2,\n TypeProperty = 1 << 3,\n SyntheticProperty = 1 << 4,\n SyntheticHostProperty = 1 << 5,\n CatSyntheticProperty = SyntheticProperty | SyntheticHostProperty,\n\n // mutually exclusive values...\n Types = TypeElementAttribute | TypeElementClass | TypeElementStyle | TypeProperty\n}\n\nexport interface OutputDef {\n type: OutputType;\n target: 'window'|'document'|'body'|'component'|null;\n eventName: string;\n propName: string|null;\n}\n\nexport const enum OutputType {ElementOutput, DirectiveOutput}\n\nexport const enum QueryValueType {\n ElementRef = 0,\n RenderElement = 1,\n TemplateRef = 2,\n ViewContainerRef = 3,\n Provider = 4\n}\n\nexport interface ElementDef {\n // set to null for `<ng-container>`\n name: string|null;\n ns: string|null;\n /** ns, name, value */\n attrs: [string, string, string][]|null;\n template: ViewDefinition|null;\n componentProvider: NodeDef|null;\n componentRendererType: RendererType2|null;\n // closure to allow recursive components\n componentView: ViewDefinitionFactory|null;\n /**\n * visible public providers for DI in the view,\n * as see from this element. This does not include private providers.\n */\n publicProviders: {[tokenKey: string]: NodeDef}|null;\n /**\n * same as visiblePublicProviders, but also includes private providers\n * that are located on this element.\n */\n allProviders: {[tokenKey: string]: NodeDef}|null;\n handleEvent: ElementHandleEventFn|null;\n}\n\nexport interface ElementHandleEventFn { (view: ViewData, eventName: string, event: any): boolean; }\n\nexport interface ProviderDef {\n token: any;\n value: any;\n deps: DepDef[];\n}\n\nexport interface NgModuleProviderDef {\n flags: NodeFlags;\n index: number;\n token: any;\n value: any;\n deps: DepDef[];\n}\n\nexport interface DepDef {\n flags: DepFlags;\n token: any;\n tokenKey: string;\n}\n\n/**\n * Bitmask for DI flags\n */\nexport const enum DepFlags {\n None = 0,\n SkipSelf = 1 << 0,\n Optional = 1 << 1,\n Self = 1 << 2,\n Value = 1 << 3,\n}\n\nexport interface TextDef { prefix: string; }\n\nexport interface QueryDef {\n id: number;\n // variant of the id that can be used to check against NodeDef.matchedQueryIds, ...\n filterId: number;\n bindings: QueryBindingDef[];\n}\n\nexport interface QueryBindingDef {\n propName: string;\n bindingType: QueryBindingType;\n}\n\nexport const enum QueryBindingType {First = 0, All = 1}\n\nexport interface NgContentDef {\n /**\n * this index is checked against NodeDef.ngContentIndex to find the nodes\n * that are matched by this ng-content.\n * Note that a NodeDef with an ng-content can be reprojected, i.e.\n * have a ngContentIndex on its own.\n */\n index: number;\n}\n\n// -------------------------------------\n// Data\n// -------------------------------------\n\nexport interface NgModuleData extends Injector, NgModuleRef<any> {\n // Note: we are using the prefix _ as NgModuleData is an NgModuleRef and therefore directly\n // exposed to the user.\n _def: NgModuleDefinition;\n _parent: Injector;\n _providers: any[];\n}\n\n/**\n * View instance data.\n * Attention: Adding fields to this is performance sensitive!\n */\nexport interface ViewData {\n def: ViewDefinition;\n root: RootData;\n renderer: Renderer2;\n // index of component provider / anchor.\n parentNodeDef: NodeDef|null;\n parent: ViewData|null;\n viewContainerParent: ViewData|null;\n component: any;\n context: any;\n // Attention: Never loop over this, as this will\n // create a polymorphic usage site.\n // Instead: Always loop over ViewDefinition.nodes,\n // and call the right accessor (e.g. `elementData`) based on\n // the NodeType.\n nodes: {[key: number]: NodeData};\n state: ViewState;\n oldValues: any[];\n disposables: DisposableFn[]|null;\n initIndex: number;\n}\n\n/**\n * Bitmask of states\n */\nexport const enum ViewState {\n BeforeFirstCheck = 1 << 0,\n FirstCheck = 1 << 1,\n Attached = 1 << 2,\n ChecksEnabled = 1 << 3,\n IsProjectedView = 1 << 4,\n CheckProjectedView = 1 << 5,\n CheckProjectedViews = 1 << 6,\n Destroyed = 1 << 7,\n\n // InitState Uses 3 bits\n InitState_Mask = 7 << 8,\n InitState_BeforeInit = 0 << 8,\n InitState_CallingOnInit = 1 << 8,\n InitState_CallingAfterContentInit = 2 << 8,\n InitState_CallingAfterViewInit = 3 << 8,\n InitState_AfterInit = 4 << 8,\n\n CatDetectChanges = Attached | ChecksEnabled,\n CatInit = BeforeFirstCheck | CatDetectChanges | InitState_BeforeInit\n}\n\n// Called before each cycle of a view's check to detect whether this is in the\n// initState for which we need to call ngOnInit, ngAfterContentInit or ngAfterViewInit\n// lifecycle methods. Returns true if this check cycle should call lifecycle\n// methods.\nexport function shiftInitState(\n view: ViewData, priorInitState: ViewState, newInitState: ViewState): boolean {\n // Only update the InitState if we are currently in the prior state.\n // For example, only move into CallingInit if we are in BeforeInit. Only\n // move into CallingContentInit if we are in CallingInit. Normally this will\n // always be true because of how checkCycle is called in checkAndUpdateView.\n // However, if checkAndUpdateView is called recursively or if an exception is\n // thrown while checkAndUpdateView is running, checkAndUpdateView starts over\n // from the beginning. This ensures the state is monotonically increasing,\n // terminating in the AfterInit state, which ensures the Init methods are called\n // at least once and only once.\n const state = view.state;\n const initState = state & ViewState.InitState_Mask;\n if (initState === priorInitState) {\n view.state = (state & ~ViewState.InitState_Mask) | newInitState;\n view.initIndex = -1;\n return true;\n }\n return initState === newInitState;\n}\n\n// Returns true if the lifecycle init method should be called for the node with\n// the given init index.\nexport function shouldCallLifecycleInitHook(\n view: ViewData, initState: ViewState, index: number): boolean {\n if ((view.state & ViewState.InitState_Mask) === initState && view.initIndex <= index) {\n view.initIndex = index + 1;\n return true;\n }\n return false;\n}\n\nexport interface DisposableFn { (): void; }\n\n/**\n * Node instance data.\n *\n * We have a separate type per NodeType to save memory\n * (TextData | ElementData | ProviderData | PureExpressionData | QueryList<any>)\n *\n * To keep our code monomorphic,\n * we prohibit using `NodeData` directly but enforce the use of accessors (`asElementData`, ...).\n * This way, no usage site can get a `NodeData` from view.nodes and then use it for different\n * purposes.\n */\nexport class NodeData { private __brand: any; }\n\n/**\n * Data for an instantiated NodeType.Text.\n *\n * Attention: Adding fields to this is performance sensitive!\n */\nexport interface TextData { renderText: any; }\n\n/**\n * Accessor for view.nodes, enforcing that every usage site stays monomorphic.\n */\nexport function asTextData(view: ViewData, index: number): TextData {\n return <any>view.nodes[index];\n}\n\n/**\n * Data for an instantiated NodeType.Element.\n *\n * Attention: Adding fields to this is performance sensitive!\n */\nexport interface ElementData {\n renderElement: any;\n componentView: ViewData;\n viewContainer: ViewContainerData|null;\n template: TemplateData;\n}\n\nexport interface ViewContainerData extends ViewContainerRef {\n // Note: we are using the prefix _ as ViewContainerData is a ViewContainerRef and therefore\n // directly\n // exposed to the user.\n _embeddedViews: ViewData[];\n}\n\nexport interface TemplateData extends TemplateRef<any> {\n // views that have been created from the template\n // of this element,\n // but inserted into the embeddedViews of another element.\n // By default, this is undefined.\n // Note: we are using the prefix _ as TemplateData is a TemplateRef and therefore directly\n // exposed to the user.\n _projectedViews: ViewData[];\n}\n\n/**\n * Accessor for view.nodes, enforcing that every usage site stays monomorphic.\n */\nexport function asElementData(view: ViewData, index: number): ElementData {\n return <any>view.nodes[index];\n}\n\n/**\n * Data for an instantiated NodeType.Provider.\n *\n * Attention: Adding fields to this is performance sensitive!\n */\nexport interface ProviderData { instance: any; }\n\n/**\n * Accessor for view.nodes, enforcing that every usage site stays monomorphic.\n */\nexport function asProviderData(view: ViewData, index: number): ProviderData {\n return <any>view.nodes[index];\n}\n\n/**\n * Data for an instantiated NodeType.PureExpression.\n *\n * Attention: Adding fields to this is performance sensitive!\n */\nexport interface PureExpressionData { value: any; }\n\n/**\n * Accessor for view.nodes, enforcing that every usage site stays monomorphic.\n */\nexport function asPureExpressionData(view: ViewData, index: number): PureExpressionData {\n return <any>view.nodes[index];\n}\n\n/**\n * Accessor for view.nodes, enforcing that every usage site stays monomorphic.\n */\nexport function asQueryList(view: ViewData, index: number): QueryList<any> {\n return <any>view.nodes[index];\n}\n\nexport interface RootData {\n injector: Injector;\n ngModule: NgModuleRef<any>;\n projectableNodes: any[][];\n selectorOrNode: any;\n renderer: Renderer2;\n rendererFactory: RendererFactory2;\n errorHandler: ErrorHandler;\n sanitizer: Sanitizer;\n}\n\nexport abstract class DebugContext {\n abstract get view(): ViewData;\n abstract get nodeIndex(): number|null;\n abstract get injector(): Injector;\n abstract get component(): any;\n abstract get providerTokens(): any[];\n abstract get references(): {[key: string]: any};\n abstract get context(): any;\n abstract get componentRenderElement(): any;\n abstract get renderNode(): any;\n abstract logError(console: Console, ...values: any[]): void;\n}\n\n// -------------------------------------\n// Other\n// -------------------------------------\n\nexport const enum CheckType {CheckAndUpdate, CheckNoChanges}\n\nexport interface ProviderOverride {\n token: any;\n flags: NodeFlags;\n value: any;\n deps: ([DepFlags, any]|any)[];\n deprecatedBehavior: boolean;\n}\n\nexport interface Services {\n setCurrentNode(view: ViewData, nodeIndex: number): void;\n createRootView(\n injector: Injector, projectableNodes: any[][], rootSelectorOrNode: string|any,\n def: ViewDefinition, ngModule: NgModuleRef<any>, context?: any): ViewData;\n createEmbeddedView(parent: ViewData, anchorDef: NodeDef, viewDef: ViewDefinition, context?: any):\n ViewData;\n createComponentView(\n parentView: ViewData, nodeDef: NodeDef, viewDef: ViewDefinition, hostElement: any): ViewData;\n createNgModuleRef(\n moduleType: Type<any>, parent: Injector, bootstrapComponents: Type<any>[],\n def: NgModuleDefinition): NgModuleRef<any>;\n overrideProvider(override: ProviderOverride): void;\n overrideComponentView(compType: Type<any>, compFactory: ComponentFactory<any>): void;\n clearOverrides(): void;\n checkAndUpdateView(view: ViewData): void;\n checkNoChangesView(view: ViewData): void;\n destroyView(view: ViewData): void;\n resolveDep(\n view: ViewData, elDef: NodeDef|null, allowPrivateServices: boolean, depDef: DepDef,\n notFoundValue?: any): any;\n createDebugContext(view: ViewData, nodeIndex: number): DebugContext;\n handleEvent: ViewHandleEventFn;\n updateDirectives: (view: ViewData, checkType: CheckType) => void;\n updateRenderer: (view: ViewData, checkType: CheckType) => void;\n dirtyParentQueries: (view: ViewData) => void;\n}\n\n/**\n * This object is used to prevent cycles in the source files and to have a place where\n * debug mode can hook it. It is lazily filled when `isDevMode` is known.\n */\nexport const Services: Services = {\n setCurrentNode: undefined !,\n createRootView: undefined !,\n createEmbeddedView: undefined !,\n createComponentView: undefined !,\n createNgModuleRef: undefined !,\n overrideProvider: undefined !,\n overrideComponentView: undefined !,\n clearOverrides: undefined !,\n checkAndUpdateView: undefined !,\n checkNoChangesView: undefined !,\n destroyView: undefined !,\n resolveDep: undefined !,\n createDebugContext: undefined !,\n handleEvent: undefined !,\n updateDirectives: undefined !,\n updateRenderer: undefined !,\n dirtyParentQueries: undefined !,\n};\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ERROR_DEBUG_CONTEXT, ERROR_LOGGER, getDebugContext} from '../errors';\nimport {DebugContext, ViewState} from './types';\n\nexport function expressionChangedAfterItHasBeenCheckedError(\n context: DebugContext, oldValue: any, currValue: any, isFirstCheck: boolean): Error {\n let msg =\n `ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: '${oldValue}'. Current value: '${currValue}'.`;\n if (isFirstCheck) {\n msg +=\n ` It seems like the view has been created after its parent and its children have been dirty checked.` +\n ` Has it been created in a change detection hook ?`;\n }\n return viewDebugError(msg, context);\n}\n\nexport function viewWrappedDebugError(err: any, context: DebugContext): Error {\n if (!(err instanceof Error)) {\n // errors that are not Error instances don't have a stack,\n // so it is ok to wrap them into a new Error object...\n err = new Error(err.toString());\n }\n _addDebugContext(err, context);\n return err;\n}\n\nexport function viewDebugError(msg: string, context: DebugContext): Error {\n const err = new Error(msg);\n _addDebugContext(err, context);\n return err;\n}\n\nfunction _addDebugContext(err: Error, context: DebugContext) {\n (err as any)[ERROR_DEBUG_CONTEXT] = context;\n (err as any)[ERROR_LOGGER] = context.logError.bind(context);\n}\n\nexport function isViewDebugError(err: Error): boolean {\n return !!getDebugContext(err);\n}\n\nexport function viewDestroyedError(action: string): Error {\n return new Error(`ViewDestroyedError: Attempt to use a destroyed view: ${action}`);\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {WrappedValue, devModeEqual} from '../change_detection/change_detection';\nimport {SOURCE} from '../di/injector';\nimport {ViewEncapsulation} from '../metadata/view';\nimport {RendererType2} from '../render/api';\nimport {looseIdentical, stringify} from '../util';\nimport {expressionChangedAfterItHasBeenCheckedError} from './errors';\nimport {BindingDef, BindingFlags, Definition, DefinitionFactory, DepDef, DepFlags, ElementData, NodeDef, NodeFlags, QueryValueType, Services, ViewData, ViewDefinition, ViewDefinitionFactory, ViewFlags, ViewState, asElementData, asTextData} from './types';\n\nexport const NOOP: any = () => {};\n\nconst _tokenKeyCache = new Map<any, string>();\n\nexport function tokenKey(token: any): string {\n let key = _tokenKeyCache.get(token);\n if (!key) {\n key = stringify(token) + '_' + _tokenKeyCache.size;\n _tokenKeyCache.set(token, key);\n }\n return key;\n}\n\nexport function unwrapValue(view: ViewData, nodeIdx: number, bindingIdx: number, value: any): any {\n if (WrappedValue.isWrapped(value)) {\n value = WrappedValue.unwrap(value);\n const globalBindingIdx = view.def.nodes[nodeIdx].bindingIndex + bindingIdx;\n const oldValue = WrappedValue.unwrap(view.oldValues[globalBindingIdx]);\n view.oldValues[globalBindingIdx] = new WrappedValue(oldValue);\n }\n return value;\n}\n\nconst UNDEFINED_RENDERER_TYPE_ID = '$$undefined';\nconst EMPTY_RENDERER_TYPE_ID = '$$empty';\n\n// Attention: this function is called as top level function.\n// Putting any logic in here will destroy closure tree shaking!\nexport function createRendererType2(values: {\n styles: (string | any[])[],\n encapsulation: ViewEncapsulation,\n data: {[kind: string]: any[]}\n}): RendererType2 {\n return {\n id: UNDEFINED_RENDERER_TYPE_ID,\n styles: values.styles,\n encapsulation: values.encapsulation,\n data: values.data\n };\n}\n\nlet _renderCompCount = 0;\n\nexport function resolveRendererType2(type?: RendererType2 | null): RendererType2|null {\n if (type && type.id === UNDEFINED_RENDERER_TYPE_ID) {\n // first time we see this RendererType2. Initialize it...\n const isFilled =\n ((type.encapsulation != null && type.encapsulation !== ViewEncapsulation.None) ||\n type.styles.length || Object.keys(type.data).length);\n if (isFilled) {\n type.id = `c${_renderCompCount++}`;\n } else {\n type.id = EMPTY_RENDERER_TYPE_ID;\n }\n }\n if (type && type.id === EMPTY_RENDERER_TYPE_ID) {\n type = null;\n }\n return type || null;\n}\n\nexport function checkBinding(\n view: ViewData, def: NodeDef, bindingIdx: number, value: any): boolean {\n const oldValues = view.oldValues;\n if ((view.state & ViewState.FirstCheck) ||\n !looseIdentical(oldValues[def.bindingIndex + bindingIdx], value)) {\n return true;\n }\n return false;\n}\n\nexport function checkAndUpdateBinding(\n view: ViewData, def: NodeDef, bindingIdx: number, value: any): boolean {\n if (checkBinding(view, def, bindingIdx, value)) {\n view.oldValues[def.bindingIndex + bindingIdx] = value;\n return true;\n }\n return false;\n}\n\nexport function checkBindingNoChanges(\n view: ViewData, def: NodeDef, bindingIdx: number, value: any) {\n const oldValue = view.oldValues[def.bindingIndex + bindingIdx];\n if ((view.state & ViewState.BeforeFirstCheck) || !devModeEqual(oldValue, value)) {\n const bindingName = def.bindings[bindingIdx].name;\n throw expressionChangedAfterItHasBeenCheckedError(\n Services.createDebugContext(view, def.nodeIndex), `${bindingName}: ${oldValue}`,\n `${bindingName}: ${value}`, (view.state & ViewState.BeforeFirstCheck) !== 0);\n }\n}\n\nexport function markParentViewsForCheck(view: ViewData) {\n let currView: ViewData|null = view;\n while (currView) {\n if (currView.def.flags & ViewFlags.OnPush) {\n currView.state |= ViewState.ChecksEnabled;\n }\n currView = currView.viewContainerParent || currView.parent;\n }\n}\n\nexport function markParentViewsForCheckProjectedViews(view: ViewData, endView: ViewData) {\n let currView: ViewData|null = view;\n while (currView && currView !== endView) {\n currView.state |= ViewState.CheckProjectedViews;\n currView = currView.viewContainerParent || currView.parent;\n }\n}\n\nexport function dispatchEvent(\n view: ViewData, nodeIndex: number, eventName: string, event: any): boolean|undefined {\n try {\n const nodeDef = view.def.nodes[nodeIndex];\n const startView = nodeDef.flags & NodeFlags.ComponentView ?\n asElementData(view, nodeIndex).componentView :\n view;\n markParentViewsForCheck(startView);\n return Services.handleEvent(view, nodeIndex, eventName, event);\n } catch (e) {\n // Attention: Don't rethrow, as it would cancel Observable subscriptions!\n view.root.errorHandler.handleError(e);\n }\n}\n\nexport function declaredViewContainer(view: ViewData): ElementData|null {\n if (view.parent) {\n const parentView = view.parent;\n return asElementData(parentView, view.parentNodeDef !.nodeIndex);\n }\n return null;\n}\n\n/**\n * for component views, this is the host element.\n * for embedded views, this is the index of the parent node\n * that contains the view container.\n */\nexport function viewParentEl(view: ViewData): NodeDef|null {\n const parentView = view.parent;\n if (parentView) {\n return view.parentNodeDef !.parent;\n } else {\n return null;\n }\n}\n\nexport function renderNode(view: ViewData, def: NodeDef): any {\n switch (def.flags & NodeFlags.Types) {\n case NodeFlags.TypeElement:\n return asElementData(view, def.nodeIndex).renderElement;\n case NodeFlags.TypeText:\n return asTextData(view, def.nodeIndex).renderText;\n }\n}\n\nexport function elementEventFullName(target: string | null, name: string): string {\n return target ? `${target}:${name}` : name;\n}\n\nexport function isComponentView(view: ViewData): boolean {\n return !!view.parent && !!(view.parentNodeDef !.flags & NodeFlags.Component);\n}\n\nexport function isEmbeddedView(view: ViewData): boolean {\n return !!view.parent && !(view.parentNodeDef !.flags & NodeFlags.Component);\n}\n\nexport function filterQueryId(queryId: number): number {\n return 1 << (queryId % 32);\n}\n\nexport function splitMatchedQueriesDsl(\n matchedQueriesDsl: [string | number, QueryValueType][] | null): {\n matchedQueries: {[queryId: string]: QueryValueType},\n references: {[refId: string]: QueryValueType},\n matchedQueryIds: number\n} {\n const matchedQueries: {[queryId: string]: QueryValueType} = {};\n let matchedQueryIds = 0;\n const references: {[refId: string]: QueryValueType} = {};\n if (matchedQueriesDsl) {\n matchedQueriesDsl.forEach(([queryId, valueType]) => {\n if (typeof queryId === 'number') {\n matchedQueries[queryId] = valueType;\n matchedQueryIds |= filterQueryId(queryId);\n } else {\n references[queryId] = valueType;\n }\n });\n }\n return {matchedQueries, references, matchedQueryIds};\n}\n\nexport function splitDepsDsl(deps: ([DepFlags, any] | any)[], sourceName?: string): DepDef[] {\n return deps.map(value => {\n let token: any;\n let flags: DepFlags;\n if (Array.isArray(value)) {\n [flags, token] = value;\n } else {\n flags = DepFlags.None;\n token = value;\n }\n if (token && (typeof token === 'function' || typeof token === 'object') && sourceName) {\n Object.defineProperty(token, SOURCE, {value: sourceName, configurable: true});\n }\n return {flags, token, tokenKey: tokenKey(token)};\n });\n}\n\nexport function getParentRenderElement(view: ViewData, renderHost: any, def: NodeDef): any {\n let renderParent = def.renderParent;\n if (renderParent) {\n if ((renderParent.flags & NodeFlags.TypeElement) === 0 ||\n (renderParent.flags & NodeFlags.ComponentView) === 0 ||\n (renderParent.element !.componentRendererType &&\n renderParent.element !.componentRendererType !.encapsulation ===\n ViewEncapsulation.Native)) {\n // only children of non components, or children of components with native encapsulation should\n // be attached.\n return asElementData(view, def.renderParent !.nodeIndex).renderElement;\n }\n } else {\n return renderHost;\n }\n}\n\nconst DEFINITION_CACHE = new WeakMap<any, Definition<any>>();\n\nexport function resolveDefinition<D extends Definition<any>>(factory: DefinitionFactory<D>): D {\n let value = DEFINITION_CACHE.get(factory) !as D;\n if (!value) {\n value = factory(() => NOOP);\n value.factory = factory;\n DEFINITION_CACHE.set(factory, value);\n }\n return value;\n}\n\nexport function rootRenderNodes(view: ViewData): any[] {\n const renderNodes: any[] = [];\n visitRootRenderNodes(view, RenderNodeAction.Collect, undefined, undefined, renderNodes);\n return renderNodes;\n}\n\nexport const enum RenderNodeAction {Collect, AppendChild, InsertBefore, RemoveChild}\n\nexport function visitRootRenderNodes(\n view: ViewData, action: RenderNodeAction, parentNode: any, nextSibling: any, target?: any[]) {\n // We need to re-compute the parent node in case the nodes have been moved around manually\n if (action === RenderNodeAction.RemoveChild) {\n parentNode = view.renderer.parentNode(renderNode(view, view.def.lastRenderRootNode !));\n }\n visitSiblingRenderNodes(\n view, action, 0, view.def.nodes.length - 1, parentNode, nextSibling, target);\n}\n\nexport function visitSiblingRenderNodes(\n view: ViewData, action: RenderNodeAction, startIndex: number, endIndex: number, parentNode: any,\n nextSibling: any, target?: any[]) {\n for (let i = startIndex; i <= endIndex; i++) {\n const nodeDef = view.def.nodes[i];\n if (nodeDef.flags & (NodeFlags.TypeElement | NodeFlags.TypeText | NodeFlags.TypeNgContent)) {\n visitRenderNode(view, nodeDef, action, parentNode, nextSibling, target);\n }\n // jump to next sibling\n i += nodeDef.childCount;\n }\n}\n\nexport function visitProjectedRenderNodes(\n view: ViewData, ngContentIndex: number, action: RenderNodeAction, parentNode: any,\n nextSibling: any, target?: any[]) {\n let compView: ViewData|null = view;\n while (compView && !isComponentView(compView)) {\n compView = compView.parent;\n }\n const hostView = compView !.parent;\n const hostElDef = viewParentEl(compView !);\n const startIndex = hostElDef !.nodeIndex + 1;\n const endIndex = hostElDef !.nodeIndex + hostElDef !.childCount;\n for (let i = startIndex; i <= endIndex; i++) {\n const nodeDef = hostView !.def.nodes[i];\n if (nodeDef.ngContentIndex === ngContentIndex) {\n visitRenderNode(hostView !, nodeDef, action, parentNode, nextSibling, target);\n }\n // jump to next sibling\n i += nodeDef.childCount;\n }\n if (!hostView !.parent) {\n // a root view\n const projectedNodes = view.root.projectableNodes[ngContentIndex];\n if (projectedNodes) {\n for (let i = 0; i < projectedNodes.length; i++) {\n execRenderNodeAction(view, projectedNodes[i], action, parentNode, nextSibling, target);\n }\n }\n }\n}\n\nfunction visitRenderNode(\n view: ViewData, nodeDef: NodeDef, action: RenderNodeAction, parentNode: any, nextSibling: any,\n target?: any[]) {\n if (nodeDef.flags & NodeFlags.TypeNgContent) {\n visitProjectedRenderNodes(\n view, nodeDef.ngContent !.index, action, parentNode, nextSibling, target);\n } else {\n const rn = renderNode(view, nodeDef);\n if (action === RenderNodeAction.RemoveChild && (nodeDef.flags & NodeFlags.ComponentView) &&\n (nodeDef.bindingFlags & BindingFlags.CatSyntheticProperty)) {\n // Note: we might need to do both actions.\n if (nodeDef.bindingFlags & (BindingFlags.SyntheticProperty)) {\n execRenderNodeAction(view, rn, action, parentNode, nextSibling, target);\n }\n if (nodeDef.bindingFlags & (BindingFlags.SyntheticHostProperty)) {\n const compView = asElementData(view, nodeDef.nodeIndex).componentView;\n execRenderNodeAction(compView, rn, action, parentNode, nextSibling, target);\n }\n } else {\n execRenderNodeAction(view, rn, action, parentNode, nextSibling, target);\n }\n if (nodeDef.flags & NodeFlags.EmbeddedViews) {\n const embeddedViews = asElementData(view, nodeDef.nodeIndex).viewContainer !._embeddedViews;\n for (let k = 0; k < embeddedViews.length; k++) {\n visitRootRenderNodes(embeddedViews[k], action, parentNode, nextSibling, target);\n }\n }\n if (nodeDef.flags & NodeFlags.TypeElement && !nodeDef.element !.name) {\n visitSiblingRenderNodes(\n view, action, nodeDef.nodeIndex + 1, nodeDef.nodeIndex + nodeDef.childCount, parentNode,\n nextSibling, target);\n }\n }\n}\n\nfunction execRenderNodeAction(\n view: ViewData, renderNode: any, action: RenderNodeAction, parentNode: any, nextSibling: any,\n target?: any[]) {\n const renderer = view.renderer;\n switch (action) {\n case RenderNodeAction.AppendChild:\n renderer.appendChild(parentNode, renderNode);\n break;\n case RenderNodeAction.InsertBefore:\n renderer.insertBefore(parentNode, renderNode, nextSibling);\n break;\n case RenderNodeAction.RemoveChild:\n renderer.removeChild(parentNode, renderNode);\n break;\n case RenderNodeAction.Collect:\n target !.push(renderNode);\n break;\n }\n}\n\nconst NS_PREFIX_RE = /^:([^:]+):(.+)$/;\n\nexport function splitNamespace(name: string): string[] {\n if (name[0] === ':') {\n const match = name.match(NS_PREFIX_RE) !;\n return [match[1], match[2]];\n }\n return ['', name];\n}\n\nexport function calcBindingFlags(bindings: BindingDef[]): BindingFlags {\n let flags = 0;\n for (let i = 0; i < bindings.length; i++) {\n flags |= bindings[i].flags;\n }\n return flags;\n}\n\nexport function interpolate(valueCount: number, constAndInterp: string[]): string {\n let result = '';\n for (let i = 0; i < valueCount * 2; i = i + 2) {\n result = result + constAndInterp[i] + _toStringWithNull(constAndInterp[i + 1]);\n }\n return result + constAndInterp[valueCount * 2];\n}\n\nexport function inlineInterpolate(\n valueCount: number, c0: string, a1: any, c1: string, a2?: any, c2?: string, a3?: any,\n c3?: string, a4?: any, c4?: string, a5?: any, c5?: string, a6?: any, c6?: string, a7?: any,\n c7?: string, a8?: any, c8?: string, a9?: any, c9?: string): string {\n switch (valueCount) {\n case 1:\n return c0 + _toStringWithNull(a1) + c1;\n case 2:\n return c0 + _toStringWithNull(a1) + c1 + _toStringWithNull(a2) + c2;\n case 3:\n return c0 + _toStringWithNull(a1) + c1 + _toStringWithNull(a2) + c2 + _toStringWithNull(a3) +\n c3;\n case 4:\n return c0 + _toStringWithNull(a1) + c1 + _toStringWithNull(a2) + c2 + _toStringWithNull(a3) +\n c3 + _toStringWithNull(a4) + c4;\n case 5:\n return c0 + _toStringWithNull(a1) + c1 + _toStringWithNull(a2) + c2 + _toStringWithNull(a3) +\n c3 + _toStringWithNull(a4) + c4 + _toStringWithNull(a5) + c5;\n case 6:\n return c0 + _toStringWithNull(a1) + c1 + _toStringWithNull(a2) + c2 + _toStringWithNull(a3) +\n c3 + _toStringWithNull(a4) + c4 + _toStringWithNull(a5) + c5 + _toStringWithNull(a6) + c6;\n case 7:\n return c0 + _toStringWithNull(a1) + c1 + _toStringWithNull(a2) + c2 + _toStringWithNull(a3) +\n c3 + _toStringWithNull(a4) + c4 + _toStringWithNull(a5) + c5 + _toStringWithNull(a6) +\n c6 + _toStringWithNull(a7) + c7;\n case 8:\n return c0 + _toStringWithNull(a1) + c1 + _toStringWithNull(a2) + c2 + _toStringWithNull(a3) +\n c3 + _toStringWithNull(a4) + c4 + _toStringWithNull(a5) + c5 + _toStringWithNull(a6) +\n c6 + _toStringWithNull(a7) + c7 + _toStringWithNull(a8) + c8;\n case 9:\n return c0 + _toStringWithNull(a1) + c1 + _toStringWithNull(a2) + c2 + _toStringWithNull(a3) +\n c3 + _toStringWithNull(a4) + c4 + _toStringWithNull(a5) + c5 + _toStringWithNull(a6) +\n c6 + _toStringWithNull(a7) + c7 + _toStringWithNull(a8) + c8 + _toStringWithNull(a9) + c9;\n default:\n throw new Error(`Does not support more than 9 expressions`);\n }\n}\n\nfunction _toStringWithNull(v: any): string {\n return v != null ? v.toString() : '';\n}\n\nexport const EMPTY_ARRAY: any[] = [];\nexport const EMPTY_MAP: {[key: string]: any} = {};\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {RendererType2} from '../render/api';\nimport {SecurityContext} from '../sanitization/security';\n\nimport {BindingDef, BindingFlags, ElementData, ElementHandleEventFn, NodeDef, NodeFlags, OutputDef, OutputType, QueryValueType, ViewData, ViewDefinitionFactory, asElementData} from './types';\nimport {NOOP, calcBindingFlags, checkAndUpdateBinding, dispatchEvent, elementEventFullName, getParentRenderElement, resolveDefinition, resolveRendererType2, splitMatchedQueriesDsl, splitNamespace} from './util';\n\nexport function anchorDef(\n flags: NodeFlags, matchedQueriesDsl: null | [string | number, QueryValueType][],\n ngContentIndex: null | number, childCount: number, handleEvent?: null | ElementHandleEventFn,\n templateFactory?: ViewDefinitionFactory): NodeDef {\n flags |= NodeFlags.TypeElement;\n const {matchedQueries, references, matchedQueryIds} = splitMatchedQueriesDsl(matchedQueriesDsl);\n const template = templateFactory ? resolveDefinition(templateFactory) : null;\n\n return {\n // will bet set by the view definition\n nodeIndex: -1,\n parent: null,\n renderParent: null,\n bindingIndex: -1,\n outputIndex: -1,\n // regular values\n flags,\n checkIndex: -1,\n childFlags: 0,\n directChildFlags: 0,\n childMatchedQueries: 0, matchedQueries, matchedQueryIds, references, ngContentIndex, childCount,\n bindings: [],\n bindingFlags: 0,\n outputs: [],\n element: {\n ns: null,\n name: null,\n attrs: null, template,\n componentProvider: null,\n componentView: null,\n componentRendererType: null,\n publicProviders: null,\n allProviders: null,\n handleEvent: handleEvent || NOOP\n },\n provider: null,\n text: null,\n query: null,\n ngContent: null\n };\n}\n\nexport function elementDef(\n checkIndex: number, flags: NodeFlags,\n matchedQueriesDsl: null | [string | number, QueryValueType][], ngContentIndex: null | number,\n childCount: number, namespaceAndName: string | null, fixedAttrs: null | [string, string][] = [],\n bindings?: null | [BindingFlags, string, string | SecurityContext | null][],\n outputs?: null | ([string, string])[], handleEvent?: null | ElementHandleEventFn,\n componentView?: null | ViewDefinitionFactory,\n componentRendererType?: RendererType2 | null): NodeDef {\n if (!handleEvent) {\n handleEvent = NOOP;\n }\n const {matchedQueries, references, matchedQueryIds} = splitMatchedQueriesDsl(matchedQueriesDsl);\n let ns: string = null !;\n let name: string = null !;\n if (namespaceAndName) {\n [ns, name] = splitNamespace(namespaceAndName);\n }\n bindings = bindings || [];\n const bindingDefs: BindingDef[] = new Array(bindings.length);\n for (let i = 0; i < bindings.length; i++) {\n const [bindingFlags, namespaceAndName, suffixOrSecurityContext] = bindings[i];\n\n const [ns, name] = splitNamespace(namespaceAndName);\n let securityContext: SecurityContext = undefined !;\n let suffix: string = undefined !;\n switch (bindingFlags & BindingFlags.Types) {\n case BindingFlags.TypeElementStyle:\n suffix = <string>suffixOrSecurityContext;\n break;\n case BindingFlags.TypeElementAttribute:\n case BindingFlags.TypeProperty:\n securityContext = <SecurityContext>suffixOrSecurityContext;\n break;\n }\n bindingDefs[i] =\n {flags: bindingFlags, ns, name, nonMinifiedName: name, securityContext, suffix};\n }\n outputs = outputs || [];\n const outputDefs: OutputDef[] = new Array(outputs.length);\n for (let i = 0; i < outputs.length; i++) {\n const [target, eventName] = outputs[i];\n outputDefs[i] = {\n type: OutputType.ElementOutput,\n target: <any>target, eventName,\n propName: null\n };\n }\n fixedAttrs = fixedAttrs || [];\n const attrs = <[string, string, string][]>fixedAttrs.map(([namespaceAndName, value]) => {\n const [ns, name] = splitNamespace(namespaceAndName);\n return [ns, name, value];\n });\n componentRendererType = resolveRendererType2(componentRendererType);\n if (componentView) {\n flags |= NodeFlags.ComponentView;\n }\n flags |= NodeFlags.TypeElement;\n return {\n // will bet set by the view definition\n nodeIndex: -1,\n parent: null,\n renderParent: null,\n bindingIndex: -1,\n outputIndex: -1,\n // regular values\n checkIndex,\n flags,\n childFlags: 0,\n directChildFlags: 0,\n childMatchedQueries: 0, matchedQueries, matchedQueryIds, references, ngContentIndex, childCount,\n bindings: bindingDefs,\n bindingFlags: calcBindingFlags(bindingDefs),\n outputs: outputDefs,\n element: {\n ns,\n name,\n attrs,\n template: null,\n // will bet set by the view definition\n componentProvider: null,\n componentView: componentView || null,\n componentRendererType: componentRendererType,\n publicProviders: null,\n allProviders: null,\n handleEvent: handleEvent || NOOP,\n },\n provider: null,\n text: null,\n query: null,\n ngContent: null\n };\n}\n\nexport function createElement(view: ViewData, renderHost: any, def: NodeDef): ElementData {\n const elDef = def.element !;\n const rootSelectorOrNode = view.root.selectorOrNode;\n const renderer = view.renderer;\n let el: any;\n if (view.parent || !rootSelectorOrNode) {\n if (elDef.name) {\n el = renderer.createElement(elDef.name, elDef.ns);\n } else {\n el = renderer.createComment('');\n }\n const parentEl = getParentRenderElement(view, renderHost, def);\n if (parentEl) {\n renderer.appendChild(parentEl, el);\n }\n } else {\n el = renderer.selectRootElement(rootSelectorOrNode);\n }\n if (elDef.attrs) {\n for (let i = 0; i < elDef.attrs.length; i++) {\n const [ns, name, value] = elDef.attrs[i];\n renderer.setAttribute(el, name, value, ns);\n }\n }\n return el;\n}\n\nexport function listenToElementOutputs(view: ViewData, compView: ViewData, def: NodeDef, el: any) {\n for (let i = 0; i < def.outputs.length; i++) {\n const output = def.outputs[i];\n const handleEventClosure = renderEventHandlerClosure(\n view, def.nodeIndex, elementEventFullName(output.target, output.eventName));\n let listenTarget: 'window'|'document'|'body'|'component'|null = output.target;\n let listenerView = view;\n if (output.target === 'component') {\n listenTarget = null;\n listenerView = compView;\n }\n const disposable =\n <any>listenerView.renderer.listen(listenTarget || el, output.eventName, handleEventClosure);\n view.disposables ![def.outputIndex + i] = disposable;\n }\n}\n\nfunction renderEventHandlerClosure(view: ViewData, index: number, eventName: string) {\n return (event: any) => dispatchEvent(view, index, eventName, event);\n}\n\n\nexport function checkAndUpdateElementInline(\n view: ViewData, def: NodeDef, v0: any, v1: any, v2: any, v3: any, v4: any, v5: any, v6: any,\n v7: any, v8: any, v9: any): boolean {\n const bindLen = def.bindings.length;\n let changed = false;\n if (bindLen > 0 && checkAndUpdateElementValue(view, def, 0, v0)) changed = true;\n if (bindLen > 1 && checkAndUpdateElementValue(view, def, 1, v1)) changed = true;\n if (bindLen > 2 && checkAndUpdateElementValue(view, def, 2, v2)) changed = true;\n if (bindLen > 3 && checkAndUpdateElementValue(view, def, 3, v3)) changed = true;\n if (bindLen > 4 && checkAndUpdateElementValue(view, def, 4, v4)) changed = true;\n if (bindLen > 5 && checkAndUpdateElementValue(view, def, 5, v5)) changed = true;\n if (bindLen > 6 && checkAndUpdateElementValue(view, def, 6, v6)) changed = true;\n if (bindLen > 7 && checkAndUpdateElementValue(view, def, 7, v7)) changed = true;\n if (bindLen > 8 && checkAndUpdateElementValue(view, def, 8, v8)) changed = true;\n if (bindLen > 9 && checkAndUpdateElementValue(view, def, 9, v9)) changed = true;\n return changed;\n}\n\nexport function checkAndUpdateElementDynamic(view: ViewData, def: NodeDef, values: any[]): boolean {\n let changed = false;\n for (let i = 0; i < values.length; i++) {\n if (checkAndUpdateElementValue(view, def, i, values[i])) changed = true;\n }\n return changed;\n}\n\nfunction checkAndUpdateElementValue(view: ViewData, def: NodeDef, bindingIdx: number, value: any) {\n if (!checkAndUpdateBinding(view, def, bindingIdx, value)) {\n return false;\n }\n const binding = def.bindings[bindingIdx];\n const elData = asElementData(view, def.nodeIndex);\n const renderNode = elData.renderElement;\n const name = binding.name !;\n switch (binding.flags & BindingFlags.Types) {\n case BindingFlags.TypeElementAttribute:\n setElementAttribute(view, binding, renderNode, binding.ns, name, value);\n break;\n case BindingFlags.TypeElementClass:\n setElementClass(view, renderNode, name, value);\n break;\n case BindingFlags.TypeElementStyle:\n setElementStyle(view, binding, renderNode, name, value);\n break;\n case BindingFlags.TypeProperty:\n const bindView = (def.flags & NodeFlags.ComponentView &&\n binding.flags & BindingFlags.SyntheticHostProperty) ?\n elData.componentView :\n view;\n setElementProperty(bindView, binding, renderNode, name, value);\n break;\n }\n return true;\n}\n\nfunction setElementAttribute(\n view: ViewData, binding: BindingDef, renderNode: any, ns: string | null, name: string,\n value: any) {\n const securityContext = binding.securityContext;\n let renderValue = securityContext ? view.root.sanitizer.sanitize(securityContext, value) : value;\n renderValue = renderValue != null ? renderValue.toString() : null;\n const renderer = view.renderer;\n if (value != null) {\n renderer.setAttribute(renderNode, name, renderValue, ns);\n } else {\n renderer.removeAttribute(renderNode, name, ns);\n }\n}\n\nfunction setElementClass(view: ViewData, renderNode: any, name: string, value: boolean) {\n const renderer = view.renderer;\n if (value) {\n renderer.addClass(renderNode, name);\n } else {\n renderer.removeClass(renderNode, name);\n }\n}\n\nfunction setElementStyle(\n view: ViewData, binding: BindingDef, renderNode: any, name: string, value: any) {\n let renderValue: string|null =\n view.root.sanitizer.sanitize(SecurityContext.STYLE, value as{} | string);\n if (renderValue != null) {\n renderValue = renderValue.toString();\n const unit = binding.suffix;\n if (unit != null) {\n renderValue = renderValue + unit;\n }\n } else {\n renderValue = null;\n }\n const renderer = view.renderer;\n if (renderValue != null) {\n renderer.setStyle(renderNode, name, renderValue);\n } else {\n renderer.removeStyle(renderNode, name);\n }\n}\n\nfunction setElementProperty(\n view: ViewData, binding: BindingDef, renderNode: any, name: string, value: any) {\n const securityContext = binding.securityContext;\n let renderValue = securityContext ? view.root.sanitizer.sanitize(securityContext, value) : value;\n view.renderer.setProperty(renderNode, name, renderValue);\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {InjectableDef} from '../di/defs';\nimport {resolveForwardRef} from '../di/forward_ref';\nimport {INJECTOR, InjectFlags, Injector, setCurrentInjector} from '../di/injector';\nimport {APP_ROOT} from '../di/scope';\nimport {NgModuleRef} from '../linker/ng_module_factory';\nimport {stringify} from '../util';\n\nimport {DepDef, DepFlags, NgModuleData, NgModuleDefinition, NgModuleProviderDef, NodeFlags} from './types';\nimport {splitDepsDsl, tokenKey} from './util';\n\nconst UNDEFINED_VALUE = new Object();\n\nconst InjectorRefTokenKey = tokenKey(Injector);\nconst INJECTORRefTokenKey = tokenKey(INJECTOR);\nconst NgModuleRefTokenKey = tokenKey(NgModuleRef);\n\nexport function moduleProvideDef(\n flags: NodeFlags, token: any, value: any,\n deps: ([DepFlags, any] | any)[]): NgModuleProviderDef {\n // Need to resolve forwardRefs as e.g. for `useValue` we\n // lowered the expression and then stopped evaluating it,\n // i.e. also didn't unwrap it.\n value = resolveForwardRef(value);\n const depDefs = splitDepsDsl(deps, stringify(token));\n return {\n // will bet set by the module definition\n index: -1,\n deps: depDefs, flags, token, value\n };\n}\n\nexport function moduleDef(providers: NgModuleProviderDef[]): NgModuleDefinition {\n const providersByKey: {[key: string]: NgModuleProviderDef} = {};\n const modules = [];\n let isRoot: boolean = false;\n for (let i = 0; i < providers.length; i++) {\n const provider = providers[i];\n if (provider.token === APP_ROOT && provider.value === true) {\n isRoot = true;\n }\n if (provider.flags & NodeFlags.TypeNgModule) {\n modules.push(provider.token);\n }\n provider.index = i;\n providersByKey[tokenKey(provider.token)] = provider;\n }\n return {\n // Will be filled later...\n factory: null,\n providersByKey,\n providers,\n modules,\n isRoot,\n };\n}\n\nexport function initNgModule(data: NgModuleData) {\n const def = data._def;\n const providers = data._providers = new Array(def.providers.length);\n for (let i = 0; i < def.providers.length; i++) {\n const provDef = def.providers[i];\n if (!(provDef.flags & NodeFlags.LazyProvider)) {\n // Make sure the provider has not been already initialized outside this loop.\n if (providers[i] === undefined) {\n providers[i] = _createProviderInstance(data, provDef);\n }\n }\n }\n}\n\nexport function resolveNgModuleDep(\n data: NgModuleData, depDef: DepDef, notFoundValue: any = Injector.THROW_IF_NOT_FOUND): any {\n const former = setCurrentInjector(data);\n try {\n if (depDef.flags & DepFlags.Value) {\n return depDef.token;\n }\n if (depDef.flags & DepFlags.Optional) {\n notFoundValue = null;\n }\n if (depDef.flags & DepFlags.SkipSelf) {\n return data._parent.get(depDef.token, notFoundValue);\n }\n const tokenKey = depDef.tokenKey;\n switch (tokenKey) {\n case InjectorRefTokenKey:\n case INJECTORRefTokenKey:\n case NgModuleRefTokenKey:\n return data;\n }\n const providerDef = data._def.providersByKey[tokenKey];\n if (providerDef) {\n let providerInstance = data._providers[providerDef.index];\n if (providerInstance === undefined) {\n providerInstance = data._providers[providerDef.index] =\n _createProviderInstance(data, providerDef);\n }\n return providerInstance === UNDEFINED_VALUE ? undefined : providerInstance;\n } else if (depDef.token.ngInjectableDef && targetsModule(data, depDef.token.ngInjectableDef)) {\n const injectableDef = depDef.token.ngInjectableDef as InjectableDef<any>;\n const key = tokenKey;\n const index = data._providers.length;\n data._def.providersByKey[depDef.tokenKey] = {\n flags: NodeFlags.TypeFactoryProvider | NodeFlags.LazyProvider,\n value: injectableDef.factory,\n deps: [], index,\n token: depDef.token,\n };\n data._providers[index] = UNDEFINED_VALUE;\n return (\n data._providers[index] =\n _createProviderInstance(data, data._def.providersByKey[depDef.tokenKey]));\n } else if (depDef.flags & DepFlags.Self) {\n return notFoundValue;\n }\n return data._parent.get(depDef.token, notFoundValue);\n } finally {\n setCurrentInjector(former);\n }\n}\n\nfunction moduleTransitivelyPresent(ngModule: NgModuleData, scope: any): boolean {\n return ngModule._def.modules.indexOf(scope) > -1;\n}\n\nfunction targetsModule(ngModule: NgModuleData, def: InjectableDef<any>): boolean {\n return def.providedIn != null && (moduleTransitivelyPresent(ngModule, def.providedIn) ||\n def.providedIn === 'root' && ngModule._def.isRoot);\n}\n\nfunction _createProviderInstance(ngModule: NgModuleData, providerDef: NgModuleProviderDef): any {\n let injectable: any;\n switch (providerDef.flags & NodeFlags.Types) {\n case NodeFlags.TypeClassProvider:\n injectable = _createClass(ngModule, providerDef.value, providerDef.deps);\n break;\n case NodeFlags.TypeFactoryProvider:\n injectable = _callFactory(ngModule, providerDef.value, providerDef.deps);\n break;\n case NodeFlags.TypeUseExistingProvider:\n injectable = resolveNgModuleDep(ngModule, providerDef.deps[0]);\n break;\n case NodeFlags.TypeValueProvider:\n injectable = providerDef.value;\n break;\n }\n\n // The read of `ngOnDestroy` here is slightly expensive as it's megamorphic, so it should be\n // avoided if possible. The sequence of checks here determines whether ngOnDestroy needs to be\n // checked. It might not if the `injectable` isn't an object or if NodeFlags.OnDestroy is already\n // set (ngOnDestroy was detected statically).\n if (injectable !== UNDEFINED_VALUE && injectable != null && typeof injectable === 'object' &&\n !(providerDef.flags & NodeFlags.OnDestroy) && typeof injectable.ngOnDestroy === 'function') {\n providerDef.flags |= NodeFlags.OnDestroy;\n }\n return injectable === undefined ? UNDEFINED_VALUE : injectable;\n}\n\nfunction _createClass(ngModule: NgModuleData, ctor: any, deps: DepDef[]): any {\n const len = deps.length;\n switch (len) {\n case 0:\n return new ctor();\n case 1:\n return new ctor(resolveNgModuleDep(ngModule, deps[0]));\n case 2:\n return new ctor(resolveNgModuleDep(ngModule, deps[0]), resolveNgModuleDep(ngModule, deps[1]));\n case 3:\n return new ctor(\n resolveNgModuleDep(ngModule, deps[0]), resolveNgModuleDep(ngModule, deps[1]),\n resolveNgModuleDep(ngModule, deps[2]));\n default:\n const depValues = new Array(len);\n for (let i = 0; i < len; i++) {\n depValues[i] = resolveNgModuleDep(ngModule, deps[i]);\n }\n return new ctor(...depValues);\n }\n}\n\nfunction _callFactory(ngModule: NgModuleData, factory: any, deps: DepDef[]): any {\n const len = deps.length;\n switch (len) {\n case 0:\n return factory();\n case 1:\n return factory(resolveNgModuleDep(ngModule, deps[0]));\n case 2:\n return factory(resolveNgModuleDep(ngModule, deps[0]), resolveNgModuleDep(ngModule, deps[1]));\n case 3:\n return factory(\n resolveNgModuleDep(ngModule, deps[0]), resolveNgModuleDep(ngModule, deps[1]),\n resolveNgModuleDep(ngModule, deps[2]));\n default:\n const depValues = Array(len);\n for (let i = 0; i < len; i++) {\n depValues[i] = resolveNgModuleDep(ngModule, deps[i]);\n }\n return factory(...depValues);\n }\n}\n\nexport function callNgModuleLifecycle(ngModule: NgModuleData, lifecycles: NodeFlags) {\n const def = ngModule._def;\n const destroyed = new Set<any>();\n for (let i = 0; i < def.providers.length; i++) {\n const provDef = def.providers[i];\n if (provDef.flags & NodeFlags.OnDestroy) {\n const instance = ngModule._providers[i];\n if (instance && instance !== UNDEFINED_VALUE) {\n const onDestroy: Function|undefined = instance.ngOnDestroy;\n if (typeof onDestroy === 'function' && !destroyed.has(instance)) {\n onDestroy.apply(instance);\n destroyed.add(instance);\n }\n }\n }\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ElementData, NodeDef, NodeFlags, Services, ViewData, ViewDefinition, ViewState} from './types';\nimport {RenderNodeAction, declaredViewContainer, isComponentView, renderNode, visitRootRenderNodes} from './util';\n\nexport function attachEmbeddedView(\n parentView: ViewData, elementData: ElementData, viewIndex: number | undefined | null,\n view: ViewData) {\n let embeddedViews = elementData.viewContainer !._embeddedViews;\n if (viewIndex === null || viewIndex === undefined) {\n viewIndex = embeddedViews.length;\n }\n view.viewContainerParent = parentView;\n addToArray(embeddedViews, viewIndex !, view);\n attachProjectedView(elementData, view);\n\n Services.dirtyParentQueries(view);\n\n const prevView = viewIndex ! > 0 ? embeddedViews[viewIndex ! - 1] : null;\n renderAttachEmbeddedView(elementData, prevView, view);\n}\n\nfunction attachProjectedView(vcElementData: ElementData, view: ViewData) {\n const dvcElementData = declaredViewContainer(view);\n if (!dvcElementData || dvcElementData === vcElementData ||\n view.state & ViewState.IsProjectedView) {\n return;\n }\n // Note: For performance reasons, we\n // - add a view to template._projectedViews only 1x throughout its lifetime,\n // and remove it not until the view is destroyed.\n // (hard, as when a parent view is attached/detached we would need to attach/detach all\n // nested projected views as well, even across component boundaries).\n // - don't track the insertion order of views in the projected views array\n // (hard, as when the views of the same template are inserted different view containers)\n view.state |= ViewState.IsProjectedView;\n let projectedViews = dvcElementData.template._projectedViews;\n if (!projectedViews) {\n projectedViews = dvcElementData.template._projectedViews = [];\n }\n projectedViews.push(view);\n // Note: we are changing the NodeDef here as we cannot calculate\n // the fact whether a template is used for projection during compilation.\n markNodeAsProjectedTemplate(view.parent !.def, view.parentNodeDef !);\n}\n\nfunction markNodeAsProjectedTemplate(viewDef: ViewDefinition, nodeDef: NodeDef) {\n if (nodeDef.flags & NodeFlags.ProjectedTemplate) {\n return;\n }\n viewDef.nodeFlags |= NodeFlags.ProjectedTemplate;\n nodeDef.flags |= NodeFlags.ProjectedTemplate;\n let parentNodeDef = nodeDef.parent;\n while (parentNodeDef) {\n parentNodeDef.childFlags |= NodeFlags.ProjectedTemplate;\n parentNodeDef = parentNodeDef.parent;\n }\n}\n\nexport function detachEmbeddedView(elementData: ElementData, viewIndex?: number): ViewData|null {\n const embeddedViews = elementData.viewContainer !._embeddedViews;\n if (viewIndex == null || viewIndex >= embeddedViews.length) {\n viewIndex = embeddedViews.length - 1;\n }\n if (viewIndex < 0) {\n return null;\n }\n const view = embeddedViews[viewIndex];\n view.viewContainerParent = null;\n removeFromArray(embeddedViews, viewIndex);\n\n // See attachProjectedView for why we don't update projectedViews here.\n Services.dirtyParentQueries(view);\n\n renderDetachView(view);\n\n return view;\n}\n\nexport function detachProjectedView(view: ViewData) {\n if (!(view.state & ViewState.IsProjectedView)) {\n return;\n }\n const dvcElementData = declaredViewContainer(view);\n if (dvcElementData) {\n const projectedViews = dvcElementData.template._projectedViews;\n if (projectedViews) {\n removeFromArray(projectedViews, projectedViews.indexOf(view));\n Services.dirtyParentQueries(view);\n }\n }\n}\n\nexport function moveEmbeddedView(\n elementData: ElementData, oldViewIndex: number, newViewIndex: number): ViewData {\n const embeddedViews = elementData.viewContainer !._embeddedViews;\n const view = embeddedViews[oldViewIndex];\n removeFromArray(embeddedViews, oldViewIndex);\n if (newViewIndex == null) {\n newViewIndex = embeddedViews.length;\n }\n addToArray(embeddedViews, newViewIndex, view);\n\n // Note: Don't need to change projectedViews as the order in there\n // as always invalid...\n\n Services.dirtyParentQueries(view);\n\n renderDetachView(view);\n const prevView = newViewIndex > 0 ? embeddedViews[newViewIndex - 1] : null;\n renderAttachEmbeddedView(elementData, prevView, view);\n\n return view;\n}\n\nfunction renderAttachEmbeddedView(\n elementData: ElementData, prevView: ViewData | null, view: ViewData) {\n const prevRenderNode = prevView ? renderNode(prevView, prevView.def.lastRenderRootNode !) :\n elementData.renderElement;\n const parentNode = view.renderer.parentNode(prevRenderNode);\n const nextSibling = view.renderer.nextSibling(prevRenderNode);\n // Note: We can't check if `nextSibling` is present, as on WebWorkers it will always be!\n // However, browsers automatically do `appendChild` when there is no `nextSibling`.\n visitRootRenderNodes(view, RenderNodeAction.InsertBefore, parentNode, nextSibling, undefined);\n}\n\nexport function renderDetachView(view: ViewData) {\n visitRootRenderNodes(view, RenderNodeAction.RemoveChild, null, null, undefined);\n}\n\nfunction addToArray(arr: any[], index: number, value: any) {\n // perf: array.push is faster than array.splice!\n if (index >= arr.length) {\n arr.push(value);\n } else {\n arr.splice(index, 0, value);\n }\n}\n\nfunction removeFromArray(arr: any[], index: number) {\n // perf: array.pop is faster than array.splice!\n if (index >= arr.length - 1) {\n arr.pop();\n } else {\n arr.splice(index, 1);\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ApplicationRef} from '../application_ref';\nimport {ChangeDetectorRef} from '../change_detection/change_detection';\nimport {InjectFlags, Injector} from '../di/injector';\nimport {ComponentFactory, ComponentRef} from '../linker/component_factory';\nimport {ComponentFactoryBoundToModule, ComponentFactoryResolver} from '../linker/component_factory_resolver';\nimport {ElementRef} from '../linker/element_ref';\nimport {InternalNgModuleRef, NgModuleRef} from '../linker/ng_module_factory';\nimport {TemplateRef} from '../linker/template_ref';\nimport {ViewContainerRef} from '../linker/view_container_ref';\nimport {EmbeddedViewRef, InternalViewRef, ViewRef} from '../linker/view_ref';\nimport {Renderer as RendererV1, Renderer2} from '../render/api';\nimport {Type} from '../type';\nimport {stringify} from '../util';\nimport {VERSION} from '../version';\n\nimport {callNgModuleLifecycle, initNgModule, resolveNgModuleDep} from './ng_module';\nimport {DepFlags, ElementData, NgModuleData, NgModuleDefinition, NodeDef, NodeFlags, Services, TemplateData, ViewContainerData, ViewData, ViewDefinitionFactory, ViewState, asElementData, asProviderData, asTextData} from './types';\nimport {markParentViewsForCheck, resolveDefinition, rootRenderNodes, splitNamespace, tokenKey, viewParentEl} from './util';\nimport {attachEmbeddedView, detachEmbeddedView, moveEmbeddedView, renderDetachView} from './view_attach';\n\nconst EMPTY_CONTEXT = new Object();\n\n// Attention: this function is called as top level function.\n// Putting any logic in here will destroy closure tree shaking!\nexport function createComponentFactory(\n selector: string, componentType: Type<any>, viewDefFactory: ViewDefinitionFactory,\n inputs: {[propName: string]: string} | null, outputs: {[propName: string]: string},\n ngContentSelectors: string[]): ComponentFactory<any> {\n return new ComponentFactory_(\n selector, componentType, viewDefFactory, inputs, outputs, ngContentSelectors);\n}\n\nexport function getComponentViewDefinitionFactory(componentFactory: ComponentFactory<any>):\n ViewDefinitionFactory {\n return (componentFactory as ComponentFactory_).viewDefFactory;\n}\n\nclass ComponentFactory_ extends ComponentFactory<any> {\n /**\n * @internal\n */\n viewDefFactory: ViewDefinitionFactory;\n\n constructor(\n public selector: string, public componentType: Type<any>,\n viewDefFactory: ViewDefinitionFactory, private _inputs: {[propName: string]: string}|null,\n private _outputs: {[propName: string]: string}, public ngContentSelectors: string[]) {\n // Attention: this ctor is called as top level function.\n // Putting any logic in here will destroy closure tree shaking!\n super();\n this.viewDefFactory = viewDefFactory;\n }\n\n get inputs() {\n const inputsArr: {propName: string, templateName: string}[] = [];\n const inputs = this._inputs !;\n for (let propName in inputs) {\n const templateName = inputs[propName];\n inputsArr.push({propName, templateName});\n }\n return inputsArr;\n }\n\n get outputs() {\n const outputsArr: {propName: string, templateName: string}[] = [];\n for (let propName in this._outputs) {\n const templateName = this._outputs[propName];\n outputsArr.push({propName, templateName});\n }\n return outputsArr;\n }\n\n /**\n * Creates a new component.\n */\n create(\n injector: Injector, projectableNodes?: any[][], rootSelectorOrNode?: string|any,\n ngModule?: NgModuleRef<any>): ComponentRef<any> {\n if (!ngModule) {\n throw new Error('ngModule should be provided');\n }\n const viewDef = resolveDefinition(this.viewDefFactory);\n const componentNodeIndex = viewDef.nodes[0].element !.componentProvider !.nodeIndex;\n const view = Services.createRootView(\n injector, projectableNodes || [], rootSelectorOrNode, viewDef, ngModule, EMPTY_CONTEXT);\n const component = asProviderData(view, componentNodeIndex).instance;\n if (rootSelectorOrNode) {\n view.renderer.setAttribute(asElementData(view, 0).renderElement, 'ng-version', VERSION.full);\n }\n\n return new ComponentRef_(view, new ViewRef_(view), component);\n }\n}\n\nclass ComponentRef_ extends ComponentRef<any> {\n public readonly hostView: ViewRef;\n public readonly instance: any;\n public readonly changeDetectorRef: ChangeDetectorRef;\n private _elDef: NodeDef;\n constructor(private _view: ViewData, private _viewRef: ViewRef, private _component: any) {\n super();\n this._elDef = this._view.def.nodes[0];\n this.hostView = _viewRef;\n this.changeDetectorRef = _viewRef;\n this.instance = _component;\n }\n get location(): ElementRef {\n return new ElementRef(asElementData(this._view, this._elDef.nodeIndex).renderElement);\n }\n get injector(): Injector { return new Injector_(this._view, this._elDef); }\n get componentType(): Type<any> { return <any>this._component.constructor; }\n\n destroy(): void { this._viewRef.destroy(); }\n onDestroy(callback: Function): void { this._viewRef.onDestroy(callback); }\n}\n\nexport function createViewContainerData(\n view: ViewData, elDef: NodeDef, elData: ElementData): ViewContainerData {\n return new ViewContainerRef_(view, elDef, elData);\n}\n\nclass ViewContainerRef_ implements ViewContainerData {\n /**\n * @internal\n */\n _embeddedViews: ViewData[] = [];\n constructor(private _view: ViewData, private _elDef: NodeDef, private _data: ElementData) {}\n\n get element(): ElementRef { return new ElementRef(this._data.renderElement); }\n\n get injector(): Injector { return new Injector_(this._view, this._elDef); }\n\n get parentInjector(): Injector {\n let view = this._view;\n let elDef = this._elDef.parent;\n while (!elDef && view) {\n elDef = viewParentEl(view);\n view = view.parent !;\n }\n\n return view ? new Injector_(view, elDef) : new Injector_(this._view, null);\n }\n\n clear(): void {\n const len = this._embeddedViews.length;\n for (let i = len - 1; i >= 0; i--) {\n const view = detachEmbeddedView(this._data, i) !;\n Services.destroyView(view);\n }\n }\n\n get(index: number): ViewRef|null {\n const view = this._embeddedViews[index];\n if (view) {\n const ref = new ViewRef_(view);\n ref.attachToViewContainerRef(this);\n return ref;\n }\n return null;\n }\n\n get length(): number { return this._embeddedViews.length; }\n\n createEmbeddedView<C>(templateRef: TemplateRef<C>, context?: C, index?: number):\n EmbeddedViewRef<C> {\n const viewRef = templateRef.createEmbeddedView(context || <any>{});\n this.insert(viewRef, index);\n return viewRef;\n }\n\n createComponent<C>(\n componentFactory: ComponentFactory<C>, index?: number, injector?: Injector,\n projectableNodes?: any[][], ngModuleRef?: NgModuleRef<any>): ComponentRef<C> {\n const contextInjector = injector || this.parentInjector;\n if (!ngModuleRef && !(componentFactory instanceof ComponentFactoryBoundToModule)) {\n ngModuleRef = contextInjector.get(NgModuleRef);\n }\n const componentRef =\n componentFactory.create(contextInjector, projectableNodes, undefined, ngModuleRef);\n this.insert(componentRef.hostView, index);\n return componentRef;\n }\n\n insert(viewRef: ViewRef, index?: number): ViewRef {\n if (viewRef.destroyed) {\n throw new Error('Cannot insert a destroyed View in a ViewContainer!');\n }\n const viewRef_ = <ViewRef_>viewRef;\n const viewData = viewRef_._view;\n attachEmbeddedView(this._view, this._data, index, viewData);\n viewRef_.attachToViewContainerRef(this);\n return viewRef;\n }\n\n move(viewRef: ViewRef_, currentIndex: number): ViewRef {\n if (viewRef.destroyed) {\n throw new Error('Cannot move a destroyed View in a ViewContainer!');\n }\n const previousIndex = this._embeddedViews.indexOf(viewRef._view);\n moveEmbeddedView(this._data, previousIndex, currentIndex);\n return viewRef;\n }\n\n indexOf(viewRef: ViewRef): number {\n return this._embeddedViews.indexOf((<ViewRef_>viewRef)._view);\n }\n\n remove(index?: number): void {\n const viewData = detachEmbeddedView(this._data, index);\n if (viewData) {\n Services.destroyView(viewData);\n }\n }\n\n detach(index?: number): ViewRef|null {\n const view = detachEmbeddedView(this._data, index);\n return view ? new ViewRef_(view) : null;\n }\n}\n\nexport function createChangeDetectorRef(view: ViewData): ChangeDetectorRef {\n return new ViewRef_(view);\n}\n\nexport class ViewRef_ implements EmbeddedViewRef<any>, InternalViewRef {\n /** @internal */\n _view: ViewData;\n private _viewContainerRef: ViewContainerRef|null;\n private _appRef: ApplicationRef|null;\n\n constructor(_view: ViewData) {\n this._view = _view;\n this._viewContainerRef = null;\n this._appRef = null;\n }\n\n get rootNodes(): any[] { return rootRenderNodes(this._view); }\n\n get context() { return this._view.context; }\n\n get destroyed(): boolean { return (this._view.state & ViewState.Destroyed) !== 0; }\n\n markForCheck(): void { markParentViewsForCheck(this._view); }\n detach(): void { this._view.state &= ~ViewState.Attached; }\n detectChanges(): void {\n const fs = this._view.root.rendererFactory;\n if (fs.begin) {\n fs.begin();\n }\n try {\n Services.checkAndUpdateView(this._view);\n } finally {\n if (fs.end) {\n fs.end();\n }\n }\n }\n checkNoChanges(): void { Services.checkNoChangesView(this._view); }\n\n reattach(): void { this._view.state |= ViewState.Attached; }\n onDestroy(callback: Function) {\n if (!this._view.disposables) {\n this._view.disposables = [];\n }\n this._view.disposables.push(<any>callback);\n }\n\n destroy() {\n if (this._appRef) {\n this._appRef.detachView(this);\n } else if (this._viewContainerRef) {\n this._viewContainerRef.detach(this._viewContainerRef.indexOf(this));\n }\n Services.destroyView(this._view);\n }\n\n detachFromAppRef() {\n this._appRef = null;\n renderDetachView(this._view);\n Services.dirtyParentQueries(this._view);\n }\n\n attachToAppRef(appRef: ApplicationRef) {\n if (this._viewContainerRef) {\n throw new Error('This view is already attached to a ViewContainer!');\n }\n this._appRef = appRef;\n }\n\n attachToViewContainerRef(vcRef: ViewContainerRef) {\n if (this._appRef) {\n throw new Error('This view is already attached directly to the ApplicationRef!');\n }\n this._viewContainerRef = vcRef;\n }\n}\n\nexport function createTemplateData(view: ViewData, def: NodeDef): TemplateData {\n return new TemplateRef_(view, def);\n}\n\nclass TemplateRef_ extends TemplateRef<any> implements TemplateData {\n /**\n * @internal\n */\n // TODO(issue/24571): remove '!'.\n _projectedViews !: ViewData[];\n\n constructor(private _parentView: ViewData, private _def: NodeDef) { super(); }\n\n createEmbeddedView(context: any): EmbeddedViewRef<any> {\n return new ViewRef_(Services.createEmbeddedView(\n this._parentView, this._def, this._def.element !.template !, context));\n }\n\n get elementRef(): ElementRef {\n return new ElementRef(asElementData(this._parentView, this._def.nodeIndex).renderElement);\n }\n}\n\nexport function createInjector(view: ViewData, elDef: NodeDef): Injector {\n return new Injector_(view, elDef);\n}\n\nclass Injector_ implements Injector {\n constructor(private view: ViewData, private elDef: NodeDef|null) {}\n get(token: any, notFoundValue: any = Injector.THROW_IF_NOT_FOUND): any {\n const allowPrivateServices =\n this.elDef ? (this.elDef.flags & NodeFlags.ComponentView) !== 0 : false;\n return Services.resolveDep(\n this.view, this.elDef, allowPrivateServices,\n {flags: DepFlags.None, token, tokenKey: tokenKey(token)}, notFoundValue);\n }\n}\n\nexport function nodeValue(view: ViewData, index: number): any {\n const def = view.def.nodes[index];\n if (def.flags & NodeFlags.TypeElement) {\n const elData = asElementData(view, def.nodeIndex);\n return def.element !.template ? elData.template : elData.renderElement;\n } else if (def.flags & NodeFlags.TypeText) {\n return asTextData(view, def.nodeIndex).renderText;\n } else if (def.flags & (NodeFlags.CatProvider | NodeFlags.TypePipe)) {\n return asProviderData(view, def.nodeIndex).instance;\n }\n throw new Error(`Illegal state: read nodeValue for node index ${index}`);\n}\n\nexport function createRendererV1(view: ViewData): RendererV1 {\n return new RendererAdapter(view.renderer);\n}\n\nclass RendererAdapter implements RendererV1 {\n constructor(private delegate: Renderer2) {}\n selectRootElement(selectorOrNode: string|Element): Element {\n return this.delegate.selectRootElement(selectorOrNode);\n }\n\n createElement(parent: Element|DocumentFragment, namespaceAndName: string): Element {\n const [ns, name] = splitNamespace(namespaceAndName);\n const el = this.delegate.createElement(name, ns);\n if (parent) {\n this.delegate.appendChild(parent, el);\n }\n return el;\n }\n\n createViewRoot(hostElement: Element): Element|DocumentFragment { return hostElement; }\n\n createTemplateAnchor(parentElement: Element|DocumentFragment): Comment {\n const comment = this.delegate.createComment('');\n if (parentElement) {\n this.delegate.appendChild(parentElement, comment);\n }\n return comment;\n }\n\n createText(parentElement: Element|DocumentFragment, value: string): any {\n const node = this.delegate.createText(value);\n if (parentElement) {\n this.delegate.appendChild(parentElement, node);\n }\n return node;\n }\n\n projectNodes(parentElement: Element|DocumentFragment, nodes: Node[]) {\n for (let i = 0; i < nodes.length; i++) {\n this.delegate.appendChild(parentElement, nodes[i]);\n }\n }\n\n attachViewAfter(node: Node, viewRootNodes: Node[]) {\n const parentElement = this.delegate.parentNode(node);\n const nextSibling = this.delegate.nextSibling(node);\n for (let i = 0; i < viewRootNodes.length; i++) {\n this.delegate.insertBefore(parentElement, viewRootNodes[i], nextSibling);\n }\n }\n\n detachView(viewRootNodes: (Element|Text|Comment)[]) {\n for (let i = 0; i < viewRootNodes.length; i++) {\n const node = viewRootNodes[i];\n const parentElement = this.delegate.parentNode(node);\n this.delegate.removeChild(parentElement, node);\n }\n }\n\n destroyView(hostElement: Element|DocumentFragment, viewAllNodes: Node[]) {\n for (let i = 0; i < viewAllNodes.length; i++) {\n this.delegate.destroyNode !(viewAllNodes[i]);\n }\n }\n\n listen(renderElement: any, name: string, callback: Function): Function {\n return this.delegate.listen(renderElement, name, <any>callback);\n }\n\n listenGlobal(target: string, name: string, callback: Function): Function {\n return this.delegate.listen(target, name, <any>callback);\n }\n\n setElementProperty(\n renderElement: Element|DocumentFragment, propertyName: string, propertyValue: any): void {\n this.delegate.setProperty(renderElement, propertyName, propertyValue);\n }\n\n setElementAttribute(renderElement: Element, namespaceAndName: string, attributeValue: string):\n void {\n const [ns, name] = splitNamespace(namespaceAndName);\n if (attributeValue != null) {\n this.delegate.setAttribute(renderElement, name, attributeValue, ns);\n } else {\n this.delegate.removeAttribute(renderElement, name, ns);\n }\n }\n\n setBindingDebugInfo(renderElement: Element, propertyName: string, propertyValue: string): void {}\n\n setElementClass(renderElement: Element, className: string, isAdd: boolean): void {\n if (isAdd) {\n this.delegate.addClass(renderElement, className);\n } else {\n this.delegate.removeClass(renderElement, className);\n }\n }\n\n setElementStyle(renderElement: HTMLElement, styleName: string, styleValue: string): void {\n if (styleValue != null) {\n this.delegate.setStyle(renderElement, styleName, styleValue);\n } else {\n this.delegate.removeStyle(renderElement, styleName);\n }\n }\n\n invokeElementMethod(renderElement: Element, methodName: string, args: any[]): void {\n (renderElement as any)[methodName].apply(renderElement, args);\n }\n\n setText(renderNode: Text, text: string): void { this.delegate.setValue(renderNode, text); }\n\n animate(): any { throw new Error('Renderer.animate is no longer supported!'); }\n}\n\n\nexport function createNgModuleRef(\n moduleType: Type<any>, parent: Injector, bootstrapComponents: Type<any>[],\n def: NgModuleDefinition): NgModuleRef<any> {\n return new NgModuleRef_(moduleType, parent, bootstrapComponents, def);\n}\n\nclass NgModuleRef_ implements NgModuleData, InternalNgModuleRef<any> {\n private _destroyListeners: (() => void)[] = [];\n private _destroyed: boolean = false;\n /** @internal */\n // TODO(issue/24571): remove '!'.\n _providers !: any[];\n /** @internal */\n // TODO(issue/24571): remove '!'.\n _modules !: any[];\n\n readonly injector: Injector = this;\n\n constructor(\n private _moduleType: Type<any>, public _parent: Injector,\n public _bootstrapComponents: Type<any>[], public _def: NgModuleDefinition) {\n initNgModule(this);\n }\n\n get(token: any, notFoundValue: any = Injector.THROW_IF_NOT_FOUND,\n injectFlags: InjectFlags = InjectFlags.Default): any {\n let flags = DepFlags.None;\n if (injectFlags & InjectFlags.SkipSelf) {\n flags |= DepFlags.SkipSelf;\n } else if (injectFlags & InjectFlags.Self) {\n flags |= DepFlags.Self;\n }\n return resolveNgModuleDep(\n this, {token: token, tokenKey: tokenKey(token), flags: flags}, notFoundValue);\n }\n\n get instance() { return this.get(this._moduleType); }\n\n get componentFactoryResolver() { return this.get(ComponentFactoryResolver); }\n\n destroy(): void {\n if (this._destroyed) {\n throw new Error(\n `The ng module ${stringify(this.instance.constructor)} has already been destroyed.`);\n }\n this._destroyed = true;\n callNgModuleLifecycle(this, NodeFlags.OnDestroy);\n this._destroyListeners.forEach((listener) => listener());\n }\n\n onDestroy(callback: () => void): void { this._destroyListeners.push(callback); }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ChangeDetectorRef, SimpleChange, SimpleChanges, WrappedValue} from '../change_detection/change_detection';\nimport {INJECTOR, Injector, resolveForwardRef} from '../di';\nimport {ElementRef} from '../linker/element_ref';\nimport {TemplateRef} from '../linker/template_ref';\nimport {ViewContainerRef} from '../linker/view_container_ref';\nimport {Renderer as RendererV1, Renderer2} from '../render/api';\nimport {stringify} from '../util';\n\nimport {createChangeDetectorRef, createInjector, createRendererV1} from './refs';\nimport {BindingDef, BindingFlags, DepDef, DepFlags, NodeDef, NodeFlags, OutputDef, OutputType, ProviderData, QueryValueType, Services, ViewData, ViewFlags, ViewState, asElementData, asProviderData, shouldCallLifecycleInitHook} from './types';\nimport {calcBindingFlags, checkBinding, dispatchEvent, isComponentView, splitDepsDsl, splitMatchedQueriesDsl, tokenKey, viewParentEl} from './util';\n\nconst RendererV1TokenKey = tokenKey(RendererV1);\nconst Renderer2TokenKey = tokenKey(Renderer2);\nconst ElementRefTokenKey = tokenKey(ElementRef);\nconst ViewContainerRefTokenKey = tokenKey(ViewContainerRef);\nconst TemplateRefTokenKey = tokenKey(TemplateRef);\nconst ChangeDetectorRefTokenKey = tokenKey(ChangeDetectorRef);\nconst InjectorRefTokenKey = tokenKey(Injector);\nconst INJECTORRefTokenKey = tokenKey(INJECTOR);\n\nexport function directiveDef(\n checkIndex: number, flags: NodeFlags,\n matchedQueries: null | [string | number, QueryValueType][], childCount: number, ctor: any,\n deps: ([DepFlags, any] | any)[], props?: null | {[name: string]: [number, string]},\n outputs?: null | {[name: string]: string}): NodeDef {\n const bindings: BindingDef[] = [];\n if (props) {\n for (let prop in props) {\n const [bindingIndex, nonMinifiedName] = props[prop];\n bindings[bindingIndex] = {\n flags: BindingFlags.TypeProperty,\n name: prop, nonMinifiedName,\n ns: null,\n securityContext: null,\n suffix: null\n };\n }\n }\n const outputDefs: OutputDef[] = [];\n if (outputs) {\n for (let propName in outputs) {\n outputDefs.push(\n {type: OutputType.DirectiveOutput, propName, target: null, eventName: outputs[propName]});\n }\n }\n flags |= NodeFlags.TypeDirective;\n return _def(\n checkIndex, flags, matchedQueries, childCount, ctor, ctor, deps, bindings, outputDefs);\n}\n\nexport function pipeDef(flags: NodeFlags, ctor: any, deps: ([DepFlags, any] | any)[]): NodeDef {\n flags |= NodeFlags.TypePipe;\n return _def(-1, flags, null, 0, ctor, ctor, deps);\n}\n\nexport function providerDef(\n flags: NodeFlags, matchedQueries: null | [string | number, QueryValueType][], token: any,\n value: any, deps: ([DepFlags, any] | any)[]): NodeDef {\n return _def(-1, flags, matchedQueries, 0, token, value, deps);\n}\n\nexport function _def(\n checkIndex: number, flags: NodeFlags,\n matchedQueriesDsl: [string | number, QueryValueType][] | null, childCount: number, token: any,\n value: any, deps: ([DepFlags, any] | any)[], bindings?: BindingDef[],\n outputs?: OutputDef[]): NodeDef {\n const {matchedQueries, references, matchedQueryIds} = splitMatchedQueriesDsl(matchedQueriesDsl);\n if (!outputs) {\n outputs = [];\n }\n if (!bindings) {\n bindings = [];\n }\n // Need to resolve forwardRefs as e.g. for `useValue` we\n // lowered the expression and then stopped evaluating it,\n // i.e. also didn't unwrap it.\n value = resolveForwardRef(value);\n\n const depDefs = splitDepsDsl(deps, stringify(token));\n\n return {\n // will bet set by the view definition\n nodeIndex: -1,\n parent: null,\n renderParent: null,\n bindingIndex: -1,\n outputIndex: -1,\n // regular values\n checkIndex,\n flags,\n childFlags: 0,\n directChildFlags: 0,\n childMatchedQueries: 0, matchedQueries, matchedQueryIds, references,\n ngContentIndex: -1, childCount, bindings,\n bindingFlags: calcBindingFlags(bindings), outputs,\n element: null,\n provider: {token, value, deps: depDefs},\n text: null,\n query: null,\n ngContent: null\n };\n}\n\nexport function createProviderInstance(view: ViewData, def: NodeDef): any {\n return _createProviderInstance(view, def);\n}\n\nexport function createPipeInstance(view: ViewData, def: NodeDef): any {\n // deps are looked up from component.\n let compView = view;\n while (compView.parent && !isComponentView(compView)) {\n compView = compView.parent;\n }\n // pipes can see the private services of the component\n const allowPrivateServices = true;\n // pipes are always eager and classes!\n return createClass(\n compView.parent !, viewParentEl(compView) !, allowPrivateServices, def.provider !.value,\n def.provider !.deps);\n}\n\nexport function createDirectiveInstance(view: ViewData, def: NodeDef): any {\n // components can see other private services, other directives can't.\n const allowPrivateServices = (def.flags & NodeFlags.Component) > 0;\n // directives are always eager and classes!\n const instance = createClass(\n view, def.parent !, allowPrivateServices, def.provider !.value, def.provider !.deps);\n if (def.outputs.length) {\n for (let i = 0; i < def.outputs.length; i++) {\n const output = def.outputs[i];\n const subscription = instance[output.propName !].subscribe(\n eventHandlerClosure(view, def.parent !.nodeIndex, output.eventName));\n view.disposables ![def.outputIndex + i] = subscription.unsubscribe.bind(subscription);\n }\n }\n return instance;\n}\n\nfunction eventHandlerClosure(view: ViewData, index: number, eventName: string) {\n return (event: any) => dispatchEvent(view, index, eventName, event);\n}\n\nexport function checkAndUpdateDirectiveInline(\n view: ViewData, def: NodeDef, v0: any, v1: any, v2: any, v3: any, v4: any, v5: any, v6: any,\n v7: any, v8: any, v9: any): boolean {\n const providerData = asProviderData(view, def.nodeIndex);\n const directive = providerData.instance;\n let changed = false;\n let changes: SimpleChanges = undefined !;\n const bindLen = def.bindings.length;\n if (bindLen > 0 && checkBinding(view, def, 0, v0)) {\n changed = true;\n changes = updateProp(view, providerData, def, 0, v0, changes);\n }\n if (bindLen > 1 && checkBinding(view, def, 1, v1)) {\n changed = true;\n changes = updateProp(view, providerData, def, 1, v1, changes);\n }\n if (bindLen > 2 && checkBinding(view, def, 2, v2)) {\n changed = true;\n changes = updateProp(view, providerData, def, 2, v2, changes);\n }\n if (bindLen > 3 && checkBinding(view, def, 3, v3)) {\n changed = true;\n changes = updateProp(view, providerData, def, 3, v3, changes);\n }\n if (bindLen > 4 && checkBinding(view, def, 4, v4)) {\n changed = true;\n changes = updateProp(view, providerData, def, 4, v4, changes);\n }\n if (bindLen > 5 && checkBinding(view, def, 5, v5)) {\n changed = true;\n changes = updateProp(view, providerData, def, 5, v5, changes);\n }\n if (bindLen > 6 && checkBinding(view, def, 6, v6)) {\n changed = true;\n changes = updateProp(view, providerData, def, 6, v6, changes);\n }\n if (bindLen > 7 && checkBinding(view, def, 7, v7)) {\n changed = true;\n changes = updateProp(view, providerData, def, 7, v7, changes);\n }\n if (bindLen > 8 && checkBinding(view, def, 8, v8)) {\n changed = true;\n changes = updateProp(view, providerData, def, 8, v8, changes);\n }\n if (bindLen > 9 && checkBinding(view, def, 9, v9)) {\n changed = true;\n changes = updateProp(view, providerData, def, 9, v9, changes);\n }\n if (changes) {\n directive.ngOnChanges(changes);\n }\n if ((def.flags & NodeFlags.OnInit) &&\n shouldCallLifecycleInitHook(view, ViewState.InitState_CallingOnInit, def.nodeIndex)) {\n directive.ngOnInit();\n }\n if (def.flags & NodeFlags.DoCheck) {\n directive.ngDoCheck();\n }\n return changed;\n}\n\nexport function checkAndUpdateDirectiveDynamic(\n view: ViewData, def: NodeDef, values: any[]): boolean {\n const providerData = asProviderData(view, def.nodeIndex);\n const directive = providerData.instance;\n let changed = false;\n let changes: SimpleChanges = undefined !;\n for (let i = 0; i < values.length; i++) {\n if (checkBinding(view, def, i, values[i])) {\n changed = true;\n changes = updateProp(view, providerData, def, i, values[i], changes);\n }\n }\n if (changes) {\n directive.ngOnChanges(changes);\n }\n if ((def.flags & NodeFlags.OnInit) &&\n shouldCallLifecycleInitHook(view, ViewState.InitState_CallingOnInit, def.nodeIndex)) {\n directive.ngOnInit();\n }\n if (def.flags & NodeFlags.DoCheck) {\n directive.ngDoCheck();\n }\n return changed;\n}\n\nfunction _createProviderInstance(view: ViewData, def: NodeDef): any {\n // private services can see other private services\n const allowPrivateServices = (def.flags & NodeFlags.PrivateProvider) > 0;\n const providerDef = def.provider;\n switch (def.flags & NodeFlags.Types) {\n case NodeFlags.TypeClassProvider:\n return createClass(\n view, def.parent !, allowPrivateServices, providerDef !.value, providerDef !.deps);\n case NodeFlags.TypeFactoryProvider:\n return callFactory(\n view, def.parent !, allowPrivateServices, providerDef !.value, providerDef !.deps);\n case NodeFlags.TypeUseExistingProvider:\n return resolveDep(view, def.parent !, allowPrivateServices, providerDef !.deps[0]);\n case NodeFlags.TypeValueProvider:\n return providerDef !.value;\n }\n}\n\nfunction createClass(\n view: ViewData, elDef: NodeDef, allowPrivateServices: boolean, ctor: any, deps: DepDef[]): any {\n const len = deps.length;\n switch (len) {\n case 0:\n return new ctor();\n case 1:\n return new ctor(resolveDep(view, elDef, allowPrivateServices, deps[0]));\n case 2:\n return new ctor(\n resolveDep(view, elDef, allowPrivateServices, deps[0]),\n resolveDep(view, elDef, allowPrivateServices, deps[1]));\n case 3:\n return new ctor(\n resolveDep(view, elDef, allowPrivateServices, deps[0]),\n resolveDep(view, elDef, allowPrivateServices, deps[1]),\n resolveDep(view, elDef, allowPrivateServices, deps[2]));\n default:\n const depValues = new Array(len);\n for (let i = 0; i < len; i++) {\n depValues[i] = resolveDep(view, elDef, allowPrivateServices, deps[i]);\n }\n return new ctor(...depValues);\n }\n}\n\nfunction callFactory(\n view: ViewData, elDef: NodeDef, allowPrivateServices: boolean, factory: any,\n deps: DepDef[]): any {\n const len = deps.length;\n switch (len) {\n case 0:\n return factory();\n case 1:\n return factory(resolveDep(view, elDef, allowPrivateServices, deps[0]));\n case 2:\n return factory(\n resolveDep(view, elDef, allowPrivateServices, deps[0]),\n resolveDep(view, elDef, allowPrivateServices, deps[1]));\n case 3:\n return factory(\n resolveDep(view, elDef, allowPrivateServices, deps[0]),\n resolveDep(view, elDef, allowPrivateServices, deps[1]),\n resolveDep(view, elDef, allowPrivateServices, deps[2]));\n default:\n const depValues = Array(len);\n for (let i = 0; i < len; i++) {\n depValues[i] = resolveDep(view, elDef, allowPrivateServices, deps[i]);\n }\n return factory(...depValues);\n }\n}\n\n// This default value is when checking the hierarchy for a token.\n//\n// It means both:\n// - the token is not provided by the current injector,\n// - only the element injectors should be checked (ie do not check module injectors\n//\n// mod1\n// /\n// el1 mod2\n// \\ /\n// el2\n//\n// When requesting el2.injector.get(token), we should check in the following order and return the\n// first found value:\n// - el2.injector.get(token, default)\n// - el1.injector.get(token, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR) -> do not check the module\n// - mod2.injector.get(token, default)\nexport const NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR = {};\n\nexport function resolveDep(\n view: ViewData, elDef: NodeDef, allowPrivateServices: boolean, depDef: DepDef,\n notFoundValue: any = Injector.THROW_IF_NOT_FOUND): any {\n if (depDef.flags & DepFlags.Value) {\n return depDef.token;\n }\n const startView = view;\n if (depDef.flags & DepFlags.Optional) {\n notFoundValue = null;\n }\n const tokenKey = depDef.tokenKey;\n\n if (tokenKey === ChangeDetectorRefTokenKey) {\n // directives on the same element as a component should be able to control the change detector\n // of that component as well.\n allowPrivateServices = !!(elDef && elDef.element !.componentView);\n }\n\n if (elDef && (depDef.flags & DepFlags.SkipSelf)) {\n allowPrivateServices = false;\n elDef = elDef.parent !;\n }\n\n let searchView: ViewData|null = view;\n while (searchView) {\n if (elDef) {\n switch (tokenKey) {\n case RendererV1TokenKey: {\n const compView = findCompView(searchView, elDef, allowPrivateServices);\n return createRendererV1(compView);\n }\n case Renderer2TokenKey: {\n const compView = findCompView(searchView, elDef, allowPrivateServices);\n return compView.renderer;\n }\n case ElementRefTokenKey:\n return new ElementRef(asElementData(searchView, elDef.nodeIndex).renderElement);\n case ViewContainerRefTokenKey:\n return asElementData(searchView, elDef.nodeIndex).viewContainer;\n case TemplateRefTokenKey: {\n if (elDef.element !.template) {\n return asElementData(searchView, elDef.nodeIndex).template;\n }\n break;\n }\n case ChangeDetectorRefTokenKey: {\n let cdView = findCompView(searchView, elDef, allowPrivateServices);\n return createChangeDetectorRef(cdView);\n }\n case InjectorRefTokenKey:\n case INJECTORRefTokenKey:\n return createInjector(searchView, elDef);\n default:\n const providerDef =\n (allowPrivateServices ? elDef.element !.allProviders :\n elDef.element !.publicProviders) ![tokenKey];\n if (providerDef) {\n let providerData = asProviderData(searchView, providerDef.nodeIndex);\n if (!providerData) {\n providerData = {instance: _createProviderInstance(searchView, providerDef)};\n searchView.nodes[providerDef.nodeIndex] = providerData as any;\n }\n return providerData.instance;\n }\n }\n }\n\n allowPrivateServices = isComponentView(searchView);\n elDef = viewParentEl(searchView) !;\n searchView = searchView.parent !;\n\n if (depDef.flags & DepFlags.Self) {\n searchView = null;\n }\n }\n\n const value = startView.root.injector.get(depDef.token, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR);\n\n if (value !== NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR ||\n notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR) {\n // Return the value from the root element injector when\n // - it provides it\n // (value !== NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR)\n // - the module injector should not be checked\n // (notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR)\n return value;\n }\n\n return startView.root.ngModule.injector.get(depDef.token, notFoundValue);\n}\n\nfunction findCompView(view: ViewData, elDef: NodeDef, allowPrivateServices: boolean) {\n let compView: ViewData;\n if (allowPrivateServices) {\n compView = asElementData(view, elDef.nodeIndex).componentView;\n } else {\n compView = view;\n while (compView.parent && !isComponentView(compView)) {\n compView = compView.parent;\n }\n }\n return compView;\n}\n\nfunction updateProp(\n view: ViewData, providerData: ProviderData, def: NodeDef, bindingIdx: number, value: any,\n changes: SimpleChanges): SimpleChanges {\n if (def.flags & NodeFlags.Component) {\n const compView = asElementData(view, def.parent !.nodeIndex).componentView;\n if (compView.def.flags & ViewFlags.OnPush) {\n compView.state |= ViewState.ChecksEnabled;\n }\n }\n const binding = def.bindings[bindingIdx];\n const propName = binding.name !;\n // Note: This is still safe with Closure Compiler as\n // the user passed in the property name as an object has to `providerDef`,\n // so Closure Compiler will have renamed the property correctly already.\n providerData.instance[propName] = value;\n if (def.flags & NodeFlags.OnChanges) {\n changes = changes || {};\n const oldValue = WrappedValue.unwrap(view.oldValues[def.bindingIndex + bindingIdx]);\n const binding = def.bindings[bindingIdx];\n changes[binding.nonMinifiedName !] =\n new SimpleChange(oldValue, value, (view.state & ViewState.FirstCheck) !== 0);\n }\n view.oldValues[def.bindingIndex + bindingIdx] = value;\n return changes;\n}\n\n// This function calls the ngAfterContentCheck, ngAfterContentInit,\n// ngAfterViewCheck, and ngAfterViewInit lifecycle hooks (depending on the node\n// flags in lifecycle). Unlike ngDoCheck, ngOnChanges and ngOnInit, which are\n// called during a pre-order traversal of the view tree (that is calling the\n// parent hooks before the child hooks) these events are sent in using a\n// post-order traversal of the tree (children before parents). This changes the\n// meaning of initIndex in the view state. For ngOnInit, initIndex tracks the\n// expected nodeIndex which a ngOnInit should be called. When sending\n// ngAfterContentInit and ngAfterViewInit it is the expected count of\n// ngAfterContentInit or ngAfterViewInit methods that have been called. This\n// ensure that despite being called recursively or after picking up after an\n// exception, the ngAfterContentInit or ngAfterViewInit will be called on the\n// correct nodes. Consider for example, the following (where E is an element\n// and D is a directive)\n// Tree: pre-order index post-order index\n// E1 0 6\n// E2 1 1\n// D3 2 0\n// E4 3 5\n// E5 4 4\n// E6 5 2\n// E7 6 3\n// As can be seen, the post-order index has an unclear relationship to the\n// pre-order index (postOrderIndex === preOrderIndex - parentCount +\n// childCount). Since number of calls to ngAfterContentInit and ngAfterViewInit\n// are stable (will be the same for the same view regardless of exceptions or\n// recursion) we just need to count them which will roughly correspond to the\n// post-order index (it skips elements and directives that do not have\n// lifecycle hooks).\n//\n// For example, if an exception is raised in the E6.onAfterViewInit() the\n// initIndex is left at 3 (by shouldCallLifecycleInitHook() which set it to\n// initIndex + 1). When checkAndUpdateView() is called again D3, E2 and E6 will\n// not have their ngAfterViewInit() called but, starting with E7, the rest of\n// the view will begin getting ngAfterViewInit() called until a check and\n// pass is complete.\n//\n// This algorthim also handles recursion. Consider if E4's ngAfterViewInit()\n// indirectly calls E1's ChangeDetectorRef.detectChanges(). The expected\n// initIndex is set to 6, the recusive checkAndUpdateView() starts walk again.\n// D3, E2, E6, E7, E5 and E4 are skipped, ngAfterViewInit() is called on E1.\n// When the recursion returns the initIndex will be 7 so E1 is skipped as it\n// has already been called in the recursively called checkAnUpdateView().\nexport function callLifecycleHooksChildrenFirst(view: ViewData, lifecycles: NodeFlags) {\n if (!(view.def.nodeFlags & lifecycles)) {\n return;\n }\n const nodes = view.def.nodes;\n let initIndex = 0;\n for (let i = 0; i < nodes.length; i++) {\n const nodeDef = nodes[i];\n let parent = nodeDef.parent;\n if (!parent && nodeDef.flags & lifecycles) {\n // matching root node (e.g. a pipe)\n callProviderLifecycles(view, i, nodeDef.flags & lifecycles, initIndex++);\n }\n if ((nodeDef.childFlags & lifecycles) === 0) {\n // no child matches one of the lifecycles\n i += nodeDef.childCount;\n }\n while (parent && (parent.flags & NodeFlags.TypeElement) &&\n i === parent.nodeIndex + parent.childCount) {\n // last child of an element\n if (parent.directChildFlags & lifecycles) {\n initIndex = callElementProvidersLifecycles(view, parent, lifecycles, initIndex);\n }\n parent = parent.parent;\n }\n }\n}\n\nfunction callElementProvidersLifecycles(\n view: ViewData, elDef: NodeDef, lifecycles: NodeFlags, initIndex: number): number {\n for (let i = elDef.nodeIndex + 1; i <= elDef.nodeIndex + elDef.childCount; i++) {\n const nodeDef = view.def.nodes[i];\n if (nodeDef.flags & lifecycles) {\n callProviderLifecycles(view, i, nodeDef.flags & lifecycles, initIndex++);\n }\n // only visit direct children\n i += nodeDef.childCount;\n }\n return initIndex;\n}\n\nfunction callProviderLifecycles(\n view: ViewData, index: number, lifecycles: NodeFlags, initIndex: number) {\n const providerData = asProviderData(view, index);\n if (!providerData) {\n return;\n }\n const provider = providerData.instance;\n if (!provider) {\n return;\n }\n Services.setCurrentNode(view, index);\n if (lifecycles & NodeFlags.AfterContentInit &&\n shouldCallLifecycleInitHook(view, ViewState.InitState_CallingAfterContentInit, initIndex)) {\n provider.ngAfterContentInit();\n }\n if (lifecycles & NodeFlags.AfterContentChecked) {\n provider.ngAfterContentChecked();\n }\n if (lifecycles & NodeFlags.AfterViewInit &&\n shouldCallLifecycleInitHook(view, ViewState.InitState_CallingAfterViewInit, initIndex)) {\n provider.ngAfterViewInit();\n }\n if (lifecycles & NodeFlags.AfterViewChecked) {\n provider.ngAfterViewChecked();\n }\n if (lifecycles & NodeFlags.OnDestroy) {\n provider.ngOnDestroy();\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ElementRef} from '../linker/element_ref';\nimport {QueryList} from '../linker/query_list';\n\nimport {NodeDef, NodeFlags, QueryBindingDef, QueryBindingType, QueryDef, QueryValueType, ViewData, asElementData, asProviderData, asQueryList} from './types';\nimport {declaredViewContainer, filterQueryId, isEmbeddedView} from './util';\n\nexport function queryDef(\n flags: NodeFlags, id: number, bindings: {[propName: string]: QueryBindingType}): NodeDef {\n let bindingDefs: QueryBindingDef[] = [];\n for (let propName in bindings) {\n const bindingType = bindings[propName];\n bindingDefs.push({propName, bindingType});\n }\n\n return {\n // will bet set by the view definition\n nodeIndex: -1,\n parent: null,\n renderParent: null,\n bindingIndex: -1,\n outputIndex: -1,\n // regular values\n // TODO(vicb): check\n checkIndex: -1, flags,\n childFlags: 0,\n directChildFlags: 0,\n childMatchedQueries: 0,\n ngContentIndex: -1,\n matchedQueries: {},\n matchedQueryIds: 0,\n references: {},\n childCount: 0,\n bindings: [],\n bindingFlags: 0,\n outputs: [],\n element: null,\n provider: null,\n text: null,\n query: {id, filterId: filterQueryId(id), bindings: bindingDefs},\n ngContent: null\n };\n}\n\nexport function createQuery(): QueryList<any> {\n return new QueryList();\n}\n\nexport function dirtyParentQueries(view: ViewData) {\n const queryIds = view.def.nodeMatchedQueries;\n while (view.parent && isEmbeddedView(view)) {\n let tplDef = view.parentNodeDef !;\n view = view.parent;\n // content queries\n const end = tplDef.nodeIndex + tplDef.childCount;\n for (let i = 0; i <= end; i++) {\n const nodeDef = view.def.nodes[i];\n if ((nodeDef.flags & NodeFlags.TypeContentQuery) &&\n (nodeDef.flags & NodeFlags.DynamicQuery) &&\n (nodeDef.query !.filterId & queryIds) === nodeDef.query !.filterId) {\n asQueryList(view, i).setDirty();\n }\n if ((nodeDef.flags & NodeFlags.TypeElement && i + nodeDef.childCount < tplDef.nodeIndex) ||\n !(nodeDef.childFlags & NodeFlags.TypeContentQuery) ||\n !(nodeDef.childFlags & NodeFlags.DynamicQuery)) {\n // skip elements that don't contain the template element or no query.\n i += nodeDef.childCount;\n }\n }\n }\n\n // view queries\n if (view.def.nodeFlags & NodeFlags.TypeViewQuery) {\n for (let i = 0; i < view.def.nodes.length; i++) {\n const nodeDef = view.def.nodes[i];\n if ((nodeDef.flags & NodeFlags.TypeViewQuery) && (nodeDef.flags & NodeFlags.DynamicQuery)) {\n asQueryList(view, i).setDirty();\n }\n // only visit the root nodes\n i += nodeDef.childCount;\n }\n }\n}\n\nexport function checkAndUpdateQuery(view: ViewData, nodeDef: NodeDef) {\n const queryList = asQueryList(view, nodeDef.nodeIndex);\n if (!queryList.dirty) {\n return;\n }\n let directiveInstance: any;\n let newValues: any[] = undefined !;\n if (nodeDef.flags & NodeFlags.TypeContentQuery) {\n const elementDef = nodeDef.parent !.parent !;\n newValues = calcQueryValues(\n view, elementDef.nodeIndex, elementDef.nodeIndex + elementDef.childCount, nodeDef.query !,\n []);\n directiveInstance = asProviderData(view, nodeDef.parent !.nodeIndex).instance;\n } else if (nodeDef.flags & NodeFlags.TypeViewQuery) {\n newValues = calcQueryValues(view, 0, view.def.nodes.length - 1, nodeDef.query !, []);\n directiveInstance = view.component;\n }\n queryList.reset(newValues);\n const bindings = nodeDef.query !.bindings;\n let notify = false;\n for (let i = 0; i < bindings.length; i++) {\n const binding = bindings[i];\n let boundValue: any;\n switch (binding.bindingType) {\n case QueryBindingType.First:\n boundValue = queryList.first;\n break;\n case QueryBindingType.All:\n boundValue = queryList;\n notify = true;\n break;\n }\n directiveInstance[binding.propName] = boundValue;\n }\n if (notify) {\n queryList.notifyOnChanges();\n }\n}\n\nfunction calcQueryValues(\n view: ViewData, startIndex: number, endIndex: number, queryDef: QueryDef,\n values: any[]): any[] {\n for (let i = startIndex; i <= endIndex; i++) {\n const nodeDef = view.def.nodes[i];\n const valueType = nodeDef.matchedQueries[queryDef.id];\n if (valueType != null) {\n values.push(getQueryValue(view, nodeDef, valueType));\n }\n if (nodeDef.flags & NodeFlags.TypeElement && nodeDef.element !.template &&\n (nodeDef.element !.template !.nodeMatchedQueries & queryDef.filterId) ===\n queryDef.filterId) {\n const elementData = asElementData(view, i);\n // check embedded views that were attached at the place of their template,\n // but process child nodes first if some match the query (see issue #16568)\n if ((nodeDef.childMatchedQueries & queryDef.filterId) === queryDef.filterId) {\n calcQueryValues(view, i + 1, i + nodeDef.childCount, queryDef, values);\n i += nodeDef.childCount;\n }\n if (nodeDef.flags & NodeFlags.EmbeddedViews) {\n const embeddedViews = elementData.viewContainer !._embeddedViews;\n for (let k = 0; k < embeddedViews.length; k++) {\n const embeddedView = embeddedViews[k];\n const dvc = declaredViewContainer(embeddedView);\n if (dvc && dvc === elementData) {\n calcQueryValues(embeddedView, 0, embeddedView.def.nodes.length - 1, queryDef, values);\n }\n }\n }\n const projectedViews = elementData.template._projectedViews;\n if (projectedViews) {\n for (let k = 0; k < projectedViews.length; k++) {\n const projectedView = projectedViews[k];\n calcQueryValues(projectedView, 0, projectedView.def.nodes.length - 1, queryDef, values);\n }\n }\n }\n if ((nodeDef.childMatchedQueries & queryDef.filterId) !== queryDef.filterId) {\n // if no child matches the query, skip the children.\n i += nodeDef.childCount;\n }\n }\n return values;\n}\n\nexport function getQueryValue(\n view: ViewData, nodeDef: NodeDef, queryValueType: QueryValueType): any {\n if (queryValueType != null) {\n // a match\n switch (queryValueType) {\n case QueryValueType.RenderElement:\n return asElementData(view, nodeDef.nodeIndex).renderElement;\n case QueryValueType.ElementRef:\n return new ElementRef(asElementData(view, nodeDef.nodeIndex).renderElement);\n case QueryValueType.TemplateRef:\n return asElementData(view, nodeDef.nodeIndex).template;\n case QueryValueType.ViewContainerRef:\n return asElementData(view, nodeDef.nodeIndex).viewContainer;\n case QueryValueType.Provider:\n return asProviderData(view, nodeDef.nodeIndex).instance;\n }\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {NodeDef, NodeFlags, ViewData} from './types';\nimport {RenderNodeAction, getParentRenderElement, visitProjectedRenderNodes} from './util';\n\nexport function ngContentDef(ngContentIndex: null | number, index: number): NodeDef {\n return {\n // will bet set by the view definition\n nodeIndex: -1,\n parent: null,\n renderParent: null,\n bindingIndex: -1,\n outputIndex: -1,\n // regular values\n checkIndex: -1,\n flags: NodeFlags.TypeNgContent,\n childFlags: 0,\n directChildFlags: 0,\n childMatchedQueries: 0,\n matchedQueries: {},\n matchedQueryIds: 0,\n references: {}, ngContentIndex,\n childCount: 0,\n bindings: [],\n bindingFlags: 0,\n outputs: [],\n element: null,\n provider: null,\n text: null,\n query: null,\n ngContent: {index}\n };\n}\n\nexport function appendNgContent(view: ViewData, renderHost: any, def: NodeDef) {\n const parentEl = getParentRenderElement(view, renderHost, def);\n if (!parentEl) {\n // Nothing to do if there is no parent element.\n return;\n }\n const ngContentIndex = def.ngContent !.index;\n visitProjectedRenderNodes(\n view, ngContentIndex, RenderNodeAction.AppendChild, parentEl, null, undefined);\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {BindingDef, BindingFlags, NodeDef, NodeFlags, PureExpressionData, ViewData, asPureExpressionData} from './types';\nimport {calcBindingFlags, checkAndUpdateBinding} from './util';\n\nexport function purePipeDef(checkIndex: number, argCount: number): NodeDef {\n // argCount + 1 to include the pipe as first arg\n return _pureExpressionDef(NodeFlags.TypePurePipe, checkIndex, new Array(argCount + 1));\n}\n\nexport function pureArrayDef(checkIndex: number, argCount: number): NodeDef {\n return _pureExpressionDef(NodeFlags.TypePureArray, checkIndex, new Array(argCount));\n}\n\nexport function pureObjectDef(checkIndex: number, propToIndex: {[p: string]: number}): NodeDef {\n const keys = Object.keys(propToIndex);\n const nbKeys = keys.length;\n const propertyNames = new Array(nbKeys);\n for (let i = 0; i < nbKeys; i++) {\n const key = keys[i];\n const index = propToIndex[key];\n propertyNames[index] = key;\n }\n\n return _pureExpressionDef(NodeFlags.TypePureObject, checkIndex, propertyNames);\n}\n\nfunction _pureExpressionDef(\n flags: NodeFlags, checkIndex: number, propertyNames: string[]): NodeDef {\n const bindings: BindingDef[] = new Array(propertyNames.length);\n for (let i = 0; i < propertyNames.length; i++) {\n const prop = propertyNames[i];\n bindings[i] = {\n flags: BindingFlags.TypeProperty,\n name: prop,\n ns: null,\n nonMinifiedName: prop,\n securityContext: null,\n suffix: null\n };\n }\n return {\n // will bet set by the view definition\n nodeIndex: -1,\n parent: null,\n renderParent: null,\n bindingIndex: -1,\n outputIndex: -1,\n // regular values\n checkIndex,\n flags,\n childFlags: 0,\n directChildFlags: 0,\n childMatchedQueries: 0,\n matchedQueries: {},\n matchedQueryIds: 0,\n references: {},\n ngContentIndex: -1,\n childCount: 0, bindings,\n bindingFlags: calcBindingFlags(bindings),\n outputs: [],\n element: null,\n provider: null,\n text: null,\n query: null,\n ngContent: null\n };\n}\n\nexport function createPureExpression(view: ViewData, def: NodeDef): PureExpressionData {\n return {value: undefined};\n}\n\nexport function checkAndUpdatePureExpressionInline(\n view: ViewData, def: NodeDef, v0: any, v1: any, v2: any, v3: any, v4: any, v5: any, v6: any,\n v7: any, v8: any, v9: any): boolean {\n const bindings = def.bindings;\n let changed = false;\n const bindLen = bindings.length;\n if (bindLen > 0 && checkAndUpdateBinding(view, def, 0, v0)) changed = true;\n if (bindLen > 1 && checkAndUpdateBinding(view, def, 1, v1)) changed = true;\n if (bindLen > 2 && checkAndUpdateBinding(view, def, 2, v2)) changed = true;\n if (bindLen > 3 && checkAndUpdateBinding(view, def, 3, v3)) changed = true;\n if (bindLen > 4 && checkAndUpdateBinding(view, def, 4, v4)) changed = true;\n if (bindLen > 5 && checkAndUpdateBinding(view, def, 5, v5)) changed = true;\n if (bindLen > 6 && checkAndUpdateBinding(view, def, 6, v6)) changed = true;\n if (bindLen > 7 && checkAndUpdateBinding(view, def, 7, v7)) changed = true;\n if (bindLen > 8 && checkAndUpdateBinding(view, def, 8, v8)) changed = true;\n if (bindLen > 9 && checkAndUpdateBinding(view, def, 9, v9)) changed = true;\n\n if (changed) {\n const data = asPureExpressionData(view, def.nodeIndex);\n let value: any;\n switch (def.flags & NodeFlags.Types) {\n case NodeFlags.TypePureArray:\n value = new Array(bindings.length);\n if (bindLen > 0) value[0] = v0;\n if (bindLen > 1) value[1] = v1;\n if (bindLen > 2) value[2] = v2;\n if (bindLen > 3) value[3] = v3;\n if (bindLen > 4) value[4] = v4;\n if (bindLen > 5) value[5] = v5;\n if (bindLen > 6) value[6] = v6;\n if (bindLen > 7) value[7] = v7;\n if (bindLen > 8) value[8] = v8;\n if (bindLen > 9) value[9] = v9;\n break;\n case NodeFlags.TypePureObject:\n value = {};\n if (bindLen > 0) value[bindings[0].name !] = v0;\n if (bindLen > 1) value[bindings[1].name !] = v1;\n if (bindLen > 2) value[bindings[2].name !] = v2;\n if (bindLen > 3) value[bindings[3].name !] = v3;\n if (bindLen > 4) value[bindings[4].name !] = v4;\n if (bindLen > 5) value[bindings[5].name !] = v5;\n if (bindLen > 6) value[bindings[6].name !] = v6;\n if (bindLen > 7) value[bindings[7].name !] = v7;\n if (bindLen > 8) value[bindings[8].name !] = v8;\n if (bindLen > 9) value[bindings[9].name !] = v9;\n break;\n case NodeFlags.TypePurePipe:\n const pipe = v0;\n switch (bindLen) {\n case 1:\n value = pipe.transform(v0);\n break;\n case 2:\n value = pipe.transform(v1);\n break;\n case 3:\n value = pipe.transform(v1, v2);\n break;\n case 4:\n value = pipe.transform(v1, v2, v3);\n break;\n case 5:\n value = pipe.transform(v1, v2, v3, v4);\n break;\n case 6:\n value = pipe.transform(v1, v2, v3, v4, v5);\n break;\n case 7:\n value = pipe.transform(v1, v2, v3, v4, v5, v6);\n break;\n case 8:\n value = pipe.transform(v1, v2, v3, v4, v5, v6, v7);\n break;\n case 9:\n value = pipe.transform(v1, v2, v3, v4, v5, v6, v7, v8);\n break;\n case 10:\n value = pipe.transform(v1, v2, v3, v4, v5, v6, v7, v8, v9);\n break;\n }\n break;\n }\n data.value = value;\n }\n return changed;\n}\n\nexport function checkAndUpdatePureExpressionDynamic(\n view: ViewData, def: NodeDef, values: any[]): boolean {\n const bindings = def.bindings;\n let changed = false;\n for (let i = 0; i < values.length; i++) {\n // Note: We need to loop over all values, so that\n // the old values are updates as well!\n if (checkAndUpdateBinding(view, def, i, values[i])) {\n changed = true;\n }\n }\n if (changed) {\n const data = asPureExpressionData(view, def.nodeIndex);\n let value: any;\n switch (def.flags & NodeFlags.Types) {\n case NodeFlags.TypePureArray:\n value = values;\n break;\n case NodeFlags.TypePureObject:\n value = {};\n for (let i = 0; i < values.length; i++) {\n value[bindings[i].name !] = values[i];\n }\n break;\n case NodeFlags.TypePurePipe:\n const pipe = values[0];\n const params = values.slice(1);\n value = (<any>pipe.transform)(...params);\n break;\n }\n data.value = value;\n }\n return changed;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {BindingDef, BindingFlags, NodeDef, NodeFlags, TextData, ViewData, asTextData} from './types';\nimport {checkAndUpdateBinding, getParentRenderElement} from './util';\n\nexport function textDef(\n checkIndex: number, ngContentIndex: number | null, staticText: string[]): NodeDef {\n const bindings: BindingDef[] = new Array(staticText.length - 1);\n for (let i = 1; i < staticText.length; i++) {\n bindings[i - 1] = {\n flags: BindingFlags.TypeProperty,\n name: null,\n ns: null,\n nonMinifiedName: null,\n securityContext: null,\n suffix: staticText[i],\n };\n }\n\n return {\n // will bet set by the view definition\n nodeIndex: -1,\n parent: null,\n renderParent: null,\n bindingIndex: -1,\n outputIndex: -1,\n // regular values\n checkIndex,\n flags: NodeFlags.TypeText,\n childFlags: 0,\n directChildFlags: 0,\n childMatchedQueries: 0,\n matchedQueries: {},\n matchedQueryIds: 0,\n references: {}, ngContentIndex,\n childCount: 0, bindings,\n bindingFlags: BindingFlags.TypeProperty,\n outputs: [],\n element: null,\n provider: null,\n text: {prefix: staticText[0]},\n query: null,\n ngContent: null,\n };\n}\n\nexport function createText(view: ViewData, renderHost: any, def: NodeDef): TextData {\n let renderNode: any;\n const renderer = view.renderer;\n renderNode = renderer.createText(def.text !.prefix);\n const parentEl = getParentRenderElement(view, renderHost, def);\n if (parentEl) {\n renderer.appendChild(parentEl, renderNode);\n }\n return {renderText: renderNode};\n}\n\nexport function checkAndUpdateTextInline(\n view: ViewData, def: NodeDef, v0: any, v1: any, v2: any, v3: any, v4: any, v5: any, v6: any,\n v7: any, v8: any, v9: any): boolean {\n let changed = false;\n const bindings = def.bindings;\n const bindLen = bindings.length;\n if (bindLen > 0 && checkAndUpdateBinding(view, def, 0, v0)) changed = true;\n if (bindLen > 1 && checkAndUpdateBinding(view, def, 1, v1)) changed = true;\n if (bindLen > 2 && checkAndUpdateBinding(view, def, 2, v2)) changed = true;\n if (bindLen > 3 && checkAndUpdateBinding(view, def, 3, v3)) changed = true;\n if (bindLen > 4 && checkAndUpdateBinding(view, def, 4, v4)) changed = true;\n if (bindLen > 5 && checkAndUpdateBinding(view, def, 5, v5)) changed = true;\n if (bindLen > 6 && checkAndUpdateBinding(view, def, 6, v6)) changed = true;\n if (bindLen > 7 && checkAndUpdateBinding(view, def, 7, v7)) changed = true;\n if (bindLen > 8 && checkAndUpdateBinding(view, def, 8, v8)) changed = true;\n if (bindLen > 9 && checkAndUpdateBinding(view, def, 9, v9)) changed = true;\n\n if (changed) {\n let value = def.text !.prefix;\n if (bindLen > 0) value += _addInterpolationPart(v0, bindings[0]);\n if (bindLen > 1) value += _addInterpolationPart(v1, bindings[1]);\n if (bindLen > 2) value += _addInterpolationPart(v2, bindings[2]);\n if (bindLen > 3) value += _addInterpolationPart(v3, bindings[3]);\n if (bindLen > 4) value += _addInterpolationPart(v4, bindings[4]);\n if (bindLen > 5) value += _addInterpolationPart(v5, bindings[5]);\n if (bindLen > 6) value += _addInterpolationPart(v6, bindings[6]);\n if (bindLen > 7) value += _addInterpolationPart(v7, bindings[7]);\n if (bindLen > 8) value += _addInterpolationPart(v8, bindings[8]);\n if (bindLen > 9) value += _addInterpolationPart(v9, bindings[9]);\n const renderNode = asTextData(view, def.nodeIndex).renderText;\n view.renderer.setValue(renderNode, value);\n }\n return changed;\n}\n\nexport function checkAndUpdateTextDynamic(view: ViewData, def: NodeDef, values: any[]): boolean {\n const bindings = def.bindings;\n let changed = false;\n for (let i = 0; i < values.length; i++) {\n // Note: We need to loop over all values, so that\n // the old values are updates as well!\n if (checkAndUpdateBinding(view, def, i, values[i])) {\n changed = true;\n }\n }\n if (changed) {\n let value = '';\n for (let i = 0; i < values.length; i++) {\n value = value + _addInterpolationPart(values[i], bindings[i]);\n }\n value = def.text !.prefix + value;\n const renderNode = asTextData(view, def.nodeIndex).renderText;\n view.renderer.setValue(renderNode, value);\n }\n return changed;\n}\n\nfunction _addInterpolationPart(value: any, binding: BindingDef): string {\n const valueStr = value != null ? value.toString() : '';\n return valueStr + binding.suffix;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Renderer2} from '../render/api';\n\nimport {checkAndUpdateElementDynamic, checkAndUpdateElementInline, createElement, listenToElementOutputs} from './element';\nimport {expressionChangedAfterItHasBeenCheckedError} from './errors';\nimport {appendNgContent} from './ng_content';\nimport {callLifecycleHooksChildrenFirst, checkAndUpdateDirectiveDynamic, checkAndUpdateDirectiveInline, createDirectiveInstance, createPipeInstance, createProviderInstance} from './provider';\nimport {checkAndUpdatePureExpressionDynamic, checkAndUpdatePureExpressionInline, createPureExpression} from './pure_expression';\nimport {checkAndUpdateQuery, createQuery} from './query';\nimport {createTemplateData, createViewContainerData} from './refs';\nimport {checkAndUpdateTextDynamic, checkAndUpdateTextInline, createText} from './text';\nimport {ArgumentType, CheckType, ElementData, NodeData, NodeDef, NodeFlags, ProviderData, RootData, Services, ViewData, ViewDefinition, ViewFlags, ViewHandleEventFn, ViewState, ViewUpdateFn, asElementData, asQueryList, asTextData, shiftInitState} from './types';\nimport {NOOP, checkBindingNoChanges, isComponentView, markParentViewsForCheckProjectedViews, resolveDefinition, tokenKey} from './util';\nimport {detachProjectedView} from './view_attach';\n\nexport function viewDef(\n flags: ViewFlags, nodes: NodeDef[], updateDirectives?: null | ViewUpdateFn,\n updateRenderer?: null | ViewUpdateFn): ViewDefinition {\n // clone nodes and set auto calculated values\n let viewBindingCount = 0;\n let viewDisposableCount = 0;\n let viewNodeFlags = 0;\n let viewRootNodeFlags = 0;\n let viewMatchedQueries = 0;\n let currentParent: NodeDef|null = null;\n let currentRenderParent: NodeDef|null = null;\n let currentElementHasPublicProviders = false;\n let currentElementHasPrivateProviders = false;\n let lastRenderRootNode: NodeDef|null = null;\n for (let i = 0; i < nodes.length; i++) {\n const node = nodes[i];\n node.nodeIndex = i;\n node.parent = currentParent;\n node.bindingIndex = viewBindingCount;\n node.outputIndex = viewDisposableCount;\n node.renderParent = currentRenderParent;\n\n viewNodeFlags |= node.flags;\n viewMatchedQueries |= node.matchedQueryIds;\n\n if (node.element) {\n const elDef = node.element;\n elDef.publicProviders =\n currentParent ? currentParent.element !.publicProviders : Object.create(null);\n elDef.allProviders = elDef.publicProviders;\n // Note: We assume that all providers of an element are before any child element!\n currentElementHasPublicProviders = false;\n currentElementHasPrivateProviders = false;\n\n if (node.element.template) {\n viewMatchedQueries |= node.element.template.nodeMatchedQueries;\n }\n }\n validateNode(currentParent, node, nodes.length);\n\n\n viewBindingCount += node.bindings.length;\n viewDisposableCount += node.outputs.length;\n\n if (!currentRenderParent && (node.flags & NodeFlags.CatRenderNode)) {\n lastRenderRootNode = node;\n }\n\n if (node.flags & NodeFlags.CatProvider) {\n if (!currentElementHasPublicProviders) {\n currentElementHasPublicProviders = true;\n // Use prototypical inheritance to not get O(n^2) complexity...\n currentParent !.element !.publicProviders =\n Object.create(currentParent !.element !.publicProviders);\n currentParent !.element !.allProviders = currentParent !.element !.publicProviders;\n }\n const isPrivateService = (node.flags & NodeFlags.PrivateProvider) !== 0;\n const isComponent = (node.flags & NodeFlags.Component) !== 0;\n if (!isPrivateService || isComponent) {\n currentParent !.element !.publicProviders ![tokenKey(node.provider !.token)] = node;\n } else {\n if (!currentElementHasPrivateProviders) {\n currentElementHasPrivateProviders = true;\n // Use prototypical inheritance to not get O(n^2) complexity...\n currentParent !.element !.allProviders =\n Object.create(currentParent !.element !.publicProviders);\n }\n currentParent !.element !.allProviders ![tokenKey(node.provider !.token)] = node;\n }\n if (isComponent) {\n currentParent !.element !.componentProvider = node;\n }\n }\n\n if (currentParent) {\n currentParent.childFlags |= node.flags;\n currentParent.directChildFlags |= node.flags;\n currentParent.childMatchedQueries |= node.matchedQueryIds;\n if (node.element && node.element.template) {\n currentParent.childMatchedQueries |= node.element.template.nodeMatchedQueries;\n }\n } else {\n viewRootNodeFlags |= node.flags;\n }\n\n if (node.childCount > 0) {\n currentParent = node;\n\n if (!isNgContainer(node)) {\n currentRenderParent = node;\n }\n } else {\n // When the current node has no children, check if it is the last children of its parent.\n // When it is, propagate the flags up.\n // The loop is required because an element could be the last transitive children of several\n // elements. We loop to either the root or the highest opened element (= with remaining\n // children)\n while (currentParent && i === currentParent.nodeIndex + currentParent.childCount) {\n const newParent: NodeDef|null = currentParent.parent;\n if (newParent) {\n newParent.childFlags |= currentParent.childFlags;\n newParent.childMatchedQueries |= currentParent.childMatchedQueries;\n }\n currentParent = newParent;\n // We also need to update the render parent & account for ng-container\n if (currentParent && isNgContainer(currentParent)) {\n currentRenderParent = currentParent.renderParent;\n } else {\n currentRenderParent = currentParent;\n }\n }\n }\n }\n\n const handleEvent: ViewHandleEventFn = (view, nodeIndex, eventName, event) =>\n nodes[nodeIndex].element !.handleEvent !(view, eventName, event);\n\n return {\n // Will be filled later...\n factory: null,\n nodeFlags: viewNodeFlags,\n rootNodeFlags: viewRootNodeFlags,\n nodeMatchedQueries: viewMatchedQueries, flags,\n nodes: nodes,\n updateDirectives: updateDirectives || NOOP,\n updateRenderer: updateRenderer || NOOP, handleEvent,\n bindingCount: viewBindingCount,\n outputCount: viewDisposableCount, lastRenderRootNode\n };\n}\n\nfunction isNgContainer(node: NodeDef): boolean {\n return (node.flags & NodeFlags.TypeElement) !== 0 && node.element !.name === null;\n}\n\nfunction validateNode(parent: NodeDef | null, node: NodeDef, nodeCount: number) {\n const template = node.element && node.element.template;\n if (template) {\n if (!template.lastRenderRootNode) {\n throw new Error(`Illegal State: Embedded templates without nodes are not allowed!`);\n }\n if (template.lastRenderRootNode &&\n template.lastRenderRootNode.flags & NodeFlags.EmbeddedViews) {\n throw new Error(\n `Illegal State: Last root node of a template can't have embedded views, at index ${node.nodeIndex}!`);\n }\n }\n if (node.flags & NodeFlags.CatProvider) {\n const parentFlags = parent ? parent.flags : 0;\n if ((parentFlags & NodeFlags.TypeElement) === 0) {\n throw new Error(\n `Illegal State: StaticProvider/Directive nodes need to be children of elements or anchors, at index ${node.nodeIndex}!`);\n }\n }\n if (node.query) {\n if (node.flags & NodeFlags.TypeContentQuery &&\n (!parent || (parent.flags & NodeFlags.TypeDirective) === 0)) {\n throw new Error(\n `Illegal State: Content Query nodes need to be children of directives, at index ${node.nodeIndex}!`);\n }\n if (node.flags & NodeFlags.TypeViewQuery && parent) {\n throw new Error(\n `Illegal State: View Query nodes have to be top level nodes, at index ${node.nodeIndex}!`);\n }\n }\n if (node.childCount) {\n const parentEnd = parent ? parent.nodeIndex + parent.childCount : nodeCount - 1;\n if (node.nodeIndex <= parentEnd && node.nodeIndex + node.childCount > parentEnd) {\n throw new Error(\n `Illegal State: childCount of node leads outside of parent, at index ${node.nodeIndex}!`);\n }\n }\n}\n\nexport function createEmbeddedView(\n parent: ViewData, anchorDef: NodeDef, viewDef: ViewDefinition, context?: any): ViewData {\n // embedded views are seen as siblings to the anchor, so we need\n // to get the parent of the anchor and use it as parentIndex.\n const view = createView(parent.root, parent.renderer, parent, anchorDef, viewDef);\n initView(view, parent.component, context);\n createViewNodes(view);\n return view;\n}\n\nexport function createRootView(root: RootData, def: ViewDefinition, context?: any): ViewData {\n const view = createView(root, root.renderer, null, null, def);\n initView(view, context, context);\n createViewNodes(view);\n return view;\n}\n\nexport function createComponentView(\n parentView: ViewData, nodeDef: NodeDef, viewDef: ViewDefinition, hostElement: any): ViewData {\n const rendererType = nodeDef.element !.componentRendererType;\n let compRenderer: Renderer2;\n if (!rendererType) {\n compRenderer = parentView.root.renderer;\n } else {\n compRenderer = parentView.root.rendererFactory.createRenderer(hostElement, rendererType);\n }\n return createView(\n parentView.root, compRenderer, parentView, nodeDef.element !.componentProvider, viewDef);\n}\n\nfunction createView(\n root: RootData, renderer: Renderer2, parent: ViewData | null, parentNodeDef: NodeDef | null,\n def: ViewDefinition): ViewData {\n const nodes: NodeData[] = new Array(def.nodes.length);\n const disposables = def.outputCount ? new Array(def.outputCount) : null;\n const view: ViewData = {\n def,\n parent,\n viewContainerParent: null, parentNodeDef,\n context: null,\n component: null, nodes,\n state: ViewState.CatInit, root, renderer,\n oldValues: new Array(def.bindingCount), disposables,\n initIndex: -1\n };\n return view;\n}\n\nfunction initView(view: ViewData, component: any, context: any) {\n view.component = component;\n view.context = context;\n}\n\nfunction createViewNodes(view: ViewData) {\n let renderHost: any;\n if (isComponentView(view)) {\n const hostDef = view.parentNodeDef;\n renderHost = asElementData(view.parent !, hostDef !.parent !.nodeIndex).renderElement;\n }\n const def = view.def;\n const nodes = view.nodes;\n for (let i = 0; i < def.nodes.length; i++) {\n const nodeDef = def.nodes[i];\n Services.setCurrentNode(view, i);\n let nodeData: any;\n switch (nodeDef.flags & NodeFlags.Types) {\n case NodeFlags.TypeElement:\n const el = createElement(view, renderHost, nodeDef) as any;\n let componentView: ViewData = undefined !;\n if (nodeDef.flags & NodeFlags.ComponentView) {\n const compViewDef = resolveDefinition(nodeDef.element !.componentView !);\n componentView = Services.createComponentView(view, nodeDef, compViewDef, el);\n }\n listenToElementOutputs(view, componentView, nodeDef, el);\n nodeData = <ElementData>{\n renderElement: el,\n componentView,\n viewContainer: null,\n template: nodeDef.element !.template ? createTemplateData(view, nodeDef) : undefined\n };\n if (nodeDef.flags & NodeFlags.EmbeddedViews) {\n nodeData.viewContainer = createViewContainerData(view, nodeDef, nodeData);\n }\n break;\n case NodeFlags.TypeText:\n nodeData = createText(view, renderHost, nodeDef) as any;\n break;\n case NodeFlags.TypeClassProvider:\n case NodeFlags.TypeFactoryProvider:\n case NodeFlags.TypeUseExistingProvider:\n case NodeFlags.TypeValueProvider: {\n nodeData = nodes[i];\n if (!nodeData && !(nodeDef.flags & NodeFlags.LazyProvider)) {\n const instance = createProviderInstance(view, nodeDef);\n nodeData = <ProviderData>{instance};\n }\n break;\n }\n case NodeFlags.TypePipe: {\n const instance = createPipeInstance(view, nodeDef);\n nodeData = <ProviderData>{instance};\n break;\n }\n case NodeFlags.TypeDirective: {\n nodeData = nodes[i];\n if (!nodeData) {\n const instance = createDirectiveInstance(view, nodeDef);\n nodeData = <ProviderData>{instance};\n }\n if (nodeDef.flags & NodeFlags.Component) {\n const compView = asElementData(view, nodeDef.parent !.nodeIndex).componentView;\n initView(compView, nodeData.instance, nodeData.instance);\n }\n break;\n }\n case NodeFlags.TypePureArray:\n case NodeFlags.TypePureObject:\n case NodeFlags.TypePurePipe:\n nodeData = createPureExpression(view, nodeDef) as any;\n break;\n case NodeFlags.TypeContentQuery:\n case NodeFlags.TypeViewQuery:\n nodeData = createQuery() as any;\n break;\n case NodeFlags.TypeNgContent:\n appendNgContent(view, renderHost, nodeDef);\n // no runtime data needed for NgContent...\n nodeData = undefined;\n break;\n }\n nodes[i] = nodeData;\n }\n // Create the ViewData.nodes of component views after we created everything else,\n // so that e.g. ng-content works\n execComponentViewsAction(view, ViewAction.CreateViewNodes);\n\n // fill static content and view queries\n execQueriesAction(\n view, NodeFlags.TypeContentQuery | NodeFlags.TypeViewQuery, NodeFlags.StaticQuery,\n CheckType.CheckAndUpdate);\n}\n\nexport function checkNoChangesView(view: ViewData) {\n markProjectedViewsForCheck(view);\n Services.updateDirectives(view, CheckType.CheckNoChanges);\n execEmbeddedViewsAction(view, ViewAction.CheckNoChanges);\n Services.updateRenderer(view, CheckType.CheckNoChanges);\n execComponentViewsAction(view, ViewAction.CheckNoChanges);\n // Note: We don't check queries for changes as we didn't do this in v2.x.\n // TODO(tbosch): investigate if we can enable the check again in v5.x with a nicer error message.\n view.state &= ~(ViewState.CheckProjectedViews | ViewState.CheckProjectedView);\n}\n\nexport function checkAndUpdateView(view: ViewData) {\n if (view.state & ViewState.BeforeFirstCheck) {\n view.state &= ~ViewState.BeforeFirstCheck;\n view.state |= ViewState.FirstCheck;\n } else {\n view.state &= ~ViewState.FirstCheck;\n }\n shiftInitState(view, ViewState.InitState_BeforeInit, ViewState.InitState_CallingOnInit);\n markProjectedViewsForCheck(view);\n Services.updateDirectives(view, CheckType.CheckAndUpdate);\n execEmbeddedViewsAction(view, ViewAction.CheckAndUpdate);\n execQueriesAction(\n view, NodeFlags.TypeContentQuery, NodeFlags.DynamicQuery, CheckType.CheckAndUpdate);\n let callInit = shiftInitState(\n view, ViewState.InitState_CallingOnInit, ViewState.InitState_CallingAfterContentInit);\n callLifecycleHooksChildrenFirst(\n view, NodeFlags.AfterContentChecked | (callInit ? NodeFlags.AfterContentInit : 0));\n\n Services.updateRenderer(view, CheckType.CheckAndUpdate);\n\n execComponentViewsAction(view, ViewAction.CheckAndUpdate);\n execQueriesAction(\n view, NodeFlags.TypeViewQuery, NodeFlags.DynamicQuery, CheckType.CheckAndUpdate);\n callInit = shiftInitState(\n view, ViewState.InitState_CallingAfterContentInit, ViewState.InitState_CallingAfterViewInit);\n callLifecycleHooksChildrenFirst(\n view, NodeFlags.AfterViewChecked | (callInit ? NodeFlags.AfterViewInit : 0));\n\n if (view.def.flags & ViewFlags.OnPush) {\n view.state &= ~ViewState.ChecksEnabled;\n }\n view.state &= ~(ViewState.CheckProjectedViews | ViewState.CheckProjectedView);\n shiftInitState(view, ViewState.InitState_CallingAfterViewInit, ViewState.InitState_AfterInit);\n}\n\nexport function checkAndUpdateNode(\n view: ViewData, nodeDef: NodeDef, argStyle: ArgumentType, v0?: any, v1?: any, v2?: any,\n v3?: any, v4?: any, v5?: any, v6?: any, v7?: any, v8?: any, v9?: any): boolean {\n if (argStyle === ArgumentType.Inline) {\n return checkAndUpdateNodeInline(view, nodeDef, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);\n } else {\n return checkAndUpdateNodeDynamic(view, nodeDef, v0);\n }\n}\n\nfunction markProjectedViewsForCheck(view: ViewData) {\n const def = view.def;\n if (!(def.nodeFlags & NodeFlags.ProjectedTemplate)) {\n return;\n }\n for (let i = 0; i < def.nodes.length; i++) {\n const nodeDef = def.nodes[i];\n if (nodeDef.flags & NodeFlags.ProjectedTemplate) {\n const projectedViews = asElementData(view, i).template._projectedViews;\n if (projectedViews) {\n for (let i = 0; i < projectedViews.length; i++) {\n const projectedView = projectedViews[i];\n projectedView.state |= ViewState.CheckProjectedView;\n markParentViewsForCheckProjectedViews(projectedView, view);\n }\n }\n } else if ((nodeDef.childFlags & NodeFlags.ProjectedTemplate) === 0) {\n // a parent with leafs\n // no child is a component,\n // then skip the children\n i += nodeDef.childCount;\n }\n }\n}\n\nfunction checkAndUpdateNodeInline(\n view: ViewData, nodeDef: NodeDef, v0?: any, v1?: any, v2?: any, v3?: any, v4?: any, v5?: any,\n v6?: any, v7?: any, v8?: any, v9?: any): boolean {\n switch (nodeDef.flags & NodeFlags.Types) {\n case NodeFlags.TypeElement:\n return checkAndUpdateElementInline(view, nodeDef, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);\n case NodeFlags.TypeText:\n return checkAndUpdateTextInline(view, nodeDef, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);\n case NodeFlags.TypeDirective:\n return checkAndUpdateDirectiveInline(view, nodeDef, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);\n case NodeFlags.TypePureArray:\n case NodeFlags.TypePureObject:\n case NodeFlags.TypePurePipe:\n return checkAndUpdatePureExpressionInline(\n view, nodeDef, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);\n default:\n throw 'unreachable';\n }\n}\n\nfunction checkAndUpdateNodeDynamic(view: ViewData, nodeDef: NodeDef, values: any[]): boolean {\n switch (nodeDef.flags & NodeFlags.Types) {\n case NodeFlags.TypeElement:\n return checkAndUpdateElementDynamic(view, nodeDef, values);\n case NodeFlags.TypeText:\n return checkAndUpdateTextDynamic(view, nodeDef, values);\n case NodeFlags.TypeDirective:\n return checkAndUpdateDirectiveDynamic(view, nodeDef, values);\n case NodeFlags.TypePureArray:\n case NodeFlags.TypePureObject:\n case NodeFlags.TypePurePipe:\n return checkAndUpdatePureExpressionDynamic(view, nodeDef, values);\n default:\n throw 'unreachable';\n }\n}\n\nexport function checkNoChangesNode(\n view: ViewData, nodeDef: NodeDef, argStyle: ArgumentType, v0?: any, v1?: any, v2?: any,\n v3?: any, v4?: any, v5?: any, v6?: any, v7?: any, v8?: any, v9?: any): any {\n if (argStyle === ArgumentType.Inline) {\n checkNoChangesNodeInline(view, nodeDef, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);\n } else {\n checkNoChangesNodeDynamic(view, nodeDef, v0);\n }\n // Returning false is ok here as we would have thrown in case of a change.\n return false;\n}\n\nfunction checkNoChangesNodeInline(\n view: ViewData, nodeDef: NodeDef, v0: any, v1: any, v2: any, v3: any, v4: any, v5: any, v6: any,\n v7: any, v8: any, v9: any): void {\n const bindLen = nodeDef.bindings.length;\n if (bindLen > 0) checkBindingNoChanges(view, nodeDef, 0, v0);\n if (bindLen > 1) checkBindingNoChanges(view, nodeDef, 1, v1);\n if (bindLen > 2) checkBindingNoChanges(view, nodeDef, 2, v2);\n if (bindLen > 3) checkBindingNoChanges(view, nodeDef, 3, v3);\n if (bindLen > 4) checkBindingNoChanges(view, nodeDef, 4, v4);\n if (bindLen > 5) checkBindingNoChanges(view, nodeDef, 5, v5);\n if (bindLen > 6) checkBindingNoChanges(view, nodeDef, 6, v6);\n if (bindLen > 7) checkBindingNoChanges(view, nodeDef, 7, v7);\n if (bindLen > 8) checkBindingNoChanges(view, nodeDef, 8, v8);\n if (bindLen > 9) checkBindingNoChanges(view, nodeDef, 9, v9);\n}\n\nfunction checkNoChangesNodeDynamic(view: ViewData, nodeDef: NodeDef, values: any[]): void {\n for (let i = 0; i < values.length; i++) {\n checkBindingNoChanges(view, nodeDef, i, values[i]);\n }\n}\n\n/**\n * Workaround https://github.com/angular/tsickle/issues/497\n * @suppress {misplacedTypeAnnotation}\n */\nfunction checkNoChangesQuery(view: ViewData, nodeDef: NodeDef) {\n const queryList = asQueryList(view, nodeDef.nodeIndex);\n if (queryList.dirty) {\n throw expressionChangedAfterItHasBeenCheckedError(\n Services.createDebugContext(view, nodeDef.nodeIndex),\n `Query ${nodeDef.query!.id} not dirty`, `Query ${nodeDef.query!.id} dirty`,\n (view.state & ViewState.BeforeFirstCheck) !== 0);\n }\n}\n\nexport function destroyView(view: ViewData) {\n if (view.state & ViewState.Destroyed) {\n return;\n }\n execEmbeddedViewsAction(view, ViewAction.Destroy);\n execComponentViewsAction(view, ViewAction.Destroy);\n callLifecycleHooksChildrenFirst(view, NodeFlags.OnDestroy);\n if (view.disposables) {\n for (let i = 0; i < view.disposables.length; i++) {\n view.disposables[i]();\n }\n }\n detachProjectedView(view);\n if (view.renderer.destroyNode) {\n destroyViewNodes(view);\n }\n if (isComponentView(view)) {\n view.renderer.destroy();\n }\n view.state |= ViewState.Destroyed;\n}\n\nfunction destroyViewNodes(view: ViewData) {\n const len = view.def.nodes.length;\n for (let i = 0; i < len; i++) {\n const def = view.def.nodes[i];\n if (def.flags & NodeFlags.TypeElement) {\n view.renderer.destroyNode !(asElementData(view, i).renderElement);\n } else if (def.flags & NodeFlags.TypeText) {\n view.renderer.destroyNode !(asTextData(view, i).renderText);\n } else if (def.flags & NodeFlags.TypeContentQuery || def.flags & NodeFlags.TypeViewQuery) {\n asQueryList(view, i).destroy();\n }\n }\n}\n\nenum ViewAction {\n CreateViewNodes,\n CheckNoChanges,\n CheckNoChangesProjectedViews,\n CheckAndUpdate,\n CheckAndUpdateProjectedViews,\n Destroy\n}\n\nfunction execComponentViewsAction(view: ViewData, action: ViewAction) {\n const def = view.def;\n if (!(def.nodeFlags & NodeFlags.ComponentView)) {\n return;\n }\n for (let i = 0; i < def.nodes.length; i++) {\n const nodeDef = def.nodes[i];\n if (nodeDef.flags & NodeFlags.ComponentView) {\n // a leaf\n callViewAction(asElementData(view, i).componentView, action);\n } else if ((nodeDef.childFlags & NodeFlags.ComponentView) === 0) {\n // a parent with leafs\n // no child is a component,\n // then skip the children\n i += nodeDef.childCount;\n }\n }\n}\n\nfunction execEmbeddedViewsAction(view: ViewData, action: ViewAction) {\n const def = view.def;\n if (!(def.nodeFlags & NodeFlags.EmbeddedViews)) {\n return;\n }\n for (let i = 0; i < def.nodes.length; i++) {\n const nodeDef = def.nodes[i];\n if (nodeDef.flags & NodeFlags.EmbeddedViews) {\n // a leaf\n const embeddedViews = asElementData(view, i).viewContainer !._embeddedViews;\n for (let k = 0; k < embeddedViews.length; k++) {\n callViewAction(embeddedViews[k], action);\n }\n } else if ((nodeDef.childFlags & NodeFlags.EmbeddedViews) === 0) {\n // a parent with leafs\n // no child is a component,\n // then skip the children\n i += nodeDef.childCount;\n }\n }\n}\n\nfunction callViewAction(view: ViewData, action: ViewAction) {\n const viewState = view.state;\n switch (action) {\n case ViewAction.CheckNoChanges:\n if ((viewState & ViewState.Destroyed) === 0) {\n if ((viewState & ViewState.CatDetectChanges) === ViewState.CatDetectChanges) {\n checkNoChangesView(view);\n } else if (viewState & ViewState.CheckProjectedViews) {\n execProjectedViewsAction(view, ViewAction.CheckNoChangesProjectedViews);\n }\n }\n break;\n case ViewAction.CheckNoChangesProjectedViews:\n if ((viewState & ViewState.Destroyed) === 0) {\n if (viewState & ViewState.CheckProjectedView) {\n checkNoChangesView(view);\n } else if (viewState & ViewState.CheckProjectedViews) {\n execProjectedViewsAction(view, action);\n }\n }\n break;\n case ViewAction.CheckAndUpdate:\n if ((viewState & ViewState.Destroyed) === 0) {\n if ((viewState & ViewState.CatDetectChanges) === ViewState.CatDetectChanges) {\n checkAndUpdateView(view);\n } else if (viewState & ViewState.CheckProjectedViews) {\n execProjectedViewsAction(view, ViewAction.CheckAndUpdateProjectedViews);\n }\n }\n break;\n case ViewAction.CheckAndUpdateProjectedViews:\n if ((viewState & ViewState.Destroyed) === 0) {\n if (viewState & ViewState.CheckProjectedView) {\n checkAndUpdateView(view);\n } else if (viewState & ViewState.CheckProjectedViews) {\n execProjectedViewsAction(view, action);\n }\n }\n break;\n case ViewAction.Destroy:\n // Note: destroyView recurses over all views,\n // so we don't need to special case projected views here.\n destroyView(view);\n break;\n case ViewAction.CreateViewNodes:\n createViewNodes(view);\n break;\n }\n}\n\nfunction execProjectedViewsAction(view: ViewData, action: ViewAction) {\n execEmbeddedViewsAction(view, action);\n execComponentViewsAction(view, action);\n}\n\nfunction execQueriesAction(\n view: ViewData, queryFlags: NodeFlags, staticDynamicQueryFlag: NodeFlags,\n checkType: CheckType) {\n if (!(view.def.nodeFlags & queryFlags) || !(view.def.nodeFlags & staticDynamicQueryFlag)) {\n return;\n }\n const nodeCount = view.def.nodes.length;\n for (let i = 0; i < nodeCount; i++) {\n const nodeDef = view.def.nodes[i];\n if ((nodeDef.flags & queryFlags) && (nodeDef.flags & staticDynamicQueryFlag)) {\n Services.setCurrentNode(view, nodeDef.nodeIndex);\n switch (checkType) {\n case CheckType.CheckAndUpdate:\n checkAndUpdateQuery(view, nodeDef);\n break;\n case CheckType.CheckNoChanges:\n checkNoChangesQuery(view, nodeDef);\n break;\n }\n }\n if (!(nodeDef.childFlags & queryFlags) || !(nodeDef.childFlags & staticDynamicQueryFlag)) {\n // no child has a matching query\n // then skip the children\n i += nodeDef.childCount;\n }\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {isDevMode} from '../application_ref';\nimport {DebugElement, DebugNode, EventListener, getDebugNode, indexDebugNode, removeDebugNodeFromIndex} from '../debug/debug_node';\nimport {Injector} from '../di';\nimport {InjectableType} from '../di/injectable';\nimport {ErrorHandler} from '../error_handler';\nimport {ComponentFactory} from '../linker/component_factory';\nimport {NgModuleRef} from '../linker/ng_module_factory';\nimport {Renderer2, RendererFactory2, RendererStyleFlags2, RendererType2} from '../render/api';\nimport {Sanitizer} from '../sanitization/security';\nimport {Type} from '../type';\nimport {tokenKey} from '../view/util';\n\nimport {isViewDebugError, viewDestroyedError, viewWrappedDebugError} from './errors';\nimport {resolveDep} from './provider';\nimport {dirtyParentQueries, getQueryValue} from './query';\nimport {createInjector, createNgModuleRef, getComponentViewDefinitionFactory} from './refs';\nimport {ArgumentType, BindingFlags, CheckType, DebugContext, DepDef, ElementData, NgModuleDefinition, NgModuleProviderDef, NodeDef, NodeFlags, NodeLogger, ProviderOverride, RootData, Services, ViewData, ViewDefinition, ViewState, asElementData, asPureExpressionData} from './types';\nimport {NOOP, isComponentView, renderNode, resolveDefinition, splitDepsDsl, viewParentEl} from './util';\nimport {checkAndUpdateNode, checkAndUpdateView, checkNoChangesNode, checkNoChangesView, createComponentView, createEmbeddedView, createRootView, destroyView} from './view';\n\n\nlet initialized = false;\n\nexport function initServicesIfNeeded() {\n if (initialized) {\n return;\n }\n initialized = true;\n const services = isDevMode() ? createDebugServices() : createProdServices();\n Services.setCurrentNode = services.setCurrentNode;\n Services.createRootView = services.createRootView;\n Services.createEmbeddedView = services.createEmbeddedView;\n Services.createComponentView = services.createComponentView;\n Services.createNgModuleRef = services.createNgModuleRef;\n Services.overrideProvider = services.overrideProvider;\n Services.overrideComponentView = services.overrideComponentView;\n Services.clearOverrides = services.clearOverrides;\n Services.checkAndUpdateView = services.checkAndUpdateView;\n Services.checkNoChangesView = services.checkNoChangesView;\n Services.destroyView = services.destroyView;\n Services.resolveDep = resolveDep;\n Services.createDebugContext = services.createDebugContext;\n Services.handleEvent = services.handleEvent;\n Services.updateDirectives = services.updateDirectives;\n Services.updateRenderer = services.updateRenderer;\n Services.dirtyParentQueries = dirtyParentQueries;\n}\n\nfunction createProdServices() {\n return {\n setCurrentNode: () => {},\n createRootView: createProdRootView,\n createEmbeddedView: createEmbeddedView,\n createComponentView: createComponentView,\n createNgModuleRef: createNgModuleRef,\n overrideProvider: NOOP,\n overrideComponentView: NOOP,\n clearOverrides: NOOP,\n checkAndUpdateView: checkAndUpdateView,\n checkNoChangesView: checkNoChangesView,\n destroyView: destroyView,\n createDebugContext: (view: ViewData, nodeIndex: number) => new DebugContext_(view, nodeIndex),\n handleEvent: (view: ViewData, nodeIndex: number, eventName: string, event: any) =>\n view.def.handleEvent(view, nodeIndex, eventName, event),\n updateDirectives: (view: ViewData, checkType: CheckType) => view.def.updateDirectives(\n checkType === CheckType.CheckAndUpdate ? prodCheckAndUpdateNode :\n prodCheckNoChangesNode,\n view),\n updateRenderer: (view: ViewData, checkType: CheckType) => view.def.updateRenderer(\n checkType === CheckType.CheckAndUpdate ? prodCheckAndUpdateNode :\n prodCheckNoChangesNode,\n view),\n };\n}\n\nfunction createDebugServices() {\n return {\n setCurrentNode: debugSetCurrentNode,\n createRootView: debugCreateRootView,\n createEmbeddedView: debugCreateEmbeddedView,\n createComponentView: debugCreateComponentView,\n createNgModuleRef: debugCreateNgModuleRef,\n overrideProvider: debugOverrideProvider,\n overrideComponentView: debugOverrideComponentView,\n clearOverrides: debugClearOverrides,\n checkAndUpdateView: debugCheckAndUpdateView,\n checkNoChangesView: debugCheckNoChangesView,\n destroyView: debugDestroyView,\n createDebugContext: (view: ViewData, nodeIndex: number) => new DebugContext_(view, nodeIndex),\n handleEvent: debugHandleEvent,\n updateDirectives: debugUpdateDirectives,\n updateRenderer: debugUpdateRenderer,\n };\n}\n\nfunction createProdRootView(\n elInjector: Injector, projectableNodes: any[][], rootSelectorOrNode: string | any,\n def: ViewDefinition, ngModule: NgModuleRef<any>, context?: any): ViewData {\n const rendererFactory: RendererFactory2 = ngModule.injector.get(RendererFactory2);\n return createRootView(\n createRootData(elInjector, ngModule, rendererFactory, projectableNodes, rootSelectorOrNode),\n def, context);\n}\n\nfunction debugCreateRootView(\n elInjector: Injector, projectableNodes: any[][], rootSelectorOrNode: string | any,\n def: ViewDefinition, ngModule: NgModuleRef<any>, context?: any): ViewData {\n const rendererFactory: RendererFactory2 = ngModule.injector.get(RendererFactory2);\n const root = createRootData(\n elInjector, ngModule, new DebugRendererFactory2(rendererFactory), projectableNodes,\n rootSelectorOrNode);\n const defWithOverride = applyProviderOverridesToView(def);\n return callWithDebugContext(\n DebugAction.create, createRootView, null, [root, defWithOverride, context]);\n}\n\nfunction createRootData(\n elInjector: Injector, ngModule: NgModuleRef<any>, rendererFactory: RendererFactory2,\n projectableNodes: any[][], rootSelectorOrNode: any): RootData {\n const sanitizer = ngModule.injector.get(Sanitizer);\n const errorHandler = ngModule.injector.get(ErrorHandler);\n const renderer = rendererFactory.createRenderer(null, null);\n return {\n ngModule,\n injector: elInjector, projectableNodes,\n selectorOrNode: rootSelectorOrNode, sanitizer, rendererFactory, renderer, errorHandler\n };\n}\n\nfunction debugCreateEmbeddedView(\n parentView: ViewData, anchorDef: NodeDef, viewDef: ViewDefinition, context?: any): ViewData {\n const defWithOverride = applyProviderOverridesToView(viewDef);\n return callWithDebugContext(\n DebugAction.create, createEmbeddedView, null,\n [parentView, anchorDef, defWithOverride, context]);\n}\n\nfunction debugCreateComponentView(\n parentView: ViewData, nodeDef: NodeDef, viewDef: ViewDefinition, hostElement: any): ViewData {\n const overrideComponentView =\n viewDefOverrides.get(nodeDef.element !.componentProvider !.provider !.token);\n if (overrideComponentView) {\n viewDef = overrideComponentView;\n } else {\n viewDef = applyProviderOverridesToView(viewDef);\n }\n return callWithDebugContext(\n DebugAction.create, createComponentView, null, [parentView, nodeDef, viewDef, hostElement]);\n}\n\nfunction debugCreateNgModuleRef(\n moduleType: Type<any>, parentInjector: Injector, bootstrapComponents: Type<any>[],\n def: NgModuleDefinition): NgModuleRef<any> {\n const defWithOverride = applyProviderOverridesToNgModule(def);\n return createNgModuleRef(moduleType, parentInjector, bootstrapComponents, defWithOverride);\n}\n\nconst providerOverrides = new Map<any, ProviderOverride>();\nconst providerOverridesWithScope = new Map<InjectableType<any>, ProviderOverride>();\nconst viewDefOverrides = new Map<any, ViewDefinition>();\n\nfunction debugOverrideProvider(override: ProviderOverride) {\n providerOverrides.set(override.token, override);\n if (typeof override.token === 'function' && override.token.ngInjectableDef &&\n typeof override.token.ngInjectableDef.providedIn === 'function') {\n providerOverridesWithScope.set(override.token as InjectableType<any>, override);\n }\n}\n\nfunction debugOverrideComponentView(comp: any, compFactory: ComponentFactory<any>) {\n const hostViewDef = resolveDefinition(getComponentViewDefinitionFactory(compFactory));\n const compViewDef = resolveDefinition(hostViewDef.nodes[0].element !.componentView !);\n viewDefOverrides.set(comp, compViewDef);\n}\n\nfunction debugClearOverrides() {\n providerOverrides.clear();\n providerOverridesWithScope.clear();\n viewDefOverrides.clear();\n}\n\n// Notes about the algorithm:\n// 1) Locate the providers of an element and check if one of them was overwritten\n// 2) Change the providers of that element\n//\n// We only create new datastructures if we need to, to keep perf impact\n// reasonable.\nfunction applyProviderOverridesToView(def: ViewDefinition): ViewDefinition {\n if (providerOverrides.size === 0) {\n return def;\n }\n const elementIndicesWithOverwrittenProviders = findElementIndicesWithOverwrittenProviders(def);\n if (elementIndicesWithOverwrittenProviders.length === 0) {\n return def;\n }\n // clone the whole view definition,\n // as it maintains references between the nodes that are hard to update.\n def = def.factory !(() => NOOP);\n for (let i = 0; i < elementIndicesWithOverwrittenProviders.length; i++) {\n applyProviderOverridesToElement(def, elementIndicesWithOverwrittenProviders[i]);\n }\n return def;\n\n function findElementIndicesWithOverwrittenProviders(def: ViewDefinition): number[] {\n const elIndicesWithOverwrittenProviders: number[] = [];\n let lastElementDef: NodeDef|null = null;\n for (let i = 0; i < def.nodes.length; i++) {\n const nodeDef = def.nodes[i];\n if (nodeDef.flags & NodeFlags.TypeElement) {\n lastElementDef = nodeDef;\n }\n if (lastElementDef && nodeDef.flags & NodeFlags.CatProviderNoDirective &&\n providerOverrides.has(nodeDef.provider !.token)) {\n elIndicesWithOverwrittenProviders.push(lastElementDef !.nodeIndex);\n lastElementDef = null;\n }\n }\n return elIndicesWithOverwrittenProviders;\n }\n\n function applyProviderOverridesToElement(viewDef: ViewDefinition, elIndex: number) {\n for (let i = elIndex + 1; i < viewDef.nodes.length; i++) {\n const nodeDef = viewDef.nodes[i];\n if (nodeDef.flags & NodeFlags.TypeElement) {\n // stop at the next element\n return;\n }\n if (nodeDef.flags & NodeFlags.CatProviderNoDirective) {\n const provider = nodeDef.provider !;\n const override = providerOverrides.get(provider.token);\n if (override) {\n nodeDef.flags = (nodeDef.flags & ~NodeFlags.CatProviderNoDirective) | override.flags;\n provider.deps = splitDepsDsl(override.deps);\n provider.value = override.value;\n }\n }\n }\n }\n}\n\n// Notes about the algorithm:\n// We only create new datastructures if we need to, to keep perf impact\n// reasonable.\nfunction applyProviderOverridesToNgModule(def: NgModuleDefinition): NgModuleDefinition {\n const {hasOverrides, hasDeprecatedOverrides} = calcHasOverrides(def);\n if (!hasOverrides) {\n return def;\n }\n // clone the whole view definition,\n // as it maintains references between the nodes that are hard to update.\n def = def.factory !(() => NOOP);\n applyProviderOverrides(def);\n return def;\n\n function calcHasOverrides(def: NgModuleDefinition):\n {hasOverrides: boolean, hasDeprecatedOverrides: boolean} {\n let hasOverrides = false;\n let hasDeprecatedOverrides = false;\n if (providerOverrides.size === 0) {\n return {hasOverrides, hasDeprecatedOverrides};\n }\n def.providers.forEach(node => {\n const override = providerOverrides.get(node.token);\n if ((node.flags & NodeFlags.CatProviderNoDirective) && override) {\n hasOverrides = true;\n hasDeprecatedOverrides = hasDeprecatedOverrides || override.deprecatedBehavior;\n }\n });\n def.modules.forEach(module => {\n providerOverridesWithScope.forEach((override, token) => {\n if (token.ngInjectableDef.providedIn === module) {\n hasOverrides = true;\n hasDeprecatedOverrides = hasDeprecatedOverrides || override.deprecatedBehavior;\n }\n });\n });\n return {hasOverrides, hasDeprecatedOverrides};\n }\n\n function applyProviderOverrides(def: NgModuleDefinition) {\n for (let i = 0; i < def.providers.length; i++) {\n const provider = def.providers[i];\n if (hasDeprecatedOverrides) {\n // We had a bug where me made\n // all providers lazy. Keep this logic behind a flag\n // for migrating existing users.\n provider.flags |= NodeFlags.LazyProvider;\n }\n const override = providerOverrides.get(provider.token);\n if (override) {\n provider.flags = (provider.flags & ~NodeFlags.CatProviderNoDirective) | override.flags;\n provider.deps = splitDepsDsl(override.deps);\n provider.value = override.value;\n }\n }\n if (providerOverridesWithScope.size > 0) {\n let moduleSet = new Set<any>(def.modules);\n providerOverridesWithScope.forEach((override, token) => {\n if (moduleSet.has(token.ngInjectableDef.providedIn)) {\n let provider = {\n token: token,\n flags:\n override.flags | (hasDeprecatedOverrides ? NodeFlags.LazyProvider : NodeFlags.None),\n deps: splitDepsDsl(override.deps),\n value: override.value,\n index: def.providers.length,\n };\n def.providers.push(provider);\n def.providersByKey[tokenKey(token)] = provider;\n }\n });\n }\n }\n}\n\nfunction prodCheckAndUpdateNode(\n view: ViewData, checkIndex: number, argStyle: ArgumentType, v0?: any, v1?: any, v2?: any,\n v3?: any, v4?: any, v5?: any, v6?: any, v7?: any, v8?: any, v9?: any): any {\n const nodeDef = view.def.nodes[checkIndex];\n checkAndUpdateNode(view, nodeDef, argStyle, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);\n return (nodeDef.flags & NodeFlags.CatPureExpression) ?\n asPureExpressionData(view, checkIndex).value :\n undefined;\n}\n\nfunction prodCheckNoChangesNode(\n view: ViewData, checkIndex: number, argStyle: ArgumentType, v0?: any, v1?: any, v2?: any,\n v3?: any, v4?: any, v5?: any, v6?: any, v7?: any, v8?: any, v9?: any): any {\n const nodeDef = view.def.nodes[checkIndex];\n checkNoChangesNode(view, nodeDef, argStyle, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);\n return (nodeDef.flags & NodeFlags.CatPureExpression) ?\n asPureExpressionData(view, checkIndex).value :\n undefined;\n}\n\nfunction debugCheckAndUpdateView(view: ViewData) {\n return callWithDebugContext(DebugAction.detectChanges, checkAndUpdateView, null, [view]);\n}\n\nfunction debugCheckNoChangesView(view: ViewData) {\n return callWithDebugContext(DebugAction.checkNoChanges, checkNoChangesView, null, [view]);\n}\n\nfunction debugDestroyView(view: ViewData) {\n return callWithDebugContext(DebugAction.destroy, destroyView, null, [view]);\n}\n\nenum DebugAction {\n create,\n detectChanges,\n checkNoChanges,\n destroy,\n handleEvent\n}\n\nlet _currentAction: DebugAction;\nlet _currentView: ViewData;\nlet _currentNodeIndex: number|null;\n\nfunction debugSetCurrentNode(view: ViewData, nodeIndex: number | null) {\n _currentView = view;\n _currentNodeIndex = nodeIndex;\n}\n\nfunction debugHandleEvent(view: ViewData, nodeIndex: number, eventName: string, event: any) {\n debugSetCurrentNode(view, nodeIndex);\n return callWithDebugContext(\n DebugAction.handleEvent, view.def.handleEvent, null, [view, nodeIndex, eventName, event]);\n}\n\nfunction debugUpdateDirectives(view: ViewData, checkType: CheckType) {\n if (view.state & ViewState.Destroyed) {\n throw viewDestroyedError(DebugAction[_currentAction]);\n }\n debugSetCurrentNode(view, nextDirectiveWithBinding(view, 0));\n return view.def.updateDirectives(debugCheckDirectivesFn, view);\n\n function debugCheckDirectivesFn(\n view: ViewData, nodeIndex: number, argStyle: ArgumentType, ...values: any[]) {\n const nodeDef = view.def.nodes[nodeIndex];\n if (checkType === CheckType.CheckAndUpdate) {\n debugCheckAndUpdateNode(view, nodeDef, argStyle, values);\n } else {\n debugCheckNoChangesNode(view, nodeDef, argStyle, values);\n }\n if (nodeDef.flags & NodeFlags.TypeDirective) {\n debugSetCurrentNode(view, nextDirectiveWithBinding(view, nodeIndex));\n }\n return (nodeDef.flags & NodeFlags.CatPureExpression) ?\n asPureExpressionData(view, nodeDef.nodeIndex).value :\n undefined;\n }\n}\n\nfunction debugUpdateRenderer(view: ViewData, checkType: CheckType) {\n if (view.state & ViewState.Destroyed) {\n throw viewDestroyedError(DebugAction[_currentAction]);\n }\n debugSetCurrentNode(view, nextRenderNodeWithBinding(view, 0));\n return view.def.updateRenderer(debugCheckRenderNodeFn, view);\n\n function debugCheckRenderNodeFn(\n view: ViewData, nodeIndex: number, argStyle: ArgumentType, ...values: any[]) {\n const nodeDef = view.def.nodes[nodeIndex];\n if (checkType === CheckType.CheckAndUpdate) {\n debugCheckAndUpdateNode(view, nodeDef, argStyle, values);\n } else {\n debugCheckNoChangesNode(view, nodeDef, argStyle, values);\n }\n if (nodeDef.flags & NodeFlags.CatRenderNode) {\n debugSetCurrentNode(view, nextRenderNodeWithBinding(view, nodeIndex));\n }\n return (nodeDef.flags & NodeFlags.CatPureExpression) ?\n asPureExpressionData(view, nodeDef.nodeIndex).value :\n undefined;\n }\n}\n\nfunction debugCheckAndUpdateNode(\n view: ViewData, nodeDef: NodeDef, argStyle: ArgumentType, givenValues: any[]): void {\n const changed = (<any>checkAndUpdateNode)(view, nodeDef, argStyle, ...givenValues);\n if (changed) {\n const values = argStyle === ArgumentType.Dynamic ? givenValues[0] : givenValues;\n if (nodeDef.flags & NodeFlags.TypeDirective) {\n const bindingValues: {[key: string]: string} = {};\n for (let i = 0; i < nodeDef.bindings.length; i++) {\n const binding = nodeDef.bindings[i];\n const value = values[i];\n if (binding.flags & BindingFlags.TypeProperty) {\n bindingValues[normalizeDebugBindingName(binding.nonMinifiedName !)] =\n normalizeDebugBindingValue(value);\n }\n }\n const elDef = nodeDef.parent !;\n const el = asElementData(view, elDef.nodeIndex).renderElement;\n if (!elDef.element !.name) {\n // a comment.\n view.renderer.setValue(el, `bindings=${JSON.stringify(bindingValues, null, 2)}`);\n } else {\n // a regular element.\n for (let attr in bindingValues) {\n const value = bindingValues[attr];\n if (value != null) {\n view.renderer.setAttribute(el, attr, value);\n } else {\n view.renderer.removeAttribute(el, attr);\n }\n }\n }\n }\n }\n}\n\nfunction debugCheckNoChangesNode(\n view: ViewData, nodeDef: NodeDef, argStyle: ArgumentType, values: any[]): void {\n (<any>checkNoChangesNode)(view, nodeDef, argStyle, ...values);\n}\n\nfunction normalizeDebugBindingName(name: string) {\n // Attribute names with `$` (eg `x-y$`) are valid per spec, but unsupported by some browsers\n name = camelCaseToDashCase(name.replace(/[$@]/g, '_'));\n return `ng-reflect-${name}`;\n}\n\nconst CAMEL_CASE_REGEXP = /([A-Z])/g;\n\nfunction camelCaseToDashCase(input: string): string {\n return input.replace(CAMEL_CASE_REGEXP, (...m: any[]) => '-' + m[1].toLowerCase());\n}\n\nfunction normalizeDebugBindingValue(value: any): string {\n try {\n // Limit the size of the value as otherwise the DOM just gets polluted.\n return value != null ? value.toString().slice(0, 30) : value;\n } catch (e) {\n return '[ERROR] Exception while trying to serialize the value';\n }\n}\n\nfunction nextDirectiveWithBinding(view: ViewData, nodeIndex: number): number|null {\n for (let i = nodeIndex; i < view.def.nodes.length; i++) {\n const nodeDef = view.def.nodes[i];\n if (nodeDef.flags & NodeFlags.TypeDirective && nodeDef.bindings && nodeDef.bindings.length) {\n return i;\n }\n }\n return null;\n}\n\nfunction nextRenderNodeWithBinding(view: ViewData, nodeIndex: number): number|null {\n for (let i = nodeIndex; i < view.def.nodes.length; i++) {\n const nodeDef = view.def.nodes[i];\n if ((nodeDef.flags & NodeFlags.CatRenderNode) && nodeDef.bindings && nodeDef.bindings.length) {\n return i;\n }\n }\n return null;\n}\n\nclass DebugContext_ implements DebugContext {\n private nodeDef: NodeDef;\n private elView: ViewData;\n private elDef: NodeDef;\n constructor(public view: ViewData, public nodeIndex: number|null) {\n if (nodeIndex == null) {\n this.nodeIndex = nodeIndex = 0;\n }\n this.nodeDef = view.def.nodes[nodeIndex];\n let elDef = this.nodeDef;\n let elView = view;\n while (elDef && (elDef.flags & NodeFlags.TypeElement) === 0) {\n elDef = elDef.parent !;\n }\n if (!elDef) {\n while (!elDef && elView) {\n elDef = viewParentEl(elView) !;\n elView = elView.parent !;\n }\n }\n this.elDef = elDef;\n this.elView = elView;\n }\n private get elOrCompView() {\n // Has to be done lazily as we use the DebugContext also during creation of elements...\n return asElementData(this.elView, this.elDef.nodeIndex).componentView || this.view;\n }\n get injector(): Injector { return createInjector(this.elView, this.elDef); }\n get component(): any { return this.elOrCompView.component; }\n get context(): any { return this.elOrCompView.context; }\n get providerTokens(): any[] {\n const tokens: any[] = [];\n if (this.elDef) {\n for (let i = this.elDef.nodeIndex + 1; i <= this.elDef.nodeIndex + this.elDef.childCount;\n i++) {\n const childDef = this.elView.def.nodes[i];\n if (childDef.flags & NodeFlags.CatProvider) {\n tokens.push(childDef.provider !.token);\n }\n i += childDef.childCount;\n }\n }\n return tokens;\n }\n get references(): {[key: string]: any} {\n const references: {[key: string]: any} = {};\n if (this.elDef) {\n collectReferences(this.elView, this.elDef, references);\n\n for (let i = this.elDef.nodeIndex + 1; i <= this.elDef.nodeIndex + this.elDef.childCount;\n i++) {\n const childDef = this.elView.def.nodes[i];\n if (childDef.flags & NodeFlags.CatProvider) {\n collectReferences(this.elView, childDef, references);\n }\n i += childDef.childCount;\n }\n }\n return references;\n }\n get componentRenderElement() {\n const elData = findHostElement(this.elOrCompView);\n return elData ? elData.renderElement : undefined;\n }\n get renderNode(): any {\n return this.nodeDef.flags & NodeFlags.TypeText ? renderNode(this.view, this.nodeDef) :\n renderNode(this.elView, this.elDef);\n }\n logError(console: Console, ...values: any[]) {\n let logViewDef: ViewDefinition;\n let logNodeIndex: number;\n if (this.nodeDef.flags & NodeFlags.TypeText) {\n logViewDef = this.view.def;\n logNodeIndex = this.nodeDef.nodeIndex;\n } else {\n logViewDef = this.elView.def;\n logNodeIndex = this.elDef.nodeIndex;\n }\n // Note: we only generate a log function for text and element nodes\n // to make the generated code as small as possible.\n const renderNodeIndex = getRenderNodeIndex(logViewDef, logNodeIndex);\n let currRenderNodeIndex = -1;\n let nodeLogger: NodeLogger = () => {\n currRenderNodeIndex++;\n if (currRenderNodeIndex === renderNodeIndex) {\n return console.error.bind(console, ...values);\n } else {\n return NOOP;\n }\n };\n logViewDef.factory !(nodeLogger);\n if (currRenderNodeIndex < renderNodeIndex) {\n console.error('Illegal state: the ViewDefinitionFactory did not call the logger!');\n (<any>console.error)(...values);\n }\n }\n}\n\nfunction getRenderNodeIndex(viewDef: ViewDefinition, nodeIndex: number): number {\n let renderNodeIndex = -1;\n for (let i = 0; i <= nodeIndex; i++) {\n const nodeDef = viewDef.nodes[i];\n if (nodeDef.flags & NodeFlags.CatRenderNode) {\n renderNodeIndex++;\n }\n }\n return renderNodeIndex;\n}\n\nfunction findHostElement(view: ViewData): ElementData|null {\n while (view && !isComponentView(view)) {\n view = view.parent !;\n }\n if (view.parent) {\n return asElementData(view.parent, viewParentEl(view) !.nodeIndex);\n }\n return null;\n}\n\nfunction collectReferences(view: ViewData, nodeDef: NodeDef, references: {[key: string]: any}) {\n for (let refName in nodeDef.references) {\n references[refName] = getQueryValue(view, nodeDef, nodeDef.references[refName]);\n }\n}\n\nfunction callWithDebugContext(action: DebugAction, fn: any, self: any, args: any[]) {\n const oldAction = _currentAction;\n const oldView = _currentView;\n const oldNodeIndex = _currentNodeIndex;\n try {\n _currentAction = action;\n const result = fn.apply(self, args);\n _currentView = oldView;\n _currentNodeIndex = oldNodeIndex;\n _currentAction = oldAction;\n return result;\n } catch (e) {\n if (isViewDebugError(e) || !_currentView) {\n throw e;\n }\n throw viewWrappedDebugError(e, getCurrentDebugContext() !);\n }\n}\n\nexport function getCurrentDebugContext(): DebugContext|null {\n return _currentView ? new DebugContext_(_currentView, _currentNodeIndex) : null;\n}\n\n\nclass DebugRendererFactory2 implements RendererFactory2 {\n constructor(private delegate: RendererFactory2) {}\n\n createRenderer(element: any, renderData: RendererType2|null): Renderer2 {\n return new DebugRenderer2(this.delegate.createRenderer(element, renderData));\n }\n\n begin() {\n if (this.delegate.begin) {\n this.delegate.begin();\n }\n }\n end() {\n if (this.delegate.end) {\n this.delegate.end();\n }\n }\n\n whenRenderingDone(): Promise<any> {\n if (this.delegate.whenRenderingDone) {\n return this.delegate.whenRenderingDone();\n }\n return Promise.resolve(null);\n }\n}\n\n\nclass DebugRenderer2 implements Renderer2 {\n readonly data: {[key: string]: any};\n constructor(private delegate: Renderer2) { this.data = this.delegate.data; }\n\n destroyNode(node: any) {\n removeDebugNodeFromIndex(getDebugNode(node) !);\n if (this.delegate.destroyNode) {\n this.delegate.destroyNode(node);\n }\n }\n\n destroy() { this.delegate.destroy(); }\n\n createElement(name: string, namespace?: string): any {\n const el = this.delegate.createElement(name, namespace);\n const debugCtx = getCurrentDebugContext();\n if (debugCtx) {\n const debugEl = new DebugElement(el, null, debugCtx);\n debugEl.name = name;\n indexDebugNode(debugEl);\n }\n return el;\n }\n\n createComment(value: string): any {\n const comment = this.delegate.createComment(value);\n const debugCtx = getCurrentDebugContext();\n if (debugCtx) {\n indexDebugNode(new DebugNode(comment, null, debugCtx));\n }\n return comment;\n }\n\n createText(value: string): any {\n const text = this.delegate.createText(value);\n const debugCtx = getCurrentDebugContext();\n if (debugCtx) {\n indexDebugNode(new DebugNode(text, null, debugCtx));\n }\n return text;\n }\n\n appendChild(parent: any, newChild: any): void {\n const debugEl = getDebugNode(parent);\n const debugChildEl = getDebugNode(newChild);\n if (debugEl && debugChildEl && debugEl instanceof DebugElement) {\n debugEl.addChild(debugChildEl);\n }\n this.delegate.appendChild(parent, newChild);\n }\n\n insertBefore(parent: any, newChild: any, refChild: any): void {\n const debugEl = getDebugNode(parent);\n const debugChildEl = getDebugNode(newChild);\n const debugRefEl = getDebugNode(refChild) !;\n if (debugEl && debugChildEl && debugEl instanceof DebugElement) {\n debugEl.insertBefore(debugRefEl, debugChildEl);\n }\n\n this.delegate.insertBefore(parent, newChild, refChild);\n }\n\n removeChild(parent: any, oldChild: any): void {\n const debugEl = getDebugNode(parent);\n const debugChildEl = getDebugNode(oldChild);\n if (debugEl && debugChildEl && debugEl instanceof DebugElement) {\n debugEl.removeChild(debugChildEl);\n }\n this.delegate.removeChild(parent, oldChild);\n }\n\n selectRootElement(selectorOrNode: string|any): any {\n const el = this.delegate.selectRootElement(selectorOrNode);\n const debugCtx = getCurrentDebugContext();\n if (debugCtx) {\n indexDebugNode(new DebugElement(el, null, debugCtx));\n }\n return el;\n }\n\n setAttribute(el: any, name: string, value: string, namespace?: string): void {\n const debugEl = getDebugNode(el);\n if (debugEl && debugEl instanceof DebugElement) {\n const fullName = namespace ? namespace + ':' + name : name;\n debugEl.attributes[fullName] = value;\n }\n this.delegate.setAttribute(el, name, value, namespace);\n }\n\n removeAttribute(el: any, name: string, namespace?: string): void {\n const debugEl = getDebugNode(el);\n if (debugEl && debugEl instanceof DebugElement) {\n const fullName = namespace ? namespace + ':' + name : name;\n debugEl.attributes[fullName] = null;\n }\n this.delegate.removeAttribute(el, name, namespace);\n }\n\n addClass(el: any, name: string): void {\n const debugEl = getDebugNode(el);\n if (debugEl && debugEl instanceof DebugElement) {\n debugEl.classes[name] = true;\n }\n this.delegate.addClass(el, name);\n }\n\n removeClass(el: any, name: string): void {\n const debugEl = getDebugNode(el);\n if (debugEl && debugEl instanceof DebugElement) {\n debugEl.classes[name] = false;\n }\n this.delegate.removeClass(el, name);\n }\n\n setStyle(el: any, style: string, value: any, flags: RendererStyleFlags2): void {\n const debugEl = getDebugNode(el);\n if (debugEl && debugEl instanceof DebugElement) {\n debugEl.styles[style] = value;\n }\n this.delegate.setStyle(el, style, value, flags);\n }\n\n removeStyle(el: any, style: string, flags: RendererStyleFlags2): void {\n const debugEl = getDebugNode(el);\n if (debugEl && debugEl instanceof DebugElement) {\n debugEl.styles[style] = null;\n }\n this.delegate.removeStyle(el, style, flags);\n }\n\n setProperty(el: any, name: string, value: any): void {\n const debugEl = getDebugNode(el);\n if (debugEl && debugEl instanceof DebugElement) {\n debugEl.properties[name] = value;\n }\n this.delegate.setProperty(el, name, value);\n }\n\n listen(\n target: 'document'|'windows'|'body'|any, eventName: string,\n callback: (event: any) => boolean): () => void {\n if (typeof target !== 'string') {\n const debugEl = getDebugNode(target);\n if (debugEl) {\n debugEl.listeners.push(new EventListener(eventName, callback));\n }\n }\n\n return this.delegate.listen(target, eventName, callback);\n }\n\n parentNode(node: any): any { return this.delegate.parentNode(node); }\n nextSibling(node: any): any { return this.delegate.nextSibling(node); }\n setValue(node: any, value: string): void { return this.delegate.setValue(node, value); }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Injector} from '../di/injector';\nimport {ComponentFactory} from '../linker/component_factory';\nimport {NgModuleFactory, NgModuleRef} from '../linker/ng_module_factory';\nimport {Type} from '../type';\n\nimport {initServicesIfNeeded} from './services';\nimport {NgModuleDefinition, NgModuleDefinitionFactory, NgModuleProviderDef, ProviderOverride, Services, ViewDefinition} from './types';\nimport {resolveDefinition} from './util';\n\nexport function overrideProvider(override: ProviderOverride) {\n initServicesIfNeeded();\n return Services.overrideProvider(override);\n}\n\nexport function overrideComponentView(comp: Type<any>, componentFactory: ComponentFactory<any>) {\n initServicesIfNeeded();\n return Services.overrideComponentView(comp, componentFactory);\n}\n\nexport function clearOverrides() {\n initServicesIfNeeded();\n return Services.clearOverrides();\n}\n\n// Attention: this function is called as top level function.\n// Putting any logic in here will destroy closure tree shaking!\nexport function createNgModuleFactory(\n ngModuleType: Type<any>, bootstrapComponents: Type<any>[],\n defFactory: NgModuleDefinitionFactory): NgModuleFactory<any> {\n return new NgModuleFactory_(ngModuleType, bootstrapComponents, defFactory);\n}\n\nfunction cloneNgModuleDefinition(def: NgModuleDefinition): NgModuleDefinition {\n const providers = Array.from(def.providers);\n const modules = Array.from(def.modules);\n const providersByKey: {[tokenKey: string]: NgModuleProviderDef} = {};\n for (const key in def.providersByKey) {\n providersByKey[key] = def.providersByKey[key];\n }\n\n return {\n factory: def.factory,\n isRoot: def.isRoot, providers, modules, providersByKey,\n };\n}\n\nclass NgModuleFactory_ extends NgModuleFactory<any> {\n constructor(\n public readonly moduleType: Type<any>, private _bootstrapComponents: Type<any>[],\n private _ngModuleDefFactory: NgModuleDefinitionFactory) {\n // Attention: this ctor is called as top level function.\n // Putting any logic in here will destroy closure tree shaking!\n super();\n }\n\n create(parentInjector: Injector|null): NgModuleRef<any> {\n initServicesIfNeeded();\n // Clone the NgModuleDefinition so that any tree shakeable provider definition\n // added to this instance of the NgModuleRef doesn't affect the cached copy.\n // See https://github.com/angular/angular/issues/25018.\n const def = cloneNgModuleDefinition(resolveDefinition(this._ngModuleDefFactory));\n return Services.createNgModuleRef(\n this.moduleType, parentInjector || Injector.NULL, this._bootstrapComponents, def);\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport {anchorDef, elementDef} from './element';\nexport {clearOverrides, createNgModuleFactory, overrideComponentView, overrideProvider} from './entrypoint';\nexport {ngContentDef} from './ng_content';\nexport {moduleDef, moduleProvideDef} from './ng_module';\nexport {directiveDef, pipeDef, providerDef} from './provider';\nexport {pureArrayDef, pureObjectDef, purePipeDef} from './pure_expression';\nexport {queryDef} from './query';\nexport {ViewRef_, createComponentFactory, getComponentViewDefinitionFactory, nodeValue} from './refs';\nexport {initServicesIfNeeded} from './services';\nexport {textDef} from './text';\nexport {EMPTY_ARRAY, EMPTY_MAP, createRendererType2, elementEventFullName, inlineInterpolate, interpolate, rootRenderNodes, tokenKey, unwrapValue} from './util';\nexport {viewDef} from './view';\nexport {attachEmbeddedView, detachEmbeddedView, moveEmbeddedView} from './view_attach';\n\nexport * from './types';\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport {ALLOW_MULTIPLE_PLATFORMS as ɵALLOW_MULTIPLE_PLATFORMS} from './application_ref';\nexport {APP_ID_RANDOM_PROVIDER as ɵAPP_ID_RANDOM_PROVIDER} from './application_tokens';\nexport {defaultIterableDiffers as ɵdefaultIterableDiffers, defaultKeyValueDiffers as ɵdefaultKeyValueDiffers} from './change_detection/change_detection';\nexport {devModeEqual as ɵdevModeEqual} from './change_detection/change_detection_util';\nexport {isListLikeIterable as ɵisListLikeIterable} from './change_detection/change_detection_util';\nexport {ChangeDetectorStatus as ɵChangeDetectorStatus, isDefaultChangeDetectionStrategy as ɵisDefaultChangeDetectionStrategy} from './change_detection/constants';\nexport {Console as ɵConsole} from './console';\nexport {InjectableDef as ɵInjectableDef, InjectorDef as ɵInjectorDef} from './di/defs';\nexport {inject as ɵinject, setCurrentInjector as ɵsetCurrentInjector} from './di/injector';\nexport {APP_ROOT as ɵAPP_ROOT} from './di/scope';\nexport {ivyEnabled as ɵivyEnabled} from './ivy_switch';\nexport {ComponentFactory as ɵComponentFactory} from './linker/component_factory';\nexport {CodegenComponentFactoryResolver as ɵCodegenComponentFactoryResolver} from './linker/component_factory_resolver';\nexport {resolveComponentResources as ɵresolveComponentResources} from './metadata/resource_loading';\nexport {ReflectionCapabilities as ɵReflectionCapabilities} from './reflection/reflection_capabilities';\nexport {GetterFn as ɵGetterFn, MethodFn as ɵMethodFn, SetterFn as ɵSetterFn} from './reflection/types';\nexport {DirectRenderer as ɵDirectRenderer, RenderDebugInfo as ɵRenderDebugInfo} from './render/api';\nexport {_sanitizeHtml as ɵ_sanitizeHtml} from './sanitization/html_sanitizer';\nexport {_sanitizeStyle as ɵ_sanitizeStyle} from './sanitization/style_sanitizer';\nexport {_sanitizeUrl as ɵ_sanitizeUrl} from './sanitization/url_sanitizer';\nexport {global as ɵglobal, looseIdentical as ɵlooseIdentical, stringify as ɵstringify} from './util';\nexport {makeDecorator as ɵmakeDecorator} from './util/decorators';\nexport {isObservable as ɵisObservable, isPromise as ɵisPromise} from './util/lang';\nexport {clearOverrides as ɵclearOverrides, initServicesIfNeeded as ɵinitServicesIfNeeded, overrideComponentView as ɵoverrideComponentView, overrideProvider as ɵoverrideProvider} from './view/index';\nexport {NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR as ɵNOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR} from './view/provider';\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n// The functions in this file verify that the assumptions we are making\n// about state in an instruction are correct before implementing any logic.\n// They are meant only to be called in dev mode as sanity checks.\n\nexport function assertNumber(actual: any, msg: string) {\n if (typeof actual != 'number') {\n throwError(msg);\n }\n}\n\nexport function assertEqual<T>(actual: T, expected: T, msg: string) {\n if (actual != expected) {\n throwError(msg);\n }\n}\n\nexport function assertNotEqual<T>(actual: T, expected: T, msg: string) {\n if (actual == expected) {\n throwError(msg);\n }\n}\n\nexport function assertSame<T>(actual: T, expected: T, msg: string) {\n if (actual !== expected) {\n throwError(msg);\n }\n}\n\nexport function assertLessThan<T>(actual: T, expected: T, msg: string) {\n if (actual >= expected) {\n throwError(msg);\n }\n}\n\nexport function assertGreaterThan<T>(actual: T, expected: T, msg: string) {\n if (actual <= expected) {\n throwError(msg);\n }\n}\n\nexport function assertNotDefined<T>(actual: T, msg: string) {\n if (actual != null) {\n throwError(msg);\n }\n}\n\nexport function assertDefined<T>(actual: T, msg: string) {\n if (actual == null) {\n throwError(msg);\n }\n}\n\nexport function assertComponentType(\n actual: any,\n msg: string =\n 'Type passed in is not ComponentType, it does not have \\'ngComponentDef\\' property.') {\n if (!actual.ngComponentDef) {\n debugger;\n throwError(msg);\n }\n}\n\nfunction throwError(msg: string): never {\n debugger; // Left intentionally for better debugger experience.\n throw new Error(`ASSERTION ERROR: ${msg}`);\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Injector} from '../../di/injector';\nimport {QueryList} from '../../linker';\nimport {Sanitizer} from '../../sanitization/security';\n\nimport {LContainer} from './container';\nimport {ComponentQuery, ComponentTemplate, DirectiveDefInternal, DirectiveDefList, PipeDefInternal, PipeDefList} from './definition';\nimport {LContainerNode, LElementNode, LViewNode, TNode} from './node';\nimport {LQueries} from './query';\nimport {Renderer3} from './renderer';\n\n/** Size of LViewData's header. Necessary to adjust for it when setting slots. */\nexport const HEADER_OFFSET = 16;\n\n// Below are constants for LViewData indices to help us look up LViewData members\n// without having to remember the specific indices.\n// Uglify will inline these when minifying so there shouldn't be a cost.\nexport const TVIEW = 0;\nexport const PARENT = 1;\nexport const NEXT = 2;\nexport const QUERIES = 3;\nexport const FLAGS = 4;\nexport const HOST_NODE = 5;\nexport const BINDING_INDEX = 6;\nexport const DIRECTIVES = 7;\nexport const CLEANUP = 8;\nexport const CONTEXT = 9;\nexport const INJECTOR = 10;\nexport const RENDERER = 11;\nexport const SANITIZER = 12;\nexport const TAIL = 13;\nexport const CONTAINER_INDEX = 14;\nexport const CONTENT_QUERIES = 15;\n\n/**\n * `LViewData` stores all of the information needed to process the instructions as\n * they are invoked from the template. Each embedded view and component view has its\n * own `LViewData`. When processing a particular view, we set the `viewData` to that\n * `LViewData`. When that view is done processing, the `viewData` is set back to\n * whatever the original `viewData` was before (the parent `LViewData`).\n *\n * Keeping separate state for each view facilities view insertion / deletion, so we\n * don't have to edit the data array based on which views are present.\n */\nexport interface LViewData extends Array<any> {\n /**\n * The static data for this view. We need a reference to this so we can easily walk up the\n * node tree in DI and get the TView.data array associated with a node (where the\n * directive defs are stored).\n */\n [TVIEW]: TView;\n\n /**\n * The parent view is needed when we exit the view and must restore the previous\n * `LViewData`. Without this, the render method would have to keep a stack of\n * views as it is recursively rendering templates.\n */\n [PARENT]: LViewData|null;\n\n /**\n *\n * The next sibling LViewData or LContainer.\n *\n * Allows us to propagate between sibling view states that aren't in the same\n * container. Embedded views already have a node.next, but it is only set for\n * views in the same container. We need a way to link component views and views\n * across containers as well.\n */\n [NEXT]: LViewData|LContainer|null;\n\n /** Queries active for this view - nodes from a view are reported to those queries. */\n [QUERIES]: LQueries|null;\n\n /** Flags for this view. See LViewFlags for more info. */\n [FLAGS]: LViewFlags;\n\n /**\n * Pointer to the `LViewNode` or `LElementNode` which represents the root of the view.\n *\n * If `LViewNode`, this is an embedded view of a container. We need this to be able to\n * efficiently find the `LViewNode` when inserting the view into an anchor.\n *\n * If `LElementNode`, this is the LView of a component.\n */\n // TODO(kara): Replace with index\n [HOST_NODE]: LViewNode|LElementNode;\n\n /**\n * The binding index we should access next.\n *\n * This is stored so that bindings can continue where they left off\n * if a view is left midway through processing bindings (e.g. if there is\n * a setter that creates an embedded view, like in ngIf).\n */\n [BINDING_INDEX]: number;\n\n /**\n * An array of directive instances in the current view.\n *\n * These must be stored separately from LNodes because their presence is\n * unknown at compile-time and thus space cannot be reserved in data[].\n */\n // TODO: flatten into LViewData[]\n [DIRECTIVES]: any[]|null;\n\n /**\n * When a view is destroyed, listeners need to be released and outputs need to be\n * unsubscribed. This context array stores both listener functions wrapped with\n * their context and output subscription instances for a particular view.\n *\n * These change per LView instance, so they cannot be stored on TView. Instead,\n * TView.cleanup saves an index to the necessary context in this array.\n */\n // TODO: flatten into LViewData[]\n [CLEANUP]: any[]|null;\n\n /**\n * - For embedded views, the context with which to render the template.\n * - For root view of the root component the context contains change detection data.\n * - `null` otherwise.\n */\n [CONTEXT]: {}|RootContext|null;\n\n /** An optional Module Injector to be used as fall back after Element Injectors are consulted. */\n [INJECTOR]: Injector|null;\n\n /** Renderer to be used for this view. */\n [RENDERER]: Renderer3;\n\n /** An optional custom sanitizer. */\n [SANITIZER]: Sanitizer|null;\n\n /**\n * The last LViewData or LContainer beneath this LViewData in the hierarchy.\n *\n * The tail allows us to quickly add a new state to the end of the view list\n * without having to propagate starting from the first child.\n */\n // TODO: replace with global\n [TAIL]: LViewData|LContainer|null;\n\n /**\n * The index of the parent container's host node. Applicable only to embedded views that\n * have been inserted dynamically. Will be -1 for component views and inline views.\n *\n * This is necessary to jump from dynamically created embedded views to their parent\n * containers because their parent cannot be stored on the TViewNode (views may be inserted\n * in multiple containers, so the parent cannot be shared between view instances).\n */\n [CONTAINER_INDEX]: number;\n\n /**\n * Stores QueryLists associated with content queries of a directive. This data structure is\n * filled-in as part of a directive creation process and is later used to retrieve a QueryList to\n * be refreshed.\n */\n [CONTENT_QUERIES]: QueryList<any>[]|null;\n}\n\n/** Flags associated with an LView (saved in LViewData[FLAGS]) */\nexport const enum LViewFlags {\n /**\n * Whether or not the view is in creationMode.\n *\n * This must be stored in the view rather than using `data` as a marker so that\n * we can properly support embedded views. Otherwise, when exiting a child view\n * back into the parent view, `data` will be defined and `creationMode` will be\n * improperly reported as false.\n */\n CreationMode = 0b000001,\n\n /** Whether this view has default change detection strategy (checks always) or onPush */\n CheckAlways = 0b000010,\n\n /** Whether or not this view is currently dirty (needing check) */\n Dirty = 0b000100,\n\n /** Whether or not this view is currently attached to change detection tree. */\n Attached = 0b001000,\n\n /**\n * Whether or not the init hooks have run.\n *\n * If on, the init hooks haven't yet been run and should be executed by the first component that\n * runs OR the first cR() instruction that runs (so inits are run for the top level view before\n * any embedded views).\n */\n RunInit = 0b010000,\n\n /** Whether or not this view is destroyed. */\n Destroyed = 0b100000,\n}\n\n/**\n * The static data for an LView (shared between all templates of a\n * given type).\n *\n * Stored on the template function as ngPrivateData.\n */\nexport interface TView {\n /**\n * ID for inline views to determine whether a view is the same as the previous view\n * in a certain position. If it's not, we know the new view needs to be inserted\n * and the one that exists needs to be removed (e.g. if/else statements)\n *\n * If this is -1, then this is a component view or a dynamically created view.\n */\n readonly id: number;\n\n /**\n * The template function used to refresh the view of dynamically created views\n * and components. Will be null for inline views.\n */\n template: ComponentTemplate<{}>|null;\n\n /**\n * A function containing query-related instructions.\n */\n viewQuery: ComponentQuery<{}>|null;\n\n /**\n * Pointer to the `TNode` that represents the root of the view.\n *\n * If this is a `TNode` for an `LViewNode`, this is an embedded view of a container.\n * We need this pointer to be able to efficiently find this node when inserting the view\n * into an anchor.\n *\n * If this is a `TNode` for an `LElementNode`, this is the TView of a component.\n */\n node: TNode;\n\n /** Whether or not this template has been processed. */\n firstTemplatePass: boolean;\n\n /** Static data equivalent of LView.data[]. Contains TNodes. */\n data: TData;\n\n /**\n * The binding start index is the index at which the data array\n * starts to store bindings only. Saving this value ensures that we\n * will begin reading bindings at the correct point in the array when\n * we are in update mode.\n */\n bindingStartIndex: number;\n\n /**\n * Index of the host node of the first LView or LContainer beneath this LView in\n * the hierarchy.\n *\n * Necessary to store this so views can traverse through their nested views\n * to remove listeners and call onDestroy callbacks.\n *\n * For embedded views, we store the index of an LContainer's host rather than the first\n * LView to avoid managing splicing when views are added/removed.\n */\n childIndex: number;\n\n /**\n * Selector matches for a node are temporarily cached on the TView so the\n * DI system can eagerly instantiate directives on the same node if they are\n * created out of order. They are overwritten after each node.\n *\n * <div dirA dirB></div>\n *\n * e.g. DirA injects DirB, but DirA is created first. DI should instantiate\n * DirB when it finds that it's on the same node, but not yet created.\n *\n * Even indices: Directive defs\n * Odd indices:\n * - Null if the associated directive hasn't been instantiated yet\n * - Directive index, if associated directive has been created\n * - String, temporary 'CIRCULAR' token set while dependencies are being resolved\n */\n currentMatches: CurrentMatchesList|null;\n\n /**\n * Directive and component defs that have already been matched to nodes on\n * this view.\n *\n * Defs are stored at the same index in TView.directives[] as their instances\n * are stored in LView.directives[]. This simplifies lookup in DI.\n */\n directives: DirectiveDefList|null;\n\n /**\n * Full registry of directives and components that may be found in this view.\n *\n * It's necessary to keep a copy of the full def list on the TView so it's possible\n * to render template functions without a host component.\n */\n directiveRegistry: DirectiveDefList|null;\n\n /**\n * Full registry of pipes that may be found in this view.\n *\n * The property is either an array of `PipeDefs`s or a function which returns the array of\n * `PipeDefs`s. The function is necessary to be able to support forward declarations.\n *\n * It's necessary to keep a copy of the full def list on the TView so it's possible\n * to render template functions without a host component.\n */\n pipeRegistry: PipeDefList|null;\n\n /**\n * Array of ngOnInit and ngDoCheck hooks that should be executed for this view in\n * creation mode.\n *\n * Even indices: Directive index\n * Odd indices: Hook function\n */\n initHooks: HookData|null;\n\n /**\n * Array of ngDoCheck hooks that should be executed for this view in update mode.\n *\n * Even indices: Directive index\n * Odd indices: Hook function\n */\n checkHooks: HookData|null;\n\n /**\n * Array of ngAfterContentInit and ngAfterContentChecked hooks that should be executed\n * for this view in creation mode.\n *\n * Even indices: Directive index\n * Odd indices: Hook function\n */\n contentHooks: HookData|null;\n\n /**\n * Array of ngAfterContentChecked hooks that should be executed for this view in update\n * mode.\n *\n * Even indices: Directive index\n * Odd indices: Hook function\n */\n contentCheckHooks: HookData|null;\n\n /**\n * Array of ngAfterViewInit and ngAfterViewChecked hooks that should be executed for\n * this view in creation mode.\n *\n * Even indices: Directive index\n * Odd indices: Hook function\n */\n viewHooks: HookData|null;\n\n /**\n * Array of ngAfterViewChecked hooks that should be executed for this view in\n * update mode.\n *\n * Even indices: Directive index\n * Odd indices: Hook function\n */\n viewCheckHooks: HookData|null;\n\n /**\n * Array of ngOnDestroy hooks that should be executed when this view is destroyed.\n *\n * Even indices: Directive index\n * Odd indices: Hook function\n */\n destroyHooks: HookData|null;\n\n /**\n * Array of pipe ngOnDestroy hooks that should be executed when this view is destroyed.\n *\n * Even indices: Index of pipe in data\n * Odd indices: Hook function\n *\n * These must be stored separately from directive destroy hooks because their contexts\n * are stored in data.\n */\n pipeDestroyHooks: HookData|null;\n\n /**\n * When a view is destroyed, listeners need to be released and outputs need to be\n * unsubscribed. This cleanup array stores both listener data (in chunks of 4)\n * and output data (in chunks of 2) for a particular view. Combining the arrays\n * saves on memory (70 bytes per array) and on a few bytes of code size (for two\n * separate for loops).\n *\n * If it's a native DOM listener being stored:\n * 1st index is: event name to remove\n * 2nd index is: index of native element in LView.data[]\n * 3rd index is: index of wrapped listener function in LView.cleanupInstances[]\n * 4th index is: useCapture boolean\n *\n * If it's a renderer2 style listener or ViewRef destroy hook being stored:\n * 1st index is: index of the cleanup function in LView.cleanupInstances[]\n * 2nd index is: null\n *\n * If it's an output subscription or query list destroy hook:\n * 1st index is: output unsubscribe function / query list destroy function\n * 2nd index is: index of function context in LView.cleanupInstances[]\n */\n cleanup: any[]|null;\n\n /**\n * A list of directive and element indices for child components that will need to be\n * refreshed when the current view has finished its check.\n *\n * Even indices: Directive indices\n * Odd indices: Element indices (adjusted for LViewData header offset)\n */\n components: number[]|null;\n\n /**\n * A list of indices for child directives that have host bindings.\n *\n * Even indices: Directive indices\n * Odd indices: Element indices\n *\n * Element indices are NOT adjusted for LViewData header offset because\n * they will be fed into instructions that expect the raw index (e.g. elementProperty)\n */\n hostBindings: number[]|null;\n\n\n /**\n * A list of indices for child directives that have content queries.\n *\n * Even indices: Directive indices\n * Odd indices: Starting index of content queries (stored in CONTENT_QUERIES) for this directive\n */\n contentQueries: number[]|null;\n}\n\n/**\n * RootContext contains information which is shared for all components which\n * were bootstrapped with {@link renderComponent}.\n */\nexport interface RootContext {\n /**\n * A function used for scheduling change detection in the future. Usually\n * this is `requestAnimationFrame`.\n */\n scheduler: (workFn: () => void) => void;\n\n /**\n * A promise which is resolved when all components are considered clean (not dirty).\n *\n * This promise is overwritten every time a first call to {@link markDirty} is invoked.\n */\n clean: Promise<null>;\n\n /**\n * RootComponents - The components that were instantiated by the call to\n * {@link renderComponent}.\n */\n components: {}[];\n}\n\n/**\n * Array of hooks that should be executed for a view and their directive indices.\n *\n * Even indices: Directive index\n * Odd indices: Hook function\n */\nexport type HookData = (number | (() => void))[];\n\n/**\n * Static data that corresponds to the instance-specific data array on an LView.\n *\n * Each node's static data is stored in tData at the same index that it's stored\n * in the data array. Each pipe's definition is stored here at the same index\n * as its pipe instance in the data array. Any nodes that do not have static\n * data store a null value in tData to avoid a sparse array.\n */\nexport type TData = (TNode | PipeDefInternal<any>| null)[];\n\n/** Type for TView.currentMatches */\nexport type CurrentMatchesList = [DirectiveDefInternal<any>, (string | number | null)];\n\n// Note: This hack is necessary so we don't erroneously get a circular dependency\n// failure based on types.\nexport const unusedValueExportToPlacateAjd = 1;\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {assertEqual} from './assert';\nimport {DirectiveDefInternal} from './interfaces/definition';\nimport {TNodeFlags} from './interfaces/node';\nimport {DIRECTIVES, FLAGS, HookData, LViewData, LViewFlags, TView} from './interfaces/view';\n\n\n/**\n * If this is the first template pass, any ngOnInit or ngDoCheck hooks will be queued into\n * TView.initHooks during directiveCreate.\n *\n * The directive index and hook type are encoded into one number (1st bit: type, remaining bits:\n * directive index), then saved in the even indices of the initHooks array. The odd indices\n * hold the hook functions themselves.\n *\n * @param index The index of the directive in LViewData[DIRECTIVES]\n * @param hooks The static hooks map on the directive def\n * @param tView The current TView\n */\nexport function queueInitHooks(\n index: number, onInit: (() => void) | null, doCheck: (() => void) | null, tView: TView): void {\n ngDevMode &&\n assertEqual(tView.firstTemplatePass, true, 'Should only be called on first template pass');\n if (onInit) {\n (tView.initHooks || (tView.initHooks = [])).push(index, onInit);\n }\n\n if (doCheck) {\n (tView.initHooks || (tView.initHooks = [])).push(index, doCheck);\n (tView.checkHooks || (tView.checkHooks = [])).push(index, doCheck);\n }\n}\n\n/**\n * Loops through the directives on a node and queues all their hooks except ngOnInit\n * and ngDoCheck, which are queued separately in directiveCreate.\n */\nexport function queueLifecycleHooks(flags: number, tView: TView): void {\n if (tView.firstTemplatePass) {\n const start = flags >> TNodeFlags.DirectiveStartingIndexShift;\n const count = flags & TNodeFlags.DirectiveCountMask;\n const end = start + count;\n\n // It's necessary to loop through the directives at elementEnd() (rather than processing in\n // directiveCreate) so we can preserve the current hook order. Content, view, and destroy\n // hooks for projected components and directives must be called *before* their hosts.\n for (let i = start; i < end; i++) {\n const def: DirectiveDefInternal<any> = tView.directives ![i];\n queueContentHooks(def, tView, i);\n queueViewHooks(def, tView, i);\n queueDestroyHooks(def, tView, i);\n }\n }\n}\n\n/** Queues afterContentInit and afterContentChecked hooks on TView */\nfunction queueContentHooks(def: DirectiveDefInternal<any>, tView: TView, i: number): void {\n if (def.afterContentInit) {\n (tView.contentHooks || (tView.contentHooks = [])).push(i, def.afterContentInit);\n }\n\n if (def.afterContentChecked) {\n (tView.contentHooks || (tView.contentHooks = [])).push(i, def.afterContentChecked);\n (tView.contentCheckHooks || (tView.contentCheckHooks = [])).push(i, def.afterContentChecked);\n }\n}\n\n/** Queues afterViewInit and afterViewChecked hooks on TView */\nfunction queueViewHooks(def: DirectiveDefInternal<any>, tView: TView, i: number): void {\n if (def.afterViewInit) {\n (tView.viewHooks || (tView.viewHooks = [])).push(i, def.afterViewInit);\n }\n\n if (def.afterViewChecked) {\n (tView.viewHooks || (tView.viewHooks = [])).push(i, def.afterViewChecked);\n (tView.viewCheckHooks || (tView.viewCheckHooks = [])).push(i, def.afterViewChecked);\n }\n}\n\n/** Queues onDestroy hooks on TView */\nfunction queueDestroyHooks(def: DirectiveDefInternal<any>, tView: TView, i: number): void {\n if (def.onDestroy != null) {\n (tView.destroyHooks || (tView.destroyHooks = [])).push(i, def.onDestroy);\n }\n}\n\n/**\n * Calls onInit and doCheck calls if they haven't already been called.\n *\n * @param currentView The current view\n */\nexport function executeInitHooks(\n currentView: LViewData, tView: TView, creationMode: boolean): void {\n if (currentView[FLAGS] & LViewFlags.RunInit) {\n executeHooks(currentView[DIRECTIVES] !, tView.initHooks, tView.checkHooks, creationMode);\n currentView[FLAGS] &= ~LViewFlags.RunInit;\n }\n}\n\n/**\n * Iterates over afterViewInit and afterViewChecked functions and calls them.\n *\n * @param currentView The current view\n */\nexport function executeHooks(\n data: any[], allHooks: HookData | null, checkHooks: HookData | null,\n creationMode: boolean): void {\n const hooksToCall = creationMode ? allHooks : checkHooks;\n if (hooksToCall) {\n callHooks(data, hooksToCall);\n }\n}\n\n/**\n * Calls lifecycle hooks with their contexts, skipping init hooks if it's not\n * creation mode.\n *\n * @param currentView The current view\n * @param arr The array in which the hooks are found\n */\nexport function callHooks(data: any[], arr: HookData): void {\n for (let i = 0; i < arr.length; i += 2) {\n (arr[i + 1] as() => void).call(data[arr[i] as number]);\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n\ndeclare global {\n const ngDevMode: null|NgDevModePerfCounters;\n interface NgDevModePerfCounters {\n firstTemplatePass: number;\n tNode: number;\n tView: number;\n rendererCreateTextNode: number;\n rendererSetText: number;\n rendererCreateElement: number;\n rendererAddEventListener: number;\n rendererSetAttribute: number;\n rendererRemoveAttribute: number;\n rendererSetProperty: number;\n rendererSetClassName: number;\n rendererAddClass: number;\n rendererRemoveClass: number;\n rendererSetStyle: number;\n rendererRemoveStyle: number;\n rendererDestroy: number;\n rendererDestroyNode: number;\n rendererMoveNode: number;\n rendererRemoveNode: number;\n }\n}\n\ndeclare let global: any;\n\nexport function ngDevModeResetPerfCounters(): NgDevModePerfCounters {\n const newCounters: NgDevModePerfCounters = {\n firstTemplatePass: 0,\n tNode: 0,\n tView: 0,\n rendererCreateTextNode: 0,\n rendererSetText: 0,\n rendererCreateElement: 0,\n rendererAddEventListener: 0,\n rendererSetAttribute: 0,\n rendererRemoveAttribute: 0,\n rendererSetProperty: 0,\n rendererSetClassName: 0,\n rendererAddClass: 0,\n rendererRemoveClass: 0,\n rendererSetStyle: 0,\n rendererRemoveStyle: 0,\n rendererDestroy: 0,\n rendererDestroyNode: 0,\n rendererMoveNode: 0,\n rendererRemoveNode: 0,\n };\n // NOTE: Under Ivy we may have both window & global defined in the Node\n // environment since ensureDocument() in render3.ts sets global.window.\n if (typeof window != 'undefined') {\n // Make sure to refer to ngDevMode as ['ngDevMode'] for closure.\n (window as any)['ngDevMode'] = newCounters;\n }\n if (typeof global != 'undefined') {\n // Make sure to refer to ngDevMode as ['ngDevMode'] for closure.\n (global as any)['ngDevMode'] = newCounters;\n }\n if (typeof self != 'undefined') {\n // Make sure to refer to ngDevMode as ['ngDevMode'] for closure.\n (self as any)['ngDevMode'] = newCounters;\n }\n return newCounters;\n}\n\n/**\n * This checks to see if the `ngDevMode` has been set. If yes,\n * than we honor it, otherwise we default to dev mode with additional checks.\n *\n * The idea is that unless we are doing production build where we explicitly\n * set `ngDevMode == false` we should be helping the developer by providing\n * as much early warning and errors as possible.\n */\nif (typeof ngDevMode === 'undefined' || ngDevMode) {\n ngDevModeResetPerfCounters();\n}\n","\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {TNode} from './interfaces/node';\n\n/** Called when directives inject each other (creating a circular dependency) */\nexport function throwCyclicDependencyError(token: any): never {\n throw new Error(`Cannot instantiate cyclic dependency! ${token}`);\n}\n\n/** Called when there are multiple component selectors that match a given node */\nexport function throwMultipleComponentError(tNode: TNode): never {\n throw new Error(`Multiple components match node with tagname ${tNode.tagName}`);\n}\n\n/** Throws an ExpressionChangedAfterChecked error if checkNoChanges mode is on. */\nexport function throwErrorIfNoChangesMode(\n creationMode: boolean, checkNoChangesMode: boolean, oldValue: any, currValue: any): never|void {\n if (checkNoChangesMode) {\n let msg =\n `ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: '${oldValue}'. Current value: '${currValue}'.`;\n if (creationMode) {\n msg +=\n ` It seems like the view has been created after its parent and its children have been dirty checked.` +\n ` Has it been created in a change detection hook ?`;\n }\n // TODO: include debug context\n throw new Error(msg);\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {LElementNode, LViewNode} from './node';\nimport {LQueries} from './query';\nimport {LViewData, NEXT, PARENT, QUERIES} from './view';\n\n/**\n * Below are constants for LContainer indices to help us look up LContainer members\n * without having to remember the specific indices.\n * Uglify will inline these when minifying so there shouldn't be a cost.\n */\nexport const ACTIVE_INDEX = 0;\n// PARENT, NEXT, and QUERIES are indices 1, 2, and 3.\n// As we already have these constants in LViewData, we don't need to re-create them.\nexport const VIEWS = 4;\nexport const RENDER_PARENT = 5;\n\n/**\n * The state associated with an LContainerNode.\n *\n * This is an array so that its structure is closer to LViewData. This helps\n * when traversing the view tree (which is a mix of containers and component\n * views), so we can jump to viewOrContainer[NEXT] in the same way regardless\n * of type.\n */\nexport interface LContainer extends Array<any> {\n /**\n * The next active index in the views array to read or write to. This helps us\n * keep track of where we are in the views array.\n * In the case the LContainer is created for a ViewContainerRef,\n * it is set to null to identify this scenario, as indices are \"absolute\" in that case,\n * i.e. provided directly by the user of the ViewContainerRef API.\n */\n [ACTIVE_INDEX]: number|null;\n\n /**\n * Access to the parent view is necessary so we can propagate back\n * up from inside a container to parent[NEXT].\n */\n [PARENT]: LViewData|null;\n\n /**\n * This allows us to jump from a container to a sibling container or component\n * view with the same parent, so we can remove listeners efficiently.\n */\n [NEXT]: LViewData|LContainer|null;\n\n /**\n * Queries active for this container - all the views inserted to / removed from\n * this container are reported to queries referenced here.\n */\n [QUERIES]: LQueries|null;\n\n /**\n * A list of the container's currently active child views. Views will be inserted\n * here as they are added and spliced from here when they are removed. We need\n * to keep a record of current views so we know which views are already in the DOM\n * (and don't need to be re-added) and so we can remove views from the DOM when they\n * are no longer required.\n */\n [VIEWS]: LViewNode[];\n\n /**\n * Parent Element which will contain the location where all of the Views will be\n * inserted into to.\n *\n * If `renderParent` is `null` it is headless. This means that it is contained\n * in another `LViewNode` which in turn is contained in another `LContainerNode` and\n * therefore it does not yet have its own parent.\n *\n * If `renderParent` is not `null` then it may be:\n * - same as `LContainerNode.parent` in which case it is just a normal container.\n * - different from `LContainerNode.parent` in which case it has been re-projected.\n * In other words `LContainerNode.parent` is logical parent where as\n * `LContainer.projectedParent` is render parent.\n *\n * When views are inserted into `LContainerNode` then `renderParent` is:\n * - `null`, we are in `LViewNode` keep going up a hierarchy until actual\n * `renderParent` is found.\n * - not `null`, then use the `projectedParent.native` as the `RElement` to insert\n * `LViewNode`s into.\n */\n [RENDER_PARENT]: LElementNode|null;\n}\n\n// Note: This hack is necessary so we don't erroneously get a circular dependency\n// failure based on types.\nexport const unusedValueExportToPlacateAjd = 1;\n","\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n\n/**\n * Expresses a single CSS Selector.\n *\n * Beginning of array\n * - First index: element name\n * - Subsequent odd indices: attr keys\n * - Subsequent even indices: attr values\n *\n * After SelectorFlags.CLASS flag\n * - Class name values\n *\n * SelectorFlags.NOT flag\n * - Changes the mode to NOT\n * - Can be combined with other flags to set the element / attr / class mode\n *\n * e.g. SelectorFlags.NOT | SelectorFlags.ELEMENT\n *\n * Example:\n * Original: `div.foo.bar[attr1=val1][attr2]`\n * Parsed: ['div', 'attr1', 'val1', 'attr2', '', SelectorFlags.CLASS, 'foo', 'bar']\n *\n * Original: 'div[attr1]:not(.foo[attr2])\n * Parsed: [\n * 'div', 'attr1', '',\n * SelectorFlags.NOT | SelectorFlags.ATTRIBUTE 'attr2', '', SelectorFlags.CLASS, 'foo'\n * ]\n *\n * See more examples in node_selector_matcher_spec.ts\n */\nexport type CssSelector = (string | SelectorFlags)[];\n\n/**\n * A list of CssSelectors.\n *\n * A directive or component can have multiple selectors. This type is used for\n * directive defs so any of the selectors in the list will match that directive.\n *\n * Original: 'form, [ngForm]'\n * Parsed: [['form'], ['', 'ngForm', '']]\n */\nexport type CssSelectorList = CssSelector[];\n\n/** Flags used to build up CssSelectors */\nexport const enum SelectorFlags {\n /** Indicates this is the beginning of a new negative selector */\n NOT = 0b0001,\n\n /** Mode for matching attributes */\n ATTRIBUTE = 0b0010,\n\n /** Mode for matching tag names */\n ELEMENT = 0b0100,\n\n /** Mode for matching class names */\n CLASS = 0b1000,\n}\n\nexport const NG_PROJECT_AS_ATTR_NAME = 'ngProjectAs';\n\n// Note: This hack is necessary so we don't erroneously get a circular dependency\n// failure based on types.\nexport const unusedValueExportToPlacateAjd = 1;\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * The goal here is to make sure that the browser DOM API is the Renderer.\n * We do this by defining a subset of DOM API to be the renderer and than\n * use that time for rendering.\n *\n * At runtime we can than use the DOM api directly, in server or web-worker\n * it will be easy to implement such API.\n */\n\nimport {ViewEncapsulation} from '../../metadata/view';\nimport {RendererStyleFlags2, RendererType2} from '../../render/api';\n\n\n// TODO: cleanup once the code is merged in angular/angular\nexport enum RendererStyleFlags3 {\n Important = 1 << 0,\n DashCase = 1 << 1\n}\n\nexport type Renderer3 = ObjectOrientedRenderer3 | ProceduralRenderer3;\n\n/**\n * Object Oriented style of API needed to create elements and text nodes.\n *\n * This is the native browser API style, e.g. operations are methods on individual objects\n * like HTMLElement. With this style, no additional code is needed as a facade\n * (reducing payload size).\n * */\nexport interface ObjectOrientedRenderer3 {\n createComment(data: string): RComment;\n createElement(tagName: string): RElement;\n createElementNS(namespace: string, tagName: string): RElement;\n createTextNode(data: string): RText;\n\n querySelector(selectors: string): RElement|null;\n}\n\n/** Returns whether the `renderer` is a `ProceduralRenderer3` */\nexport function isProceduralRenderer(renderer: ProceduralRenderer3 | ObjectOrientedRenderer3):\n renderer is ProceduralRenderer3 {\n return !!((renderer as any).listen);\n}\n\n/**\n * Procedural style of API needed to create elements and text nodes.\n *\n * In non-native browser environments (e.g. platforms such as web-workers), this is the\n * facade that enables element manipulation. This also facilitates backwards compatibility\n * with Renderer2.\n */\nexport interface ProceduralRenderer3 {\n destroy(): void;\n createComment(value: string): RComment;\n createElement(name: string, namespace?: string|null): RElement;\n createText(value: string): RText;\n /**\n * This property is allowed to be null / undefined,\n * in which case the view engine won't call it.\n * This is used as a performance optimization for production mode.\n */\n destroyNode?: ((node: RNode) => void)|null;\n appendChild(parent: RElement, newChild: RNode): void;\n insertBefore(parent: RNode, newChild: RNode, refChild: RNode|null): void;\n removeChild(parent: RElement, oldChild: RNode): void;\n selectRootElement(selectorOrNode: string|any): RElement;\n\n setAttribute(el: RElement, name: string, value: string, namespace?: string|null): void;\n removeAttribute(el: RElement, name: string, namespace?: string|null): void;\n addClass(el: RElement, name: string): void;\n removeClass(el: RElement, name: string): void;\n setStyle(\n el: RElement, style: string, value: any,\n flags?: RendererStyleFlags2|RendererStyleFlags3): void;\n removeStyle(el: RElement, style: string, flags?: RendererStyleFlags2|RendererStyleFlags3): void;\n setProperty(el: RElement, name: string, value: any): void;\n setValue(node: RText, value: string): void;\n\n // TODO(misko): Deprecate in favor of addEventListener/removeEventListener\n listen(target: RNode, eventName: string, callback: (event: any) => boolean | void): () => void;\n}\n\nexport interface RendererFactory3 {\n createRenderer(hostElement: RElement|null, rendererType: RendererType2|null): Renderer3;\n begin?(): void;\n end?(): void;\n}\n\nexport const domRendererFactory3: RendererFactory3 = {\n createRenderer: (hostElement: RElement | null, rendererType: RendererType2 | null):\n Renderer3 => { return document;}\n};\n\n/** Subset of API needed for appending elements and text nodes. */\nexport interface RNode {\n removeChild(oldChild: RNode): void;\n\n /**\n * Insert a child node.\n *\n * Used exclusively for adding View root nodes into ViewAnchor location.\n */\n insertBefore(newChild: RNode, refChild: RNode|null, isViewRoot: boolean): void;\n\n /**\n * Append a child node.\n *\n * Used exclusively for building up DOM which are static (ie not View roots)\n */\n appendChild(newChild: RNode): RNode;\n}\n\n/**\n * Subset of API needed for writing attributes, properties, and setting up\n * listeners on Element.\n */\nexport interface RElement extends RNode {\n style: RCssStyleDeclaration;\n classList: RDomTokenList;\n className: string;\n setAttribute(name: string, value: string): void;\n removeAttribute(name: string): void;\n setAttributeNS(namespaceURI: string, qualifiedName: string, value: string): void;\n addEventListener(type: string, listener: EventListener, useCapture?: boolean): void;\n removeEventListener(type: string, listener?: EventListener, options?: boolean): void;\n\n setProperty?(name: string, value: any): void;\n}\n\nexport interface RCssStyleDeclaration {\n removeProperty(propertyName: string): string;\n setProperty(propertyName: string, value: string|null, priority?: string): void;\n}\n\nexport interface RDomTokenList {\n add(token: string): void;\n remove(token: string): void;\n}\n\nexport interface RText extends RNode { textContent: string|null; }\n\nexport interface RComment extends RNode {}\n\n// Note: This hack is necessary so we don't erroneously get a circular dependency\n// failure based on types.\nexport const unusedValueExportToPlacateAjd = 1;\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {assertDefined, assertEqual} from './assert';\nimport {LNode, TNodeType} from './interfaces/node';\n\nexport function assertNodeType(node: LNode, type: TNodeType) {\n assertDefined(node, 'should be called with a node');\n assertEqual(node.tNode.type, type, `should be a ${typeName(type)}`);\n}\n\nexport function assertNodeOfPossibleTypes(node: LNode, ...types: TNodeType[]) {\n assertDefined(node, 'should be called with a node');\n const found = types.some(type => node.tNode.type === type);\n assertEqual(found, true, `Should be one of ${types.map(typeName).join(', ')}`);\n}\n\nfunction typeName(type: TNodeType): string {\n if (type == TNodeType.Projection) return 'Projection';\n if (type == TNodeType.Container) return 'Container';\n if (type == TNodeType.View) return 'View';\n if (type == TNodeType.Element) return 'Element';\n return '<unknown>';\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {StylingContext} from '../styling';\n\nimport {LContainer} from './container';\nimport {LInjector} from './injector';\nimport {LQueries} from './query';\nimport {RComment, RElement, RText} from './renderer';\nimport {LViewData, TView} from './view';\n\n\n\n/**\n * TNodeType corresponds to the TNode.type property. It contains information\n * on how to map a particular set of bits in LNode.flags to the node type.\n */\nexport const enum TNodeType {\n Container = 0b00,\n Projection = 0b01,\n View = 0b10,\n Element = 0b11,\n ViewOrElement = 0b10,\n}\n\n/**\n * Corresponds to the TNode.flags property.\n */\nexport const enum TNodeFlags {\n /** The number of directives on this node is encoded on the least significant bits */\n DirectiveCountMask = 0b00000000000000000000111111111111,\n\n /** This bit is set if the node is a component */\n isComponent = 0b00000000000000000001000000000000,\n\n /** This bit is set if the node has been projected */\n isProjected = 0b00000000000000000010000000000000,\n\n /** The index of the first directive on this node is encoded on the most significant bits */\n DirectiveStartingIndexShift = 14,\n}\n\n/**\n * LNode is an internal data structure which is used for the incremental DOM algorithm.\n * The \"L\" stands for \"Logical\" to differentiate between `RNodes` (actual rendered DOM\n * node) and our logical representation of DOM nodes, `LNodes`.\n *\n * The data structure is optimized for speed and size.\n *\n * In order to be fast, all subtypes of `LNode` should have the same shape.\n * Because size of the `LNode` matters, many fields have multiple roles depending\n * on the `LNode` subtype.\n *\n * See: https://en.wikipedia.org/wiki/Inline_caching#Monomorphic_inline_caching\n *\n * NOTE: This is a private data structure and should not be exported by any of the\n * instructions.\n */\nexport interface LNode {\n /**\n * The associated DOM node. Storing this allows us to:\n * - append children to their element parents in the DOM (e.g. `parent.native.appendChild(...)`)\n * - retrieve the sibling elements of text nodes whose creation / insertion has been delayed\n */\n readonly native: RComment|RElement|RText|null;\n\n /**\n * If regular LElementNode, then `data` will be null.\n * If LElementNode with component, then `data` contains LView.\n * If LViewNode, then `data` contains the LView.\n * If LContainerNode, then `data` contains LContainer.\n * If LProjectionNode, then `data` contains LProjection.\n */\n readonly data: LViewData|LContainer|null;\n\n\n /**\n * Each node belongs to a view.\n *\n * When the injector is walking up a tree, it needs access to the `directives` (part of view).\n */\n readonly view: LViewData;\n\n /** The injector associated with this node. Necessary for DI. */\n nodeInjector: LInjector|null;\n\n /**\n * Optional set of queries that track query-related events for this node.\n *\n * If present the node creation/updates are reported to the `LQueries`.\n */\n queries: LQueries|null;\n\n /**\n * Pointer to the corresponding TNode object, which stores static\n * data about this node.\n */\n tNode: TNode;\n\n /**\n * A pointer to an LContainerNode created by directives requesting ViewContainerRef\n */\n // TODO(kara): Remove when removing LNodes\n dynamicLContainerNode: LContainerNode|null;\n}\n\n\n/** LNode representing an element. */\nexport interface LElementNode extends LNode {\n /** The DOM element associated with this node. */\n readonly native: RElement;\n\n /** If Component then data has LView (light DOM) */\n readonly data: LViewData|null;\n}\n\n/** LNode representing a #text node. */\nexport interface LTextNode extends LNode {\n /** The text node associated with this node. */\n native: RText;\n readonly data: null;\n dynamicLContainerNode: null;\n}\n\n/** Abstract node which contains root nodes of a view. */\nexport interface LViewNode extends LNode {\n readonly native: null;\n readonly data: LViewData;\n dynamicLContainerNode: null;\n}\n\n/** Abstract node container which contains other views. */\nexport interface LContainerNode extends LNode {\n /*\n * This comment node is appended to the container's parent element to mark where\n * in the DOM the container's child views should be added.\n *\n * If the container is a root node of a view, this comment will not be appended\n * until the parent view is processed.\n */\n native: RComment;\n readonly data: LContainer;\n}\n\n\nexport interface LProjectionNode extends LNode {\n readonly native: null;\n readonly data: null;\n dynamicLContainerNode: null;\n}\n\n/**\n * A set of marker values to be used in the attributes arrays. Those markers indicate that some\n * items are not regular attributes and the processing should be adapted accordingly.\n */\nexport const enum AttributeMarker {\n /**\n * Marker indicates that the following 3 values in the attributes array are:\n * namespaceUri, attributeName, attributeValue\n * in that order.\n */\n NamespaceURI = 0,\n\n /**\n * This marker indicates that the following attribute names were extracted from bindings (ex.:\n * [foo]=\"exp\") and / or event handlers (ex. (bar)=\"doSth()\").\n * Taking the above bindings and outputs as an example an attributes array could look as follows:\n * ['class', 'fade in', AttributeMarker.SelectOnly, 'foo', 'bar']\n */\n SelectOnly = 1\n}\n\n/**\n * A combination of:\n * - attribute names and values\n * - special markers acting as flags to alter attributes processing.\n */\nexport type TAttributes = (string | AttributeMarker)[];\n\n/**\n * LNode binding data (flyweight) for a particular node that is shared between all templates\n * of a specific type.\n *\n * If a property is:\n * - PropertyAliases: that property's data was generated and this is it\n * - Null: that property's data was already generated and nothing was found.\n * - Undefined: that property's data has not yet been generated\n *\n * see: https://en.wikipedia.org/wiki/Flyweight_pattern for more on the Flyweight pattern\n */\nexport interface TNode {\n /** The type of the TNode. See TNodeType. */\n type: TNodeType;\n\n /**\n * Index of the TNode in TView.data and corresponding LNode in LView.data.\n *\n * This is necessary to get from any TNode to its corresponding LNode when\n * traversing the node tree.\n *\n * If index is -1, this is a dynamically created container node or embedded view node.\n */\n index: number;\n\n /**\n * This number stores two values using its bits:\n *\n * - the number of directives on that node (first 12 bits)\n * - the starting index of the node's directives in the directives array (last 20 bits).\n *\n * These two values are necessary so DI can effectively search the directives associated\n * with a node without searching the whole directives array.\n */\n flags: TNodeFlags;\n\n /** The tag name associated with this node. */\n tagName: string|null;\n\n /**\n * Attributes associated with an element. We need to store attributes to support various use-cases\n * (attribute injection, content projection with selectors, directives matching).\n * Attributes are stored statically because reading them from the DOM would be way too slow for\n * content projection and queries.\n *\n * Since attrs will always be calculated first, they will never need to be marked undefined by\n * other instructions.\n *\n * For regular attributes a name of an attribute and its value alternate in the array.\n * e.g. ['role', 'checkbox']\n * This array can contain flags that will indicate \"special attributes\" (attributes with\n * namespaces, attributes extracted from bindings and outputs).\n */\n attrs: TAttributes|null;\n\n /**\n * A set of local names under which a given element is exported in a template and\n * visible to queries. An entry in this array can be created for different reasons:\n * - an element itself is referenced, ex.: `<div #foo>`\n * - a component is referenced, ex.: `<my-cmpt #foo>`\n * - a directive is referenced, ex.: `<my-cmpt #foo=\"directiveExportAs\">`.\n *\n * A given element might have different local names and those names can be associated\n * with a directive. We store local names at even indexes while odd indexes are reserved\n * for directive index in a view (or `-1` if there is no associated directive).\n *\n * Some examples:\n * - `<div #foo>` => `[\"foo\", -1]`\n * - `<my-cmpt #foo>` => `[\"foo\", myCmptIdx]`\n * - `<my-cmpt #foo #bar=\"directiveExportAs\">` => `[\"foo\", myCmptIdx, \"bar\", directiveIdx]`\n * - `<div #foo #bar=\"directiveExportAs\">` => `[\"foo\", -1, \"bar\", directiveIdx]`\n */\n localNames: (string|number)[]|null;\n\n /** Information about input properties that need to be set once from attribute data. */\n initialInputs: InitialInputData|null|undefined;\n\n /**\n * Input data for all directives on this node.\n *\n * - `undefined` means that the prop has not been initialized yet,\n * - `null` means that the prop has been initialized but no inputs have been found.\n */\n inputs: PropertyAliases|null|undefined;\n\n /**\n * Output data for all directives on this node.\n *\n * - `undefined` means that the prop has not been initialized yet,\n * - `null` means that the prop has been initialized but no outputs have been found.\n */\n outputs: PropertyAliases|null|undefined;\n\n /**\n * The TView or TViews attached to this node.\n *\n * If this TNode corresponds to an LContainerNode with inline views, the container will\n * need to store separate static data for each of its view blocks (TView[]). Otherwise,\n * nodes in inline views with the same index as nodes in their parent views will overwrite\n * each other, as they are in the same template.\n *\n * Each index in this array corresponds to the static data for a certain\n * view. So if you had V(0) and V(1) in a container, you might have:\n *\n * [\n * [{tagName: 'div', attrs: ...}, null], // V(0) TView\n * [{tagName: 'button', attrs ...}, null] // V(1) TView\n *\n * If this TNode corresponds to an LContainerNode with a template (e.g. structural\n * directive), the template's TView will be stored here.\n *\n * If this TNode corresponds to an LElementNode, tViews will be null .\n */\n tViews: TView|TView[]|null;\n\n /**\n * The next sibling node. Necessary so we can propagate through the root nodes of a view\n * to insert them or remove them from the DOM.\n */\n next: TNode|null;\n\n /**\n * First child of the current node.\n *\n * For component nodes, the child will always be a ContentChild (in same view).\n * For embedded view nodes, the child will be in their child view.\n */\n child: TNode|null;\n\n /**\n * Parent node (in the same view only).\n *\n * We need a reference to a node's parent so we can append the node to its parent's native\n * element at the appropriate time.\n *\n * If the parent would be in a different view (e.g. component host), this property will be null.\n * It's important that we don't try to cross component boundaries when retrieving the parent\n * because the parent will change (e.g. index, attrs) depending on where the component was\n * used (and thus shouldn't be stored on TNode). In these cases, we retrieve the parent through\n * LView.node instead (which will be instance-specific).\n *\n * If this is an inline view node (V), the parent will be its container.\n */\n parent: TElementNode|TContainerNode|null;\n\n /**\n * A pointer to a TContainerNode created by directives requesting ViewContainerRef\n */\n dynamicContainerNode: TNode|null;\n\n /**\n * If this node is part of an i18n block, it indicates whether this container is part of the DOM\n * If this node is not part of an i18n block, this field is null.\n */\n detached: boolean|null;\n\n stylingTemplate: StylingContext|null;\n /**\n * List of projected TNodes for a given component host element OR index into the said nodes.\n *\n * For easier discussion assume this example:\n * `<parent>`'s view definition:\n * ```\n * <child id=\"c1\">content1</child>\n * <child id=\"c2\"><span>content2</span></child>\n * ```\n * `<child>`'s view definition:\n * ```\n * <ng-content id=\"cont1\"></ng-content>\n * ```\n *\n * If `Array.isArray(projection)` then `TNode` is a host element:\n * - `projection` stores the content nodes which are to be projected.\n * - The nodes represent categories defined by the selector: For example:\n * `<ng-content/><ng-content select=\"abc\"/>` would represent the heads for `<ng-content/>`\n * and `<ng-content select=\"abc\"/>` respectively.\n * - The nodes we store in `projection` are heads only, we used `.next` to get their\n * siblings.\n * - The nodes `.next` is sorted/rewritten as part of the projection setup.\n * - `projection` size is equal to the number of projections `<ng-content>`. The size of\n * `c1` will be `1` because `<child>` has only one `<ng-content>`.\n * - we store `projection` with the host (`c1`, `c2`) rather than the `<ng-content>` (`cont1`)\n * because the same component (`<child>`) can be used in multiple locations (`c1`, `c2`) and as\n * a result have different set of nodes to project.\n * - without `projection` it would be difficult to efficiently traverse nodes to be projected.\n *\n * If `typeof projection == 'number'` then `TNode` is a `<ng-content>` element:\n * - `projection` is an index of the host's `projection`Nodes.\n * - This would return the first head node to project:\n * `getHost(currentTNode).projection[currentTNode.projection]`.\n * - When projecting nodes the parent node retrieved may be a `<ng-content>` node, in which case\n * the process is recursive in nature (not implementation).\n */\n projection: (TNode|null)[]|number|null;\n}\n\n/** Static data for an LElementNode */\nexport interface TElementNode extends TNode {\n /** Index in the data[] array */\n index: number;\n child: TElementNode|TTextNode|TContainerNode|TProjectionNode|null;\n /**\n * Element nodes will have parents unless they are the first node of a component or\n * embedded view (which means their parent is in a different view and must be\n * retrieved using LView.node).\n */\n parent: TElementNode|null;\n tViews: null;\n\n /**\n * If this is a component TNode with projection, this will be an array of projected\n * TNodes (see TNode.projection for more info). If it's a regular element node or a\n * component without projection, it will be null.\n */\n projection: (TNode|null)[]|null;\n}\n\n/** Static data for an LTextNode */\nexport interface TTextNode extends TNode {\n /** Index in the data[] array */\n index: number;\n child: null;\n /**\n * Text nodes will have parents unless they are the first node of a component or\n * embedded view (which means their parent is in a different view and must be\n * retrieved using LView.node).\n */\n parent: TElementNode|null;\n tViews: null;\n projection: null;\n}\n\n/** Static data for an LContainerNode */\nexport interface TContainerNode extends TNode {\n /**\n * Index in the data[] array.\n *\n * If it's -1, this is a dynamically created container node that isn't stored in\n * data[] (e.g. when you inject ViewContainerRef) .\n */\n index: number;\n child: null;\n\n /**\n * Container nodes will have parents unless:\n *\n * - They are the first node of a component or embedded view\n * - They are dynamically created\n */\n parent: TElementNode|null;\n tViews: TView|TView[]|null;\n projection: null;\n}\n\n/** Static data for an LViewNode */\nexport interface TViewNode extends TNode {\n /** If -1, it's a dynamically created view. Otherwise, it is the view block ID. */\n index: number;\n child: TElementNode|TTextNode|TContainerNode|TProjectionNode|null;\n parent: TContainerNode|null;\n tViews: null;\n projection: null;\n}\n\n/** Static data for an LProjectionNode */\nexport interface TProjectionNode extends TNode {\n /** Index in the data[] array */\n child: null;\n /**\n * Projection nodes will have parents unless they are the first node of a component\n * or embedded view (which means their parent is in a different view and must be\n * retrieved using LView.node).\n */\n parent: TElementNode|null;\n tViews: null;\n\n /** Index of the projection node. (See TNode.projection for more info.) */\n projection: number;\n}\n\n/**\n * This mapping is necessary so we can set input properties and output listeners\n * properly at runtime when property names are minified or aliased.\n *\n * Key: unminified / public input or output name\n * Value: array containing minified / internal name and related directive index\n *\n * The value must be an array to support inputs and outputs with the same name\n * on the same node.\n */\nexport type PropertyAliases = {\n // This uses an object map because using the Map type would be too slow\n [key: string]: PropertyAliasValue\n};\n\n/**\n * Store the runtime input or output names for all the directives.\n *\n * - Even indices: directive index\n * - Odd indices: minified / internal name\n *\n * e.g. [0, 'change-minified']\n */\nexport type PropertyAliasValue = (number | string)[];\n\n\n/**\n * This array contains information about input properties that\n * need to be set once from attribute data. It's ordered by\n * directive index (relative to element) so it's simple to\n * look up a specific directive's initial input data.\n *\n * Within each sub-array:\n *\n * Even indices: minified/internal input name\n * Odd indices: initial value\n *\n * If a directive on a node does not have any input properties\n * that should be set from attributes, its index is set to null\n * to avoid a sparse array.\n *\n * e.g. [null, ['role-min', 'button']]\n */\nexport type InitialInputData = (InitialInputs | null)[];\n\n/**\n * Used by InitialInputData to store input properties\n * that should be set once from attributes.\n *\n * Even indices: minified/internal input name\n * Odd indices: initial value\n *\n * e.g. ['role-min', 'button']\n */\nexport type InitialInputs = string[];\n\n// Note: This hack is necessary so we don't erroneously get a circular dependency\n// failure based on types.\nexport const unusedValueExportToPlacateAjd = 1;\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {assertLessThan} from './assert';\nimport {LElementNode} from './interfaces/node';\nimport {HEADER_OFFSET, LViewData} from './interfaces/view';\n\n\n/**\n* Must use this method for CD (instead of === ) since NaN !== NaN\n*/\nexport function isDifferent(a: any, b: any): boolean {\n // NaN is the only value that is not equal to itself so the first\n // test checks if both a and b are not NaN\n return !(a !== a && b !== b) && a !== b;\n}\n\nexport function stringify(value: any): string {\n if (typeof value == 'function') return value.name || value;\n if (typeof value == 'string') return value;\n if (value == null) return '';\n return '' + value;\n}\n\n/**\n * Function that throws a \"not implemented\" error so it's clear certain\n * behaviors/methods aren't yet ready.\n *\n * @returns Not implemented error\n */\nexport function notImplemented(): Error {\n return new Error('NotImplemented');\n}\n\n/**\n * Flattens an array in non-recursive way. Input arrays are not modified.\n */\nexport function flatten(list: any[]): any[] {\n const result: any[] = [];\n let i = 0;\n\n while (i < list.length) {\n const item = list[i];\n if (Array.isArray(item)) {\n if (item.length > 0) {\n list = item.concat(list.slice(i + 1));\n i = 0;\n } else {\n i++;\n }\n } else {\n result.push(item);\n i++;\n }\n }\n\n return result;\n}\n\n/** Retrieves a value from any `LViewData`. */\nexport function loadInternal<T>(index: number, arr: LViewData): T {\n ngDevMode && assertDataInRangeInternal(index + HEADER_OFFSET, arr);\n return arr[index + HEADER_OFFSET];\n}\n\nexport function assertDataInRangeInternal(index: number, arr: any[]) {\n assertLessThan(index, arr ? arr.length : 0, 'index expected to be a valid data index');\n}\n\n/** Retrieves an element value from the provided `viewData`.\n *\n * Elements that are read may be wrapped in a style context,\n * therefore reading the value may involve unwrapping that.\n */\nexport function loadElementInternal(index: number, arr: LViewData): LElementNode {\n const value = loadInternal<LElementNode>(index, arr);\n return readElementValue(value);\n}\n\nexport function readElementValue(value: LElementNode | any[]): LElementNode {\n return (Array.isArray(value) ? (value as any as any[])[0] : value) as LElementNode;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {assertDefined} from './assert';\nimport {callHooks} from './hooks';\nimport {LContainer, RENDER_PARENT, VIEWS, unusedValueExportToPlacateAjd as unused1} from './interfaces/container';\nimport {LContainerNode, LElementNode, LNode, LProjectionNode, LTextNode, LViewNode, TNode, TNodeFlags, TNodeType, unusedValueExportToPlacateAjd as unused2} from './interfaces/node';\nimport {unusedValueExportToPlacateAjd as unused3} from './interfaces/projection';\nimport {ProceduralRenderer3, RComment, RElement, RNode, RText, Renderer3, isProceduralRenderer, unusedValueExportToPlacateAjd as unused4} from './interfaces/renderer';\nimport {CLEANUP, CONTAINER_INDEX, DIRECTIVES, FLAGS, HEADER_OFFSET, HOST_NODE, HookData, LViewData, LViewFlags, NEXT, PARENT, QUERIES, RENDERER, TVIEW, unusedValueExportToPlacateAjd as unused5} from './interfaces/view';\nimport {assertNodeOfPossibleTypes, assertNodeType} from './node_assert';\nimport {readElementValue, stringify} from './util';\n\nconst unusedValueToPlacateAjd = unused1 + unused2 + unused3 + unused4 + unused5;\n\n/** Retrieves the sibling node for the given node. */\nexport function getNextLNode(node: LNode): LNode|null {\n // View nodes don't have TNodes, so their next must be retrieved through their LView.\n if (node.tNode.type === TNodeType.View) {\n const viewData = node.data as LViewData;\n return viewData[NEXT] ? (viewData[NEXT] as LViewData)[HOST_NODE] : null;\n }\n return node.tNode.next ? node.view[node.tNode.next.index] : null;\n}\n\n/** Retrieves the first child of a given node */\nexport function getChildLNode(node: LNode): LNode|null {\n if (node.tNode.child) {\n const viewData = node.tNode.type === TNodeType.View ? node.data as LViewData : node.view;\n return readElementValue(viewData[node.tNode.child.index]);\n }\n return null;\n}\n\n/** Retrieves the parent LNode of a given node. */\nexport function getParentLNode(node: LContainerNode | LElementNode | LTextNode | LProjectionNode):\n LElementNode|LViewNode;\nexport function getParentLNode(node: LViewNode): LContainerNode|null;\nexport function getParentLNode(node: LNode): LElementNode|LContainerNode|LViewNode|null;\nexport function getParentLNode(node: LNode): LElementNode|LContainerNode|LViewNode|null {\n if (node.tNode.index === -1 && node.tNode.type === TNodeType.View) {\n // This is a dynamically created view inside a dynamic container.\n // If the host index is -1, the view has not yet been inserted, so it has no parent.\n const containerHostIndex = (node.data as LViewData)[CONTAINER_INDEX];\n return containerHostIndex === -1 ? null : node.view[containerHostIndex].dynamicLContainerNode;\n }\n const parent = node.tNode.parent;\n return readElementValue(parent ? node.view[parent.index] : node.view[HOST_NODE]);\n}\n\nconst enum WalkLNodeTreeAction {\n /** node insert in the native environment */\n Insert = 0,\n\n /** node detach from the native environment */\n Detach = 1,\n\n /** node destruction using the renderer's API */\n Destroy = 2,\n}\n\n\n/**\n * Stack used to keep track of projection nodes in walkLNodeTree.\n *\n * This is deliberately created outside of walkLNodeTree to avoid allocating\n * a new array each time the function is called. Instead the array will be\n * re-used by each invocation. This works because the function is not reentrant.\n */\nconst projectionNodeStack: LProjectionNode[] = [];\n\n/**\n * Walks a tree of LNodes, applying a transformation on the LElement nodes, either only on the first\n * one found, or on all of them.\n *\n * @param startingNode the node from which the walk is started.\n * @param rootNode the root node considered. This prevents walking past that node.\n * @param action identifies the action to be performed on the LElement nodes.\n * @param renderer the current renderer.\n * @param renderParentNode Optional the render parent node to be set in all LContainerNodes found,\n * required for action modes Insert and Destroy.\n * @param beforeNode Optional the node before which elements should be added, required for action\n * Insert.\n */\nfunction walkLNodeTree(\n startingNode: LNode | null, rootNode: LNode, action: WalkLNodeTreeAction, renderer: Renderer3,\n renderParentNode?: LElementNode | null, beforeNode?: RNode | null) {\n let node: LNode|null = startingNode;\n let projectionNodeIndex = -1;\n while (node) {\n let nextNode: LNode|null = null;\n const parent = renderParentNode ? renderParentNode.native : null;\n const nodeType = node.tNode.type;\n if (nodeType === TNodeType.Element) {\n // Execute the action\n executeNodeAction(action, renderer, parent, node.native !, beforeNode);\n if (node.dynamicLContainerNode) {\n executeNodeAction(\n action, renderer, parent, node.dynamicLContainerNode.native !, beforeNode);\n }\n } else if (nodeType === TNodeType.Container) {\n executeNodeAction(action, renderer, parent, node.native !, beforeNode);\n const lContainerNode: LContainerNode = (node as LContainerNode);\n const childContainerData: LContainer = lContainerNode.dynamicLContainerNode ?\n lContainerNode.dynamicLContainerNode.data :\n lContainerNode.data;\n if (renderParentNode) {\n childContainerData[RENDER_PARENT] = renderParentNode;\n }\n nextNode =\n childContainerData[VIEWS].length ? getChildLNode(childContainerData[VIEWS][0]) : null;\n if (nextNode) {\n // When the walker enters a container, then the beforeNode has to become the local native\n // comment node.\n beforeNode = lContainerNode.dynamicLContainerNode ?\n lContainerNode.dynamicLContainerNode.native :\n lContainerNode.native;\n }\n } else if (nodeType === TNodeType.Projection) {\n const componentHost = findComponentHost(node.view);\n const head =\n (componentHost.tNode.projection as(TNode | null)[])[node.tNode.projection as number];\n\n projectionNodeStack[++projectionNodeIndex] = node as LProjectionNode;\n\n nextNode = head ? (componentHost.data as LViewData)[PARENT] ![head.index] : null;\n } else {\n // Otherwise look at the first child\n nextNode = getChildLNode(node as LViewNode);\n }\n\n if (nextNode === null) {\n nextNode = getNextLNode(node);\n\n // this last node was projected, we need to get back down to its projection node\n if (nextNode === null && (node.tNode.flags & TNodeFlags.isProjected)) {\n nextNode = getNextLNode(projectionNodeStack[projectionNodeIndex--] as LNode);\n }\n /**\n * Find the next node in the LNode tree, taking into account the place where a node is\n * projected (in the shadow DOM) rather than where it comes from (in the light DOM).\n *\n * If there is no sibling node, then it goes to the next sibling of the parent node...\n * until it reaches rootNode (at which point null is returned).\n */\n while (node && !nextNode) {\n node = getParentLNode(node);\n if (node === null || node === rootNode) return null;\n\n // When exiting a container, the beforeNode must be restored to the previous value\n if (!node.tNode.next && nodeType === TNodeType.Container) {\n beforeNode = node.native;\n }\n nextNode = getNextLNode(node);\n }\n }\n node = nextNode;\n }\n}\n\n\n/**\n * Given a current view, finds the nearest component's host (LElement).\n *\n * @param lViewData LViewData for which we want a host element node\n * @returns The host node\n */\nexport function findComponentHost(lViewData: LViewData): LElementNode {\n let viewRootLNode = lViewData[HOST_NODE];\n\n while (viewRootLNode.tNode.type === TNodeType.View) {\n ngDevMode && assertDefined(lViewData[PARENT], 'lViewData.parent');\n lViewData = lViewData[PARENT] !;\n viewRootLNode = lViewData[HOST_NODE];\n }\n\n ngDevMode && assertNodeType(viewRootLNode, TNodeType.Element);\n ngDevMode && assertDefined(viewRootLNode.data, 'node.data');\n\n return viewRootLNode as LElementNode;\n}\n\n/**\n * NOTE: for performance reasons, the possible actions are inlined within the function instead of\n * being passed as an argument.\n */\nfunction executeNodeAction(\n action: WalkLNodeTreeAction, renderer: Renderer3, parent: RElement | null,\n node: RComment | RElement | RText, beforeNode?: RNode | null) {\n if (action === WalkLNodeTreeAction.Insert) {\n isProceduralRenderer(renderer !) ?\n (renderer as ProceduralRenderer3).insertBefore(parent !, node, beforeNode as RNode | null) :\n parent !.insertBefore(node, beforeNode as RNode | null, true);\n } else if (action === WalkLNodeTreeAction.Detach) {\n isProceduralRenderer(renderer !) ?\n (renderer as ProceduralRenderer3).removeChild(parent !, node) :\n parent !.removeChild(node);\n } else if (action === WalkLNodeTreeAction.Destroy) {\n ngDevMode && ngDevMode.rendererDestroyNode++;\n (renderer as ProceduralRenderer3).destroyNode !(node);\n }\n}\n\nexport function createTextNode(value: any, renderer: Renderer3): RText {\n return isProceduralRenderer(renderer) ? renderer.createText(stringify(value)) :\n renderer.createTextNode(stringify(value));\n}\n\n/**\n * Adds or removes all DOM elements associated with a view.\n *\n * Because some root nodes of the view may be containers, we sometimes need\n * to propagate deeply into the nested containers to remove all elements in the\n * views beneath it.\n *\n * @param container The container to which the root view belongs\n * @param rootNode The view from which elements should be added or removed\n * @param insertMode Whether or not elements should be added (if false, removing)\n * @param beforeNode The node before which elements should be added, if insert mode\n */\nexport function addRemoveViewFromContainer(\n container: LContainerNode, rootNode: LViewNode, insertMode: true,\n beforeNode: RNode | null): void;\nexport function addRemoveViewFromContainer(\n container: LContainerNode, rootNode: LViewNode, insertMode: false): void;\nexport function addRemoveViewFromContainer(\n container: LContainerNode, rootNode: LViewNode, insertMode: boolean,\n beforeNode?: RNode | null): void {\n ngDevMode && assertNodeType(container, TNodeType.Container);\n ngDevMode && assertNodeType(rootNode, TNodeType.View);\n const parentNode = container.data[RENDER_PARENT];\n const parent = parentNode ? parentNode.native : null;\n if (parent) {\n let node: LNode|null = getChildLNode(rootNode);\n const renderer = container.view[RENDERER];\n walkLNodeTree(\n node, rootNode, insertMode ? WalkLNodeTreeAction.Insert : WalkLNodeTreeAction.Detach,\n renderer, parentNode, beforeNode);\n }\n}\n\n/**\n * Traverses down and up the tree of views and containers to remove listeners and\n * call onDestroy callbacks.\n *\n * Notes:\n * - Because it's used for onDestroy calls, it needs to be bottom-up.\n * - Must process containers instead of their views to avoid splicing\n * when views are destroyed and re-added.\n * - Using a while loop because it's faster than recursion\n * - Destroy only called on movement to sibling or movement to parent (laterally or up)\n *\n * @param rootView The view to destroy\n */\nexport function destroyViewTree(rootView: LViewData): void {\n // If the view has no children, we can clean it up and return early.\n if (rootView[TVIEW].childIndex === -1) {\n return cleanUpView(rootView);\n }\n let viewOrContainer: LViewData|LContainer|null = getLViewChild(rootView);\n\n while (viewOrContainer) {\n let next: LViewData|LContainer|null = null;\n\n if (viewOrContainer.length >= HEADER_OFFSET) {\n // If LViewData, traverse down to child.\n const view = viewOrContainer as LViewData;\n if (view[TVIEW].childIndex > -1) next = getLViewChild(view);\n } else {\n // If container, traverse down to its first LViewData.\n const container = viewOrContainer as LContainer;\n if (container[VIEWS].length) next = container[VIEWS][0].data;\n }\n\n if (next == null) {\n // Only clean up view when moving to the side or up, as destroy hooks\n // should be called in order from the bottom up.\n while (viewOrContainer && !viewOrContainer ![NEXT] && viewOrContainer !== rootView) {\n cleanUpView(viewOrContainer);\n viewOrContainer = getParentState(viewOrContainer, rootView);\n }\n cleanUpView(viewOrContainer || rootView);\n next = viewOrContainer && viewOrContainer ![NEXT];\n }\n viewOrContainer = next;\n }\n}\n\n/**\n * Inserts a view into a container.\n *\n * This adds the view to the container's array of active views in the correct\n * position. It also adds the view's elements to the DOM if the container isn't a\n * root node of another view (in that case, the view's elements will be added when\n * the container's parent view is added later).\n *\n * @param container The container into which the view should be inserted\n * @param viewNode The view to insert\n * @param index The index at which to insert the view\n * @returns The inserted view\n */\nexport function insertView(\n container: LContainerNode, viewNode: LViewNode, index: number): LViewNode {\n const state = container.data;\n const views = state[VIEWS];\n const lView = viewNode.data as LViewData;\n\n if (index > 0) {\n // This is a new view, we need to add it to the children.\n views[index - 1].data[NEXT] = lView;\n }\n\n if (index < views.length) {\n lView[NEXT] = views[index].data;\n views.splice(index, 0, viewNode);\n } else {\n views.push(viewNode);\n lView[NEXT] = null;\n }\n\n // Dynamically inserted views need a reference to their parent container'S host so it's\n // possible to jump from a view to its container's next when walking the node tree.\n if (viewNode.tNode.index === -1) {\n lView[CONTAINER_INDEX] = container.tNode.parent !.index;\n (viewNode as{view: LViewData}).view = container.view;\n }\n\n // Notify query that a new view has been added\n if (lView[QUERIES]) {\n lView[QUERIES] !.insertView(index);\n }\n\n // Sets the attached flag\n lView[FLAGS] |= LViewFlags.Attached;\n\n return viewNode;\n}\n\n/**\n * Detaches a view from a container.\n *\n * This method splices the view from the container's array of active views. It also\n * removes the view's elements from the DOM.\n *\n * @param container The container from which to detach a view\n * @param removeIndex The index of the view to detach\n * @returns The detached view\n */\nexport function detachView(container: LContainerNode, removeIndex: number): LViewNode {\n const views = container.data[VIEWS];\n const viewNode = views[removeIndex];\n if (removeIndex > 0) {\n views[removeIndex - 1].data[NEXT] = viewNode.data[NEXT] as LViewData;\n }\n views.splice(removeIndex, 1);\n if (!container.tNode.detached) {\n addRemoveViewFromContainer(container, viewNode, false);\n }\n // Notify query that view has been removed\n const removedLView = viewNode.data;\n if (removedLView[QUERIES]) {\n removedLView[QUERIES] !.removeView();\n }\n removedLView[CONTAINER_INDEX] = -1;\n (viewNode as{view: LViewData | null}).view = null;\n // Unsets the attached flag\n viewNode.data[FLAGS] &= ~LViewFlags.Attached;\n return viewNode;\n}\n\n/**\n * Removes a view from a container, i.e. detaches it and then destroys the underlying LView.\n *\n * @param container The container from which to remove a view\n * @param removeIndex The index of the view to remove\n * @returns The removed view\n */\nexport function removeView(container: LContainerNode, removeIndex: number): LViewNode {\n const viewNode = container.data[VIEWS][removeIndex];\n detachView(container, removeIndex);\n destroyLView(viewNode.data);\n return viewNode;\n}\n\n/** Gets the child of the given LViewData */\nexport function getLViewChild(viewData: LViewData): LViewData|LContainer|null {\n if (viewData[TVIEW].childIndex === -1) return null;\n\n const hostNode: LElementNode|LContainerNode = viewData[viewData[TVIEW].childIndex];\n\n return hostNode.data ? hostNode.data : (hostNode.dynamicLContainerNode as LContainerNode).data;\n}\n\n/**\n * A standalone function which destroys an LView,\n * conducting cleanup (e.g. removing listeners, calling onDestroys).\n *\n * @param view The view to be destroyed.\n */\nexport function destroyLView(view: LViewData) {\n const renderer = view[RENDERER];\n if (isProceduralRenderer(renderer) && renderer.destroyNode) {\n walkLNodeTree(view[HOST_NODE], view[HOST_NODE], WalkLNodeTreeAction.Destroy, renderer);\n }\n destroyViewTree(view);\n // Sets the destroyed flag\n view[FLAGS] |= LViewFlags.Destroyed;\n}\n\n/**\n * Determines which LViewOrLContainer to jump to when traversing back up the\n * tree in destroyViewTree.\n *\n * Normally, the view's parent LView should be checked, but in the case of\n * embedded views, the container (which is the view node's parent, but not the\n * LView's parent) needs to be checked for a possible next property.\n *\n * @param state The LViewOrLContainer for which we need a parent state\n * @param rootView The rootView, so we don't propagate too far up the view tree\n * @returns The correct parent LViewOrLContainer\n */\nexport function getParentState(state: LViewData | LContainer, rootView: LViewData): LViewData|\n LContainer|null {\n let node;\n if ((node = (state as LViewData) ![HOST_NODE]) && node.tNode.type === TNodeType.View) {\n // if it's an embedded view, the state needs to go up to the container, in case the\n // container has a next\n return getParentLNode(node) !.data as any;\n } else {\n // otherwise, use parent view for containers or component views\n return state[PARENT] === rootView ? null : state[PARENT];\n }\n}\n\n/**\n * Removes all listeners and call all onDestroys in a given view.\n *\n * @param view The LViewData to clean up\n */\nfunction cleanUpView(viewOrContainer: LViewData | LContainer): void {\n if ((viewOrContainer as LViewData)[TVIEW]) {\n const view = viewOrContainer as LViewData;\n removeListeners(view);\n executeOnDestroys(view);\n executePipeOnDestroys(view);\n // For component views only, the local renderer is destroyed as clean up time.\n if (view[TVIEW].id === -1 && isProceduralRenderer(view[RENDERER])) {\n ngDevMode && ngDevMode.rendererDestroy++;\n (view[RENDERER] as ProceduralRenderer3).destroy();\n }\n }\n}\n\n/** Removes listeners and unsubscribes from output subscriptions */\nfunction removeListeners(viewData: LViewData): void {\n const cleanup = viewData[TVIEW].cleanup !;\n if (cleanup != null) {\n for (let i = 0; i < cleanup.length - 1; i += 2) {\n if (typeof cleanup[i] === 'string') {\n // This is a listener with the native renderer\n const native = readElementValue(viewData[cleanup[i + 1]]).native;\n const listener = viewData[CLEANUP] ![cleanup[i + 2]];\n native.removeEventListener(cleanup[i], listener, cleanup[i + 3]);\n i += 2;\n } else if (typeof cleanup[i] === 'number') {\n // This is a listener with renderer2 (cleanup fn can be found by index)\n const cleanupFn = viewData[CLEANUP] ![cleanup[i]];\n cleanupFn();\n } else {\n // This is a cleanup function that is grouped with the index of its context\n const context = viewData[CLEANUP] ![cleanup[i + 1]];\n cleanup[i].call(context);\n }\n }\n viewData[CLEANUP] = null;\n }\n}\n\n/** Calls onDestroy hooks for this view */\nfunction executeOnDestroys(view: LViewData): void {\n const tView = view[TVIEW];\n let destroyHooks: HookData|null;\n if (tView != null && (destroyHooks = tView.destroyHooks) != null) {\n callHooks(view[DIRECTIVES] !, destroyHooks);\n }\n}\n\n/** Calls pipe destroy hooks for this view */\nfunction executePipeOnDestroys(viewData: LViewData): void {\n const pipeDestroyHooks = viewData[TVIEW] && viewData[TVIEW].pipeDestroyHooks;\n if (pipeDestroyHooks) {\n callHooks(viewData !, pipeDestroyHooks);\n }\n}\n\n/**\n * Returns whether a native element can be inserted into the given parent.\n *\n * There are two reasons why we may not be able to insert a element immediately.\n * - Projection: When creating a child content element of a component, we have to skip the\n * insertion because the content of a component will be projected.\n * `<component><content>delayed due to projection</content></component>`\n * - Parent container is disconnected: This can happen when we are inserting a view into\n * parent container, which itself is disconnected. For example the parent container is part\n * of a View which has not be inserted or is mare for projection but has not been inserted\n * into destination.\n *\n\n *\n * @param parent The parent where the child will be inserted into.\n * @param currentView Current LView being processed.\n * @return boolean Whether the child should be inserted now (or delayed until later).\n */\nexport function canInsertNativeNode(parent: LNode, currentView: LViewData): boolean {\n // We can only insert into a Component or View. Any other type should be an Error.\n ngDevMode && assertNodeOfPossibleTypes(parent, TNodeType.Element, TNodeType.View);\n\n if (parent.tNode.type === TNodeType.Element) {\n // Parent is an element.\n if (parent.view !== currentView) {\n // If the Parent view is not the same as current view than we are inserting across\n // Views. This happens when we insert a root element of the component view into\n // the component host element and it should always be eager.\n return true;\n }\n // Parent elements can be a component which may have projection.\n if (parent.data === null) {\n // Parent is a regular non-component element. We should eagerly insert into it\n // since we know that this relationship will never be broken.\n return true;\n } else {\n // Parent is a Component. Component's content nodes are not inserted immediately\n // because they will be projected, and so doing insert at this point would be wasteful.\n // Since the projection would than move it to its final destination.\n return false;\n }\n } else {\n // Parent is a View.\n ngDevMode && assertNodeType(parent, TNodeType.View);\n\n // Because we are inserting into a `View` the `View` may be disconnected.\n const grandParentContainer = getParentLNode(parent) as LContainerNode;\n if (grandParentContainer == null) {\n // The `View` is not inserted into a `Container` we have to delay insertion.\n return false;\n }\n ngDevMode && assertNodeType(grandParentContainer, TNodeType.Container);\n if (grandParentContainer.data[RENDER_PARENT] == null) {\n // The parent `Container` itself is disconnected. So we have to delay.\n return false;\n } else {\n // The parent `Container` is in inserted state, so we can eagerly insert into\n // this location.\n return true;\n }\n }\n}\n\n/**\n * Appends the `child` element to the `parent`.\n *\n * The element insertion might be delayed {@link canInsertNativeNode}.\n *\n * @param parent The parent to which to append the child\n * @param child The child that should be appended\n * @param currentView The current LView\n * @returns Whether or not the child was appended\n */\nexport function appendChild(parent: LNode, child: RNode | null, currentView: LViewData): boolean {\n if (child !== null && canInsertNativeNode(parent, currentView)) {\n const renderer = currentView[RENDERER];\n if (parent.tNode.type === TNodeType.View) {\n const container = getParentLNode(parent) as LContainerNode;\n const renderParent = container.data[RENDER_PARENT];\n const views = container.data[VIEWS];\n const index = views.indexOf(parent as LViewNode);\n const beforeNode =\n index + 1 < views.length ? (getChildLNode(views[index + 1]) !).native : container.native;\n isProceduralRenderer(renderer) ?\n renderer.insertBefore(renderParent !.native, child, beforeNode) :\n renderParent !.native.insertBefore(child, beforeNode, true);\n } else {\n isProceduralRenderer(renderer) ? renderer.appendChild(parent.native !as RElement, child) :\n parent.native !.appendChild(child);\n }\n return true;\n }\n return false;\n}\n\n/**\n * Removes the `child` element of the `parent` from the DOM.\n *\n * @param parent The parent from which to remove the child\n * @param child The child that should be removed\n * @param currentView The current LView\n * @returns Whether or not the child was removed\n */\nexport function removeChild(parent: LNode, child: RNode | null, currentView: LViewData): boolean {\n if (child !== null && canInsertNativeNode(parent, currentView)) {\n // We only remove the element if not in View or not projected.\n const renderer = currentView[RENDERER];\n isProceduralRenderer(renderer) ? renderer.removeChild(parent.native as RElement, child) :\n parent.native !.removeChild(child);\n return true;\n }\n return false;\n}\n\n/**\n * Appends a projected node to the DOM, or in the case of a projected container,\n * appends the nodes from all of the container's active views to the DOM.\n *\n * @param node The node to process\n * @param currentParent The last parent element to be processed\n * @param currentView Current LView\n */\nexport function appendProjectedNode(\n node: LElementNode | LTextNode | LContainerNode, currentParent: LElementNode | LViewNode,\n currentView: LViewData, renderParent: LElementNode): void {\n appendChild(currentParent, node.native, currentView);\n if (node.tNode.type === TNodeType.Container) {\n // The node we are adding is a container and we are adding it to an element which\n // is not a component (no more re-projection).\n // Alternatively a container is projected at the root of a component's template\n // and can't be re-projected (as not content of any component).\n // Assign the final projection location in those cases.\n const lContainer = (node as LContainerNode).data;\n lContainer[RENDER_PARENT] = renderParent;\n const views = lContainer[VIEWS];\n for (let i = 0; i < views.length; i++) {\n addRemoveViewFromContainer(node as LContainerNode, views[i], true, node.native);\n }\n }\n if (node.dynamicLContainerNode) {\n node.dynamicLContainerNode.data[RENDER_PARENT] = renderParent;\n appendChild(currentParent, node.dynamicLContainerNode.native, currentView);\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport './ng_dev_mode';\n\nimport {assertDefined, assertNotEqual} from './assert';\nimport {AttributeMarker, TAttributes, TNode, unusedValueExportToPlacateAjd as unused1} from './interfaces/node';\nimport {CssSelector, CssSelectorList, NG_PROJECT_AS_ATTR_NAME, SelectorFlags, unusedValueExportToPlacateAjd as unused2} from './interfaces/projection';\n\nconst unusedValueToPlacateAjd = unused1 + unused2;\n\nfunction isCssClassMatching(nodeClassAttrVal: string, cssClassToMatch: string): boolean {\n const nodeClassesLen = nodeClassAttrVal.length;\n const matchIndex = nodeClassAttrVal !.indexOf(cssClassToMatch);\n const matchEndIdx = matchIndex + cssClassToMatch.length;\n if (matchIndex === -1 // no match\n || (matchIndex > 0 && nodeClassAttrVal ![matchIndex - 1] !== ' ') // no space before\n ||\n (matchEndIdx < nodeClassesLen && nodeClassAttrVal ![matchEndIdx] !== ' ')) // no space after\n {\n return false;\n }\n return true;\n}\n\n/**\n * A utility function to match an Ivy node static data against a simple CSS selector\n *\n * @param node static data to match\n * @param selector\n * @returns true if node matches the selector.\n */\nexport function isNodeMatchingSelector(tNode: TNode, selector: CssSelector): boolean {\n ngDevMode && assertDefined(selector[0], 'Selector should have a tag name');\n\n let mode: SelectorFlags = SelectorFlags.ELEMENT;\n const nodeAttrs = tNode.attrs !;\n const selectOnlyMarkerIdx = nodeAttrs ? nodeAttrs.indexOf(AttributeMarker.SelectOnly) : -1;\n\n // When processing \":not\" selectors, we skip to the next \":not\" if the\n // current one doesn't match\n let skipToNextSelector = false;\n\n for (let i = 0; i < selector.length; i++) {\n const current = selector[i];\n if (typeof current === 'number') {\n // If we finish processing a :not selector and it hasn't failed, return false\n if (!skipToNextSelector && !isPositive(mode) && !isPositive(current as number)) {\n return false;\n }\n // If we are skipping to the next :not() and this mode flag is positive,\n // it's a part of the current :not() selector, and we should keep skipping\n if (skipToNextSelector && isPositive(current)) continue;\n skipToNextSelector = false;\n mode = (current as number) | (mode & SelectorFlags.NOT);\n continue;\n }\n\n if (skipToNextSelector) continue;\n\n if (mode & SelectorFlags.ELEMENT) {\n mode = SelectorFlags.ATTRIBUTE | mode & SelectorFlags.NOT;\n if (current !== '' && current !== tNode.tagName) {\n if (isPositive(mode)) return false;\n skipToNextSelector = true;\n }\n } else {\n const attrName = mode & SelectorFlags.CLASS ? 'class' : current;\n const attrIndexInNode = findAttrIndexInNode(attrName, nodeAttrs);\n\n if (attrIndexInNode === -1) {\n if (isPositive(mode)) return false;\n skipToNextSelector = true;\n continue;\n }\n\n const selectorAttrValue = mode & SelectorFlags.CLASS ? current : selector[++i];\n if (selectorAttrValue !== '') {\n let nodeAttrValue: string;\n const maybeAttrName = nodeAttrs[attrIndexInNode];\n if (selectOnlyMarkerIdx > -1 && attrIndexInNode > selectOnlyMarkerIdx) {\n nodeAttrValue = '';\n } else {\n ngDevMode && assertNotEqual(\n maybeAttrName, AttributeMarker.NamespaceURI,\n 'We do not match directives on namespaced attributes');\n nodeAttrValue = nodeAttrs[attrIndexInNode + 1] as string;\n }\n if (mode & SelectorFlags.CLASS &&\n !isCssClassMatching(nodeAttrValue as string, selectorAttrValue as string) ||\n mode & SelectorFlags.ATTRIBUTE && selectorAttrValue !== nodeAttrValue) {\n if (isPositive(mode)) return false;\n skipToNextSelector = true;\n }\n }\n }\n }\n\n return isPositive(mode) || skipToNextSelector;\n}\n\nfunction isPositive(mode: SelectorFlags): boolean {\n return (mode & SelectorFlags.NOT) === 0;\n}\n\n/**\n * Examines an attributes definition array from a node to find the index of the\n * attribute with the specified name.\n *\n * NOTE: Will not find namespaced attributes.\n *\n * @param name the name of the attribute to find\n * @param attrs the attribute array to examine\n */\nfunction findAttrIndexInNode(name: string, attrs: TAttributes | null): number {\n if (attrs === null) return -1;\n let selectOnlyMode = false;\n let i = 0;\n while (i < attrs.length) {\n const maybeAttrName = attrs[i];\n if (maybeAttrName === name) {\n return i;\n } else if (maybeAttrName === AttributeMarker.NamespaceURI) {\n // NOTE(benlesh): will not find namespaced attributes. This is by design.\n i += 4;\n } else {\n if (maybeAttrName === AttributeMarker.SelectOnly) {\n selectOnlyMode = true;\n }\n i += selectOnlyMode ? 1 : 2;\n }\n }\n\n return -1;\n}\n\nexport function isNodeMatchingSelectorList(tNode: TNode, selector: CssSelectorList): boolean {\n for (let i = 0; i < selector.length; i++) {\n if (isNodeMatchingSelector(tNode, selector[i])) {\n return true;\n }\n }\n\n return false;\n}\n\nexport function getProjectAsAttrValue(tNode: TNode): string|null {\n const nodeAttrs = tNode.attrs;\n if (nodeAttrs != null) {\n const ngProjectAsAttrIdx = nodeAttrs.indexOf(NG_PROJECT_AS_ATTR_NAME);\n // only check for ngProjectAs in attribute names, don't accidentally match attribute's value\n // (attribute names are stored at even indexes)\n if ((ngProjectAsAttrIdx & 1) === 0) {\n return nodeAttrs[ngProjectAsAttrIdx + 1] as string;\n }\n }\n return null;\n}\n\n/**\n * Checks a given node against matching selectors and returns\n * selector index (or 0 if none matched).\n *\n * This function takes into account the ngProjectAs attribute: if present its value will be compared\n * to the raw (un-parsed) CSS selector instead of using standard selector matching logic.\n */\nexport function matchingSelectorIndex(\n tNode: TNode, selectors: CssSelectorList[], textSelectors: string[]): number {\n const ngProjectAsAttrVal = getProjectAsAttrValue(tNode);\n for (let i = 0; i < selectors.length; i++) {\n // if a node has the ngProjectAs attribute match it against unparsed selector\n // match a node against a parsed selector only if ngProjectAs attribute is not present\n if (ngProjectAsAttrVal === textSelectors[i] ||\n ngProjectAsAttrVal === null && isNodeMatchingSelectorList(tNode, selectors[i])) {\n return i + 1; // first matching selector \"captures\" a given node\n }\n }\n return 0;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {StyleSanitizeFn} from '../sanitization/style_sanitizer';\nimport {InitialStylingFlags} from './interfaces/definition';\nimport {LElementNode} from './interfaces/node';\nimport {Renderer3, RendererStyleFlags3, isProceduralRenderer} from './interfaces/renderer';\n\n\n/**\n * The styling context acts as a styling manifest (shaped as an array) for determining which\n * styling properties have been assigned via the provided `updateStylingMap`, `updateStyleProp`\n * and `updateClassProp` functions. There are also two initialization functions\n * `allocStylingContext` and `createStylingContextTemplate` which are used to initialize\n * and/or clone the context.\n *\n * The context is an array where the first two cells are used for static data (initial styling)\n * and dirty flags / index offsets). The remaining set of cells is used for multi (map) and single\n * (prop) style values.\n *\n * each value from here onwards is mapped as so:\n * [i] = mutation/type flag for the style/class value\n * [i + 1] = prop string (or null incase it has been removed)\n * [i + 2] = value string (or null incase it has been removed)\n *\n * There are three types of styling types stored in this context:\n * initial: any styles that are passed in once the context is created\n * (these are stored in the first cell of the array and the first\n * value of this array is always `null` even if no initial styling exists.\n * the `null` value is there so that any new styles have a parent to point\n * to. This way we can always assume that there is a parent.)\n *\n * single: any styles that are updated using `updateStyleProp` or `updateClassProp` (fixed set)\n *\n * multi: any styles that are updated using `updateStylingMap` (dynamic set)\n *\n * Note that context is only used to collect style information. Only when `renderStyling`\n * is called is when the styling payload will be rendered (or built as a key/value map).\n *\n * When the context is created, depending on what initial styling values are passed in, the\n * context itself will be pre-filled with slots based on the initial style properties. Say\n * for example we have a series of initial styles that look like so:\n *\n * style=\"width:100px; height:200px;\"\n * class=\"foo\"\n *\n * Then the initial state of the context (once initialized) will look like so:\n *\n * ```\n * context = [\n * element,\n * styleSanitizer | null,\n * [null, '100px', '200px', true], // property names are not needed since they have already been\n * written to DOM.\n *\n * configMasterVal,\n * 1, // this instructs how many `style` values there are so that class index values can be\n * offsetted\n * 'last class string applied',\n *\n * // 6\n * 'width',\n * pointers(1, 15); // Point to static `width`: `100px` and multi `width`.\n * null,\n *\n * // 9\n * 'height',\n * pointers(2, 18); // Point to static `height`: `200px` and multi `height`.\n * null,\n *\n * // 12\n * 'foo',\n * pointers(1, 21); // Point to static `foo`: `true` and multi `foo`.\n * null,\n *\n * // 15\n * 'width',\n * pointers(1, 6); // Point to static `width`: `100px` and single `width`.\n * null,\n *\n * // 18\n * 'height',\n * pointers(2, 9); // Point to static `height`: `200px` and single `height`.\n * null,\n *\n * // 21\n * 'foo',\n * pointers(3, 12); // Point to static `foo`: `true` and single `foo`.\n * null,\n * ]\n *\n * function pointers(staticIndex: number, dynamicIndex: number) {\n * // combine the two indices into a single word.\n * return (staticIndex << StylingFlags.BitCountSize) |\n * (dynamicIndex << (StylingIndex.BitCountSize + StylingFlags.BitCountSize));\n * }\n * ```\n *\n * The values are duplicated so that space is set aside for both multi ([style] and [class])\n * and single ([style.prop] or [class.named]) values. The respective config values\n * (configValA, configValB, etc...) are a combination of the StylingFlags with two index\n * values: the `initialIndex` (which points to the index location of the style value in\n * the initial styles array in slot 0) and the `dynamicIndex` (which points to the\n * matching single/multi index position in the context array for the same prop).\n *\n * This means that every time `updateStyleProp` or `updateClassProp` are called then they\n * must be called using an index value (not a property string) which references the index\n * value of the initial style prop/class when the context was created. This also means that\n * `updateStyleProp` or `updateClassProp` cannot be called with a new property (only\n * `updateStylingMap` can include new CSS properties that will be added to the context).\n */\nexport interface StylingContext extends\n Array<InitialStyles|number|string|boolean|LElementNode|StyleSanitizeFn|null> {\n /**\n * Location of element that is used as a target for this context.\n */\n [0]: LElementNode|null;\n\n /**\n * The style sanitizer that is used within this context\n */\n [1]: StyleSanitizeFn|null;\n\n /**\n * Location of initial data shared by all instances of this style.\n */\n [2]: InitialStyles;\n\n /**\n * A numeric value representing the configuration status (whether the context is dirty or not)\n * mixed together (using bit shifting) with a index value which tells the starting index value\n * of where the multi style entries begin.\n */\n [3]: number;\n\n /**\n * A numeric value representing the class index offset value. Whenever a single class is\n * applied (using `elementClassProp`) it should have an styling index value that doesn't\n * need to take into account any style values that exist in the context.\n */\n [4]: number;\n\n /**\n * The last CLASS STRING VALUE that was interpreted by elementStylingMap. This is cached\n * So that the algorithm can exit early incase the string has not changed.\n */\n [5]: string|null;\n}\n\n/**\n * The initial styles is populated whether or not there are any initial styles passed into\n * the context during allocation. The 0th value must be null so that index values of `0` within\n * the context flags can always point to a null value safely when nothing is set.\n *\n * All other entries in this array are of `string` value and correspond to the values that\n * were extracted from the `style=\"\"` attribute in the HTML code for the provided template.\n */\nexport interface InitialStyles extends Array<string|null|boolean> { [0]: null; }\n\n/**\n * Used to set the context to be dirty or not both on the master flag (position 1)\n * or for each single/multi property that exists in the context.\n */\nexport const enum StylingFlags {\n // Implies no configurations\n None = 0b000,\n // Whether or not the entry or context itself is dirty\n Dirty = 0b001,\n // Whether or not this is a class-based assignment\n Class = 0b010,\n // Whether or not a sanitizer was applied to this property\n Sanitize = 0b100,\n // The max amount of bits used to represent these configuration values\n BitCountSize = 3,\n // There are only three bits here\n BitMask = 0b111\n}\n\n/** Used as numeric pointer values to determine what cells to update in the `StylingContext` */\nexport const enum StylingIndex {\n // Position of where the initial styles are stored in the styling context\n ElementPosition = 0,\n // Position of where the style sanitizer is stored within the styling context\n StyleSanitizerPosition = 1,\n // Position of where the initial styles are stored in the styling context\n InitialStylesPosition = 2,\n // Index of location where the start of single properties are stored. (`updateStyleProp`)\n MasterFlagPosition = 3,\n // Index of location where the class index offset value is located\n ClassOffsetPosition = 4,\n // Position of where the last string-based CSS class value was stored\n CachedCssClassString = 5,\n // Location of single (prop) value entries are stored within the context\n SingleStylesStartPosition = 6,\n // Multi and single entries are stored in `StylingContext` as: Flag; PropertyName; PropertyValue\n FlagsOffset = 0,\n PropertyOffset = 1,\n ValueOffset = 2,\n // Size of each multi or single entry (flag + prop + value)\n Size = 3,\n // Each flag has a binary digit length of this value\n BitCountSize = 14, // (32 - 3) / 2 = ~14\n // The binary digit value as a mask\n BitMask = 0b11111111111111 // 14 bits\n}\n\n/**\n * Used clone a copy of a pre-computed template of a styling context.\n *\n * A pre-computed template is designed to be computed once for a given element\n * (instructions.ts has logic for caching this).\n */\nexport function allocStylingContext(\n lElement: LElementNode | null, templateStyleContext: StylingContext): StylingContext {\n // each instance gets a copy\n const context = templateStyleContext.slice() as any as StylingContext;\n context[StylingIndex.ElementPosition] = lElement;\n return context;\n}\n\n/**\n * Creates a styling context template where styling information is stored.\n * Any styles that are later referenced using `updateStyleProp` must be\n * passed in within this function. Initial values for those styles are to\n * be declared after all initial style properties are declared (this change in\n * mode between declarations and initial styles is made possible using a special\n * enum value found in `definition.ts`).\n *\n * @param initialStyleDeclarations a list of style declarations and initial style values\n * that are used later within the styling context.\n *\n * -> ['width', 'height', SPECIAL_ENUM_VAL, 'width', '100px']\n * This implies that `width` and `height` will be later styled and that the `width`\n * property has an initial value of `100px`.\n *\n * @param initialClassDeclarations a list of class declarations and initial class values\n * that are used later within the styling context.\n *\n * -> ['foo', 'bar', SPECIAL_ENUM_VAL, 'foo', true]\n * This implies that `foo` and `bar` will be later styled and that the `foo`\n * class will be applied to the element as an initial class since it's true\n */\nexport function createStylingContextTemplate(\n initialClassDeclarations?: (string | boolean | InitialStylingFlags)[] | null,\n initialStyleDeclarations?: (string | boolean | InitialStylingFlags)[] | null,\n styleSanitizer?: StyleSanitizeFn | null): StylingContext {\n const initialStylingValues: InitialStyles = [null];\n const context: StylingContext = [null, styleSanitizer || null, initialStylingValues, 0, 0, null];\n\n // we use two maps since a class name might collide with a CSS style prop\n const stylesLookup: {[key: string]: number} = {};\n const classesLookup: {[key: string]: number} = {};\n\n let totalStyleDeclarations = 0;\n if (initialStyleDeclarations) {\n let hasPassedDeclarations = false;\n for (let i = 0; i < initialStyleDeclarations.length; i++) {\n const v = initialStyleDeclarations[i] as string | InitialStylingFlags;\n\n // this flag value marks where the declarations end the initial values begin\n if (v === InitialStylingFlags.VALUES_MODE) {\n hasPassedDeclarations = true;\n } else {\n const prop = v as string;\n if (hasPassedDeclarations) {\n const value = initialStyleDeclarations[++i] as string;\n initialStylingValues.push(value);\n stylesLookup[prop] = initialStylingValues.length - 1;\n } else {\n totalStyleDeclarations++;\n stylesLookup[prop] = 0;\n }\n }\n }\n }\n\n // make where the class offsets begin\n context[StylingIndex.ClassOffsetPosition] = totalStyleDeclarations;\n\n if (initialClassDeclarations) {\n let hasPassedDeclarations = false;\n for (let i = 0; i < initialClassDeclarations.length; i++) {\n const v = initialClassDeclarations[i] as string | boolean | InitialStylingFlags;\n // this flag value marks where the declarations end the initial values begin\n if (v === InitialStylingFlags.VALUES_MODE) {\n hasPassedDeclarations = true;\n } else {\n const className = v as string;\n if (hasPassedDeclarations) {\n const value = initialClassDeclarations[++i] as boolean;\n initialStylingValues.push(value);\n classesLookup[className] = initialStylingValues.length - 1;\n } else {\n classesLookup[className] = 0;\n }\n }\n }\n }\n\n const styleProps = Object.keys(stylesLookup);\n const classNames = Object.keys(classesLookup);\n const classNamesIndexStart = styleProps.length;\n const totalProps = styleProps.length + classNames.length;\n\n // *2 because we are filling for both single and multi style spaces\n const maxLength = totalProps * StylingIndex.Size * 2 + StylingIndex.SingleStylesStartPosition;\n\n // we need to fill the array from the start so that we can access\n // both the multi and the single array positions in the same loop block\n for (let i = StylingIndex.SingleStylesStartPosition; i < maxLength; i++) {\n context.push(null);\n }\n\n const singleStart = StylingIndex.SingleStylesStartPosition;\n const multiStart = totalProps * StylingIndex.Size + StylingIndex.SingleStylesStartPosition;\n\n // fill single and multi-level styles\n for (let i = 0; i < totalProps; i++) {\n const isClassBased = i >= classNamesIndexStart;\n const prop = isClassBased ? classNames[i - classNamesIndexStart] : styleProps[i];\n const indexForInitial = isClassBased ? classesLookup[prop] : stylesLookup[prop];\n const initialValue = initialStylingValues[indexForInitial];\n\n const indexForMulti = i * StylingIndex.Size + multiStart;\n const indexForSingle = i * StylingIndex.Size + singleStart;\n const initialFlag = prepareInitialFlag(prop, isClassBased, styleSanitizer || null);\n\n setFlag(context, indexForSingle, pointers(initialFlag, indexForInitial, indexForMulti));\n setProp(context, indexForSingle, prop);\n setValue(context, indexForSingle, null);\n\n const flagForMulti =\n initialFlag | (initialValue !== null ? StylingFlags.Dirty : StylingFlags.None);\n setFlag(context, indexForMulti, pointers(flagForMulti, indexForInitial, indexForSingle));\n setProp(context, indexForMulti, prop);\n setValue(context, indexForMulti, null);\n }\n\n // there is no initial value flag for the master index since it doesn't\n // reference an initial style value\n setFlag(context, StylingIndex.MasterFlagPosition, pointers(0, 0, multiStart));\n setContextDirty(context, initialStylingValues.length > 1);\n\n return context;\n}\n\nconst EMPTY_ARR: any[] = [];\nconst EMPTY_OBJ: {[key: string]: any} = {};\n/**\n * Sets and resolves all `multi` styling on an `StylingContext` so that they can be\n * applied to the element once `renderStyling` is called.\n *\n * All missing styles/class (any values that are not provided in the new `styles`\n * or `classes` params) will resolve to `null` within their respective positions\n * in the context.\n *\n * @param context The styling context that will be updated with the\n * newly provided style values.\n * @param classes The key/value map of CSS class names that will be used for the update.\n * @param styles The key/value map of CSS styles that will be used for the update.\n */\nexport function updateStylingMap(\n context: StylingContext, classes: {[key: string]: any} | string | null,\n styles?: {[key: string]: any} | null): void {\n let classNames: string[] = EMPTY_ARR;\n let applyAllClasses = false;\n let ignoreAllClassUpdates = false;\n\n // each time a string-based value pops up then it shouldn't require a deep\n // check of what's changed.\n if (typeof classes == 'string') {\n const cachedClassString = context[StylingIndex.CachedCssClassString] as string | null;\n if (cachedClassString && cachedClassString === classes) {\n ignoreAllClassUpdates = true;\n } else {\n context[StylingIndex.CachedCssClassString] = classes;\n classNames = classes.split(/\\s+/);\n // this boolean is used to avoid having to create a key/value map of `true` values\n // since a classname string implies that all those classes are added\n applyAllClasses = true;\n }\n } else {\n classNames = classes ? Object.keys(classes) : EMPTY_ARR;\n context[StylingIndex.CachedCssClassString] = null;\n }\n\n classes = (classes || EMPTY_OBJ) as{[key: string]: any};\n\n const styleProps = styles ? Object.keys(styles) : EMPTY_ARR;\n styles = styles || EMPTY_OBJ;\n\n const classesStartIndex = styleProps.length;\n const multiStartIndex = getMultiStartIndex(context);\n\n let dirty = false;\n let ctxIndex = multiStartIndex;\n\n let propIndex = 0;\n const propLimit = styleProps.length + classNames.length;\n\n // the main loop here will try and figure out how the shape of the provided\n // styles differ with respect to the context. Later if the context/styles/classes\n // are off-balance then they will be dealt in another loop after this one\n while (ctxIndex < context.length && propIndex < propLimit) {\n const isClassBased = propIndex >= classesStartIndex;\n\n // when there is a cache-hit for a string-based class then we should\n // avoid doing any work diffing any of the changes\n if (!ignoreAllClassUpdates || !isClassBased) {\n const adjustedPropIndex = isClassBased ? propIndex - classesStartIndex : propIndex;\n const newProp: string =\n isClassBased ? classNames[adjustedPropIndex] : styleProps[adjustedPropIndex];\n const newValue: string|boolean =\n isClassBased ? (applyAllClasses ? true : classes[newProp]) : styles[newProp];\n\n const prop = getProp(context, ctxIndex);\n if (prop === newProp) {\n const value = getValue(context, ctxIndex);\n const flag = getPointers(context, ctxIndex);\n if (hasValueChanged(flag, value, newValue)) {\n setValue(context, ctxIndex, newValue);\n\n const initialValue = getInitialValue(context, flag);\n\n // there is no point in setting this to dirty if the previously\n // rendered value was being referenced by the initial style (or null)\n if (initialValue !== newValue) {\n setDirty(context, ctxIndex, true);\n dirty = true;\n }\n }\n } else {\n const indexOfEntry = findEntryPositionByProp(context, newProp, ctxIndex);\n if (indexOfEntry > 0) {\n // it was found at a later point ... just swap the values\n const valueToCompare = getValue(context, indexOfEntry);\n const flagToCompare = getPointers(context, indexOfEntry);\n swapMultiContextEntries(context, ctxIndex, indexOfEntry);\n if (valueToCompare !== newValue) {\n const initialValue = getInitialValue(context, flagToCompare);\n setValue(context, ctxIndex, newValue);\n if (initialValue !== newValue) {\n setDirty(context, ctxIndex, true);\n dirty = true;\n }\n }\n } else {\n // we only care to do this if the insertion is in the middle\n const newFlag = prepareInitialFlag(newProp, isClassBased, getStyleSanitizer(context));\n insertNewMultiProperty(context, ctxIndex, isClassBased, newProp, newFlag, newValue);\n dirty = true;\n }\n }\n }\n\n ctxIndex += StylingIndex.Size;\n propIndex++;\n }\n\n // this means that there are left-over values in the context that\n // were not included in the provided styles/classes and in this\n // case the goal is to \"remove\" them from the context (by nullifying)\n while (ctxIndex < context.length) {\n const flag = getPointers(context, ctxIndex);\n const isClassBased = (flag & StylingFlags.Class) === StylingFlags.Class;\n if (ignoreAllClassUpdates && isClassBased) break;\n\n const value = getValue(context, ctxIndex);\n const doRemoveValue = valueExists(value, isClassBased);\n if (doRemoveValue) {\n setDirty(context, ctxIndex, true);\n setValue(context, ctxIndex, null);\n dirty = true;\n }\n ctxIndex += StylingIndex.Size;\n }\n\n // this means that there are left-over properties in the context that\n // were not detected in the context during the loop above. In that\n // case we want to add the new entries into the list\n const sanitizer = getStyleSanitizer(context);\n while (propIndex < propLimit) {\n const isClassBased = propIndex >= classesStartIndex;\n if (ignoreAllClassUpdates && isClassBased) break;\n\n const adjustedPropIndex = isClassBased ? propIndex - classesStartIndex : propIndex;\n const prop = isClassBased ? classNames[adjustedPropIndex] : styleProps[adjustedPropIndex];\n const value: string|boolean =\n isClassBased ? (applyAllClasses ? true : classes[prop]) : styles[prop];\n const flag = prepareInitialFlag(prop, isClassBased, sanitizer) | StylingFlags.Dirty;\n context.push(flag, prop, value);\n propIndex++;\n dirty = true;\n }\n\n if (dirty) {\n setContextDirty(context, true);\n }\n}\n\n/**\n * Sets and resolves a single styling property/value on the provided `StylingContext` so\n * that they can be applied to the element once `renderStyling` is called.\n *\n * Note that prop-level styling values are considered higher priority than any styling that\n * has been applied using `updateStylingMap`, therefore, when styling values are rendered\n * then any styles/classes that have been applied using this function will be considered first\n * (then multi values second and then initial values as a backup).\n *\n * @param context The styling context that will be updated with the\n * newly provided style value.\n * @param index The index of the property which is being updated.\n * @param value The CSS style value that will be assigned\n */\nexport function updateStyleProp(\n context: StylingContext, index: number, value: string | boolean | null): void {\n const singleIndex = StylingIndex.SingleStylesStartPosition + index * StylingIndex.Size;\n const currValue = getValue(context, singleIndex);\n const currFlag = getPointers(context, singleIndex);\n\n // didn't change ... nothing to make a note of\n if (hasValueChanged(currFlag, currValue, value)) {\n // the value will always get updated (even if the dirty flag is skipped)\n setValue(context, singleIndex, value);\n const indexForMulti = getMultiOrSingleIndex(currFlag);\n\n // if the value is the same in the multi-area then there's no point in re-assembling\n const valueForMulti = getValue(context, indexForMulti);\n if (!valueForMulti || valueForMulti !== value) {\n let multiDirty = false;\n let singleDirty = true;\n\n const isClassBased = (currFlag & StylingFlags.Class) === StylingFlags.Class;\n\n // only when the value is set to `null` should the multi-value get flagged\n if (!valueExists(value, isClassBased) && valueExists(valueForMulti, isClassBased)) {\n multiDirty = true;\n singleDirty = false;\n }\n\n setDirty(context, indexForMulti, multiDirty);\n setDirty(context, singleIndex, singleDirty);\n setContextDirty(context, true);\n }\n }\n}\n\n/**\n * This method will toggle the referenced CSS class (by the provided index)\n * within the given context.\n *\n * @param context The styling context that will be updated with the\n * newly provided class value.\n * @param index The index of the CSS class which is being updated.\n * @param addOrRemove Whether or not to add or remove the CSS class\n */\nexport function updateClassProp(\n context: StylingContext, index: number, addOrRemove: boolean): void {\n const adjustedIndex = index + context[StylingIndex.ClassOffsetPosition];\n updateStyleProp(context, adjustedIndex, addOrRemove);\n}\n\n/**\n * Renders all queued styling using a renderer onto the given element.\n *\n * This function works by rendering any styles (that have been applied\n * using `updateStylingMap`) and any classes (that have been applied using\n * `updateStyleProp`) onto the provided element using the provided renderer.\n * Just before the styles/classes are rendered a final key/value style map\n * will be assembled (if `styleStore` or `classStore` are provided).\n *\n * @param lElement the element that the styles will be rendered on\n * @param context The styling context that will be used to determine\n * what styles will be rendered\n * @param renderer the renderer that will be used to apply the styling\n * @param styleStore if provided, the updated style values will be applied\n * to this key/value map instead of being renderered via the renderer.\n * @param classStore if provided, the updated class values will be applied\n * to this key/value map instead of being renderered via the renderer.\n */\nexport function renderStyling(\n context: StylingContext, renderer: Renderer3, styleStore?: {[key: string]: any},\n classStore?: {[key: string]: boolean}) {\n if (isContextDirty(context)) {\n const native = context[StylingIndex.ElementPosition] !.native;\n const multiStartIndex = getMultiStartIndex(context);\n const styleSanitizer = getStyleSanitizer(context);\n for (let i = StylingIndex.SingleStylesStartPosition; i < context.length;\n i += StylingIndex.Size) {\n // there is no point in rendering styles that have not changed on screen\n if (isDirty(context, i)) {\n const prop = getProp(context, i);\n const value = getValue(context, i);\n const flag = getPointers(context, i);\n const isClassBased = flag & StylingFlags.Class ? true : false;\n const isInSingleRegion = i < multiStartIndex;\n\n let valueToApply: string|boolean|null = value;\n\n // VALUE DEFER CASE 1: Use a multi value instead of a null single value\n // this check implies that a single value was removed and we\n // should now defer to a multi value and use that (if set).\n if (isInSingleRegion && !valueExists(valueToApply, isClassBased)) {\n // single values ALWAYS have a reference to a multi index\n const multiIndex = getMultiOrSingleIndex(flag);\n valueToApply = getValue(context, multiIndex);\n }\n\n // VALUE DEFER CASE 2: Use the initial value if all else fails (is falsy)\n // the initial value will always be a string or null,\n // therefore we can safely adopt it incase there's nothing else\n // note that this should always be a falsy check since `false` is used\n // for both class and style comparisons (styles can't be false and false\n // classes are turned off and should therefore defer to their initial values)\n if (!valueExists(valueToApply, isClassBased)) {\n valueToApply = getInitialValue(context, flag);\n }\n\n if (isClassBased) {\n setClass(native, prop, valueToApply ? true : false, renderer, classStore);\n } else {\n const sanitizer = (flag & StylingFlags.Sanitize) ? styleSanitizer : null;\n setStyle(native, prop, valueToApply as string | null, renderer, sanitizer, styleStore);\n }\n setDirty(context, i, false);\n }\n }\n\n setContextDirty(context, false);\n }\n}\n\n/**\n * This function renders a given CSS prop/value entry using the\n * provided renderer. If a `store` value is provided then\n * that will be used a render context instead of the provided\n * renderer.\n *\n * @param native the DOM Element\n * @param prop the CSS style property that will be rendered\n * @param value the CSS style value that will be rendered\n * @param renderer\n * @param store an optional key/value map that will be used as a context to render styles on\n */\nfunction setStyle(\n native: any, prop: string, value: string | null, renderer: Renderer3,\n sanitizer: StyleSanitizeFn | null, store?: {[key: string]: any}) {\n value = sanitizer && value ? sanitizer(prop, value) : value;\n if (store) {\n store[prop] = value;\n } else if (value) {\n ngDevMode && ngDevMode.rendererSetStyle++;\n isProceduralRenderer(renderer) ?\n renderer.setStyle(native, prop, value, RendererStyleFlags3.DashCase) :\n native['style'].setProperty(prop, value);\n } else {\n ngDevMode && ngDevMode.rendererRemoveStyle++;\n isProceduralRenderer(renderer) ?\n renderer.removeStyle(native, prop, RendererStyleFlags3.DashCase) :\n native['style'].removeProperty(prop);\n }\n}\n\n/**\n * This function renders a given CSS class value using the provided\n * renderer (by adding or removing it from the provided element).\n * If a `store` value is provided then that will be used a render\n * context instead of the provided renderer.\n *\n * @param native the DOM Element\n * @param prop the CSS style property that will be rendered\n * @param value the CSS style value that will be rendered\n * @param renderer\n * @param store an optional key/value map that will be used as a context to render styles on\n */\nfunction setClass(\n native: any, className: string, add: boolean, renderer: Renderer3,\n store?: {[key: string]: boolean}) {\n if (store) {\n store[className] = add;\n } else if (add) {\n ngDevMode && ngDevMode.rendererAddClass++;\n isProceduralRenderer(renderer) ? renderer.addClass(native, className) :\n native['classList'].add(className);\n } else {\n ngDevMode && ngDevMode.rendererRemoveClass++;\n isProceduralRenderer(renderer) ? renderer.removeClass(native, className) :\n native['classList'].remove(className);\n }\n}\n\nfunction setDirty(context: StylingContext, index: number, isDirtyYes: boolean) {\n const adjustedIndex =\n index >= StylingIndex.SingleStylesStartPosition ? (index + StylingIndex.FlagsOffset) : index;\n if (isDirtyYes) {\n (context[adjustedIndex] as number) |= StylingFlags.Dirty;\n } else {\n (context[adjustedIndex] as number) &= ~StylingFlags.Dirty;\n }\n}\n\nfunction isDirty(context: StylingContext, index: number): boolean {\n const adjustedIndex =\n index >= StylingIndex.SingleStylesStartPosition ? (index + StylingIndex.FlagsOffset) : index;\n return ((context[adjustedIndex] as number) & StylingFlags.Dirty) == StylingFlags.Dirty;\n}\n\nfunction isClassBased(context: StylingContext, index: number): boolean {\n const adjustedIndex =\n index >= StylingIndex.SingleStylesStartPosition ? (index + StylingIndex.FlagsOffset) : index;\n return ((context[adjustedIndex] as number) & StylingFlags.Class) == StylingFlags.Class;\n}\n\nfunction isSanitizable(context: StylingContext, index: number): boolean {\n const adjustedIndex =\n index >= StylingIndex.SingleStylesStartPosition ? (index + StylingIndex.FlagsOffset) : index;\n return ((context[adjustedIndex] as number) & StylingFlags.Sanitize) == StylingFlags.Sanitize;\n}\n\nfunction pointers(configFlag: number, staticIndex: number, dynamicIndex: number) {\n return (configFlag & StylingFlags.BitMask) | (staticIndex << StylingFlags.BitCountSize) |\n (dynamicIndex << (StylingIndex.BitCountSize + StylingFlags.BitCountSize));\n}\n\nfunction getInitialValue(context: StylingContext, flag: number): string|null {\n const index = getInitialIndex(flag);\n return context[StylingIndex.InitialStylesPosition][index] as null | string;\n}\n\nfunction getInitialIndex(flag: number): number {\n return (flag >> StylingFlags.BitCountSize) & StylingIndex.BitMask;\n}\n\nfunction getMultiOrSingleIndex(flag: number): number {\n const index =\n (flag >> (StylingIndex.BitCountSize + StylingFlags.BitCountSize)) & StylingIndex.BitMask;\n return index >= StylingIndex.SingleStylesStartPosition ? index : -1;\n}\n\nfunction getMultiStartIndex(context: StylingContext): number {\n return getMultiOrSingleIndex(context[StylingIndex.MasterFlagPosition]) as number;\n}\n\nfunction getStyleSanitizer(context: StylingContext): StyleSanitizeFn|null {\n return context[StylingIndex.StyleSanitizerPosition];\n}\n\nfunction setProp(context: StylingContext, index: number, prop: string) {\n context[index + StylingIndex.PropertyOffset] = prop;\n}\n\nfunction setValue(context: StylingContext, index: number, value: string | null | boolean) {\n context[index + StylingIndex.ValueOffset] = value;\n}\n\nfunction setFlag(context: StylingContext, index: number, flag: number) {\n const adjustedIndex =\n index === StylingIndex.MasterFlagPosition ? index : (index + StylingIndex.FlagsOffset);\n context[adjustedIndex] = flag;\n}\n\nfunction getPointers(context: StylingContext, index: number): number {\n const adjustedIndex =\n index === StylingIndex.MasterFlagPosition ? index : (index + StylingIndex.FlagsOffset);\n return context[adjustedIndex] as number;\n}\n\nfunction getValue(context: StylingContext, index: number): string|boolean|null {\n return context[index + StylingIndex.ValueOffset] as string | boolean | null;\n}\n\nfunction getProp(context: StylingContext, index: number): string {\n return context[index + StylingIndex.PropertyOffset] as string;\n}\n\nexport function isContextDirty(context: StylingContext): boolean {\n return isDirty(context, StylingIndex.MasterFlagPosition);\n}\n\nexport function setContextDirty(context: StylingContext, isDirtyYes: boolean): void {\n setDirty(context, StylingIndex.MasterFlagPosition, isDirtyYes);\n}\n\nfunction findEntryPositionByProp(\n context: StylingContext, prop: string, startIndex?: number): number {\n for (let i = (startIndex || 0) + StylingIndex.PropertyOffset; i < context.length;\n i += StylingIndex.Size) {\n const thisProp = context[i];\n if (thisProp == prop) {\n return i - StylingIndex.PropertyOffset;\n }\n }\n return -1;\n}\n\nfunction swapMultiContextEntries(context: StylingContext, indexA: number, indexB: number) {\n const tmpValue = getValue(context, indexA);\n const tmpProp = getProp(context, indexA);\n const tmpFlag = getPointers(context, indexA);\n\n let flagA = tmpFlag;\n let flagB = getPointers(context, indexB);\n\n const singleIndexA = getMultiOrSingleIndex(flagA);\n if (singleIndexA >= 0) {\n const _flag = getPointers(context, singleIndexA);\n const _initial = getInitialIndex(_flag);\n setFlag(context, singleIndexA, pointers(_flag, _initial, indexB));\n }\n\n const singleIndexB = getMultiOrSingleIndex(flagB);\n if (singleIndexB >= 0) {\n const _flag = getPointers(context, singleIndexB);\n const _initial = getInitialIndex(_flag);\n setFlag(context, singleIndexB, pointers(_flag, _initial, indexA));\n }\n\n setValue(context, indexA, getValue(context, indexB));\n setProp(context, indexA, getProp(context, indexB));\n setFlag(context, indexA, getPointers(context, indexB));\n\n setValue(context, indexB, tmpValue);\n setProp(context, indexB, tmpProp);\n setFlag(context, indexB, tmpFlag);\n}\n\nfunction updateSinglePointerValues(context: StylingContext, indexStartPosition: number) {\n for (let i = indexStartPosition; i < context.length; i += StylingIndex.Size) {\n const multiFlag = getPointers(context, i);\n const singleIndex = getMultiOrSingleIndex(multiFlag);\n if (singleIndex > 0) {\n const singleFlag = getPointers(context, singleIndex);\n const initialIndexForSingle = getInitialIndex(singleFlag);\n const flagValue = (isDirty(context, singleIndex) ? StylingFlags.Dirty : StylingFlags.None) |\n (isClassBased(context, singleIndex) ? StylingFlags.Class : StylingFlags.None) |\n (isSanitizable(context, singleIndex) ? StylingFlags.Sanitize : StylingFlags.None);\n const updatedFlag = pointers(flagValue, initialIndexForSingle, i);\n setFlag(context, singleIndex, updatedFlag);\n }\n }\n}\n\nfunction insertNewMultiProperty(\n context: StylingContext, index: number, classBased: boolean, name: string, flag: number,\n value: string | boolean): void {\n const doShift = index < context.length;\n\n // prop does not exist in the list, add it in\n context.splice(\n index, 0, flag | StylingFlags.Dirty | (classBased ? StylingFlags.Class : StylingFlags.None),\n name, value);\n\n if (doShift) {\n // because the value was inserted midway into the array then we\n // need to update all the shifted multi values' single value\n // pointers to point to the newly shifted location\n updateSinglePointerValues(context, index + StylingIndex.Size);\n }\n}\n\nfunction valueExists(value: string | null | boolean, isClassBased?: boolean) {\n if (isClassBased) {\n return value ? true : false;\n }\n return value !== null;\n}\n\nfunction prepareInitialFlag(\n name: string, isClassBased: boolean, sanitizer?: StyleSanitizeFn | null) {\n if (isClassBased) {\n return StylingFlags.Class;\n } else if (sanitizer && sanitizer(name)) {\n return StylingFlags.Sanitize;\n }\n return StylingFlags.None;\n}\n\nfunction hasValueChanged(\n flag: number, a: string | boolean | null, b: string | boolean | null): boolean {\n const isClassBased = flag & StylingFlags.Class;\n const hasValues = a && b;\n const usesSanitizer = flag & StylingFlags.Sanitize;\n // the toString() comparison ensures that a value is checked\n // ... otherwise (during sanitization bypassing) the === comparsion\n // would fail since a new String() instance is created\n if (!isClassBased && hasValues && usesSanitizer) {\n // we know for sure we're dealing with strings at this point\n return (a as string).toString() !== (b as string).toString();\n }\n\n // everything else is safe to check with a normal equality check\n return a !== b;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport './ng_dev_mode';\n\nimport {QueryList} from '../linker';\nimport {Sanitizer} from '../sanitization/security';\nimport {StyleSanitizeFn} from '../sanitization/style_sanitizer';\n\nimport {assertDefined, assertEqual, assertLessThan, assertNotDefined, assertNotEqual} from './assert';\nimport {throwCyclicDependencyError, throwErrorIfNoChangesMode, throwMultipleComponentError} from './errors';\nimport {executeHooks, executeInitHooks, queueInitHooks, queueLifecycleHooks} from './hooks';\nimport {ACTIVE_INDEX, LContainer, RENDER_PARENT, VIEWS} from './interfaces/container';\nimport {ComponentDefInternal, ComponentQuery, ComponentTemplate, DirectiveDefInternal, DirectiveDefListOrFactory, InitialStylingFlags, PipeDefListOrFactory, RenderFlags} from './interfaces/definition';\nimport {LInjector} from './interfaces/injector';\nimport {AttributeMarker, InitialInputData, InitialInputs, LContainerNode, LElementNode, LNode, LProjectionNode, LTextNode, LViewNode, PropertyAliasValue, PropertyAliases, TAttributes, TContainerNode, TElementNode, TNode, TNodeFlags, TNodeType} from './interfaces/node';\nimport {CssSelectorList, NG_PROJECT_AS_ATTR_NAME} from './interfaces/projection';\nimport {LQueries} from './interfaces/query';\nimport {ProceduralRenderer3, RComment, RElement, RText, Renderer3, RendererFactory3, RendererStyleFlags3, isProceduralRenderer} from './interfaces/renderer';\nimport {BINDING_INDEX, CLEANUP, CONTAINER_INDEX, CONTENT_QUERIES, CONTEXT, CurrentMatchesList, DIRECTIVES, FLAGS, HEADER_OFFSET, HOST_NODE, INJECTOR, LViewData, LViewFlags, NEXT, PARENT, QUERIES, RENDERER, RootContext, SANITIZER, TAIL, TData, TVIEW, TView} from './interfaces/view';\nimport {assertNodeOfPossibleTypes, assertNodeType} from './node_assert';\nimport {appendChild, appendProjectedNode, canInsertNativeNode, createTextNode, findComponentHost, getChildLNode, getLViewChild, getNextLNode, getParentLNode, insertView, removeView} from './node_manipulation';\nimport {isNodeMatchingSelectorList, matchingSelectorIndex} from './node_selector_matcher';\nimport {StylingContext, allocStylingContext, createStylingContextTemplate, renderStyling as renderElementStyles, updateClassProp as updateElementClassProp, updateStyleProp as updateElementStyleProp, updateStylingMap} from './styling';\nimport {assertDataInRangeInternal, isDifferent, loadElementInternal, loadInternal, stringify} from './util';\nimport {ViewRef} from './view_ref';\n\n\n\n/**\n * Directive (D) sets a property on all component instances using this constant as a key and the\n * component's host node (LElement) as the value. This is used in methods like detectChanges to\n * facilitate jumping from an instance to the host node.\n */\nexport const NG_HOST_SYMBOL = '__ngHostLNode__';\n\n/**\n * A permanent marker promise which signifies that the current CD tree is\n * clean.\n */\nconst _CLEAN_PROMISE = Promise.resolve(null);\n\n/**\n * Function used to sanitize the value before writing it into the renderer.\n */\nexport type SanitizerFn = (value: any) => string;\n\n/**\n * Directive and element indices for top-level directive.\n *\n * Saved here to avoid re-instantiating an array on every change detection run.\n *\n * Note: Element is not actually stored at index 0 because of the LViewData\n * header, but the host bindings function expects an index that is NOT adjusted\n * because it will ultimately be fed to instructions like elementProperty.\n */\nconst _ROOT_DIRECTIVE_INDICES = [0, 0];\n\n/**\n * TView.data needs to fill the same number of slots as the LViewData header\n * so the indices of nodes are consistent between LViewData and TView.data.\n *\n * It's much faster to keep a blueprint of the pre-filled array and slice it\n * than it is to create a new array and fill it each time a TView is created.\n */\nconst HEADER_FILLER = new Array(HEADER_OFFSET).fill(null);\n\n/**\n * Token set in currentMatches while dependencies are being resolved.\n *\n * If we visit a directive that has a value set to CIRCULAR, we know we've\n * already seen it, and thus have a circular dependency.\n */\nexport const CIRCULAR = '__CIRCULAR__';\n\n/**\n * This property gets set before entering a template.\n *\n * This renderer can be one of two varieties of Renderer3:\n *\n * - ObjectedOrientedRenderer3\n *\n * This is the native browser API style, e.g. operations are methods on individual objects\n * like HTMLElement. With this style, no additional code is needed as a facade (reducing payload\n * size).\n *\n * - ProceduralRenderer3\n *\n * In non-native browser environments (e.g. platforms such as web-workers), this is the facade\n * that enables element manipulation. This also facilitates backwards compatibility with\n * Renderer2.\n */\nlet renderer: Renderer3;\nlet rendererFactory: RendererFactory3;\nlet currentElementNode: LElementNode|null = null;\n\nexport function getRenderer(): Renderer3 {\n // top level variables should not be exported for performance reasons (PERF_NOTES.md)\n return renderer;\n}\n\nexport function getCurrentSanitizer(): Sanitizer|null {\n return viewData && viewData[SANITIZER];\n}\n\nexport function getViewData(): LViewData {\n // top level variables should not be exported for performance reasons (PERF_NOTES.md)\n return viewData;\n}\n\n/** Used to set the parent property when nodes are created. */\nlet previousOrParentNode: LNode;\n\nexport function getPreviousOrParentNode(): LNode {\n // top level variables should not be exported for performance reasons (PERF_NOTES.md)\n return previousOrParentNode;\n}\n\n/**\n * If `isParent` is:\n * - `true`: then `previousOrParentNode` points to a parent node.\n * - `false`: then `previousOrParentNode` points to previous node (sibling).\n */\nlet isParent: boolean;\n\nlet tView: TView;\n\nlet currentQueries: LQueries|null;\n\n/**\n * Query instructions can ask for \"current queries\" in 2 different cases:\n * - when creating view queries (at the root of a component view, before any node is created - in\n * this case currentQueries points to view queries)\n * - when creating content queries (inb this previousOrParentNode points to a node on which we\n * create content queries).\n */\nexport function getCurrentQueries(QueryType: {new (): LQueries}): LQueries {\n // top level variables should not be exported for performance reasons (PERF_NOTES.md)\n return currentQueries ||\n (currentQueries =\n (previousOrParentNode.queries && previousOrParentNode.queries.clone() ||\n new QueryType()));\n}\n\n/**\n * This property gets set before entering a template.\n */\nlet creationMode: boolean;\n\nexport function getCreationMode(): boolean {\n // top level variables should not be exported for performance reasons (PERF_NOTES.md)\n return creationMode;\n}\n\n/**\n * State of the current view being processed.\n *\n * An array of nodes (text, element, container, etc), pipes, their bindings, and\n * any local variables that need to be stored between invocations.\n */\nlet viewData: LViewData;\n\n/**\n * An array of directive instances in the current view.\n *\n * These must be stored separately from LNodes because their presence is\n * unknown at compile-time and thus space cannot be reserved in data[].\n */\nlet directives: any[]|null;\n\nfunction getCleanup(view: LViewData): any[] {\n // top level variables should not be exported for performance reasons (PERF_NOTES.md)\n return view[CLEANUP] || (view[CLEANUP] = []);\n}\n\nfunction getTViewCleanup(view: LViewData): any[] {\n return view[TVIEW].cleanup || (view[TVIEW].cleanup = []);\n}\n/**\n * In this mode, any changes in bindings will throw an ExpressionChangedAfterChecked error.\n *\n * Necessary to support ChangeDetectorRef.checkNoChanges().\n */\nlet checkNoChangesMode = false;\n\n/** Whether or not this is the first time the current view has been processed. */\nlet firstTemplatePass = true;\n\nconst enum BindingDirection {\n Input,\n Output,\n}\n\n/**\n * Swap the current state with a new state.\n *\n * For performance reasons we store the state in the top level of the module.\n * This way we minimize the number of properties to read. Whenever a new view\n * is entered we have to store the state for later, and when the view is\n * exited the state has to be restored\n *\n * @param newView New state to become active\n * @param host Element to which the View is a child of\n * @returns the previous state;\n */\nexport function enterView(newView: LViewData, host: LElementNode | LViewNode | null): LViewData {\n const oldView: LViewData = viewData;\n directives = newView && newView[DIRECTIVES];\n tView = newView && newView[TVIEW];\n\n creationMode = newView && (newView[FLAGS] & LViewFlags.CreationMode) === LViewFlags.CreationMode;\n firstTemplatePass = newView && tView.firstTemplatePass;\n\n renderer = newView && newView[RENDERER];\n\n if (host != null) {\n previousOrParentNode = host;\n isParent = true;\n }\n\n viewData = newView;\n currentQueries = newView && newView[QUERIES];\n\n return oldView;\n}\n\n/**\n * Used in lieu of enterView to make it clear when we are exiting a child view. This makes\n * the direction of traversal (up or down the view tree) a bit clearer.\n *\n * @param newView New state to become active\n * @param creationOnly An optional boolean to indicate that the view was processed in creation mode\n * only, i.e. the first update will be done later. Only possible for dynamically created views.\n */\nexport function leaveView(newView: LViewData, creationOnly?: boolean): void {\n if (!creationOnly) {\n if (!checkNoChangesMode) {\n executeHooks(directives !, tView.viewHooks, tView.viewCheckHooks, creationMode);\n }\n // Views are clean and in update mode after being checked, so these bits are cleared\n viewData[FLAGS] &= ~(LViewFlags.CreationMode | LViewFlags.Dirty);\n }\n viewData[FLAGS] |= LViewFlags.RunInit;\n viewData[BINDING_INDEX] = -1;\n enterView(newView, null);\n}\n\n/**\n * Refreshes the view, executing the following steps in that order:\n * triggers init hooks, refreshes dynamic embedded views, triggers content hooks, sets host\n * bindings,\n * refreshes child components.\n * Note: view hooks are triggered later when leaving the view.\n */\nfunction refreshView() {\n if (!checkNoChangesMode) {\n executeInitHooks(viewData, tView, creationMode);\n }\n refreshDynamicEmbeddedViews(viewData);\n if (!checkNoChangesMode) {\n executeHooks(directives !, tView.contentHooks, tView.contentCheckHooks, creationMode);\n }\n\n // This needs to be set before children are processed to support recursive components\n tView.firstTemplatePass = firstTemplatePass = false;\n\n setHostBindings(tView.hostBindings);\n refreshContentQueries(tView);\n refreshChildComponents(tView.components);\n}\n\n\n/** Sets the host bindings for the current view. */\nexport function setHostBindings(bindings: number[] | null): void {\n if (bindings != null) {\n const defs = tView.directives !;\n for (let i = 0; i < bindings.length; i += 2) {\n const dirIndex = bindings[i];\n const def = defs[dirIndex] as DirectiveDefInternal<any>;\n def.hostBindings && def.hostBindings(dirIndex, bindings[i + 1]);\n }\n }\n}\n\n/** Refreshes content queries for all directives in the given view. */\nfunction refreshContentQueries(tView: TView): void {\n if (tView.contentQueries != null) {\n for (let i = 0; i < tView.contentQueries.length; i += 2) {\n const directiveDefIdx = tView.contentQueries[i];\n const directiveDef = tView.directives ![directiveDefIdx];\n\n directiveDef.contentQueriesRefresh !(directiveDefIdx, tView.contentQueries[i + 1]);\n }\n }\n}\n\n/** Refreshes child components in the current view. */\nfunction refreshChildComponents(components: number[] | null): void {\n if (components != null) {\n for (let i = 0; i < components.length; i += 2) {\n componentRefresh(components[i], components[i + 1]);\n }\n }\n}\n\nexport function executeInitAndContentHooks(): void {\n if (!checkNoChangesMode) {\n executeInitHooks(viewData, tView, creationMode);\n executeHooks(directives !, tView.contentHooks, tView.contentCheckHooks, creationMode);\n }\n}\n\nexport function createLViewData<T>(\n renderer: Renderer3, tView: TView, context: T | null, flags: LViewFlags,\n sanitizer?: Sanitizer | null): LViewData {\n return [\n tView, // tView\n viewData, // parent\n null, // next\n null, // queries\n flags | LViewFlags.CreationMode | LViewFlags.Attached | LViewFlags.RunInit, // flags\n null !, // hostNode\n -1, // bindingIndex\n null, // directives\n null, // cleanupInstances\n context, // context\n viewData && viewData[INJECTOR], // injector\n renderer, // renderer\n sanitizer || null, // sanitizer\n null, // tail\n -1, // containerIndex\n null, // contentQueries\n ];\n}\n\n/**\n * Creation of LNode object is extracted to a separate function so we always create LNode object\n * with the same shape\n * (same properties assigned in the same order).\n */\nexport function createLNodeObject(\n type: TNodeType, currentView: LViewData, parent: LNode | null,\n native: RText | RElement | RComment | null, state: any,\n queries: LQueries | null): LElementNode&LTextNode&LViewNode&LContainerNode&LProjectionNode {\n return {\n native: native as any,\n view: currentView,\n nodeInjector: parent ? parent.nodeInjector : null,\n data: state,\n queries: queries,\n tNode: null !,\n dynamicLContainerNode: null\n };\n}\n\n/**\n * A common way of creating the LNode to make sure that all of them have same shape to\n * keep the execution code monomorphic and fast.\n *\n * @param index The index at which the LNode should be saved (null if view, since they are not\n * saved).\n * @param type The type of LNode to create\n * @param native The native element for this LNode, if applicable\n * @param name The tag name of the associated native element, if applicable\n * @param attrs Any attrs for the native element, if applicable\n * @param data Any data that should be saved on the LNode\n */\nexport function createLNode(\n index: number, type: TNodeType.Element, native: RElement | RText | null, name: string | null,\n attrs: TAttributes | null, lViewData?: LViewData | null): LElementNode;\nexport function createLNode(\n index: number, type: TNodeType.View, native: null, name: null, attrs: null,\n lViewData: LViewData): LViewNode;\nexport function createLNode(\n index: number, type: TNodeType.Container, native: RComment, name: string | null,\n attrs: TAttributes | null, lContainer: LContainer): LContainerNode;\nexport function createLNode(\n index: number, type: TNodeType.Projection, native: null, name: null, attrs: TAttributes | null,\n lProjection: null): LProjectionNode;\nexport function createLNode(\n index: number, type: TNodeType, native: RText | RElement | RComment | null, name: string | null,\n attrs: TAttributes | null, state?: null | LViewData | LContainer): LElementNode&LTextNode&\n LViewNode&LContainerNode&LProjectionNode {\n const parent = isParent ? previousOrParentNode :\n previousOrParentNode && getParentLNode(previousOrParentNode) !as LNode;\n // Parents cannot cross component boundaries because components will be used in multiple places,\n // so it's only set if the view is the same.\n const tParent =\n parent && parent.view === viewData ? parent.tNode as TElementNode | TContainerNode : null;\n let queries =\n (isParent ? currentQueries : previousOrParentNode && previousOrParentNode.queries) ||\n parent && parent.queries && parent.queries.child();\n const isState = state != null;\n const node =\n createLNodeObject(type, viewData, parent, native, isState ? state as any : null, queries);\n\n if (index === -1 || type === TNodeType.View) {\n // View nodes are not stored in data because they can be added / removed at runtime (which\n // would cause indices to change). Their TNodes are instead stored in TView.node.\n node.tNode = (state ? (state as LViewData)[TVIEW].node : null) ||\n createTNode(type, index, null, null, tParent, null);\n } else {\n const adjustedIndex = index + HEADER_OFFSET;\n\n // This is an element or container or projection node\n ngDevMode && assertDataNext(adjustedIndex);\n const tData = tView.data;\n\n viewData[adjustedIndex] = node;\n\n // Every node adds a value to the static data array to avoid a sparse array\n if (adjustedIndex >= tData.length) {\n const tNode = tData[adjustedIndex] =\n createTNode(type, adjustedIndex, name, attrs, tParent, null);\n if (!isParent && previousOrParentNode) {\n const previousTNode = previousOrParentNode.tNode;\n previousTNode.next = tNode;\n if (previousTNode.dynamicContainerNode) previousTNode.dynamicContainerNode.next = tNode;\n }\n }\n node.tNode = tData[adjustedIndex] as TNode;\n\n // Now link ourselves into the tree.\n if (isParent) {\n currentQueries = null;\n if (previousOrParentNode.tNode.child == null && previousOrParentNode.view === viewData ||\n previousOrParentNode.tNode.type === TNodeType.View) {\n // We are in the same view, which means we are adding content node to the parent View.\n previousOrParentNode.tNode.child = node.tNode;\n }\n }\n }\n\n // View nodes and host elements need to set their host node (components set host nodes later)\n if ((type & TNodeType.ViewOrElement) === TNodeType.ViewOrElement && isState) {\n const lViewData = state as LViewData;\n ngDevMode && assertNotDefined(\n lViewData[HOST_NODE], 'lViewData[HOST_NODE] should not have been initialized');\n lViewData[HOST_NODE] = node;\n if (firstTemplatePass) lViewData[TVIEW].node = node.tNode;\n }\n\n previousOrParentNode = node;\n isParent = true;\n return node;\n}\n\n\n//////////////////////////\n//// Render\n//////////////////////////\n\n/**\n * Resets the application state.\n */\nexport function resetApplicationState() {\n isParent = false;\n previousOrParentNode = null !;\n}\n\n/**\n *\n * @param hostNode Existing node to render into.\n * @param template Template function with the instructions.\n * @param context to pass into the template.\n * @param providedRendererFactory renderer factory to use\n * @param host The host element node to use\n * @param directives Directive defs that should be used for matching\n * @param pipes Pipe defs that should be used for matching\n */\nexport function renderTemplate<T>(\n hostNode: RElement, template: ComponentTemplate<T>, context: T,\n providedRendererFactory: RendererFactory3, host: LElementNode | null,\n directives?: DirectiveDefListOrFactory | null, pipes?: PipeDefListOrFactory | null,\n sanitizer?: Sanitizer | null): LElementNode {\n if (host == null) {\n resetApplicationState();\n rendererFactory = providedRendererFactory;\n const tView = getOrCreateTView(template, directives || null, pipes || null, null);\n host = createLNode(\n -1, TNodeType.Element, hostNode, null, null,\n createLViewData(\n providedRendererFactory.createRenderer(null, null), tView, {}, LViewFlags.CheckAlways,\n sanitizer));\n }\n const hostView = host.data !;\n ngDevMode && assertDefined(hostView, 'Host node should have an LView defined in host.data.');\n renderComponentOrTemplate(host, hostView, context, template);\n return host;\n}\n\n/**\n * Used for creating the LViewNode of a dynamic embedded view,\n * either through ViewContainerRef.createEmbeddedView() or TemplateRef.createEmbeddedView().\n * Such lViewNode will then be renderer with renderEmbeddedTemplate() (see below).\n */\nexport function createEmbeddedViewNode<T>(\n tView: TView, context: T, renderer: Renderer3, queries?: LQueries | null): LViewNode {\n const _isParent = isParent;\n const _previousOrParentNode = previousOrParentNode;\n isParent = true;\n previousOrParentNode = null !;\n\n const lView =\n createLViewData(renderer, tView, context, LViewFlags.CheckAlways, getCurrentSanitizer());\n if (queries) {\n lView[QUERIES] = queries.createView();\n }\n const viewNode = createLNode(-1, TNodeType.View, null, null, null, lView);\n\n isParent = _isParent;\n previousOrParentNode = _previousOrParentNode;\n return viewNode;\n}\n\n/**\n * Used for rendering embedded views (e.g. dynamically created views)\n *\n * Dynamically created views must store/retrieve their TViews differently from component views\n * because their template functions are nested in the template functions of their hosts, creating\n * closures. If their host template happens to be an embedded template in a loop (e.g. ngFor inside\n * an ngFor), the nesting would mean we'd have multiple instances of the template function, so we\n * can't store TViews in the template function itself (as we do for comps). Instead, we store the\n * TView for dynamically created views on their host TNode, which only has one instance.\n */\nexport function renderEmbeddedTemplate<T>(\n viewNode: LViewNode | LElementNode, tView: TView, context: T, rf: RenderFlags): LViewNode|\n LElementNode {\n const _isParent = isParent;\n const _previousOrParentNode = previousOrParentNode;\n let oldView: LViewData;\n if (viewNode.data ![PARENT] == null && viewNode.data ![CONTEXT] && !tView.template) {\n // This is a root view inside the view tree\n tickRootContext(viewNode.data ![CONTEXT] as RootContext);\n } else {\n try {\n isParent = true;\n previousOrParentNode = null !;\n\n oldView = enterView(viewNode.data !, viewNode);\n namespaceHTML();\n tView.template !(rf, context);\n if (rf & RenderFlags.Update) {\n refreshView();\n } else {\n viewNode.data ![TVIEW].firstTemplatePass = firstTemplatePass = false;\n }\n } finally {\n // renderEmbeddedTemplate() is called twice in fact, once for creation only and then once for\n // update. When for creation only, leaveView() must not trigger view hooks, nor clean flags.\n const isCreationOnly = (rf & RenderFlags.Create) === RenderFlags.Create;\n leaveView(oldView !, isCreationOnly);\n isParent = _isParent;\n previousOrParentNode = _previousOrParentNode;\n }\n }\n return viewNode;\n}\n\nexport function renderComponentOrTemplate<T>(\n node: LElementNode, hostView: LViewData, componentOrContext: T,\n template?: ComponentTemplate<T>) {\n const oldView = enterView(hostView, node);\n try {\n if (rendererFactory.begin) {\n rendererFactory.begin();\n }\n if (template) {\n namespaceHTML();\n template(getRenderFlags(hostView), componentOrContext !);\n refreshView();\n } else {\n executeInitAndContentHooks();\n\n // Element was stored at 0 in data and directive was stored at 0 in directives\n // in renderComponent()\n setHostBindings(_ROOT_DIRECTIVE_INDICES);\n componentRefresh(0, HEADER_OFFSET);\n }\n } finally {\n if (rendererFactory.end) {\n rendererFactory.end();\n }\n leaveView(oldView);\n }\n}\n\n/**\n * This function returns the default configuration of rendering flags depending on when the\n * template is in creation mode or update mode. By default, the update block is run with the\n * creation block when the view is in creation mode. Otherwise, the update block is run\n * alone.\n *\n * Dynamically created views do NOT use this configuration (update block and create block are\n * always run separately).\n */\nfunction getRenderFlags(view: LViewData): RenderFlags {\n return view[FLAGS] & LViewFlags.CreationMode ? RenderFlags.Create | RenderFlags.Update :\n RenderFlags.Update;\n}\n\n//////////////////////////\n//// Namespace\n//////////////////////////\n\nlet _currentNamespace: string|null = null;\n\nexport function namespaceSVG() {\n _currentNamespace = 'http://www.w3.org/2000/svg/';\n}\n\nexport function namespaceMathML() {\n _currentNamespace = 'http://www.w3.org/1998/MathML/';\n}\n\nexport function namespaceHTML() {\n _currentNamespace = null;\n}\n\n//////////////////////////\n//// Element\n//////////////////////////\n\n/**\n * Creates an empty element using {@link elementStart} and {@link elementEnd}\n *\n * @param index Index of the element in the data array\n * @param name Name of the DOM Node\n * @param attrs Statically bound set of attributes to be written into the DOM element on creation.\n * @param localRefs A set of local reference bindings on the element.\n */\nexport function element(\n index: number, name: string, attrs?: TAttributes | null, localRefs?: string[] | null): void {\n elementStart(index, name, attrs, localRefs);\n elementEnd();\n}\n\n/**\n * Create DOM element. The instruction must later be followed by `elementEnd()` call.\n *\n * @param index Index of the element in the LViewData array\n * @param name Name of the DOM Node\n * @param attrs Statically bound set of attributes to be written into the DOM element on creation.\n * @param localRefs A set of local reference bindings on the element.\n *\n * Attributes and localRefs are passed as an array of strings where elements with an even index\n * hold an attribute name and elements with an odd index hold an attribute value, ex.:\n * ['id', 'warning5', 'class', 'alert']\n */\nexport function elementStart(\n index: number, name: string, attrs?: TAttributes | null,\n localRefs?: string[] | null): RElement {\n ngDevMode &&\n assertEqual(viewData[BINDING_INDEX], -1, 'elements should be created before any bindings');\n\n ngDevMode && ngDevMode.rendererCreateElement++;\n\n const native = elementCreate(name);\n\n ngDevMode && assertDataInRange(index - 1);\n\n const node: LElementNode =\n createLNode(index, TNodeType.Element, native !, name, attrs || null, null);\n currentElementNode = node;\n\n if (attrs) {\n setUpAttributes(native, attrs);\n }\n appendChild(getParentLNode(node), native, viewData);\n createDirectivesAndLocals(localRefs);\n return native;\n}\n/**\n * Creates a native element from a tag name, using a renderer.\n * @param name the tag name\n * @param overriddenRenderer Optional A renderer to override the default one\n * @returns the element created\n */\nexport function elementCreate(name: string, overriddenRenderer?: Renderer3): RElement {\n let native: RElement;\n const rendererToUse = overriddenRenderer || renderer;\n\n if (isProceduralRenderer(rendererToUse)) {\n native = rendererToUse.createElement(name, _currentNamespace);\n } else {\n if (_currentNamespace === null) {\n native = rendererToUse.createElement(name);\n } else {\n native = rendererToUse.createElementNS(_currentNamespace, name);\n }\n }\n return native;\n}\n\n/**\n * Creates directive instances and populates local refs.\n *\n * @param localRefs Local refs of the current node\n */\nfunction createDirectivesAndLocals(localRefs?: string[] | null) {\n const node = previousOrParentNode;\n\n if (firstTemplatePass) {\n ngDevMode && ngDevMode.firstTemplatePass++;\n cacheMatchingDirectivesForNode(node.tNode, tView, localRefs || null);\n } else {\n instantiateDirectivesDirectly();\n }\n saveResolvedLocalsInData();\n}\n\n/**\n * On first template pass, we match each node against available directive selectors and save\n * the resulting defs in the correct instantiation order for subsequent change detection runs\n * (so dependencies are always created before the directives that inject them).\n */\nfunction cacheMatchingDirectivesForNode(\n tNode: TNode, tView: TView, localRefs: string[] | null): void {\n // Please make sure to have explicit type for `exportsMap`. Inferred type triggers bug in tsickle.\n const exportsMap: ({[key: string]: number} | null) = localRefs ? {'': -1} : null;\n const matches = tView.currentMatches = findDirectiveMatches(tNode);\n if (matches) {\n for (let i = 0; i < matches.length; i += 2) {\n const def = matches[i] as DirectiveDefInternal<any>;\n const valueIndex = i + 1;\n resolveDirective(def, valueIndex, matches, tView);\n saveNameToExportMap(matches[valueIndex] as number, def, exportsMap);\n }\n }\n if (exportsMap) cacheMatchingLocalNames(tNode, localRefs, exportsMap);\n}\n\n/** Matches the current node against all available selectors. */\nfunction findDirectiveMatches(tNode: TNode): CurrentMatchesList|null {\n const registry = tView.directiveRegistry;\n let matches: any[]|null = null;\n if (registry) {\n for (let i = 0; i < registry.length; i++) {\n const def = registry[i];\n if (isNodeMatchingSelectorList(tNode, def.selectors !)) {\n if ((def as ComponentDefInternal<any>).template) {\n if (tNode.flags & TNodeFlags.isComponent) throwMultipleComponentError(tNode);\n tNode.flags = TNodeFlags.isComponent;\n }\n if (def.diPublic) def.diPublic(def);\n (matches || (matches = [])).push(def, null);\n }\n }\n }\n return matches as CurrentMatchesList;\n}\n\nexport function resolveDirective(\n def: DirectiveDefInternal<any>, valueIndex: number, matches: CurrentMatchesList,\n tView: TView): any {\n if (matches[valueIndex] === null) {\n matches[valueIndex] = CIRCULAR;\n const instance = def.factory();\n (tView.directives || (tView.directives = [])).push(def);\n return directiveCreate(matches[valueIndex] = tView.directives !.length - 1, instance, def);\n } else if (matches[valueIndex] === CIRCULAR) {\n // If we revisit this directive before it's resolved, we know it's circular\n throwCyclicDependencyError(def.type);\n }\n return null;\n}\n\n/** Stores index of component's host element so it will be queued for view refresh during CD. */\nfunction queueComponentIndexForCheck(dirIndex: number): void {\n if (firstTemplatePass) {\n (tView.components || (tView.components = [])).push(dirIndex, viewData.length - 1);\n }\n}\n\n/** Stores index of directive and host element so it will be queued for binding refresh during CD.\n */\nfunction queueHostBindingForCheck(dirIndex: number): void {\n // Must subtract the header offset because hostBindings functions are generated with\n // instructions that expect element indices that are NOT adjusted (e.g. elementProperty).\n ngDevMode &&\n assertEqual(firstTemplatePass, true, 'Should only be called in first template pass.');\n (tView.hostBindings || (tView.hostBindings = [\n ])).push(dirIndex, viewData.length - 1 - HEADER_OFFSET);\n}\n\n/** Sets the context for a ChangeDetectorRef to the given instance. */\nexport function initChangeDetectorIfExisting(\n injector: LInjector | null, instance: any, view: LViewData): void {\n if (injector && injector.changeDetectorRef != null) {\n (injector.changeDetectorRef as ViewRef<any>)._setComponentContext(view, instance);\n }\n}\n\nexport function isComponent(tNode: TNode): boolean {\n return (tNode.flags & TNodeFlags.isComponent) === TNodeFlags.isComponent;\n}\n\n/**\n * This function instantiates the given directives.\n */\nfunction instantiateDirectivesDirectly() {\n const tNode = previousOrParentNode.tNode;\n const count = tNode.flags & TNodeFlags.DirectiveCountMask;\n\n if (count > 0) {\n const start = tNode.flags >> TNodeFlags.DirectiveStartingIndexShift;\n const end = start + count;\n const tDirectives = tView.directives !;\n\n for (let i = start; i < end; i++) {\n const def: DirectiveDefInternal<any> = tDirectives[i];\n directiveCreate(i, def.factory(), def);\n }\n }\n}\n\n/** Caches local names and their matching directive indices for query and template lookups. */\nfunction cacheMatchingLocalNames(\n tNode: TNode, localRefs: string[] | null, exportsMap: {[key: string]: number}): void {\n if (localRefs) {\n const localNames: (string | number)[] = tNode.localNames = [];\n\n // Local names must be stored in tNode in the same order that localRefs are defined\n // in the template to ensure the data is loaded in the same slots as their refs\n // in the template (for template queries).\n for (let i = 0; i < localRefs.length; i += 2) {\n const index = exportsMap[localRefs[i + 1]];\n if (index == null) throw new Error(`Export of name '${localRefs[i + 1]}' not found!`);\n localNames.push(localRefs[i], index);\n }\n }\n}\n\n/**\n * Builds up an export map as directives are created, so local refs can be quickly mapped\n * to their directive instances.\n */\nfunction saveNameToExportMap(\n index: number, def: DirectiveDefInternal<any>| ComponentDefInternal<any>,\n exportsMap: {[key: string]: number} | null) {\n if (exportsMap) {\n if (def.exportAs) exportsMap[def.exportAs] = index;\n if ((def as ComponentDefInternal<any>).template) exportsMap[''] = index;\n }\n}\n\n/**\n * Takes a list of local names and indices and pushes the resolved local variable values\n * to LViewData in the same order as they are loaded in the template with load().\n */\nfunction saveResolvedLocalsInData(): void {\n const localNames = previousOrParentNode.tNode.localNames;\n if (localNames) {\n for (let i = 0; i < localNames.length; i += 2) {\n const index = localNames[i + 1] as number;\n const value = index === -1 ? previousOrParentNode.native : directives ![index];\n viewData.push(value);\n }\n }\n}\n\n/**\n * Gets TView from a template function or creates a new TView\n * if it doesn't already exist.\n *\n * @param template The template from which to get static data\n * @param directives Directive defs that should be saved on TView\n * @param pipes Pipe defs that should be saved on TView\n * @returns TView\n */\nfunction getOrCreateTView(\n template: ComponentTemplate<any>, directives: DirectiveDefListOrFactory | null,\n pipes: PipeDefListOrFactory | null, viewQuery: ComponentQuery<any>| null): TView {\n // TODO(misko): reading `ngPrivateData` here is problematic for two reasons\n // 1. It is a megamorphic call on each invocation.\n // 2. For nested embedded views (ngFor inside ngFor) the template instance is per\n // outer template invocation, which means that no such property will exist\n // Correct solution is to only put `ngPrivateData` on the Component template\n // and not on embedded templates.\n\n return template.ngPrivateData ||\n (template.ngPrivateData = createTView(-1, template, directives, pipes, viewQuery) as never);\n}\n\n/**\n * Creates a TView instance\n *\n * @param viewIndex The viewBlockId for inline views, or -1 if it's a component/dynamic\n * @param directives Registry of directives for this view\n * @param pipes Registry of pipes for this view\n */\nexport function createTView(\n viewIndex: number, template: ComponentTemplate<any>| null,\n directives: DirectiveDefListOrFactory | null, pipes: PipeDefListOrFactory | null,\n viewQuery: ComponentQuery<any>| null): TView {\n ngDevMode && ngDevMode.tView++;\n return {\n id: viewIndex,\n template: template,\n viewQuery: viewQuery,\n node: null !,\n data: HEADER_FILLER.slice(), // Fill in to match HEADER_OFFSET in LViewData\n childIndex: -1, // Children set in addToViewTree(), if any\n bindingStartIndex: -1, // Set in initBindings()\n directives: null,\n firstTemplatePass: true,\n initHooks: null,\n checkHooks: null,\n contentHooks: null,\n contentCheckHooks: null,\n viewHooks: null,\n viewCheckHooks: null,\n destroyHooks: null,\n pipeDestroyHooks: null,\n cleanup: null,\n hostBindings: null,\n contentQueries: null,\n components: null,\n directiveRegistry: typeof directives === 'function' ? directives() : directives,\n pipeRegistry: typeof pipes === 'function' ? pipes() : pipes,\n currentMatches: null\n };\n}\n\nfunction setUpAttributes(native: RElement, attrs: TAttributes): void {\n const isProc = isProceduralRenderer(renderer);\n let i = 0;\n\n while (i < attrs.length) {\n const attrName = attrs[i];\n if (attrName === AttributeMarker.SelectOnly) break;\n if (attrName === NG_PROJECT_AS_ATTR_NAME) {\n i += 2;\n } else {\n ngDevMode && ngDevMode.rendererSetAttribute++;\n if (attrName === AttributeMarker.NamespaceURI) {\n // Namespaced attributes\n const namespaceURI = attrs[i + 1] as string;\n const attrName = attrs[i + 2] as string;\n const attrVal = attrs[i + 3] as string;\n isProc ?\n (renderer as ProceduralRenderer3)\n .setAttribute(native, attrName, attrVal, namespaceURI) :\n native.setAttributeNS(namespaceURI, attrName, attrVal);\n i += 4;\n } else {\n // Standard attributes\n const attrVal = attrs[i + 1];\n isProc ?\n (renderer as ProceduralRenderer3)\n .setAttribute(native, attrName as string, attrVal as string) :\n native.setAttribute(attrName as string, attrVal as string);\n i += 2;\n }\n }\n }\n}\n\nexport function createError(text: string, token: any) {\n return new Error(`Renderer: ${text} [${stringify(token)}]`);\n}\n\n\n/**\n * Locates the host native element, used for bootstrapping existing nodes into rendering pipeline.\n *\n * @param elementOrSelector Render element or CSS selector to locate the element.\n */\nexport function locateHostElement(\n factory: RendererFactory3, elementOrSelector: RElement | string): RElement|null {\n ngDevMode && assertDataInRange(-1);\n rendererFactory = factory;\n const defaultRenderer = factory.createRenderer(null, null);\n const rNode = typeof elementOrSelector === 'string' ?\n (isProceduralRenderer(defaultRenderer) ?\n defaultRenderer.selectRootElement(elementOrSelector) :\n defaultRenderer.querySelector(elementOrSelector)) :\n elementOrSelector;\n if (ngDevMode && !rNode) {\n if (typeof elementOrSelector === 'string') {\n throw createError('Host node with selector not found:', elementOrSelector);\n } else {\n throw createError('Host node is required:', elementOrSelector);\n }\n }\n return rNode;\n}\n\n/**\n * Creates the host LNode.\n *\n * @param rNode Render host element.\n * @param def ComponentDef\n *\n * @returns LElementNode created\n */\nexport function hostElement(\n tag: string, rNode: RElement | null, def: ComponentDefInternal<any>,\n sanitizer?: Sanitizer | null): LElementNode {\n resetApplicationState();\n const node = createLNode(\n 0, TNodeType.Element, rNode, null, null,\n createLViewData(\n renderer, getOrCreateTView(def.template, def.directiveDefs, def.pipeDefs, def.viewQuery),\n null, def.onPush ? LViewFlags.Dirty : LViewFlags.CheckAlways, sanitizer));\n\n if (firstTemplatePass) {\n node.tNode.flags = TNodeFlags.isComponent;\n if (def.diPublic) def.diPublic(def);\n tView.directives = [def];\n }\n\n return node;\n}\n\n\n/**\n * Adds an event listener to the current node.\n *\n * If an output exists on one of the node's directives, it also subscribes to the output\n * and saves the subscription for later cleanup.\n *\n * @param eventName Name of the event\n * @param listenerFn The function to be called when event emits\n * @param useCapture Whether or not to use capture in event listener.\n */\nexport function listener(\n eventName: string, listenerFn: (e?: any) => any, useCapture = false): void {\n ngDevMode && assertPreviousIsParent();\n const node = previousOrParentNode;\n const native = node.native as RElement;\n ngDevMode && ngDevMode.rendererAddEventListener++;\n\n // In order to match current behavior, native DOM event listeners must be added for all\n // events (including outputs).\n if (isProceduralRenderer(renderer)) {\n const wrappedListener = wrapListenerWithDirtyLogic(viewData, listenerFn);\n const cleanupFn = renderer.listen(native, eventName, wrappedListener);\n storeCleanupFn(viewData, cleanupFn);\n } else {\n const wrappedListener = wrapListenerWithDirtyAndDefault(viewData, listenerFn);\n native.addEventListener(eventName, wrappedListener, useCapture);\n const cleanupInstances = getCleanup(viewData);\n cleanupInstances.push(wrappedListener);\n if (firstTemplatePass) {\n getTViewCleanup(viewData).push(\n eventName, node.tNode.index, cleanupInstances !.length - 1, useCapture);\n }\n }\n\n let tNode: TNode|null = node.tNode;\n if (tNode.outputs === undefined) {\n // if we create TNode here, inputs must be undefined so we know they still need to be\n // checked\n tNode.outputs = generatePropertyAliases(node.tNode.flags, BindingDirection.Output);\n }\n\n const outputs = tNode.outputs;\n let outputData: PropertyAliasValue|undefined;\n if (outputs && (outputData = outputs[eventName])) {\n createOutput(outputData, listenerFn);\n }\n}\n\n/**\n * Iterates through the outputs associated with a particular event name and subscribes to\n * each output.\n */\nfunction createOutput(outputs: PropertyAliasValue, listener: Function): void {\n for (let i = 0; i < outputs.length; i += 2) {\n ngDevMode && assertDataInRange(outputs[i] as number, directives !);\n const subscription = directives ![outputs[i] as number][outputs[i + 1]].subscribe(listener);\n storeCleanupWithContext(viewData, subscription, subscription.unsubscribe);\n }\n}\n\n/**\n * Saves context for this cleanup function in LView.cleanupInstances.\n *\n * On the first template pass, saves in TView:\n * - Cleanup function\n * - Index of context we just saved in LView.cleanupInstances\n */\nexport function storeCleanupWithContext(\n view: LViewData | null, context: any, cleanupFn: Function): void {\n if (!view) view = viewData;\n getCleanup(view).push(context);\n\n if (view[TVIEW].firstTemplatePass) {\n getTViewCleanup(view).push(cleanupFn, view[CLEANUP] !.length - 1);\n }\n}\n\n/**\n * Saves the cleanup function itself in LView.cleanupInstances.\n *\n * This is necessary for functions that are wrapped with their contexts, like in renderer2\n * listeners.\n *\n * On the first template pass, the index of the cleanup function is saved in TView.\n */\nexport function storeCleanupFn(view: LViewData, cleanupFn: Function): void {\n getCleanup(view).push(cleanupFn);\n\n if (view[TVIEW].firstTemplatePass) {\n getTViewCleanup(view).push(view[CLEANUP] !.length - 1, null);\n }\n}\n\n/** Mark the end of the element. */\nexport function elementEnd() {\n if (isParent) {\n isParent = false;\n } else {\n ngDevMode && assertHasParent();\n previousOrParentNode = getParentLNode(previousOrParentNode) as LElementNode;\n }\n ngDevMode && assertNodeType(previousOrParentNode, TNodeType.Element);\n const queries = previousOrParentNode.queries;\n queries && queries.addNode(previousOrParentNode);\n queueLifecycleHooks(previousOrParentNode.tNode.flags, tView);\n currentElementNode = null;\n}\n\n/**\n * Updates the value of removes an attribute on an Element.\n *\n * @param number index The index of the element in the data array\n * @param name name The name of the attribute.\n * @param value value The attribute is removed when value is `null` or `undefined`.\n * Otherwise the attribute value is set to the stringified value.\n * @param sanitizer An optional function used to sanitize the value.\n */\nexport function elementAttribute(\n index: number, name: string, value: any, sanitizer?: SanitizerFn): void {\n if (value !== NO_CHANGE) {\n const element = loadElement(index);\n if (value == null) {\n ngDevMode && ngDevMode.rendererRemoveAttribute++;\n isProceduralRenderer(renderer) ? renderer.removeAttribute(element.native, name) :\n element.native.removeAttribute(name);\n } else {\n ngDevMode && ngDevMode.rendererSetAttribute++;\n const strValue = sanitizer == null ? stringify(value) : sanitizer(value);\n isProceduralRenderer(renderer) ? renderer.setAttribute(element.native, name, strValue) :\n element.native.setAttribute(name, strValue);\n }\n }\n}\n\n/**\n * Update a property on an Element.\n *\n * If the property name also exists as an input property on one of the element's directives,\n * the component property will be set instead of the element property. This check must\n * be conducted at runtime so child components that add new @Inputs don't have to be re-compiled.\n *\n * @param index The index of the element to update in the data array\n * @param propName Name of property. Because it is going to DOM, this is not subject to\n * renaming as part of minification.\n * @param value New value to write.\n * @param sanitizer An optional function used to sanitize the value.\n */\n\nexport function elementProperty<T>(\n index: number, propName: string, value: T | NO_CHANGE, sanitizer?: SanitizerFn): void {\n if (value === NO_CHANGE) return;\n const node = loadElement(index) as LElementNode;\n const tNode = node.tNode;\n // if tNode.inputs is undefined, a listener has created outputs, but inputs haven't\n // yet been checked\n if (tNode && tNode.inputs === undefined) {\n // mark inputs as checked\n tNode.inputs = generatePropertyAliases(node.tNode.flags, BindingDirection.Input);\n }\n\n const inputData = tNode && tNode.inputs;\n let dataValue: PropertyAliasValue|undefined;\n if (inputData && (dataValue = inputData[propName])) {\n setInputsForProperty(dataValue, value);\n markDirtyIfOnPush(node);\n } else {\n // It is assumed that the sanitizer is only added when the compiler determines that the property\n // is risky, so sanitization can be done without further checks.\n value = sanitizer != null ? (sanitizer(value) as any) : value;\n const native = node.native;\n ngDevMode && ngDevMode.rendererSetProperty++;\n isProceduralRenderer(renderer) ? renderer.setProperty(native, propName, value) :\n (native.setProperty ? native.setProperty(propName, value) :\n (native as any)[propName] = value);\n }\n}\n\n/**\n * Constructs a TNode object from the arguments.\n *\n * @param type The type of the node\n * @param adjustedIndex The index of the TNode in TView.data, adjusted for HEADER_OFFSET\n * @param tagName The tag name of the node\n * @param attrs The attributes defined on this node\n * @param parent The parent of this node\n * @param tViews Any TViews attached to this node\n * @returns the TNode object\n */\nexport function createTNode(\n type: TNodeType, adjustedIndex: number, tagName: string | null, attrs: TAttributes | null,\n parent: TElementNode | TContainerNode | null, tViews: TView[] | null): TNode {\n ngDevMode && ngDevMode.tNode++;\n return {\n type: type,\n index: adjustedIndex,\n flags: 0,\n tagName: tagName,\n attrs: attrs,\n localNames: null,\n initialInputs: undefined,\n inputs: undefined,\n outputs: undefined,\n tViews: tViews,\n next: null,\n child: null,\n parent: parent,\n dynamicContainerNode: null,\n detached: null,\n stylingTemplate: null,\n projection: null\n };\n}\n\n/**\n * Given a list of directive indices and minified input names, sets the\n * input properties on the corresponding directives.\n */\nfunction setInputsForProperty(inputs: PropertyAliasValue, value: any): void {\n for (let i = 0; i < inputs.length; i += 2) {\n ngDevMode && assertDataInRange(inputs[i] as number, directives !);\n directives ![inputs[i] as number][inputs[i + 1]] = value;\n }\n}\n\n/**\n * Consolidates all inputs or outputs of all directives on this logical node.\n *\n * @param number lNodeFlags logical node flags\n * @param Direction direction whether to consider inputs or outputs\n * @returns PropertyAliases|null aggregate of all properties if any, `null` otherwise\n */\nfunction generatePropertyAliases(\n tNodeFlags: TNodeFlags, direction: BindingDirection): PropertyAliases|null {\n const count = tNodeFlags & TNodeFlags.DirectiveCountMask;\n let propStore: PropertyAliases|null = null;\n\n if (count > 0) {\n const start = tNodeFlags >> TNodeFlags.DirectiveStartingIndexShift;\n const end = start + count;\n const isInput = direction === BindingDirection.Input;\n const defs = tView.directives !;\n\n for (let i = start; i < end; i++) {\n const directiveDef = defs[i] as DirectiveDefInternal<any>;\n const propertyAliasMap: {[publicName: string]: string} =\n isInput ? directiveDef.inputs : directiveDef.outputs;\n for (let publicName in propertyAliasMap) {\n if (propertyAliasMap.hasOwnProperty(publicName)) {\n propStore = propStore || {};\n const internalName = propertyAliasMap[publicName];\n const hasProperty = propStore.hasOwnProperty(publicName);\n hasProperty ? propStore[publicName].push(i, internalName) :\n (propStore[publicName] = [i, internalName]);\n }\n }\n }\n }\n return propStore;\n}\n\n/**\n * Add or remove a class in a `classList` on a DOM element.\n *\n * This instruction is meant to handle the [class.foo]=\"exp\" case\n *\n * @param index The index of the element to update in the data array\n * @param className Name of class to toggle. Because it is going to DOM, this is not subject to\n * renaming as part of minification.\n * @param value A value indicating if a given class should be added or removed.\n */\nexport function elementClassProp<T>(\n index: number, stylingIndex: number, value: T | NO_CHANGE): void {\n updateElementClassProp(getStylingContext(index), stylingIndex, value ? true : false);\n}\n\n/**\n * Assign any inline style values to the element during creation mode.\n *\n * This instruction is meant to be called during creation mode to apply all styling\n * (e.g. `style=\"...\"`) values to the element. This is also where the provided index\n * value is allocated for the styling details for its corresponding element (the element\n * index is the previous index value from this one).\n *\n * (Note this function calls `elementStylingApply` immediately when called.)\n *\n *\n * @param index Index value which will be allocated to store styling data for the element.\n * (Note that this is not the element index, but rather an index value allocated\n * specifically for element styling--the index must be the next index after the element\n * index.)\n * @param classDeclarations A key/value array of CSS classes that will be registered on the element.\n * Each individual style will be used on the element as long as it is not overridden\n * by any classes placed on the element by multiple (`[class]`) or singular (`[class.named]`)\n * bindings. If a class binding changes its value to a falsy value then the matching initial\n * class value that are passed in here will be applied to the element (if matched).\n * @param styleDeclarations A key/value array of CSS styles that will be registered on the element.\n * Each individual style will be used on the element as long as it is not overridden\n * by any styles placed on the element by multiple (`[style]`) or singular (`[style.prop]`)\n * bindings. If a style binding changes its value to null then the initial styling\n * values that are passed in here will be applied to the element (if matched).\n * @param styleSanitizer An optional sanitizer function that will be used (if provided)\n * to sanitize the any CSS property values that are applied to the element (during rendering).\n */\nexport function elementStyling<T>(\n classDeclarations?: (string | boolean | InitialStylingFlags)[] | null,\n styleDeclarations?: (string | boolean | InitialStylingFlags)[] | null,\n styleSanitizer?: StyleSanitizeFn | null): void {\n const lElement = currentElementNode !;\n const tNode = lElement.tNode;\n if (!tNode.stylingTemplate) {\n // initialize the styling template.\n tNode.stylingTemplate =\n createStylingContextTemplate(classDeclarations, styleDeclarations, styleSanitizer);\n }\n if (styleDeclarations && styleDeclarations.length ||\n classDeclarations && classDeclarations.length) {\n elementStylingApply(tNode.index - HEADER_OFFSET);\n }\n}\n\n/**\n * Retrieve the `StylingContext` at a given index.\n *\n * This method lazily creates the `StylingContext`. This is because in most cases\n * we have styling without any bindings. Creating `StylingContext` eagerly would mean that\n * every style declaration such as `<div style=\"color: red\">` would result `StyleContext`\n * which would create unnecessary memory pressure.\n *\n * @param index Index of the style allocation. See: `elementStyling`.\n */\nfunction getStylingContext(index: number): StylingContext {\n let stylingContext = load<StylingContext>(index);\n if (!Array.isArray(stylingContext)) {\n const lElement = stylingContext as any as LElementNode;\n const tNode = lElement.tNode;\n ngDevMode &&\n assertDefined(tNode.stylingTemplate, 'getStylingContext() called before elementStyling()');\n stylingContext = viewData[index + HEADER_OFFSET] =\n allocStylingContext(lElement, tNode.stylingTemplate !);\n }\n return stylingContext;\n}\n\n/**\n * Apply all styling values to the element which have been queued by any styling instructions.\n *\n * This instruction is meant to be run once one or more `elementStyle` and/or `elementStyleProp`\n * have been issued against the element. This function will also determine if any styles have\n * changed and will then skip the operation if there is nothing new to render.\n *\n * Once called then all queued styles will be flushed.\n *\n * @param index Index of the element's styling storage that will be rendered.\n * (Note that this is not the element index, but rather an index value allocated\n * specifically for element styling--the index must be the next index after the element\n * index.)\n */\nexport function elementStylingApply<T>(index: number): void {\n renderElementStyles(getStylingContext(index), renderer);\n}\n\n/**\n * Queue a given style to be rendered on an Element.\n *\n * If the style value is `null` then it will be removed from the element\n * (or assigned a different value depending if there are any styles placed\n * on the element with `elementStyle` or any styles that are present\n * from when the element was created (with `elementStyling`).\n *\n * (Note that the styling instruction will not be applied until `elementStylingApply` is called.)\n *\n * @param index Index of the element's styling storage to change in the data array.\n * (Note that this is not the element index, but rather an index value allocated\n * specifically for element styling--the index must be the next index after the element\n * index.)\n * @param styleIndex Index of the style property on this element. (Monotonically increasing.)\n * @param styleName Name of property. Because it is going to DOM this is not subject to\n * renaming as part of minification.\n * @param value New value to write (null to remove).\n * @param suffix Optional suffix. Used with scalar values to add unit such as `px`.\n * Note that when a suffix is provided then the underlying sanitizer will\n * be ignored.\n */\nexport function elementStyleProp<T>(\n index: number, styleIndex: number, value: T | null, suffix?: string): void {\n let valueToAdd: string|null = null;\n if (value) {\n if (suffix) {\n // when a suffix is applied then it will bypass\n // sanitization entirely (b/c a new string is created)\n valueToAdd = stringify(value) + suffix;\n } else {\n // sanitization happens by dealing with a String value\n // this means that the string value will be passed through\n // into the style rendering later (which is where the value\n // will be sanitized before it is applied)\n valueToAdd = value as any as string;\n }\n }\n updateElementStyleProp(getStylingContext(index), styleIndex, valueToAdd);\n}\n\n/**\n * Queue a key/value map of styles to be rendered on an Element.\n *\n * This instruction is meant to handle the `[style]=\"exp\"` usage. When styles are applied to\n * the Element they will then be placed with respect to any styles set with `elementStyleProp`.\n * If any styles are set to `null` then they will be removed from the element (unless the same\n * style properties have been assigned to the element during creation using `elementStyling`).\n *\n * (Note that the styling instruction will not be applied until `elementStylingApply` is called.)\n *\n * @param index Index of the element's styling storage to change in the data array.\n * (Note that this is not the element index, but rather an index value allocated\n * specifically for element styling--the index must be the next index after the element\n * index.)\n * @param classes A key/value style map of CSS classes that will be added to the given element.\n * Any missing classes (that have already been applied to the element beforehand) will be\n * removed (unset) from the element's list of CSS classes.\n * @param styles A key/value style map of the styles that will be applied to the given element.\n * Any missing styles (that have already been applied to the element beforehand) will be\n * removed (unset) from the element's styling.\n */\nexport function elementStylingMap<T>(\n index: number, classes: {[key: string]: any} | string | null,\n styles?: {[styleName: string]: any} | null): void {\n updateStylingMap(getStylingContext(index), classes, styles);\n}\n\n//////////////////////////\n//// Text\n//////////////////////////\n\n/**\n * Create static text node\n *\n * @param index Index of the node in the data array\n * @param value Value to write. This value will be stringified.\n */\nexport function text(index: number, value?: any): void {\n ngDevMode &&\n assertEqual(viewData[BINDING_INDEX], -1, 'text nodes should be created before bindings');\n ngDevMode && ngDevMode.rendererCreateTextNode++;\n const textNode = createTextNode(value, renderer);\n const node = createLNode(index, TNodeType.Element, textNode, null, null);\n\n // Text nodes are self closing.\n isParent = false;\n appendChild(getParentLNode(node), textNode, viewData);\n}\n\n/**\n * Create text node with binding\n * Bindings should be handled externally with the proper interpolation(1-8) method\n *\n * @param index Index of the node in the data array.\n * @param value Stringified value to write.\n */\nexport function textBinding<T>(index: number, value: T | NO_CHANGE): void {\n if (value !== NO_CHANGE) {\n ngDevMode && assertDataInRange(index + HEADER_OFFSET);\n const existingNode = loadElement(index) as any as LTextNode;\n ngDevMode && assertDefined(existingNode, 'LNode should exist');\n ngDevMode && assertDefined(existingNode.native, 'native element should exist');\n ngDevMode && ngDevMode.rendererSetText++;\n isProceduralRenderer(renderer) ? renderer.setValue(existingNode.native, stringify(value)) :\n existingNode.native.textContent = stringify(value);\n }\n}\n\n//////////////////////////\n//// Directive\n//////////////////////////\n\n/**\n * Create a directive and their associated content queries.\n *\n * NOTE: directives can be created in order other than the index order. They can also\n * be retrieved before they are created in which case the value will be null.\n *\n * @param directive The directive instance.\n * @param directiveDef DirectiveDef object which contains information about the template.\n */\nexport function directiveCreate<T>(\n directiveDefIdx: number, directive: T,\n directiveDef: DirectiveDefInternal<T>| ComponentDefInternal<T>): T {\n const instance = baseDirectiveCreate(directiveDefIdx, directive, directiveDef);\n\n ngDevMode && assertDefined(previousOrParentNode.tNode, 'previousOrParentNode.tNode');\n const tNode = previousOrParentNode.tNode;\n\n const isComponent = (directiveDef as ComponentDefInternal<T>).template;\n if (isComponent) {\n addComponentLogic(directiveDefIdx, directive, directiveDef as ComponentDefInternal<T>);\n }\n\n if (firstTemplatePass) {\n // Init hooks are queued now so ngOnInit is called in host components before\n // any projected components.\n queueInitHooks(directiveDefIdx, directiveDef.onInit, directiveDef.doCheck, tView);\n\n if (directiveDef.hostBindings) queueHostBindingForCheck(directiveDefIdx);\n }\n\n if (tNode && tNode.attrs) {\n setInputsFromAttrs(directiveDefIdx, instance, directiveDef.inputs, tNode);\n }\n\n if (directiveDef.contentQueries) {\n directiveDef.contentQueries();\n }\n\n return instance;\n}\n\nfunction addComponentLogic<T>(\n directiveIndex: number, instance: T, def: ComponentDefInternal<T>): void {\n const tView = getOrCreateTView(def.template, def.directiveDefs, def.pipeDefs, def.viewQuery);\n\n // Only component views should be added to the view tree directly. Embedded views are\n // accessed through their containers because they may be removed / re-added later.\n const componentView = addToViewTree(\n viewData, previousOrParentNode.tNode.index as number,\n createLViewData(\n rendererFactory.createRenderer(previousOrParentNode.native as RElement, def.rendererType),\n tView, null, def.onPush ? LViewFlags.Dirty : LViewFlags.CheckAlways,\n getCurrentSanitizer()));\n\n // We need to set the host node/data here because when the component LNode was created,\n // we didn't yet know it was a component (just an element).\n (previousOrParentNode as{data: LViewData}).data = componentView;\n (componentView as LViewData)[HOST_NODE] = previousOrParentNode as LElementNode;\n\n initChangeDetectorIfExisting(previousOrParentNode.nodeInjector, instance, componentView);\n\n if (firstTemplatePass) queueComponentIndexForCheck(directiveIndex);\n}\n\n/**\n * A lighter version of directiveCreate() that is used for the root component\n *\n * This version does not contain features that we don't already support at root in\n * current Angular. Example: local refs and inputs on root component.\n */\nexport function baseDirectiveCreate<T>(\n index: number, directive: T,\n directiveDef: DirectiveDefInternal<T>| ComponentDefInternal<T>): T {\n ngDevMode &&\n assertEqual(viewData[BINDING_INDEX], -1, 'directives should be created before any bindings');\n ngDevMode && assertPreviousIsParent();\n\n Object.defineProperty(\n directive, NG_HOST_SYMBOL, {enumerable: false, value: previousOrParentNode});\n\n if (directives == null) viewData[DIRECTIVES] = directives = [];\n\n ngDevMode && assertDataNext(index, directives);\n directives[index] = directive;\n\n if (firstTemplatePass) {\n const flags = previousOrParentNode.tNode.flags;\n if ((flags & TNodeFlags.DirectiveCountMask) === 0) {\n // When the first directive is created:\n // - save the index,\n // - set the number of directives to 1\n previousOrParentNode.tNode.flags =\n index << TNodeFlags.DirectiveStartingIndexShift | flags & TNodeFlags.isComponent | 1;\n } else {\n // Only need to bump the size when subsequent directives are created\n ngDevMode && assertNotEqual(\n flags & TNodeFlags.DirectiveCountMask, TNodeFlags.DirectiveCountMask,\n 'Reached the max number of directives');\n previousOrParentNode.tNode.flags++;\n }\n } else {\n const diPublic = directiveDef !.diPublic;\n if (diPublic) diPublic(directiveDef !);\n }\n\n if (directiveDef !.attributes != null && previousOrParentNode.tNode.type == TNodeType.Element) {\n setUpAttributes(\n (previousOrParentNode as LElementNode).native, directiveDef !.attributes as string[]);\n }\n\n return directive;\n}\n\n/**\n * Sets initial input properties on directive instances from attribute data\n *\n * @param directiveIndex Index of the directive in directives array\n * @param instance Instance of the directive on which to set the initial inputs\n * @param inputs The list of inputs from the directive def\n * @param tNode The static data for this node\n */\nfunction setInputsFromAttrs<T>(\n directiveIndex: number, instance: T, inputs: {[P in keyof T]: string;}, tNode: TNode): void {\n let initialInputData = tNode.initialInputs as InitialInputData | undefined;\n if (initialInputData === undefined || directiveIndex >= initialInputData.length) {\n initialInputData = generateInitialInputs(directiveIndex, inputs, tNode);\n }\n\n const initialInputs: InitialInputs|null = initialInputData[directiveIndex];\n if (initialInputs) {\n for (let i = 0; i < initialInputs.length; i += 2) {\n (instance as any)[initialInputs[i]] = initialInputs[i + 1];\n }\n }\n}\n\n/**\n * Generates initialInputData for a node and stores it in the template's static storage\n * so subsequent template invocations don't have to recalculate it.\n *\n * initialInputData is an array containing values that need to be set as input properties\n * for directives on this node, but only once on creation. We need this array to support\n * the case where you set an @Input property of a directive using attribute-like syntax.\n * e.g. if you have a `name` @Input, you can set it once like this:\n *\n * <my-component name=\"Bess\"></my-component>\n *\n * @param directiveIndex Index to store the initial input data\n * @param inputs The list of inputs from the directive def\n * @param tNode The static data on this node\n */\nfunction generateInitialInputs(\n directiveIndex: number, inputs: {[key: string]: string}, tNode: TNode): InitialInputData {\n const initialInputData: InitialInputData = tNode.initialInputs || (tNode.initialInputs = []);\n initialInputData[directiveIndex] = null;\n\n const attrs = tNode.attrs !;\n let i = 0;\n while (i < attrs.length) {\n const attrName = attrs[i];\n if (attrName === AttributeMarker.SelectOnly) break;\n if (attrName === AttributeMarker.NamespaceURI) {\n // We do not allow inputs on namespaced attributes.\n i += 4;\n continue;\n }\n const minifiedInputName = inputs[attrName];\n const attrValue = attrs[i + 1];\n\n if (minifiedInputName !== undefined) {\n const inputsToStore: InitialInputs =\n initialInputData[directiveIndex] || (initialInputData[directiveIndex] = []);\n inputsToStore.push(minifiedInputName, attrValue as string);\n }\n\n i += 2;\n }\n return initialInputData;\n}\n\n//////////////////////////\n//// ViewContainer & View\n//////////////////////////\n\n/**\n * Creates a LContainer, either from a container instruction, or for a ViewContainerRef.\n *\n * @param parentLNode the LNode in which the container's content will be rendered\n * @param currentView The parent view of the LContainer\n * @param isForViewContainerRef Optional a flag indicating the ViewContainerRef case\n * @returns LContainer\n */\nexport function createLContainer(\n parentLNode: LNode, currentView: LViewData, isForViewContainerRef?: boolean): LContainer {\n ngDevMode && assertDefined(parentLNode, 'containers should have a parent');\n let renderParent = canInsertNativeNode(parentLNode, currentView) ?\n parentLNode as LElementNode | LViewNode :\n null;\n if (renderParent && renderParent.tNode.type === TNodeType.View) {\n renderParent = getParentLNode(renderParent as LViewNode) !.data[RENDER_PARENT];\n }\n return [\n isForViewContainerRef ? null : 0, // active index\n currentView, // parent\n null, // next\n null, // queries\n [], // views\n renderParent as LElementNode\n ];\n}\n\n/**\n * Creates an LContainerNode.\n *\n * Only `LViewNodes` can go into `LContainerNodes`.\n *\n * @param index The index of the container in the data array\n * @param template Optional inline template\n * @param tagName The name of the container element, if applicable\n * @param attrs The attrs attached to the container, if applicable\n * @param localRefs A set of local reference bindings on the element.\n */\nexport function container(\n index: number, template?: ComponentTemplate<any>, tagName?: string | null, attrs?: TAttributes,\n localRefs?: string[] | null): void {\n ngDevMode &&\n assertEqual(\n viewData[BINDING_INDEX], -1, 'container nodes should be created before any bindings');\n\n const currentParent = isParent ? previousOrParentNode : getParentLNode(previousOrParentNode) !;\n const lContainer = createLContainer(currentParent, viewData);\n\n const comment = renderer.createComment(ngDevMode ? 'container' : '');\n const node =\n createLNode(index, TNodeType.Container, comment, tagName || null, attrs || null, lContainer);\n appendChild(getParentLNode(node), comment, viewData);\n\n if (firstTemplatePass) {\n node.tNode.tViews = template ?\n createTView(-1, template, tView.directiveRegistry, tView.pipeRegistry, null) :\n [];\n }\n\n // Containers are added to the current view tree instead of their embedded views\n // because views can be removed and re-inserted.\n addToViewTree(viewData, index + HEADER_OFFSET, node.data);\n\n const queries = node.queries;\n if (queries) {\n // prepare place for matching nodes from views inserted into a given container\n lContainer[QUERIES] = queries.container();\n }\n\n createDirectivesAndLocals(localRefs);\n\n isParent = false;\n ngDevMode && assertNodeType(previousOrParentNode, TNodeType.Container);\n queries && queries.addNode(node); // check if a given container node matches\n queueLifecycleHooks(node.tNode.flags, tView);\n}\n\n/**\n * Sets a container up to receive views.\n *\n * @param index The index of the container in the data array\n */\nexport function containerRefreshStart(index: number): void {\n previousOrParentNode = loadElement(index) as LNode;\n ngDevMode && assertNodeType(previousOrParentNode, TNodeType.Container);\n isParent = true;\n (previousOrParentNode as LContainerNode).data[ACTIVE_INDEX] = 0;\n\n if (!checkNoChangesMode) {\n // We need to execute init hooks here so ngOnInit hooks are called in top level views\n // before they are called in embedded views (for backwards compatibility).\n executeInitHooks(viewData, tView, creationMode);\n }\n}\n\n/**\n * Marks the end of the LContainerNode.\n *\n * Marking the end of LContainerNode is the time when to child Views get inserted or removed.\n */\nexport function containerRefreshEnd(): void {\n if (isParent) {\n isParent = false;\n } else {\n ngDevMode && assertNodeType(previousOrParentNode, TNodeType.View);\n ngDevMode && assertHasParent();\n previousOrParentNode = getParentLNode(previousOrParentNode) !;\n }\n ngDevMode && assertNodeType(previousOrParentNode, TNodeType.Container);\n const container = previousOrParentNode as LContainerNode;\n ngDevMode && assertNodeType(container, TNodeType.Container);\n const nextIndex = container.data[ACTIVE_INDEX] !;\n\n // remove extra views at the end of the container\n while (nextIndex < container.data[VIEWS].length) {\n removeView(container, nextIndex);\n }\n}\n\n/**\n * Goes over dynamic embedded views (ones created through ViewContainerRef APIs) and refreshes them\n * by executing an associated template function.\n */\nfunction refreshDynamicEmbeddedViews(lViewData: LViewData) {\n for (let current = getLViewChild(lViewData); current !== null; current = current[NEXT]) {\n // Note: current can be an LViewData or an LContainer instance, but here we are only interested\n // in LContainer. We can tell it's an LContainer because its length is less than the LViewData\n // header.\n if (current.length < HEADER_OFFSET && current[ACTIVE_INDEX] === null) {\n const container = current as LContainer;\n for (let i = 0; i < container[VIEWS].length; i++) {\n const lViewNode = container[VIEWS][i];\n // The directives and pipes are not needed here as an existing view is only being refreshed.\n const dynamicViewData = lViewNode.data;\n ngDevMode && assertDefined(dynamicViewData[TVIEW], 'TView must be allocated');\n renderEmbeddedTemplate(\n lViewNode, dynamicViewData[TVIEW], dynamicViewData[CONTEXT] !, RenderFlags.Update);\n }\n }\n }\n}\n\n\n/**\n * Looks for a view with a given view block id inside a provided LContainer.\n * Removes views that need to be deleted in the process.\n *\n * @param containerNode where to search for views\n * @param startIdx starting index in the views array to search from\n * @param viewBlockId exact view block id to look for\n * @returns index of a found view or -1 if not found\n */\nfunction scanForView(\n containerNode: LContainerNode, startIdx: number, viewBlockId: number): LViewNode|null {\n const views = containerNode.data[VIEWS];\n for (let i = startIdx; i < views.length; i++) {\n const viewAtPositionId = views[i].data[TVIEW].id;\n if (viewAtPositionId === viewBlockId) {\n return views[i];\n } else if (viewAtPositionId < viewBlockId) {\n // found a view that should not be at this position - remove\n removeView(containerNode, i);\n } else {\n // found a view with id greater than the one we are searching for\n // which means that required view doesn't exist and can't be found at\n // later positions in the views array - stop the search here\n break;\n }\n }\n return null;\n}\n\n/**\n * Marks the start of an embedded view.\n *\n * @param viewBlockId The ID of this view\n * @return boolean Whether or not this view is in creation mode\n */\nexport function embeddedViewStart(viewBlockId: number): RenderFlags {\n const container =\n (isParent ? previousOrParentNode : getParentLNode(previousOrParentNode)) as LContainerNode;\n ngDevMode && assertNodeType(container, TNodeType.Container);\n const lContainer = container.data;\n let viewNode: LViewNode|null = scanForView(container, lContainer[ACTIVE_INDEX] !, viewBlockId);\n\n if (viewNode) {\n previousOrParentNode = viewNode;\n ngDevMode && assertNodeType(previousOrParentNode, TNodeType.View);\n isParent = true;\n enterView(viewNode.data, viewNode);\n } else {\n // When we create a new LView, we always reset the state of the instructions.\n const newView = createLViewData(\n renderer, getOrCreateEmbeddedTView(viewBlockId, container), null, LViewFlags.CheckAlways,\n getCurrentSanitizer());\n\n if (lContainer[QUERIES]) {\n newView[QUERIES] = lContainer[QUERIES] !.createView();\n }\n\n enterView(\n newView, viewNode = createLNode(viewBlockId, TNodeType.View, null, null, null, newView));\n }\n if (container) {\n if (creationMode) {\n // it is a new view, insert it into collection of views for a given container\n insertView(container, viewNode, lContainer[ACTIVE_INDEX] !);\n }\n lContainer[ACTIVE_INDEX] !++;\n }\n return getRenderFlags(viewNode.data);\n}\n\n/**\n * Initialize the TView (e.g. static data) for the active embedded view.\n *\n * Each embedded view block must create or retrieve its own TView. Otherwise, the embedded view's\n * static data for a particular node would overwrite the static data for a node in the view above\n * it with the same index (since it's in the same template).\n *\n * @param viewIndex The index of the TView in TNode.tViews\n * @param parent The parent container in which to look for the view's static data\n * @returns TView\n */\nfunction getOrCreateEmbeddedTView(viewIndex: number, parent: LContainerNode): TView {\n ngDevMode && assertNodeType(parent, TNodeType.Container);\n const containerTViews = (parent !.tNode as TContainerNode).tViews as TView[];\n ngDevMode && assertDefined(containerTViews, 'TView expected');\n ngDevMode && assertEqual(Array.isArray(containerTViews), true, 'TViews should be in an array');\n if (viewIndex >= containerTViews.length || containerTViews[viewIndex] == null) {\n containerTViews[viewIndex] =\n createTView(viewIndex, null, tView.directiveRegistry, tView.pipeRegistry, null);\n }\n return containerTViews[viewIndex];\n}\n\n/** Marks the end of an embedded view. */\nexport function embeddedViewEnd(): void {\n refreshView();\n isParent = false;\n previousOrParentNode = viewData[HOST_NODE] as LViewNode;\n leaveView(viewData[PARENT] !);\n ngDevMode && assertEqual(isParent, false, 'isParent');\n ngDevMode && assertNodeType(previousOrParentNode, TNodeType.View);\n}\n\n/////////////\n\n/**\n * Refreshes components by entering the component view and processing its bindings, queries, etc.\n *\n * @param directiveIndex Directive index in LViewData[DIRECTIVES]\n * @param adjustedElementIndex Element index in LViewData[] (adjusted for HEADER_OFFSET)\n */\nexport function componentRefresh<T>(directiveIndex: number, adjustedElementIndex: number): void {\n ngDevMode && assertDataInRange(adjustedElementIndex);\n const element = viewData[adjustedElementIndex] as LElementNode;\n ngDevMode && assertNodeType(element, TNodeType.Element);\n ngDevMode &&\n assertDefined(element.data, `Component's host node should have an LViewData attached.`);\n const hostView = element.data !;\n\n // Only attached CheckAlways components or attached, dirty OnPush components should be checked\n if (viewAttached(hostView) && hostView[FLAGS] & (LViewFlags.CheckAlways | LViewFlags.Dirty)) {\n ngDevMode && assertDataInRange(directiveIndex, directives !);\n detectChangesInternal(hostView, element, directives ![directiveIndex]);\n }\n}\n\n/** Returns a boolean for whether the view is attached */\nexport function viewAttached(view: LViewData): boolean {\n return (view[FLAGS] & LViewFlags.Attached) === LViewFlags.Attached;\n}\n\n/**\n * Instruction to distribute projectable nodes among <ng-content> occurrences in a given template.\n * It takes all the selectors from the entire component's template and decides where\n * each projected node belongs (it re-distributes nodes among \"buckets\" where each \"bucket\" is\n * backed by a selector).\n *\n * This function requires CSS selectors to be provided in 2 forms: parsed (by a compiler) and text,\n * un-parsed form.\n *\n * The parsed form is needed for efficient matching of a node against a given CSS selector.\n * The un-parsed, textual form is needed for support of the ngProjectAs attribute.\n *\n * Having a CSS selector in 2 different formats is not ideal, but alternatives have even more\n * drawbacks:\n * - having only a textual form would require runtime parsing of CSS selectors;\n * - we can't have only a parsed as we can't re-construct textual form from it (as entered by a\n * template author).\n *\n * @param selectors A collection of parsed CSS selectors\n * @param rawSelectors A collection of CSS selectors in the raw, un-parsed form\n */\nexport function projectionDef(selectors?: CssSelectorList[], textSelectors?: string[]): void {\n const componentNode: LElementNode = findComponentHost(viewData);\n\n if (!componentNode.tNode.projection) {\n const noOfNodeBuckets = selectors ? selectors.length + 1 : 1;\n const pData: (TNode | null)[] = componentNode.tNode.projection =\n new Array(noOfNodeBuckets).fill(null);\n const tails: (TNode | null)[] = pData.slice();\n\n let componentChild = componentNode.tNode.child;\n\n while (componentChild !== null) {\n const bucketIndex =\n selectors ? matchingSelectorIndex(componentChild, selectors, textSelectors !) : 0;\n const nextNode = componentChild.next;\n\n if (tails[bucketIndex]) {\n tails[bucketIndex] !.next = componentChild;\n } else {\n pData[bucketIndex] = componentChild;\n componentChild.next = null;\n }\n tails[bucketIndex] = componentChild;\n\n componentChild = nextNode;\n }\n }\n}\n\n/**\n * Stack used to keep track of projection nodes in projection() instruction.\n *\n * This is deliberately created outside of projection() to avoid allocating\n * a new array each time the function is called. Instead the array will be\n * re-used by each invocation. This works because the function is not reentrant.\n */\nconst projectionNodeStack: LProjectionNode[] = [];\n\n/**\n * Inserts previously re-distributed projected nodes. This instruction must be preceded by a call\n * to the projectionDef instruction.\n *\n * @param nodeIndex\n * @param selectorIndex:\n * - 0 when the selector is `*` (or unspecified as this is the default value),\n * - 1 based index of the selector from the {@link projectionDef}\n */\nexport function projection(nodeIndex: number, selectorIndex: number = 0, attrs?: string[]): void {\n const node = createLNode(nodeIndex, TNodeType.Projection, null, null, attrs || null, null);\n\n // We can't use viewData[HOST_NODE] because projection nodes can be nested in embedded views.\n if (node.tNode.projection === null) node.tNode.projection = selectorIndex;\n\n // `<ng-content>` has no content\n isParent = false;\n\n // re-distribution of projectable nodes is stored on a component's view level\n const parent = getParentLNode(node);\n\n if (canInsertNativeNode(parent, viewData)) {\n const componentNode = findComponentHost(viewData);\n let nodeToProject = (componentNode.tNode.projection as(TNode | null)[])[selectorIndex];\n let projectedView = componentNode.view;\n let projectionNodeIndex = -1;\n let grandparent: LContainerNode;\n const renderParent = parent.tNode.type === TNodeType.View ?\n (grandparent = getParentLNode(parent) as LContainerNode) &&\n grandparent.data[RENDER_PARENT] ! :\n parent as LElementNode;\n\n while (nodeToProject) {\n if (nodeToProject.type === TNodeType.Projection) {\n // This node is re-projected, so we must go up the tree to get its projected nodes.\n const currentComponentHost = findComponentHost(projectedView);\n const firstProjectedNode = (currentComponentHost.tNode.projection as(\n TNode | null)[])[nodeToProject.projection as number];\n\n if (firstProjectedNode) {\n projectionNodeStack[++projectionNodeIndex] = projectedView[nodeToProject.index];\n nodeToProject = firstProjectedNode;\n projectedView = currentComponentHost.view;\n continue;\n }\n } else {\n const lNode = projectedView[nodeToProject.index];\n lNode.tNode.flags |= TNodeFlags.isProjected;\n appendProjectedNode(\n lNode as LTextNode | LElementNode | LContainerNode, parent, viewData, renderParent);\n }\n\n // If we are finished with a list of re-projected nodes, we need to get\n // back to the root projection node that was re-projected.\n if (nodeToProject.next === null && projectedView !== componentNode.view) {\n // move down into the view of the component we're projecting right now\n const lNode = projectionNodeStack[projectionNodeIndex--];\n nodeToProject = lNode.tNode;\n projectedView = lNode.view;\n }\n nodeToProject = nodeToProject.next;\n }\n }\n}\n\n/**\n * Adds LViewData or LContainer to the end of the current view tree.\n *\n * This structure will be used to traverse through nested views to remove listeners\n * and call onDestroy callbacks.\n *\n * @param currentView The view where LViewData or LContainer should be added\n * @param adjustedHostIndex Index of the view's host node in LViewData[], adjusted for header\n * @param state The LViewData or LContainer to add to the view tree\n * @returns The state passed in\n */\nexport function addToViewTree<T extends LViewData|LContainer>(\n currentView: LViewData, adjustedHostIndex: number, state: T): T {\n if (currentView[TAIL]) {\n currentView[TAIL] ![NEXT] = state;\n } else if (firstTemplatePass) {\n tView.childIndex = adjustedHostIndex;\n }\n currentView[TAIL] = state;\n return state;\n}\n\n///////////////////////////////\n//// Change detection\n///////////////////////////////\n\n/** If node is an OnPush component, marks its LViewData dirty. */\nexport function markDirtyIfOnPush(node: LElementNode): void {\n // Because data flows down the component tree, ancestors do not need to be marked dirty\n if (node.data && !(node.data[FLAGS] & LViewFlags.CheckAlways)) {\n node.data[FLAGS] |= LViewFlags.Dirty;\n }\n}\n\n/**\n * Wraps an event listener so its host view and its ancestor views will be marked dirty\n * whenever the event fires. Necessary to support OnPush components.\n */\nexport function wrapListenerWithDirtyLogic(\n view: LViewData, listenerFn: (e?: any) => any): (e: Event) => any {\n return function(e: any) {\n markViewDirty(view);\n return listenerFn(e);\n };\n}\n\n/**\n * Wraps an event listener so its host view and its ancestor views will be marked dirty\n * whenever the event fires. Also wraps with preventDefault behavior.\n */\nexport function wrapListenerWithDirtyAndDefault(\n view: LViewData, listenerFn: (e?: any) => any): EventListener {\n return function wrapListenerIn_markViewDirty(e: Event) {\n markViewDirty(view);\n if (listenerFn(e) === false) {\n e.preventDefault();\n // Necessary for legacy browsers that don't support preventDefault (e.g. IE)\n e.returnValue = false;\n }\n };\n}\n\n/** Marks current view and all ancestors dirty */\nexport function markViewDirty(view: LViewData): void {\n let currentView: LViewData = view;\n\n while (currentView[PARENT] != null) {\n currentView[FLAGS] |= LViewFlags.Dirty;\n currentView = currentView[PARENT] !;\n }\n currentView[FLAGS] |= LViewFlags.Dirty;\n ngDevMode && assertDefined(currentView[CONTEXT], 'rootContext');\n scheduleTick(currentView[CONTEXT] as RootContext);\n}\n\n\n/**\n * Used to schedule change detection on the whole application.\n *\n * Unlike `tick`, `scheduleTick` coalesces multiple calls into one change detection run.\n * It is usually called indirectly by calling `markDirty` when the view needs to be\n * re-rendered.\n *\n * Typically `scheduleTick` uses `requestAnimationFrame` to coalesce multiple\n * `scheduleTick` requests. The scheduling function can be overridden in\n * `renderComponent`'s `scheduler` option.\n */\nexport function scheduleTick<T>(rootContext: RootContext) {\n if (rootContext.clean == _CLEAN_PROMISE) {\n let res: null|((val: null) => void);\n rootContext.clean = new Promise<null>((r) => res = r);\n rootContext.scheduler(() => {\n tickRootContext(rootContext);\n res !(null);\n rootContext.clean = _CLEAN_PROMISE;\n });\n }\n}\n\n/**\n * Used to perform change detection on the whole application.\n *\n * This is equivalent to `detectChanges`, but invoked on root component. Additionally, `tick`\n * executes lifecycle hooks and conditionally checks components based on their\n * `ChangeDetectionStrategy` and dirtiness.\n *\n * The preferred way to trigger change detection is to call `markDirty`. `markDirty` internally\n * schedules `tick` using a scheduler in order to coalesce multiple `markDirty` calls into a\n * single change detection run. By default, the scheduler is `requestAnimationFrame`, but can\n * be changed when calling `renderComponent` and providing the `scheduler` option.\n */\nexport function tick<T>(component: T): void {\n const rootView = getRootView(component);\n const rootContext = rootView[CONTEXT] as RootContext;\n tickRootContext(rootContext);\n}\n\nfunction tickRootContext(rootContext: RootContext) {\n for (let i = 0; i < rootContext.components.length; i++) {\n const rootComponent = rootContext.components[i];\n const hostNode = _getComponentHostLElementNode(rootComponent);\n\n ngDevMode && assertDefined(hostNode.data, 'Component host node should be attached to an LView');\n renderComponentOrTemplate(hostNode, getRootView(rootComponent), rootComponent);\n }\n}\n\n/**\n * Retrieve the root view from any component by walking the parent `LViewData` until\n * reaching the root `LViewData`.\n *\n * @param component any component\n */\n\nexport function getRootView(component: any): LViewData {\n ngDevMode && assertDefined(component, 'component');\n const lElementNode = _getComponentHostLElementNode(component);\n let lViewData = lElementNode.view;\n while (lViewData[PARENT]) {\n lViewData = lViewData[PARENT] !;\n }\n return lViewData;\n}\n\n/**\n * Synchronously perform change detection on a component (and possibly its sub-components).\n *\n * This function triggers change detection in a synchronous way on a component. There should\n * be very little reason to call this function directly since a preferred way to do change\n * detection is to {@link markDirty} the component and wait for the scheduler to call this method\n * at some future point in time. This is because a single user action often results in many\n * components being invalidated and calling change detection on each component synchronously\n * would be inefficient. It is better to wait until all components are marked as dirty and\n * then perform single change detection across all of the components\n *\n * @param component The component which the change detection should be performed on.\n */\nexport function detectChanges<T>(component: T): void {\n const hostNode = _getComponentHostLElementNode(component);\n ngDevMode &&\n assertDefined(\n hostNode.data, 'Component host node should be attached to an LViewData instance.');\n detectChangesInternal(hostNode.data as LViewData, hostNode, component);\n}\n\n\n/**\n * Checks the change detector and its children, and throws if any changes are detected.\n *\n * This is used in development mode to verify that running change detection doesn't\n * introduce other changes.\n */\nexport function checkNoChanges<T>(component: T): void {\n checkNoChangesMode = true;\n try {\n detectChanges(component);\n } finally {\n checkNoChangesMode = false;\n }\n}\n\n/** Checks the view of the component provided. Does not gate on dirty checks or execute doCheck. */\nexport function detectChangesInternal<T>(\n hostView: LViewData, hostNode: LElementNode, component: T) {\n const oldView = enterView(hostView, hostNode);\n const hostTView = hostView[TVIEW];\n const template = hostTView.template !;\n const viewQuery = hostTView.viewQuery;\n\n try {\n namespaceHTML();\n createViewQuery(viewQuery, hostView[FLAGS], component);\n template(getRenderFlags(hostView), component);\n refreshView();\n updateViewQuery(viewQuery, component);\n } finally {\n leaveView(oldView);\n }\n}\n\nfunction createViewQuery<T>(\n viewQuery: ComponentQuery<{}>| null, flags: LViewFlags, component: T): void {\n if (viewQuery && (flags & LViewFlags.CreationMode)) {\n viewQuery(RenderFlags.Create, component);\n }\n}\n\nfunction updateViewQuery<T>(viewQuery: ComponentQuery<{}>| null, component: T): void {\n if (viewQuery) {\n viewQuery(RenderFlags.Update, component);\n }\n}\n\n\n/**\n * Mark the component as dirty (needing change detection).\n *\n * Marking a component dirty will schedule a change detection on this\n * component at some point in the future. Marking an already dirty\n * component as dirty is a noop. Only one outstanding change detection\n * can be scheduled per component tree. (Two components bootstrapped with\n * separate `renderComponent` will have separate schedulers)\n *\n * When the root component is bootstrapped with `renderComponent`, a scheduler\n * can be provided.\n *\n * @param component Component to mark as dirty.\n */\nexport function markDirty<T>(component: T) {\n ngDevMode && assertDefined(component, 'component');\n const lElementNode = _getComponentHostLElementNode(component);\n markViewDirty(lElementNode.view);\n}\n\n///////////////////////////////\n//// Bindings & interpolations\n///////////////////////////////\n\nexport interface NO_CHANGE {\n // This is a brand that ensures that this type can never match anything else\n brand: 'NO_CHANGE';\n}\n\n/** A special value which designates that a value has not changed. */\nexport const NO_CHANGE = {} as NO_CHANGE;\n\n/**\n * Initializes the binding start index. Will get inlined.\n *\n * This function must be called before any binding related function is called\n * (ie `bind()`, `interpolationX()`, `pureFunctionX()`)\n */\nfunction initBindings() {\n ngDevMode && assertEqual(\n viewData[BINDING_INDEX], -1,\n 'Binding index should not yet be set ' + viewData[BINDING_INDEX]);\n if (tView.bindingStartIndex === -1) {\n tView.bindingStartIndex = viewData.length;\n }\n viewData[BINDING_INDEX] = tView.bindingStartIndex;\n}\n\n/**\n * Creates a single value binding.\n *\n * @param value Value to diff\n */\nexport function bind<T>(value: T): T|NO_CHANGE {\n return bindingUpdated(value) ? value : NO_CHANGE;\n}\n\n/**\n * Reserves slots for pure functions (`pureFunctionX` instructions)\n *\n * Bindings for pure functions are stored after the LNodes in the data array but before the binding.\n *\n * ----------------------------------------------------------------------------\n * | LNodes ... | pure function bindings | regular bindings / interpolations |\n * ----------------------------------------------------------------------------\n * ^\n * TView.bindingStartIndex\n *\n * Pure function instructions are given an offset from TView.bindingStartIndex.\n * Subtracting the offset from TView.bindingStartIndex gives the first index where the bindings\n * are stored.\n *\n * NOTE: reserveSlots instructions are only ever allowed at the very end of the creation block\n */\nexport function reserveSlots(numSlots: number) {\n // Init the slots with a unique `NO_CHANGE` value so that the first change is always detected\n // whether it happens or not during the first change detection pass - pure functions checks\n // might be skipped when short-circuited.\n viewData.length += numSlots;\n viewData.fill(NO_CHANGE, -numSlots);\n // We need to initialize the binding in case a `pureFunctionX` kind of binding instruction is\n // called first in the update section.\n initBindings();\n}\n\n/**\n * Sets up the binding index before executing any `pureFunctionX` instructions.\n *\n * The index must be restored after the pure function is executed\n *\n * {@link reserveSlots}\n */\nexport function moveBindingIndexToReservedSlot(offset: number): number {\n const currentSlot = viewData[BINDING_INDEX];\n viewData[BINDING_INDEX] = tView.bindingStartIndex - offset;\n return currentSlot;\n}\n\n/**\n * Restores the binding index to the given value.\n *\n * This function is typically used to restore the index after a `pureFunctionX` has\n * been executed.\n */\nexport function restoreBindingIndex(index: number): void {\n viewData[BINDING_INDEX] = index;\n}\n\n/**\n * Create interpolation bindings with a variable number of expressions.\n *\n * If there are 1 to 8 expressions `interpolation1()` to `interpolation8()` should be used instead.\n * Those are faster because there is no need to create an array of expressions and iterate over it.\n *\n * `values`:\n * - has static text at even indexes,\n * - has evaluated expressions at odd indexes.\n *\n * Returns the concatenated string when any of the arguments changes, `NO_CHANGE` otherwise.\n */\nexport function interpolationV(values: any[]): string|NO_CHANGE {\n ngDevMode && assertLessThan(2, values.length, 'should have at least 3 values');\n ngDevMode && assertEqual(values.length % 2, 1, 'should have an odd number of values');\n\n let different = false;\n\n for (let i = 1; i < values.length; i += 2) {\n // Check if bindings (odd indexes) have changed\n bindingUpdated(values[i]) && (different = true);\n }\n\n if (!different) {\n return NO_CHANGE;\n }\n\n // Build the updated content\n let content = values[0];\n for (let i = 1; i < values.length; i += 2) {\n content += stringify(values[i]) + values[i + 1];\n }\n\n return content;\n}\n\n/**\n * Creates an interpolation binding with 1 expression.\n *\n * @param prefix static value used for concatenation only.\n * @param v0 value checked for change.\n * @param suffix static value used for concatenation only.\n */\nexport function interpolation1(prefix: string, v0: any, suffix: string): string|NO_CHANGE {\n const different = bindingUpdated(v0);\n\n return different ? prefix + stringify(v0) + suffix : NO_CHANGE;\n}\n\n/** Creates an interpolation binding with 2 expressions. */\nexport function interpolation2(\n prefix: string, v0: any, i0: string, v1: any, suffix: string): string|NO_CHANGE {\n const different = bindingUpdated2(v0, v1);\n\n return different ? prefix + stringify(v0) + i0 + stringify(v1) + suffix : NO_CHANGE;\n}\n\n/** Creates an interpolation binding with 3 expressions. */\nexport function interpolation3(\n prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, suffix: string): string|\n NO_CHANGE {\n let different = bindingUpdated2(v0, v1);\n different = bindingUpdated(v2) || different;\n\n return different ? prefix + stringify(v0) + i0 + stringify(v1) + i1 + stringify(v2) + suffix :\n NO_CHANGE;\n}\n\n/** Create an interpolation binding with 4 expressions. */\nexport function interpolation4(\n prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any,\n suffix: string): string|NO_CHANGE {\n const different = bindingUpdated4(v0, v1, v2, v3);\n\n return different ?\n prefix + stringify(v0) + i0 + stringify(v1) + i1 + stringify(v2) + i2 + stringify(v3) +\n suffix :\n NO_CHANGE;\n}\n\n/** Creates an interpolation binding with 5 expressions. */\nexport function interpolation5(\n prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any,\n i3: string, v4: any, suffix: string): string|NO_CHANGE {\n let different = bindingUpdated4(v0, v1, v2, v3);\n different = bindingUpdated(v4) || different;\n\n return different ?\n prefix + stringify(v0) + i0 + stringify(v1) + i1 + stringify(v2) + i2 + stringify(v3) + i3 +\n stringify(v4) + suffix :\n NO_CHANGE;\n}\n\n/** Creates an interpolation binding with 6 expressions. */\nexport function interpolation6(\n prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any,\n i3: string, v4: any, i4: string, v5: any, suffix: string): string|NO_CHANGE {\n let different = bindingUpdated4(v0, v1, v2, v3);\n different = bindingUpdated2(v4, v5) || different;\n\n return different ?\n prefix + stringify(v0) + i0 + stringify(v1) + i1 + stringify(v2) + i2 + stringify(v3) + i3 +\n stringify(v4) + i4 + stringify(v5) + suffix :\n NO_CHANGE;\n}\n\n/** Creates an interpolation binding with 7 expressions. */\nexport function interpolation7(\n prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any,\n i3: string, v4: any, i4: string, v5: any, i5: string, v6: any, suffix: string): string|\n NO_CHANGE {\n let different = bindingUpdated4(v0, v1, v2, v3);\n different = bindingUpdated2(v4, v5) || different;\n different = bindingUpdated(v6) || different;\n\n return different ?\n prefix + stringify(v0) + i0 + stringify(v1) + i1 + stringify(v2) + i2 + stringify(v3) + i3 +\n stringify(v4) + i4 + stringify(v5) + i5 + stringify(v6) + suffix :\n NO_CHANGE;\n}\n\n/** Creates an interpolation binding with 8 expressions. */\nexport function interpolation8(\n prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any,\n i3: string, v4: any, i4: string, v5: any, i5: string, v6: any, i6: string, v7: any,\n suffix: string): string|NO_CHANGE {\n let different = bindingUpdated4(v0, v1, v2, v3);\n different = bindingUpdated4(v4, v5, v6, v7) || different;\n\n return different ?\n prefix + stringify(v0) + i0 + stringify(v1) + i1 + stringify(v2) + i2 + stringify(v3) + i3 +\n stringify(v4) + i4 + stringify(v5) + i5 + stringify(v6) + i6 + stringify(v7) + suffix :\n NO_CHANGE;\n}\n\n/** Store a value in the `data` at a given `index`. */\nexport function store<T>(index: number, value: T): void {\n // We don't store any static data for local variables, so the first time\n // we see the template, we should store as null to avoid a sparse array\n const adjustedIndex = index + HEADER_OFFSET;\n if (adjustedIndex >= tView.data.length) {\n tView.data[adjustedIndex] = null;\n }\n viewData[adjustedIndex] = value;\n}\n\n/** Retrieves a value from the `directives` array. */\nexport function loadDirective<T>(index: number): T {\n ngDevMode && assertDefined(directives, 'Directives array should be defined if reading a dir.');\n ngDevMode && assertDataInRange(index, directives !);\n return directives ![index];\n}\n\nexport function loadQueryList<T>(queryListIdx: number): QueryList<T> {\n ngDevMode && assertDefined(\n viewData[CONTENT_QUERIES],\n 'Content QueryList array should be defined if reading a query.');\n ngDevMode && assertDataInRange(queryListIdx, viewData[CONTENT_QUERIES] !);\n\n return viewData[CONTENT_QUERIES] ![queryListIdx];\n}\n\n/** Retrieves a value from current `viewData`. */\nexport function load<T>(index: number): T {\n return loadInternal<T>(index, viewData);\n}\n\nexport function loadElement(index: number): LElementNode {\n return loadElementInternal(index, viewData);\n}\n\n/** Gets the current binding value and increments the binding index. */\nexport function consumeBinding(): any {\n ngDevMode && assertDataInRange(viewData[BINDING_INDEX]);\n ngDevMode &&\n assertNotEqual(\n viewData[viewData[BINDING_INDEX]], NO_CHANGE, 'Stored value should never be NO_CHANGE.');\n return viewData[viewData[BINDING_INDEX]++];\n}\n\n/** Updates binding if changed, then returns whether it was updated. */\nexport function bindingUpdated(value: any): boolean {\n ngDevMode && assertNotEqual(value, NO_CHANGE, 'Incoming value should never be NO_CHANGE.');\n if (viewData[BINDING_INDEX] === -1) initBindings();\n const bindingIndex = viewData[BINDING_INDEX];\n\n if (bindingIndex >= viewData.length) {\n viewData[viewData[BINDING_INDEX]++] = value;\n } else if (isDifferent(viewData[bindingIndex], value)) {\n throwErrorIfNoChangesMode(creationMode, checkNoChangesMode, viewData[bindingIndex], value);\n viewData[viewData[BINDING_INDEX]++] = value;\n } else {\n viewData[BINDING_INDEX]++;\n return false;\n }\n return true;\n}\n\n/** Updates binding if changed, then returns the latest value. */\nexport function checkAndUpdateBinding(value: any): any {\n bindingUpdated(value);\n return value;\n}\n\n/** Updates 2 bindings if changed, then returns whether either was updated. */\nexport function bindingUpdated2(exp1: any, exp2: any): boolean {\n const different = bindingUpdated(exp1);\n return bindingUpdated(exp2) || different;\n}\n\n/** Updates 4 bindings if changed, then returns whether any was updated. */\nexport function bindingUpdated4(exp1: any, exp2: any, exp3: any, exp4: any): boolean {\n const different = bindingUpdated2(exp1, exp2);\n return bindingUpdated2(exp3, exp4) || different;\n}\n\nexport function getTView(): TView {\n return tView;\n}\n\n/**\n * Registers a QueryList, associated with a content query, for later refresh (part of a view\n * refresh).\n */\nexport function registerContentQuery<Q>(queryList: QueryList<Q>): void {\n const savedContentQueriesLength =\n (viewData[CONTENT_QUERIES] || (viewData[CONTENT_QUERIES] = [])).push(queryList);\n if (firstTemplatePass) {\n const currentDirectiveIndex = directives !.length - 1;\n const tViewContentQueries = tView.contentQueries || (tView.contentQueries = []);\n const lastSavedDirectiveIndex =\n tView.contentQueries.length ? tView.contentQueries[tView.contentQueries.length - 2] : -1;\n if (currentDirectiveIndex !== lastSavedDirectiveIndex) {\n tViewContentQueries.push(currentDirectiveIndex, savedContentQueriesLength - 1);\n }\n }\n}\n\nexport function assertPreviousIsParent() {\n assertEqual(isParent, true, 'previousOrParentNode should be a parent');\n}\n\nfunction assertHasParent() {\n assertDefined(getParentLNode(previousOrParentNode), 'previousOrParentNode should have a parent');\n}\n\nfunction assertDataInRange(index: number, arr?: any[]) {\n if (arr == null) arr = viewData;\n assertDataInRangeInternal(index, arr || viewData);\n}\n\nfunction assertDataNext(index: number, arr?: any[]) {\n if (arr == null) arr = viewData;\n assertEqual(\n arr.length, index, `index ${index} expected to be at the end of arr (length ${arr.length})`);\n}\n\n/**\n * On the first template pass, the reserved slots should be set `NO_CHANGE`.\n *\n * If not, they might not have been actually reserved.\n */\nexport function assertReservedSlotInitialized(slotOffset: number, numSlots: number) {\n if (firstTemplatePass) {\n const startIndex = tView.bindingStartIndex - slotOffset;\n for (let i = 0; i < numSlots; i++) {\n assertEqual(\n viewData[startIndex + i], NO_CHANGE,\n 'The reserved slots should be set to `NO_CHANGE` on first template pass');\n }\n }\n}\n\nexport function _getComponentHostLElementNode<T>(component: T): LElementNode {\n ngDevMode && assertDefined(component, 'expecting component got null');\n const lElementNode = (component as any)[NG_HOST_SYMBOL] as LElementNode;\n ngDevMode && assertDefined(component, 'object is not a component');\n return lElementNode;\n}\n\nexport const CLEAN_PROMISE = _CLEAN_PROMISE;\nexport const ROOT_DIRECTIVE_INDICES = _ROOT_DIRECTIVE_INDICES;\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n// We are temporarily importing the existing viewEngine from core so we can be sure we are\n// correctly implementing its interfaces for backwards compatibility.\nimport {Type} from '../core';\nimport {Injector} from '../di/injector';\nimport {Sanitizer} from '../sanitization/security';\n\nimport {assertComponentType, assertDefined} from './assert';\nimport {queueInitHooks, queueLifecycleHooks} from './hooks';\nimport {CLEAN_PROMISE, ROOT_DIRECTIVE_INDICES, _getComponentHostLElementNode, baseDirectiveCreate, createLViewData, createTView, detectChangesInternal, enterView, executeInitAndContentHooks, getRootView, hostElement, initChangeDetectorIfExisting, leaveView, locateHostElement, setHostBindings,} from './instructions';\nimport {ComponentDef, ComponentDefInternal, ComponentType} from './interfaces/definition';\nimport {LElementNode} from './interfaces/node';\nimport {RElement, RendererFactory3, domRendererFactory3} from './interfaces/renderer';\nimport {LViewData, LViewFlags, RootContext, INJECTOR, CONTEXT, TVIEW} from './interfaces/view';\nimport {stringify} from './util';\n\n\n/** Options that control how the component should be bootstrapped. */\nexport interface CreateComponentOptions {\n /** Which renderer factory to use. */\n rendererFactory?: RendererFactory3;\n\n /** A custom sanitizer instance */\n sanitizer?: Sanitizer;\n\n /**\n * Host element on which the component will be bootstrapped. If not specified,\n * the component definition's `tag` is used to query the existing DOM for the\n * element to bootstrap.\n */\n host?: RElement|string;\n\n /** Module injector for the component. If unspecified, the injector will be NULL_INJECTOR. */\n injector?: Injector;\n\n /**\n * List of features to be applied to the created component. Features are simply\n * functions that decorate a component with a certain behavior.\n *\n * Typically, the features in this list are features that cannot be added to the\n * other features list in the component definition because they rely on other factors.\n *\n * Example: `RootLifecycleHooks` is a function that adds lifecycle hook capabilities\n * to root components in a tree-shakable way. It cannot be added to the component\n * features list because there's no way of knowing when the component will be used as\n * a root component.\n */\n hostFeatures?: (<T>(component: T, componentDef: ComponentDef<T, string>) => void)[];\n\n /**\n * A function which is used to schedule change detection work in the future.\n *\n * When marking components as dirty, it is necessary to schedule the work of\n * change detection in the future. This is done to coalesce multiple\n * {@link markDirty} calls into a single changed detection processing.\n *\n * The default value of the scheduler is the `requestAnimationFrame` function.\n *\n * It is also useful to override this function for testing purposes.\n */\n scheduler?: (work: () => void) => void;\n}\n\n// TODO: A hack to not pull in the NullInjector from @angular/core.\nexport const NULL_INJECTOR: Injector = {\n get: (token: any, notFoundValue?: any) => {\n throw new Error('NullInjector: Not found: ' + stringify(token));\n }\n};\n\n/**\n * Bootstraps a Component into an existing host element and returns an instance\n * of the component.\n *\n * Use this function to bootstrap a component into the DOM tree. Each invocation\n * of this function will create a separate tree of components, injectors and\n * change detection cycles and lifetimes. To dynamically insert a new component\n * into an existing tree such that it shares the same injection, change detection\n * and object lifetime, use {@link ViewContainer#createComponent}.\n *\n * @param componentType Component to bootstrap\n * @param options Optional parameters which control bootstrapping\n */\nexport function renderComponent<T>(\n componentType: ComponentType<T>|\n Type<T>/* Type as workaround for: Microsoft/TypeScript/issues/4881 */\n ,\n opts: CreateComponentOptions = {}): T {\n ngDevMode && assertComponentType(componentType);\n const rendererFactory = opts.rendererFactory || domRendererFactory3;\n const sanitizer = opts.sanitizer || null;\n const componentDef =\n (componentType as ComponentType<T>).ngComponentDef as ComponentDefInternal<T>;\n if (componentDef.type != componentType) componentDef.type = componentType;\n let component: T;\n // The first index of the first selector is the tag name.\n const componentTag = componentDef.selectors ![0] ![0] as string;\n const hostNode = locateHostElement(rendererFactory, opts.host || componentTag);\n const rootContext = createRootContext(opts.scheduler || requestAnimationFrame.bind(window));\n\n const rootView: LViewData = createLViewData(\n rendererFactory.createRenderer(hostNode, componentDef.rendererType),\n createTView(-1, null, null, null, null), rootContext,\n componentDef.onPush ? LViewFlags.Dirty : LViewFlags.CheckAlways);\n rootView[INJECTOR] = opts.injector || null;\n\n const oldView = enterView(rootView, null !);\n let elementNode: LElementNode;\n try {\n if (rendererFactory.begin) rendererFactory.begin();\n\n // Create element node at index 0 in data array\n elementNode = hostElement(componentTag, hostNode, componentDef, sanitizer);\n\n // Create directive instance with factory() and store at index 0 in directives array\n rootContext.components.push(\n component = baseDirectiveCreate(0, componentDef.factory(), componentDef) as T);\n initChangeDetectorIfExisting(elementNode.nodeInjector, component, elementNode.data !);\n\n opts.hostFeatures && opts.hostFeatures.forEach((feature) => feature(component, componentDef));\n\n executeInitAndContentHooks();\n setHostBindings(ROOT_DIRECTIVE_INDICES);\n detectChangesInternal(elementNode.data as LViewData, elementNode, component);\n } finally {\n leaveView(oldView);\n if (rendererFactory.end) rendererFactory.end();\n }\n\n return component;\n}\n\nexport function createRootContext(scheduler: (workFn: () => void) => void): RootContext {\n return {\n components: [],\n scheduler: scheduler,\n clean: CLEAN_PROMISE,\n };\n}\n\n/**\n * Used to enable lifecycle hooks on the root component.\n *\n * Include this feature when calling `renderComponent` if the root component\n * you are rendering has lifecycle hooks defined. Otherwise, the hooks won't\n * be called properly.\n *\n * Example:\n *\n * ```\n * renderComponent(AppComponent, {features: [RootLifecycleHooks]});\n * ```\n */\nexport function LifecycleHooksFeature(component: any, def: ComponentDefInternal<any>): void {\n const elementNode = _getComponentHostLElementNode(component);\n\n // Root component is always created at dir index 0\n const tView = elementNode.view[TVIEW];\n queueInitHooks(0, def.onInit, def.doCheck, tView);\n queueLifecycleHooks(elementNode.tNode.flags, tView);\n}\n\n/**\n * Retrieve the root context for any component by walking the parent `LView` until\n * reaching the root `LView`.\n *\n * @param component any component\n */\nfunction getRootContext(component: any): RootContext {\n const rootContext = getRootView(component)[CONTEXT] as RootContext;\n ngDevMode && assertDefined(rootContext, 'rootContext');\n return rootContext;\n}\n\n/**\n * Retrieve the host element of the component.\n *\n * Use this function to retrieve the host element of the component. The host\n * element is the element which the component is associated with.\n *\n * @param component Component for which the host element should be retrieved.\n */\nexport function getHostElement<T>(component: T): HTMLElement {\n return _getComponentHostLElementNode(component).native as any;\n}\n\n/**\n * Retrieves the rendered text for a given component.\n *\n * This function retrieves the host element of a component and\n * and then returns the `textContent` for that element. This implies\n * that the text returned will include re-projected content of\n * the component as well.\n *\n * @param component The component to return the content text for.\n */\nexport function getRenderedText(component: any): string {\n const hostElement = getHostElement(component);\n return hostElement.textContent || '';\n}\n\n/**\n * Wait on component until it is rendered.\n *\n * This function returns a `Promise` which is resolved when the component's\n * change detection is executed. This is determined by finding the scheduler\n * associated with the `component`'s render tree and waiting until the scheduler\n * flushes. If nothing is scheduled, the function returns a resolved promise.\n *\n * Example:\n * ```\n * await whenRendered(myComponent);\n * ```\n *\n * @param component Component to wait upon\n * @returns Promise which resolves when the component is rendered.\n */\nexport function whenRendered(component: any): Promise<null> {\n return getRootContext(component).clean;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {SimpleChange} from '../change_detection/change_detection_util';\nimport {ChangeDetectionStrategy} from '../change_detection/constants';\nimport {Provider} from '../core';\nimport {OnChanges, SimpleChanges} from '../metadata/lifecycle_hooks';\nimport {NgModuleDef, NgModuleDefInternal} from '../metadata/ng_module';\nimport {RendererType2} from '../render/api';\nimport {Type} from '../type';\nimport {resolveRendererType2} from '../view/util';\n\nimport {diPublic} from './di';\nimport {ComponentDefFeature, ComponentDefInternal, ComponentQuery, ComponentTemplate, ComponentType, DirectiveDefFeature, DirectiveDefInternal, DirectiveDefListOrFactory, DirectiveType, DirectiveTypesOrFactory, PipeDefInternal, PipeType, PipeTypesOrFactory} from './interfaces/definition';\nimport {CssSelectorList, SelectorFlags} from './interfaces/projection';\n\n\n\n/**\n * Create a component definition object.\n *\n *\n * # Example\n * ```\n * class MyDirective {\n * // Generated by Angular Template Compiler\n * // [Symbol] syntax will not be supported by TypeScript until v2.7\n * static ngComponentDef = defineComponent({\n * ...\n * });\n * }\n * ```\n */\nexport function defineComponent<T>(componentDefinition: {\n /**\n * Directive type, needed to configure the injector.\n */\n type: Type<T>;\n\n /** The selectors that will be used to match nodes to this component. */\n selectors: CssSelectorList;\n\n /**\n * Factory method used to create an instance of directive.\n */\n factory: () => T;\n\n /**\n * Static attributes to set on host element.\n *\n * Even indices: attribute name\n * Odd indices: attribute value\n */\n attributes?: string[];\n\n /**\n * A map of input names.\n *\n * The format is in: `{[actualPropertyName: string]:(string|[string, string])}`.\n *\n * Given:\n * ```\n * class MyComponent {\n * @Input()\n * publicInput1: string;\n *\n * @Input('publicInput2')\n * declaredInput2: string;\n * }\n * ```\n *\n * is described as:\n * ```\n * {\n * publicInput1: 'publicInput1',\n * declaredInput2: ['declaredInput2', 'publicInput2'],\n * }\n * ```\n *\n * Which the minifier may translate to:\n * ```\n * {\n * minifiedPublicInput1: 'publicInput1',\n * minifiedDeclaredInput2: [ 'publicInput2', 'declaredInput2'],\n * }\n * ```\n *\n * This allows the render to re-construct the minified, public, and declared names\n * of properties.\n *\n * NOTE:\n * - Because declared and public name are usually same we only generate the array\n * `['declared', 'public']` format when they differ.\n * - The reason why this API and `outputs` API is not the same is that `NgOnChanges` has\n * inconsistent behavior in that it uses declared names rather than minified or public. For\n * this reason `NgOnChanges` will be deprecated and removed in future version and this\n * API will be simplified to be consistent with `output`.\n */\n inputs?: {[P in keyof T]?: string | [string, string]};\n\n /**\n * A map of output names.\n *\n * The format is in: `{[actualPropertyName: string]:string}`.\n *\n * Which the minifier may translate to: `{[minifiedPropertyName: string]:string}`.\n *\n * This allows the render to re-construct the minified and non-minified names\n * of properties.\n */\n outputs?: {[P in keyof T]?: string};\n\n /**\n * Function executed by the parent template to allow child directive to apply host bindings.\n */\n hostBindings?: (directiveIndex: number, elementIndex: number) => void;\n\n /**\n * Function to create instances of content queries associated with a given directive.\n */\n contentQueries?: (() => void);\n\n /** Refreshes content queries associated with directives in a given view */\n contentQueriesRefresh?: ((directiveIndex: number, queryIndex: number) => void);\n\n /**\n * Defines the name that can be used in the template to assign this directive to a variable.\n *\n * See: {@link Directive.exportAs}\n */\n exportAs?: string;\n\n /**\n * Template function use for rendering DOM.\n *\n * This function has following structure.\n *\n * ```\n * function Template<T>(ctx:T, creationMode: boolean) {\n * if (creationMode) {\n * // Contains creation mode instructions.\n * }\n * // Contains binding update instructions\n * }\n * ```\n *\n * Common instructions are:\n * Creation mode instructions:\n * - `elementStart`, `elementEnd`\n * - `text`\n * - `container`\n * - `listener`\n *\n * Binding update instructions:\n * - `bind`\n * - `elementAttribute`\n * - `elementProperty`\n * - `elementClass`\n * - `elementStyle`\n *\n */\n template: ComponentTemplate<T>;\n\n /**\n * Additional set of instructions specific to view query processing. This could be seen as a\n * set of instruction to be inserted into the template function.\n *\n * Query-related instructions need to be pulled out to a specific function as a timing of\n * execution is different as compared to all other instructions (after change detection hooks but\n * before view hooks).\n */\n viewQuery?: ComponentQuery<T>| null;\n\n /**\n * A list of optional features to apply.\n *\n * See: {@link NgOnChangesFeature}, {@link PublicFeature}\n */\n features?: ComponentDefFeature[];\n\n rendererType?: RendererType2;\n\n changeDetection?: ChangeDetectionStrategy;\n\n /**\n * Defines the set of injectable objects that are visible to a Directive and its light DOM\n * children.\n */\n providers?: Provider[];\n\n /**\n * Defines the set of injectable objects that are visible to its view DOM children.\n */\n viewProviders?: Provider[];\n\n /**\n * Registry of directives and components that may be found in this component's view.\n *\n * The property is either an array of `DirectiveDef`s or a function which returns the array of\n * `DirectiveDef`s. The function is necessary to be able to support forward declarations.\n */\n directives?: DirectiveTypesOrFactory | null;\n\n /**\n * Registry of pipes that may be found in this component's view.\n *\n * The property is either an array of `PipeDefs`s or a function which returns the array of\n * `PipeDefs`s. The function is necessary to be able to support forward declarations.\n */\n pipes?: PipeTypesOrFactory | null;\n}): never {\n const type = componentDefinition.type;\n const pipeTypes = componentDefinition.pipes !;\n const directiveTypes = componentDefinition.directives !;\n const declaredInputs: {[key: string]: string} = {} as any;\n const def: ComponentDefInternal<any> = {\n type: type,\n diPublic: null,\n factory: componentDefinition.factory,\n template: componentDefinition.template || null !,\n hostBindings: componentDefinition.hostBindings || null,\n contentQueries: componentDefinition.contentQueries || null,\n contentQueriesRefresh: componentDefinition.contentQueriesRefresh || null,\n attributes: componentDefinition.attributes || null,\n inputs: invertObject(componentDefinition.inputs, declaredInputs),\n declaredInputs: declaredInputs,\n outputs: invertObject(componentDefinition.outputs),\n rendererType: resolveRendererType2(componentDefinition.rendererType) || null,\n exportAs: componentDefinition.exportAs || null,\n onInit: type.prototype.ngOnInit || null,\n doCheck: type.prototype.ngDoCheck || null,\n afterContentInit: type.prototype.ngAfterContentInit || null,\n afterContentChecked: type.prototype.ngAfterContentChecked || null,\n afterViewInit: type.prototype.ngAfterViewInit || null,\n afterViewChecked: type.prototype.ngAfterViewChecked || null,\n onDestroy: type.prototype.ngOnDestroy || null,\n onPush: componentDefinition.changeDetection === ChangeDetectionStrategy.OnPush,\n directiveDefs: directiveTypes ?\n () => (typeof directiveTypes === 'function' ? directiveTypes() : directiveTypes)\n .map(extractDirectiveDef) :\n null,\n pipeDefs: pipeTypes ?\n () => (typeof pipeTypes === 'function' ? pipeTypes() : pipeTypes).map(extractPipeDef) :\n null,\n selectors: componentDefinition.selectors,\n viewQuery: componentDefinition.viewQuery || null,\n features: componentDefinition.features || null,\n };\n const feature = componentDefinition.features;\n feature && feature.forEach((fn) => fn(def));\n return def as never;\n}\n\nexport function extractDirectiveDef(type: DirectiveType<any>& ComponentType<any>):\n DirectiveDefInternal<any>|ComponentDefInternal<any> {\n const def = type.ngComponentDef || type.ngDirectiveDef;\n if (ngDevMode && !def) {\n throw new Error(`'${type.name}' is neither 'ComponentType' or 'DirectiveType'.`);\n }\n return def;\n}\n\nexport function extractPipeDef(type: PipeType<any>): PipeDefInternal<any> {\n const def = type.ngPipeDef;\n if (ngDevMode && !def) {\n throw new Error(`'${type.name}' is not a 'PipeType'.`);\n }\n return def;\n}\n\nexport function defineNgModule<T>(def: {type: T} & Partial<NgModuleDef<T, any, any, any>>): never {\n const res: NgModuleDefInternal<T> = {\n type: def.type,\n bootstrap: def.bootstrap || [],\n declarations: def.declarations || [],\n imports: def.imports || [],\n exports: def.exports || [],\n transitiveCompileScopes: null,\n };\n return res as never;\n}\n\nconst EMPTY = {};\n\n/**\n * Inverts an inputs or outputs lookup such that the keys, which were the\n * minified keys, are part of the values, and the values are parsed so that\n * the publicName of the property is the new key\n *\n * e.g. for\n *\n * ```\n * class Comp {\n * @Input()\n * propName1: string;\n *\n * @Input('publicName')\n * propName2: number;\n * }\n * ```\n *\n * will be serialized as\n *\n * ```\n * {\n * a0: 'propName1',\n * b1: ['publicName', 'propName2'],\n * }\n * ```\n *\n * becomes\n *\n * ```\n * {\n * 'propName1': 'a0',\n * 'publicName': 'b1'\n * }\n * ```\n *\n * Optionally the function can take `secondary` which will result in:\n *\n * ```\n * {\n * 'propName1': 'a0',\n * 'propName2': 'b1'\n * }\n * ```\n *\n\n */\nfunction invertObject(obj: any, secondary?: any): any {\n if (obj == null) return EMPTY;\n const newLookup: any = {};\n for (const minifiedKey in obj) {\n if (obj.hasOwnProperty(minifiedKey)) {\n let publicName = obj[minifiedKey];\n let declaredName = publicName;\n if (Array.isArray(publicName)) {\n declaredName = publicName[1];\n publicName = publicName[0];\n }\n newLookup[publicName] = minifiedKey;\n if (secondary) {\n (secondary[declaredName] = minifiedKey);\n }\n }\n }\n return newLookup;\n}\n\n/**\n * Create a directive definition object.\n *\n * # Example\n * ```\n * class MyDirective {\n * // Generated by Angular Template Compiler\n * // [Symbol] syntax will not be supported by TypeScript until v2.7\n * static ngDirectiveDef = defineDirective({\n * ...\n * });\n * }\n * ```\n */\nexport const defineDirective = defineComponent as any as<T>(directiveDefinition: {\n /**\n * Directive type, needed to configure the injector.\n */\n type: Type<T>;\n\n /** The selectors that will be used to match nodes to this directive. */\n selectors: CssSelectorList;\n\n /**\n * Factory method used to create an instance of directive.\n */\n factory: () => T | ({0: T} & any[]); /* trying to say T | [T, ...any] */\n\n /**\n * Static attributes to set on host element.\n *\n * Even indices: attribute name\n * Odd indices: attribute value\n */\n attributes?: string[];\n\n /**\n * A map of input names.\n *\n * The format is in: `{[actualPropertyName: string]:(string|[string, string])}`.\n *\n * Given:\n * ```\n * class MyComponent {\n * @Input()\n * publicInput1: string;\n *\n * @Input('publicInput2')\n * declaredInput2: string;\n * }\n * ```\n *\n * is described as:\n * ```\n * {\n * publicInput1: 'publicInput1',\n * declaredInput2: ['declaredInput2', 'publicInput2'],\n * }\n * ```\n *\n * Which the minifier may translate to:\n * ```\n * {\n * minifiedPublicInput1: 'publicInput1',\n * minifiedDeclaredInput2: [ 'publicInput2', 'declaredInput2'],\n * }\n * ```\n *\n * This allows the render to re-construct the minified, public, and declared names\n * of properties.\n *\n * NOTE:\n * - Because declared and public name are usually same we only generate the array\n * `['declared', 'public']` format when they differ.\n * - The reason why this API and `outputs` API is not the same is that `NgOnChanges` has\n * inconsistent behavior in that it uses declared names rather than minified or public. For\n * this reason `NgOnChanges` will be deprecated and removed in future version and this\n * API will be simplified to be consistent with `output`.\n */\n inputs?: {[P in keyof T]?: string | [string, string]};\n\n /**\n * A map of output names.\n *\n * The format is in: `{[actualPropertyName: string]:string}`.\n *\n * Which the minifier may translate to: `{[minifiedPropertyName: string]:string}`.\n *\n * This allows the render to re-construct the minified and non-minified names\n * of properties.\n */\n outputs?: {[P in keyof T]?: string};\n\n /**\n * A list of optional features to apply.\n *\n * See: {@link NgOnChangesFeature}, {@link PublicFeature}, {@link InheritDefinitionFeature}\n */\n features?: DirectiveDefFeature[];\n\n /**\n * Function executed by the parent template to allow child directive to apply host bindings.\n */\n hostBindings?: (directiveIndex: number, elementIndex: number) => void;\n\n /**\n * Function to create instances of content queries associated with a given directive.\n */\n contentQueries?: (() => void);\n\n /** Refreshes content queries associated with directives in a given view */\n contentQueriesRefresh?: ((directiveIndex: number, queryIndex: number) => void);\n\n /**\n * Defines the name that can be used in the template to assign this directive to a variable.\n *\n * See: {@link Directive.exportAs}\n */\n exportAs?: string;\n}) => never;\n\n/**\n * Create a pipe definition object.\n *\n * # Example\n * ```\n * class MyPipe implements PipeTransform {\n * // Generated by Angular Template Compiler\n * static ngPipeDef = definePipe({\n * ...\n * });\n * }\n * ```\n * @param pipeDef Pipe definition generated by the compiler\n */\nexport function definePipe<T>(pipeDef: {\n /** Name of the pipe. Used for matching pipes in template to pipe defs. */\n name: string,\n\n /** Pipe class reference. Needed to extract pipe lifecycle hooks. */\n type: Type<T>,\n\n /** A factory for creating a pipe instance. */\n factory: () => T,\n\n /** Whether the pipe is pure. */\n pure?: boolean\n}): never {\n return (<PipeDefInternal<T>>{\n name: pipeDef.name,\n factory: pipeDef.factory,\n pure: pipeDef.pure !== false,\n onDestroy: pipeDef.type.prototype.ngOnDestroy || null\n }) as never;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Type} from '../../type';\nimport {ComponentDefInternal, ComponentType, DirectiveDefFeature, DirectiveDefInternal} from '../interfaces/definition';\n\n\n/**\n * Sets properties on a target object from a source object, but only if\n * the property doesn't already exist on the target object.\n * @param target The target to set properties on\n * @param source The source of the property keys and values to set\n */\nfunction fillProperties(target: {[key: string]: string}, source: {[key: string]: string}) {\n for (const key in source) {\n if (source.hasOwnProperty(key) && !target.hasOwnProperty(key)) {\n target[key] = source[key];\n }\n }\n}\n/**\n * Determines if a definition is a {@link ComponentDefInternal} or a {@link DirectiveDefInternal}\n * @param definition The definition to examine\n */\nfunction isComponentDef<T>(definition: ComponentDefInternal<T>| DirectiveDefInternal<T>):\n definition is ComponentDefInternal<T> {\n const def = definition as ComponentDefInternal<T>;\n return typeof def.template === 'function';\n}\n\nfunction getSuperType(type: Type<any>): Type<any>&\n {ngComponentDef?: ComponentDefInternal<any>, ngDirectiveDef?: DirectiveDefInternal<any>} {\n return Object.getPrototypeOf(type.prototype).constructor;\n}\n\n/**\n * Merges the definition from a super class to a sub class.\n * @param definition The definition that is a SubClass of another directive of component\n */\nexport function InheritDefinitionFeature(\n definition: DirectiveDefInternal<any>| ComponentDefInternal<any>): void {\n let superType = getSuperType(definition.type);\n let superDef: DirectiveDefInternal<any>|ComponentDefInternal<any>|undefined = undefined;\n\n while (superType && !superDef) {\n if (isComponentDef(definition)) {\n superDef = superType.ngComponentDef || superType.ngDirectiveDef;\n } else {\n if (superType.ngComponentDef) {\n throw new Error('Directives cannot inherit Components');\n }\n superDef = superType.ngDirectiveDef;\n }\n\n if (superDef) {\n // Merge inputs and outputs\n fillProperties(definition.inputs, superDef.inputs);\n fillProperties(definition.declaredInputs, superDef.declaredInputs);\n fillProperties(definition.outputs, superDef.outputs);\n\n // Merge hostBindings\n const prevHostBindings = definition.hostBindings;\n const superHostBindings = superDef.hostBindings;\n if (superHostBindings) {\n if (prevHostBindings) {\n definition.hostBindings = (directiveIndex: number, elementIndex: number) => {\n superHostBindings(directiveIndex, elementIndex);\n prevHostBindings(directiveIndex, elementIndex);\n };\n } else {\n definition.hostBindings = superHostBindings;\n }\n }\n\n // Inherit hooks\n // Assume super class inheritance feature has already run.\n definition.afterContentChecked =\n definition.afterContentChecked || superDef.afterContentChecked;\n definition.afterContentInit = definition.afterContentInit || superDef.afterContentInit;\n definition.afterViewChecked = definition.afterViewChecked || superDef.afterViewChecked;\n definition.afterViewInit = definition.afterViewInit || superDef.afterViewInit;\n definition.doCheck = definition.doCheck || superDef.doCheck;\n definition.onDestroy = definition.onDestroy || superDef.onDestroy;\n definition.onInit = definition.onInit || superDef.onInit;\n\n // Run parent features\n const features = superDef.features;\n if (features) {\n for (const feature of features) {\n if (feature && feature !== InheritDefinitionFeature) {\n (feature as DirectiveDefFeature)(definition);\n }\n }\n }\n } else {\n // Even if we don't have a definition, check the type for the hooks and use those if need be\n const superPrototype = superType.prototype;\n\n if (superPrototype) {\n definition.afterContentChecked =\n definition.afterContentChecked || superPrototype.afterContentChecked;\n definition.afterContentInit =\n definition.afterContentInit || superPrototype.afterContentInit;\n definition.afterViewChecked =\n definition.afterViewChecked || superPrototype.afterViewChecked;\n definition.afterViewInit = definition.afterViewInit || superPrototype.afterViewInit;\n definition.doCheck = definition.doCheck || superPrototype.doCheck;\n definition.onDestroy = definition.onDestroy || superPrototype.onDestroy;\n definition.onInit = definition.onInit || superPrototype.onInit;\n }\n }\n\n superType = Object.getPrototypeOf(superType);\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {SimpleChange} from '../../change_detection/change_detection_util';\nimport {OnChanges, SimpleChanges} from '../../metadata/lifecycle_hooks';\nimport {DirectiveDefInternal} from '../interfaces/definition';\n\nconst PRIVATE_PREFIX = '__ngOnChanges_';\n\ntype OnChangesExpando = OnChanges & {\n __ngOnChanges_: SimpleChanges|null|undefined;\n // tslint:disable-next-line:no-any Can hold any value\n [key: string]: any;\n};\n\n/**\n * The NgOnChangesFeature decorates a component with support for the ngOnChanges\n * lifecycle hook, so it should be included in any component that implements\n * that hook.\n *\n * If the component or directive uses inheritance, the NgOnChangesFeature MUST\n * be included as a feature AFTER {@link InheritDefinitionFeature}, otherwise\n * inherited properties will not be propagated to the ngOnChanges lifecycle\n * hook.\n *\n * Example usage:\n *\n * ```\n * static ngComponentDef = defineComponent({\n * ...\n * inputs: {name: 'publicName'},\n * features: [NgOnChangesFeature]\n * });\n * ```\n */\nexport function NgOnChangesFeature<T>(definition: DirectiveDefInternal<T>): void {\n const declaredToMinifiedInputs = definition.declaredInputs;\n const proto = definition.type.prototype;\n for (const declaredName in declaredToMinifiedInputs) {\n if (declaredToMinifiedInputs.hasOwnProperty(declaredName)) {\n const minifiedKey = declaredToMinifiedInputs[declaredName];\n const privateMinKey = PRIVATE_PREFIX + minifiedKey;\n\n // Walk the prototype chain to see if we find a property descriptor\n // That way we can honor setters and getters that were inherited.\n let originalProperty: PropertyDescriptor|undefined = undefined;\n let checkProto = proto;\n while (!originalProperty && checkProto &&\n Object.getPrototypeOf(checkProto) !== Object.getPrototypeOf(Object.prototype)) {\n originalProperty = Object.getOwnPropertyDescriptor(checkProto, minifiedKey);\n checkProto = Object.getPrototypeOf(checkProto);\n }\n\n const getter = originalProperty && originalProperty.get;\n const setter = originalProperty && originalProperty.set;\n\n // create a getter and setter for property\n Object.defineProperty(proto, minifiedKey, {\n get: getter ||\n (setter ? undefined : function(this: OnChangesExpando) { return this[privateMinKey]; }),\n set<T>(this: OnChangesExpando, value: T) {\n let simpleChanges = this[PRIVATE_PREFIX];\n if (!simpleChanges) {\n simpleChanges = {};\n // Place where we will store SimpleChanges if there is a change\n Object.defineProperty(this, PRIVATE_PREFIX, {value: simpleChanges, writable: true});\n }\n\n const isFirstChange = !this.hasOwnProperty(privateMinKey);\n const currentChange = simpleChanges[declaredName];\n\n if (currentChange) {\n currentChange.currentValue = value;\n } else {\n simpleChanges[declaredName] =\n new SimpleChange(this[privateMinKey], value, isFirstChange);\n }\n\n if (isFirstChange) {\n // Create a place where the actual value will be stored and make it non-enumerable\n Object.defineProperty(this, privateMinKey, {value, writable: true});\n } else {\n this[privateMinKey] = value;\n }\n\n if (setter) setter.call(this, value);\n }\n });\n }\n }\n\n // If an onInit hook is defined, it will need to wrap the ngOnChanges call\n // so the call order is changes-init-check in creation mode. In subsequent\n // change detection runs, only the check wrapper will be called.\n if (definition.onInit != null) {\n definition.onInit = onChangesWrapper(definition.onInit);\n }\n\n definition.doCheck = onChangesWrapper(definition.doCheck);\n}\n\nfunction onChangesWrapper(delegateHook: (() => void) | null) {\n return function(this: OnChangesExpando) {\n const simpleChanges = this[PRIVATE_PREFIX];\n if (simpleChanges != null) {\n this.ngOnChanges(simpleChanges);\n this[PRIVATE_PREFIX] = null;\n }\n if (delegateHook) delegateHook.apply(this);\n };\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ApplicationRef} from '../application_ref';\nimport {ChangeDetectorRef as viewEngine_ChangeDetectorRef} from '../change_detection/change_detector_ref';\nimport {ViewContainerRef as viewEngine_ViewContainerRef} from '../linker/view_container_ref';\nimport {EmbeddedViewRef as viewEngine_EmbeddedViewRef, InternalViewRef as viewEngine_InternalViewRef} from '../linker/view_ref';\n\nimport {checkNoChanges, detectChanges, markViewDirty, storeCleanupFn, viewAttached} from './instructions';\nimport {LViewNode} from './interfaces/node';\nimport {FLAGS, LViewData, LViewFlags} from './interfaces/view';\nimport {destroyLView} from './node_manipulation';\n\n// Needed due to tsickle downleveling where multiple `implements` with classes creates\n// multiple @extends in Closure annotations, which is illegal. This workaround fixes\n// the multiple @extends by making the annotation @implements instead\nexport interface viewEngine_ChangeDetectorRef_interface extends viewEngine_ChangeDetectorRef {}\n\nexport class ViewRef<T> implements viewEngine_EmbeddedViewRef<T>, viewEngine_InternalViewRef,\n viewEngine_ChangeDetectorRef_interface {\n private _appRef: ApplicationRef|null = null;\n private _viewContainerRef: viewEngine_ViewContainerRef|null = null;\n\n /**\n * @internal\n */\n _lViewNode: LViewNode|null = null;\n\n context: T;\n // TODO(issue/24571): remove '!'.\n rootNodes !: any[];\n\n constructor(protected _view: LViewData, context: T|null) { this.context = context !; }\n\n /** @internal */\n _setComponentContext(view: LViewData, context: T) {\n this._view = view;\n this.context = context;\n }\n\n get destroyed(): boolean {\n return (this._view[FLAGS] & LViewFlags.Destroyed) === LViewFlags.Destroyed;\n }\n\n destroy(): void {\n if (this._viewContainerRef && viewAttached(this._view)) {\n this._viewContainerRef.detach(this._viewContainerRef.indexOf(this));\n this._viewContainerRef = null;\n }\n destroyLView(this._view);\n }\n\n onDestroy(callback: Function) { storeCleanupFn(this._view, callback); }\n\n /**\n * Marks a view and all of its ancestors dirty.\n *\n * It also triggers change detection by calling `scheduleTick` internally, which coalesces\n * multiple `markForCheck` calls to into one change detection run.\n *\n * This can be used to ensure an {@link ChangeDetectionStrategy#OnPush OnPush} component is\n * checked when it needs to be re-rendered but the two normal triggers haven't marked it\n * dirty (i.e. inputs haven't changed and events haven't fired in the view).\n *\n * <!-- TODO: Add a link to a chapter on OnPush components -->\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * @Component({\n * selector: 'my-app',\n * template: `Number of ticks: {{numberOfTicks}}`\n * changeDetection: ChangeDetectionStrategy.OnPush,\n * })\n * class AppComponent {\n * numberOfTicks = 0;\n *\n * constructor(private ref: ChangeDetectorRef) {\n * setInterval(() => {\n * this.numberOfTicks++;\n * // the following is required, otherwise the view will not be updated\n * this.ref.markForCheck();\n * }, 1000);\n * }\n * }\n * ```\n */\n markForCheck(): void { markViewDirty(this._view); }\n\n /**\n * Detaches the view from the change detection tree.\n *\n * Detached views will not be checked during change detection runs until they are\n * re-attached, even if they are dirty. `detach` can be used in combination with\n * {@link ChangeDetectorRef#detectChanges detectChanges} to implement local change\n * detection checks.\n *\n * <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->\n * <!-- TODO: Add a live demo once ref.detectChanges is merged into master -->\n *\n * @usageNotes\n * ### Example\n *\n * The following example defines a component with a large list of readonly data.\n * Imagine the data changes constantly, many times per second. For performance reasons,\n * we want to check and update the list every five seconds. We can do that by detaching\n * the component's change detector and doing a local check every five seconds.\n *\n * ```typescript\n * class DataProvider {\n * // in a real application the returned data will be different every time\n * get data() {\n * return [1,2,3,4,5];\n * }\n * }\n *\n * @Component({\n * selector: 'giant-list',\n * template: `\n * <li *ngFor=\"let d of dataProvider.data\">Data {{d}}</li>\n * `,\n * })\n * class GiantList {\n * constructor(private ref: ChangeDetectorRef, private dataProvider: DataProvider) {\n * ref.detach();\n * setInterval(() => {\n * this.ref.detectChanges();\n * }, 5000);\n * }\n * }\n *\n * @Component({\n * selector: 'app',\n * providers: [DataProvider],\n * template: `\n * <giant-list><giant-list>\n * `,\n * })\n * class App {\n * }\n * ```\n */\n detach(): void { this._view[FLAGS] &= ~LViewFlags.Attached; }\n\n /**\n * Re-attaches a view to the change detection tree.\n *\n * This can be used to re-attach views that were previously detached from the tree\n * using {@link ChangeDetectorRef#detach detach}. Views are attached to the tree by default.\n *\n * <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->\n *\n * @usageNotes\n * ### Example\n *\n * The following example creates a component displaying `live` data. The component will detach\n * its change detector from the main change detector tree when the component's live property\n * is set to false.\n *\n * ```typescript\n * class DataProvider {\n * data = 1;\n *\n * constructor() {\n * setInterval(() => {\n * this.data = this.data * 2;\n * }, 500);\n * }\n * }\n *\n * @Component({\n * selector: 'live-data',\n * inputs: ['live'],\n * template: 'Data: {{dataProvider.data}}'\n * })\n * class LiveData {\n * constructor(private ref: ChangeDetectorRef, private dataProvider: DataProvider) {}\n *\n * set live(value) {\n * if (value) {\n * this.ref.reattach();\n * } else {\n * this.ref.detach();\n * }\n * }\n * }\n *\n * @Component({\n * selector: 'my-app',\n * providers: [DataProvider],\n * template: `\n * Live Update: <input type=\"checkbox\" [(ngModel)]=\"live\">\n * <live-data [live]=\"live\"><live-data>\n * `,\n * })\n * class AppComponent {\n * live = true;\n * }\n * ```\n */\n reattach(): void { this._view[FLAGS] |= LViewFlags.Attached; }\n\n /**\n * Checks the view and its children.\n *\n * This can also be used in combination with {@link ChangeDetectorRef#detach detach} to implement\n * local change detection checks.\n *\n * <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->\n * <!-- TODO: Add a live demo once ref.detectChanges is merged into master -->\n *\n * @usageNotes\n * ### Example\n *\n * The following example defines a component with a large list of readonly data.\n * Imagine, the data changes constantly, many times per second. For performance reasons,\n * we want to check and update the list every five seconds.\n *\n * We can do that by detaching the component's change detector and doing a local change detection\n * check every five seconds.\n *\n * See {@link ChangeDetectorRef#detach detach} for more information.\n */\n detectChanges(): void { detectChanges(this.context); }\n\n /**\n * Checks the change detector and its children, and throws if any changes are detected.\n *\n * This is used in development mode to verify that running change detection doesn't\n * introduce other changes.\n */\n checkNoChanges(): void { checkNoChanges(this.context); }\n\n attachToViewContainerRef(vcRef: viewEngine_ViewContainerRef) { this._viewContainerRef = vcRef; }\n\n detachFromAppRef() { this._appRef = null; }\n\n attachToAppRef(appRef: ApplicationRef) { this._appRef = appRef; }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ChangeDetectorRef} from '../change_detection/change_detector_ref';\nimport {InjectionToken} from '../di/injection_token';\nimport {Injector, inject} from '../di/injector';\nimport {ComponentFactory as viewEngine_ComponentFactory, ComponentRef as viewEngine_ComponentRef} from '../linker/component_factory';\nimport {ComponentFactoryResolver as viewEngine_ComponentFactoryResolver} from '../linker/component_factory_resolver';\nimport {ElementRef} from '../linker/element_ref';\nimport {NgModuleRef as viewEngine_NgModuleRef} from '../linker/ng_module_factory';\nimport {RendererFactory2} from '../render/api';\nimport {Type} from '../type';\n\nimport {assertComponentType, assertDefined} from './assert';\nimport {LifecycleHooksFeature, createRootContext} from './component';\nimport {baseDirectiveCreate, createLNode, createLViewData, createTView, elementCreate, enterView, hostElement, initChangeDetectorIfExisting, locateHostElement, renderEmbeddedTemplate} from './instructions';\nimport {ComponentDefInternal, ComponentType, RenderFlags} from './interfaces/definition';\nimport {LElementNode, TNode, TNodeType} from './interfaces/node';\nimport {RElement, domRendererFactory3} from './interfaces/renderer';\nimport {FLAGS, INJECTOR, LViewData, LViewFlags, RootContext, TVIEW} from './interfaces/view';\nimport {ViewRef} from './view_ref';\n\nexport class ComponentFactoryResolver extends viewEngine_ComponentFactoryResolver {\n resolveComponentFactory<T>(component: Type<T>): viewEngine_ComponentFactory<T> {\n ngDevMode && assertComponentType(component);\n const componentDef = (component as ComponentType<T>).ngComponentDef;\n return new ComponentFactory(componentDef);\n }\n}\n\nfunction toRefArray(map: {[key: string]: string}): {propName: string; templateName: string;}[] {\n const array: {propName: string; templateName: string;}[] = [];\n for (let nonMinified in map) {\n if (map.hasOwnProperty(nonMinified)) {\n const minified = map[nonMinified];\n array.push({propName: minified, templateName: nonMinified});\n }\n }\n return array;\n}\n\n/**\n * Default {@link RootContext} for all components rendered with {@link renderComponent}.\n */\nexport const ROOT_CONTEXT = new InjectionToken<RootContext>(\n 'ROOT_CONTEXT_TOKEN',\n {providedIn: 'root', factory: () => createRootContext(inject(SCHEDULER))});\n\n/**\n * A change detection scheduler token for {@link RootContext}. This token is the default value used\n * for the default `RootContext` found in the {@link ROOT_CONTEXT} token.\n */\nexport const SCHEDULER = new InjectionToken<((fn: () => void) => void)>(\n 'SCHEDULER_TOKEN', {providedIn: 'root', factory: () => requestAnimationFrame.bind(window)});\n\n/**\n * Render3 implementation of {@link viewEngine_ComponentFactory}.\n */\nexport class ComponentFactory<T> extends viewEngine_ComponentFactory<T> {\n selector: string;\n componentType: Type<any>;\n ngContentSelectors: string[];\n get inputs(): {propName: string; templateName: string;}[] {\n return toRefArray(this.componentDef.inputs);\n }\n get outputs(): {propName: string; templateName: string;}[] {\n return toRefArray(this.componentDef.outputs);\n }\n\n constructor(private componentDef: ComponentDefInternal<any>) {\n super();\n this.componentType = componentDef.type;\n this.selector = componentDef.selectors[0][0] as string;\n this.ngContentSelectors = [];\n }\n\n create(\n injector: Injector, projectableNodes?: any[][]|undefined, rootSelectorOrNode?: any,\n ngModule?: viewEngine_NgModuleRef<any>|undefined): viewEngine_ComponentRef<T> {\n const isInternalRootView = rootSelectorOrNode === undefined;\n\n const rendererFactory =\n ngModule ? ngModule.injector.get(RendererFactory2) : domRendererFactory3;\n const hostNode = isInternalRootView ?\n elementCreate(\n this.selector, rendererFactory.createRenderer(null, this.componentDef.rendererType)) :\n locateHostElement(rendererFactory, rootSelectorOrNode);\n\n // The first index of the first selector is the tag name.\n const componentTag = this.componentDef.selectors ![0] ![0] as string;\n\n const rootContext: RootContext = ngModule && !isInternalRootView ?\n ngModule.injector.get(ROOT_CONTEXT) :\n createRootContext(requestAnimationFrame.bind(window));\n\n // Create the root view. Uses empty TView and ContentTemplate.\n const rootView: LViewData = createLViewData(\n rendererFactory.createRenderer(hostNode, this.componentDef.rendererType),\n createTView(-1, null, null, null, null), rootContext,\n this.componentDef.onPush ? LViewFlags.Dirty : LViewFlags.CheckAlways);\n rootView[INJECTOR] = ngModule && ngModule.injector || null;\n\n // rootView is the parent when bootstrapping\n const oldView = enterView(rootView, null !);\n\n let component: T;\n let elementNode: LElementNode;\n try {\n if (rendererFactory.begin) rendererFactory.begin();\n\n // Create element node at index 0 in data array\n elementNode = hostElement(componentTag, hostNode, this.componentDef);\n\n // Create directive instance with factory() and store at index 0 in directives array\n rootContext.components.push(\n component = baseDirectiveCreate(0, this.componentDef.factory(), this.componentDef) as T);\n initChangeDetectorIfExisting(elementNode.nodeInjector, component, elementNode.data !);\n\n // TODO: should LifecycleHooksFeature and other host features be generated by the compiler and\n // executed here?\n // Angular 5 reference: https://stackblitz.com/edit/lifecycle-hooks-vcref\n LifecycleHooksFeature(component, this.componentDef);\n\n // Transform the arrays of native nodes into a LNode structure that can be consumed by the\n // projection instruction. This is needed to support the reprojection of these nodes.\n if (projectableNodes) {\n let index = 0;\n const projection: TNode[] = elementNode.tNode.projection = [];\n for (let i = 0; i < projectableNodes.length; i++) {\n const nodeList = projectableNodes[i];\n let firstTNode: TNode|null = null;\n let previousTNode: TNode|null = null;\n for (let j = 0; j < nodeList.length; j++) {\n const lNode =\n createLNode(++index, TNodeType.Element, nodeList[j] as RElement, null, null);\n if (previousTNode) {\n previousTNode.next = lNode.tNode;\n } else {\n firstTNode = lNode.tNode;\n }\n previousTNode = lNode.tNode;\n }\n projection.push(firstTNode !);\n }\n }\n\n // Execute the template in creation mode only, and then turn off the CreationMode flag\n renderEmbeddedTemplate(elementNode, elementNode.data ![TVIEW], component, RenderFlags.Create);\n elementNode.data ![FLAGS] &= ~LViewFlags.CreationMode;\n } finally {\n enterView(oldView, null);\n if (rendererFactory.end) rendererFactory.end();\n }\n\n const componentRef =\n new ComponentRef(this.componentType, component, rootView, injector, hostNode !);\n if (isInternalRootView) {\n // The host element of the internal root view is attached to the component's host view node\n componentRef.hostView._lViewNode !.tNode.child = elementNode.tNode;\n }\n return componentRef;\n }\n}\n\n/**\n * Represents an instance of a Component created via a {@link ComponentFactory}.\n *\n * `ComponentRef` provides access to the Component Instance as well other objects related to this\n * Component Instance and allows you to destroy the Component Instance via the {@link #destroy}\n * method.\n *\n */\nexport class ComponentRef<T> extends viewEngine_ComponentRef<T> {\n destroyCbs: (() => void)[]|null = [];\n location: ElementRef<any>;\n injector: Injector;\n instance: T;\n hostView: ViewRef<T>;\n changeDetectorRef: ChangeDetectorRef;\n componentType: Type<T>;\n\n constructor(\n componentType: Type<T>, instance: T, rootView: LViewData, injector: Injector,\n hostNode: RElement) {\n super();\n this.instance = instance;\n /* TODO(jasonaden): This is incomplete, to be adjusted in follow-up PR. Notes from Kara:When\n * ViewRef.detectChanges is called from ApplicationRef.tick, it will call detectChanges at the\n * component instance level. I suspect this means that lifecycle hooks and host bindings on the\n * given component won't work (as these are always called at the level above a component).\n *\n * In render2, ViewRef.detectChanges uses the root view instance for view checks, not the\n * component instance. So passing in the root view (1 level above the component) is sufficient.\n * We might want to think about creating a fake component for the top level? Or overwrite\n * detectChanges with a function that calls tickRootContext? */\n this.hostView = this.changeDetectorRef = new ViewRef(rootView, instance);\n this.hostView._lViewNode = createLNode(-1, TNodeType.View, null, null, null, rootView);\n this.injector = injector;\n this.location = new ElementRef(hostNode);\n this.componentType = componentType;\n }\n\n destroy(): void {\n ngDevMode && assertDefined(this.destroyCbs, 'NgModule already destroyed');\n this.destroyCbs !.forEach(fn => fn());\n this.destroyCbs = null;\n }\n onDestroy(callback: () => void): void {\n ngDevMode && assertDefined(this.destroyCbs, 'NgModule already destroyed');\n this.destroyCbs !.push(callback);\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n// We are temporarily importing the existing viewEngine_from core so we can be sure we are\n// correctly implementing its interfaces for backwards compatibility.\nimport {ChangeDetectorRef as viewEngine_ChangeDetectorRef} from '../change_detection/change_detector_ref';\nimport {InjectFlags, Injector, inject, setCurrentInjector} from '../di/injector';\nimport {ComponentFactory as viewEngine_ComponentFactory, ComponentRef as viewEngine_ComponentRef} from '../linker/component_factory';\nimport {ComponentFactoryResolver as viewEngine_ComponentFactoryResolver} from '../linker/component_factory_resolver';\nimport {ElementRef as viewEngine_ElementRef} from '../linker/element_ref';\nimport {NgModuleRef as viewEngine_NgModuleRef} from '../linker/ng_module_factory';\nimport {TemplateRef as viewEngine_TemplateRef} from '../linker/template_ref';\nimport {ViewContainerRef as viewEngine_ViewContainerRef} from '../linker/view_container_ref';\nimport {EmbeddedViewRef as viewEngine_EmbeddedViewRef, ViewRef as viewEngine_ViewRef} from '../linker/view_ref';\nimport {Type} from '../type';\n\nimport {assertDefined, assertGreaterThan, assertLessThan} from './assert';\nimport {ComponentFactoryResolver} from './component_ref';\nimport {addToViewTree, assertPreviousIsParent, createEmbeddedViewNode, createLContainer, createLNodeObject, createTNode, getPreviousOrParentNode, getRenderer, isComponent, renderEmbeddedTemplate, resolveDirective} from './instructions';\nimport {VIEWS} from './interfaces/container';\nimport {DirectiveDefInternal, RenderFlags} from './interfaces/definition';\nimport {LInjector} from './interfaces/injector';\nimport {AttributeMarker, LContainerNode, LElementNode, LNode, LViewNode, TContainerNode, TElementNode, TNodeFlags, TNodeType} from './interfaces/node';\nimport {LQueries, QueryReadType} from './interfaces/query';\nimport {Renderer3} from './interfaces/renderer';\nimport {DIRECTIVES, HOST_NODE, INJECTOR, LViewData, QUERIES, RENDERER, TVIEW, TView} from './interfaces/view';\nimport {assertNodeOfPossibleTypes, assertNodeType} from './node_assert';\nimport {addRemoveViewFromContainer, appendChild, detachView, getChildLNode, getParentLNode, insertView, removeView} from './node_manipulation';\nimport {stringify} from './util';\nimport {ViewRef} from './view_ref';\n\n\n\n/**\n * If a directive is diPublic, bloomAdd sets a property on the instance with this constant as\n * the key and the directive's unique ID as the value. This allows us to map directives to their\n * bloom filter bit for DI.\n */\nconst NG_ELEMENT_ID = '__NG_ELEMENT_ID__';\n\n/**\n * The number of slots in each bloom filter (used by DI). The larger this number, the fewer\n * directives that will share slots, and thus, the fewer false positives when checking for\n * the existence of a directive.\n */\nconst BLOOM_SIZE = 256;\n\n/** Counter used to generate unique IDs for directives. */\nlet nextNgElementId = 0;\n\n/**\n * Registers this directive as present in its node's injector by flipping the directive's\n * corresponding bit in the injector's bloom filter.\n *\n * @param injector The node injector in which the directive should be registered\n * @param type The directive to register\n */\nexport function bloomAdd(injector: LInjector, type: Type<any>): void {\n let id: number|undefined = (type as any)[NG_ELEMENT_ID];\n\n // Set a unique ID on the directive type, so if something tries to inject the directive,\n // we can easily retrieve the ID and hash it into the bloom bit that should be checked.\n if (id == null) {\n id = (type as any)[NG_ELEMENT_ID] = nextNgElementId++;\n }\n\n // We only have BLOOM_SIZE (256) slots in our bloom filter (8 buckets * 32 bits each),\n // so all unique IDs must be modulo-ed into a number from 0 - 255 to fit into the filter.\n // This means that after 255, some directives will share slots, leading to some false positives\n // when checking for a directive's presence.\n const bloomBit = id % BLOOM_SIZE;\n\n // Create a mask that targets the specific bit associated with the directive.\n // JS bit operations are 32 bits, so this will be a number between 2^0 and 2^31, corresponding\n // to bit positions 0 - 31 in a 32 bit integer.\n const mask = 1 << bloomBit;\n\n // Use the raw bloomBit number to determine which bloom filter bucket we should check\n // e.g: bf0 = [0 - 31], bf1 = [32 - 63], bf2 = [64 - 95], bf3 = [96 - 127], etc\n if (bloomBit < 128) {\n // Then use the mask to flip on the bit (0-31) associated with the directive in that bucket\n bloomBit < 64 ? (bloomBit < 32 ? (injector.bf0 |= mask) : (injector.bf1 |= mask)) :\n (bloomBit < 96 ? (injector.bf2 |= mask) : (injector.bf3 |= mask));\n } else {\n bloomBit < 192 ? (bloomBit < 160 ? (injector.bf4 |= mask) : (injector.bf5 |= mask)) :\n (bloomBit < 224 ? (injector.bf6 |= mask) : (injector.bf7 |= mask));\n }\n}\n\nexport function getOrCreateNodeInjector(): LInjector {\n ngDevMode && assertPreviousIsParent();\n return getOrCreateNodeInjectorForNode(getPreviousOrParentNode() as LElementNode | LContainerNode);\n}\n\n/**\n * Creates (or gets an existing) injector for a given element or container.\n *\n * @param node for which an injector should be retrieved / created.\n * @returns Node injector\n */\nexport function getOrCreateNodeInjectorForNode(node: LElementNode | LContainerNode): LInjector {\n const nodeInjector = node.nodeInjector;\n const parent = getParentLNode(node);\n const parentInjector = parent && parent.nodeInjector;\n if (nodeInjector != parentInjector) {\n return nodeInjector !;\n }\n return node.nodeInjector = {\n parent: parentInjector,\n node: node,\n bf0: 0,\n bf1: 0,\n bf2: 0,\n bf3: 0,\n bf4: 0,\n bf5: 0,\n bf6: 0,\n bf7: 0,\n cbf0: parentInjector == null ? 0 : parentInjector.cbf0 | parentInjector.bf0,\n cbf1: parentInjector == null ? 0 : parentInjector.cbf1 | parentInjector.bf1,\n cbf2: parentInjector == null ? 0 : parentInjector.cbf2 | parentInjector.bf2,\n cbf3: parentInjector == null ? 0 : parentInjector.cbf3 | parentInjector.bf3,\n cbf4: parentInjector == null ? 0 : parentInjector.cbf4 | parentInjector.bf4,\n cbf5: parentInjector == null ? 0 : parentInjector.cbf5 | parentInjector.bf5,\n cbf6: parentInjector == null ? 0 : parentInjector.cbf6 | parentInjector.bf6,\n cbf7: parentInjector == null ? 0 : parentInjector.cbf7 | parentInjector.bf7,\n templateRef: null,\n viewContainerRef: null,\n elementRef: null,\n changeDetectorRef: null,\n };\n}\n\n\n/**\n * Makes a directive public to the DI system by adding it to an injector's bloom filter.\n *\n * @param di The node injector in which a directive will be added\n * @param def The definition of the directive to be made public\n */\nexport function diPublicInInjector(di: LInjector, def: DirectiveDefInternal<any>): void {\n bloomAdd(di, def.type);\n}\n\n/**\n * Makes a directive public to the DI system by adding it to an injector's bloom filter.\n *\n * @param def The definition of the directive to be made public\n */\nexport function diPublic(def: DirectiveDefInternal<any>): void {\n diPublicInInjector(getOrCreateNodeInjector(), def);\n}\n\n/**\n * Searches for an instance of the given type up the injector tree and returns\n * that instance if found.\n *\n * If not found, it will propagate up to the next parent injector until the token\n * is found or the top is reached.\n *\n * Usage example (in factory function):\n *\n * class SomeDirective {\n * constructor(directive: DirectiveA) {}\n *\n * static ngDirectiveDef = defineDirective({\n * type: SomeDirective,\n * factory: () => new SomeDirective(directiveInject(DirectiveA))\n * });\n * }\n *\n * NOTE: use `directiveInject` with `@Directive`, `@Component`, and `@Pipe`. For\n * all other injection use `inject` which does not walk the DOM render tree.\n *\n * @param token The directive type to search for\n * @param flags Injection flags (e.g. CheckParent)\n * @returns The instance found\n */\nexport function directiveInject<T>(token: Type<T>): T;\nexport function directiveInject<T>(token: Type<T>, flags: InjectFlags.Optional): T|null;\nexport function directiveInject<T>(token: Type<T>, flags: InjectFlags): T;\nexport function directiveInject<T>(token: Type<T>, flags = InjectFlags.Default): T|null {\n return getOrCreateInjectable<T>(getOrCreateNodeInjector(), token, flags);\n}\n\n/**\n * Creates an ElementRef and stores it on the injector.\n * Or, if the ElementRef already exists, retrieves the existing ElementRef.\n *\n * @returns The ElementRef instance to use\n */\nexport function injectElementRef(): viewEngine_ElementRef {\n return getOrCreateElementRef(getOrCreateNodeInjector());\n}\n\n/**\n * Creates a TemplateRef and stores it on the injector. Or, if the TemplateRef already\n * exists, retrieves the existing TemplateRef.\n *\n * @returns The TemplateRef instance to use\n */\nexport function injectTemplateRef<T>(): viewEngine_TemplateRef<T> {\n return getOrCreateTemplateRef<T>(getOrCreateNodeInjector());\n}\n\n/**\n * Creates a ViewContainerRef and stores it on the injector. Or, if the ViewContainerRef\n * already exists, retrieves the existing ViewContainerRef.\n *\n * @returns The ViewContainerRef instance to use\n */\nexport function injectViewContainerRef(): viewEngine_ViewContainerRef {\n return getOrCreateContainerRef(getOrCreateNodeInjector());\n}\n\n/** Returns a ChangeDetectorRef (a.k.a. a ViewRef) */\nexport function injectChangeDetectorRef(): viewEngine_ChangeDetectorRef {\n return getOrCreateChangeDetectorRef(getOrCreateNodeInjector(), null);\n}\n\n/**\n * Creates a ComponentFactoryResolver and stores it on the injector. Or, if the\n * ComponentFactoryResolver\n * already exists, retrieves the existing ComponentFactoryResolver.\n *\n * @returns The ComponentFactoryResolver instance to use\n */\nexport function injectComponentFactoryResolver(): viewEngine_ComponentFactoryResolver {\n return componentFactoryResolver;\n}\nconst componentFactoryResolver: ComponentFactoryResolver = new ComponentFactoryResolver();\n\n/**\n * Inject static attribute value into directive constructor.\n *\n * This method is used with `factory` functions which are generated as part of\n * `defineDirective` or `defineComponent`. The method retrieves the static value\n * of an attribute. (Dynamic attributes are not supported since they are not resolved\n * at the time of injection and can change over time.)\n *\n * # Example\n * Given:\n * ```\n * @Component(...)\n * class MyComponent {\n * constructor(@Attribute('title') title: string) { ... }\n * }\n * ```\n * When instantiated with\n * ```\n * <my-component title=\"Hello\"></my-component>\n * ```\n *\n * Then factory method generated is:\n * ```\n * MyComponent.ngComponentDef = defineComponent({\n * factory: () => new MyComponent(injectAttribute('title'))\n * ...\n * })\n * ```\n *\n * @experimental\n */\nexport function injectAttribute(attrNameToInject: string): string|undefined {\n ngDevMode && assertPreviousIsParent();\n const lElement = getPreviousOrParentNode() as LElementNode;\n ngDevMode && assertNodeType(lElement, TNodeType.Element);\n const tElement = lElement.tNode;\n ngDevMode && assertDefined(tElement, 'expecting tNode');\n const attrs = tElement.attrs;\n if (attrs) {\n for (let i = 0; i < attrs.length; i = i + 2) {\n const attrName = attrs[i];\n if (attrName === AttributeMarker.SelectOnly) break;\n if (attrName == attrNameToInject) {\n return attrs[i + 1] as string;\n }\n }\n }\n return undefined;\n}\n\n/**\n * Creates a ViewRef and stores it on the injector as ChangeDetectorRef (public alias).\n * Or, if it already exists, retrieves the existing instance.\n *\n * @returns The ChangeDetectorRef to use\n */\nexport function getOrCreateChangeDetectorRef(\n di: LInjector, context: any): viewEngine_ChangeDetectorRef {\n if (di.changeDetectorRef) return di.changeDetectorRef;\n\n const currentNode = di.node;\n if (isComponent(currentNode.tNode)) {\n return di.changeDetectorRef = new ViewRef(currentNode.data as LViewData, context);\n } else if (currentNode.tNode.type === TNodeType.Element) {\n return di.changeDetectorRef = getOrCreateHostChangeDetector(currentNode.view[HOST_NODE]);\n }\n return null !;\n}\n\n/** Gets or creates ChangeDetectorRef for the closest host component */\nfunction getOrCreateHostChangeDetector(currentNode: LViewNode | LElementNode):\n viewEngine_ChangeDetectorRef {\n const hostNode = getClosestComponentAncestor(currentNode);\n const hostInjector = hostNode.nodeInjector;\n const existingRef = hostInjector && hostInjector.changeDetectorRef;\n\n return existingRef ?\n existingRef :\n new ViewRef(\n hostNode.data as LViewData,\n hostNode\n .view[DIRECTIVES] ![hostNode.tNode.flags >> TNodeFlags.DirectiveStartingIndexShift]);\n}\n\n/**\n * If the node is an embedded view, traverses up the view tree to return the closest\n * ancestor view that is attached to a component. If it's already a component node,\n * returns itself.\n */\nfunction getClosestComponentAncestor(node: LViewNode | LElementNode): LElementNode {\n while (node.tNode.type === TNodeType.View) {\n node = node.view[HOST_NODE];\n }\n return node as LElementNode;\n}\n\n/**\n * Searches for an instance of the given directive type up the injector tree and returns\n * that instance if found.\n *\n * Specifically, it gets the bloom filter bit associated with the directive (see bloomHashBit),\n * checks that bit against the bloom filter structure to identify an injector that might have\n * the directive (see bloomFindPossibleInjector), then searches the directives on that injector\n * for a match.\n *\n * If not found, it will propagate up to the next parent injector until the token\n * is found or the top is reached.\n *\n * @param di Node injector where the search should start\n * @param token The directive type to search for\n * @param flags Injection flags (e.g. CheckParent)\n * @returns The instance found\n */\nexport function getOrCreateInjectable<T>(\n di: LInjector, token: Type<T>, flags: InjectFlags = InjectFlags.Default): T|null {\n const bloomHash = bloomHashBit(token);\n\n // If the token has a bloom hash, then it is a directive that is public to the injection system\n // (diPublic). If there is no hash, fall back to the module injector.\n if (bloomHash === null) {\n const moduleInjector = getPreviousOrParentNode().view[INJECTOR];\n const formerInjector = setCurrentInjector(moduleInjector);\n try {\n return inject(token, flags);\n } finally {\n setCurrentInjector(formerInjector);\n }\n } else {\n let injector: LInjector|null = di;\n\n while (injector) {\n // Get the closest potential matching injector (upwards in the injector tree) that\n // *potentially* has the token.\n injector = bloomFindPossibleInjector(injector, bloomHash, flags);\n\n // If no injector is found, we *know* that there is no ancestor injector that contains the\n // token, so we abort.\n if (!injector) {\n break;\n }\n\n // At this point, we have an injector which *may* contain the token, so we step through the\n // directives associated with the injector's corresponding node to get the directive instance.\n const node = injector.node;\n const nodeFlags = node.tNode.flags;\n const count = nodeFlags & TNodeFlags.DirectiveCountMask;\n\n if (count !== 0) {\n const start = nodeFlags >> TNodeFlags.DirectiveStartingIndexShift;\n const end = start + count;\n const defs = node.view[TVIEW].directives !;\n\n for (let i = start; i < end; i++) {\n // Get the definition for the directive at this index and, if it is injectable (diPublic),\n // and matches the given token, return the directive instance.\n const directiveDef = defs[i] as DirectiveDefInternal<any>;\n if (directiveDef.type === token && directiveDef.diPublic) {\n return node.view[DIRECTIVES] ![i];\n }\n }\n }\n\n // If we *didn't* find the directive for the token and we are searching the current node's\n // injector, it's possible the directive is on this node and hasn't been created yet.\n let instance: T|null;\n if (injector === di && (instance = searchMatchesQueuedForCreation<T>(node, token))) {\n return instance;\n }\n\n // The def wasn't found anywhere on this node, so it was a false positive.\n // If flags permit, traverse up the tree and continue searching.\n if (flags & InjectFlags.Self || flags & InjectFlags.Host && !sameHostView(injector)) {\n injector = null;\n } else {\n injector = injector.parent;\n }\n }\n }\n\n // No directive was found for the given token.\n if (flags & InjectFlags.Optional) return null;\n throw new Error(`Injector: NOT_FOUND [${stringify(token)}]`);\n}\n\nfunction searchMatchesQueuedForCreation<T>(node: LNode, token: any): T|null {\n const matches = node.view[TVIEW].currentMatches;\n if (matches) {\n for (let i = 0; i < matches.length; i += 2) {\n const def = matches[i] as DirectiveDefInternal<any>;\n if (def.type === token) {\n return resolveDirective(def, i + 1, matches, node.view[TVIEW]);\n }\n }\n }\n return null;\n}\n\n/**\n * Given a directive type, this function returns the bit in an injector's bloom filter\n * that should be used to determine whether or not the directive is present.\n *\n * When the directive was added to the bloom filter, it was given a unique ID that can be\n * retrieved on the class. Since there are only BLOOM_SIZE slots per bloom filter, the directive's\n * ID must be modulo-ed by BLOOM_SIZE to get the correct bloom bit (directives share slots after\n * BLOOM_SIZE is reached).\n *\n * @param type The directive type\n * @returns The bloom bit to check for the directive\n */\nfunction bloomHashBit(type: Type<any>): number|null {\n let id: number|undefined = (type as any)[NG_ELEMENT_ID];\n return typeof id === 'number' ? id % BLOOM_SIZE : null;\n}\n\n/**\n * Finds the closest injector that might have a certain directive.\n *\n * Each directive corresponds to a bit in an injector's bloom filter. Given the bloom bit to\n * check and a starting injector, this function traverses up injectors until it finds an\n * injector that contains a 1 for that bit in its bloom filter. A 1 indicates that the\n * injector may have that directive. It only *may* have the directive because directives begin\n * to share bloom filter bits after the BLOOM_SIZE is reached, and it could correspond to a\n * different directive sharing the bit.\n *\n * Note: We can skip checking further injectors up the tree if an injector's cbf structure\n * has a 0 for that bloom bit. Since cbf contains the merged value of all the parent\n * injectors, a 0 in the bloom bit indicates that the parents definitely do not contain\n * the directive and do not need to be checked.\n *\n * @param injector The starting node injector to check\n * @param bloomBit The bit to check in each injector's bloom filter\n * @param flags The injection flags for this injection site (e.g. Optional or SkipSelf)\n * @returns An injector that might have the directive\n */\nexport function bloomFindPossibleInjector(\n startInjector: LInjector, bloomBit: number, flags: InjectFlags): LInjector|null {\n // Create a mask that targets the specific bit associated with the directive we're looking for.\n // JS bit operations are 32 bits, so this will be a number between 2^0 and 2^31, corresponding\n // to bit positions 0 - 31 in a 32 bit integer.\n const mask = 1 << bloomBit;\n\n // Traverse up the injector tree until we find a potential match or until we know there *isn't* a\n // match.\n let injector: LInjector|null =\n flags & InjectFlags.SkipSelf ? startInjector.parent ! : startInjector;\n while (injector) {\n // Our bloom filter size is 256 bits, which is eight 32-bit bloom filter buckets:\n // bf0 = [0 - 31], bf1 = [32 - 63], bf2 = [64 - 95], bf3 = [96 - 127], etc.\n // Get the bloom filter value from the appropriate bucket based on the directive's bloomBit.\n let value: number;\n if (bloomBit < 128) {\n value = bloomBit < 64 ? (bloomBit < 32 ? injector.bf0 : injector.bf1) :\n (bloomBit < 96 ? injector.bf2 : injector.bf3);\n } else {\n value = bloomBit < 192 ? (bloomBit < 160 ? injector.bf4 : injector.bf5) :\n (bloomBit < 224 ? injector.bf6 : injector.bf7);\n }\n\n // If the bloom filter value has the bit corresponding to the directive's bloomBit flipped on,\n // this injector is a potential match.\n if ((value & mask) === mask) {\n return injector;\n } else if (flags & InjectFlags.Self || flags & InjectFlags.Host && !sameHostView(injector)) {\n return null;\n }\n\n // If the current injector does not have the directive, check the bloom filters for the ancestor\n // injectors (cbf0 - cbf7). These filters capture *all* ancestor injectors.\n if (bloomBit < 128) {\n value = bloomBit < 64 ? (bloomBit < 32 ? injector.cbf0 : injector.cbf1) :\n (bloomBit < 96 ? injector.cbf2 : injector.cbf3);\n } else {\n value = bloomBit < 192 ? (bloomBit < 160 ? injector.cbf4 : injector.cbf5) :\n (bloomBit < 224 ? injector.cbf6 : injector.cbf7);\n }\n\n // If the ancestor bloom filter value has the bit corresponding to the directive, traverse up to\n // find the specific injector. If the ancestor bloom filter does not have the bit, we can abort.\n injector = (value & mask) ? injector.parent : null;\n }\n return null;\n}\n\n/**\n * Checks whether the current injector and its parent are in the same host view.\n *\n * This is necessary to support @Host() decorators. If @Host() is set, we should stop searching once\n * the injector and its parent view don't match because it means we'd cross the view boundary.\n */\nfunction sameHostView(injector: LInjector): boolean {\n return !!injector.parent && injector.parent.node.view === injector.node.view;\n}\n\nexport class ReadFromInjectorFn<T> {\n constructor(readonly read: (injector: LInjector, node: LNode, directiveIndex?: number) => T) {}\n}\n\n/**\n * Creates an ElementRef for a given node injector and stores it on the injector.\n * Or, if the ElementRef already exists, retrieves the existing ElementRef.\n *\n * @param di The node injector where we should store a created ElementRef\n * @returns The ElementRef instance to use\n */\nexport function getOrCreateElementRef(di: LInjector): viewEngine_ElementRef {\n return di.elementRef || (di.elementRef = new ElementRef(di.node.native));\n}\n\nexport const QUERY_READ_TEMPLATE_REF = <QueryReadType<viewEngine_TemplateRef<any>>>(\n new ReadFromInjectorFn<viewEngine_TemplateRef<any>>(\n (injector: LInjector) => getOrCreateTemplateRef(injector)) as any);\n\nexport const QUERY_READ_CONTAINER_REF = <QueryReadType<viewEngine_ViewContainerRef>>(\n new ReadFromInjectorFn<viewEngine_ViewContainerRef>(\n (injector: LInjector) => getOrCreateContainerRef(injector)) as any);\n\nexport const QUERY_READ_ELEMENT_REF =\n <QueryReadType<viewEngine_ElementRef>>(new ReadFromInjectorFn<viewEngine_ElementRef>(\n (injector: LInjector) => getOrCreateElementRef(injector)) as any);\n\nexport const QUERY_READ_FROM_NODE =\n (new ReadFromInjectorFn<any>((injector: LInjector, node: LNode, directiveIdx: number) => {\n ngDevMode && assertNodeOfPossibleTypes(node, TNodeType.Container, TNodeType.Element);\n if (directiveIdx > -1) {\n return node.view[DIRECTIVES] ![directiveIdx];\n } else if (node.tNode.type === TNodeType.Element) {\n return getOrCreateElementRef(injector);\n } else if (node.tNode.type === TNodeType.Container) {\n return getOrCreateTemplateRef(injector);\n }\n throw new Error('fail');\n }) as any as QueryReadType<any>);\n\n/** A ref to a node's native element. */\nclass ElementRef implements viewEngine_ElementRef {\n readonly nativeElement: any;\n constructor(nativeElement: any) { this.nativeElement = nativeElement; }\n}\n\n/**\n * Creates a ViewContainerRef and stores it on the injector. Or, if the ViewContainerRef\n * already exists, retrieves the existing ViewContainerRef.\n *\n * @returns The ViewContainerRef instance to use\n */\nexport function getOrCreateContainerRef(di: LInjector): viewEngine_ViewContainerRef {\n if (!di.viewContainerRef) {\n const vcRefHost = di.node;\n\n ngDevMode && assertNodeOfPossibleTypes(vcRefHost, TNodeType.Container, TNodeType.Element);\n const hostParent = getParentLNode(vcRefHost) !;\n const lContainer = createLContainer(hostParent, vcRefHost.view, true);\n const comment = vcRefHost.view[RENDERER].createComment(ngDevMode ? 'container' : '');\n const lContainerNode: LContainerNode = createLNodeObject(\n TNodeType.Container, vcRefHost.view, hostParent, comment, lContainer, null);\n appendChild(hostParent, comment, vcRefHost.view);\n\n\n if (vcRefHost.queries) {\n lContainerNode.queries = vcRefHost.queries.container();\n }\n\n const hostTNode = vcRefHost.tNode as TElementNode | TContainerNode;\n if (!hostTNode.dynamicContainerNode) {\n hostTNode.dynamicContainerNode =\n createTNode(TNodeType.Container, -1, null, null, hostTNode, null);\n }\n\n lContainerNode.tNode = hostTNode.dynamicContainerNode;\n vcRefHost.dynamicLContainerNode = lContainerNode;\n\n addToViewTree(vcRefHost.view, hostTNode.index as number, lContainer);\n\n di.viewContainerRef = new ViewContainerRef(lContainerNode);\n }\n\n return di.viewContainerRef;\n}\n\n/**\n * A ref to a container that enables adding and removing views from that container\n * imperatively.\n */\nclass ViewContainerRef implements viewEngine_ViewContainerRef {\n private _viewRefs: viewEngine_ViewRef[] = [];\n // TODO(issue/24571): remove '!'.\n element !: viewEngine_ElementRef;\n // TODO(issue/24571): remove '!'.\n injector !: Injector;\n // TODO(issue/24571): remove '!'.\n parentInjector !: Injector;\n\n constructor(private _lContainerNode: LContainerNode) {}\n\n clear(): void {\n const lContainer = this._lContainerNode.data;\n while (lContainer[VIEWS].length) {\n this.remove(0);\n }\n }\n\n get(index: number): viewEngine_ViewRef|null { return this._viewRefs[index] || null; }\n\n get length(): number {\n const lContainer = this._lContainerNode.data;\n return lContainer[VIEWS].length;\n }\n\n createEmbeddedView<C>(templateRef: viewEngine_TemplateRef<C>, context?: C, index?: number):\n viewEngine_EmbeddedViewRef<C> {\n const adjustedIdx = this._adjustIndex(index);\n const viewRef = (templateRef as TemplateRef<C>)\n .createEmbeddedView(context || <any>{}, this._lContainerNode, adjustedIdx);\n (viewRef as ViewRef<any>).attachToViewContainerRef(this);\n this._viewRefs.splice(adjustedIdx, 0, viewRef);\n return viewRef;\n }\n\n createComponent<C>(\n componentFactory: viewEngine_ComponentFactory<C>, index?: number|undefined,\n injector?: Injector|undefined, projectableNodes?: any[][]|undefined,\n ngModuleRef?: viewEngine_NgModuleRef<any>|undefined): viewEngine_ComponentRef<C> {\n const contextInjector = injector || this.parentInjector;\n if (!ngModuleRef && contextInjector) {\n ngModuleRef = contextInjector.get(viewEngine_NgModuleRef);\n }\n\n const componentRef =\n componentFactory.create(contextInjector, projectableNodes, undefined, ngModuleRef);\n this.insert(componentRef.hostView, index);\n return componentRef;\n }\n\n insert(viewRef: viewEngine_ViewRef, index?: number): viewEngine_ViewRef {\n if (viewRef.destroyed) {\n throw new Error('Cannot insert a destroyed View in a ViewContainer!');\n }\n const lViewNode = (viewRef as ViewRef<any>)._lViewNode !;\n const adjustedIdx = this._adjustIndex(index);\n\n insertView(this._lContainerNode, lViewNode, adjustedIdx);\n const views = this._lContainerNode.data[VIEWS];\n const beforeNode = adjustedIdx + 1 < views.length ?\n (getChildLNode(views[adjustedIdx + 1]) !).native :\n this._lContainerNode.native;\n addRemoveViewFromContainer(this._lContainerNode, lViewNode, true, beforeNode);\n\n (viewRef as ViewRef<any>).attachToViewContainerRef(this);\n this._viewRefs.splice(adjustedIdx, 0, viewRef);\n\n return viewRef;\n }\n\n move(viewRef: viewEngine_ViewRef, newIndex: number): viewEngine_ViewRef {\n const index = this.indexOf(viewRef);\n this.detach(index);\n this.insert(viewRef, this._adjustIndex(newIndex));\n return viewRef;\n }\n\n indexOf(viewRef: viewEngine_ViewRef): number { return this._viewRefs.indexOf(viewRef); }\n\n remove(index?: number): void {\n const adjustedIdx = this._adjustIndex(index, -1);\n removeView(this._lContainerNode, adjustedIdx);\n this._viewRefs.splice(adjustedIdx, 1);\n }\n\n detach(index?: number): viewEngine_ViewRef|null {\n const adjustedIdx = this._adjustIndex(index, -1);\n const lViewNode = detachView(this._lContainerNode, adjustedIdx);\n return this._viewRefs.splice(adjustedIdx, 1)[0] || null;\n }\n\n private _adjustIndex(index?: number, shift: number = 0) {\n if (index == null) {\n return this._lContainerNode.data[VIEWS].length + shift;\n }\n if (ngDevMode) {\n assertGreaterThan(index, -1, 'index must be positive');\n // +1 because it's legal to insert at the end.\n assertLessThan(index, this._lContainerNode.data[VIEWS].length + 1 + shift, 'index');\n }\n return index;\n }\n}\n\n/**\n * Creates a TemplateRef and stores it on the injector. Or, if the TemplateRef already\n * exists, retrieves the existing TemplateRef.\n *\n * @param di The node injector where we should store a created TemplateRef\n * @returns The TemplateRef instance to use\n */\nexport function getOrCreateTemplateRef<T>(di: LInjector): viewEngine_TemplateRef<T> {\n if (!di.templateRef) {\n ngDevMode && assertNodeType(di.node, TNodeType.Container);\n const hostNode = di.node as LContainerNode;\n const hostTNode = hostNode.tNode;\n ngDevMode && assertDefined(hostTNode.tViews, 'TView must be allocated');\n di.templateRef = new TemplateRef<any>(\n getOrCreateElementRef(di), hostTNode.tViews as TView, getRenderer(),\n hostNode.data[QUERIES]);\n }\n return di.templateRef;\n}\n\nclass TemplateRef<T> implements viewEngine_TemplateRef<T> {\n readonly elementRef: viewEngine_ElementRef;\n\n constructor(\n elementRef: viewEngine_ElementRef, private _tView: TView, private _renderer: Renderer3,\n private _queries: LQueries|null) {\n this.elementRef = elementRef;\n }\n\n createEmbeddedView(context: T, containerNode?: LContainerNode, index?: number):\n viewEngine_EmbeddedViewRef<T> {\n const viewNode = createEmbeddedViewNode(this._tView, context, this._renderer, this._queries);\n if (containerNode) {\n insertView(containerNode, viewNode, index !);\n }\n renderEmbeddedTemplate(viewNode, this._tView, context, RenderFlags.Create);\n const viewRef = new ViewRef(viewNode.data, context);\n viewRef._lViewNode = viewNode;\n return viewRef;\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {diPublic} from '../di';\nimport {DirectiveDefInternal} from '../interfaces/definition';\n\n/**\n * This feature publishes the directive (or component) into the DI system, making it visible to\n * others for injection.\n *\n * @param definition\n */\nexport function PublicFeature<T>(definition: DirectiveDefInternal<T>) {\n definition.diPublic = diPublic;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {assertEqual, assertLessThan} from './assert';\nimport {NO_CHANGE, bindingUpdated, bindingUpdated2, bindingUpdated4, createLNode, getPreviousOrParentNode, getRenderer, getViewData, load, resetApplicationState} from './instructions';\nimport {RENDER_PARENT} from './interfaces/container';\nimport {LContainerNode, LNode, TContainerNode, TElementNode, TNodeType} from './interfaces/node';\nimport {BINDING_INDEX, HEADER_OFFSET, TVIEW} from './interfaces/view';\nimport {appendChild, createTextNode, getParentLNode, removeChild} from './node_manipulation';\nimport {stringify} from './util';\n\n/**\n * A list of flags to encode the i18n instructions used to translate the template.\n * We shift the flags by 29 so that 30 & 31 & 32 bits contains the instructions.\n */\nexport const enum I18nInstructions {\n Text = 1 << 29,\n Element = 2 << 29,\n Expression = 3 << 29,\n TemplateRoot = 4 << 29,\n Any = 5 << 29,\n CloseNode = 6 << 29,\n RemoveNode = 7 << 29,\n /** Used to decode the number encoded with the instruction. */\n IndexMask = (1 << 29) - 1,\n /** Used to test the type of instruction. */\n InstructionMask = ~((1 << 29) - 1),\n}\n\n/**\n * Represents the instructions used to translate the template.\n * Instructions can be a placeholder index, a static text or a simple bit field (`I18nFlag`).\n * When the instruction is the flag `Text`, it is always followed by its text value.\n */\nexport type I18nInstruction = number | string;\n/**\n * Represents the instructions used to translate attributes containing expressions.\n * Even indexes contain static strings, while odd indexes contain the index of the expression whose\n * value will be concatenated into the final translation.\n */\nexport type I18nExpInstruction = number | string;\n/** Mapping of placeholder names to their absolute indexes in their templates. */\nexport type PlaceholderMap = {\n [name: string]: number\n};\nconst i18nTagRegex = /{\\$([^}]+)}/g;\n\n/**\n * Takes a translation string, the initial list of placeholders (elements and expressions) and the\n * indexes of their corresponding expression nodes to return a list of instructions for each\n * template function.\n *\n * Because embedded templates have different indexes for each placeholder, each parameter (except\n * the translation) is an array, where each value corresponds to a different template, by order of\n * appearance.\n *\n * @param translation A translation string where placeholders are represented by `{$name}`\n * @param elements An array containing, for each template, the maps of element placeholders and\n * their indexes.\n * @param expressions An array containing, for each template, the maps of expression placeholders\n * and their indexes.\n * @param templateRoots An array of template roots whose content should be ignored when\n * generating the instructions for their parent template.\n * @param lastChildIndex The index of the last child of the i18n node. Used when the i18n block is\n * an ng-container.\n *\n * @returns A list of instructions used to translate each template.\n */\nexport function i18nMapping(\n translation: string, elements: (PlaceholderMap | null)[] | null,\n expressions?: (PlaceholderMap | null)[] | null, templateRoots?: string[] | null,\n lastChildIndex?: number | null): I18nInstruction[][] {\n const translationParts = translation.split(i18nTagRegex);\n const nbTemplates = templateRoots ? templateRoots.length + 1 : 1;\n const instructions: I18nInstruction[][] = (new Array(nbTemplates)).fill(undefined);\n\n generateMappingInstructions(\n 0, 0, translationParts, instructions, elements, expressions, templateRoots, lastChildIndex);\n\n return instructions;\n}\n\n/**\n * Internal function that reads the translation parts and generates a set of instructions for each\n * template.\n *\n * See `i18nMapping()` for more details.\n *\n * @param tmplIndex The order of appearance of the template.\n * 0 for the root template, following indexes match the order in `templateRoots`.\n * @param partIndex The current index in `translationParts`.\n * @param translationParts The translation string split into an array of placeholders and text\n * elements.\n * @param instructions The current list of instructions to update.\n * @param elements An array containing, for each template, the maps of element placeholders and\n * their indexes.\n * @param expressions An array containing, for each template, the maps of expression placeholders\n * and their indexes.\n * @param templateRoots An array of template roots whose content should be ignored when\n * generating the instructions for their parent template.\n * @param lastChildIndex The index of the last child of the i18n node. Used when the i18n block is\n * an ng-container.\n *\n * @returns the current index in `translationParts`\n */\nfunction generateMappingInstructions(\n tmplIndex: number, partIndex: number, translationParts: string[],\n instructions: I18nInstruction[][], elements: (PlaceholderMap | null)[] | null,\n expressions?: (PlaceholderMap | null)[] | null, templateRoots?: string[] | null,\n lastChildIndex?: number | null): number {\n const tmplInstructions: I18nInstruction[] = [];\n const phVisited: string[] = [];\n let openedTagCount = 0;\n let maxIndex = 0;\n let currentElements: PlaceholderMap|null =\n elements && elements[tmplIndex] ? elements[tmplIndex] : null;\n let currentExpressions: PlaceholderMap|null =\n expressions && expressions[tmplIndex] ? expressions[tmplIndex] : null;\n\n instructions[tmplIndex] = tmplInstructions;\n\n for (; partIndex < translationParts.length; partIndex++) {\n // The value can either be text or the name of a placeholder (element/template root/expression)\n const value = translationParts[partIndex];\n\n // Odd indexes are placeholders\n if (partIndex & 1) {\n let phIndex;\n if (currentElements && currentElements[value] !== undefined) {\n phIndex = currentElements[value];\n // The placeholder represents a DOM element, add an instruction to move it\n let templateRootIndex = templateRoots ? templateRoots.indexOf(value) : -1;\n if (templateRootIndex !== -1 && (templateRootIndex + 1) !== tmplIndex) {\n // This is a template root, it has no closing tag, not treating it as an element\n tmplInstructions.push(phIndex | I18nInstructions.TemplateRoot);\n } else {\n tmplInstructions.push(phIndex | I18nInstructions.Element);\n openedTagCount++;\n }\n phVisited.push(value);\n } else if (currentExpressions && currentExpressions[value] !== undefined) {\n phIndex = currentExpressions[value];\n // The placeholder represents an expression, add an instruction to move it\n tmplInstructions.push(phIndex | I18nInstructions.Expression);\n phVisited.push(value);\n } else {\n // It is a closing tag\n tmplInstructions.push(I18nInstructions.CloseNode);\n\n if (tmplIndex > 0) {\n openedTagCount--;\n\n // If we have reached the closing tag for this template, exit the loop\n if (openedTagCount === 0) {\n break;\n }\n }\n }\n\n if (phIndex !== undefined && phIndex > maxIndex) {\n maxIndex = phIndex;\n }\n\n if (templateRoots) {\n const newTmplIndex = templateRoots.indexOf(value) + 1;\n if (newTmplIndex !== 0 && newTmplIndex !== tmplIndex) {\n partIndex = generateMappingInstructions(\n newTmplIndex, partIndex, translationParts, instructions, elements, expressions,\n templateRoots, lastChildIndex);\n }\n }\n\n } else if (value) {\n // It's a non-empty string, create a text node\n tmplInstructions.push(I18nInstructions.Text, value);\n }\n }\n\n // Add instructions to remove elements that are not used in the translation\n if (elements) {\n const tmplElements = elements[tmplIndex];\n\n if (tmplElements) {\n const phKeys = Object.keys(tmplElements);\n\n for (let i = 0; i < phKeys.length; i++) {\n const ph = phKeys[i];\n\n if (phVisited.indexOf(ph) === -1) {\n let index = tmplElements[ph];\n // Add an instruction to remove the element\n tmplInstructions.push(index | I18nInstructions.RemoveNode);\n\n if (index > maxIndex) {\n maxIndex = index;\n }\n }\n }\n }\n }\n\n // Add instructions to remove expressions that are not used in the translation\n if (expressions) {\n const tmplExpressions = expressions[tmplIndex];\n\n if (tmplExpressions) {\n const phKeys = Object.keys(tmplExpressions);\n\n for (let i = 0; i < phKeys.length; i++) {\n const ph = phKeys[i];\n\n if (phVisited.indexOf(ph) === -1) {\n let index = tmplExpressions[ph];\n if (ngDevMode) {\n assertLessThan(\n index.toString(2).length, 28, `Index ${index} is too big and will overflow`);\n }\n // Add an instruction to remove the expression\n tmplInstructions.push(index | I18nInstructions.RemoveNode);\n\n if (index > maxIndex) {\n maxIndex = index;\n }\n }\n }\n }\n }\n\n if (tmplIndex === 0 && typeof lastChildIndex === 'number') {\n // The current parent is an ng-container and it has more children after the translation that we\n // need to append to keep the order of the DOM nodes correct\n for (let i = maxIndex + 1; i <= lastChildIndex; i++) {\n if (ngDevMode) {\n assertLessThan(i.toString(2).length, 28, `Index ${i} is too big and will overflow`);\n }\n tmplInstructions.push(i | I18nInstructions.Any);\n }\n }\n\n return partIndex;\n}\n\nfunction appendI18nNode(node: LNode, parentNode: LNode, previousNode: LNode) {\n if (ngDevMode) {\n ngDevMode.rendererMoveNode++;\n }\n\n const viewData = getViewData();\n\n appendChild(parentNode, node.native || null, viewData);\n\n // On first pass, re-organize node tree to put this node in the correct position.\n const firstTemplatePass = node.view[TVIEW].firstTemplatePass;\n if (firstTemplatePass) {\n if (previousNode === parentNode && node.tNode !== parentNode.tNode.child) {\n node.tNode.next = parentNode.tNode.child;\n parentNode.tNode.child = node.tNode;\n } else if (previousNode !== parentNode && node.tNode !== previousNode.tNode.next) {\n node.tNode.next = previousNode.tNode.next;\n previousNode.tNode.next = node.tNode;\n } else {\n node.tNode.next = null;\n }\n\n if (parentNode.view === node.view) node.tNode.parent = parentNode.tNode as TElementNode;\n }\n\n // Template containers also have a comment node for the `ViewContainerRef` that should be moved\n if (node.tNode.type === TNodeType.Container && node.dynamicLContainerNode) {\n appendChild(parentNode, node.dynamicLContainerNode.native || null, viewData);\n if (firstTemplatePass) {\n node.tNode.dynamicContainerNode = node.dynamicLContainerNode.tNode;\n node.dynamicLContainerNode.tNode.parent = node.tNode as TContainerNode;\n }\n return node.dynamicLContainerNode;\n }\n\n return node;\n}\n\n/**\n * Takes a list of instructions generated by `i18nMapping()` to transform the template accordingly.\n *\n * @param startIndex Index of the first element to translate (for instance the first child of the\n * element with the i18n attribute).\n * @param instructions The list of instructions to apply on the current view.\n */\nexport function i18nApply(startIndex: number, instructions: I18nInstruction[]): void {\n const viewData = getViewData();\n if (ngDevMode) {\n assertEqual(viewData[BINDING_INDEX], -1, 'i18nApply should be called before any binding');\n }\n\n if (!instructions) {\n return;\n }\n\n const renderer = getRenderer();\n let localParentNode: LNode = getParentLNode(load(startIndex)) || getPreviousOrParentNode();\n let localPreviousNode: LNode = localParentNode;\n resetApplicationState(); // We don't want to add to the tree with the wrong previous node\n\n for (let i = 0; i < instructions.length; i++) {\n const instruction = instructions[i] as number;\n switch (instruction & I18nInstructions.InstructionMask) {\n case I18nInstructions.Element:\n const element: LNode = load(instruction & I18nInstructions.IndexMask);\n localPreviousNode = appendI18nNode(element, localParentNode, localPreviousNode);\n localParentNode = element;\n break;\n case I18nInstructions.Expression:\n case I18nInstructions.TemplateRoot:\n case I18nInstructions.Any:\n const node: LNode = load(instruction & I18nInstructions.IndexMask);\n localPreviousNode = appendI18nNode(node, localParentNode, localPreviousNode);\n break;\n case I18nInstructions.Text:\n if (ngDevMode) {\n ngDevMode.rendererCreateTextNode++;\n }\n const value = instructions[++i];\n const textRNode = createTextNode(value, renderer);\n // If we were to only create a `RNode` then projections won't move the text.\n // Create text node at the current end of viewData. Must subtract header offset because\n // createLNode takes a raw index (not adjusted by header offset).\n const textLNode =\n createLNode(viewData.length - HEADER_OFFSET, TNodeType.Element, textRNode, null, null);\n localPreviousNode = appendI18nNode(textLNode, localParentNode, localPreviousNode);\n resetApplicationState();\n break;\n case I18nInstructions.CloseNode:\n localPreviousNode = localParentNode;\n localParentNode = getParentLNode(localParentNode) !;\n break;\n case I18nInstructions.RemoveNode:\n if (ngDevMode) {\n ngDevMode.rendererRemoveNode++;\n }\n const index = instruction & I18nInstructions.IndexMask;\n const removedNode: LNode|LContainerNode = load(index);\n const parentNode = getParentLNode(removedNode) !;\n removeChild(parentNode, removedNode.native || null, viewData);\n\n // For template containers we also need to remove their `ViewContainerRef` from the DOM\n if (removedNode.tNode.type === TNodeType.Container && removedNode.dynamicLContainerNode) {\n removeChild(parentNode, removedNode.dynamicLContainerNode.native || null, viewData);\n removedNode.dynamicLContainerNode.tNode.detached = true;\n removedNode.dynamicLContainerNode.data[RENDER_PARENT] = null;\n }\n break;\n }\n }\n}\n\n/**\n * Takes a translation string and the initial list of expressions and returns a list of instructions\n * that will be used to translate an attribute.\n * Even indexes contain static strings, while odd indexes contain the index of the expression whose\n * value will be concatenated into the final translation.\n */\nexport function i18nExpMapping(\n translation: string, placeholders: PlaceholderMap): I18nExpInstruction[] {\n const staticText: I18nExpInstruction[] = translation.split(i18nTagRegex);\n // odd indexes are placeholders\n for (let i = 1; i < staticText.length; i += 2) {\n staticText[i] = placeholders[staticText[i]];\n }\n return staticText;\n}\n\n/**\n * Checks if the value of an expression has changed and replaces it by its value in a translation,\n * or returns NO_CHANGE.\n *\n * @param instructions A list of instructions that will be used to translate an attribute.\n * @param v0 value checked for change.\n *\n * @returns The concatenated string when any of the arguments changes, `NO_CHANGE` otherwise.\n */\nexport function i18nInterpolation1(instructions: I18nExpInstruction[], v0: any): string|NO_CHANGE {\n const different = bindingUpdated(v0);\n\n if (!different) {\n return NO_CHANGE;\n }\n\n let res = '';\n for (let i = 0; i < instructions.length; i++) {\n // Odd indexes are bindings\n if (i & 1) {\n res += stringify(v0);\n } else {\n res += instructions[i];\n }\n }\n\n return res;\n}\n\n/**\n * Checks if the values of up to 2 expressions have changed and replaces them by their values in a\n * translation, or returns NO_CHANGE.\n *\n * @param instructions A list of instructions that will be used to translate an attribute.\n * @param v0 value checked for change.\n * @param v1 value checked for change.\n *\n * @returns The concatenated string when any of the arguments changes, `NO_CHANGE` otherwise.\n */\nexport function i18nInterpolation2(instructions: I18nExpInstruction[], v0: any, v1: any): string|\n NO_CHANGE {\n const different = bindingUpdated2(v0, v1);\n\n if (!different) {\n return NO_CHANGE;\n }\n\n let res = '';\n for (let i = 0; i < instructions.length; i++) {\n // Odd indexes are bindings\n if (i & 1) {\n // Extract bits\n const idx = instructions[i] as number;\n const b1 = idx & 1;\n // Get the value from the argument vx where x = idx\n const value = b1 ? v1 : v0;\n\n res += stringify(value);\n } else {\n res += instructions[i];\n }\n }\n\n return res;\n}\n\n/**\n * Checks if the values of up to 3 expressions have changed and replaces them by their values in a\n * translation, or returns NO_CHANGE.\n *\n * @param instructions A list of instructions that will be used to translate an attribute.\n * @param v0 value checked for change.\n * @param v1 value checked for change.\n * @param v2 value checked for change.\n *\n * @returns The concatenated string when any of the arguments changes, `NO_CHANGE` otherwise.\n */\nexport function i18nInterpolation3(\n instructions: I18nExpInstruction[], v0: any, v1: any, v2: any): string|NO_CHANGE {\n let different = bindingUpdated2(v0, v1);\n different = bindingUpdated(v2) || different;\n\n if (!different) {\n return NO_CHANGE;\n }\n\n let res = '';\n for (let i = 0; i < instructions.length; i++) {\n // Odd indexes are bindings\n if (i & 1) {\n // Extract bits\n const idx = instructions[i] as number;\n const b2 = idx & 2;\n const b1 = idx & 1;\n // Get the value from the argument vx where x = idx\n const value = b2 ? v2 : (b1 ? v1 : v0);\n\n res += stringify(value);\n } else {\n res += instructions[i];\n }\n }\n\n return res;\n}\n\n/**\n * Checks if the values of up to 4 expressions have changed and replaces them by their values in a\n * translation, or returns NO_CHANGE.\n *\n * @param instructions A list of instructions that will be used to translate an attribute.\n * @param v0 value checked for change.\n * @param v1 value checked for change.\n * @param v2 value checked for change.\n * @param v3 value checked for change.\n *\n * @returns The concatenated string when any of the arguments changes, `NO_CHANGE` otherwise.\n */\nexport function i18nInterpolation4(\n instructions: I18nExpInstruction[], v0: any, v1: any, v2: any, v3: any): string|NO_CHANGE {\n const different = bindingUpdated4(v0, v1, v2, v3);\n\n if (!different) {\n return NO_CHANGE;\n }\n\n let res = '';\n for (let i = 0; i < instructions.length; i++) {\n // Odd indexes are bindings\n if (i & 1) {\n // Extract bits\n const idx = instructions[i] as number;\n const b2 = idx & 2;\n const b1 = idx & 1;\n // Get the value from the argument vx where x = idx\n const value = b2 ? (b1 ? v3 : v2) : (b1 ? v1 : v0);\n\n res += stringify(value);\n } else {\n res += instructions[i];\n }\n }\n\n return res;\n}\n\n/**\n * Checks if the values of up to 5 expressions have changed and replaces them by their values in a\n * translation, or returns NO_CHANGE.\n *\n * @param instructions A list of instructions that will be used to translate an attribute.\n * @param v0 value checked for change.\n * @param v1 value checked for change.\n * @param v2 value checked for change.\n * @param v3 value checked for change.\n * @param v4 value checked for change.\n *\n * @returns The concatenated string when any of the arguments changes, `NO_CHANGE` otherwise.\n */\nexport function i18nInterpolation5(\n instructions: I18nExpInstruction[], v0: any, v1: any, v2: any, v3: any, v4: any): string|\n NO_CHANGE {\n let different = bindingUpdated4(v0, v1, v2, v3);\n different = bindingUpdated(v4) || different;\n\n if (!different) {\n return NO_CHANGE;\n }\n\n let res = '';\n for (let i = 0; i < instructions.length; i++) {\n // Odd indexes are bindings\n if (i & 1) {\n // Extract bits\n const idx = instructions[i] as number;\n const b4 = idx & 4;\n const b2 = idx & 2;\n const b1 = idx & 1;\n // Get the value from the argument vx where x = idx\n const value = b4 ? v4 : (b2 ? (b1 ? v3 : v2) : (b1 ? v1 : v0));\n\n res += stringify(value);\n } else {\n res += instructions[i];\n }\n }\n\n return res;\n}\n\n/**\n * Checks if the values of up to 6 expressions have changed and replaces them by their values in a\n * translation, or returns NO_CHANGE.\n *\n * @param instructions A list of instructions that will be used to translate an attribute.\n * @param v0 value checked for change.\n * @param v1 value checked for change.\n * @param v2 value checked for change.\n * @param v3 value checked for change.\n * @param v4 value checked for change.\n * @param v5 value checked for change.\n *\n * @returns The concatenated string when any of the arguments changes, `NO_CHANGE` otherwise.\n */ export function\ni18nInterpolation6(\n instructions: I18nExpInstruction[], v0: any, v1: any, v2: any, v3: any, v4: any, v5: any):\n string|NO_CHANGE {\n let different = bindingUpdated4(v0, v1, v2, v3);\n different = bindingUpdated2(v4, v5) || different;\n\n if (!different) {\n return NO_CHANGE;\n }\n\n let res = '';\n for (let i = 0; i < instructions.length; i++) {\n // Odd indexes are bindings\n if (i & 1) {\n // Extract bits\n const idx = instructions[i] as number;\n const b4 = idx & 4;\n const b2 = idx & 2;\n const b1 = idx & 1;\n // Get the value from the argument vx where x = idx\n const value = b4 ? (b1 ? v5 : v4) : (b2 ? (b1 ? v3 : v2) : (b1 ? v1 : v0));\n\n res += stringify(value);\n } else {\n res += instructions[i];\n }\n }\n\n return res;\n}\n\n/**\n * Checks if the values of up to 7 expressions have changed and replaces them by their values in a\n * translation, or returns NO_CHANGE.\n *\n * @param instructions A list of instructions that will be used to translate an attribute.\n * @param v0 value checked for change.\n * @param v1 value checked for change.\n * @param v2 value checked for change.\n * @param v3 value checked for change.\n * @param v4 value checked for change.\n * @param v5 value checked for change.\n * @param v6 value checked for change.\n *\n * @returns The concatenated string when any of the arguments changes, `NO_CHANGE` otherwise.\n */\nexport function i18nInterpolation7(\n instructions: I18nExpInstruction[], v0: any, v1: any, v2: any, v3: any, v4: any, v5: any,\n v6: any): string|NO_CHANGE {\n let different = bindingUpdated4(v0, v1, v2, v3);\n different = bindingUpdated2(v4, v5) || different;\n different = bindingUpdated(v6) || different;\n\n if (!different) {\n return NO_CHANGE;\n }\n\n let res = '';\n for (let i = 0; i < instructions.length; i++) {\n // Odd indexes are bindings\n if (i & 1) {\n // Extract bits\n const idx = instructions[i] as number;\n const b4 = idx & 4;\n const b2 = idx & 2;\n const b1 = idx & 1;\n // Get the value from the argument vx where x = idx\n const value = b4 ? (b2 ? v6 : (b1 ? v5 : v4)) : (b2 ? (b1 ? v3 : v2) : (b1 ? v1 : v0));\n\n res += stringify(value);\n } else {\n res += instructions[i];\n }\n }\n\n return res;\n}\n\n/**\n * Checks if the values of up to 8 expressions have changed and replaces them by their values in a\n * translation, or returns NO_CHANGE.\n *\n * @param instructions A list of instructions that will be used to translate an attribute.\n * @param v0 value checked for change.\n * @param v1 value checked for change.\n * @param v2 value checked for change.\n * @param v3 value checked for change.\n * @param v4 value checked for change.\n * @param v5 value checked for change.\n * @param v6 value checked for change.\n * @param v7 value checked for change.\n *\n * @returns The concatenated string when any of the arguments changes, `NO_CHANGE` otherwise.\n */\nexport function i18nInterpolation8(\n instructions: I18nExpInstruction[], v0: any, v1: any, v2: any, v3: any, v4: any, v5: any,\n v6: any, v7: any): string|NO_CHANGE {\n let different = bindingUpdated4(v0, v1, v2, v3);\n different = bindingUpdated4(v4, v5, v6, v7) || different;\n\n if (!different) {\n return NO_CHANGE;\n }\n\n let res = '';\n for (let i = 0; i < instructions.length; i++) {\n // Odd indexes are bindings\n if (i & 1) {\n // Extract bits\n const idx = instructions[i] as number;\n const b4 = idx & 4;\n const b2 = idx & 2;\n const b1 = idx & 1;\n // Get the value from the argument vx where x = idx\n const value =\n b4 ? (b2 ? (b1 ? v7 : v6) : (b1 ? v5 : v4)) : (b2 ? (b1 ? v3 : v2) : (b1 ? v1 : v0));\n\n res += stringify(value);\n } else {\n res += instructions[i];\n }\n }\n\n return res;\n}\n\n/**\n * Create a translated interpolation binding with a variable number of expressions.\n *\n * If there are 1 to 8 expressions then `i18nInterpolation()` should be used instead. It is faster\n * because there is no need to create an array of expressions and iterate over it.\n *\n * @returns The concatenated string when any of the arguments changes, `NO_CHANGE` otherwise.\n */\nexport function i18nInterpolationV(instructions: I18nExpInstruction[], values: any[]): string|\n NO_CHANGE {\n let different = false;\n for (let i = 0; i < values.length; i++) {\n // Check if bindings have changed\n bindingUpdated(values[i]) && (different = true);\n }\n\n if (!different) {\n return NO_CHANGE;\n }\n\n let res = '';\n for (let i = 0; i < instructions.length; i++) {\n // Odd indexes are placeholders\n if (i & 1) {\n res += stringify(values[instructions[i] as number]);\n } else {\n res += instructions[i];\n }\n }\n\n return res;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Injector} from '../di/injector';\nimport {StaticProvider} from '../di/provider';\nimport {createInjector} from '../di/r3_injector';\nimport {ComponentFactoryResolver as viewEngine_ComponentFactoryResolver} from '../linker/component_factory_resolver';\nimport {InternalNgModuleRef, NgModuleFactory as viewEngine_NgModuleFactory, NgModuleRef as viewEngine_NgModuleRef} from '../linker/ng_module_factory';\nimport {NgModuleDefInternal} from '../metadata/ng_module';\nimport {Type} from '../type';\nimport {stringify} from '../util';\nimport {assertDefined} from './assert';\nimport {ComponentFactoryResolver} from './component_ref';\n\nexport interface NgModuleType { ngModuleDef: NgModuleDefInternal<any>; }\n\nexport const COMPONENT_FACTORY_RESOLVER: StaticProvider = {\n provide: viewEngine_ComponentFactoryResolver,\n useFactory: () => new ComponentFactoryResolver(),\n deps: [],\n};\n\nexport class NgModuleRef<T> extends viewEngine_NgModuleRef<T> implements InternalNgModuleRef<T> {\n // tslint:disable-next-line:require-internal-with-underscore\n _bootstrapComponents: Type<any>[] = [];\n injector: Injector;\n componentFactoryResolver: viewEngine_ComponentFactoryResolver;\n instance: T;\n destroyCbs: (() => void)[]|null = [];\n\n constructor(ngModuleType: Type<T>, parentInjector: Injector|null) {\n super();\n const ngModuleDef = (ngModuleType as any as NgModuleType).ngModuleDef;\n ngDevMode && assertDefined(\n ngModuleDef,\n `NgModule '${stringify(ngModuleType)}' is not a subtype of 'NgModuleType'.`);\n\n this._bootstrapComponents = ngModuleDef.bootstrap;\n const additionalProviders: StaticProvider[] = [\n COMPONENT_FACTORY_RESOLVER, {\n provide: viewEngine_NgModuleRef,\n useValue: this,\n }\n ];\n this.injector = createInjector(ngModuleType, parentInjector, additionalProviders);\n this.instance = this.injector.get(ngModuleType);\n this.componentFactoryResolver = new ComponentFactoryResolver();\n }\n\n destroy(): void {\n ngDevMode && assertDefined(this.destroyCbs, 'NgModule already destroyed');\n this.destroyCbs !.forEach(fn => fn());\n this.destroyCbs = null;\n }\n onDestroy(callback: () => void): void {\n ngDevMode && assertDefined(this.destroyCbs, 'NgModule already destroyed');\n this.destroyCbs !.push(callback);\n }\n}\n\nexport class NgModuleFactory<T> extends viewEngine_NgModuleFactory<T> {\n constructor(public moduleType: Type<T>) { super(); }\n\n create(parentInjector: Injector|null): viewEngine_NgModuleRef<T> {\n return new NgModuleRef(this.moduleType, parentInjector);\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {assertReservedSlotInitialized, bindingUpdated, bindingUpdated2, bindingUpdated4, checkAndUpdateBinding, consumeBinding, getCreationMode, moveBindingIndexToReservedSlot, restoreBindingIndex} from './instructions';\n\n\n\n/**\n * If the value hasn't been saved, calls the pure function to store and return the\n * value. If it has been saved, returns the saved value.\n *\n * @param pureFn Function that returns a value\n * @param slotOffset the offset in the reserved slot space {@link reserveSlots}\n * @param thisArg Optional calling context of pureFn\n * @returns value\n */\nexport function pureFunction0<T>(slotOffset: number, pureFn: () => T, thisArg?: any): T {\n ngDevMode && assertReservedSlotInitialized(slotOffset, 1);\n const index = moveBindingIndexToReservedSlot(slotOffset);\n const value = getCreationMode() ?\n checkAndUpdateBinding(thisArg ? pureFn.call(thisArg) : pureFn()) :\n consumeBinding();\n restoreBindingIndex(index);\n return value;\n}\n\n/**\n * If the value of the provided exp has changed, calls the pure function to return\n * an updated value. Or if the value has not changed, returns cached value.\n *\n * @param slotOffset the offset in the reserved slot space {@link reserveSlots}\n * @param pureFn Function that returns an updated value\n * @param exp Updated expression value\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n */\nexport function pureFunction1(\n slotOffset: number, pureFn: (v: any) => any, exp: any, thisArg?: any): any {\n ngDevMode && assertReservedSlotInitialized(slotOffset, 2);\n const index = moveBindingIndexToReservedSlot(slotOffset);\n const value = bindingUpdated(exp) ?\n checkAndUpdateBinding(thisArg ? pureFn.call(thisArg, exp) : pureFn(exp)) :\n consumeBinding();\n restoreBindingIndex(index);\n return value;\n}\n\n/**\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param slotOffset the offset in the reserved slot space {@link reserveSlots}\n * @param pureFn\n * @param exp1\n * @param exp2\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n */\nexport function pureFunction2(\n slotOffset: number, pureFn: (v1: any, v2: any) => any, exp1: any, exp2: any,\n thisArg?: any): any {\n ngDevMode && assertReservedSlotInitialized(slotOffset, 3);\n const index = moveBindingIndexToReservedSlot(slotOffset);\n const value = bindingUpdated2(exp1, exp2) ?\n checkAndUpdateBinding(thisArg ? pureFn.call(thisArg, exp1, exp2) : pureFn(exp1, exp2)) :\n consumeBinding();\n restoreBindingIndex(index);\n return value;\n}\n\n/**\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param slotOffset the offset in the reserved slot space {@link reserveSlots}\n * @param pureFn\n * @param exp1\n * @param exp2\n * @param exp3\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n */\nexport function pureFunction3(\n slotOffset: number, pureFn: (v1: any, v2: any, v3: any) => any, exp1: any, exp2: any, exp3: any,\n thisArg?: any): any {\n ngDevMode && assertReservedSlotInitialized(slotOffset, 4);\n const index = moveBindingIndexToReservedSlot(slotOffset);\n const different = bindingUpdated2(exp1, exp2);\n const value = bindingUpdated(exp3) || different ?\n checkAndUpdateBinding(\n thisArg ? pureFn.call(thisArg, exp1, exp2, exp3) : pureFn(exp1, exp2, exp3)) :\n consumeBinding();\n restoreBindingIndex(index);\n return value;\n}\n\n/**\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param slotOffset the offset in the reserved slot space {@link reserveSlots}\n * @param pureFn\n * @param exp1\n * @param exp2\n * @param exp3\n * @param exp4\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n */\nexport function pureFunction4(\n slotOffset: number, pureFn: (v1: any, v2: any, v3: any, v4: any) => any, exp1: any, exp2: any,\n exp3: any, exp4: any, thisArg?: any): any {\n ngDevMode && assertReservedSlotInitialized(slotOffset, 5);\n const index = moveBindingIndexToReservedSlot(slotOffset);\n const value = bindingUpdated4(exp1, exp2, exp3, exp4) ?\n checkAndUpdateBinding(\n thisArg ? pureFn.call(thisArg, exp1, exp2, exp3, exp4) : pureFn(exp1, exp2, exp3, exp4)) :\n consumeBinding();\n restoreBindingIndex(index);\n return value;\n}\n\n/**\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param slotOffset the offset in the reserved slot space {@link reserveSlots}\n * @param pureFn\n * @param exp1\n * @param exp2\n * @param exp3\n * @param exp4\n * @param exp5\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n */\nexport function pureFunction5(\n slotOffset: number, pureFn: (v1: any, v2: any, v3: any, v4: any, v5: any) => any, exp1: any,\n exp2: any, exp3: any, exp4: any, exp5: any, thisArg?: any): any {\n ngDevMode && assertReservedSlotInitialized(slotOffset, 6);\n const index = moveBindingIndexToReservedSlot(slotOffset);\n const different = bindingUpdated4(exp1, exp2, exp3, exp4);\n const value = bindingUpdated(exp5) || different ?\n checkAndUpdateBinding(\n thisArg ? pureFn.call(thisArg, exp1, exp2, exp3, exp4, exp5) :\n pureFn(exp1, exp2, exp3, exp4, exp5)) :\n consumeBinding();\n restoreBindingIndex(index);\n return value;\n}\n\n/**\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param slotOffset the offset in the reserved slot space {@link reserveSlots}\n * @param pureFn\n * @param exp1\n * @param exp2\n * @param exp3\n * @param exp4\n * @param exp5\n * @param exp6\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n */\nexport function pureFunction6(\n slotOffset: number, pureFn: (v1: any, v2: any, v3: any, v4: any, v5: any, v6: any) => any,\n exp1: any, exp2: any, exp3: any, exp4: any, exp5: any, exp6: any, thisArg?: any): any {\n ngDevMode && assertReservedSlotInitialized(slotOffset, 7);\n const index = moveBindingIndexToReservedSlot(slotOffset);\n const different = bindingUpdated4(exp1, exp2, exp3, exp4);\n const value = bindingUpdated2(exp5, exp6) || different ?\n checkAndUpdateBinding(\n thisArg ? pureFn.call(thisArg, exp1, exp2, exp3, exp4, exp5, exp6) :\n pureFn(exp1, exp2, exp3, exp4, exp5, exp6)) :\n consumeBinding();\n restoreBindingIndex(index);\n return value;\n}\n\n/**\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param slotOffset the offset in the reserved slot space {@link reserveSlots}\n * @param pureFn\n * @param exp1\n * @param exp2\n * @param exp3\n * @param exp4\n * @param exp5\n * @param exp6\n * @param exp7\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n */\nexport function pureFunction7(\n slotOffset: number,\n pureFn: (v1: any, v2: any, v3: any, v4: any, v5: any, v6: any, v7: any) => any, exp1: any,\n exp2: any, exp3: any, exp4: any, exp5: any, exp6: any, exp7: any, thisArg?: any): any {\n ngDevMode && assertReservedSlotInitialized(slotOffset, 8);\n const index = moveBindingIndexToReservedSlot(slotOffset);\n let different = bindingUpdated4(exp1, exp2, exp3, exp4);\n different = bindingUpdated2(exp5, exp6) || different;\n const value = bindingUpdated(exp7) || different ?\n checkAndUpdateBinding(\n thisArg ? pureFn.call(thisArg, exp1, exp2, exp3, exp4, exp5, exp6, exp7) :\n pureFn(exp1, exp2, exp3, exp4, exp5, exp6, exp7)) :\n consumeBinding();\n restoreBindingIndex(index);\n return value;\n}\n\n/**\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param slotOffset the offset in the reserved slot space {@link reserveSlots}\n * @param pureFn\n * @param exp1\n * @param exp2\n * @param exp3\n * @param exp4\n * @param exp5\n * @param exp6\n * @param exp7\n * @param exp8\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n */\nexport function pureFunction8(\n slotOffset: number,\n pureFn: (v1: any, v2: any, v3: any, v4: any, v5: any, v6: any, v7: any, v8: any) => any,\n exp1: any, exp2: any, exp3: any, exp4: any, exp5: any, exp6: any, exp7: any, exp8: any,\n thisArg?: any): any {\n ngDevMode && assertReservedSlotInitialized(slotOffset, 9);\n const index = moveBindingIndexToReservedSlot(slotOffset);\n const different = bindingUpdated4(exp1, exp2, exp3, exp4);\n const value = bindingUpdated4(exp5, exp6, exp7, exp8) || different ?\n checkAndUpdateBinding(\n thisArg ? pureFn.call(thisArg, exp1, exp2, exp3, exp4, exp5, exp6, exp7, exp8) :\n pureFn(exp1, exp2, exp3, exp4, exp5, exp6, exp7, exp8)) :\n consumeBinding();\n restoreBindingIndex(index);\n return value;\n}\n\n/**\n * pureFunction instruction that can support any number of bindings.\n *\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param slotOffset the offset in the reserved slot space {@link reserveSlots}\n * @param pureFn A pure function that takes binding values and builds an object or array\n * containing those values.\n * @param exps An array of binding values\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n */\nexport function pureFunctionV(\n slotOffset: number, pureFn: (...v: any[]) => any, exps: any[], thisArg?: any): any {\n ngDevMode && assertReservedSlotInitialized(slotOffset, exps.length + 1);\n const index = moveBindingIndexToReservedSlot(slotOffset);\n\n let different = false;\n for (let i = 0; i < exps.length; i++) {\n bindingUpdated(exps[i]) && (different = true);\n }\n const value = different ? checkAndUpdateBinding(pureFn.apply(thisArg, exps)) : consumeBinding();\n restoreBindingIndex(index);\n return value;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {PipeTransform} from '../change_detection/pipe_transform';\n\nimport {getTView, load, store} from './instructions';\nimport {PipeDefInternal, PipeDefList} from './interfaces/definition';\nimport {HEADER_OFFSET} from './interfaces/view';\nimport {pureFunction1, pureFunction2, pureFunction3, pureFunction4, pureFunctionV} from './pure_function';\n\n/**\n * Create a pipe.\n *\n * @param index Pipe index where the pipe will be stored.\n * @param pipeName The name of the pipe\n * @returns T the instance of the pipe.\n */\nexport function pipe(index: number, pipeName: string): any {\n const tView = getTView();\n let pipeDef: PipeDefInternal<any>;\n const adjustedIndex = index + HEADER_OFFSET;\n\n if (tView.firstTemplatePass) {\n pipeDef = getPipeDef(pipeName, tView.pipeRegistry);\n tView.data[adjustedIndex] = pipeDef;\n if (pipeDef.onDestroy) {\n (tView.pipeDestroyHooks || (tView.pipeDestroyHooks = [\n ])).push(adjustedIndex, pipeDef.onDestroy);\n }\n } else {\n pipeDef = tView.data[adjustedIndex] as PipeDefInternal<any>;\n }\n\n const pipeInstance = pipeDef.factory();\n store(index, pipeInstance);\n return pipeInstance;\n}\n\n/**\n * Searches the pipe registry for a pipe with the given name. If one is found,\n * returns the pipe. Otherwise, an error is thrown because the pipe cannot be resolved.\n *\n * @param name Name of pipe to resolve\n * @param registry Full list of available pipes\n * @returns Matching PipeDef\n */\nfunction getPipeDef(name: string, registry: PipeDefList | null): PipeDefInternal<any> {\n if (registry) {\n for (let i = 0; i < registry.length; i++) {\n const pipeDef = registry[i];\n if (name === pipeDef.name) {\n return pipeDef;\n }\n }\n }\n throw new Error(`Pipe with name '${name}' not found!`);\n}\n\n/**\n * Invokes a pipe with 1 arguments.\n *\n * This instruction acts as a guard to {@link PipeTransform#transform} invoking\n * the pipe only when an input to the pipe changes.\n *\n * @param index Pipe index where the pipe was stored on creation.\n * @param slotOffset the offset in the reserved slot space {@link reserveSlots}\n * @param v1 1st argument to {@link PipeTransform#transform}.\n */\nexport function pipeBind1(index: number, slotOffset: number, v1: any): any {\n const pipeInstance = load<PipeTransform>(index);\n return isPure(index) ? pureFunction1(slotOffset, pipeInstance.transform, v1, pipeInstance) :\n pipeInstance.transform(v1);\n}\n\n/**\n * Invokes a pipe with 2 arguments.\n *\n * This instruction acts as a guard to {@link PipeTransform#transform} invoking\n * the pipe only when an input to the pipe changes.\n *\n * @param index Pipe index where the pipe was stored on creation.\n * @param slotOffset the offset in the reserved slot space {@link reserveSlots}\n * @param v1 1st argument to {@link PipeTransform#transform}.\n * @param v2 2nd argument to {@link PipeTransform#transform}.\n */\nexport function pipeBind2(index: number, slotOffset: number, v1: any, v2: any): any {\n const pipeInstance = load<PipeTransform>(index);\n return isPure(index) ? pureFunction2(slotOffset, pipeInstance.transform, v1, v2, pipeInstance) :\n pipeInstance.transform(v1, v2);\n}\n\n/**\n * Invokes a pipe with 3 arguments.\n *\n * This instruction acts as a guard to {@link PipeTransform#transform} invoking\n * the pipe only when an input to the pipe changes.\n *\n * @param index Pipe index where the pipe was stored on creation.\n * @param slotOffset the offset in the reserved slot space {@link reserveSlots}\n * @param v1 1st argument to {@link PipeTransform#transform}.\n * @param v2 2nd argument to {@link PipeTransform#transform}.\n * @param v3 4rd argument to {@link PipeTransform#transform}.\n */\nexport function pipeBind3(index: number, slotOffset: number, v1: any, v2: any, v3: any): any {\n const pipeInstance = load<PipeTransform>(index);\n return isPure(index) ?\n pureFunction3(slotOffset, pipeInstance.transform, v1, v2, v3, pipeInstance) :\n pipeInstance.transform(v1, v2, v3);\n}\n\n/**\n * Invokes a pipe with 4 arguments.\n *\n * This instruction acts as a guard to {@link PipeTransform#transform} invoking\n * the pipe only when an input to the pipe changes.\n *\n * @param index Pipe index where the pipe was stored on creation.\n * @param slotOffset the offset in the reserved slot space {@link reserveSlots}\n * @param v1 1st argument to {@link PipeTransform#transform}.\n * @param v2 2nd argument to {@link PipeTransform#transform}.\n * @param v3 3rd argument to {@link PipeTransform#transform}.\n * @param v4 4th argument to {@link PipeTransform#transform}.\n */\nexport function pipeBind4(\n index: number, slotOffset: number, v1: any, v2: any, v3: any, v4: any): any {\n const pipeInstance = load<PipeTransform>(index);\n return isPure(index) ?\n pureFunction4(slotOffset, pipeInstance.transform, v1, v2, v3, v4, pipeInstance) :\n pipeInstance.transform(v1, v2, v3, v4);\n}\n\n/**\n * Invokes a pipe with variable number of arguments.\n *\n * This instruction acts as a guard to {@link PipeTransform#transform} invoking\n * the pipe only when an input to the pipe changes.\n *\n * @param index Pipe index where the pipe was stored on creation.\n * @param slotOffset the offset in the reserved slot space {@link reserveSlots}\n * @param values Array of arguments to pass to {@link PipeTransform#transform} method.\n */\nexport function pipeBindV(index: number, slotOffset: number, values: any[]): any {\n const pipeInstance = load<PipeTransform>(index);\n return isPure(index) ? pureFunctionV(slotOffset, pipeInstance.transform, values, pipeInstance) :\n pipeInstance.transform.apply(pipeInstance, values);\n}\n\nfunction isPure(index: number): boolean {\n return (<PipeDefInternal<any>>getTView().data[index + HEADER_OFFSET]).pure;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Provider} from '../../core';\nimport {RendererType2} from '../../render/api';\nimport {Type} from '../../type';\nimport {CssSelectorList} from './projection';\n\n/**\n * Definition of what a template rendering function should look like.\n */\nexport type ComponentTemplate<T> = {\n (rf: RenderFlags, ctx: T): void; ngPrivateData?: never;\n};\n\n/**\n * Definition of what a query function should look like.\n */\nexport type ComponentQuery<T> = ComponentTemplate<T>;\n\n/**\n * Flags passed into template functions to determine which blocks (i.e. creation, update)\n * should be executed.\n *\n * Typically, a template runs both the creation block and the update block on initialization and\n * subsequent runs only execute the update block. However, dynamically created views require that\n * the creation block be executed separately from the update block (for backwards compat).\n */\nexport const enum RenderFlags {\n /* Whether to run the creation block (e.g. create elements and directives) */\n Create = 0b01,\n\n /* Whether to run the update block (e.g. refresh bindings) */\n Update = 0b10\n}\n\n/**\n * A subclass of `Type` which has a static `ngComponentDef`:`ComponentDef` field making it\n * consumable for rendering.\n */\nexport interface ComponentType<T> extends Type<T> { ngComponentDef: never; }\n\n/**\n * A subclass of `Type` which has a static `ngDirectiveDef`:`DirectiveDef` field making it\n * consumable for rendering.\n */\nexport interface DirectiveType<T> extends Type<T> { ngDirectiveDef: never; }\n\nexport const enum DirectiveDefFlags {ContentQuery = 0b10}\n\n/**\n * A subclass of `Type` which has a static `ngPipeDef`:`PipeDef` field making it\n * consumable for rendering.\n */\nexport interface PipeType<T> extends Type<T> { ngPipeDef: never; }\n\n/**\n * A version of {@link DirectiveDef} that represents the runtime type shape only, and excludes\n * metadata parameters.\n */\nexport type DirectiveDefInternal<T> = DirectiveDef<T, string>;\n\n/**\n * Runtime link information for Directives.\n *\n * This is internal data structure used by the render to link\n * directives into templates.\n *\n * NOTE: Always use `defineDirective` function to create this object,\n * never create the object directly since the shape of this object\n * can change between versions.\n *\n * @param Selector type metadata specifying the selector of the directive or component\n *\n * See: {@link defineDirective}\n */\nexport interface DirectiveDef<T, Selector extends string> {\n /** Token representing the directive. Used by DI. */\n type: Type<T>;\n\n /** Function that makes a directive public to the DI system. */\n diPublic: ((def: DirectiveDef<T, string>) => void)|null;\n\n /** The selectors that will be used to match nodes to this directive. */\n selectors: CssSelectorList;\n\n /**\n * A dictionary mapping the inputs' minified property names to their public API names, which\n * are their aliases if any, or their original unminified property names\n * (as in `@Input('alias') propertyName: any;`).\n */\n readonly inputs: {[P in keyof T]: string};\n\n /**\n * @deprecated This is only here because `NgOnChanges` incorrectly uses declared name instead of\n * public or minified name.\n */\n readonly declaredInputs: {[P in keyof T]: P};\n\n /**\n * A dictionary mapping the outputs' minified property names to their public API names, which\n * are their aliases if any, or their original unminified property names\n * (as in `@Output('alias') propertyName: any;`).\n */\n readonly outputs: {[P in keyof T]: P};\n\n /**\n * Name under which the directive is exported (for use with local references in template)\n */\n readonly exportAs: string|null;\n\n /**\n * Factory function used to create a new directive instance.\n *\n * Usually returns the directive instance, but if the directive has a content query,\n * it instead returns an array that contains the instance as well as content query data.\n */\n factory(): T|[T];\n\n /**\n * Function to create instances of content queries associated with a given directive.\n */\n contentQueries: (() => void)|null;\n\n /** Refreshes content queries associated with directives in a given view */\n contentQueriesRefresh: ((directiveIndex: number, queryIndex: number) => void)|null;\n\n /** Refreshes host bindings on the associated directive. */\n hostBindings: ((directiveIndex: number, elementIndex: number) => void)|null;\n\n /**\n * Static attributes to set on host element.\n *\n * Even indices: attribute name\n * Odd indices: attribute value\n */\n attributes: string[]|null;\n\n /* The following are lifecycle hooks for this component */\n onInit: (() => void)|null;\n doCheck: (() => void)|null;\n afterContentInit: (() => void)|null;\n afterContentChecked: (() => void)|null;\n afterViewInit: (() => void)|null;\n afterViewChecked: (() => void)|null;\n onDestroy: (() => void)|null;\n\n /**\n * The features applied to this directive\n */\n features: DirectiveDefFeature[]|null;\n}\n\n/**\n * A version of {@link ComponentDef} that represents the runtime type shape only, and excludes\n * metadata parameters.\n */\nexport type ComponentDefInternal<T> = ComponentDef<T, string>;\n\n/**\n * Runtime link information for Components.\n *\n * This is internal data structure used by the render to link\n * components into templates.\n *\n * NOTE: Always use `defineComponent` function to create this object,\n * never create the object directly since the shape of this object\n * can change between versions.\n *\n * See: {@link defineComponent}\n */\nexport interface ComponentDef<T, Selector extends string> extends DirectiveDef<T, Selector> {\n /**\n * The View template of the component.\n */\n readonly template: ComponentTemplate<T>;\n\n /**\n * Query-related instructions for a component.\n */\n readonly viewQuery: ComponentQuery<T>|null;\n\n /**\n * Renderer type data of the component.\n */\n readonly rendererType: RendererType2|null;\n\n /** Whether or not this component's ChangeDetectionStrategy is OnPush */\n readonly onPush: boolean;\n\n /**\n * Defines the set of injectable providers that are visible to a Directive and its content DOM\n * children.\n */\n readonly providers?: Provider[];\n\n /**\n * Defines the set of injectable providers that are visible to a Directive and its view DOM\n * children only.\n */\n readonly viewProviders?: Provider[];\n\n /**\n * Registry of directives and components that may be found in this view.\n *\n * The property is either an array of `DirectiveDef`s or a function which returns the array of\n * `DirectiveDef`s. The function is necessary to be able to support forward declarations.\n */\n directiveDefs: DirectiveDefListOrFactory|null;\n\n /**\n * Registry of pipes that may be found in this view.\n *\n * The property is either an array of `PipeDefs`s or a function which returns the array of\n * `PipeDefs`s. The function is necessary to be able to support forward declarations.\n */\n pipeDefs: PipeDefListOrFactory|null;\n}\n\n/**\n * Runtime link information for Pipes.\n *\n * This is internal data structure used by the renderer to link\n * pipes into templates.\n *\n * NOTE: Always use `definePipe` function to create this object,\n * never create the object directly since the shape of this object\n * can change between versions.\n *\n * See: {@link definePipe}\n */\nexport interface PipeDef<T, S extends string> {\n /**\n * Pipe name.\n *\n * Used to resolve pipe in templates.\n */\n name: S;\n\n /**\n * Factory function used to create a new pipe instance.\n */\n factory: () => T;\n\n /**\n * Whether or not the pipe is pure.\n *\n * Pure pipes result only depends on the pipe input and not on internal\n * state of the pipe.\n */\n pure: boolean;\n\n /* The following are lifecycle hooks for this pipe */\n onDestroy: (() => void)|null;\n}\n\nexport type PipeDefInternal<T> = PipeDef<T, string>;\n\nexport type DirectiveDefFeature = <T>(directiveDef: DirectiveDef<T, string>) => void;\nexport type ComponentDefFeature = <T>(componentDef: ComponentDef<T, string>) => void;\n\n/**\n * Type used for directiveDefs on component definition.\n *\n * The function is necessary to be able to support forward declarations.\n */\nexport type DirectiveDefListOrFactory = (() => DirectiveDefList) | DirectiveDefList;\n\nexport type DirectiveDefList = (DirectiveDef<any, string>| ComponentDef<any, string>)[];\n\nexport type DirectiveTypesOrFactory = (() => DirectiveTypeList) | DirectiveTypeList;\n\nexport type DirectiveTypeList =\n (DirectiveDef<any, string>| ComponentDef<any, string>|\n Type<any>/* Type as workaround for: Microsoft/TypeScript/issues/4881 */)[];\n\n/**\n * Type used for PipeDefs on component definition.\n *\n * The function is necessary to be able to support forward declarations.\n */\nexport type PipeDefListOrFactory = (() => PipeDefList) | PipeDefList;\n\nexport type PipeDefList = PipeDefInternal<any>[];\n\nexport type PipeTypesOrFactory = (() => DirectiveTypeList) | DirectiveTypeList;\n\nexport type PipeTypeList =\n (PipeDefInternal<any>|\n Type<any>/* Type as workaround for: Microsoft/TypeScript/issues/4881 */)[];\n\n\n// Note: This hack is necessary so we don't erroneously get a circular dependency\n// failure based on types.\nexport const unusedValueExportToPlacateAjd = 1;\n\nexport const enum InitialStylingFlags {\n VALUES_MODE = 0b1,\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ChangeDetectorRef} from '../../change_detection/change_detector_ref';\nimport {ElementRef} from '../../linker/element_ref';\nimport {TemplateRef} from '../../linker/template_ref';\nimport {ViewContainerRef} from '../../linker/view_container_ref';\n\nimport {LContainerNode, LElementNode} from './node';\n\nexport interface LInjector {\n /**\n * We need to store a reference to the injector's parent so DI can keep looking up\n * the injector tree until it finds the dependency it's looking for.\n */\n readonly parent: LInjector|null;\n\n /**\n * Allows access to the directives array in that node's static data and to\n * the node's flags (for starting directive index and directive size). Necessary\n * for DI to retrieve a directive from the data array if injector indicates\n * it is there.\n */\n readonly node: LElementNode|LContainerNode;\n\n /**\n * The following bloom filter determines whether a directive is available\n * on the associated node or not. This prevents us from searching the directives\n * array at this level unless it's probable the directive is in it.\n *\n * - bf0: Check directive IDs 0-31 (IDs are % 128)\n * - bf1: Check directive IDs 32-63\n * - bf2: Check directive IDs 64-95\n * - bf3: Check directive IDs 96-127\n * - bf4: Check directive IDs 128-159\n * - bf5: Check directive IDs 160 - 191\n * - bf6: Check directive IDs 192 - 223\n * - bf7: Check directive IDs 224 - 255\n *\n * See: https://en.wikipedia.org/wiki/Bloom_filter for more about bloom filters.\n */\n bf0: number;\n bf1: number;\n bf2: number;\n bf3: number;\n bf4: number;\n bf5: number;\n bf6: number;\n bf7: number;\n\n /**\n * cbf0 - cbf7 properties determine whether a directive is available through a\n * parent injector. They refer to the merged values of parent bloom filters. This\n * allows us to skip looking up the chain unless it's probable that directive exists\n * up the chain.\n */\n cbf0: number;\n cbf1: number;\n cbf2: number;\n cbf3: number;\n cbf4: number;\n cbf5: number;\n cbf6: number;\n cbf7: number;\n\n /** Stores the TemplateRef so subsequent injections of the TemplateRef get the same instance. */\n templateRef: TemplateRef<any>|null;\n\n /** Stores the ViewContainerRef so subsequent injections of the ViewContainerRef get the same\n * instance. */\n viewContainerRef: ViewContainerRef|null;\n\n /** Stores the ElementRef so subsequent injections of the ElementRef get the same instance. */\n elementRef: ElementRef|null;\n\n /**\n * Stores the ChangeDetectorRef so subsequent injections of the ChangeDetectorRef get the\n * same instance.\n */\n changeDetectorRef: ChangeDetectorRef|null;\n}\n\n// Note: This hack is necessary so we don't erroneously get a circular dependency\n// failure based on types.\nexport const unusedValueExportToPlacateAjd = 1;\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {QueryList} from '../../linker';\nimport {Type} from '../../type';\nimport {LNode} from './node';\n\n/** Used for tracking queries (e.g. ViewChild, ContentChild). */\nexport interface LQueries {\n /**\n * Ask queries to prepare copy of itself. This assures that tracking new queries on child nodes\n * doesn't mutate list of queries tracked on a parent node. We will clone LQueries before\n * constructing content queries.\n */\n clone(): LQueries|null;\n\n /**\n * Used to ask queries if those should be cloned to the child element.\n *\n * For example in the case of deep queries the `child()` returns\n * queries for the child node. In case of shallow queries it returns\n * `null`.\n */\n child(): LQueries|null;\n\n /**\n * Notify `LQueries` that a new `LNode` has been created and needs to be added to query results\n * if matching query predicate.\n */\n addNode(node: LNode): void;\n\n /**\n * Notify `LQueries` that a new LContainer was added to ivy data structures. As a result we need\n * to prepare room for views that might be inserted into this container.\n */\n container(): LQueries|null;\n\n /**\n * Notify `LQueries` that a new `LView` has been created. As a result we need to prepare room\n * and collect nodes that match query predicate.\n */\n createView(): LQueries|null;\n\n /**\n * Notify `LQueries` that a new `LView` has been added to `LContainer`. As a result all\n * the matching nodes from this view should be added to container's queries.\n */\n insertView(newViewIndex: number): void;\n\n /**\n * Notify `LQueries` that an `LView` has been removed from `LContainer`. As a result all\n * the matching nodes from this view should be removed from container's queries.\n */\n removeView(): void;\n\n /**\n * Add additional `QueryList` to track.\n *\n * @param queryList `QueryList` to update with changes.\n * @param predicate Either `Type` or selector array of [key, value] predicates.\n * @param descend If true the query will recursively apply to the children.\n * @param read Indicates which token should be read from DI for this query.\n */\n track<T>(\n queryList: QueryList<T>, predicate: Type<any>|string[], descend?: boolean,\n read?: QueryReadType<T>|Type<T>): void;\n}\n\nexport class QueryReadType<T> { private defeatStructuralTyping: any; }\n\n// Note: This hack is necessary so we don't erroneously get a circular dependency\n// failure based on types.\nexport const unusedValueExportToPlacateAjd = 1;\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n// We are temporarily importing the existing viewEngine_from core so we can be sure we are\n// correctly implementing its interfaces for backwards compatibility.\nimport {Observable} from 'rxjs';\n\nimport {EventEmitter} from '../event_emitter';\nimport {QueryList as viewEngine_QueryList} from '../linker/query_list';\nimport {Type} from '../type';\nimport {getSymbolIterator} from '../util';\n\nimport {assertDefined, assertEqual} from './assert';\nimport {ReadFromInjectorFn, getOrCreateNodeInjectorForNode} from './di';\nimport {assertPreviousIsParent, getCurrentQueries, store, storeCleanupWithContext} from './instructions';\nimport {DirectiveDefInternal, unusedValueExportToPlacateAjd as unused1} from './interfaces/definition';\nimport {LInjector, unusedValueExportToPlacateAjd as unused2} from './interfaces/injector';\nimport {LContainerNode, LElementNode, LNode, TNode, TNodeFlags, unusedValueExportToPlacateAjd as unused3} from './interfaces/node';\nimport {LQueries, QueryReadType, unusedValueExportToPlacateAjd as unused4} from './interfaces/query';\nimport {DIRECTIVES, TVIEW} from './interfaces/view';\nimport {flatten} from './util';\n\nconst unusedValueToPlacateAjd = unused1 + unused2 + unused3 + unused4;\n\n/**\n * A predicate which determines if a given element/directive should be included in the query\n * results.\n */\nexport interface QueryPredicate<T> {\n /**\n * If looking for directives then it contains the directive type.\n */\n type: Type<T>|null;\n\n /**\n * If selector then contains local names to query for.\n */\n selector: string[]|null;\n\n /**\n * Indicates which token should be read from DI for this query.\n */\n read: QueryReadType<T>|Type<T>|null;\n}\n\n/**\n * An object representing a query, which is a combination of:\n * - query predicate to determines if a given element/directive should be included in the query\n * - values collected based on a predicate\n * - `QueryList` to which collected values should be reported\n */\nexport interface LQuery<T> {\n /**\n * Next query. Used when queries are stored as a linked list in `LQueries`.\n */\n next: LQuery<any>|null;\n\n /**\n * Destination to which the value should be added.\n */\n list: QueryList<T>;\n\n /**\n * A predicate which determines if a given element/directive should be included in the query\n * results.\n */\n predicate: QueryPredicate<T>;\n\n /**\n * Values which have been located.\n *\n * This is what builds up the `QueryList._valuesTree`.\n */\n values: any[];\n\n /**\n * A pointer to an array that stores collected values from views. This is necessary so we know a\n * container into which to insert nodes collected from views.\n */\n containerValues: any[]|null;\n}\n\nexport class LQueries_ implements LQueries {\n shallow: LQuery<any>|null = null;\n deep: LQuery<any>|null = null;\n\n constructor(deep?: LQuery<any>) { this.deep = deep == null ? null : deep; }\n\n track<T>(\n queryList: viewEngine_QueryList<T>, predicate: Type<T>|string[], descend?: boolean,\n read?: QueryReadType<T>|Type<T>): void {\n if (descend) {\n this.deep = createQuery(this.deep, queryList, predicate, read != null ? read : null);\n } else {\n this.shallow = createQuery(this.shallow, queryList, predicate, read != null ? read : null);\n }\n }\n\n clone(): LQueries|null { return this.deep ? new LQueries_(this.deep) : null; }\n\n child(): LQueries|null {\n if (this.deep === null) {\n // if we don't have any deep queries then no need to track anything more.\n return null;\n }\n if (this.shallow === null) {\n // DeepQuery: We can reuse the current state if the child state would be same as current\n // state.\n return this;\n } else {\n // We need to create new state\n return new LQueries_(this.deep);\n }\n }\n\n container(): LQueries|null {\n let result: LQuery<any>|null = null;\n let query = this.deep;\n\n while (query) {\n const containerValues: any[] = []; // prepare room for views\n query.values.push(containerValues);\n const clonedQuery: LQuery<any> = {\n next: null,\n list: query.list,\n predicate: query.predicate,\n values: containerValues,\n containerValues: null\n };\n clonedQuery.next = result;\n result = clonedQuery;\n query = query.next;\n }\n\n return result ? new LQueries_(result) : null;\n }\n\n createView(): LQueries|null {\n let result: LQuery<any>|null = null;\n let query = this.deep;\n\n while (query) {\n const clonedQuery: LQuery<any> = {\n next: null,\n list: query.list,\n predicate: query.predicate,\n values: [],\n containerValues: query.values\n };\n clonedQuery.next = result;\n result = clonedQuery;\n query = query.next;\n }\n\n return result ? new LQueries_(result) : null;\n }\n\n insertView(index: number): void {\n let query = this.deep;\n while (query) {\n ngDevMode &&\n assertDefined(\n query.containerValues, 'View queries need to have a pointer to container values.');\n query.containerValues !.splice(index, 0, query.values);\n query = query.next;\n }\n }\n\n addNode(node: LNode): void {\n add(this.shallow, node);\n add(this.deep, node);\n }\n\n removeView(): void {\n let query = this.deep;\n while (query) {\n ngDevMode &&\n assertDefined(\n query.containerValues, 'View queries need to have a pointer to container values.');\n\n const containerValues = query.containerValues !;\n const viewValuesIdx = containerValues.indexOf(query.values);\n const removed = containerValues.splice(viewValuesIdx, 1);\n\n // mark a query as dirty only when removed view had matching modes\n ngDevMode && assertEqual(removed.length, 1, 'removed.length');\n if (removed[0].length) {\n query.list.setDirty();\n }\n\n query = query.next;\n }\n }\n}\n\n/**\n * Iterates over local names for a given node and returns directive index\n * (or -1 if a local name points to an element).\n *\n * @param tNode static data of a node to check\n * @param selector selector to match\n * @returns directive index, -1 or null if a selector didn't match any of the local names\n */\nfunction getIdxOfMatchingSelector(tNode: TNode, selector: string): number|null {\n const localNames = tNode.localNames;\n if (localNames) {\n for (let i = 0; i < localNames.length; i += 2) {\n if (localNames[i] === selector) {\n return localNames[i + 1] as number;\n }\n }\n }\n return null;\n}\n\n/**\n * Iterates over all the directives for a node and returns index of a directive for a given type.\n *\n * @param node Node on which directives are present.\n * @param type Type of a directive to look for.\n * @returns Index of a found directive or null when none found.\n */\nfunction getIdxOfMatchingDirective(node: LNode, type: Type<any>): number|null {\n const defs = node.view[TVIEW].directives !;\n const flags = node.tNode.flags;\n const count = flags & TNodeFlags.DirectiveCountMask;\n const start = flags >> TNodeFlags.DirectiveStartingIndexShift;\n const end = start + count;\n for (let i = start; i < end; i++) {\n const def = defs[i] as DirectiveDefInternal<any>;\n if (def.type === type && def.diPublic) {\n return i;\n }\n }\n return null;\n}\n\nfunction readFromNodeInjector(\n nodeInjector: LInjector, node: LNode, read: QueryReadType<any>| Type<any>,\n directiveIdx: number): any {\n if (read instanceof ReadFromInjectorFn) {\n return read.read(nodeInjector, node, directiveIdx);\n } else {\n const matchingIdx = getIdxOfMatchingDirective(node, read as Type<any>);\n if (matchingIdx !== null) {\n return node.view[DIRECTIVES] ![matchingIdx];\n }\n }\n return null;\n}\n\nfunction add(query: LQuery<any>| null, node: LNode) {\n const nodeInjector = getOrCreateNodeInjectorForNode(node as LElementNode | LContainerNode);\n while (query) {\n const predicate = query.predicate;\n const type = predicate.type;\n if (type) {\n const directiveIdx = getIdxOfMatchingDirective(node, type);\n if (directiveIdx !== null) {\n // a node is matching a predicate - determine what to read\n // if read token and / or strategy is not specified, use type as read token\n const result =\n readFromNodeInjector(nodeInjector, node, predicate.read || type, directiveIdx);\n if (result !== null) {\n addMatch(query, result);\n }\n }\n } else {\n const selector = predicate.selector !;\n for (let i = 0; i < selector.length; i++) {\n const directiveIdx = getIdxOfMatchingSelector(node.tNode, selector[i]);\n if (directiveIdx !== null) {\n // a node is matching a predicate - determine what to read\n // note that queries using name selector must specify read strategy\n ngDevMode && assertDefined(predicate.read, 'the node should have a predicate');\n const result = readFromNodeInjector(nodeInjector, node, predicate.read !, directiveIdx);\n if (result !== null) {\n addMatch(query, result);\n }\n }\n }\n }\n query = query.next;\n }\n}\n\nfunction addMatch(query: LQuery<any>, matchingValue: any): void {\n query.values.push(matchingValue);\n query.list.setDirty();\n}\n\nfunction createPredicate<T>(\n predicate: Type<T>| string[], read: QueryReadType<T>| Type<T>| null): QueryPredicate<T> {\n const isArray = Array.isArray(predicate);\n return {\n type: isArray ? null : predicate as Type<T>,\n selector: isArray ? predicate as string[] : null,\n read: read\n };\n}\n\nfunction createQuery<T>(\n previous: LQuery<any>| null, queryList: QueryList<T>, predicate: Type<T>| string[],\n read: QueryReadType<T>| Type<T>| null): LQuery<T> {\n return {\n next: previous,\n list: queryList,\n predicate: createPredicate(predicate, read),\n values: (queryList as any as QueryList_<T>)._valuesTree,\n containerValues: null\n };\n}\n\nclass QueryList_<T>/* implements viewEngine_QueryList<T> */ {\n readonly dirty = true;\n readonly changes: Observable<T> = new EventEmitter();\n private _values: T[] = [];\n /** @internal */\n _valuesTree: any[] = [];\n\n get length(): number { return this._values.length; }\n\n get first(): T|null {\n let values = this._values;\n return values.length ? values[0] : null;\n }\n\n get last(): T|null {\n let values = this._values;\n return values.length ? values[values.length - 1] : null;\n }\n\n /**\n * See\n * [Array.map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)\n */\n map<U>(fn: (item: T, index: number, array: T[]) => U): U[] { return this._values.map(fn); }\n\n /**\n * See\n * [Array.filter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter)\n */\n filter(fn: (item: T, index: number, array: T[]) => boolean): T[] {\n return this._values.filter(fn);\n }\n\n /**\n * See\n * [Array.find](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find)\n */\n find(fn: (item: T, index: number, array: T[]) => boolean): T|undefined {\n return this._values.find(fn);\n }\n\n /**\n * See\n * [Array.reduce](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce)\n */\n reduce<U>(fn: (prevValue: U, curValue: T, curIndex: number, array: T[]) => U, init: U): U {\n return this._values.reduce(fn, init);\n }\n\n /**\n * See\n * [Array.forEach](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach)\n */\n forEach(fn: (item: T, index: number, array: T[]) => void): void { this._values.forEach(fn); }\n\n /**\n * See\n * [Array.some](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some)\n */\n some(fn: (value: T, index: number, array: T[]) => boolean): boolean {\n return this._values.some(fn);\n }\n\n toArray(): T[] { return this._values.slice(0); }\n\n [getSymbolIterator()](): Iterator<T> { return (this._values as any)[getSymbolIterator()](); }\n\n toString(): string { return this._values.toString(); }\n\n reset(res: (any[]|T)[]): void {\n this._values = flatten(res);\n (this as{dirty: boolean}).dirty = false;\n }\n\n notifyOnChanges(): void { (this.changes as EventEmitter<any>).emit(this); }\n setDirty(): void { (this as{dirty: boolean}).dirty = true; }\n destroy(): void {\n (this.changes as EventEmitter<any>).complete();\n (this.changes as EventEmitter<any>).unsubscribe();\n }\n}\n\n// NOTE: this hack is here because IQueryList has private members and therefore\n// it can't be implemented only extended.\nexport type QueryList<T> = viewEngine_QueryList<T>;\nexport const QueryList: typeof viewEngine_QueryList = QueryList_ as any;\n\n/**\n * Creates and returns a QueryList.\n *\n * @param memoryIndex The index in memory where the QueryList should be saved. If null,\n * this is is a content query and the QueryList will be saved later through directiveCreate.\n * @param predicate The type for which the query will search\n * @param descend Whether or not to descend into children\n * @param read What to save in the query\n * @returns QueryList<T>\n */\nexport function query<T>(\n memoryIndex: number | null, predicate: Type<any>| string[], descend?: boolean,\n read?: QueryReadType<T>| Type<T>): QueryList<T> {\n ngDevMode && assertPreviousIsParent();\n const queryList = new QueryList<T>();\n const queries = getCurrentQueries(LQueries_);\n queries.track(queryList, predicate, descend, read);\n storeCleanupWithContext(null, queryList, queryList.destroy);\n if (memoryIndex != null) {\n store(memoryIndex, queryList);\n }\n return queryList;\n}\n\n/**\n * Refreshes a query by combining matches from all active views and removing matches from deleted\n * views.\n * Returns true if a query got dirty during change detection, false otherwise.\n */\nexport function queryRefresh(queryList: QueryList<any>): boolean {\n const queryListImpl = (queryList as any as QueryList_<any>);\n if (queryList.dirty) {\n queryList.reset(queryListImpl._valuesTree);\n queryList.notifyOnChanges();\n return true;\n }\n return false;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {LifecycleHooksFeature, getHostElement, getRenderedText, renderComponent, whenRendered} from './component';\nimport {defineComponent, defineDirective, defineNgModule, definePipe} from './definition';\nimport {InheritDefinitionFeature} from './features/inherit_definition_feature';\nimport {NgOnChangesFeature} from './features/ng_onchanges_feature';\nimport {PublicFeature} from './features/public_feature';\nimport {I18nExpInstruction, I18nInstruction, i18nExpMapping, i18nInterpolation1, i18nInterpolation2, i18nInterpolation3, i18nInterpolation4, i18nInterpolation5, i18nInterpolation6, i18nInterpolation7, i18nInterpolation8, i18nInterpolationV} from './i18n';\nimport {ComponentDef, ComponentDefInternal, ComponentTemplate, ComponentType, DirectiveDef, DirectiveDefFlags, DirectiveDefInternal, DirectiveType, PipeDef} from './interfaces/definition';\n\nexport {ComponentFactory, ComponentFactoryResolver, ComponentRef} from './component_ref';\nexport {QUERY_READ_CONTAINER_REF, QUERY_READ_ELEMENT_REF, QUERY_READ_FROM_NODE, QUERY_READ_TEMPLATE_REF, directiveInject, injectAttribute, injectChangeDetectorRef, injectComponentFactoryResolver, injectElementRef, injectTemplateRef, injectViewContainerRef} from './di';\nexport {RenderFlags} from './interfaces/definition';\nexport {CssSelectorList} from './interfaces/projection';\n\n\n\n// Naming scheme:\n// - Capital letters are for creating things: T(Text), E(Element), D(Directive), V(View),\n// C(Container), L(Listener)\n// - lower case letters are for binding: b(bind)\n// - lower case letters are for binding target: p(property), a(attribute), k(class), s(style),\n// i(input)\n// - lower case letters for guarding life cycle hooks: l(lifeCycle)\n// - lower case for closing: c(containerEnd), e(elementEnd), v(viewEnd)\n// clang-format off\nexport {\n\n NO_CHANGE as NC,\n\n bind as b,\n interpolation1 as i1,\n interpolation2 as i2,\n interpolation3 as i3,\n interpolation4 as i4,\n interpolation5 as i5,\n interpolation6 as i6,\n interpolation7 as i7,\n interpolation8 as i8,\n interpolationV as iV,\n\n container as C,\n containerRefreshStart as cR,\n containerRefreshEnd as cr,\n\n element as Ee,\n elementAttribute as a,\n elementClassProp as cp,\n elementEnd as e,\n elementProperty as p,\n elementStart as E,\n\n elementStyling as s,\n elementStylingMap as sm,\n elementStyleProp as sp,\n elementStylingApply as sa,\n\n listener as L,\n store as st,\n load as ld,\n loadDirective as d,\n\n namespaceHTML as NH,\n namespaceMathML as NM,\n namespaceSVG as NS,\n\n projection as P,\n projectionDef as pD,\n\n text as T,\n textBinding as t,\n\n reserveSlots as rS,\n\n embeddedViewStart as V,\n embeddedViewEnd as v,\n detectChanges,\n markDirty,\n tick,\n} from './instructions';\n\nexport {\n i18nApply as iA,\n i18nMapping as iM,\n i18nInterpolation1 as iI1,\n i18nInterpolation2 as iI2,\n i18nInterpolation3 as iI3,\n i18nInterpolation4 as iI4,\n i18nInterpolation5 as iI5,\n i18nInterpolation6 as iI6,\n i18nInterpolation7 as iI7,\n i18nInterpolation8 as iI8,\n i18nInterpolationV as iIV,\n i18nExpMapping as iEM,\n I18nInstruction,\n I18nExpInstruction\n} from './i18n';\n\nexport {NgModuleFactory, NgModuleRef, NgModuleType} from './ng_module_ref';\n\nexport {\n AttributeMarker\n} from './interfaces/node';\n\nexport {\n pipe as Pp,\n pipeBind1 as pb1,\n pipeBind2 as pb2,\n pipeBind3 as pb3,\n pipeBind4 as pb4,\n pipeBindV as pbV,\n} from './pipe';\n\nexport {\n QueryList,\n query as Q,\n queryRefresh as qR,\n} from './query';\nexport {\n registerContentQuery as Qr,\n loadQueryList as ql,\n} from './instructions';\n\nexport {\n pureFunction0 as f0,\n pureFunction1 as f1,\n pureFunction2 as f2,\n pureFunction3 as f3,\n pureFunction4 as f4,\n pureFunction5 as f5,\n pureFunction6 as f6,\n pureFunction7 as f7,\n pureFunction8 as f8,\n pureFunctionV as fV,\n} from './pure_function';\n\n\n// clang-format on\n\nexport {\n ComponentDef,\n ComponentDefInternal,\n ComponentTemplate,\n ComponentType,\n DirectiveDef,\n DirectiveDefFlags,\n DirectiveDefInternal,\n DirectiveType,\n NgOnChangesFeature,\n InheritDefinitionFeature,\n PublicFeature,\n PipeDef,\n LifecycleHooksFeature,\n defineComponent,\n defineDirective,\n defineNgModule,\n definePipe,\n getHostElement,\n getRenderedText,\n renderComponent,\n whenRendered,\n};\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nconst BRAND = '__SANITIZER_TRUSTED_BRAND__';\n\nexport const enum BypassType {\n Url = 'Url',\n Html = 'Html',\n ResourceUrl = 'ResourceUrl',\n Script = 'Script',\n Style = 'Style',\n}\n\n/**\n * A branded trusted string used with sanitization.\n *\n * See: {@link TrustedHtmlString}, {@link TrustedResourceUrlString}, {@link TrustedScriptString},\n * {@link TrustedStyleString}, {@link TrustedUrlString}\n */\nexport interface TrustedString extends String { [BRAND]: BypassType; }\n\n/**\n * A branded trusted string used with sanitization of `html` strings.\n *\n * See: {@link bypassSanitizationTrustHtml} and {@link htmlSanitizer}.\n */\nexport interface TrustedHtmlString extends TrustedString { [BRAND]: BypassType.Html; }\n\n/**\n * A branded trusted string used with sanitization of `style` strings.\n *\n * See: {@link bypassSanitizationTrustStyle} and {@link styleSanitizer}.\n */\nexport interface TrustedStyleString extends TrustedString { [BRAND]: BypassType.Style; }\n\n/**\n * A branded trusted string used with sanitization of `url` strings.\n *\n * See: {@link bypassSanitizationTrustScript} and {@link scriptSanitizer}.\n */\nexport interface TrustedScriptString extends TrustedString { [BRAND]: BypassType.Script; }\n\n/**\n * A branded trusted string used with sanitization of `url` strings.\n *\n * See: {@link bypassSanitizationTrustUrl} and {@link urlSanitizer}.\n */\nexport interface TrustedUrlString extends TrustedString { [BRAND]: BypassType.Url; }\n\n/**\n * A branded trusted string used with sanitization of `resourceUrl` strings.\n *\n * See: {@link bypassSanitizationTrustResourceUrl} and {@link resourceUrlSanitizer}.\n */\nexport interface TrustedResourceUrlString extends TrustedString { [BRAND]: BypassType.ResourceUrl; }\n\nexport function allowSanitizationBypass(value: any, type: BypassType): boolean {\n return (value instanceof String && (value as TrustedStyleString)[BRAND] === type) ? true : false;\n}\n\n/**\n * Mark `html` string as trusted.\n *\n * This function wraps the trusted string in `String` and brands it in a way which makes it\n * recognizable to {@link htmlSanitizer} to be trusted implicitly.\n *\n * @param trustedHtml `html` string which needs to be implicitly trusted.\n * @returns a `html` `String` which has been branded to be implicitly trusted.\n */\nexport function bypassSanitizationTrustHtml(trustedHtml: string): TrustedHtmlString {\n return bypassSanitizationTrustString(trustedHtml, BypassType.Html);\n}\n/**\n * Mark `style` string as trusted.\n *\n * This function wraps the trusted string in `String` and brands it in a way which makes it\n * recognizable to {@link styleSanitizer} to be trusted implicitly.\n *\n * @param trustedStyle `style` string which needs to be implicitly trusted.\n * @returns a `style` `String` which has been branded to be implicitly trusted.\n */\nexport function bypassSanitizationTrustStyle(trustedStyle: string): TrustedStyleString {\n return bypassSanitizationTrustString(trustedStyle, BypassType.Style);\n}\n/**\n * Mark `script` string as trusted.\n *\n * This function wraps the trusted string in `String` and brands it in a way which makes it\n * recognizable to {@link scriptSanitizer} to be trusted implicitly.\n *\n * @param trustedScript `script` string which needs to be implicitly trusted.\n * @returns a `script` `String` which has been branded to be implicitly trusted.\n */\nexport function bypassSanitizationTrustScript(trustedScript: string): TrustedScriptString {\n return bypassSanitizationTrustString(trustedScript, BypassType.Script);\n}\n/**\n * Mark `url` string as trusted.\n *\n * This function wraps the trusted string in `String` and brands it in a way which makes it\n * recognizable to {@link urlSanitizer} to be trusted implicitly.\n *\n * @param trustedUrl `url` string which needs to be implicitly trusted.\n * @returns a `url` `String` which has been branded to be implicitly trusted.\n */\nexport function bypassSanitizationTrustUrl(trustedUrl: string): TrustedUrlString {\n return bypassSanitizationTrustString(trustedUrl, BypassType.Url);\n}\n/**\n * Mark `url` string as trusted.\n *\n * This function wraps the trusted string in `String` and brands it in a way which makes it\n * recognizable to {@link resourceUrlSanitizer} to be trusted implicitly.\n *\n * @param trustedResourceUrl `url` string which needs to be implicitly trusted.\n * @returns a `url` `String` which has been branded to be implicitly trusted.\n */\nexport function bypassSanitizationTrustResourceUrl(trustedResourceUrl: string):\n TrustedResourceUrlString {\n return bypassSanitizationTrustString(trustedResourceUrl, BypassType.ResourceUrl);\n}\n\n\nfunction bypassSanitizationTrustString(\n trustedString: string, mode: BypassType.Html): TrustedHtmlString;\nfunction bypassSanitizationTrustString(\n trustedString: string, mode: BypassType.Style): TrustedStyleString;\nfunction bypassSanitizationTrustString(\n trustedString: string, mode: BypassType.Script): TrustedScriptString;\nfunction bypassSanitizationTrustString(\n trustedString: string, mode: BypassType.Url): TrustedUrlString;\nfunction bypassSanitizationTrustString(\n trustedString: string, mode: BypassType.ResourceUrl): TrustedResourceUrlString;\nfunction bypassSanitizationTrustString(trustedString: string, mode: BypassType): TrustedString {\n const trusted = new String(trustedString) as TrustedString;\n trusted[BRAND] = mode;\n return trusted;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {getCurrentSanitizer} from '../render3/instructions';\nimport {stringify} from '../render3/util';\n\nimport {BypassType, allowSanitizationBypass} from './bypass';\nimport {_sanitizeHtml as _sanitizeHtml} from './html_sanitizer';\nimport {SecurityContext} from './security';\nimport {StyleSanitizeFn, _sanitizeStyle as _sanitizeStyle} from './style_sanitizer';\nimport {_sanitizeUrl as _sanitizeUrl} from './url_sanitizer';\n\n\n\n/**\n * An `html` sanitizer which converts untrusted `html` **string** into trusted string by removing\n * dangerous content.\n *\n * This method parses the `html` and locates potentially dangerous content (such as urls and\n * javascript) and removes it.\n *\n * It is possible to mark a string as trusted by calling {@link bypassSanitizationTrustHtml}.\n *\n * @param unsafeHtml untrusted `html`, typically from the user.\n * @returns `html` string which is safe to display to user, because all of the dangerous javascript\n * and urls have been removed.\n */\nexport function sanitizeHtml(unsafeHtml: any): string {\n const s = getCurrentSanitizer();\n if (s) {\n return s.sanitize(SecurityContext.HTML, unsafeHtml) || '';\n }\n if (allowSanitizationBypass(unsafeHtml, BypassType.Html)) {\n return unsafeHtml.toString();\n }\n return _sanitizeHtml(document, stringify(unsafeHtml));\n}\n\n/**\n * A `style` sanitizer which converts untrusted `style` **string** into trusted string by removing\n * dangerous content.\n *\n * This method parses the `style` and locates potentially dangerous content (such as urls and\n * javascript) and removes it.\n *\n * It is possible to mark a string as trusted by calling {@link bypassSanitizationTrustStyle}.\n *\n * @param unsafeStyle untrusted `style`, typically from the user.\n * @returns `style` string which is safe to bind to the `style` properties, because all of the\n * dangerous javascript and urls have been removed.\n */\nexport function sanitizeStyle(unsafeStyle: any): string {\n const s = getCurrentSanitizer();\n if (s) {\n return s.sanitize(SecurityContext.STYLE, unsafeStyle) || '';\n }\n if (allowSanitizationBypass(unsafeStyle, BypassType.Style)) {\n return unsafeStyle.toString();\n }\n return _sanitizeStyle(stringify(unsafeStyle));\n}\n\n/**\n * A `url` sanitizer which converts untrusted `url` **string** into trusted string by removing\n * dangerous\n * content.\n *\n * This method parses the `url` and locates potentially dangerous content (such as javascript) and\n * removes it.\n *\n * It is possible to mark a string as trusted by calling {@link bypassSanitizationTrustUrl}.\n *\n * @param unsafeUrl untrusted `url`, typically from the user.\n * @returns `url` string which is safe to bind to the `src` properties such as `<img src>`, because\n * all of the dangerous javascript has been removed.\n */\nexport function sanitizeUrl(unsafeUrl: any): string {\n const s = getCurrentSanitizer();\n if (s) {\n return s.sanitize(SecurityContext.URL, unsafeUrl) || '';\n }\n if (allowSanitizationBypass(unsafeUrl, BypassType.Url)) {\n return unsafeUrl.toString();\n }\n return _sanitizeUrl(stringify(unsafeUrl));\n}\n\n/**\n * A `url` sanitizer which only lets trusted `url`s through.\n *\n * This passes only `url`s marked trusted by calling {@link bypassSanitizationTrustResourceUrl}.\n *\n * @param unsafeResourceUrl untrusted `url`, typically from the user.\n * @returns `url` string which is safe to bind to the `src` properties such as `<img src>`, because\n * only trusted `url`s have been allowed to pass.\n */\nexport function sanitizeResourceUrl(unsafeResourceUrl: any): string {\n const s = getCurrentSanitizer();\n if (s) {\n return s.sanitize(SecurityContext.RESOURCE_URL, unsafeResourceUrl) || '';\n }\n if (allowSanitizationBypass(unsafeResourceUrl, BypassType.ResourceUrl)) {\n return unsafeResourceUrl.toString();\n }\n throw new Error('unsafe value used in a resource URL context (see http://g.co/ng/security#xss)');\n}\n\n/**\n * A `script` sanitizer which only lets trusted javascript through.\n *\n * This passes only `script`s marked trusted by calling {@link bypassSanitizationTrustScript}.\n *\n * @param unsafeScript untrusted `script`, typically from the user.\n * @returns `url` string which is safe to bind to the `<script>` element such as `<img src>`,\n * because only trusted `scripts`s have been allowed to pass.\n */\nexport function sanitizeScript(unsafeScript: any): string {\n const s = getCurrentSanitizer();\n if (s) {\n return s.sanitize(SecurityContext.SCRIPT, unsafeScript) || '';\n }\n if (allowSanitizationBypass(unsafeScript, BypassType.Script)) {\n return unsafeScript.toString();\n }\n throw new Error('unsafe value used in a script context');\n}\n\n/**\n * The default style sanitizer will handle sanitization for style properties by\n * sanitizing any CSS property that can include a `url` value (usually image-based properties)\n */\nexport const defaultStyleSanitizer = (function(prop: string, value?: string): string | boolean {\n if (value === undefined) {\n return prop === 'background-image' || prop === 'background' || prop === 'border-image' ||\n prop === 'filter' || prop === 'filter' || prop === 'list-style' ||\n prop === 'list-style-image';\n }\n\n return sanitizeStyle(value);\n} as StyleSanitizeFn);\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n// clang-format off\nexport {\n defineComponent as ɵdefineComponent,\n defineDirective as ɵdefineDirective,\n definePipe as ɵdefinePipe,\n defineNgModule as ɵdefineNgModule,\n detectChanges as ɵdetectChanges,\n renderComponent as ɵrenderComponent,\n ComponentType as ɵComponentType,\n DirectiveType as ɵDirectiveType,\n RenderFlags as ɵRenderFlags,\n directiveInject as ɵdirectiveInject,\n injectElementRef as ɵinjectElementRef,\n injectTemplateRef as ɵinjectTemplateRef,\n injectViewContainerRef as ɵinjectViewContainerRef,\n injectChangeDetectorRef as ɵinjectChangeDetectorRef,\n injectAttribute as ɵinjectAttribute,\n PublicFeature as ɵPublicFeature,\n InheritDefinitionFeature as ɵInheritDefinitionFeature,\n NgOnChangesFeature as ɵNgOnChangesFeature,\n NgModuleType as ɵNgModuleType,\n CssSelectorList as ɵCssSelectorList,\n markDirty as ɵmarkDirty,\n NgModuleFactory as ɵNgModuleFactory,\n NC as ɵNC,\n C as ɵC,\n E as ɵE,\n NH as ɵNH,\n NM as ɵNM,\n NS as ɵNS,\n Ee as ɵEe,\n L as ɵL,\n T as ɵT,\n V as ɵV,\n Q as ɵQ,\n Qr as ɵQr,\n d as ɵd,\n P as ɵP,\n b as ɵb,\n i1 as ɵi1,\n i2 as ɵi2,\n i3 as ɵi3,\n i4 as ɵi4,\n i5 as ɵi5,\n i6 as ɵi6,\n i7 as ɵi7,\n i8 as ɵi8,\n iV as ɵiV,\n pb1 as ɵpb1,\n pb2 as ɵpb2,\n pb3 as ɵpb3,\n pb4 as ɵpb4,\n pbV as ɵpbV,\n f0 as ɵf0,\n f1 as ɵf1,\n f2 as ɵf2,\n f3 as ɵf3,\n f4 as ɵf4,\n f5 as ɵf5,\n f6 as ɵf6,\n f7 as ɵf7,\n f8 as ɵf8,\n fV as ɵfV,\n cR as ɵcR,\n cr as ɵcr,\n qR as ɵqR,\n ql as ɵql,\n e as ɵe,\n p as ɵp,\n pD as ɵpD,\n rS as ɵrS,\n a as ɵa,\n s as ɵs,\n sm as ɵsm,\n sp as ɵsp,\n sa as ɵsa,\n cp as ɵcp,\n t as ɵt,\n v as ɵv,\n st as ɵst,\n ld as ɵld,\n Pp as ɵPp,\n ComponentDef as ɵComponentDef,\n DirectiveDef as ɵDirectiveDef,\n PipeDef as ɵPipeDef,\n whenRendered as ɵwhenRendered,\n iA as ɵiA,\n iEM as ɵiEM,\n iI1 as ɵiI1,\n iI2 as ɵiI2,\n iI3 as ɵiI3,\n iI4 as ɵiI4,\n iI5 as ɵiI5,\n iI6 as ɵiI6,\n iI7 as ɵiI7,\n iI8 as ɵiI8,\n iIV as ɵIV,\n iM as ɵiM,\n I18nInstruction as ɵI18nInstruction,\n I18nExpInstruction as ɵI18nExpInstruction,\n} from './render3/index';\nexport {NgModuleDef as ɵNgModuleDef} from './metadata/ng_module';\nexport {\n sanitizeHtml as ɵsanitizeHtml,\n sanitizeStyle as ɵsanitizeStyle,\n sanitizeUrl as ɵsanitizeUrl,\n sanitizeResourceUrl as ɵsanitizeResourceUrl,\n} from './sanitization/sanitization';\nexport {\n bypassSanitizationTrustHtml as ɵbypassSanitizationTrustHtml,\n bypassSanitizationTrustStyle as ɵbypassSanitizationTrustStyle,\n bypassSanitizationTrustScript as ɵbypassSanitizationTrustScript,\n bypassSanitizationTrustUrl as ɵbypassSanitizationTrustUrl,\n bypassSanitizationTrustResourceUrl as ɵbypassSanitizationTrustResourceUrl,\n} from './sanitization/bypass';\n// clang-format on\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport {CodegenComponentFactoryResolver as ɵCodegenComponentFactoryResolver} from './linker/component_factory_resolver';\nexport {registerModuleFactory as ɵregisterModuleFactory} from './linker/ng_module_factory_loader';\nexport {ArgumentType as ɵArgumentType, BindingFlags as ɵBindingFlags, DepFlags as ɵDepFlags, EMPTY_ARRAY as ɵEMPTY_ARRAY, EMPTY_MAP as ɵEMPTY_MAP, NodeFlags as ɵNodeFlags, QueryBindingType as ɵQueryBindingType, QueryValueType as ɵQueryValueType, ViewDefinition as ɵViewDefinition, ViewFlags as ɵViewFlags, anchorDef as ɵand, createComponentFactory as ɵccf, createNgModuleFactory as ɵcmf, createRendererType2 as ɵcrt, directiveDef as ɵdid, elementDef as ɵeld, elementEventFullName as ɵelementEventFullName, getComponentViewDefinitionFactory as ɵgetComponentViewDefinitionFactory, inlineInterpolate as ɵinlineInterpolate, interpolate as ɵinterpolate, moduleDef as ɵmod, moduleProvideDef as ɵmpd, ngContentDef as ɵncd, nodeValue as ɵnov, pipeDef as ɵpid, providerDef as ɵprd, pureArrayDef as ɵpad, pureObjectDef as ɵpod, purePipeDef as ɵppd, queryDef as ɵqud, textDef as ɵted, unwrapValue as ɵunv, viewDef as ɵvid} from './view/index';\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @module\n * @description\n * Entry point from which you should import all public core APIs.\n */\nexport * from './metadata';\nexport * from './version';\nexport {TypeDecorator} from './util/decorators';\nexport * from './di';\nexport {createPlatform, assertPlatform, destroyPlatform, getPlatform, PlatformRef, ApplicationRef, enableProdMode, isDevMode, createPlatformFactory, NgProbeToken} from './application_ref';\nexport {APP_ID, PACKAGE_ROOT_URL, PLATFORM_INITIALIZER, PLATFORM_ID, APP_BOOTSTRAP_LISTENER} from './application_tokens';\nexport {APP_INITIALIZER, ApplicationInitStatus} from './application_init';\nexport * from './zone';\nexport * from './render';\nexport * from './linker';\nexport {DebugElement, DebugNode, asNativeElements, getDebugNode, Predicate} from './debug/debug_node';\nexport {GetTestability, Testability, TestabilityRegistry, setTestabilityGetter} from './testability/testability';\nexport * from './change_detection';\nexport * from './platform_core_providers';\nexport {TRANSLATIONS, TRANSLATIONS_FORMAT, LOCALE_ID, MissingTranslationStrategy} from './i18n/tokens';\nexport {ApplicationModule} from './application_module';\nexport {wtfCreateScope, wtfLeave, wtfStartTimeRange, wtfEndTimeRange, WtfScopeFn} from './profile/profile';\nexport {Type} from './type';\nexport {EventEmitter} from './event_emitter';\nexport {ErrorHandler} from './error_handler';\nexport * from './core_private_export';\nexport * from './core_render3_private_export';\nexport {Sanitizer, SecurityContext} from './sanitization/security';\nexport * from './codegen_private_exports';\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @module\n * @description\n * Entry point for all public APIs of this package.\n */\nexport * from './src/core';\n\n// This file only reexports content of the `src` folder. Keep it that way.\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n// This file is not used to build this module. It is only used during editing\n// by the TypeScript language service and during build for verification. `ngc`\n// replaces this file with production index.ts when it rewrites private symbol\n// names.\n\nexport * from './public_api';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n\nexport {APPLICATION_MODULE_PROVIDERS as ɵangular_packages_core_core_l,_iterableDiffersFactory as ɵangular_packages_core_core_i,_keyValueDiffersFactory as ɵangular_packages_core_core_j,_localeFactory as ɵangular_packages_core_core_k} from './src/application_module';\nexport {_appIdRandomProviderFactory as ɵangular_packages_core_core_f} from './src/application_tokens';\nexport {DefaultIterableDifferFactory as ɵangular_packages_core_core_g} from './src/change_detection/differs/default_iterable_differ';\nexport {DefaultKeyValueDifferFactory as ɵangular_packages_core_core_h} from './src/change_detection/differs/default_keyvalue_differ';\nexport {ReflectiveInjector_ as ɵangular_packages_core_core_c} from './src/di/reflective_injector';\nexport {ReflectiveDependency as ɵangular_packages_core_core_d,resolveReflectiveProviders as ɵangular_packages_core_core_e} from './src/di/reflective_provider';\nexport {wtfEnabled as ɵangular_packages_core_core_m} from './src/profile/profile';\nexport {createScope as ɵangular_packages_core_core_o,detectWTF as ɵangular_packages_core_core_n,endTimeRange as ɵangular_packages_core_core_r,leave as ɵangular_packages_core_core_p,startTimeRange as ɵangular_packages_core_core_q} from './src/profile/wtf_impl';\nexport {getOrCreateChangeDetectorRef as ɵangular_packages_core_core_v,getOrCreateContainerRef as ɵangular_packages_core_core_y,getOrCreateElementRef as ɵangular_packages_core_core_x,getOrCreateInjectable as ɵangular_packages_core_core_w,getOrCreateNodeInjector as ɵangular_packages_core_core_u,getOrCreateTemplateRef as ɵangular_packages_core_core_z} from './src/render3/di';\nexport {bindingUpdated as ɵangular_packages_core_core_ba} from './src/render3/instructions';\nexport {loadInternal as ɵangular_packages_core_core_bb} from './src/render3/util';\nexport {makeParamDecorator as ɵangular_packages_core_core_a,makePropDecorator as ɵangular_packages_core_core_b} from './src/util/decorators';\nexport {_def as ɵangular_packages_core_core_s} from './src/view/provider';\nexport {DebugContext as ɵangular_packages_core_core_t} from './src/view/types';"],"names":["global","getClosureSafeProperty","GET_PROPERTY_NAME","USE_VALUE","ResolvedReflectiveFactory","CIRCULAR","EMPTY_ARRAY","NULL_INJECTOR","tslib_1.__param","tslib_1.__extends","tslib_1.__values","merge","renderNode","RendererV1","InjectorRefTokenKey","INJECTORRefTokenKey","_createProviderInstance","tokenKey","createInjector","anchorDef","viewDef","INJECTOR","stringify","updateElementClassProp","renderElementStyles","updateElementStyleProp","projectionNodeStack","EMPTY","ComponentFactoryResolver","ComponentFactory","viewEngine_ComponentFactoryResolver","projection","ComponentRef","viewEngine_ComponentFactory","ViewRef","viewEngine_ComponentRef","ElementRef","ViewContainerRef","viewEngine_NgModuleRef","TemplateRef","element","NgModuleRef","NgModuleFactory","viewEngine_NgModuleFactory","checkAndUpdateBinding","createQuery","flatten","QueryList"],"mappings":";;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;AA+HA,0BAAoC,IAGnC;IACC,OAAQ;QACN,UAAU,EAAE,IAAI,CAAC,UAAiB,IAAI,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE,SAAS;KACtD,CAAC;CACjC;;;;;;;;;;;;;;;;;;;;;AAsBD,wBAA+B,OAAiE;IAE9F,OAAQ;QACN,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO,CAAC,SAAS,IAAI,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,IAAI,EAAE;KAC/D,CAAC;CACjC;;ACjKD;;;;;;;AAUA,AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCA;IAME,wBAAsB,KAAa,EAAE,OAGpC;QAHqB,UAAK,GAAL,KAAK,CAAQ;;QAJ1B,mBAAc,GAAG,gBAAgB,CAAC;QAQzC,IAAI,OAAO,KAAK,SAAS,EAAE;YACzB,IAAI,CAAC,eAAe,GAAG,gBAAgB,CAAC;gBACtC,UAAU,EAAE,OAAO,CAAC,UAAU,IAAI,MAAM;gBACxC,OAAO,EAAE,OAAO,CAAC,OAAO;aACzB,CAAC,CAAC;SACJ;aAAM;YACL,IAAI,CAAC,eAAe,GAAG,SAAS,CAAC;SAClC;KACF;IAED,iCAAQ,GAAR,cAAqB,OAAO,oBAAkB,IAAI,CAAC,KAAO,CAAC,EAAE;IAC/D,qBAAC;CAAA;;ACvED;;;;;;;AAoCO,IAAM,WAAW,GAAG,iBAAiB,CAAC;AAC7C,AAAO,IAAM,UAAU,GAAG,gBAAgB,CAAC;AAC3C,AAAO,IAAM,aAAa,GAAG,oBAAoB,CAAC;;;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