{"version":3,"file":"upgrade.js","sources":["../../../../packages/upgrade/index.ts","../../../../packages/upgrade/public_api.ts","../../../../packages/upgrade/src/dynamic/upgrade_adapter.ts","../../../../packages/upgrade/src/dynamic/upgrade_ng1_adapter.ts","../../../../packages/upgrade/src/common/upgrade_helper.ts","../../../../packages/upgrade/src/common/downgrade_injectable.ts","../../../../packages/upgrade/src/common/downgrade_component.ts","../../../../packages/upgrade/src/common/downgrade_component_adapter.ts","../../../../packages/upgrade/src/common/util.ts","../../../../packages/upgrade/src/common/component_info.ts","../../../../packages/upgrade/src/common/constants.ts","../../../../packages/upgrade/src/common/angular1.ts","../../../../packages/upgrade/src/common/version.ts"],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport {VERSION,UpgradeAdapter,UpgradeAdapterRef} from './public_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 * @module\n * @description\n * Entry point for all public APIs of the upgrade/dynamic package, allowing\n * Angular 1 and Angular 2+ to run side by side in the same application.\n */\nexport {VERSION} from './src/common/version';\nexport {UpgradeAdapter, UpgradeAdapterRef} from './src/dynamic/upgrade_adapter';\n\n// This file only re-exports 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\nimport {Compiler, CompilerOptions, Directive, Injector, NgModule, NgModuleRef, NgZone, Provider, Testability, Type} from '@angular/core';\nimport {platformBrowserDynamic} from '@angular/platform-browser-dynamic';\n\nimport * as angular from '../common/angular1';\nimport {$$TESTABILITY, $COMPILE, $INJECTOR, $ROOT_SCOPE, COMPILER_KEY, INJECTOR_KEY, NG_ZONE_KEY} from '../common/constants';\nimport {downgradeComponent} from '../common/downgrade_component';\nimport {downgradeInjectable} from '../common/downgrade_injectable';\nimport {Deferred, controllerKey, onError} from '../common/util';\n\nimport {UpgradeNg1ComponentAdapterBuilder} from './upgrade_ng1_adapter';\n\nlet /** @type {?} */ upgradeCount: number = 0;\n/**\n * Use `UpgradeAdapter` to allow AngularJS and Angular to coexist in a single application.\n * \n * The `UpgradeAdapter` allows:\n * 1. creation of Angular component from AngularJS component directive\n * (See [UpgradeAdapter#upgradeNg1Component()])\n * 2. creation of AngularJS directive from Angular component.\n * (See [UpgradeAdapter#downgradeNg2Component()])\n * 3. Bootstrapping of a hybrid Angular application which contains both of the frameworks\n * coexisting in a single application.\n * \n * ## Mental Model\n * \n * When reasoning about how a hybrid application works it is useful to have a mental model which\n * describes what is happening and explains what is happening at the lowest level.\n * \n * 1. There are two independent frameworks running in a single application, each framework treats\n * the other as a black box.\n * 2. Each DOM element on the page is owned exactly by one framework. Whichever framework\n * instantiated the element is the owner. Each framework only updates/interacts with its own\n * DOM elements and ignores others.\n * 3. AngularJS directives always execute inside AngularJS framework codebase regardless of\n * where they are instantiated.\n * 4. Angular components always execute inside Angular framework codebase regardless of\n * where they are instantiated.\n * 5. An AngularJS component can be upgraded to an Angular component. This creates an\n * Angular directive, which bootstraps the AngularJS component directive in that location.\n * 6. An Angular component can be downgraded to an AngularJS component directive. This creates\n * an AngularJS directive, which bootstraps the Angular component in that location.\n * 7. Whenever an adapter component is instantiated the host element is owned by the framework\n * doing the instantiation. The other framework then instantiates and owns the view for that\n * component. This implies that component bindings will always follow the semantics of the\n * instantiation framework. The syntax is always that of Angular syntax.\n * 8. AngularJS is always bootstrapped first and owns the bottom most view.\n * 9. The new application is running in Angular zone, and therefore it no longer needs calls to\n * `$apply()`.\n * \n * ### Example\n * \n * ```\n * const adapter = new UpgradeAdapter(forwardRef(() => MyNg2Module), myCompilerOptions);\n * const module = angular.module('myExample', []);\n * module.directive('ng2Comp', adapter.downgradeNg2Component(Ng2Component));\n * \n * module.directive('ng1Hello', function() {\n * return {\n * scope: { title: '=' },\n * template: 'ng1[Hello {{title}}!]()'\n * };\n * });\n * \n * \n * \\@Component({ \n * selector: 'ng2-comp',\n * inputs: ['name'],\n * template: 'ng2[transclude]()',\n * directives:\n * })\n * class Ng2Component {\n * }\n * \n * \\@NgModule({ \n * declarations: [Ng2Component, adapter.upgradeNg1Component('ng1Hello')],\n * imports: [BrowserModule]\n * })\n * class MyNg2Module {}\n * \n * \n * document.body.innerHTML = 'project';\n * \n * adapter.bootstrap(document.body, ['myExample']).ready(function() {\n * expect(document.body.textContent).toEqual(\n * \"ng2[ng1[Hello World!](transclude)](project)\");\n * });\n * \n * ```\n * \n * \\@stable\n */\nexport class UpgradeAdapter {\nprivate idPrefix: string = `NG2_UPGRADE_${upgradeCount++}_`;\nprivate downgradedComponents: Type[] = [];\n/**\n * An internal map of ng1 components which need to up upgraded to ng2.\n * \n * We can't upgrade until injector is instantiated and we can retrieve the component metadata.\n * For this reason we keep a list of components to upgrade until ng1 injector is bootstrapped.\n * \n * \\@internal\n */\nprivate ng1ComponentsToBeUpgraded: {[name: string]: UpgradeNg1ComponentAdapterBuilder} = {};\nprivate upgradedProviders: Provider[] = [];\nprivate ngZone: NgZone;\nprivate ng1Module: angular.IModule;\nprivate moduleRef: NgModuleRef|null = null;\nprivate ng2BootstrapDeferred: Deferred;\n/**\n * @param {?} ng2AppModule\n * @param {?=} compilerOptions\n */\nconstructor(private ng2AppModule: Type,\nprivate compilerOptions?: CompilerOptions) {\n if (!ng2AppModule) {\n throw new Error(\n 'UpgradeAdapter cannot be instantiated without an NgModule of the Angular app.');\n }\n }\n/**\n * Allows Angular Component to be used from AngularJS.\n * \n * Use `downgradeNg2Component` to create an AngularJS Directive Definition Factory from\n * Angular Component. The adapter will bootstrap Angular component from within the\n * AngularJS template.\n * \n * ## Mental Model\n * \n * 1. The component is instantiated by being listed in AngularJS template. This means that the\n * host element is controlled by AngularJS, but the component's view will be controlled by\n * Angular.\n * 2. Even thought the component is instantiated in AngularJS, it will be using Angular\n * syntax. This has to be done, this way because we must follow Angular components do not\n * declare how the attributes should be interpreted.\n * 3. `ng-model` is controlled by AngularJS and communicates with the downgraded Angular component\n * by way of the `ControlValueAccessor` interface from \\@angular/forms. Only components that\n * implement this interface are eligible.\n * \n * ## Supported Features\n * \n * - Bindings:\n * - Attribute: ``\n * - Interpolation: ``\n * - Expression: ``\n * - Event: ``\n * - ng-model: ``\n * - Content projection: yes\n * \n * ### Example\n * \n * ```\n * const adapter = new UpgradeAdapter(forwardRef(() => MyNg2Module));\n * const module = angular.module('myExample', []);\n * module.directive('greet', adapter.downgradeNg2Component(Greeter));\n * \n * \\@Component({ \n * selector: 'greet',\n * template: '{{salutation}} {{name}}! - '\n * })\n * class Greeter {\n * \\@Input() salutation: string;\n * \\@Input() name: string;\n * }\n * \n * \\@NgModule({ \n * declarations: [Greeter],\n * imports: [BrowserModule]\n * })\n * class MyNg2Module {}\n * \n * document.body.innerHTML =\n * 'ng1 template: text';\n * \n * adapter.bootstrap(document.body, ['myExample']).ready(function() {\n * expect(document.body.textContent).toEqual(\"ng1 template: Hello world! - text\");\n * });\n * ```\n * @param {?} component\n * @return {?}\n */\ndowngradeNg2Component(component: Type): Function {\n this.downgradedComponents.push(component);\n\n return downgradeComponent({component});\n }\n/**\n * Allows AngularJS Component to be used from Angular.\n * \n * Use `upgradeNg1Component` to create an Angular component from AngularJS Component\n * directive. The adapter will bootstrap AngularJS component from within the Angular\n * template.\n * \n * ## Mental Model\n * \n * 1. The component is instantiated by being listed in Angular template. This means that the\n * host element is controlled by Angular, but the component's view will be controlled by\n * AngularJS.\n * \n * ## Supported Features\n * \n * - Bindings:\n * - Attribute: ``\n * - Interpolation: ``\n * - Expression: ``\n * - Event: ``\n * - Transclusion: yes\n * - Only some of the features of\n * [Directive Definition Object](https://docs.angularjs.org/api/ng/service/$compile) are\n * supported:\n * - `compile`: not supported because the host element is owned by Angular, which does\n * not allow modifying DOM structure during compilation.\n * - `controller`: supported. (NOTE: injection of `$attrs` and `$transclude` is not supported.)\n * - `controllerAs`: supported.\n * - `bindToController`: supported.\n * - `link`: supported. (NOTE: only pre-link function is supported.)\n * - `name`: supported.\n * - `priority`: ignored.\n * - `replace`: not supported.\n * - `require`: supported.\n * - `restrict`: must be set to 'E'.\n * - `scope`: supported.\n * - `template`: supported.\n * - `templateUrl`: supported.\n * - `terminal`: ignored.\n * - `transclude`: supported.\n * \n * \n * ### Example\n * \n * ```\n * const adapter = new UpgradeAdapter(forwardRef(() => MyNg2Module));\n * const module = angular.module('myExample', []);\n * \n * module.directive('greet', function() {\n * return {\n * scope: {salutation: '=', name: '=' },\n * template: '{{salutation}} {{name}}! - '\n * };\n * });\n * \n * module.directive('ng2', adapter.downgradeNg2Component(Ng2Component));\n * \n * \\@Component({ \n * selector: 'ng2',\n * template: 'ng2 template: text'\n * })\n * class Ng2Component {\n * }\n * \n * \\@NgModule({ \n * declarations: [Ng2Component, adapter.upgradeNg1Component('greet')],\n * imports: [BrowserModule]\n * })\n * class MyNg2Module {}\n * \n * document.body.innerHTML = '';\n * \n * adapter.bootstrap(document.body, ['myExample']).ready(function() {\n * expect(document.body.textContent).toEqual(\"ng2 template: Hello world! - text\");\n * });\n * ```\n * @param {?} name\n * @return {?}\n */\nupgradeNg1Component(name: string): Type {\n if (( /** @type {?} */((this.ng1ComponentsToBeUpgraded))).hasOwnProperty(name)) {\n return this.ng1ComponentsToBeUpgraded[name].type;\n } else {\n return (this.ng1ComponentsToBeUpgraded[name] = new UpgradeNg1ComponentAdapterBuilder(name))\n .type;\n }\n }\n/**\n * Registers the adapter's AngularJS upgrade module for unit testing in AngularJS.\n * Use this instead of `angular.mock.module()` to load the upgrade module into\n * the AngularJS testing injector.\n * \n * ### Example\n * \n * ```\n * const upgradeAdapter = new UpgradeAdapter(MyNg2Module);\n * \n * // configure the adapter with upgrade/downgrade components and services\n * upgradeAdapter.downgradeNg2Component(MyComponent);\n * \n * let upgradeAdapterRef: UpgradeAdapterRef;\n * let $compile, $rootScope;\n * \n * // We must register the adapter before any calls to `inject()`\n * beforeEach(() => {\n * upgradeAdapterRef = upgradeAdapter.registerForNg1Tests(['heroApp']);\n * });\n * \n * beforeEach(inject((_$compile_, _$rootScope_) => {\n * $compile = _$compile_;\n * $rootScope = _$rootScope_;\n * }));\n * \n * it(\"says hello\", (done) => {\n * upgradeAdapterRef.ready(() => {\n * const element = $compile(\"\")($rootScope);\n * $rootScope.$apply();\n * expect(element.html()).toContain(\"Hello World\");\n * done();\n * })\n * });\n * \n * ```\n * \n * @param {?=} modules any AngularJS modules that the upgrade module should depend upon\n * @return {?} an {\\@link UpgradeAdapterRef}, which lets you register a `ready()` callback to\n * run assertions once the Angular components are ready to test through AngularJS.\n */\nregisterForNg1Tests(modules?: string[]): UpgradeAdapterRef {\n const /** @type {?} */ windowNgMock = ( /** @type {?} */((window as any)))['angular'].mock;\n if (!windowNgMock || !windowNgMock.module) {\n throw new Error('Failed to find \\'angular.mock.module\\'.');\n }\n this.declareNg1Module(modules);\n windowNgMock.module(this.ng1Module.name);\n const /** @type {?} */ upgrade = new UpgradeAdapterRef();\n this.ng2BootstrapDeferred.promise.then(\n (ng1Injector) => { ( /** @type {?} */((upgrade)))._bootstrapDone(this.moduleRef, ng1Injector); }, onError);\n return upgrade;\n }\n/**\n * Bootstrap a hybrid AngularJS / Angular application.\n * \n * This `bootstrap` method is a direct replacement (takes same arguments) for AngularJS\n * [`bootstrap`](https://docs.angularjs.org/api/ng/function/angular.bootstrap) method. Unlike\n * AngularJS, this bootstrap is asynchronous.\n * \n * ### Example\n * \n * ```\n * const adapter = new UpgradeAdapter(MyNg2Module);\n * const module = angular.module('myExample', []);\n * module.directive('ng2', adapter.downgradeNg2Component(Ng2));\n * \n * module.directive('ng1', function() {\n * return {\n * scope: { title: '=' },\n * template: 'ng1[Hello {{title}}!]()'\n * };\n * });\n * \n * \n * \\@Component({ \n * selector: 'ng2',\n * inputs: ['name'],\n * template: 'ng2[transclude]()'\n * })\n * class Ng2 {\n * }\n * \n * \\@NgModule({ \n * declarations: [Ng2, adapter.upgradeNg1Component('ng1')],\n * imports: [BrowserModule]\n * })\n * class MyNg2Module {}\n * \n * document.body.innerHTML = 'project';\n * \n * adapter.bootstrap(document.body, ['myExample']).ready(function() {\n * expect(document.body.textContent).toEqual(\n * \"ng2[ng1[Hello World!](transclude)](project)\");\n * });\n * ```\n * @param {?} element\n * @param {?=} modules\n * @param {?=} config\n * @return {?}\n */\nbootstrap(element: Element, modules?: any[], config?: angular.IAngularBootstrapConfig):\n UpgradeAdapterRef {\n this.declareNg1Module(modules);\n\n const /** @type {?} */ upgrade = new UpgradeAdapterRef();\n\n // Make sure resumeBootstrap() only exists if the current bootstrap is deferred\n const /** @type {?} */ windowAngular = ( /** @type {?} */((window as any)) /** TODO #???? */)['angular'];\n windowAngular.resumeBootstrap = undefined;\n\n this.ngZone.run(() => { angular.bootstrap(element, [this.ng1Module.name], /** @type {?} */(( config))); });\n const /** @type {?} */ ng1BootstrapPromise = new Promise((resolve) => {\n if (windowAngular.resumeBootstrap) {\n const /** @type {?} */ originalResumeBootstrap: () => void = windowAngular.resumeBootstrap;\n windowAngular.resumeBootstrap = function() {\n windowAngular.resumeBootstrap = originalResumeBootstrap;\n windowAngular.resumeBootstrap.apply(this, arguments);\n resolve();\n };\n } else {\n resolve();\n }\n });\n\n Promise.all([this.ng2BootstrapDeferred.promise, ng1BootstrapPromise]).then(([ng1Injector]) => { /** @type {?} */((\n angular.element(element).data))(controllerKey(INJECTOR_KEY), /** @type {?} */(( this.moduleRef)).injector); /** @type {?} */((\n this.moduleRef)).injector.get(NgZone).run(\n () => { ( /** @type {?} */((upgrade)))._bootstrapDone(this.moduleRef, ng1Injector); });\n }, onError);\n return upgrade;\n }\n/**\n * Allows AngularJS service to be accessible from Angular.\n * \n * \n * ### Example\n * \n * ```\n * class Login { ... }\n * class Server { ... }\n * \n * \\@Injectable() \n * class Example {\n * constructor(\\@Inject('server') server, login: Login) {\n * ...\n * }\n * }\n * \n * const module = angular.module('myExample', []);\n * module.service('server', Server);\n * module.service('login', Login);\n * \n * const adapter = new UpgradeAdapter(MyNg2Module);\n * adapter.upgradeNg1Provider('server');\n * adapter.upgradeNg1Provider('login', {asToken: Login});\n * \n * adapter.bootstrap(document.body, ['myExample']).ready((ref) => {\n * const example: Example = ref.ng2Injector.get(Example);\n * });\n * \n * ```\n * @param {?} name\n * @param {?=} options\n * @return {?}\n */\nupgradeNg1Provider(name: string, options?: {asToken: any}) {\n const /** @type {?} */ token = options && options.asToken || name;\n this.upgradedProviders.push({\n provide: token,\n useFactory: ($injector: angular.IInjectorService) => $injector.get(name),\n deps: [$INJECTOR]\n });\n }\n/**\n * Allows Angular service to be accessible from AngularJS.\n * \n * \n * ### Example\n * \n * ```\n * class Example {\n * }\n * \n * const adapter = new UpgradeAdapter(MyNg2Module);\n * \n * const module = angular.module('myExample', []);\n * module.factory('example', adapter.downgradeNg2Provider(Example));\n * \n * adapter.bootstrap(document.body, ['myExample']).ready((ref) => {\n * const example: Example = ref.ng1Injector.get('example');\n * });\n * \n * ```\n * @param {?} token\n * @return {?}\n */\ndowngradeNg2Provider(token: any): Function { return downgradeInjectable(token); }\n/**\n * Declare the AngularJS upgrade module for this adapter without bootstrapping the whole\n * hybrid application.\n * \n * This method is automatically called by `bootstrap()` and `registerForNg1Tests()`.\n * \n * @param {?=} modules The AngularJS modules that this upgrade module should depend upon.\n * @return {?} The AngularJS upgrade module that is declared by this method\n * \n * ### Example\n * \n * ```\n * const upgradeAdapter = new UpgradeAdapter(MyNg2Module);\n * upgradeAdapter.declareNg1Module(['heroApp']);\n * ```\n */\nprivate declareNg1Module(modules: string[] = []): angular.IModule {\n const /** @type {?} */ delayApplyExps: Function[] = [];\n let /** @type {?} */ original$applyFn: Function;\n let /** @type {?} */ rootScopePrototype: any;\n let /** @type {?} */ rootScope: angular.IRootScopeService;\n const /** @type {?} */ upgradeAdapter = this;\n const /** @type {?} */ ng1Module = this.ng1Module = angular.module(this.idPrefix, modules);\n const /** @type {?} */ platformRef = platformBrowserDynamic();\n\n this.ngZone = new NgZone({enableLongStackTrace: Zone.hasOwnProperty('longStackTraceZoneSpec')});\n this.ng2BootstrapDeferred = new Deferred();\n ng1Module.factory(INJECTOR_KEY, () => /** @type {?} */(( this.moduleRef)).injector.get(Injector))\n .constant(NG_ZONE_KEY, this.ngZone)\n .factory(COMPILER_KEY, () => /** @type {?} */(( this.moduleRef)).injector.get(Compiler))\n .config([\n '$provide', '$injector',\n (provide: angular.IProvideService, ng1Injector: angular.IInjectorService) => {\n provide.decorator($ROOT_SCOPE, [\n '$delegate',\n function(rootScopeDelegate: angular.IRootScopeService) {\n // Capture the root apply so that we can delay first call to $apply until we\n // bootstrap Angular and then we replay and restore the $apply.\n rootScopePrototype = rootScopeDelegate.constructor.prototype;\n if (rootScopePrototype.hasOwnProperty('$apply')) {\n original$applyFn = rootScopePrototype.$apply;\n rootScopePrototype.$apply = (exp: any) => delayApplyExps.push(exp);\n } else {\n throw new Error('Failed to find \\'$apply\\' on \\'$rootScope\\'!');\n }\n return rootScope = rootScopeDelegate;\n }\n ]);\n if (ng1Injector.has($$TESTABILITY)) {\n provide.decorator($$TESTABILITY, [\n '$delegate',\n function(testabilityDelegate: angular.ITestabilityService) {\n const /** @type {?} */ originalWhenStable: Function = testabilityDelegate.whenStable;\n // Cannot use arrow function below because we need the context\n const /** @type {?} */ newWhenStable = function(callback: Function) {\n originalWhenStable.call(this, function() {\n const /** @type {?} */ ng2Testability: Testability = /** @type {?} */((\n upgradeAdapter.moduleRef)).injector.get(Testability);\n if (ng2Testability.isStable()) {\n callback.apply(this, arguments);\n } else {\n ng2Testability.whenStable(newWhenStable.bind(this, callback));\n }\n });\n };\n\n testabilityDelegate.whenStable = newWhenStable;\n return testabilityDelegate;\n }\n ]);\n }\n }\n ]);\n\n ng1Module.run([\n '$injector', '$rootScope',\n (ng1Injector: angular.IInjectorService, rootScope: angular.IRootScopeService) => {\n UpgradeNg1ComponentAdapterBuilder.resolve(this.ng1ComponentsToBeUpgraded, ng1Injector)\n .then(() => {\n // At this point we have ng1 injector and we have prepared\n // ng1 components to be upgraded, we now can bootstrap ng2.\n const /** @type {?} */ DynamicNgUpgradeModule =\n NgModule({\n providers: [\n {provide: $INJECTOR, useFactory: () => ng1Injector},\n {provide: $COMPILE, useFactory: () => ng1Injector.get($COMPILE)},\n this.upgradedProviders\n ],\n imports: [this.ng2AppModule],\n entryComponents: this.downgradedComponents\n }).Class({\n constructor: function DynamicNgUpgradeModule() {},\n ngDoBootstrap: function() {}\n });\n ( /** @type {?} */((platformRef as any)))\n ._bootstrapModuleWithZone(\n DynamicNgUpgradeModule, this.compilerOptions, this.ngZone)\n .then((ref: NgModuleRef) => {\n this.moduleRef = ref;\n this.ngZone.run(() => {\n if (rootScopePrototype) {\n rootScopePrototype.$apply = original$applyFn; // restore original $apply\n while (delayApplyExps.length) {\n rootScope.$apply(delayApplyExps.shift());\n }\n rootScopePrototype = null;\n }\n });\n })\n .then(() => this.ng2BootstrapDeferred.resolve(ng1Injector), onError)\n .then(() => {\n let /** @type {?} */ subscription =\n this.ngZone.onMicrotaskEmpty.subscribe({next: () => rootScope.$digest()});\n rootScope.$on('$destroy', () => { subscription.unsubscribe(); });\n });\n })\n .catch((e) => this.ng2BootstrapDeferred.reject(e));\n }\n ]);\n\n return ng1Module;\n }\n}\n\nfunction UpgradeAdapter_tsickle_Closure_declarations() {\n/** @type {?} */\nUpgradeAdapter.prototype.idPrefix;\n/** @type {?} */\nUpgradeAdapter.prototype.downgradedComponents;\n/**\n * An internal map of ng1 components which need to up upgraded to ng2.\n * \n * We can't upgrade until injector is instantiated and we can retrieve the component metadata.\n * For this reason we keep a list of components to upgrade until ng1 injector is bootstrapped.\n * \n * \\@internal\n * @type {?}\n */\nUpgradeAdapter.prototype.ng1ComponentsToBeUpgraded;\n/** @type {?} */\nUpgradeAdapter.prototype.upgradedProviders;\n/** @type {?} */\nUpgradeAdapter.prototype.ngZone;\n/** @type {?} */\nUpgradeAdapter.prototype.ng1Module;\n/** @type {?} */\nUpgradeAdapter.prototype.moduleRef;\n/** @type {?} */\nUpgradeAdapter.prototype.ng2BootstrapDeferred;\n/** @type {?} */\nUpgradeAdapter.prototype.ng2AppModule;\n/** @type {?} */\nUpgradeAdapter.prototype.compilerOptions;\n}\n\n/**\n * Synchronous promise-like object to wrap parent injectors,\n * to preserve the synchronous nature of AngularJS's $compile.\n */\nclass ParentInjectorPromise {\nprivate injector: Injector;\nprivate callbacks: ((injector: Injector) => any)[] = [];\n/**\n * @param {?} element\n */\nconstructor(private element: angular.IAugmentedJQuery) {\n // store the promise on the element\n element.data !(controllerKey(INJECTOR_KEY), this);\n }\n/**\n * @param {?} callback\n * @return {?}\n */\nthen(callback: (injector: Injector) => any) {\n if (this.injector) {\n callback(this.injector);\n } else {\n this.callbacks.push(callback);\n }\n }\n/**\n * @param {?} injector\n * @return {?}\n */\nresolve(injector: Injector) {\n this.injector = injector; /** @type {?} */((\n\n // reset the element data to point to the real injector\n this.element.data))(controllerKey(INJECTOR_KEY), injector);\n\n // clean out the element to prevent memory leaks\n this.element = /** @type {?} */(( null));\n\n // run all the queued callbacks\n this.callbacks.forEach((callback) => callback(injector));\n this.callbacks.length = 0;\n }\n}\n\nfunction ParentInjectorPromise_tsickle_Closure_declarations() {\n/** @type {?} */\nParentInjectorPromise.prototype.injector;\n/** @type {?} */\nParentInjectorPromise.prototype.callbacks;\n/** @type {?} */\nParentInjectorPromise.prototype.element;\n}\n\n/**\n * Use `UpgradeAdapterRef` to control a hybrid AngularJS / Angular application.\n * \n * \\@stable\n */\nexport class UpgradeAdapterRef {\nprivate _readyFn: ((upgradeAdapterRef?: UpgradeAdapterRef) => void)|null = null;\npublic ng1RootScope: angular.IRootScopeService = /** @type {?} */(( null));\npublic ng1Injector: angular.IInjectorService = /** @type {?} */(( null));\npublic ng2ModuleRef: NgModuleRef = /** @type {?} */(( null));\npublic ng2Injector: Injector = /** @type {?} */(( null));\n/**\n * @param {?} ngModuleRef\n * @param {?} ng1Injector\n * @return {?}\n */\nprivate _bootstrapDone(ngModuleRef: NgModuleRef, ng1Injector: angular.IInjectorService) {\n this.ng2ModuleRef = ngModuleRef;\n this.ng2Injector = ngModuleRef.injector;\n this.ng1Injector = ng1Injector;\n this.ng1RootScope = ng1Injector.get($ROOT_SCOPE);\n this._readyFn && this._readyFn(this);\n }\n/**\n * Register a callback function which is notified upon successful hybrid AngularJS / Angular\n * application has been bootstrapped.\n * \n * The `ready` callback function is invoked inside the Angular zone, therefore it does not\n * require a call to `$apply()`.\n * @param {?} fn\n * @return {?}\n */\npublic ready(fn: (upgradeAdapterRef: UpgradeAdapterRef) => void) { this._readyFn = fn; }\n/**\n * Dispose of running hybrid AngularJS / Angular application.\n * @return {?}\n */\npublic dispose() { /** @type {?} */((\n this.ng1Injector)).get($ROOT_SCOPE).$destroy(); /** @type {?} */((\n this.ng2ModuleRef)).destroy();\n }\n}\n\nfunction UpgradeAdapterRef_tsickle_Closure_declarations() {\n/** @type {?} */\nUpgradeAdapterRef.prototype._readyFn;\n/** @type {?} */\nUpgradeAdapterRef.prototype.ng1RootScope;\n/** @type {?} */\nUpgradeAdapterRef.prototype.ng1Injector;\n/** @type {?} */\nUpgradeAdapterRef.prototype.ng2ModuleRef;\n/** @type {?} */\nUpgradeAdapterRef.prototype.ng2Injector;\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 {Directive, DoCheck, ElementRef, EventEmitter, Inject, Injector, OnChanges, OnInit, SimpleChange, SimpleChanges, Type} from '@angular/core';\n\nimport * as angular from '../common/angular1';\nimport {$SCOPE} from '../common/constants';\nimport {IBindingDestination, IControllerInstance, UpgradeHelper} from '../common/upgrade_helper';\nimport {isFunction, strictEquals} from '../common/util';\n\n\nconst /** @type {?} */ CAMEL_CASE = /([A-Z])/g;\nconst /** @type {?} */ INITIAL_VALUE = {\n __UNINITIALIZED__: true\n};\nconst /** @type {?} */ NOT_SUPPORTED: any = 'NOT_SUPPORTED';\nexport class UpgradeNg1ComponentAdapterBuilder {\n type: Type;\n inputs: string[] = [];\n inputsRename: string[] = [];\n outputs: string[] = [];\n outputsRename: string[] = [];\n propertyOutputs: string[] = [];\n checkProperties: string[] = [];\n propertyMap: {[name: string]: string} = {};\n directive: angular.IDirective|null = null;\n template: string;\n/**\n * @param {?} name\n */\nconstructor(public name: string) {\n const selector =\n name.replace(CAMEL_CASE, (all: string, next: string) => '-' + next.toLowerCase());\n const self = this;\n\n this.type =\n Directive({selector: selector, inputs: this.inputsRename, outputs: this.outputsRename})\n .Class({\n constructor: [\n new Inject($SCOPE), Injector, ElementRef,\n function(scope: angular.IScope, injector: Injector, elementRef: ElementRef) {\n const helper = new UpgradeHelper(injector, name, elementRef, this.directive);\n return new UpgradeNg1ComponentAdapter(\n helper, scope, self.template, self.inputs, self.outputs, self.propertyOutputs,\n self.checkProperties, self.propertyMap);\n }\n ],\n ngOnInit: function() { /* needs to be here for ng2 to properly detect it */ },\n ngOnChanges: function() { /* needs to be here for ng2 to properly detect it */ },\n ngDoCheck: function() { /* needs to be here for ng2 to properly detect it */ },\n ngOnDestroy: function() { /* needs to be here for ng2 to properly detect it */ },\n });\n }\n/**\n * @return {?}\n */\nextractBindings() {\n const /** @type {?} */ btcIsObject = typeof /** @type {?} */(( this.directive)).bindToController === 'object';\n if (btcIsObject && Object.keys( /** @type {?} */((this.directive)).scope).length) {\n throw new Error(\n `Binding definitions on scope and controller at the same time are not supported.`);\n }\n\n const /** @type {?} */ context = (btcIsObject) ? /** @type {?} */(( this.directive)).bindToController : /** @type {?} */(( this.directive)).scope;\n\n if (typeof context == 'object') {\n Object.keys(context).forEach(propName => {\n const /** @type {?} */ definition = context[propName];\n const /** @type {?} */ bindingType = definition.charAt(0);\n const /** @type {?} */ bindingOptions = definition.charAt(1);\n const /** @type {?} */ attrName = definition.substring(bindingOptions === '?' ? 2 : 1) || propName;\n\n // QUESTION: What about `=*`? Ignore? Throw? Support?\n\n const /** @type {?} */ inputName = `input_${attrName}`;\n const /** @type {?} */ inputNameRename = `${inputName}: ${attrName}`;\n const /** @type {?} */ outputName = `output_${attrName}`;\n const /** @type {?} */ outputNameRename = `${outputName}: ${attrName}`;\n const /** @type {?} */ outputNameRenameChange = `${outputNameRename}Change`;\n\n switch (bindingType) {\n case '@':\n case '<':\n this.inputs.push(inputName);\n this.inputsRename.push(inputNameRename);\n this.propertyMap[inputName] = propName;\n break;\n case '=':\n this.inputs.push(inputName);\n this.inputsRename.push(inputNameRename);\n this.propertyMap[inputName] = propName;\n\n this.outputs.push(outputName);\n this.outputsRename.push(outputNameRenameChange);\n this.propertyMap[outputName] = propName;\n\n this.checkProperties.push(propName);\n this.propertyOutputs.push(outputName);\n break;\n case '&':\n this.outputs.push(outputName);\n this.outputsRename.push(outputNameRename);\n this.propertyMap[outputName] = propName;\n break;\n default:\n let /** @type {?} */ json = JSON.stringify(context);\n throw new Error(\n `Unexpected mapping '${bindingType}' in '${json}' in '${this.name}' directive.`);\n }\n });\n }\n }\n/**\n * Upgrade ng1 components into Angular.\n * @param {?} exportedComponents\n * @param {?} $injector\n * @return {?}\n */\nstatic resolve(\n exportedComponents: {[name: string]: UpgradeNg1ComponentAdapterBuilder},\n $injector: angular.IInjectorService): Promise {\n const /** @type {?} */ promises = Object.keys(exportedComponents).map(name => {\n const /** @type {?} */ exportedComponent = exportedComponents[name];\n exportedComponent.directive = UpgradeHelper.getDirective($injector, name);\n exportedComponent.extractBindings();\n\n return Promise\n .resolve(UpgradeHelper.getTemplate($injector, exportedComponent.directive, true))\n .then(template => exportedComponent.template = template);\n });\n\n return Promise.all(promises);\n }\n}\n\nfunction UpgradeNg1ComponentAdapterBuilder_tsickle_Closure_declarations() {\n/** @type {?} */\nUpgradeNg1ComponentAdapterBuilder.prototype.type;\n/** @type {?} */\nUpgradeNg1ComponentAdapterBuilder.prototype.inputs;\n/** @type {?} */\nUpgradeNg1ComponentAdapterBuilder.prototype.inputsRename;\n/** @type {?} */\nUpgradeNg1ComponentAdapterBuilder.prototype.outputs;\n/** @type {?} */\nUpgradeNg1ComponentAdapterBuilder.prototype.outputsRename;\n/** @type {?} */\nUpgradeNg1ComponentAdapterBuilder.prototype.propertyOutputs;\n/** @type {?} */\nUpgradeNg1ComponentAdapterBuilder.prototype.checkProperties;\n/** @type {?} */\nUpgradeNg1ComponentAdapterBuilder.prototype.propertyMap;\n/** @type {?} */\nUpgradeNg1ComponentAdapterBuilder.prototype.directive;\n/** @type {?} */\nUpgradeNg1ComponentAdapterBuilder.prototype.template;\n/** @type {?} */\nUpgradeNg1ComponentAdapterBuilder.prototype.name;\n}\n\nclass UpgradeNg1ComponentAdapter implements OnInit, OnChanges, DoCheck {\nprivate controllerInstance: IControllerInstance|null = null;\n destinationObj: IBindingDestination|null = null;\n checkLastValues: any[] = [];\nprivate directive: angular.IDirective;\n element: Element;\n $element: any = null;\n componentScope: angular.IScope;\n/**\n * @param {?} helper\n * @param {?} scope\n * @param {?} template\n * @param {?} inputs\n * @param {?} outputs\n * @param {?} propOuts\n * @param {?} checkProperties\n * @param {?} propertyMap\n */\nconstructor(\nprivate helper: UpgradeHelper, scope: angular.IScope,\nprivate template: string,\nprivate inputs: string[],\nprivate outputs: string[],\nprivate propOuts: string[],\nprivate checkProperties: string[],\nprivate propertyMap: {[key: string]: string}) {\n this.directive = helper.directive;\n this.element = helper.element;\n this.$element = helper.$element;\n this.componentScope = scope.$new(!!this.directive.scope);\n\n const controllerType = this.directive.controller;\n\n if (this.directive.bindToController && controllerType) {\n this.controllerInstance = this.helper.buildController(controllerType, this.componentScope);\n this.destinationObj = this.controllerInstance;\n } else {\n this.destinationObj = this.componentScope;\n }\n\n for (let i = 0; i < inputs.length; i++) {\n (this as any)[inputs[i]] = null;\n }\n for (let j = 0; j < outputs.length; j++) {\n const emitter = (this as any)[outputs[j]] = new EventEmitter();\n this.setComponentProperty(\n outputs[j], (emitter => (value: any) => emitter.emit(value))(emitter));\n }\n for (let k = 0; k < propOuts.length; k++) {\n this.checkLastValues.push(INITIAL_VALUE);\n }\n }\n/**\n * @return {?}\n */\nngOnInit() {\n // Collect contents, insert and compile template\n const /** @type {?} */ attachChildNodes: angular.ILinkFn|undefined = this.helper.prepareTransclusion();\n const /** @type {?} */ linkFn = this.helper.compileTemplate(this.template);\n\n // Instantiate controller (if not already done so)\n const /** @type {?} */ controllerType = this.directive.controller;\n const /** @type {?} */ bindToController = this.directive.bindToController;\n if (controllerType && !bindToController) {\n this.controllerInstance = this.helper.buildController(controllerType, this.componentScope);\n }\n\n // Require other controllers\n const /** @type {?} */ requiredControllers =\n this.helper.resolveAndBindRequiredControllers(this.controllerInstance);\n\n // Hook: $onInit\n if (this.controllerInstance && isFunction(this.controllerInstance.$onInit)) {\n this.controllerInstance.$onInit();\n }\n\n // Linking\n const /** @type {?} */ link = this.directive.link;\n const /** @type {?} */ preLink = (typeof link == 'object') && ( /** @type {?} */((link as angular.IDirectivePrePost))).pre;\n const /** @type {?} */ postLink = (typeof link == 'object') ? ( /** @type {?} */((link as angular.IDirectivePrePost))).post : link;\n const /** @type {?} */ attrs: angular.IAttributes = NOT_SUPPORTED;\n const /** @type {?} */ transcludeFn: angular.ITranscludeFunction = NOT_SUPPORTED;\n if (preLink) {\n preLink(this.componentScope, this.$element, attrs, requiredControllers, transcludeFn);\n }\n\n linkFn(this.componentScope, /** @type {?} */(( null)), {parentBoundTranscludeFn: attachChildNodes});\n\n if (postLink) {\n postLink(this.componentScope, this.$element, attrs, requiredControllers, transcludeFn);\n }\n\n // Hook: $postLink\n if (this.controllerInstance && isFunction(this.controllerInstance.$postLink)) {\n this.controllerInstance.$postLink();\n }\n }\n/**\n * @param {?} changes\n * @return {?}\n */\nngOnChanges(changes: SimpleChanges) {\n const /** @type {?} */ ng1Changes: any = {};\n Object.keys(changes).forEach(name => {\n const /** @type {?} */ change: SimpleChange = changes[name];\n this.setComponentProperty(name, change.currentValue);\n ng1Changes[this.propertyMap[name]] = change;\n });\n\n if (isFunction( /** @type {?} */((this.destinationObj)).$onChanges)) { /** @type {?} */(( /** @type {?} */((\n this.destinationObj)).$onChanges))(ng1Changes);\n }\n }\n/**\n * @return {?}\n */\nngDoCheck() {\n const /** @type {?} */ destinationObj = this.destinationObj;\n const /** @type {?} */ lastValues = this.checkLastValues;\n const /** @type {?} */ checkProperties = this.checkProperties;\n const /** @type {?} */ propOuts = this.propOuts;\n checkProperties.forEach((propName, i) => {\n const /** @type {?} */ value = /** @type {?} */(( destinationObj))[propName];\n const /** @type {?} */ last = lastValues[i];\n if (!strictEquals(last, value)) {\n const /** @type {?} */ eventEmitter: EventEmitter = ( /** @type {?} */((this as any)))[propOuts[i]];\n eventEmitter.emit(lastValues[i] = value);\n }\n });\n\n if (this.controllerInstance && isFunction(this.controllerInstance.$doCheck)) {\n this.controllerInstance.$doCheck();\n }\n }\n/**\n * @return {?}\n */\nngOnDestroy() {\n if (this.controllerInstance && isFunction(this.controllerInstance.$onDestroy)) {\n this.controllerInstance.$onDestroy();\n }\n }\n/**\n * @param {?} name\n * @param {?} value\n * @return {?}\n */\nsetComponentProperty(name: string, value: any) { /** @type {?} */((\n this.destinationObj))[this.propertyMap[name]] = value;\n }\n}\n\nfunction UpgradeNg1ComponentAdapter_tsickle_Closure_declarations() {\n/** @type {?} */\nUpgradeNg1ComponentAdapter.prototype.controllerInstance;\n/** @type {?} */\nUpgradeNg1ComponentAdapter.prototype.destinationObj;\n/** @type {?} */\nUpgradeNg1ComponentAdapter.prototype.checkLastValues;\n/** @type {?} */\nUpgradeNg1ComponentAdapter.prototype.directive;\n/** @type {?} */\nUpgradeNg1ComponentAdapter.prototype.element;\n/** @type {?} */\nUpgradeNg1ComponentAdapter.prototype.$element;\n/** @type {?} */\nUpgradeNg1ComponentAdapter.prototype.componentScope;\n/** @type {?} */\nUpgradeNg1ComponentAdapter.prototype.helper;\n/** @type {?} */\nUpgradeNg1ComponentAdapter.prototype.template;\n/** @type {?} */\nUpgradeNg1ComponentAdapter.prototype.inputs;\n/** @type {?} */\nUpgradeNg1ComponentAdapter.prototype.outputs;\n/** @type {?} */\nUpgradeNg1ComponentAdapter.prototype.propOuts;\n/** @type {?} */\nUpgradeNg1ComponentAdapter.prototype.checkProperties;\n/** @type {?} */\nUpgradeNg1ComponentAdapter.prototype.propertyMap;\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 {ElementRef, Injector, SimpleChanges} from '@angular/core';\n\nimport * as angular from './angular1';\nimport {$COMPILE, $CONTROLLER, $HTTP_BACKEND, $INJECTOR, $TEMPLATE_CACHE} from './constants';\nimport {controllerKey, directiveNormalize, isFunction} from './util';\n\n\n// Constants\nconst /** @type {?} */ REQUIRE_PREFIX_RE = /^(\\^\\^?)?(\\?)?(\\^\\^?)?/;\n\n// Interfaces\nexport interface IBindingDestination {\n [key: string]: any;\n $onChanges?: (changes: SimpleChanges) => void;\n}\n\nexport interface IControllerInstance extends IBindingDestination {\n $doCheck?: () => void;\n $onDestroy?: () => void;\n $onInit?: () => void;\n $postLink?: () => void;\n}\nexport class UpgradeHelper {\npublic readonly $injector: angular.IInjectorService;\npublic readonly element: Element;\npublic readonly $element: angular.IAugmentedJQuery;\npublic readonly directive: angular.IDirective;\nprivate readonly $compile: angular.ICompileService;\nprivate readonly $controller: angular.IControllerService;\n/**\n * @param {?} injector\n * @param {?} name\n * @param {?} elementRef\n * @param {?=} directive\n */\nconstructor(\nprivate injector: Injector,\nprivate name: string, elementRef: ElementRef,\n directive?: angular.IDirective) {\n this.$injector = injector.get($INJECTOR);\n this.$compile = this.$injector.get($COMPILE);\n this.$controller = this.$injector.get($CONTROLLER);\n\n this.element = elementRef.nativeElement;\n this.$element = angular.element(this.element);\n\n this.directive = directive || UpgradeHelper.getDirective(this.$injector, name);\n }\n/**\n * @param {?} $injector\n * @param {?} name\n * @return {?}\n */\nstatic getDirective($injector: angular.IInjectorService, name: string): angular.IDirective {\n const /** @type {?} */ directives: angular.IDirective[] = $injector.get(name + 'Directive');\n if (directives.length > 1) {\n throw new Error(`Only support single directive definition for: ${name}`);\n }\n\n const /** @type {?} */ directive = directives[0];\n\n // AngularJS will transform `link: xyz` to `compile: () => xyz`. So we can only tell there was a\n // user-defined `compile` if there is no `link`. In other cases, we will just ignore `compile`.\n if (directive.compile && !directive.link) notSupported(name, 'compile');\n if (directive.replace) notSupported(name, 'replace');\n if (directive.terminal) notSupported(name, 'terminal');\n\n return directive;\n }\n/**\n * @param {?} $injector\n * @param {?} directive\n * @param {?=} fetchRemoteTemplate\n * @return {?}\n */\nstatic getTemplate(\n $injector: angular.IInjectorService, directive: angular.IDirective,\n fetchRemoteTemplate = false): string|Promise {\n if (directive.template !== undefined) {\n return getOrCall(directive.template);\n } else if (directive.templateUrl) {\n const /** @type {?} */ $templateCache = /** @type {?} */(( $injector.get($TEMPLATE_CACHE) as angular.ITemplateCacheService));\n const /** @type {?} */ url = getOrCall(directive.templateUrl);\n const /** @type {?} */ template = $templateCache.get(url);\n\n if (template !== undefined) {\n return template;\n } else if (!fetchRemoteTemplate) {\n throw new Error('loading directive templates asynchronously is not supported');\n }\n\n return new Promise((resolve, reject) => {\n const /** @type {?} */ $httpBackend = /** @type {?} */(( $injector.get($HTTP_BACKEND) as angular.IHttpBackendService));\n $httpBackend('GET', url, null, (status: number, response: string) => {\n if (status === 200) {\n resolve($templateCache.put(url, response));\n } else {\n reject(`GET component template from '${url}' returned '${status}: ${response}'`);\n }\n });\n });\n } else {\n throw new Error(`Directive '${directive.name}' is not a component, it is missing template.`);\n }\n }\n/**\n * @param {?} controllerType\n * @param {?} $scope\n * @return {?}\n */\nbuildController(controllerType: angular.IController, $scope: angular.IScope) {\n // TODO: Document that we do not pre-assign bindings on the controller instance.\n // Quoted properties below so that this code can be optimized with Closure Compiler.\n const /** @type {?} */ locals = {'$scope': $scope, '$element': this.$element};\n const /** @type {?} */ controller = this.$controller(controllerType, locals, null, this.directive.controllerAs); /** @type {?} */((\n\n this.$element.data))(controllerKey( /** @type {?} */((this.directive.name))), controller);\n\n return controller;\n }\n/**\n * @param {?=} template\n * @return {?}\n */\ncompileTemplate(template?: string): angular.ILinkFn {\n if (template === undefined) {\n template = /** @type {?} */(( UpgradeHelper.getTemplate(this.$injector, this.directive) as string));\n }\n\n return this.compileHtml(template);\n }\n/**\n * @return {?}\n */\nprepareTransclusion(): angular.ILinkFn|undefined {\n const /** @type {?} */ transclude = this.directive.transclude;\n const /** @type {?} */ contentChildNodes = this.extractChildNodes();\n let /** @type {?} */ $template = contentChildNodes;\n let /** @type {?} */ attachChildrenFn: angular.ILinkFn|undefined = (scope, cloneAttach) => /** @type {?} */((\n cloneAttach))($template, scope);\n\n if (transclude) {\n const /** @type {?} */ slots = Object.create(null);\n\n if (typeof transclude === 'object') {\n $template = [];\n\n const /** @type {?} */ slotMap = Object.create(null);\n const /** @type {?} */ filledSlots = Object.create(null);\n\n // Parse the element selectors.\n Object.keys(transclude).forEach(slotName => {\n let /** @type {?} */ selector = transclude[slotName];\n const /** @type {?} */ optional = selector.charAt(0) === '?';\n selector = optional ? selector.substring(1) : selector;\n\n slotMap[selector] = slotName;\n slots[slotName] = null; // `null`: Defined but not yet filled.\n filledSlots[slotName] = optional; // Consider optional slots as filled.\n });\n\n // Add the matching elements into their slot.\n contentChildNodes.forEach(node => {\n const /** @type {?} */ slotName = slotMap[directiveNormalize(node.nodeName.toLowerCase())];\n if (slotName) {\n filledSlots[slotName] = true;\n slots[slotName] = slots[slotName] || [];\n slots[slotName].push(node);\n } else {\n $template.push(node);\n }\n });\n\n // Check for required slots that were not filled.\n Object.keys(filledSlots).forEach(slotName => {\n if (!filledSlots[slotName]) {\n throw new Error(`Required transclusion slot '${slotName}' on directive: ${this.name}`);\n }\n });\n\n Object.keys(slots).filter(slotName => slots[slotName]).forEach(slotName => {\n const /** @type {?} */ nodes = slots[slotName];\n slots[slotName] = (scope: angular.IScope, cloneAttach: angular.ICloneAttachFunction) => /** @type {?} */((\n cloneAttach))(nodes, scope);\n });\n }\n\n // Attach `$$slots` to default slot transclude fn.\n attachChildrenFn.$$slots = slots;\n\n // AngularJS v1.6+ ignores empty or whitespace-only transcluded text nodes. But Angular\n // removes all text content after the first interpolation and updates it later, after\n // evaluating the expressions. This would result in AngularJS failing to recognize text\n // nodes that start with an interpolation as transcluded content and use the fallback\n // content instead.\n // To avoid this issue, we add a\n // [zero-width non-joiner character](https://en.wikipedia.org/wiki/Zero-width_non-joiner)\n // to empty text nodes (which can only be a result of Angular removing their initial content).\n // NOTE: Transcluded text content that starts with whitespace followed by an interpolation\n // will still fail to be detected by AngularJS v1.6+\n $template.forEach(node => {\n if (node.nodeType === Node.TEXT_NODE && !node.nodeValue) {\n node.nodeValue = '\\u200C';\n }\n });\n }\n\n return attachChildrenFn;\n }\n/**\n * @param {?} controllerInstance\n * @return {?}\n */\nresolveAndBindRequiredControllers(controllerInstance: IControllerInstance|null) {\n const /** @type {?} */ directiveRequire = this.getDirectiveRequire();\n const /** @type {?} */ requiredControllers = this.resolveRequire(directiveRequire);\n\n if (controllerInstance && this.directive.bindToController && isMap(directiveRequire)) {\n const /** @type {?} */ requiredControllersMap = /** @type {?} */(( requiredControllers as{[key: string]: IControllerInstance}));\n Object.keys(requiredControllersMap).forEach(key => {\n controllerInstance[key] = requiredControllersMap[key];\n });\n }\n\n return requiredControllers;\n }\n/**\n * @param {?} html\n * @return {?}\n */\nprivate compileHtml(html: string): angular.ILinkFn {\n this.element.innerHTML = html;\n return this.$compile(this.element.childNodes);\n }\n/**\n * @return {?}\n */\nprivate extractChildNodes(): Node[] {\n const /** @type {?} */ childNodes: Node[] = [];\n let /** @type {?} */ childNode: Node|null;\n\n while (childNode = this.element.firstChild) {\n this.element.removeChild(childNode);\n childNodes.push(childNode);\n }\n\n return childNodes;\n }\n/**\n * @return {?}\n */\nprivate getDirectiveRequire(): angular.DirectiveRequireProperty {\n const /** @type {?} */ require = this.directive.require || /** @type {?} */(( (this.directive.controller && this.directive.name)));\n\n if (isMap(require)) {\n Object.keys(require).forEach(key => {\n const /** @type {?} */ value = require[key];\n const /** @type {?} */ match = /** @type {?} */(( value.match(REQUIRE_PREFIX_RE)));\n const /** @type {?} */ name = value.substring(match[0].length);\n\n if (!name) {\n require[key] = match[0] + key;\n }\n });\n }\n\n return require;\n }\n/**\n * @param {?} require\n * @param {?=} controllerInstance\n * @return {?}\n */\nprivate resolveRequire(require: angular.DirectiveRequireProperty, controllerInstance?: any):\n angular.SingleOrListOrMap|null {\n if (!require) {\n return null;\n } else if (Array.isArray(require)) {\n return require.map(req => this.resolveRequire(req));\n } else if (typeof require === 'object') {\n const /** @type {?} */ value: {[key: string]: IControllerInstance} = {};\n Object.keys(require).forEach(key => value[key] = /** @type {?} */(( this.resolveRequire(require[key]))));\n return value;\n } else if (typeof require === 'string') {\n const /** @type {?} */ match = /** @type {?} */(( require.match(REQUIRE_PREFIX_RE)));\n const /** @type {?} */ inheritType = match[1] || match[3];\n\n const /** @type {?} */ name = require.substring(match[0].length);\n const /** @type {?} */ isOptional = !!match[2];\n const /** @type {?} */ searchParents = !!inheritType;\n const /** @type {?} */ startOnParent = inheritType === '^^';\n\n const /** @type {?} */ ctrlKey = controllerKey(name);\n const /** @type {?} */ elem = startOnParent ? /** @type {?} */(( this.$element.parent))() : this.$element;\n const /** @type {?} */ value = searchParents ? /** @type {?} */(( elem.inheritedData))(ctrlKey) : /** @type {?} */(( elem.data))(ctrlKey);\n\n if (!value && !isOptional) {\n throw new Error(\n `Unable to find required '${require}' in upgraded directive '${this.name}'.`);\n }\n\n return value;\n } else {\n throw new Error(\n `Unrecognized 'require' syntax on upgraded directive '${this.name}': ${require}`);\n }\n }\n}\n\nfunction UpgradeHelper_tsickle_Closure_declarations() {\n/** @type {?} */\nUpgradeHelper.prototype.$injector;\n/** @type {?} */\nUpgradeHelper.prototype.element;\n/** @type {?} */\nUpgradeHelper.prototype.$element;\n/** @type {?} */\nUpgradeHelper.prototype.directive;\n/** @type {?} */\nUpgradeHelper.prototype.$compile;\n/** @type {?} */\nUpgradeHelper.prototype.$controller;\n/** @type {?} */\nUpgradeHelper.prototype.injector;\n/** @type {?} */\nUpgradeHelper.prototype.name;\n}\n\n/**\n * @template T\n * @param {?} property\n * @return {?}\n */\nfunction getOrCall(property: T | Function): T {\n return isFunction(property) ? property() : property;\n}\n/**\n * @template T\n * @param {?} value\n * @return {?}\n */\nfunction isMap(value: angular.SingleOrListOrMap): value is {[key: string]: T} {\n return value && !Array.isArray(value) && typeof value === 'object';\n}\n/**\n * @param {?} name\n * @param {?} feature\n * @return {?}\n */\nfunction notSupported(name: string, feature: string) {\n throw new Error(`Upgraded directive '${name}' contains unsupported feature: '${feature}'.`);\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 {Injector} from '@angular/core';\nimport {INJECTOR_KEY} from './constants';\n/**\n * \\@whatItDoes \n * \n * *Part of the [upgrade/static](api?query=upgrade%2Fstatic)\n * library for hybrid upgrade apps that support AoT compilation*\n * \n * Allow an Angular service to be accessible from AngularJS.\n * \n * \\@howToUse \n * \n * First ensure that the service to be downgraded is provided in an {\\@link NgModule}\n * that will be part of the upgrade application. For example, let's assume we have\n * defined `HeroesService`\n * \n * {\\@example upgrade/static/ts/module.ts region=\"ng2-heroes-service\"}\n * \n * and that we have included this in our upgrade app {\\@link NgModule}\n * \n * {\\@example upgrade/static/ts/module.ts region=\"ng2-module\"}\n * \n * Now we can register the `downgradeInjectable` factory function for the service\n * on an AngularJS module.\n * \n * {\\@example upgrade/static/ts/module.ts region=\"downgrade-ng2-heroes-service\"}\n * \n * Inside an AngularJS component's controller we can get hold of the\n * downgraded service via the name we gave when downgrading.\n * \n * {\\@example upgrade/static/ts/module.ts region=\"example-app\"}\n * \n * \\@description \n * \n * Takes a `token` that identifies a service provided from Angular.\n * \n * Returns a [factory function](https://docs.angularjs.org/guide/di) that can be\n * used to register the service on an AngularJS module.\n * \n * The factory function provides access to the Angular service that\n * is identified by the `token` parameter.\n * \n * \\@experimental\n * @param {?} token\n * @return {?}\n */\nexport function downgradeInjectable(token: any): Function {\n const /** @type {?} */ factory = function(i: Injector) { return i.get(token); };\n ( /** @type {?} */((factory as any)))['$inject'] = [INJECTOR_KEY];\n\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\n\nimport {ComponentFactory, ComponentFactoryResolver, Injector, Type} from '@angular/core';\n\nimport * as angular from './angular1';\nimport {$COMPILE, $INJECTOR, $PARSE, INJECTOR_KEY, REQUIRE_INJECTOR, REQUIRE_NG_MODEL} from './constants';\nimport {DowngradeComponentAdapter} from './downgrade_component_adapter';\nimport {controllerKey, getComponentName} from './util';\n/**\n * \\@whatItDoes \n * \n * *Part of the [upgrade/static](api?query=upgrade%2Fstatic)\n * library for hybrid upgrade apps that support AoT compilation*\n * \n * Allows an Angular component to be used from AngularJS.\n * \n * \\@howToUse \n * \n * Let's assume that you have an Angular component called `ng2Heroes` that needs\n * to be made available in AngularJS templates.\n * \n * {\\@example upgrade/static/ts/module.ts region=\"ng2-heroes\"}\n * \n * We must create an AngularJS [directive](https://docs.angularjs.org/guide/directive)\n * that will make this Angular component available inside AngularJS templates.\n * The `downgradeComponent()` function returns a factory function that we\n * can use to define the AngularJS directive that wraps the \"downgraded\" component.\n * \n * {\\@example upgrade/static/ts/module.ts region=\"ng2-heroes-wrapper\"}\n * \n * \\@description \n * \n * A helper function that returns a factory function to be used for registering an\n * AngularJS wrapper directive for \"downgrading\" an Angular component.\n * \n * The parameter contains information about the Component that is being downgraded:\n * \n * * `component: Type`: The type of the Component that will be downgraded\n * \n * \\@experimental\n * @param {?} info\n * @return {?}\n */\nexport function downgradeComponent(info: {\n component: Type;\n /** @deprecated since v4. This parameter is no longer used */\n inputs?: string[];\n /** @deprecated since v4. This parameter is no longer used */\n outputs?: string[];\n /** @deprecated since v4. This parameter is no longer used */\n selectors?: string[];\n}): any /* angular.IInjectable */ {\n const /** @type {?} */ directiveFactory:\n angular.IAnnotatedFunction = function(\n $compile: angular.ICompileService,\n $injector: angular.IInjectorService,\n $parse: angular.IParseService): angular.IDirective {\n\n return {\n restrict: 'E',\n terminal: true,\n require: [REQUIRE_INJECTOR, REQUIRE_NG_MODEL],\n link: (scope: angular.IScope, element: angular.IAugmentedJQuery, attrs: angular.IAttributes,\n required: any[]) => {\n // We might have to compile the contents asynchronously, because this might have been\n // triggered by `UpgradeNg1ComponentAdapterBuilder`, before the Angular templates have\n // been compiled.\n\n const /** @type {?} */ parentInjector: Injector|ParentInjectorPromise =\n required[0] || $injector.get(INJECTOR_KEY);\n const /** @type {?} */ ngModel: angular.INgModelController = required[1];\n\n const /** @type {?} */ downgradeFn = (injector: Injector) => {\n const /** @type {?} */ componentFactoryResolver: ComponentFactoryResolver =\n injector.get(ComponentFactoryResolver);\n const /** @type {?} */ componentFactory: ComponentFactory = /** @type {?} */((\n componentFactoryResolver.resolveComponentFactory(info.component)));\n\n if (!componentFactory) {\n throw new Error('Expecting ComponentFactory for: ' + getComponentName(info.component));\n }\n\n const /** @type {?} */ injectorPromise = new ParentInjectorPromise(element);\n const /** @type {?} */ facade = new DowngradeComponentAdapter(\n element, attrs, scope, ngModel, injector, $injector, $compile, $parse,\n componentFactory);\n\n const /** @type {?} */ projectableNodes = facade.compileContents();\n facade.createComponent(projectableNodes);\n facade.setupInputs();\n facade.setupOutputs();\n facade.registerCleanup();\n\n injectorPromise.resolve(facade.getInjector());\n };\n\n if (parentInjector instanceof ParentInjectorPromise) {\n parentInjector.then(downgradeFn);\n } else {\n downgradeFn(parentInjector);\n }\n }\n };\n };\n\n // bracket-notation because of closure - see #14441\n directiveFactory['$inject'] = [$COMPILE, $INJECTOR, $PARSE];\n return directiveFactory;\n}\n/**\n * Synchronous promise-like object to wrap parent injectors,\n * to preserve the synchronous nature of Angular 1's $compile.\n */\nclass ParentInjectorPromise {\nprivate injector: Injector;\nprivate injectorKey: string = controllerKey(INJECTOR_KEY);\nprivate callbacks: ((injector: Injector) => any)[] = [];\n/**\n * @param {?} element\n */\nconstructor(private element: angular.IAugmentedJQuery) {\n // Store the promise on the element.\n element.data !(this.injectorKey, this);\n }\n/**\n * @param {?} callback\n * @return {?}\n */\nthen(callback: (injector: Injector) => any) {\n if (this.injector) {\n callback(this.injector);\n } else {\n this.callbacks.push(callback);\n }\n }\n/**\n * @param {?} injector\n * @return {?}\n */\nresolve(injector: Injector) {\n this.injector = injector; /** @type {?} */((\n\n // Store the real injector on the element.\n this.element.data))(this.injectorKey, injector);\n\n // Release the element to prevent memory leaks.\n this.element = /** @type {?} */(( null));\n\n // Run the queued callbacks.\n this.callbacks.forEach(callback => callback(injector));\n this.callbacks.length = 0;\n }\n}\n\nfunction ParentInjectorPromise_tsickle_Closure_declarations() {\n/** @type {?} */\nParentInjectorPromise.prototype.injector;\n/** @type {?} */\nParentInjectorPromise.prototype.injectorKey;\n/** @type {?} */\nParentInjectorPromise.prototype.callbacks;\n/** @type {?} */\nParentInjectorPromise.prototype.element;\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 {ChangeDetectorRef, ComponentFactory, ComponentRef, EventEmitter, Injector, OnChanges, ReflectiveInjector, SimpleChange, SimpleChanges, Type} from '@angular/core';\n\nimport * as angular from './angular1';\nimport {PropertyBinding} from './component_info';\nimport {$SCOPE} from './constants';\nimport {getAttributesAsArray, getComponentName, hookupNgModel, strictEquals} from './util';\n\nconst /** @type {?} */ INITIAL_VALUE = {\n __UNINITIALIZED__: true\n};\nexport class DowngradeComponentAdapter {\nprivate inputChangeCount: number = 0;\nprivate inputChanges: SimpleChanges|null = null;\nprivate componentScope: angular.IScope;\nprivate componentRef: ComponentRef|null = null;\nprivate component: any = null;\nprivate changeDetector: ChangeDetectorRef|null = null;\n/**\n * @param {?} element\n * @param {?} attrs\n * @param {?} scope\n * @param {?} ngModel\n * @param {?} parentInjector\n * @param {?} $injector\n * @param {?} $compile\n * @param {?} $parse\n * @param {?} componentFactory\n */\nconstructor(\nprivate element: angular.IAugmentedJQuery,\nprivate attrs: angular.IAttributes,\nprivate scope: angular.IScope,\nprivate ngModel: angular.INgModelController,\nprivate parentInjector: Injector,\nprivate $injector: angular.IInjectorService,\nprivate $compile: angular.ICompileService,\nprivate $parse: angular.IParseService,\nprivate componentFactory: ComponentFactory) {\n this.componentScope = scope.$new();\n }\n/**\n * @return {?}\n */\ncompileContents(): Node[][] {\n const /** @type {?} */ compiledProjectableNodes: Node[][] = [];\n const /** @type {?} */ projectableNodes: Node[][] = this.groupProjectableNodes();\n const /** @type {?} */ linkFns = projectableNodes.map(nodes => this.$compile(nodes)); /** @type {?} */((\n\n this.element.empty))();\n\n linkFns.forEach(linkFn => {\n linkFn(this.scope, (clone: Node[]) => {\n compiledProjectableNodes.push(clone); /** @type {?} */((\n this.element.append))(clone);\n });\n });\n\n return compiledProjectableNodes;\n }\n/**\n * @param {?} projectableNodes\n * @return {?}\n */\ncreateComponent(projectableNodes: Node[][]) {\n const /** @type {?} */ childInjector = ReflectiveInjector.resolveAndCreate(\n [{provide: $SCOPE, useValue: this.componentScope}], this.parentInjector);\n\n this.componentRef =\n this.componentFactory.create(childInjector, projectableNodes, this.element[0]);\n this.changeDetector = this.componentRef.changeDetectorRef;\n this.component = this.componentRef.instance;\n\n hookupNgModel(this.ngModel, this.component);\n }\n/**\n * @return {?}\n */\nsetupInputs(): void {\n const /** @type {?} */ attrs = this.attrs;\n const /** @type {?} */ inputs = this.componentFactory.inputs || [];\n for (let /** @type {?} */ i = 0; i < inputs.length; i++) {\n const /** @type {?} */ input = new PropertyBinding(inputs[i].propName, inputs[i].templateName);\n let /** @type {?} */ expr: string|null = null;\n\n if (attrs.hasOwnProperty(input.attr)) {\n const /** @type {?} */ observeFn = (prop => {\n let /** @type {?} */ prevValue = INITIAL_VALUE;\n return (currValue: any) => {\n // Initially, both `$observe()` and `$watch()` will call this function.\n if (!strictEquals(prevValue, currValue)) {\n if (prevValue === INITIAL_VALUE) {\n prevValue = currValue;\n }\n\n this.updateInput(prop, prevValue, currValue);\n prevValue = currValue;\n }\n };\n })(input.prop);\n attrs.$observe(input.attr, observeFn);\n\n // Use `$watch()` (in addition to `$observe()`) in order to initialize the input in time\n // for `ngOnChanges()`. This is necessary if we are already in a `$digest`, which means that\n // `ngOnChanges()` (which is called by a watcher) will run before the `$observe()` callback.\n let /** @type {?} */ unwatch: Function|null = this.componentScope.$watch(() => { /** @type {?} */((\n unwatch))();\n unwatch = null;\n observeFn(attrs[input.attr]);\n });\n\n } else if (attrs.hasOwnProperty(input.bindAttr)) {\n expr = attrs[input.bindAttr];\n } else if (attrs.hasOwnProperty(input.bracketAttr)) {\n expr = attrs[input.bracketAttr];\n } else if (attrs.hasOwnProperty(input.bindonAttr)) {\n expr = attrs[input.bindonAttr];\n } else if (attrs.hasOwnProperty(input.bracketParenAttr)) {\n expr = attrs[input.bracketParenAttr];\n }\n if (expr != null) {\n const /** @type {?} */ watchFn =\n (prop => (currValue: any, prevValue: any) =>\n this.updateInput(prop, prevValue, currValue))(input.prop);\n this.componentScope.$watch(expr, watchFn);\n }\n }\n\n const /** @type {?} */ prototype = this.componentFactory.componentType.prototype;\n if (prototype && ( /** @type {?} */((prototype))).ngOnChanges) {\n // Detect: OnChanges interface\n this.inputChanges = {};\n this.componentScope.$watch(() => this.inputChangeCount, () => {\n const /** @type {?} */ inputChanges = this.inputChanges;\n this.inputChanges = {};\n ( /** @type {?} */((this.component))).ngOnChanges( /** @type {?} */((inputChanges)));\n });\n }\n this.componentScope.$watch(() => this.changeDetector && this.changeDetector.detectChanges());\n }\n/**\n * @return {?}\n */\nsetupOutputs() {\n const /** @type {?} */ attrs = this.attrs;\n const /** @type {?} */ outputs = this.componentFactory.outputs || [];\n for (let /** @type {?} */ j = 0; j < outputs.length; j++) {\n const /** @type {?} */ output = new PropertyBinding(outputs[j].propName, outputs[j].templateName);\n let /** @type {?} */ expr: string|null = null;\n let /** @type {?} */ assignExpr = false;\n\n const /** @type {?} */ bindonAttr = output.bindonAttr.substring(0, output.bindonAttr.length - 6);\n const /** @type {?} */ bracketParenAttr =\n `[(${output.bracketParenAttr.substring(2, output.bracketParenAttr.length - 8)})]`;\n\n if (attrs.hasOwnProperty(output.onAttr)) {\n expr = attrs[output.onAttr];\n } else if (attrs.hasOwnProperty(output.parenAttr)) {\n expr = attrs[output.parenAttr];\n } else if (attrs.hasOwnProperty(bindonAttr)) {\n expr = attrs[bindonAttr];\n assignExpr = true;\n } else if (attrs.hasOwnProperty(bracketParenAttr)) {\n expr = attrs[bracketParenAttr];\n assignExpr = true;\n }\n\n if (expr != null && assignExpr != null) {\n const /** @type {?} */ getter = this.$parse(expr);\n const /** @type {?} */ setter = getter.assign;\n if (assignExpr && !setter) {\n throw new Error(`Expression '${expr}' is not assignable!`);\n }\n const /** @type {?} */ emitter = /** @type {?} */(( this.component[output.prop] as EventEmitter));\n if (emitter) {\n emitter.subscribe({\n next: assignExpr ? (v: any) => /** @type {?} */(( setter))(this.scope, v) :\n (v: any) => getter(this.scope, {'$event': v})\n });\n } else {\n throw new Error(\n `Missing emitter '${output.prop}' on component '${getComponentName(this.componentFactory.componentType)}'!`);\n }\n }\n }\n }\n/**\n * @return {?}\n */\nregisterCleanup() { /** @type {?} */((\n this.element.bind))('$destroy', () => {\n this.componentScope.$destroy(); /** @type {?} */((\n this.componentRef)).destroy();\n });\n }\n/**\n * @return {?}\n */\ngetInjector(): Injector { return /** @type {?} */(( this.componentRef)) && /** @type {?} */(( this.componentRef)).injector; }\n/**\n * @param {?} prop\n * @param {?} prevValue\n * @param {?} currValue\n * @return {?}\n */\nprivate updateInput(prop: string, prevValue: any, currValue: any) {\n if (this.inputChanges) {\n this.inputChangeCount++;\n this.inputChanges[prop] = new SimpleChange(prevValue, currValue, prevValue === currValue);\n }\n\n this.component[prop] = currValue;\n }\n/**\n * @return {?}\n */\ngroupProjectableNodes() {\n let /** @type {?} */ ngContentSelectors = this.componentFactory.ngContentSelectors;\n return groupNodesBySelector(ngContentSelectors, /** @type {?} */(( this.element.contents))());\n }\n}\n\nfunction DowngradeComponentAdapter_tsickle_Closure_declarations() {\n/** @type {?} */\nDowngradeComponentAdapter.prototype.inputChangeCount;\n/** @type {?} */\nDowngradeComponentAdapter.prototype.inputChanges;\n/** @type {?} */\nDowngradeComponentAdapter.prototype.componentScope;\n/** @type {?} */\nDowngradeComponentAdapter.prototype.componentRef;\n/** @type {?} */\nDowngradeComponentAdapter.prototype.component;\n/** @type {?} */\nDowngradeComponentAdapter.prototype.changeDetector;\n/** @type {?} */\nDowngradeComponentAdapter.prototype.element;\n/** @type {?} */\nDowngradeComponentAdapter.prototype.attrs;\n/** @type {?} */\nDowngradeComponentAdapter.prototype.scope;\n/** @type {?} */\nDowngradeComponentAdapter.prototype.ngModel;\n/** @type {?} */\nDowngradeComponentAdapter.prototype.parentInjector;\n/** @type {?} */\nDowngradeComponentAdapter.prototype.$injector;\n/** @type {?} */\nDowngradeComponentAdapter.prototype.$compile;\n/** @type {?} */\nDowngradeComponentAdapter.prototype.$parse;\n/** @type {?} */\nDowngradeComponentAdapter.prototype.componentFactory;\n}\n\n/**\n * Group a set of DOM nodes into `ngContent` groups, based on the given content selectors.\n * @param {?} ngContentSelectors\n * @param {?} nodes\n * @return {?}\n */\nexport function groupNodesBySelector(ngContentSelectors: string[], nodes: Node[]): Node[][] {\n const /** @type {?} */ projectableNodes: Node[][] = [];\n let /** @type {?} */ wildcardNgContentIndex: number;\n\n for (let /** @type {?} */ i = 0, /** @type {?} */ ii = ngContentSelectors.length; i < ii; ++i) {\n projectableNodes[i] = [];\n }\n\n for (let /** @type {?} */ j = 0, /** @type {?} */ jj = nodes.length; j < jj; ++j) {\n const /** @type {?} */ node = nodes[j];\n const /** @type {?} */ ngContentIndex = findMatchingNgContentIndex(node, ngContentSelectors);\n if (ngContentIndex != null) {\n projectableNodes[ngContentIndex].push(node);\n }\n }\n\n return projectableNodes;\n}\n/**\n * @param {?} element\n * @param {?} ngContentSelectors\n * @return {?}\n */\nfunction findMatchingNgContentIndex(element: any, ngContentSelectors: string[]): number|null {\n const /** @type {?} */ ngContentIndices: number[] = [];\n let /** @type {?} */ wildcardNgContentIndex: number = -1;\n for (let /** @type {?} */ i = 0; i < ngContentSelectors.length; i++) {\n const /** @type {?} */ selector = ngContentSelectors[i];\n if (selector === '*') {\n wildcardNgContentIndex = i;\n } else {\n if (matchesSelector(element, selector)) {\n ngContentIndices.push(i);\n }\n }\n }\n ngContentIndices.sort();\n\n if (wildcardNgContentIndex !== -1) {\n ngContentIndices.push(wildcardNgContentIndex);\n }\n return ngContentIndices.length ? ngContentIndices[0] : null;\n}\n\nlet /** @type {?} */ _matches: (this: any, selector: string) => boolean;\n/**\n * @param {?} el\n * @param {?} selector\n * @return {?}\n */\nfunction matchesSelector(el: any, selector: string): boolean {\n if (!_matches) {\n const /** @type {?} */ elProto = /** @type {?} */(( Element.prototype));\n _matches = elProto.matches || elProto.matchesSelector || elProto.mozMatchesSelector ||\n elProto.msMatchesSelector || elProto.oMatchesSelector || elProto.webkitMatchesSelector;\n }\n return el.nodeType === Node.ELEMENT_NODE ? _matches.call(el, selector) : 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\n\nimport {Type} from '@angular/core';\nimport * as angular from './angular1';\n\nconst /** @type {?} */ DIRECTIVE_PREFIX_REGEXP = /^(?:x|data)[:\\-_]/i;\nconst /** @type {?} */ DIRECTIVE_SPECIAL_CHARS_REGEXP = /[:\\-_]+(.)/g;\n/**\n * @param {?} e\n * @return {?}\n */\nexport function onError(e: any) {\n // TODO: (misko): We seem to not have a stack trace here!\n if (console.error) {\n console.error(e, e.stack);\n } else {\n // tslint:disable-next-line:no-console\n console.log(e, e.stack);\n }\n throw e;\n}\n/**\n * @param {?} name\n * @return {?}\n */\nexport function controllerKey(name: string): string {\n return '$' + name + 'Controller';\n}\n/**\n * @param {?} name\n * @return {?}\n */\nexport function directiveNormalize(name: string): string {\n return name.replace(DIRECTIVE_PREFIX_REGEXP, '')\n .replace(DIRECTIVE_SPECIAL_CHARS_REGEXP, (_, letter) => letter.toUpperCase());\n}\n/**\n * @param {?} node\n * @return {?}\n */\nexport function getAttributesAsArray(node: Node): [string, string][] {\n const /** @type {?} */ attributes = node.attributes;\n let /** @type {?} */ asArray: [string, string][] = /** @type {?} */(( undefined));\n if (attributes) {\n let /** @type {?} */ attrLen = attributes.length;\n asArray = new Array(attrLen);\n for (let /** @type {?} */ i = 0; i < attrLen; i++) {\n asArray[i] = [attributes[i].nodeName, /** @type {?} */(( attributes[i].nodeValue))];\n }\n }\n return asArray || [];\n}\n/**\n * @param {?} component\n * @return {?}\n */\nexport function getComponentName(component: Type): string {\n // Return the name of the component or the first line of its stringified version.\n return ( /** @type {?} */((component as any))).overriddenName || component.name || component.toString().split('\\n')[0];\n}\n/**\n * @param {?} value\n * @return {?}\n */\nexport function isFunction(value: any): value is Function {\n return typeof value === 'function';\n}\nexport class Deferred {\n promise: Promise;\n resolve: (value?: R|PromiseLike) => void;\n reject: (error?: any) => void;\nconstructor() {\n this.promise = new Promise((res, rej) => {\n this.resolve = res;\n this.reject = rej;\n });\n }\n}\n\nfunction Deferred_tsickle_Closure_declarations() {\n/** @type {?} */\nDeferred.prototype.promise;\n/** @type {?} */\nDeferred.prototype.resolve;\n/** @type {?} */\nDeferred.prototype.reject;\n}\n\n/**\n * @param {?} component\n * @return {?} Whether the passed-in component implements the subset of the\n * `ControlValueAccessor` interface needed for AngularJS `ng-model`\n * compatibility.\n */\nfunction supportsNgModel(component: any) {\n return typeof component.writeValue === 'function' &&\n typeof component.registerOnChange === 'function';\n}\n/**\n * Glue the AngularJS `NgModelController` (if it exists) to the component\n * (if it implements the needed subset of the `ControlValueAccessor` interface).\n * @param {?} ngModel\n * @param {?} component\n * @return {?}\n */\nexport function hookupNgModel(ngModel: angular.INgModelController, component: any) {\n if (ngModel && supportsNgModel(component)) {\n ngModel.$render = () => { component.writeValue(ngModel.$viewValue); };\n component.registerOnChange(ngModel.$setViewValue.bind(ngModel));\n }\n}\n/**\n * Test two values for strict equality, accounting for the fact that `NaN !== NaN`.\n * @param {?} val1\n * @param {?} val2\n * @return {?}\n */\nexport function strictEquals(val1: any, val2: any): boolean {\n return val1 === val2 || (val1 !== val1 && val2 !== val2);\n}\n","\n/**\n * A `PropertyBinding` represents a mapping between a property name\n * and an attribute name. It is parsed from a string of the form\n * `\"prop: attr\"`; or simply `\"propAndAttr\" where the property\n * and attribute have the same identifier.\n */\nexport class PropertyBinding {\n bracketAttr: string;\n bracketParenAttr: string;\n parenAttr: string;\n onAttr: string;\n bindAttr: string;\n bindonAttr: string;\n/**\n * @param {?} prop\n * @param {?} attr\n */\nconstructor(public prop: string,\npublic attr: string) { this.parseBinding(); }\n/**\n * @return {?}\n */\nprivate parseBinding() {\n this.bracketAttr = `[${this.attr}]`;\n this.parenAttr = `(${this.attr})`;\n this.bracketParenAttr = `[(${this.attr})]`;\n const /** @type {?} */ capitalAttr = this.attr.charAt(0).toUpperCase() + this.attr.substr(1);\n this.onAttr = `on${capitalAttr}`;\n this.bindAttr = `bind${capitalAttr}`;\n this.bindonAttr = `bindon${capitalAttr}`;\n }\n}\n\nfunction PropertyBinding_tsickle_Closure_declarations() {\n/** @type {?} */\nPropertyBinding.prototype.bracketAttr;\n/** @type {?} */\nPropertyBinding.prototype.bracketParenAttr;\n/** @type {?} */\nPropertyBinding.prototype.parenAttr;\n/** @type {?} */\nPropertyBinding.prototype.onAttr;\n/** @type {?} */\nPropertyBinding.prototype.bindAttr;\n/** @type {?} */\nPropertyBinding.prototype.bindonAttr;\n/** @type {?} */\nPropertyBinding.prototype.prop;\n/** @type {?} */\nPropertyBinding.prototype.attr;\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 */\nexport const $COMPILE = '$compile';\nexport const /** @type {?} */ $CONTROLLER = '$controller';\nexport const /** @type {?} */ $DELEGATE = '$delegate';\nexport const /** @type {?} */ $HTTP_BACKEND = '$httpBackend';\nexport const /** @type {?} */ $INJECTOR = '$injector';\nexport const /** @type {?} */ $INTERVAL = '$interval';\nexport const /** @type {?} */ $PARSE = '$parse';\nexport const /** @type {?} */ $PROVIDE = '$provide';\nexport const /** @type {?} */ $ROOT_SCOPE = '$rootScope';\nexport const /** @type {?} */ $SCOPE = '$scope';\nexport const /** @type {?} */ $TEMPLATE_CACHE = '$templateCache';\nexport const /** @type {?} */ $TEMPLATE_REQUEST = '$templateRequest';\n\nexport const /** @type {?} */ $$TESTABILITY = '$$testability';\n\nexport const /** @type {?} */ COMPILER_KEY = '$$angularCompiler';\nexport const /** @type {?} */ GROUP_PROJECTABLE_NODES_KEY = '$$angularGroupProjectableNodes';\nexport const /** @type {?} */ INJECTOR_KEY = '$$angularInjector';\nexport const /** @type {?} */ NG_ZONE_KEY = '$$angularNgZone';\n\nexport const /** @type {?} */ REQUIRE_INJECTOR = '?^^' + INJECTOR_KEY;\nexport const /** @type {?} */ REQUIRE_NG_MODEL = '?ngModel';\n\nexport const /** @type {?} */ UPGRADE_MODULE_NAME = '$$UpgradeModule';\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 type Ng1Token = string;\n\nexport type Ng1Expression = string | Function;\n\nexport interface IAnnotatedFunction extends Function { $inject?: Ng1Token[]; }\n\nexport type IInjectable = (Ng1Token | Function)[] | IAnnotatedFunction;\n\nexport type SingleOrListOrMap = T | T[] | {[key: string]: T};\n\nexport interface IModule {\n name: string;\n requires: (string|IInjectable)[];\n config(fn: IInjectable): IModule;\n directive(selector: string, factory: IInjectable): IModule;\n component(selector: string, component: IComponent): IModule;\n controller(name: string, type: IInjectable): IModule;\n factory(key: Ng1Token, factoryFn: IInjectable): IModule;\n value(key: Ng1Token, value: any): IModule;\n constant(token: Ng1Token, value: any): IModule;\n run(a: IInjectable): IModule;\n}\nexport interface ICompileService {\n (element: Element|NodeList|Node[]|string, transclude?: Function): ILinkFn;\n}\nexport interface ILinkFn {\n (scope: IScope, cloneAttachFn?: ICloneAttachFunction, options?: ILinkFnOptions): IAugmentedJQuery;\n $$slots?: {[slotName: string]: ILinkFn};\n}\nexport interface ILinkFnOptions {\n parentBoundTranscludeFn?: Function;\n transcludeControllers?: {[key: string]: any};\n futureParentElement?: Node;\n}\nexport interface IRootScopeService {\n $new(isolate?: boolean): IScope;\n $id: string;\n $parent: IScope;\n $root: IScope;\n $watch(exp: Ng1Expression, fn?: (a1?: any, a2?: any) => void): Function;\n $on(event: string, fn?: (event?: any, ...args: any[]) => void): Function;\n $destroy(): any;\n $apply(exp?: Ng1Expression): any;\n $digest(): any;\n $evalAsync(exp: Ng1Expression, locals?: any): void;\n $on(event: string, fn?: (event?: any, ...args: any[]) => void): Function;\n $$childTail: IScope;\n $$childHead: IScope;\n $$nextSibling: IScope;\n [key: string]: any;\n}\nexport interface IScope extends IRootScopeService {}\n\nexport interface IAngularBootstrapConfig { strictDi?: boolean; }\nexport interface IDirective {\n compile?: IDirectiveCompileFn;\n controller?: IController;\n controllerAs?: string;\n bindToController?: boolean|{[key: string]: string};\n link?: IDirectiveLinkFn|IDirectivePrePost;\n name?: string;\n priority?: number;\n replace?: boolean;\n require?: DirectiveRequireProperty;\n restrict?: string;\n scope?: boolean|{[key: string]: string};\n template?: string|Function;\n templateUrl?: string|Function;\n templateNamespace?: string;\n terminal?: boolean;\n transclude?: DirectiveTranscludeProperty;\n}\nexport type DirectiveRequireProperty = SingleOrListOrMap;\nexport type DirectiveTranscludeProperty = boolean | 'element' | {[key: string]: string};\nexport interface IDirectiveCompileFn {\n (templateElement: IAugmentedJQuery, templateAttributes: IAttributes,\n transclude: ITranscludeFunction): IDirectivePrePost;\n}\nexport interface IDirectivePrePost {\n pre?: IDirectiveLinkFn;\n post?: IDirectiveLinkFn;\n}\nexport interface IDirectiveLinkFn {\n (scope: IScope, instanceElement: IAugmentedJQuery, instanceAttributes: IAttributes,\n controller: any, transclude: ITranscludeFunction): void;\n}\nexport interface IComponent {\n bindings?: {[key: string]: string};\n controller?: string|IInjectable;\n controllerAs?: string;\n require?: DirectiveRequireProperty;\n template?: string|Function;\n templateUrl?: string|Function;\n transclude?: DirectiveTranscludeProperty;\n}\nexport interface IAttributes {\n $observe(attr: string, fn: (v: string) => void): void;\n [key: string]: any;\n}\nexport interface ITranscludeFunction {\n // If the scope is provided, then the cloneAttachFn must be as well.\n (scope: IScope, cloneAttachFn: ICloneAttachFunction): IAugmentedJQuery;\n // If one argument is provided, then it's assumed to be the cloneAttachFn.\n (cloneAttachFn?: ICloneAttachFunction): IAugmentedJQuery;\n}\nexport interface ICloneAttachFunction {\n // Let's hint but not force cloneAttachFn's signature\n (clonedElement?: IAugmentedJQuery, scope?: IScope): any;\n}\nexport type IAugmentedJQuery = Node[] & {\n bind?: (name: string, fn: () => void) => void;\n data?: (name: string, value?: any) => any;\n text?: () => string;\n inheritedData?: (name: string, value?: any) => any;\n contents?: () => IAugmentedJQuery;\n parent?: () => IAugmentedJQuery;\n empty?: () => void;\n append?: (content: IAugmentedJQuery | string) => IAugmentedJQuery;\n controller?: (name: string) => any;\n isolateScope?: () => IScope;\n injector?: () => IInjectorService;\n};\nexport interface IProvider { $get: IInjectable; }\nexport interface IProvideService {\n provider(token: Ng1Token, provider: IProvider): IProvider;\n factory(token: Ng1Token, factory: IInjectable): IProvider;\n service(token: Ng1Token, type: IInjectable): IProvider;\n value(token: Ng1Token, value: any): IProvider;\n constant(token: Ng1Token, value: any): void;\n decorator(token: Ng1Token, factory: IInjectable): void;\n}\nexport interface IParseService { (expression: string): ICompiledExpression; }\nexport interface ICompiledExpression {\n (context: any, locals: any): any;\n assign?: (context: any, value: any) => any;\n}\nexport interface IHttpBackendService {\n (method: string, url: string, post?: any, callback?: Function, headers?: any, timeout?: number,\n withCredentials?: boolean): void;\n}\nexport interface ICacheObject {\n put(key: string, value?: T): T;\n get(key: string): any;\n}\nexport interface ITemplateCacheService extends ICacheObject {}\nexport interface ITemplateRequestService {\n (template: string|any /* TrustedResourceUrl */, ignoreRequestError?: boolean): Promise;\n totalPendingRequests: number;\n}\nexport type IController = string | IInjectable;\nexport interface IControllerService {\n (controllerConstructor: IController, locals?: any, later?: any, ident?: any): any;\n (controllerName: string, locals?: any): any;\n}\n\nexport interface IInjectorService {\n get(key: string): any;\n has(key: string): boolean;\n}\n\nexport interface IIntervalService {\n (func: Function, delay: number, count?: number, invokeApply?: boolean,\n ...args: any[]): Promise;\n cancel(promise: Promise): boolean;\n}\n\nexport interface ITestabilityService {\n findBindings(element: Element, expression: string, opt_exactMatch?: boolean): Element[];\n findModels(element: Element, expression: string, opt_exactMatch?: boolean): Element[];\n getLocation(): string;\n setLocation(url: string): void;\n whenStable(callback: Function): void;\n}\n\nexport interface INgModelController {\n $render(): void;\n $isEmpty(value: any): boolean;\n $setValidity(validationErrorKey: string, isValid: boolean): void;\n $setPristine(): void;\n $setDirty(): void;\n $setUntouched(): void;\n $setTouched(): void;\n $rollbackViewValue(): void;\n $validate(): void;\n $commitViewValue(): void;\n $setViewValue(value: any, trigger: string): void;\n\n $viewValue: any;\n $modelValue: any;\n $parsers: Function[];\n $formatters: Function[];\n $validators: {[key: string]: Function};\n $asyncValidators: {[key: string]: Function};\n $viewChangeListeners: Function[];\n $error: Object;\n $pending: Object;\n $untouched: boolean;\n $touched: boolean;\n $pristine: boolean;\n $dirty: boolean;\n $valid: boolean;\n $invalid: boolean;\n $name: string;\n}\n/**\n * @return {?}\n */\nfunction noNg() {\n throw new Error('AngularJS v1.x is not loaded!');\n}\n\n\nlet /** @type {?} */ angular: {\n bootstrap: (e: Element, modules: (string | IInjectable)[], config?: IAngularBootstrapConfig) =>\n IInjectorService,\n module: (prefix: string, dependencies?: string[]) => IModule,\n element: (e: Element | string) => IAugmentedJQuery,\n version: {major: number},\n resumeBootstrap: () => void,\n getTestability: (e: Element) => ITestabilityService\n} = /** @type {?} */(( {\n bootstrap: noNg,\n module: noNg,\n element: noNg,\n version: noNg,\n resumeBootstrap: noNg,\n getTestability: noNg\n}));\n\ntry {\n if (window.hasOwnProperty('angular')) {\n angular = ( /** @type {?} */((window))).angular;\n }\n} catch ( /** @type {?} */e) {\n // ignore in CJS mode.\n}\n/**\n * Resets the AngularJS library.\n * \n * Used when angularjs is loaded lazily, and not available on `window`.\n * \n * \\@stable\n * @param {?} ng\n * @return {?}\n */\nexport function setAngularLib(ng: any): void {\n angular = ng;\n}\n/**\n * Returns the current version of the AngularJS library.\n * \n * \\@stable\n * @return {?}\n */\nexport function getAngularLib(): any {\n return angular;\n}\n\nexport const /** @type {?} */ bootstrap =\n (e: Element, modules: (string | IInjectable)[], config?: IAngularBootstrapConfig) =>\n angular.bootstrap(e, modules, config);\n\nexport const /** @type {?} */ module = (prefix: string, dependencies?: string[]) =>\n angular.module(prefix, dependencies);\n\nexport const /** @type {?} */ element = (e: Element | string) => angular.element(e);\n\nexport const /** @type {?} */ resumeBootstrap = () => angular.resumeBootstrap();\n\nexport const /** @type {?} */ getTestability = (e: Element) => angular.getTestability(e);\n\nexport const /** @type {?} */ version = angular.version;\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 the common package.\n */\n\n\nimport {Version} from '@angular/core';\n/**\n * \\@stable\n */\nexport const VERSION = new Version('4.4.6');\n"],"names":["angular.module","angular.element","element","angular.bootstrap","INITIAL_VALUE","ParentInjectorPromise","module"],"mappings":";;;AYAA;;;;;;;;;;;;AAeA,AACA;;;AAGA,AADC,MAAA,OAAA,GAAA,IAAA,OAAA,CAAA,m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