{"version":3,"file":"static.mjs","sources":["../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/upgrade/src/common/src/component_info.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/upgrade/src/common/src/util.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/upgrade/src/common/src/downgrade_component_adapter.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/upgrade/src/common/src/promise_util.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/upgrade/src/common/src/downgrade_component.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/upgrade/src/common/src/downgrade_injectable.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/upgrade/src/common/src/security/trusted_types.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/upgrade/src/common/src/upgrade_helper.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/upgrade/static/src/angular1_providers.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/upgrade/static/src/util.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/upgrade/static/src/downgrade_module.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/upgrade/static/src/upgrade_component.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/upgrade/static/src/upgrade_module.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.dev/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  bracketAttr: string;\n  bracketParenAttr: string;\n  parenAttr: string;\n  onAttr: string;\n  bindAttr: string;\n  bindonAttr: string;\n\n  constructor(\n    public prop: string,\n    public attr: string,\n  ) {\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.slice(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.dev/license\n */\n\nimport {Injector, Type, ɵNG_MOD_DEF} from '@angular/core';\n\nimport {\n  element as angularElement,\n  IAugmentedJQuery,\n  IInjectorService,\n  INgModelController,\n  IRootScopeService,\n} from './angular1';\nimport {\n  $ROOT_ELEMENT,\n  $ROOT_SCOPE,\n  DOWNGRADED_MODULE_COUNT_KEY,\n  UPGRADE_APP_TYPE_KEY,\n} 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  console.error(e, e.stack);\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\n    .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)\n    ? $injector.get(DOWNGRADED_MODULE_COUNT_KEY)\n    : 0;\n}\n\nexport function getUpgradeAppType($injector: IInjectorService): UpgradeAppType {\n  return $injector.has(UPGRADE_APP_TYPE_KEY)\n    ? $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\nexport function isNgModuleType(value: any): value is Type<unknown> {\n  // NgModule class should have the `ɵmod` static property attached by AOT or JIT compiler.\n  return isFunction(value) && !!value[ɵNG_MOD_DEF];\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,\n  downgradedModule: string,\n  injectionKey: string,\n  attemptedAction: string,\n): 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      }\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\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\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}\n\nexport class Deferred<R> {\n  promise: Promise<R>;\n  resolve!: (value: R | PromiseLike<R>) => void;\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 (\n    typeof component.writeValue === 'function' && typeof component.registerOnChange === 'function'\n  );\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.dev/license\n */\n\nimport {\n  ApplicationRef,\n  ChangeDetectorRef,\n  ComponentRef,\n  createComponent,\n  EnvironmentInjector,\n  type EventEmitter,\n  Injector,\n  type ɵInputSignalNode as InputSignalNode,\n  OnChanges,\n  type OutputEmitterRef,\n  reflectComponentType,\n  ɵSIGNAL as SIGNAL,\n  SimpleChange,\n  SimpleChanges,\n  StaticProvider,\n  Testability,\n  TestabilityRegistry,\n  Type,\n} from '@angular/core';\n\nimport {\n  IAttributes,\n  IAugmentedJQuery,\n  ICompileService,\n  INgModelController,\n  IParseService,\n  IScope,\n} 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\n  constructor(\n    private element: IAugmentedJQuery,\n    private attrs: IAttributes,\n    private scope: IScope,\n    private ngModel: INgModelController,\n    private environmentInjector: EnvironmentInjector,\n    private parentInjector: Injector,\n    private $compile: ICompileService,\n    private $parse: IParseService,\n    private component: Type<any>,\n    private wrapCallback: <T>(cb: () => T) => () => T,\n    private readonly unsafelyOverwriteSignalInputs: boolean,\n  ) {\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  createComponentAndSetup(\n    projectableNodes: Node[][],\n    manuallyAttachView = false,\n    propagateDigest = true,\n  ): ComponentRef<any> {\n    const component = this.createComponent(projectableNodes);\n    this.setupInputs(manuallyAttachView, propagateDigest, component);\n    this.setupOutputs(component.componentRef);\n    this.registerCleanup(component.componentRef);\n\n    return component.componentRef;\n  }\n\n  private createComponent(projectableNodes: Node[][]): ComponentInfo {\n    const providers: StaticProvider[] = [{provide: $SCOPE, useValue: this.componentScope}];\n    const childInjector = Injector.create({\n      providers: providers,\n      parent: this.parentInjector,\n      name: 'DowngradeComponentAdapter',\n    });\n\n    const componentRef = createComponent(this.component, {\n      elementInjector: childInjector,\n      environmentInjector: this.environmentInjector,\n      projectableNodes,\n      hostElement: this.element[0] as Element,\n    });\n    const viewChangeDetector = componentRef.injector.get(ChangeDetectorRef);\n    const changeDetector = componentRef.changeDetectorRef;\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 = componentRef.injector.get(Testability, null);\n    if (testability) {\n      componentRef.injector\n        .get(TestabilityRegistry)\n        .registerApplication(componentRef.location.nativeElement, testability);\n    }\n\n    hookupNgModel(this.ngModel, componentRef.instance);\n\n    return {viewChangeDetector, componentRef, changeDetector};\n  }\n\n  private setupInputs(\n    manuallyAttachView: boolean,\n    propagateDigest = true,\n    {componentRef, changeDetector, viewChangeDetector}: ComponentInfo,\n  ): void {\n    const attrs = this.attrs;\n    const inputs = reflectComponentType(this.component)?.inputs ?? [];\n    for (const input of inputs) {\n      const inputBinding = new PropertyBinding(input.propName, input.templateName);\n      let expr: string | null = null;\n\n      if (attrs.hasOwnProperty(inputBinding.attr)) {\n        const observeFn = ((prop, isSignal) => {\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(componentRef, prop, prevValue, currValue, isSignal);\n              prevValue = currValue;\n            }\n          };\n        })(inputBinding.prop, input.isSignal);\n        attrs.$observe(inputBinding.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[inputBinding.attr]);\n        });\n      } else if (attrs.hasOwnProperty(inputBinding.bindAttr)) {\n        expr = attrs[inputBinding.bindAttr];\n      } else if (attrs.hasOwnProperty(inputBinding.bracketAttr)) {\n        expr = attrs[inputBinding.bracketAttr];\n      } else if (attrs.hasOwnProperty(inputBinding.bindonAttr)) {\n        expr = attrs[inputBinding.bindonAttr];\n      } else if (attrs.hasOwnProperty(inputBinding.bracketParenAttr)) {\n        expr = attrs[inputBinding.bracketParenAttr];\n      }\n      if (expr != null) {\n        const watchFn = (\n          (prop, isSignal) => (currValue: unknown, prevValue: unknown) =>\n            this.updateInput(componentRef, prop, prevValue, currValue, isSignal)\n        )(inputBinding.prop, input.isSignal);\n        this.componentScope.$watch(expr, watchFn);\n      }\n    }\n\n    // Invoke `ngOnChanges()` and Change Detection (when necessary)\n    const detectChanges = () => changeDetector.detectChanges();\n    const prototype = this.component.prototype;\n    this.implementsOnChanges = !!(prototype && (<OnChanges>prototype).ngOnChanges);\n\n    this.componentScope.$watch(\n      () => this.inputChangeCount,\n      this.wrapCallback(() => {\n        // Invoke `ngOnChanges()`\n        if (this.implementsOnChanges) {\n          const inputChanges = this.inputChanges;\n          this.inputChanges = {};\n          (<OnChanges>componentRef.instance).ngOnChanges(inputChanges);\n        }\n\n        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\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(componentRef.hostView);\n      });\n    }\n  }\n\n  private setupOutputs(componentRef: ComponentRef<any>) {\n    const attrs = this.attrs;\n    const outputs = reflectComponentType(this.component)?.outputs ?? [];\n    for (const output of outputs) {\n      const outputBindings = new PropertyBinding(output.propName, output.templateName);\n      const bindonAttr = outputBindings.bindonAttr.substring(\n        0,\n        outputBindings.bindonAttr.length - 6,\n      );\n      const bracketParenAttr = `[(${outputBindings.bracketParenAttr.substring(\n        2,\n        outputBindings.bracketParenAttr.length - 8,\n      )})]`;\n      // order below is important - first update bindings then evaluate expressions\n      if (attrs.hasOwnProperty(bindonAttr)) {\n        this.subscribeToOutput(componentRef, outputBindings, attrs[bindonAttr], true);\n      }\n      if (attrs.hasOwnProperty(bracketParenAttr)) {\n        this.subscribeToOutput(componentRef, outputBindings, attrs[bracketParenAttr], true);\n      }\n      if (attrs.hasOwnProperty(outputBindings.onAttr)) {\n        this.subscribeToOutput(componentRef, outputBindings, attrs[outputBindings.onAttr]);\n      }\n      if (attrs.hasOwnProperty(outputBindings.parenAttr)) {\n        this.subscribeToOutput(componentRef, outputBindings, attrs[outputBindings.parenAttr]);\n      }\n    }\n  }\n\n  private subscribeToOutput(\n    componentRef: ComponentRef<any>,\n    output: PropertyBinding,\n    expr: string,\n    isAssignment: boolean = false,\n  ) {\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 = componentRef.instance[output.prop] as EventEmitter<any> | OutputEmitterRef<any>;\n    if (emitter) {\n      const subscription = emitter.subscribe(\n        isAssignment\n          ? (v: any) => setter!(this.scope, v)\n          : (v: any) => getter(this.scope, {'$event': v}),\n      );\n      componentRef.onDestroy(() => subscription.unsubscribe());\n    } else {\n      throw new Error(\n        `Missing emitter '${output.prop}' on component '${getTypeName(this.component)}'!`,\n      );\n    }\n  }\n\n  private registerCleanup(componentRef: ComponentRef<any>) {\n    const testabilityRegistry = componentRef.injector.get(TestabilityRegistry);\n    const destroyComponentRef = this.wrapCallback(() => 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(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  private updateInput(\n    componentRef: ComponentRef<any>,\n    prop: string,\n    prevValue: any,\n    currValue: any,\n    isSignal: boolean,\n  ) {\n    if (this.implementsOnChanges) {\n      this.inputChanges[prop] = new SimpleChange(prevValue, currValue, prevValue === currValue);\n    }\n\n    this.inputChangeCount++;\n    const instanceProp = componentRef.instance[prop];\n    const node = instanceProp?.[SIGNAL] as InputSignalNode<unknown, unknown> | undefined;\n    // Model signals are writable signal inputs (they expose `.set()` and `applyValueToInputSignal`).\n    // Overwriting them would destroy the internal OutputEmitterRef that setupOutputs() already\n    // subscribed to, severing the Angular→AngularJS two-way binding. Always use\n    // applyValueToInputSignal for model signals regardless of the unsafelyOverwriteSignalInputs\n    // flag. Check applyValueToInputSignal (not just .set) to distinguish model() from a plain\n    // WritableSignal used with @Input(), which also has .set() but does not support this method.\n    const isModelSignal =\n      node != null &&\n      typeof instanceProp.set === 'function' &&\n      typeof node.applyValueToInputSignal === 'function';\n    if (isModelSignal || (isSignal && !this.unsafelyOverwriteSignalInputs)) {\n      node!.applyValueToInputSignal(node!, currValue);\n    } else {\n      componentRef.instance[prop] = currValue;\n    }\n  }\n\n  private groupProjectableNodes() {\n    let ngContentSelectors = reflectComponentType(this.component)?.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(\n  ngContentSelectors: readonly string[],\n  nodes: Node[],\n): 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(\n  element: any,\n  ngContentSelectors: readonly string[],\n): 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\nfunction matchesSelector(el: any, selector: string): boolean {\n  const elProto = <any>Element.prototype;\n\n  return el.nodeType === Node.ELEMENT_NODE\n    ? // matches is supported by all browsers from 2014 onwards except non-chromium edge\n      (elProto.matches ?? elProto.msMatchesSelector).call(el, selector)\n    : false;\n}\n\ninterface ComponentInfo {\n  componentRef: ComponentRef<any>;\n  changeDetector: ChangeDetectorRef;\n  viewChangeDetector: ChangeDetectorRef;\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.dev/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.dev/license\n */\n\nimport {EnvironmentInjector, Injector, NgZone, Type} from '@angular/core';\n\nimport {\n  IAnnotatedFunction,\n  IAttributes,\n  IAugmentedJQuery,\n  ICompileService,\n  IDirective,\n  IInjectorService,\n  INgModelController,\n  IParseService,\n  IScope,\n} from './angular1';\nimport {\n  $COMPILE,\n  $INJECTOR,\n  $PARSE,\n  INJECTOR_KEY,\n  LAZY_MODULE_REF,\n  REQUIRE_INJECTOR,\n  REQUIRE_NG_MODEL,\n} from './constants';\nimport {DowngradeComponentAdapter} from './downgrade_component_adapter';\nimport {SyncPromise, Thenable} from './promise_util';\nimport {\n  controllerKey,\n  getDowngradedModuleCount,\n  getTypeName,\n  getUpgradeAppType,\n  LazyModuleRef,\n  UpgradeAppType,\n  validateInjectionKey,\n} from './util';\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](https://angular.io/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 /api/core/ChangeDetectorRef#detectChanges detectChanges} on the\n * component on every {@link https://docs.angularjs.org/api/ng/type/$rootScope.Scope#$digest $digest}.\n *   If set to `false`, 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,\n    $injector: IInjectorService,\n    $parse: IParseService,\n  ): IDirective {\n    const unsafelyOverwriteSignalInputs =\n      (info as {unsafelyOverwriteSignalInputs?: boolean}).unsafelyOverwriteSignalInputs ?? false;\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 = !isNgUpgradeLite\n      ? (cb) => cb\n      : (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 = isNgUpgradeLite && getDowngradedModuleCount($injector) > 1;\n\n    return {\n      restrict: 'E',\n      terminal: true,\n      require: [REQUIRE_INJECTOR, REQUIRE_NG_MODEL],\n      // Controller needs to be set so that `angular-component-router.js` (from beta Angular 2)\n      // configuration properties can be made available. See:\n      // See G3: javascript/angular2/angular1_router_lib.js\n      // https://github.com/angular/angular.js/blob/47bf11ee94664367a26ed8c91b9b586d3dd420f5/src/ng/compile.js#L1670-L1691.\n      controller: function () {},\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;\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          const injectorPromise = new ParentInjectorPromise(element);\n          const facade = new DowngradeComponentAdapter(\n            element,\n            attrs,\n            scope,\n            ngModel,\n            moduleInjector.get(EnvironmentInjector),\n            injector,\n            $compile,\n            $parse,\n            info.component,\n            wrapCallback,\n            unsafelyOverwriteSignalInputs,\n          );\n\n          const projectableNodes = facade.compileContents();\n          const componentRef = facade.createComponentAndSetup(\n            projectableNodes,\n            isNgUpgradeLite,\n            info.propagateDigest,\n          );\n\n          injectorPromise.resolve(componentRef.injector);\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 = !isNgUpgradeLite\n          ? doDowngrade\n          : (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]).then(([pInjector, mInjector]) =>\n          downgradeFn(pInjector, mInjector),\n        );\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.dev/license\n */\n\nimport {Injector} from '@angular/core';\n\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=\"docs-alert docs-alert-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 as Error).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.dev/license\n */\n\n/**\n * @fileoverview\n * A module to facilitate use of a Trusted Types policy internally within\n * the upgrade package. It lazily constructs the Trusted Types policy, providing\n * helper utilities for promoting strings to Trusted Types. When Trusted Types\n * are not available, strings are used as a fallback.\n * @security All use of this module is security-sensitive and should go through\n * security review.\n */\n\nimport {TrustedHTML, TrustedTypePolicy, TrustedTypePolicyFactory} from './trusted_types_defs';\n\n/**\n * The Trusted Types policy, or null if Trusted Types are not\n * enabled/supported, or undefined if the policy has not been created yet.\n */\nlet policy: TrustedTypePolicy | null | undefined;\n\n/**\n * Returns the Trusted Types policy, or null if Trusted Types are not\n * enabled/supported. The first call to this function will create the policy.\n */\nfunction getPolicy(): TrustedTypePolicy | null {\n  if (policy === undefined) {\n    policy = null;\n    const windowWithTrustedTypes = window as unknown as {trustedTypes?: TrustedTypePolicyFactory};\n    if (windowWithTrustedTypes.trustedTypes) {\n      try {\n        policy = windowWithTrustedTypes.trustedTypes.createPolicy('angular#unsafe-upgrade', {\n          createHTML: (s: string) => s,\n        });\n      } catch {\n        // trustedTypes.createPolicy throws if called with a name that is\n        // already registered, even in report-only mode. Until the API changes,\n        // catch the error not to break the applications functionally. In such\n        // cases, the code will fall back to using strings.\n      }\n    }\n  }\n  return policy;\n}\n\n/**\n * Unsafely promote a legacy AngularJS template to a TrustedHTML, falling back\n * to strings when Trusted Types are not available.\n * @security This is a security-sensitive function; any use of this function\n * must go through security review. In particular, the template string should\n * always be under full control of the application author, as untrusted input\n * can cause an XSS vulnerability.\n */\nexport function trustedHTMLFromLegacyTemplate(html: string): TrustedHTML | string {\n  return getPolicy()?.createHTML(html) || html;\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.dev/license\n */\n\nimport {ElementRef, Injector, SimpleChanges} from '@angular/core';\n\nimport {\n  DirectiveRequireProperty,\n  element as angularElement,\n  IAugmentedJQuery,\n  ICloneAttachFunction,\n  ICompileService,\n  IController,\n  IControllerService,\n  IDirective,\n  IHttpBackendService,\n  IInjectorService,\n  ILinkFn,\n  IScope,\n  ITemplateCacheService,\n  SingleOrListOrMap,\n} from './angular1';\nimport {$COMPILE, $CONTROLLER, $HTTP_BACKEND, $INJECTOR, $TEMPLATE_CACHE} from './constants';\nimport {cleanData, controllerKey, directiveNormalize, isFunction} from './util';\nimport {TrustedHTML} from './security/trusted_types_defs';\nimport {trustedHTMLFromLegacyTemplate} from './security/trusted_types';\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,\n    private name: string,\n    elementRef: ElementRef,\n    directive?: IDirective,\n  ) {\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,\n    directive: IDirective,\n    fetchRemoteTemplate = false,\n    $element?: IAugmentedJQuery,\n  ): string | TrustedHTML | Promise<string | TrustedHTML> {\n    if (directive.template !== undefined) {\n      return trustedHTMLFromLegacyTemplate(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 trustedHTMLFromLegacyTemplate(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(trustedHTMLFromLegacyTemplate($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 | TrustedHTML): ILinkFn {\n    if (template === undefined) {\n      template = UpgradeHelper.getTemplate(this.$injector, this.directive, false, this.$element) as\n        | string\n        | TrustedHTML;\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)\n          .filter((slotName) => slots[slotName])\n          .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 | TrustedHTML): 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      (childNode as Element | Comment | Text).remove();\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.entries(require).forEach(([key, value]) => {\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(\n    require: DirectiveRequireProperty,\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\n      return value;\n    } else {\n      throw new Error(\n        `Unrecognized 'require' syntax on upgraded directive '${this.name}': ${require}`,\n      );\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.dev/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.dev/license\n */\n\nimport {\n  Injector,\n  ɵNOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR as NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR,\n} from '@angular/core';\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.dev/license\n */\n\nimport {\n  Injector,\n  NgModuleFactory,\n  NgModuleRef,\n  PlatformRef,\n  StaticProvider,\n  Type,\n  ɵinternalProvideZoneChangeDetection as internalProvideZoneChangeDetection,\n} from '@angular/core';\nimport {platformBrowser} from '@angular/platform-browser';\n\nimport {ɵangular1, ɵconstants, ɵutil} from '../common';\n\nimport {angular1Providers, setTempInjectorRef} from './angular1_providers';\nimport {NgAdapterInjector} from './util';\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`, `NgModule` class 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 *   NOTE: this type of the argument is deprecated. Please either provide an `NgModule` class or a\n *   bootstrap function instead.\n * - `NgModule` class: If you pass an NgModule class, it will be used to instantiate a module\n *   using `platformBrowser`'s {@link PlatformRef#bootstrapModule bootstrapModule()}.\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](https://angular.io/guide/upgrade).\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=\"docs-alert docs-alert-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](https://angular.io/guide/upgrade).\n *\n * <div class=\"docs-alert docs-alert-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 /api/core/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>(\n  moduleOrBootstrapFn: Type<T> | ((extraProviders: StaticProvider[]) => Promise<NgModuleRef<T>>),\n): string;\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`, `NgModule` class 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 *   NOTE: this type of the argument is deprecated. Please either provide an `NgModule` class or a\n *   bootstrap function instead.\n * - `NgModule` class: If you pass an NgModule class, it will be used to instantiate a module\n *   using `platformBrowser`'s {@link PlatformRef#bootstrapModule bootstrapModule()}.\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](https://angular.io/guide/upgrade).\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=\"docs-alert docs-alert-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](https://angular.io/guide/upgrade).\n *\n * <div class=\"docs-alert docs-alert-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 /api/core/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 *\n * @deprecated Passing `NgModuleFactory` as the `downgradeModule` function argument is deprecated,\n *     please pass an NgModule class reference instead.\n */\nexport function downgradeModule<T>(moduleOrBootstrapFn: NgModuleFactory<T>): string;\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`, `NgModule` class 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 *   NOTE: this type of the argument is deprecated. Please either provide an `NgModule` class or a\n *   bootstrap function instead.\n * - `NgModule` class: If you pass an NgModule class, it will be used to instantiate a module\n *   using `platformBrowser`'s {@link PlatformRef#bootstrapModule bootstrapModule()}.\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](https://angular.io/guide/upgrade).\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=\"docs-alert docs-alert-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](https://angular.io/guide/upgrade).\n *\n * <div class=\"docs-alert docs-alert-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 /api/core/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>(\n  moduleOrBootstrapFn:\n    | Type<T>\n    | NgModuleFactory<T>\n    | ((extraProviders: StaticProvider[]) => Promise<NgModuleRef<T>>),\n): string {\n  const lazyModuleName = `${ɵconstants.UPGRADE_MODULE_NAME}.lazy${++moduleUid}`;\n  const lazyModuleRefKey = `${ɵconstants.LAZY_MODULE_REF}${lazyModuleName}`;\n  const lazyInjectorKey = `${ɵconstants.INJECTOR_KEY}${lazyModuleName}`;\n\n  let bootstrapFn: (extraProviders: StaticProvider[]) => Promise<NgModuleRef<T>>;\n  if (ɵutil.isNgModuleType(moduleOrBootstrapFn)) {\n    // NgModule class\n    bootstrapFn = (extraProviders: StaticProvider[]) =>\n      platformBrowser(extraProviders).bootstrapModule(moduleOrBootstrapFn, {\n        applicationProviders: [internalProvideZoneChangeDetection({})],\n      });\n  } else if (!ɵutil.isFunction(moduleOrBootstrapFn)) {\n    // NgModule factory\n    bootstrapFn = (extraProviders: StaticProvider[]) =>\n      platformBrowser(extraProviders).bootstrapModuleFactory(moduleOrBootstrapFn, {\n        applicationProviders: [internalProvideZoneChangeDetection({})],\n      });\n  } else {\n    // bootstrap function\n    bootstrapFn = moduleOrBootstrapFn;\n  }\n\n  let injector: Injector;\n\n  // Create an ng1 module to bootstrap.\n  ɵangular1\n    .module_(lazyModuleName, [])\n    .constant(ɵconstants.UPGRADE_APP_TYPE_KEY, ɵutil.UpgradeAppType.Lite)\n    .factory(ɵconstants.INJECTOR_KEY, [lazyInjectorKey, identity])\n    .factory(lazyInjectorKey, () => {\n      if (!injector) {\n        throw new Error(\n          'Trying to get the Angular injector before bootstrapping the corresponding ' +\n            'Angular module.',\n        );\n      }\n      return injector;\n    })\n    .factory(ɵconstants.LAZY_MODULE_REF, [lazyModuleRefKey, identity])\n    .factory(lazyModuleRefKey, [\n      ɵconstants.$INJECTOR,\n      ($injector: ɵangular1.IInjectorService) => {\n        setTempInjectorRef($injector);\n        const result: ɵutil.LazyModuleRef = {\n          promise: bootstrapFn(angular1Providers).then((ref) => {\n            injector = result.injector = new NgAdapterInjector(ref.injector);\n            injector.get(ɵconstants.$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(() => ɵutil.destroyApp($injector));\n\n            return injector;\n          }),\n        };\n        return result;\n      },\n    ])\n    .config([\n      ɵconstants.$INJECTOR,\n      ɵconstants.$PROVIDE,\n      ($injector: ɵangular1.IInjectorService, $provide: ɵangular1.IProvideService) => {\n        $provide.constant(\n          ɵconstants.DOWNGRADED_MODULE_COUNT_KEY,\n          ɵutil.getDowngradedModuleCount($injector) + 1,\n        );\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.dev/license\n */\n\nimport {\n  Directive,\n  DoCheck,\n  ElementRef,\n  EventEmitter,\n  Injector,\n  OnChanges,\n  OnDestroy,\n  OnInit,\n  SimpleChanges,\n} from '@angular/core';\n\nimport {ɵangular1, ɵconstants, ɵupgradeHelper, ɵutil} from '../common';\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.UpgradeHelper;\n\n  private $element: ɵangular1.IAugmentedJQuery;\n  private $componentScope: ɵangular1.IScope;\n\n  private directive: ɵangular1.IDirective;\n  private bindings: Bindings;\n\n  private controllerInstance?: ɵupgradeHelper.IControllerInstance;\n  private bindingDestination?: ɵupgradeHelper.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  private pendingChanges: SimpleChanges | null = null;\n\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(name: string, elementRef: ElementRef, injector: Injector) {\n    this.helper = new ɵupgradeHelper.UpgradeHelper(injector, name, elementRef);\n\n    this.$element = this.helper.$element;\n\n    this.directive = this.helper.directive;\n    this.bindings = this.initializeBindings(this.directive, name);\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(ɵconstants.$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  /** @docs-private */\n  ngOnInit() {\n    // Collect contents, insert and compile template\n    const attachChildNodes: ɵangular1.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    let controllerInstance = controllerType\n      ? this.helper.buildController(controllerType, this.$componentScope)\n      : undefined;\n    let bindingDestination: ɵupgradeHelper.IBindingDestination;\n\n    if (!bindToController) {\n      bindingDestination = this.$componentScope;\n    } else if (controllerType && controllerInstance) {\n      bindingDestination = controllerInstance;\n    } else {\n      throw new Error(\n        `Upgraded directive '${this.directive.name}' specifies 'bindToController' but no controller.`,\n      );\n    }\n    this.controllerInstance = controllerInstance;\n    this.bindingDestination = bindingDestination;\n\n    // Set up outputs\n    this.bindOutputs(bindingDestination);\n\n    // Require other controllers\n    const requiredControllers = this.helper.resolveAndBindRequiredControllers(controllerInstance);\n\n    // Hook: $onChanges\n    if (this.pendingChanges) {\n      this.forwardChanges(this.pendingChanges, bindingDestination);\n      this.pendingChanges = null;\n    }\n\n    // Hook: $onInit\n    if (this.controllerInstance && ɵutil.isFunction(this.controllerInstance.$onInit)) {\n      this.controllerInstance.$onInit();\n    }\n\n    // Hook: $doCheck\n    if (controllerInstance && ɵutil.isFunction(controllerInstance.$doCheck)) {\n      const callDoCheck = () => 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: ɵangular1.IAttributes = NOT_SUPPORTED;\n    const transcludeFn: ɵangular1.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 && ɵutil.isFunction(this.controllerInstance.$postLink)) {\n      this.controllerInstance.$postLink();\n    }\n  }\n\n  /** @docs-private */\n  ngOnChanges(changes: SimpleChanges) {\n    if (!this.bindingDestination) {\n      this.pendingChanges = changes;\n    } else {\n      this.forwardChanges(changes, this.bindingDestination);\n    }\n  }\n\n  /** @docs-private */\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  /** @docs-private */\n  ngOnDestroy() {\n    if (ɵutil.isFunction(this.unregisterDoCheckWatcher)) {\n      this.unregisterDoCheckWatcher();\n    }\n    this.helper.onDestroy(this.$componentScope, this.controllerInstance);\n  }\n\n  private initializeBindings(directive: ɵangular1.IDirective, name: string) {\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\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 '${name}' directive.`,\n            );\n        }\n      });\n    }\n\n    return bindings;\n  }\n\n  private initializeOutputs() {\n    // Initialize the outputs for `=` and `&` bindings\n    this.bindings.twoWayBoundProperties\n      .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(bindingDestination: ɵupgradeHelper.IBindingDestination) {\n    // Bind `&` bindings to the corresponding outputs\n    this.bindings.expressionBoundProperties.forEach((propName) => {\n      const outputName = this.bindings.propertyToOutputMap[propName];\n      const emitter: EventEmitter<any> = (this as any)[outputName];\n\n      bindingDestination[propName] = (value: any) => emitter.emit(value);\n    });\n  }\n\n  private forwardChanges(\n    changes: SimpleChanges,\n    bindingDestination: ɵupgradeHelper.IBindingDestination,\n  ) {\n    // Forward input changes to `bindingDestination`\n    Object.keys(changes).forEach(\n      (propName) => (bindingDestination[propName] = changes[propName].currentValue),\n    );\n\n    if (ɵutil.isFunction(bindingDestination.$onChanges)) {\n      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.dev/license\n */\n\nimport {\n  Injector,\n  ApplicationRef,\n  NgModule,\n  NgZone,\n  PlatformRef,\n  Testability,\n  ɵNoopNgZone,\n  ɵinternalProvideZoneChangeDetection,\n} from '@angular/core';\n\nimport {ɵangular1, ɵconstants, ɵutil} from '../common';\n\nimport {angular1Providers, setTempInjectorRef} from './angular1_providers';\nimport {NgAdapterInjector} from './util';\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 * 5. 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<br />\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<br />\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 Angular {@link NgModule 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 * ### 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, ɵinternalProvideZoneChangeDetection({})]})\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  private readonly applicationRef: ApplicationRef;\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  ) {\n    this.injector = new NgAdapterInjector(injector);\n    this.applicationRef = this.injector.get(ApplicationRef);\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   * @return The value returned by\n   *     [angular.bootstrap()](https://docs.angularjs.org/api/ng/function/angular.bootstrap).\n   */\n  bootstrap(\n    element: Element,\n    modules: string[] = [],\n    config?: any /*angular.IAngularBootstrapConfig*/,\n  ): any /*ReturnType<typeof angular.bootstrap>*/ {\n    const INIT_MODULE_NAME = ɵconstants.UPGRADE_MODULE_NAME + '.init';\n\n    // Create an ng1 module to bootstrap\n    ɵangular1\n      .module_(INIT_MODULE_NAME, [])\n\n      .constant(ɵconstants.UPGRADE_APP_TYPE_KEY, ɵutil.UpgradeAppType.Static)\n\n      .value(ɵconstants.INJECTOR_KEY, this.injector)\n\n      .factory(ɵconstants.LAZY_MODULE_REF, [\n        ɵconstants.INJECTOR_KEY,\n        (injector: Injector) => ({injector}) as ɵutil.LazyModuleRef,\n      ])\n\n      .config([\n        ɵconstants.$PROVIDE,\n        ɵconstants.$INJECTOR,\n        ($provide: ɵangular1.IProvideService, $injector: ɵangular1.IInjectorService) => {\n          if ($injector.has(ɵconstants.$$TESTABILITY)) {\n            $provide.decorator(ɵconstants.$$TESTABILITY, [\n              ɵconstants.$DELEGATE,\n              (testabilityDelegate: ɵangular1.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(newWhenStable.bind(testabilityDelegate, callback));\n                    }\n                  });\n                };\n\n                testabilityDelegate.whenStable = newWhenStable;\n                return testabilityDelegate;\n              },\n            ]);\n          }\n\n          if ($injector.has(ɵconstants.$INTERVAL)) {\n            $provide.decorator(ɵconstants.$INTERVAL, [\n              ɵconstants.$DELEGATE,\n              (intervalDelegate: ɵangular1.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,\n                  delay: number,\n                  count?: number,\n                  invokeApply?: boolean,\n                  ...pass: any[]\n                ) => {\n                  return this.ngZone.runOutsideAngular(() => {\n                    return intervalDelegate(\n                      (...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                      },\n                      delay,\n                      count,\n                      invokeApply,\n                      ...pass,\n                    );\n                  });\n                };\n\n                (Object.keys(intervalDelegate) as (keyof ɵangular1.IIntervalService)[]).forEach(\n                  (prop) => ((wrappedInterval as any)[prop] = intervalDelegate[prop]),\n                );\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        ɵconstants.$INJECTOR,\n        ($injector: ɵangular1.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(ɵconstants.$INJECTOR);\n\n          // Put the injector on the DOM, so that it can be \"required\"\n          ɵangular1.element(element).data!(\n            ɵutil.controllerKey(ɵconstants.INJECTOR_KEY),\n            this.injector,\n          );\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(() => ɵutil.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 synchronize = () => {\n              this.ngZone.run(() => {\n                if ($rootScope.$$phase) {\n                  if (typeof ngDevMode === 'undefined' || ngDevMode) {\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\n                  $rootScope.$evalAsync();\n                } else {\n                  $rootScope.$digest();\n                }\n              });\n            };\n            const subscription =\n              // We _DO NOT_ usually want to have any code that does one thing for zoneless and another for ZoneJS.\n              // This is only here because there is not enough coverage for hybrid apps anymore so we cannot\n              // be confident that making UpgradeModule work with zoneless is a non-breaking change.\n              this.ngZone instanceof ɵNoopNgZone\n                ? (this.applicationRef as any).afterTick.subscribe(() => synchronize())\n                : this.ngZone.onMicrotaskEmpty.subscribe(() => synchronize());\n            $rootScope.$on('$destroy', () => {\n              subscription.unsubscribe();\n            });\n          }, 0);\n        },\n      ]);\n\n    const upgradeModule = ɵangular1.module_(\n      ɵconstants.UPGRADE_MODULE_NAME,\n      [INIT_MODULE_NAME].concat(modules),\n    );\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    const returnValue = this.ngZone.run(() =>\n      ɵangular1.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    return returnValue;\n  }\n}\n"],"names":["angularElement","ɵNG_MOD_DEF","INITIAL_VALUE","SIGNAL","NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR","ɵconstants.UPGRADE_MODULE_NAME","ɵconstants.LAZY_MODULE_REF","ɵconstants.INJECTOR_KEY","ɵutil.isNgModuleType","internalProvideZoneChangeDetection","ɵutil.isFunction","ɵangular1.module_","ɵconstants.UPGRADE_APP_TYPE_KEY","ɵconstants.$INJECTOR","ɵutil.destroyApp","ɵconstants.$PROVIDE","ɵconstants.DOWNGRADED_MODULE_COUNT_KEY","ɵutil.getDowngradedModuleCount","ɵupgradeHelper.UpgradeHelper","ɵconstants.$SCOPE","element","ɵconstants.$$TESTABILITY","ɵconstants.$DELEGATE","ɵconstants.$INTERVAL","ɵangular1.element","ɵutil.controllerKey","ɵNoopNgZone","ɵangular1.bootstrap","ɵinternalProvideZoneChangeDetection"],"mappings":";;;;;;;;;;;;;MAca,eAAe,CAAA;EASjB,IAAA;EACA,IAAA;EATT,WAAW;EACX,gBAAgB;EAChB,SAAS;EACT,MAAM;EACN,QAAQ;EACR,UAAU;AAEV,EAAA,WAAA,CACS,IAAY,EACZ,IAAY,EAAA;IADZ,IAAA,CAAA,IAAI,GAAJ,IAAI;IACJ,IAAA,CAAA,IAAI,GAAJ,IAAI;AAEX,IAAA,IAAI,CAAC,WAAW,GAAG,IAAI,IAAI,CAAC,IAAI,CAAA,CAAA,CAAG;AACnC,IAAA,IAAI,CAAC,SAAS,GAAG,IAAI,IAAI,CAAC,IAAI,CAAA,CAAA,CAAG;AACjC,IAAA,IAAI,CAAC,gBAAgB,GAAG,KAAK,IAAI,CAAC,IAAI,CAAA,EAAA,CAAI;IAC1C,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;AAC1E,IAAA,IAAI,CAAC,MAAM,GAAG,C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