UNPKG

145 kBSource Map (JSON)View Raw
1{"version":3,"file":"static.mjs","sources":["../../../../../../packages/upgrade/src/common/src/angular1.ts","../../../../../../packages/upgrade/src/common/src/constants.ts","../../../../../../packages/upgrade/src/common/src/component_info.ts","../../../../../../packages/upgrade/src/common/src/util.ts","../../../../../../packages/upgrade/src/common/src/downgrade_component_adapter.ts","../../../../../../packages/upgrade/src/common/src/promise_util.ts","../../../../../../packages/upgrade/src/common/src/downgrade_component.ts","../../../../../../packages/upgrade/src/common/src/downgrade_injectable.ts","../../../../../../packages/upgrade/src/common/src/version.ts","../../../../../../packages/upgrade/static/src/angular1_providers.ts","../../../../../../packages/upgrade/static/src/util.ts","../../../../../../packages/upgrade/static/src/downgrade_module.ts","../../../../../../packages/upgrade/src/common/src/upgrade_helper.ts","../../../../../../packages/upgrade/static/src/upgrade_component.ts","../../../../../../packages/upgrade/static/src/upgrade_module.ts","../../../../../../packages/upgrade/static/public_api.ts","../../../../../../packages/upgrade/static/index.ts","../../../../../../packages/upgrade/static/static.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC 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 {\n // Older versions of `@types/angular` typings extend the global `Function` interface with\n // `$inject?: string[]`, which is not compatible with `$inject?: ReadonlyArray<string>` (used in\n // latest versions).\n $inject?: Function extends {$inject?: string[]}? Ng1Token[]: ReadonlyArray<Ng1Token>;\n}\n\nexport type IInjectable = (Ng1Token|Function)[]|IAnnotatedFunction;\n\nexport type SingleOrListOrMap<T> = 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 {\n strictDi?: boolean;\n}\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<string>;\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 (clonedElement: IAugmentedJQuery, scope: IScope): any;\n}\nexport type IAugmentedJQuery = Node[]&{\n on?: (name: string, fn: () => void) => void;\n data?: (name: string, value?: any) => any;\n text?: () => string;\n inheritedData?: (name: string, value?: any) => any;\n children?: () => IAugmentedJQuery;\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 triggerHandler?: (eventTypeOrObject: string|Event, extraParameters?: any[]) => IAugmentedJQuery;\n remove?: () => void;\n removeData?: () => void;\n};\nexport interface IProvider {\n $get: IInjectable;\n}\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 {\n (expression: string): ICompiledExpression;\n}\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<T>(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<string>;\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<any>;\n cancel(promise: Promise<any>): 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\nfunction noNg(): never {\n throw new Error('AngularJS v1.x is not loaded!');\n}\n\nconst noNgElement: typeof angular.element = (() => noNg()) as any;\nnoNgElement.cleanData = noNg;\n\nlet angular: {\n bootstrap: (e: Element, modules: (string|IInjectable)[], config?: IAngularBootstrapConfig) =>\n IInjectorService,\n module: (prefix: string, dependencies?: string[]) => IModule,\n element: {\n (e: string|Element|Document|IAugmentedJQuery): IAugmentedJQuery;\n cleanData: (nodes: Node[]|NodeList) => void;\n },\n injector: (modules: Array<string|IInjectable>, strictDi?: boolean) => IInjectorService,\n version: {major: number},\n resumeBootstrap: () => void,\n getTestability: (e: Element) => ITestabilityService\n} = {\n bootstrap: noNg,\n module: noNg,\n element: noNgElement,\n injector: noNg,\n version: undefined as any,\n resumeBootstrap: noNg,\n getTestability: noNg\n};\n\ntry {\n if (window.hasOwnProperty('angular')) {\n angular = (<any>window).angular;\n }\n} catch {\n // ignore in CJS mode.\n}\n\n/**\n * @deprecated Use `setAngularJSGlobal` instead.\n *\n * @publicApi\n */\nexport function setAngularLib(ng: any): void {\n setAngularJSGlobal(ng);\n}\n\n/**\n * @deprecated Use `getAngularJSGlobal` instead.\n *\n * @publicApi\n */\nexport function getAngularLib(): any {\n return getAngularJSGlobal();\n}\n\n/**\n * Resets the AngularJS global.\n *\n * Used when AngularJS is loaded lazily, and not available on `window`.\n *\n * @publicApi\n */\nexport function setAngularJSGlobal(ng: any): void {\n angular = ng;\n}\n\n/**\n * Returns the current AngularJS global.\n *\n * @publicApi\n */\nexport function getAngularJSGlobal(): any {\n return angular;\n}\n\nexport const bootstrap: typeof angular.bootstrap = (e, modules, config?) =>\n angular.bootstrap(e, modules, config);\n\n// Do not declare as `module` to avoid webpack bug\n// (see https://github.com/angular/angular/issues/30050).\nexport const module_: typeof angular.module = (prefix, dependencies?) =>\n angular.module(prefix, dependencies);\n\nexport const element: typeof angular.element = (e => angular.element(e)) as typeof angular.element;\nelement.cleanData = nodes => angular.element.cleanData(nodes);\n\nexport const injector: typeof angular.injector =\n (modules: Array<string|IInjectable>, strictDi?: boolean) => angular.injector(modules, strictDi);\n\nexport const resumeBootstrap: typeof angular.resumeBootstrap = () => angular.resumeBootstrap();\n\nexport const getTestability: typeof angular.getTestability = e => angular.getTestability(e);\n","/**\n * @license\n * Copyright Google LLC 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 $COMPILE = '$compile';\nexport const $CONTROLLER = '$controller';\nexport const $DELEGATE = '$delegate';\nexport const $EXCEPTION_HANDLER = '$exceptionHandler';\nexport const $HTTP_BACKEND = '$httpBackend';\nexport const $INJECTOR = '$injector';\nexport const $INTERVAL = '$interval';\nexport const $PARSE = '$parse';\nexport const $PROVIDE = '$provide';\nexport const $ROOT_ELEMENT = '$rootElement';\nexport const $ROOT_SCOPE = '$rootScope';\nexport const $SCOPE = '$scope';\nexport const $TEMPLATE_CACHE = '$templateCache';\nexport const $TEMPLATE_REQUEST = '$templateRequest';\n\nexport const $$TESTABILITY = '$$testability';\n\nexport const COMPILER_KEY = '$$angularCompiler';\nexport const DOWNGRADED_MODULE_COUNT_KEY = '$$angularDowngradedModuleCount';\nexport const GROUP_PROJECTABLE_NODES_KEY = '$$angularGroupProjectableNodes';\nexport const INJECTOR_KEY = '$$angularInjector';\nexport const LAZY_MODULE_REF = '$$angularLazyModuleRef';\nexport const NG_ZONE_KEY = '$$angularNgZone';\nexport const UPGRADE_APP_TYPE_KEY = '$$angularUpgradeAppType';\n\nexport const REQUIRE_INJECTOR = '?^^' + INJECTOR_KEY;\nexport const REQUIRE_NG_MODEL = '?ngModel';\n\nexport const UPGRADE_MODULE_NAME = '$$UpgradeModule';\n","/**\n * @license\n * Copyright Google LLC 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 `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 // TODO(issue/24571): remove '!'.\n bracketAttr!: string;\n // TODO(issue/24571): remove '!'.\n bracketParenAttr!: string;\n // TODO(issue/24571): remove '!'.\n parenAttr!: string;\n // TODO(issue/24571): remove '!'.\n onAttr!: string;\n // TODO(issue/24571): remove '!'.\n bindAttr!: string;\n // TODO(issue/24571): remove '!'.\n bindonAttr!: string;\n\n constructor(public prop: string, public attr: string) {\n this.parseBinding();\n }\n\n private parseBinding() {\n this.bracketAttr = `[${this.attr}]`;\n this.parenAttr = `(${this.attr})`;\n this.bracketParenAttr = `[(${this.attr})]`;\n const 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","/**\n * @license\n * Copyright Google LLC 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, Type} from '@angular/core';\n\nimport {element as angularElement, IAugmentedJQuery, IInjectorService, INgModelController, IRootScopeService} from './angular1';\nimport {$ROOT_ELEMENT, $ROOT_SCOPE, DOWNGRADED_MODULE_COUNT_KEY, UPGRADE_APP_TYPE_KEY} from './constants';\n\nconst DIRECTIVE_PREFIX_REGEXP = /^(?:x|data)[:\\-_]/i;\nconst DIRECTIVE_SPECIAL_CHARS_REGEXP = /[:\\-_]+(.)/g;\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/**\n * Clean the jqLite/jQuery data on the element and all its descendants.\n * Equivalent to how jqLite/jQuery invoke `cleanData()` on an Element when removed:\n * https://github.com/angular/angular.js/blob/2e72ea13fa98bebf6ed4b5e3c45eaf5f990ed16f/src/jqLite.js#L349-L355\n * https://github.com/jquery/jquery/blob/6984d1747623dbc5e87fd6c261a5b6b1628c107c/src/manipulation.js#L182\n *\n * NOTE:\n * `cleanData()` will also invoke the AngularJS `$destroy` DOM event on the element:\n * https://github.com/angular/angular.js/blob/2e72ea13fa98bebf6ed4b5e3c45eaf5f990ed16f/src/Angular.js#L1932-L1945\n *\n * @param node The DOM node whose data needs to be cleaned.\n */\nexport function cleanData(node: Node): void {\n angularElement.cleanData([node]);\n if (isParentNode(node)) {\n angularElement.cleanData(node.querySelectorAll('*'));\n }\n}\n\nexport function controllerKey(name: string): string {\n return '$' + name + 'Controller';\n}\n\n/**\n * Destroy an AngularJS app given the app `$injector`.\n *\n * NOTE: Destroying an app is not officially supported by AngularJS, but try to do our best by\n * destroying `$rootScope` and clean the jqLite/jQuery data on `$rootElement` and all\n * descendants.\n *\n * @param $injector The `$injector` of the AngularJS app to destroy.\n */\nexport function destroyApp($injector: IInjectorService): void {\n const $rootElement: IAugmentedJQuery = $injector.get($ROOT_ELEMENT);\n const $rootScope: IRootScopeService = $injector.get($ROOT_SCOPE);\n\n $rootScope.$destroy();\n cleanData($rootElement[0]);\n}\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\nexport function getTypeName(type: Type<any>): string {\n // Return the name of the type or the first line of its stringified version.\n return (type as any).overriddenName || type.name || type.toString().split('\\n')[0];\n}\n\nexport function getDowngradedModuleCount($injector: IInjectorService): number {\n return $injector.has(DOWNGRADED_MODULE_COUNT_KEY) ? $injector.get(DOWNGRADED_MODULE_COUNT_KEY) :\n 0;\n}\n\nexport function getUpgradeAppType($injector: IInjectorService): UpgradeAppType {\n return $injector.has(UPGRADE_APP_TYPE_KEY) ? $injector.get(UPGRADE_APP_TYPE_KEY) :\n UpgradeAppType.None;\n}\n\nexport function isFunction(value: any): value is Function {\n return typeof value === 'function';\n}\n\nfunction isParentNode(node: Node|ParentNode): node is ParentNode {\n return isFunction((node as unknown as ParentNode).querySelectorAll);\n}\n\nexport function validateInjectionKey(\n $injector: IInjectorService, downgradedModule: string, injectionKey: string,\n attemptedAction: string): void {\n const upgradeAppType = getUpgradeAppType($injector);\n const downgradedModuleCount = getDowngradedModuleCount($injector);\n\n // Check for common errors.\n switch (upgradeAppType) {\n case UpgradeAppType.Dynamic:\n case UpgradeAppType.Static:\n if (downgradedModule) {\n throw new Error(\n `Error while ${attemptedAction}: 'downgradedModule' unexpectedly specified.\\n` +\n 'You should not specify a value for \\'downgradedModule\\', unless you are downgrading ' +\n 'more than one Angular module (via \\'downgradeModule()\\').');\n }\n break;\n case UpgradeAppType.Lite:\n if (!downgradedModule && (downgradedModuleCount >= 2)) {\n throw new Error(\n `Error while ${attemptedAction}: 'downgradedModule' not specified.\\n` +\n 'This application contains more than one downgraded Angular module, thus you need to ' +\n 'always specify \\'downgradedModule\\' when downgrading components and injectables.');\n }\n\n if (!$injector.has(injectionKey)) {\n throw new Error(\n `Error while ${attemptedAction}: Unable to find the specified downgraded module.\\n` +\n 'Did you forget to downgrade an Angular module or include it in the AngularJS ' +\n 'application?');\n }\n\n break;\n default:\n throw new Error(\n `Error while ${attemptedAction}: Not a valid '@angular/upgrade' application.\\n` +\n 'Did you forget to downgrade an Angular module or include it in the AngularJS ' +\n 'application?');\n }\n}\n\nexport class Deferred<R> {\n promise: Promise<R>;\n // TODO(issue/24571): remove '!'.\n resolve!: (value: R|PromiseLike<R>) => void;\n // TODO(issue/24571): remove '!'.\n reject!: (error?: any) => void;\n\n constructor() {\n this.promise = new Promise((res, rej) => {\n this.resolve = res;\n this.reject = rej;\n });\n }\n}\n\nexport interface LazyModuleRef {\n injector?: Injector;\n promise?: Promise<Injector>;\n}\n\nexport const enum UpgradeAppType {\n // App NOT using `@angular/upgrade`. (This should never happen in an `ngUpgrade` app.)\n None,\n\n // App using the deprecated `@angular/upgrade` APIs (a.k.a. dynamic `ngUpgrade`).\n Dynamic,\n\n // App using `@angular/upgrade/static` with `UpgradeModule`.\n Static,\n\n // App using @angular/upgrade/static` with `downgradeModule()` (a.k.a `ngUpgrade`-lite ).\n Lite,\n}\n\n/**\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/**\n * Glue the AngularJS `NgModelController` (if it exists) to the component\n * (if it implements the needed subset of the `ControlValueAccessor` interface).\n */\nexport function hookupNgModel(ngModel: INgModelController, component: any) {\n if (ngModel && supportsNgModel(component)) {\n ngModel.$render = () => {\n component.writeValue(ngModel.$viewValue);\n };\n component.registerOnChange(ngModel.$setViewValue.bind(ngModel));\n if (typeof component.registerOnTouched === 'function') {\n component.registerOnTouched(ngModel.$setTouched.bind(ngModel));\n }\n }\n}\n\n/**\n * Test two values for strict equality, accounting for the fact that `NaN !== NaN`.\n */\nexport function strictEquals(val1: any, val2: any): boolean {\n return val1 === val2 || (val1 !== val1 && val2 !== val2);\n}\n","/**\n * @license\n * Copyright Google LLC 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, ChangeDetectorRef, ComponentFactory, ComponentRef, EventEmitter, Injector, OnChanges, SimpleChange, SimpleChanges, StaticProvider, Testability, TestabilityRegistry, Type} from '@angular/core';\n\nimport {IAttributes, IAugmentedJQuery, ICompileService, INgModelController, IParseService, IScope} from './angular1';\nimport {PropertyBinding} from './component_info';\nimport {$SCOPE} from './constants';\nimport {cleanData, getTypeName, hookupNgModel, strictEquals} from './util';\n\nconst INITIAL_VALUE = {\n __UNINITIALIZED__: true\n};\n\nexport class DowngradeComponentAdapter {\n private implementsOnChanges = false;\n private inputChangeCount: number = 0;\n private inputChanges: SimpleChanges = {};\n private componentScope: IScope;\n // TODO(issue/24571): remove '!'.\n private componentRef!: ComponentRef<any>;\n private component: any;\n // TODO(issue/24571): remove '!'.\n private changeDetector!: ChangeDetectorRef;\n // TODO(issue/24571): remove '!'.\n private viewChangeDetector!: ChangeDetectorRef;\n\n constructor(\n private element: IAugmentedJQuery, private attrs: IAttributes, private scope: IScope,\n private ngModel: INgModelController, private parentInjector: Injector,\n private $compile: ICompileService, private $parse: IParseService,\n private componentFactory: ComponentFactory<any>,\n private wrapCallback: <T>(cb: () => T) => () => T) {\n this.componentScope = scope.$new();\n }\n\n compileContents(): Node[][] {\n const compiledProjectableNodes: Node[][] = [];\n const projectableNodes: Node[][] = this.groupProjectableNodes();\n const linkFns = projectableNodes.map(nodes => this.$compile(nodes));\n\n this.element.empty!();\n\n linkFns.forEach(linkFn => {\n linkFn(this.scope, (clone: Node[]) => {\n compiledProjectableNodes.push(clone);\n this.element.append!(clone);\n });\n });\n\n return compiledProjectableNodes;\n }\n\n createComponent(projectableNodes: Node[][]) {\n const providers: StaticProvider[] = [{provide: $SCOPE, useValue: this.componentScope}];\n const childInjector = Injector.create(\n {providers: providers, parent: this.parentInjector, name: 'DowngradeComponentAdapter'});\n\n this.componentRef =\n this.componentFactory.create(childInjector, projectableNodes, this.element[0]);\n this.viewChangeDetector = this.componentRef.injector.get(ChangeDetectorRef);\n this.changeDetector = this.componentRef.changeDetectorRef;\n this.component = this.componentRef.instance;\n\n // testability hook is commonly added during component bootstrap in\n // packages/core/src/application_ref.bootstrap()\n // in downgraded application, component creation will take place here as well as adding the\n // testability hook.\n const testability = this.componentRef.injector.get(Testability, null);\n if (testability) {\n this.componentRef.injector.get(TestabilityRegistry)\n .registerApplication(this.componentRef.location.nativeElement, testability);\n }\n\n hookupNgModel(this.ngModel, this.component);\n }\n\n setupInputs(manuallyAttachView: boolean, propagateDigest = true): void {\n const attrs = this.attrs;\n const inputs = this.componentFactory.inputs || [];\n for (let i = 0; i < inputs.length; i++) {\n const input = new PropertyBinding(inputs[i].propName, inputs[i].templateName);\n let expr: string|null = null;\n\n if (attrs.hasOwnProperty(input.attr)) {\n const observeFn = (prop => {\n let 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 unwatch: Function|null = this.componentScope.$watch(() => {\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 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 // Invoke `ngOnChanges()` and Change Detection (when necessary)\n const detectChanges = () => this.changeDetector.detectChanges();\n const prototype = this.componentFactory.componentType.prototype;\n this.implementsOnChanges = !!(prototype && (<OnChanges>prototype).ngOnChanges);\n\n this.componentScope.$watch(() => this.inputChangeCount, this.wrapCallback(() => {\n // Invoke `ngOnChanges()`\n if (this.implementsOnChanges) {\n const inputChanges = this.inputChanges;\n this.inputChanges = {};\n (<OnChanges>this.component).ngOnChanges(inputChanges!);\n }\n\n this.viewChangeDetector.markForCheck();\n\n // If opted out of propagating digests, invoke change detection when inputs change.\n if (!propagateDigest) {\n detectChanges();\n }\n }));\n\n // If not opted out of propagating digests, invoke change detection on every digest\n if (propagateDigest) {\n this.componentScope.$watch(this.wrapCallback(detectChanges));\n }\n\n // If necessary, attach the view so that it will be dirty-checked.\n // (Allow time for the initial input values to be set and `ngOnChanges()` to be called.)\n if (manuallyAttachView || !propagateDigest) {\n let unwatch: Function|null = this.componentScope.$watch(() => {\n unwatch!();\n unwatch = null;\n\n const appRef = this.parentInjector.get<ApplicationRef>(ApplicationRef);\n appRef.attachView(this.componentRef.hostView);\n });\n }\n }\n\n setupOutputs() {\n const attrs = this.attrs;\n const outputs = this.componentFactory.outputs || [];\n for (let j = 0; j < outputs.length; j++) {\n const output = new PropertyBinding(outputs[j].propName, outputs[j].templateName);\n const bindonAttr = output.bindonAttr.substring(0, output.bindonAttr.length - 6);\n const bracketParenAttr =\n `[(${output.bracketParenAttr.substring(2, output.bracketParenAttr.length - 8)})]`;\n // order below is important - first update bindings then evaluate expressions\n if (attrs.hasOwnProperty(bindonAttr)) {\n this.subscribeToOutput(output, attrs[bindonAttr], true);\n }\n if (attrs.hasOwnProperty(bracketParenAttr)) {\n this.subscribeToOutput(output, attrs[bracketParenAttr], true);\n }\n if (attrs.hasOwnProperty(output.onAttr)) {\n this.subscribeToOutput(output, attrs[output.onAttr]);\n }\n if (attrs.hasOwnProperty(output.parenAttr)) {\n this.subscribeToOutput(output, attrs[output.parenAttr]);\n }\n }\n }\n\n private subscribeToOutput(output: PropertyBinding, expr: string, isAssignment: boolean = false) {\n const getter = this.$parse(expr);\n const setter = getter.assign;\n if (isAssignment && !setter) {\n throw new Error(`Expression '${expr}' is not assignable!`);\n }\n const emitter = this.component[output.prop] as EventEmitter<any>;\n if (emitter) {\n emitter.subscribe({\n next: isAssignment ? (v: any) => setter!(this.scope, v) :\n (v: any) => getter(this.scope, {'$event': v})\n });\n } else {\n throw new Error(`Missing emitter '${output.prop}' on component '${\n getTypeName(this.componentFactory.componentType)}'!`);\n }\n }\n\n registerCleanup() {\n const testabilityRegistry = this.componentRef.injector.get(TestabilityRegistry);\n const destroyComponentRef = this.wrapCallback(() => this.componentRef.destroy());\n let destroyed = false;\n\n this.element.on!('$destroy', () => {\n // The `$destroy` event may have been triggered by the `cleanData()` call in the\n // `componentScope` `$destroy` handler below. In that case, we don't want to call\n // `componentScope.$destroy()` again.\n if (!destroyed) this.componentScope.$destroy();\n });\n this.componentScope.$on('$destroy', () => {\n if (!destroyed) {\n destroyed = true;\n testabilityRegistry.unregisterApplication(this.componentRef.location.nativeElement);\n\n // The `componentScope` might be getting destroyed, because an ancestor element is being\n // removed/destroyed. If that is the case, jqLite/jQuery would normally invoke `cleanData()`\n // on the removed element and all descendants.\n // https://github.com/angular/angular.js/blob/2e72ea13fa98bebf6ed4b5e3c45eaf5f990ed16f/src/jqLite.js#L349-L355\n // https://github.com/jquery/jquery/blob/6984d1747623dbc5e87fd6c261a5b6b1628c107c/src/manipulation.js#L182\n //\n // Here, however, `destroyComponentRef()` may under some circumstances remove the element\n // from the DOM and therefore it will no longer be a descendant of the removed element when\n // `cleanData()` is called. This would result in a memory leak, because the element's data\n // and event handlers (and all objects directly or indirectly referenced by them) would be\n // retained.\n //\n // To ensure the element is always properly cleaned up, we manually call `cleanData()` on\n // this element and its descendants before destroying the `ComponentRef`.\n cleanData(this.element[0]);\n\n destroyComponentRef();\n }\n });\n }\n\n getInjector(): Injector {\n return this.componentRef.injector;\n }\n\n private updateInput(prop: string, prevValue: any, currValue: any) {\n if (this.implementsOnChanges) {\n this.inputChanges[prop] = new SimpleChange(prevValue, currValue, prevValue === currValue);\n }\n\n this.inputChangeCount++;\n this.component[prop] = currValue;\n }\n\n groupProjectableNodes() {\n let ngContentSelectors = this.componentFactory.ngContentSelectors;\n return groupNodesBySelector(ngContentSelectors, this.element.contents!());\n }\n}\n\n/**\n * Group a set of DOM nodes into `ngContent` groups, based on the given content selectors.\n */\nexport function groupNodesBySelector(ngContentSelectors: string[], nodes: Node[]): Node[][] {\n const projectableNodes: Node[][] = [];\n\n for (let i = 0, ii = ngContentSelectors.length; i < ii; ++i) {\n projectableNodes[i] = [];\n }\n\n for (let j = 0, jj = nodes.length; j < jj; ++j) {\n const node = nodes[j];\n const ngContentIndex = findMatchingNgContentIndex(node, ngContentSelectors);\n if (ngContentIndex != null) {\n projectableNodes[ngContentIndex].push(node);\n }\n }\n\n return projectableNodes;\n}\n\nfunction findMatchingNgContentIndex(element: any, ngContentSelectors: string[]): number|null {\n const ngContentIndices: number[] = [];\n let wildcardNgContentIndex: number = -1;\n for (let i = 0; i < ngContentSelectors.length; i++) {\n const 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 _matches: (this: any, selector: string) => boolean;\n\nfunction matchesSelector(el: any, selector: string): boolean {\n if (!_matches) {\n const elProto = <any>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 LLC 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 {isFunction} from './util';\n\nexport interface Thenable<T> {\n then(callback: (value: T) => any): any;\n}\n\nexport function isThenable<T>(obj: unknown): obj is Thenable<T> {\n return !!obj && isFunction((obj as any).then);\n}\n\n/**\n * Synchronous, promise-like object.\n */\nexport class SyncPromise<T> {\n protected value: T|undefined;\n private resolved = false;\n private callbacks: ((value: T) => unknown)[] = [];\n\n static all<T>(valuesOrPromises: (T|Thenable<T>)[]): SyncPromise<T[]> {\n const aggrPromise = new SyncPromise<T[]>();\n\n let resolvedCount = 0;\n const results: T[] = [];\n const resolve = (idx: number, value: T) => {\n results[idx] = value;\n if (++resolvedCount === valuesOrPromises.length) aggrPromise.resolve(results);\n };\n\n valuesOrPromises.forEach((p, idx) => {\n if (isThenable(p)) {\n p.then(v => resolve(idx, v));\n } else {\n resolve(idx, p);\n }\n });\n\n return aggrPromise;\n }\n\n resolve(value: T): void {\n // Do nothing, if already resolved.\n if (this.resolved) return;\n\n this.value = value;\n this.resolved = true;\n\n // Run the queued callbacks.\n this.callbacks.forEach(callback => callback(value));\n this.callbacks.length = 0;\n }\n\n then(callback: (value: T) => unknown): void {\n if (this.resolved) {\n callback(this.value!);\n } else {\n this.callbacks.push(callback);\n }\n }\n}\n","/**\n * @license\n * Copyright Google LLC 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 {ComponentFactory, ComponentFactoryResolver, Injector, NgZone, Type} from '@angular/core';\n\nimport {IAnnotatedFunction, IAttributes, IAugmentedJQuery, ICompileService, IDirective, IInjectorService, INgModelController, IParseService, IScope} from './angular1';\nimport {$COMPILE, $INJECTOR, $PARSE, INJECTOR_KEY, LAZY_MODULE_REF, REQUIRE_INJECTOR, REQUIRE_NG_MODEL} from './constants';\nimport {DowngradeComponentAdapter} from './downgrade_component_adapter';\nimport {SyncPromise, Thenable} from './promise_util';\nimport {controllerKey, getDowngradedModuleCount, getTypeName, getUpgradeAppType, LazyModuleRef, UpgradeAppType, validateInjectionKey} from './util';\n\n\n/**\n * @description\n *\n * A helper function that allows an Angular component to be used from AngularJS.\n *\n * *Part of the [upgrade/static](api?query=upgrade%2Fstatic)\n * library for hybrid upgrade apps that support AOT compilation*\n *\n * This helper function returns a factory function to be used for registering\n * an AngularJS wrapper directive for \"downgrading\" an Angular component.\n *\n * @usageNotes\n * ### Examples\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/full/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/full/module.ts region=\"ng2-heroes-wrapper\"}\n *\n * For more details and examples on downgrading Angular components to AngularJS components please\n * visit the [Upgrade guide](guide/upgrade#using-angular-components-from-angularjs-code).\n *\n * @param info contains information about the Component that is being downgraded:\n *\n * - `component: Type<any>`: The type of the Component that will be downgraded\n * - `downgradedModule?: string`: The name of the downgraded module (if any) that the component\n * \"belongs to\", as returned by a call to `downgradeModule()`. It is the module, whose\n * corresponding Angular module will be bootstrapped, when the component needs to be instantiated.\n * <br />\n * (This option is only necessary when using `downgradeModule()` to downgrade more than one\n * Angular module.)\n * - `propagateDigest?: boolean`: Whether to perform {@link ChangeDetectorRef#detectChanges\n * change detection} on the component on every\n * [$digest](https://docs.angularjs.org/api/ng/type/$rootScope.Scope#$digest). If set to `false`,\n * change detection will still be performed when any of the component's inputs changes.\n * (Default: true)\n *\n * @returns a factory function that can be used to register the component in an\n * AngularJS module.\n *\n * @publicApi\n */\nexport function downgradeComponent(info: {\n component: Type<any>;\n downgradedModule?: string;\n propagateDigest?: boolean;\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 directiveFactory: IAnnotatedFunction = function(\n $compile: ICompileService, $injector: IInjectorService, $parse: IParseService): IDirective {\n // When using `downgradeModule()`, we need to handle certain things specially. For example:\n // - We always need to attach the component view to the `ApplicationRef` for it to be\n // dirty-checked.\n // - We need to ensure callbacks to Angular APIs (e.g. change detection) are run inside the\n // Angular zone.\n // NOTE: This is not needed, when using `UpgradeModule`, because `$digest()` will be run\n // inside the Angular zone (except if explicitly escaped, in which case we shouldn't\n // force it back in).\n const isNgUpgradeLite = getUpgradeAppType($injector) === UpgradeAppType.Lite;\n const wrapCallback: <T>(cb: () => T) => typeof cb =\n !isNgUpgradeLite ? cb => cb : cb => () => NgZone.isInAngularZone() ? cb() : ngZone.run(cb);\n let ngZone: NgZone;\n\n // When downgrading multiple modules, special handling is needed wrt injectors.\n const hasMultipleDowngradedModules =\n isNgUpgradeLite && (getDowngradedModuleCount($injector) > 1);\n\n return {\n restrict: 'E',\n terminal: true,\n require: [REQUIRE_INJECTOR, REQUIRE_NG_MODEL],\n link: (scope: IScope, element: IAugmentedJQuery, attrs: IAttributes, 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 ngModel: INgModelController = required[1];\n const parentInjector: Injector|Thenable<Injector>|undefined = required[0];\n let moduleInjector: Injector|Thenable<Injector>|undefined = undefined;\n let ranAsync = false;\n\n if (!parentInjector || hasMultipleDowngradedModules) {\n const downgradedModule = info.downgradedModule || '';\n const lazyModuleRefKey = `${LAZY_MODULE_REF}${downgradedModule}`;\n const attemptedAction = `instantiating component '${getTypeName(info.component)}'`;\n\n validateInjectionKey($injector, downgradedModule, lazyModuleRefKey, attemptedAction);\n\n const lazyModuleRef = $injector.get(lazyModuleRefKey) as LazyModuleRef;\n moduleInjector = lazyModuleRef.injector || lazyModuleRef.promise as Promise<Injector>;\n }\n\n // Notes:\n //\n // There are two injectors: `finalModuleInjector` and `finalParentInjector` (they might be\n // the same instance, but that is irrelevant):\n // - `finalModuleInjector` is used to retrieve `ComponentFactoryResolver`, thus it must be\n // on the same tree as the `NgModule` that declares this downgraded component.\n // - `finalParentInjector` is used for all other injection purposes.\n // (Note that Angular knows to only traverse the component-tree part of that injector,\n // when looking for an injectable and then switch to the module injector.)\n //\n // There are basically three cases:\n // - If there is no parent component (thus no `parentInjector`), we bootstrap the downgraded\n // `NgModule` and use its injector as both `finalModuleInjector` and\n // `finalParentInjector`.\n // - If there is a parent component (and thus a `parentInjector`) and we are sure that it\n // belongs to the same `NgModule` as this downgraded component (e.g. because there is only\n // one downgraded module, we use that `parentInjector` as both `finalModuleInjector` and\n // `finalParentInjector`.\n // - If there is a parent component, but it may belong to a different `NgModule`, then we\n // use the `parentInjector` as `finalParentInjector` and this downgraded component's\n // declaring `NgModule`'s injector as `finalModuleInjector`.\n // Note 1: If the `NgModule` is already bootstrapped, we just get its injector (we don't\n // bootstrap again).\n // Note 2: It is possible that (while there are multiple downgraded modules) this\n // downgraded component and its parent component both belong to the same NgModule.\n // In that case, we could have used the `parentInjector` as both\n // `finalModuleInjector` and `finalParentInjector`, but (for simplicity) we are\n // treating this case as if they belong to different `NgModule`s. That doesn't\n // really affect anything, since `parentInjector` has `moduleInjector` as ancestor\n // and trying to resolve `ComponentFactoryResolver` from either one will return\n // the same instance.\n\n // If there is a parent component, use its injector as parent injector.\n // If this is a \"top-level\" Angular component, use the module injector.\n const finalParentInjector = parentInjector || moduleInjector!;\n\n // If this is a \"top-level\" Angular component or the parent component may belong to a\n // different `NgModule`, use the module injector for module-specific dependencies.\n // If there is a parent component that belongs to the same `NgModule`, use its injector.\n const finalModuleInjector = moduleInjector || parentInjector!;\n\n const doDowngrade = (injector: Injector, moduleInjector: Injector) => {\n // Retrieve `ComponentFactoryResolver` from the injector tied to the `NgModule` this\n // component belongs to.\n const componentFactoryResolver: ComponentFactoryResolver =\n moduleInjector.get(ComponentFactoryResolver);\n const componentFactory: ComponentFactory<any> =\n componentFactoryResolver.resolveComponentFactory(info.component)!;\n\n if (!componentFactory) {\n throw new Error(`Expecting ComponentFactory for: ${getTypeName(info.component)}`);\n }\n\n const injectorPromise = new ParentInjectorPromise(element);\n const facade = new DowngradeComponentAdapter(\n element, attrs, scope, ngModel, injector, $compile, $parse, componentFactory,\n wrapCallback);\n\n const projectableNodes = facade.compileContents();\n facade.createComponent(projectableNodes);\n facade.setupInputs(isNgUpgradeLite, info.propagateDigest);\n facade.setupOutputs();\n facade.registerCleanup();\n\n injectorPromise.resolve(facade.getInjector());\n\n if (ranAsync) {\n // If this is run async, it is possible that it is not run inside a\n // digest and initial input values will not be detected.\n scope.$evalAsync(() => {});\n }\n };\n\n const downgradeFn =\n !isNgUpgradeLite ? doDowngrade : (pInjector: Injector, mInjector: Injector) => {\n if (!ngZone) {\n ngZone = pInjector.get(NgZone);\n }\n\n wrapCallback(() => doDowngrade(pInjector, mInjector))();\n };\n\n // NOTE:\n // Not using `ParentInjectorPromise.all()` (which is inherited from `SyncPromise`), because\n // Closure Compiler (or some related tool) complains:\n // `TypeError: ...$src$downgrade_component_ParentInjectorPromise.all is not a function`\n SyncPromise.all([finalParentInjector, finalModuleInjector])\n .then(([pInjector, mInjector]) => downgradeFn(pInjector, mInjector));\n\n ranAsync = true;\n }\n };\n };\n\n // bracket-notation because of closure - see #14441\n directiveFactory['$inject'] = [$COMPILE, $INJECTOR, $PARSE];\n return directiveFactory;\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 extends SyncPromise<Injector> {\n private injectorKey: string = controllerKey(INJECTOR_KEY);\n\n constructor(private element: IAugmentedJQuery) {\n super();\n\n // Store the promise on the element.\n element.data!(this.injectorKey, this);\n }\n\n override resolve(injector: Injector): void {\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 = null!;\n\n // Resolve the promise.\n super.resolve(injector);\n }\n}\n","/**\n * @license\n * Copyright Google LLC 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 '@angular/core';\nimport {IInjectorService} from './angular1';\nimport {$INJECTOR, INJECTOR_KEY} from './constants';\nimport {getTypeName, isFunction, validateInjectionKey} from './util';\n\n/**\n * @description\n *\n * A helper function to allow an Angular service to be accessible from AngularJS.\n *\n * *Part of the [upgrade/static](api?query=upgrade%2Fstatic)\n * library for hybrid upgrade apps that support AOT compilation*\n *\n * This helper function returns a factory function that provides access to the Angular\n * service identified by the `token` parameter.\n *\n * @usageNotes\n * ### Examples\n *\n * First ensure that the service to be downgraded is provided in an `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/full/module.ts region=\"ng2-heroes-service\"}\n *\n * and that we have included this in our upgrade app `NgModule`\n *\n * {@example upgrade/static/ts/full/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/full/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/full/module.ts region=\"example-app\"}\n *\n * <div class=\"alert is-important\">\n *\n * When using `downgradeModule()`, downgraded injectables will not be available until the Angular\n * module that provides them is instantiated. In order to be safe, you need to ensure that the\n * downgraded injectables are not used anywhere _outside_ the part of the app where it is\n * guaranteed that their module has been instantiated.\n *\n * For example, it is _OK_ to use a downgraded service in an upgraded component that is only used\n * from a downgraded Angular component provided by the same Angular module as the injectable, but\n * it is _not OK_ to use it in an AngularJS component that may be used independently of Angular or\n * use it in a downgraded Angular component from a different module.\n *\n * </div>\n *\n * @param token an `InjectionToken` that identifies a service provided from Angular.\n * @param downgradedModule the name of the downgraded module (if any) that the injectable\n * \"belongs to\", as returned by a call to `downgradeModule()`. It is the module, whose injector will\n * be used for instantiating the injectable.<br />\n * (This option is only necessary when using `downgradeModule()` to downgrade more than one Angular\n * module.)\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 * @publicApi\n */\nexport function downgradeInjectable(token: any, downgradedModule: string = ''): Function {\n const factory = function($injector: IInjectorService) {\n const injectorKey = `${INJECTOR_KEY}${downgradedModule}`;\n const injectableName = isFunction(token) ? getTypeName(token) : String(token);\n const attemptedAction = `instantiating injectable '${injectableName}'`;\n\n validateInjectionKey($injector, downgradedModule, injectorKey, attemptedAction);\n\n try {\n const injector: Injector = $injector.get(injectorKey);\n return injector.get(token);\n } catch (err) {\n throw new Error(`Error while ${attemptedAction}: ${err.message || err}`);\n }\n };\n (factory as any)['$inject'] = [$INJECTOR];\n\n return factory;\n}\n","/**\n * @license\n * Copyright Google LLC 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 package.\n */\n\nimport {Version} from '@angular/core';\n\n/**\n * @publicApi\n */\nexport const VERSION = new Version('13.0.2');\n","\n/**\n * @license\n * Copyright Google LLC 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 {IInjectorService} from '../../src/common/src/angular1';\n\n// We have to do a little dance to get the ng1 injector into the module injector.\n// We store the ng1 injector so that the provider in the module injector can access it\n// Then we \"get\" the ng1 injector from the module injector, which triggers the provider to read\n// the stored injector and release the reference to it.\nlet tempInjectorRef: IInjectorService|null = null;\nexport function setTempInjectorRef(injector: IInjectorService) {\n tempInjectorRef = injector;\n}\nexport function injectorFactory() {\n if (!tempInjectorRef) {\n throw new Error('Trying to get the AngularJS injector before it being set.');\n }\n\n const injector: IInjectorService = tempInjectorRef;\n tempInjectorRef = null; // clear the value to prevent memory leaks\n return injector;\n}\n\nexport function rootScopeFactory(i: IInjectorService) {\n return i.get('$rootScope');\n}\n\nexport function compileFactory(i: IInjectorService) {\n return i.get('$compile');\n}\n\nexport function parseFactory(i: IInjectorService) {\n return i.get('$parse');\n}\n\nexport const angular1Providers = [\n // We must use exported named functions for the ng2 factories to keep the compiler happy:\n // > Metadata collected contains an error that will be reported at runtime:\n // > Function calls are not supported.\n // > Consider replacing the function or lambda with a reference to an exported function\n {provide: '$injector', useFactory: injectorFactory, deps: []},\n {provide: '$rootScope', useFactory: rootScopeFactory, deps: ['$injector']},\n {provide: '$compile', useFactory: compileFactory, deps: ['$injector']},\n {provide: '$parse', useFactory: parseFactory, deps: ['$injector']}\n];\n","/**\n * @license\n * Copyright Google LLC 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, ɵNOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR as NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR} from '@angular/core';\n\n\nexport class NgAdapterInjector implements Injector {\n constructor(private modInjector: Injector) {}\n\n // When Angular locate a service in the component injector tree, the not found value is set to\n // `NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR`. In such a case we should not walk up to the module\n // injector.\n // AngularJS only supports a single tree and should always check the module injector.\n get(token: any, notFoundValue?: any): any {\n if (notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR) {\n return notFoundValue;\n }\n\n return this.modInjector.get(token, notFoundValue);\n }\n}\n","/**\n * @license\n * Copyright Google LLC 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, NgModuleFactory, NgModuleRef, PlatformRef, StaticProvider} from '@angular/core';\nimport {platformBrowser} from '@angular/platform-browser';\n\nimport {IInjectorService, IProvideService, module_ as angularModule} from '../../src/common/src/angular1';\nimport {$INJECTOR, $PROVIDE, DOWNGRADED_MODULE_COUNT_KEY, INJECTOR_KEY, LAZY_MODULE_REF, UPGRADE_APP_TYPE_KEY, UPGRADE_MODULE_NAME} from '../../src/common/src/constants';\nimport {destroyApp, getDowngradedModuleCount, isFunction, LazyModuleRef, UpgradeAppType} from '../../src/common/src/util';\n\nimport {angular1Providers, setTempInjectorRef} from './angular1_providers';\nimport {NgAdapterInjector} from './util';\n\n\nlet moduleUid = 0;\n\n/**\n * @description\n *\n * A helper function for creating an AngularJS module that can bootstrap an Angular module\n * \"on-demand\" (possibly lazily) when a {@link downgradeComponent downgraded component} needs to be\n * instantiated.\n *\n * *Part of the [upgrade/static](api?query=upgrade/static) library for hybrid upgrade apps that\n * support AOT compilation.*\n *\n * It allows loading/bootstrapping the Angular part of a hybrid application lazily and not having to\n * pay the cost up-front. For example, you can have an AngularJS application that uses Angular for\n * specific routes and only instantiate the Angular modules if/when the user visits one of these\n * routes.\n *\n * The Angular module will be bootstrapped once (when requested for the first time) and the same\n * reference will be used from that point onwards.\n *\n * `downgradeModule()` requires either an `NgModuleFactory` or a function:\n * - `NgModuleFactory`: If you pass an `NgModuleFactory`, it will be used to instantiate a module\n * using `platformBrowser`'s {@link PlatformRef#bootstrapModuleFactory bootstrapModuleFactory()}.\n * - `Function`: If you pass a function, it is expected to return a promise resolving to an\n * `NgModuleRef`. The function is called with an array of extra {@link StaticProvider Providers}\n * that are expected to be available from the returned `NgModuleRef`'s `Injector`.\n *\n * `downgradeModule()` returns the name of the created AngularJS wrapper module. You can use it to\n * declare a dependency in your main AngularJS module.\n *\n * {@example upgrade/static/ts/lite/module.ts region=\"basic-how-to\"}\n *\n * For more details on how to use `downgradeModule()` see\n * [Upgrading for Performance](guide/upgrade-performance).\n *\n * @usageNotes\n *\n * Apart from `UpgradeModule`, you can use the rest of the `upgrade/static` helpers as usual to\n * build a hybrid application. Note that the Angular pieces (e.g. downgraded services) will not be\n * available until the downgraded module has been bootstrapped, i.e. by instantiating a downgraded\n * component.\n *\n * <div class=\"alert is-important\">\n *\n * You cannot use `downgradeModule()` and `UpgradeModule` in the same hybrid application.<br />\n * Use one or the other.\n *\n * </div>\n *\n * ### Differences with `UpgradeModule`\n *\n * Besides their different API, there are two important internal differences between\n * `downgradeModule()` and `UpgradeModule` that affect the behavior of hybrid applications:\n *\n * 1. Unlike `UpgradeModule`, `downgradeModule()` does not bootstrap the main AngularJS module\n * inside the {@link NgZone Angular zone}.\n * 2. Unlike `UpgradeModule`, `downgradeModule()` does not automatically run a\n * [$digest()](https://docs.angularjs.org/api/ng/type/$rootScope.Scope#$digest) when changes are\n * detected in the Angular part of the application.\n *\n * What this means is that applications using `UpgradeModule` will run change detection more\n * frequently in order to ensure that both frameworks are properly notified about possible changes.\n * This will inevitably result in more change detection runs than necessary.\n *\n * `downgradeModule()`, on the other side, does not try to tie the two change detection systems as\n * tightly, restricting the explicit change detection runs only to cases where it knows it is\n * necessary (e.g. when the inputs of a downgraded component change). This improves performance,\n * especially in change-detection-heavy applications, but leaves it up to the developer to manually\n * notify each framework as needed.\n *\n * For a more detailed discussion of the differences and their implications, see\n * [Upgrading for Performance](guide/upgrade-performance).\n *\n * <div class=\"alert is-helpful\">\n *\n * You can manually trigger a change detection run in AngularJS using\n * [scope.$apply(...)](https://docs.angularjs.org/api/ng/type/$rootScope.Scope#$apply) or\n * [$rootScope.$digest()](https://docs.angularjs.org/api/ng/type/$rootScope.Scope#$digest).\n *\n * You can manually trigger a change detection run in Angular using {@link NgZone#run\n * ngZone.run(...)}.\n *\n * </div>\n *\n * ### Downgrading multiple modules\n *\n * It is possible to downgrade multiple modules and include them in an AngularJS application. In\n * that case, each downgraded module will be bootstrapped when an associated downgraded component or\n * injectable needs to be instantiated.\n *\n * Things to keep in mind, when downgrading multiple modules:\n *\n * - Each downgraded component/injectable needs to be explicitly associated with a downgraded\n * module. See `downgradeComponent()` and `downgradeInjectable()` for more details.\n *\n * - If you want some injectables to be shared among all downgraded modules, you can provide them as\n * `StaticProvider`s, when creating the `PlatformRef` (e.g. via `platformBrowser` or\n * `platformBrowserDynamic`).\n *\n * - When using {@link PlatformRef#bootstrapmodule `bootstrapModule()`} or\n * {@link PlatformRef#bootstrapmodulefactory `bootstrapModuleFactory()`} to bootstrap the\n * downgraded modules, each one is considered a \"root\" module. As a consequence, a new instance\n * will be created for every injectable provided in `\"root\"` (via\n * {@link Injectable#providedIn `providedIn`}).\n * If this is not your intention, you can have a shared module (that will act as act as the \"root\"\n * module) and create all downgraded modules using that module's injector:\n *\n * {@example upgrade/static/ts/lite-multi-shared/module.ts region=\"shared-root-module\"}\n *\n * @publicApi\n */\nexport function downgradeModule<T>(moduleFactoryOrBootstrapFn: NgModuleFactory<T>|(\n (extraProviders: StaticProvider[]) => Promise<NgModuleRef<T>>)): string {\n const lazyModuleName = `${UPGRADE_MODULE_NAME}.lazy${++moduleUid}`;\n const lazyModuleRefKey = `${LAZY_MODULE_REF}${lazyModuleName}`;\n const lazyInjectorKey = `${INJECTOR_KEY}${lazyModuleName}`;\n\n const bootstrapFn = isFunction(moduleFactoryOrBootstrapFn) ?\n moduleFactoryOrBootstrapFn :\n (extraProviders: StaticProvider[]) =>\n platformBrowser(extraProviders).bootstrapModuleFactory(moduleFactoryOrBootstrapFn);\n\n let injector: Injector;\n\n // Create an ng1 module to bootstrap.\n angularModule(lazyModuleName, [])\n .constant(UPGRADE_APP_TYPE_KEY, UpgradeAppType.Lite)\n .factory(INJECTOR_KEY, [lazyInjectorKey, identity])\n .factory(\n lazyInjectorKey,\n () => {\n if (!injector) {\n throw new Error(\n 'Trying to get the Angular injector before bootstrapping the corresponding ' +\n 'Angular module.');\n }\n return injector;\n })\n .factory(LAZY_MODULE_REF, [lazyModuleRefKey, identity])\n .factory(\n lazyModuleRefKey,\n [\n $INJECTOR,\n ($injector: IInjectorService) => {\n setTempInjectorRef($injector);\n const result: LazyModuleRef = {\n promise: bootstrapFn(angular1Providers).then(ref => {\n injector = result.injector = new NgAdapterInjector(ref.injector);\n injector.get($INJECTOR);\n\n // Destroy the AngularJS app once the Angular `PlatformRef` is destroyed.\n // This does not happen in a typical SPA scenario, but it might be useful for\n // other use-cases where disposing of an Angular/AngularJS app is necessary\n // (such as Hot Module Replacement (HMR)).\n // See https://github.com/angular/angular/issues/39935.\n injector.get(PlatformRef).onDestroy(() => destroyApp($injector));\n\n return injector;\n })\n };\n return result;\n }\n ])\n .config([\n $INJECTOR, $PROVIDE,\n ($injector: IInjectorService, $provide: IProvideService) => {\n $provide.constant(DOWNGRADED_MODULE_COUNT_KEY, getDowngradedModuleCount($injector) + 1);\n }\n ]);\n\n return lazyModuleName;\n}\n\nfunction identity<T = any>(x: T): T {\n return x;\n}\n","/**\n * @license\n * Copyright Google LLC 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, Injector, SimpleChanges} from '@angular/core';\n\nimport {DirectiveRequireProperty, element as angularElement, IAugmentedJQuery, ICloneAttachFunction, ICompileService, IController, IControllerService, IDirective, IHttpBackendService, IInjectorService, ILinkFn, IScope, ITemplateCacheService, SingleOrListOrMap} from './angular1';\nimport {$COMPILE, $CONTROLLER, $HTTP_BACKEND, $INJECTOR, $TEMPLATE_CACHE} from './constants';\nimport {cleanData, controllerKey, directiveNormalize, isFunction} from './util';\n\n\n\n// Constants\nconst 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}\n\n// Classes\nexport class UpgradeHelper {\n public readonly $injector: IInjectorService;\n public readonly element: Element;\n public readonly $element: IAugmentedJQuery;\n public readonly directive: IDirective;\n\n private readonly $compile: ICompileService;\n private readonly $controller: IControllerService;\n\n constructor(\n injector: Injector, private name: string, elementRef: ElementRef, directive?: 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 = angularElement(this.element);\n\n this.directive = directive || UpgradeHelper.getDirective(this.$injector, name);\n }\n\n static getDirective($injector: IInjectorService, name: string): IDirective {\n const directives: 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 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 static getTemplate(\n $injector: IInjectorService, directive: IDirective, fetchRemoteTemplate = false,\n $element?: IAugmentedJQuery): string|Promise<string> {\n if (directive.template !== undefined) {\n return getOrCall<string>(directive.template, $element);\n } else if (directive.templateUrl) {\n const $templateCache = $injector.get($TEMPLATE_CACHE) as ITemplateCacheService;\n const url = getOrCall<string>(directive.templateUrl, $element);\n const 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 $httpBackend = $injector.get($HTTP_BACKEND) as 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 buildController(controllerType: IController, $scope: 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 locals = {'$scope': $scope, '$element': this.$element};\n const controller = this.$controller(controllerType, locals, null, this.directive.controllerAs);\n\n this.$element.data!(controllerKey(this.directive.name!), controller);\n\n return controller;\n }\n\n compileTemplate(template?: string): ILinkFn {\n if (template === undefined) {\n template =\n UpgradeHelper.getTemplate(this.$injector, this.directive, false, this.$element) as string;\n }\n\n return this.compileHtml(template);\n }\n\n onDestroy($scope: IScope, controllerInstance?: any) {\n if (controllerInstance && isFunction(controllerInstance.$onDestroy)) {\n controllerInstance.$onDestroy();\n }\n $scope.$destroy();\n cleanData(this.element);\n }\n\n prepareTransclusion(): ILinkFn|undefined {\n const transclude = this.directive.transclude;\n const contentChildNodes = this.extractChildNodes();\n const attachChildrenFn: ILinkFn = (scope, cloneAttachFn) => {\n // Since AngularJS v1.5.8, `cloneAttachFn` will try to destroy the transclusion scope if\n // `$template` is empty. Since the transcluded content comes from Angular, not AngularJS,\n // there will be no transclusion scope here.\n // Provide a dummy `scope.$destroy()` method to prevent `cloneAttachFn` from throwing.\n scope = scope || {$destroy: () => undefined};\n return cloneAttachFn!($template, scope);\n };\n let $template = contentChildNodes;\n\n if (transclude) {\n const slots = Object.create(null);\n\n if (typeof transclude === 'object') {\n $template = [];\n\n const slotMap = Object.create(null);\n const filledSlots = Object.create(null);\n\n // Parse the element selectors.\n Object.keys(transclude).forEach(slotName => {\n let selector = transclude[slotName];\n const 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 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 nodes = slots[slotName];\n slots[slotName] = (scope: IScope, cloneAttach: ICloneAttachFunction) => {\n return cloneAttach!(nodes, scope);\n };\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 resolveAndBindRequiredControllers(controllerInstance: IControllerInstance|null) {\n const directiveRequire = this.getDirectiveRequire();\n const requiredControllers = this.resolveRequire(directiveRequire);\n\n if (controllerInstance && this.directive.bindToController && isMap(directiveRequire)) {\n const requiredControllersMap = 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 private compileHtml(html: string): ILinkFn {\n this.element.innerHTML = html;\n return this.$compile(this.element.childNodes);\n }\n\n private extractChildNodes(): Node[] {\n const childNodes: Node[] = [];\n let 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 private getDirectiveRequire(): DirectiveRequireProperty {\n const require = this.directive.require || (this.directive.controller && this.directive.name)!;\n\n if (isMap(require)) {\n Object.keys(require).forEach(key => {\n const value = require[key];\n const match = value.match(REQUIRE_PREFIX_RE)!;\n const 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 private resolveRequire(require: DirectiveRequireProperty, controllerInstance?: any):\n SingleOrListOrMap<IControllerInstance>|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 value: {[key: string]: IControllerInstance} = {};\n Object.keys(require).forEach(key => value[key] = this.resolveRequire(require[key])!);\n return value;\n } else if (typeof require === 'string') {\n const match = require.match(REQUIRE_PREFIX_RE)!;\n const inheritType = match[1] || match[3];\n\n const name = require.substring(match[0].length);\n const isOptional = !!match[2];\n const searchParents = !!inheritType;\n const startOnParent = inheritType === '^^';\n\n const ctrlKey = controllerKey(name);\n const elem = startOnParent ? this.$element.parent!() : this.$element;\n const value = searchParents ? elem.inheritedData!(ctrlKey) : 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 getOrCall<T>(property: T|Function, ...args: any[]): T {\n return isFunction(property) ? property(...args) : property;\n}\n\n// NOTE: Only works for `typeof T !== 'object'`.\nfunction isMap<T>(value: SingleOrListOrMap<T>): value is {[key: string]: T} {\n return value && !Array.isArray(value) && typeof value === 'object';\n}\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 LLC 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 {Directive, DoCheck, ElementRef, EventEmitter, Injector, OnChanges, OnDestroy, OnInit, SimpleChanges} from '@angular/core';\n\nimport {IAttributes, IAugmentedJQuery, IDirective, IInjectorService, ILinkFn, IScope, ITranscludeFunction} from '../../src/common/src/angular1';\nimport {$SCOPE} from '../../src/common/src/constants';\nimport {IBindingDestination, IControllerInstance, UpgradeHelper} from '../../src/common/src/upgrade_helper';\nimport {isFunction} from '../../src/common/src/util';\n\nconst NOT_SUPPORTED: any = 'NOT_SUPPORTED';\nconst INITIAL_VALUE = {\n __UNINITIALIZED__: true\n};\n\nclass Bindings {\n twoWayBoundProperties: string[] = [];\n twoWayBoundLastValues: any[] = [];\n\n expressionBoundProperties: string[] = [];\n\n propertyToOutputMap: {[propName: string]: string} = {};\n}\n\n/**\n * @description\n *\n * A helper class that allows an AngularJS component to be used from Angular.\n *\n * *Part of the [upgrade/static](api?query=upgrade%2Fstatic)\n * library for hybrid upgrade apps that support AOT compilation.*\n *\n * This helper class should be used as a base class for creating Angular directives\n * that wrap AngularJS components that need to be \"upgraded\".\n *\n * @usageNotes\n * ### Examples\n *\n * Let's assume that you have an AngularJS component called `ng1Hero` that needs\n * to be made available in Angular templates.\n *\n * {@example upgrade/static/ts/full/module.ts region=\"ng1-hero\"}\n *\n * We must create a `Directive` that will make this AngularJS component\n * available inside Angular templates.\n *\n * {@example upgrade/static/ts/full/module.ts region=\"ng1-hero-wrapper\"}\n *\n * In this example you can see that we must derive from the `UpgradeComponent`\n * base class but also provide an {@link Directive `@Directive`} decorator. This is\n * because the AOT compiler requires that this information is statically available at\n * compile time.\n *\n * Note that we must do the following:\n * * specify the directive's selector (`ng1-hero`)\n * * specify all inputs and outputs that the AngularJS component expects\n * * derive from `UpgradeComponent`\n * * call the base class from the constructor, passing\n * * the AngularJS name of the component (`ng1Hero`)\n * * the `ElementRef` and `Injector` for the component wrapper\n *\n * @publicApi\n * @extensible\n */\n@Directive()\nexport class UpgradeComponent implements OnInit, OnChanges, DoCheck, OnDestroy {\n private helper: UpgradeHelper;\n\n private $injector: IInjectorService;\n\n private element: Element;\n private $element: IAugmentedJQuery;\n private $componentScope: IScope;\n\n private directive: IDirective;\n private bindings: Bindings;\n\n // TODO(issue/24571): remove '!'.\n private controllerInstance!: IControllerInstance;\n // TODO(issue/24571): remove '!'.\n private bindingDestination!: IBindingDestination;\n\n // We will be instantiating the controller in the `ngOnInit` hook, when the\n // first `ngOnChanges` will have been already triggered. We store the\n // `SimpleChanges` and \"play them back\" later.\n // TODO(issue/24571): remove '!'.\n private pendingChanges!: SimpleChanges|null;\n\n // TODO(issue/24571): remove '!'.\n private unregisterDoCheckWatcher!: Function;\n\n /**\n * Create a new `UpgradeComponent` instance. You should not normally need to do this.\n * Instead you should derive a new class from this one and call the super constructor\n * from the base class.\n *\n * {@example upgrade/static/ts/full/module.ts region=\"ng1-hero-wrapper\" }\n *\n * * The `name` parameter should be the name of the AngularJS directive.\n * * The `elementRef` and `injector` parameters should be acquired from Angular by dependency\n * injection into the base class constructor.\n */\n constructor(private name: string, private elementRef: ElementRef, private injector: Injector) {\n this.helper = new UpgradeHelper(injector, name, elementRef);\n\n this.$injector = this.helper.$injector;\n\n this.element = this.helper.element;\n this.$element = this.helper.$element;\n\n this.directive = this.helper.directive;\n this.bindings = this.initializeBindings(this.directive);\n\n // We ask for the AngularJS scope from the Angular injector, since\n // we will put the new component scope onto the new injector for each component\n const $parentScope = injector.get($SCOPE);\n // QUESTION 1: Should we create an isolated scope if the scope is only true?\n // QUESTION 2: Should we make the scope accessible through `$element.scope()/isolateScope()`?\n this.$componentScope = $parentScope.$new(!!this.directive.scope);\n\n this.initializeOutputs();\n }\n\n ngOnInit() {\n // Collect contents, insert and compile template\n const attachChildNodes: ILinkFn|undefined = this.helper.prepareTransclusion();\n const linkFn = this.helper.compileTemplate();\n\n // Instantiate controller\n const controllerType = this.directive.controller;\n const bindToController = this.directive.bindToController;\n if (controllerType) {\n this.controllerInstance = this.helper.buildController(controllerType, this.$componentScope);\n } else if (bindToController) {\n throw new Error(`Upgraded directive '${\n this.directive.name}' specifies 'bindToController' but no controller.`);\n }\n\n // Set up outputs\n this.bindingDestination = bindToController ? this.controllerInstance : this.$componentScope;\n this.bindOutputs();\n\n // Require other controllers\n const requiredControllers =\n this.helper.resolveAndBindRequiredControllers(this.controllerInstance);\n\n // Hook: $onChanges\n if (this.pendingChanges) {\n this.forwardChanges(this.pendingChanges);\n this.pendingChanges = null;\n }\n\n // Hook: $onInit\n if (this.controllerInstance && isFunction(this.controllerInstance.$onInit)) {\n this.controllerInstance.$onInit();\n }\n\n // Hook: $doCheck\n if (this.controllerInstance && isFunction(this.controllerInstance.$doCheck)) {\n const callDoCheck = () => this.controllerInstance.$doCheck!();\n\n this.unregisterDoCheckWatcher = this.$componentScope.$parent.$watch(callDoCheck);\n callDoCheck();\n }\n\n // Linking\n const link = this.directive.link;\n const preLink = typeof link == 'object' && link.pre;\n const postLink = typeof link == 'object' ? link.post : link;\n const attrs: IAttributes = NOT_SUPPORTED;\n const transcludeFn: ITranscludeFunction = NOT_SUPPORTED;\n if (preLink) {\n preLink(this.$componentScope, this.$element, attrs, requiredControllers, transcludeFn);\n }\n\n linkFn(this.$componentScope, 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 ngOnChanges(changes: SimpleChanges) {\n if (!this.bindingDestination) {\n this.pendingChanges = changes;\n } else {\n this.forwardChanges(changes);\n }\n }\n\n ngDoCheck() {\n const twoWayBoundProperties = this.bindings.twoWayBoundProperties;\n const twoWayBoundLastValues = this.bindings.twoWayBoundLastValues;\n const propertyToOutputMap = this.bindings.propertyToOutputMap;\n\n twoWayBoundProperties.forEach((propName, idx) => {\n const newValue = this.bindingDestination[propName];\n const oldValue = twoWayBoundLastValues[idx];\n\n if (!Object.is(newValue, oldValue)) {\n const outputName = propertyToOutputMap[propName];\n const eventEmitter: EventEmitter<any> = (this as any)[outputName];\n\n eventEmitter.emit(newValue);\n twoWayBoundLastValues[idx] = newValue;\n }\n });\n }\n\n ngOnDestroy() {\n if (isFunction(this.unregisterDoCheckWatcher)) {\n this.unregisterDoCheckWatcher();\n }\n this.helper.onDestroy(this.$componentScope, this.controllerInstance);\n }\n\n private initializeBindings(directive: IDirective) {\n const btcIsObject = typeof directive.bindToController === 'object';\n if (btcIsObject && Object.keys(directive.scope!).length) {\n throw new Error(\n `Binding definitions on scope and controller at the same time is not supported.`);\n }\n\n const context = btcIsObject ? directive.bindToController : directive.scope;\n const bindings = new Bindings();\n\n if (typeof context == 'object') {\n Object.keys(context).forEach(propName => {\n const definition = context[propName];\n const bindingType = definition.charAt(0);\n\n // QUESTION: What about `=*`? Ignore? Throw? Support?\n\n switch (bindingType) {\n case '@':\n case '<':\n // We don't need to do anything special. They will be defined as inputs on the\n // upgraded component facade and the change propagation will be handled by\n // `ngOnChanges()`.\n break;\n case '=':\n bindings.twoWayBoundProperties.push(propName);\n bindings.twoWayBoundLastValues.push(INITIAL_VALUE);\n bindings.propertyToOutputMap[propName] = propName + 'Change';\n break;\n case '&':\n bindings.expressionBoundProperties.push(propName);\n bindings.propertyToOutputMap[propName] = propName;\n break;\n default:\n let json = JSON.stringify(context);\n throw new Error(\n `Unexpected mapping '${bindingType}' in '${json}' in '${this.name}' directive.`);\n }\n });\n }\n\n return bindings;\n }\n\n private initializeOutputs() {\n // Initialize the outputs for `=` and `&` bindings\n this.bindings.twoWayBoundProperties.concat(this.bindings.expressionBoundProperties)\n .forEach(propName => {\n const outputName = this.bindings.propertyToOutputMap[propName];\n (this as any)[outputName] = new EventEmitter();\n });\n }\n\n private bindOutputs() {\n // Bind `&` bindings to the corresponding outputs\n this.bindings.expressionBoundProperties.forEach(propName => {\n const outputName = this.bindings.propertyToOutputMap[propName];\n const emitter = (this as any)[outputName];\n\n this.bindingDestination[propName] = (value: any) => emitter.emit(value);\n });\n }\n\n private forwardChanges(changes: SimpleChanges) {\n // Forward input changes to `bindingDestination`\n Object.keys(changes).forEach(\n propName => this.bindingDestination[propName] = changes[propName].currentValue);\n\n if (isFunction(this.bindingDestination.$onChanges)) {\n this.bindingDestination.$onChanges(changes);\n }\n }\n}\n","/**\n * @license\n * Copyright Google LLC 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, isDevMode, NgModule, NgZone, PlatformRef, Testability} from '@angular/core';\n\nimport {bootstrap, element as angularElement, IInjectorService, IIntervalService, IProvideService, ITestabilityService, module_ as angularModule} from '../../src/common/src/angular1';\nimport {$$TESTABILITY, $DELEGATE, $INJECTOR, $INTERVAL, $PROVIDE, INJECTOR_KEY, LAZY_MODULE_REF, UPGRADE_APP_TYPE_KEY, UPGRADE_MODULE_NAME} from '../../src/common/src/constants';\nimport {controllerKey, destroyApp, LazyModuleRef, UpgradeAppType} from '../../src/common/src/util';\n\nimport {angular1Providers, setTempInjectorRef} from './angular1_providers';\nimport {NgAdapterInjector} from './util';\n\n\n\n/**\n * @description\n *\n * An `NgModule`, which you import to provide AngularJS core services,\n * and has an instance method used to bootstrap the hybrid upgrade application.\n *\n * *Part of the [upgrade/static](api?query=upgrade/static)\n * library for hybrid upgrade apps that support AOT compilation*\n *\n * The `upgrade/static` package contains helpers that allow AngularJS and Angular components\n * to be used together inside a hybrid upgrade application, which supports AOT compilation.\n *\n * Specifically, the classes and functions in the `upgrade/static` module allow the following:\n *\n * 1. Creation of an Angular directive that wraps and exposes an AngularJS component so\n * that it can be used in an Angular template. See `UpgradeComponent`.\n * 2. Creation of an AngularJS directive that wraps and exposes an Angular component so\n * that it can be used in an AngularJS template. See `downgradeComponent`.\n * 3. Creation of an Angular root injector provider that wraps and exposes an AngularJS\n * service so that it can be injected into an Angular context. See\n * {@link UpgradeModule#upgrading-an-angular-1-service Upgrading an AngularJS service} below.\n * 4. Creation of an AngularJS service that wraps and exposes an Angular injectable\n * so that it can be injected into an AngularJS context. See `downgradeInjectable`.\n * 3. Bootstrapping of a hybrid Angular application which contains both of the frameworks\n * coexisting in a single application.\n *\n * @usageNotes\n *\n * ```ts\n * import {UpgradeModule} from '@angular/upgrade/static';\n * ```\n *\n * See also the {@link UpgradeModule#examples examples} below.\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 the AngularJS framework codebase regardless of\n * where they are instantiated.\n * 4. Angular components always execute inside the Angular framework codebase regardless of\n * where they are instantiated.\n * 5. An AngularJS component can be \"upgraded\"\" to an Angular component. This is achieved by\n * defining an Angular directive, which bootstraps the AngularJS component at its location\n * in the DOM. See `UpgradeComponent`.\n * 6. An Angular component can be \"downgraded\" to an AngularJS component. This is achieved by\n * defining an AngularJS directive, which bootstraps the Angular component at its location\n * in the DOM. See `downgradeComponent`.\n * 7. Whenever an \"upgraded\"/\"downgraded\" component is instantiated the host element is owned by\n * the framework doing the instantiation. The other framework then instantiates and owns the\n * view for that component.\n * 1. This implies that the component bindings will always follow the semantics of the\n * instantiation framework.\n * 2. The DOM attributes are parsed by the framework that owns the current template. So\n * attributes in AngularJS templates must use kebab-case, while AngularJS templates must use\n * camelCase.\n * 3. However the template binding syntax will always use the Angular style, e.g. square\n * brackets (`[...]`) for property binding.\n * 8. Angular is bootstrapped first; AngularJS is bootstrapped second. AngularJS always owns the\n * root component of the application.\n * 9. The new application is running in an Angular zone, and therefore it no longer needs calls to\n * `$apply()`.\n *\n * ### The `UpgradeModule` class\n *\n * This class is an `NgModule`, which you import to provide AngularJS core services,\n * and has an instance method used to bootstrap the hybrid upgrade application.\n *\n * * Core AngularJS services\n * Importing this `NgModule` will add providers for the core\n * [AngularJS services](https://docs.angularjs.org/api/ng/service) to the root injector.\n *\n * * Bootstrap\n * The runtime instance of this class contains a {@link UpgradeModule#bootstrap `bootstrap()`}\n * method, which you use to bootstrap the top level AngularJS module onto an element in the\n * DOM for the hybrid upgrade app.\n *\n * It also contains properties to access the {@link UpgradeModule#injector root injector}, the\n * bootstrap `NgZone` and the\n * [AngularJS $injector](https://docs.angularjs.org/api/auto/service/$injector).\n *\n * ### Examples\n *\n * Import the `UpgradeModule` into your top level {@link NgModule Angular `NgModule`}.\n *\n * {@example upgrade/static/ts/full/module.ts region='ng2-module'}\n *\n * Then inject `UpgradeModule` into your Angular `NgModule` and use it to bootstrap the top level\n * [AngularJS module](https://docs.angularjs.org/api/ng/type/angular.Module) in the\n * `ngDoBootstrap()` method.\n *\n * {@example upgrade/static/ts/full/module.ts region='bootstrap-ng1'}\n *\n * Finally, kick off the whole process, by bootstrapping your top level Angular `NgModule`.\n *\n * {@example upgrade/static/ts/full/module.ts region='bootstrap-ng2'}\n *\n * {@a upgrading-an-angular-1-service}\n * ### Upgrading an AngularJS service\n *\n * There is no specific API for upgrading an AngularJS service. Instead you should just follow the\n * following recipe:\n *\n * Let's say you have an AngularJS service:\n *\n * {@example upgrade/static/ts/full/module.ts region=\"ng1-text-formatter-service\"}\n *\n * Then you should define an Angular provider to be included in your `NgModule` `providers`\n * property.\n *\n * {@example upgrade/static/ts/full/module.ts region=\"upgrade-ng1-service\"}\n *\n * Then you can use the \"upgraded\" AngularJS service by injecting it into an Angular component\n * or service.\n *\n * {@example upgrade/static/ts/full/module.ts region=\"use-ng1-upgraded-service\"}\n *\n * @publicApi\n */\n@NgModule({providers: [angular1Providers]})\nexport class UpgradeModule {\n /**\n * The AngularJS `$injector` for the upgrade application.\n */\n public $injector: any /*angular.IInjectorService*/;\n /** The Angular Injector **/\n public injector: Injector;\n\n constructor(\n /** The root `Injector` for the upgrade application. */\n injector: Injector,\n /** The bootstrap zone for the upgrade application */\n public ngZone: NgZone,\n /**\n * The owning `NgModuleRef`s `PlatformRef` instance.\n * This is used to tie the lifecycle of the bootstrapped AngularJS apps to that of the Angular\n * `PlatformRef`.\n */\n private platformRef: PlatformRef) {\n this.injector = new NgAdapterInjector(injector);\n }\n\n /**\n * Bootstrap an AngularJS application from this NgModule\n * @param element the element on which to bootstrap the AngularJS application\n * @param [modules] the AngularJS modules to bootstrap for this application\n * @param [config] optional extra AngularJS bootstrap configuration\n */\n bootstrap(\n element: Element, modules: string[] = [], config?: any /*angular.IAngularBootstrapConfig*/) {\n const INIT_MODULE_NAME = UPGRADE_MODULE_NAME + '.init';\n\n // Create an ng1 module to bootstrap\n angularModule(INIT_MODULE_NAME, [])\n\n .constant(UPGRADE_APP_TYPE_KEY, UpgradeAppType.Static)\n\n .value(INJECTOR_KEY, this.injector)\n\n .factory(\n LAZY_MODULE_REF, [INJECTOR_KEY, (injector: Injector) => ({injector} as LazyModuleRef)])\n\n .config([\n $PROVIDE, $INJECTOR,\n ($provide: IProvideService, $injector: IInjectorService) => {\n if ($injector.has($$TESTABILITY)) {\n $provide.decorator($$TESTABILITY, [\n $DELEGATE,\n (testabilityDelegate: ITestabilityService) => {\n const originalWhenStable: Function = testabilityDelegate.whenStable;\n const injector = this.injector;\n // Cannot use arrow function below because we need the context\n const newWhenStable = function(callback: Function) {\n originalWhenStable.call(testabilityDelegate, function() {\n const ng2Testability: Testability = injector.get(Testability);\n if (ng2Testability.isStable()) {\n callback();\n } else {\n ng2Testability.whenStable(\n newWhenStable.bind(testabilityDelegate, callback));\n }\n });\n };\n\n testabilityDelegate.whenStable = newWhenStable;\n return testabilityDelegate;\n }\n ]);\n }\n\n if ($injector.has($INTERVAL)) {\n $provide.decorator($INTERVAL, [\n $DELEGATE,\n (intervalDelegate: IIntervalService) => {\n // Wrap the $interval service so that setInterval is called outside NgZone,\n // but the callback is still invoked within it. This is so that $interval\n // won't block stability, which preserves the behavior from AngularJS.\n let wrappedInterval =\n (fn: Function, delay: number, count?: number, invokeApply?: boolean,\n ...pass: any[]) => {\n return this.ngZone.runOutsideAngular(() => {\n return intervalDelegate((...args: any[]) => {\n // Run callback in the next VM turn - $interval calls\n // $rootScope.$apply, and running the callback in NgZone will\n // cause a '$digest already in progress' error if it's in the\n // same vm turn.\n setTimeout(() => {\n this.ngZone.run(() => fn(...args));\n });\n }, delay, count, invokeApply, ...pass);\n });\n };\n\n (Object.keys(intervalDelegate) as (keyof IIntervalService)[])\n .forEach(prop => (wrappedInterval as any)[prop] = intervalDelegate[prop]);\n\n // the `flush` method will be present when ngMocks is used\n if (intervalDelegate.hasOwnProperty('flush')) {\n (wrappedInterval as any)['flush'] = () => {\n (intervalDelegate as any)['flush']();\n return wrappedInterval;\n };\n }\n\n return wrappedInterval;\n }\n ]);\n }\n }\n ])\n\n .run([\n $INJECTOR,\n ($injector: IInjectorService) => {\n this.$injector = $injector;\n const $rootScope = $injector.get('$rootScope');\n\n // Initialize the ng1 $injector provider\n setTempInjectorRef($injector);\n this.injector.get($INJECTOR);\n\n // Put the injector on the DOM, so that it can be \"required\"\n angularElement(element).data!(controllerKey(INJECTOR_KEY), this.injector);\n\n // Destroy the AngularJS app once the Angular `PlatformRef` is destroyed.\n // This does not happen in a typical SPA scenario, but it might be useful for\n // other use-cases where disposing of an Angular/AngularJS app is necessary\n // (such as Hot Module Replacement (HMR)).\n // See https://github.com/angular/angular/issues/39935.\n this.platformRef.onDestroy(() => destroyApp($injector));\n\n // Wire up the ng1 rootScope to run a digest cycle whenever the zone settles\n // We need to do this in the next tick so that we don't prevent the bootup stabilizing\n setTimeout(() => {\n const subscription = this.ngZone.onMicrotaskEmpty.subscribe(() => {\n if ($rootScope.$$phase) {\n if (isDevMode()) {\n console.warn(\n 'A digest was triggered while one was already in progress. This may mean that something is triggering digests outside the Angular zone.');\n }\n\n return $rootScope.$evalAsync();\n }\n\n return $rootScope.$digest();\n });\n $rootScope.$on('$destroy', () => {\n subscription.unsubscribe();\n });\n }, 0);\n }\n ]);\n\n const upgradeModule = angularModule(UPGRADE_MODULE_NAME, [INIT_MODULE_NAME].concat(modules));\n\n // Make sure resumeBootstrap() only exists if the current bootstrap is deferred\n const windowAngular = (window as any)['angular'];\n windowAngular.resumeBootstrap = undefined;\n\n // Bootstrap the AngularJS application inside our zone\n this.ngZone.run(() => {\n bootstrap(element, [upgradeModule.name], config);\n });\n\n // Patch resumeBootstrap() to run inside the ngZone\n if (windowAngular.resumeBootstrap) {\n const originalResumeBootstrap: () => void = windowAngular.resumeBootstrap;\n const ngZone = this.ngZone;\n windowAngular.resumeBootstrap = function() {\n let args = arguments;\n windowAngular.resumeBootstrap = originalResumeBootstrap;\n return ngZone.run(() => windowAngular.resumeBootstrap.apply(this, args));\n };\n }\n }\n}\n","/**\n * @license\n * Copyright Google LLC 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 {getAngularJSGlobal, getAngularLib, setAngularJSGlobal, setAngularLib} from '../src/common/src/angular1';\nexport {downgradeComponent} from '../src/common/src/downgrade_component';\nexport {downgradeInjectable} from '../src/common/src/downgrade_injectable';\nexport {VERSION} from '../src/common/src/version';\nexport {downgradeModule} from './src/downgrade_module';\nexport {UpgradeComponent} from './src/upgrade_component';\nexport {UpgradeModule} from './src/upgrade_module';\n\n\n// This file only re-exports items to appear in the public api. Keep it that way.\n","/**\n * @license\n * Copyright Google LLC 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"],"names":["angularElement","INITIAL_VALUE","NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR","angularModule","element"],"mappings":";;;;;;;;;;AAAA;;;;;;;AAmOA,SAAS,IAAI;IACX,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;AACnD,CAAC;AAED,MAAM,WAAW,IAA4B,MAAM,IAAI,EAAE,CAAQ,CAAC;AAClE,WAAW,CAAC,SAAS,GAAG,IAAI,CAAC;AAE7B,IAAI,OAAO,GAYP;IACF,SAAS,EAAE,IAAI;IACf,MAAM,EAAE,IAAI;IACZ,OAAO,EAAE,WAAW;IACpB,QAAQ,EAAE,IAAI;IACd,OAAO,EAAE,SAAgB;IACzB,eAAe,EAAE,IAAI;IACrB,cAAc,EAAE,IAAI;CACrB,CAAC;AAEF,IAAI;IACF,IAAI,MAAM,CAAC,cAAc,CAAC,SAAS,CAAC,EAAE;QACpC,OAAO,GAAS,MAAO,CAAC,OAAO,CAAC;KACjC;CACF;AAAC,WAAM;;CAEP;AAED;;;;;SAKgB,aAAa,CAAC,EAAO;IACnC,kBAAkB,CAAC,EAAE,CAAC,CAAC;AACzB,CAAC;AAED;;;;;SAKgB,aAAa;IAC3B,OAAO,kBAAkB,EAAE,CAAC;AAC9B,CAAC;AAED;;;;;;;SAOgB,kBAAkB,CAAC,EAAO;IACxC,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