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AAUnE,GAAWwB,GAErB4C,EADWR,EAASM,UAAUC,EAAQ7D,UACZ6D,EAAQ3D,OAAS2D,EAAQ1D,KAErDwD,IAAoBG,GACpBV,EAAOW,cAAcD,EAAc,CAAEE,oBAAoB,GAAM,EAI/E,CKvEOf,CAAkBH,EACtB,CAAC5D,SAAA3D,KAAA,mBAAA6D,iBARQyD,GAAgBxD,MAAA4E,GAAA,EAAA/E,SAAA3D,KAAA,UAAA4F,EAAA+C,GAAA,MAAhBrB,IAAgB3D,SAAA3D,KAAA,UAAA4F,EAAAgD,IAAA,UAZrBzI,EACA0I,MAAaC,SAAS,CAClB,CACIC,KAAM,KACNC,UAAWnC,GACXpE,KAAM,CACFwG,kBAAkB,gBAMzB3B,CAAgB","names":["noNg","Error","noNgElement","cleanData","angular","bootstrap","module","element","injector","version","undefined","resumeBootstrap","getTestability","window","hasOwnProperty","module_","prefix","dependencies","e","nodes","$DELEGATE","$INJECTOR","$INTERVAL","$$TESTABILITY","DOWNGRADED_MODULE_COUNT_KEY","INJECTOR_KEY","UPGRADE_APP_TYPE_KEY","UPGRADE_MODULE_NAME","destroyApp","$injector","$rootElement","get","$destroy","node","isParentNode","isFunction","querySelectorAll","value","validateInjectionKey","downgradedModule","injectionKey","attemptedAction","upgradeAppType","getUpgradeAppType","has","downgradedModuleCount","getDowngradedModuleCount","downgradeInjectable","token","factory","injectorKey","getTypeName","type","overriddenName","name","toString","split","String","err","message","$inject","tempInjectorRef","angular1Providers","provide","useFactory","injectorFactory","deps","rootScopeFactory","i","compileFactory","parseFactory","NgAdapterInjector","constructor","modInjector","this","notFoundValue","ɵNOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR","UpgradeModule","ngZone","platformRef","element$1","modules","config","INIT_MODULE_NAME","constant","$provide","decorator","testabilityDelegate","originalWhenStable","whenStable","newWhenStable","callback","call","ng2Testability","Testability","isStable","bind","intervalDelegate","wrappedInterval","fn","delay","count","invokeApply","pass","runOutsideAngular","args","setTimeout","run","Object","keys","forEach","prop","flush","$rootScope","setTempInjectorRef","data","controllerKey","onDestroy","subscription","onMicrotaskEmpty","subscribe","$$phase","$evalAsync","$digest","$on","unsubscribe","upgradeModule","concat","windowAngular","returnValue","originalResumeBootstrap","arguments","apply","static","ɵfac","t","i0","ɵmod","ɵinj","providers","anchor","resolveUrl","url","document","createElement","setAttribute","href","pathname","replace","search","hash","BuildiumCacheModule","service","NotifyShimService","ToastMessageStateService","success","error","messageType","errorAfterNavigate","successAfterNavigate","displayMessageOnNavigate","SiteChromeService","visible$","BehaviorSubject","setVisibility","next","core","jDH","providedIn","jQuery","defineProperty","prototype","PublicAngularJSModule","angularRedux","PublicAngularJSRoutingModule","PageTitleService","PageLoadingService","FeatureFlagService","environment","production","console","debug","full","EmptyComponent","VBU","selectors","decls","vars","template","rf","ctx","encapsulation","Ng1WrapperModule","upgrade","body","strictDi","setUpLocationSync","ngUpgrade","urlType","router","Router","location","Location","_","current","currentUrl","currentLocation","normalize","nextUrl","nextLocation","navigateByUrl","skipLocationChange","i1","$C","G2t","RouterModule","forChild","path","component","isAngularJsRoute"],"sourceRoot":"webpack:///","sources":["./node_modules/@angular/upgrade/fesm2022/static.mjs","./projects/public/src/app/core/routes/angular-router-upgrade.patch.ts","./src/shared/cache.module.js","./projects/public/src/ajs-app/page/notify-shim-service.js","./src/app/core/app-shell/services/site-chrome.service.ts","./projects/public/src/ajs-app/app.module.ajs.ts","./projects/public/src/app/ng1-wrapper.module.ts"],"sourcesContent":["/**\n * @license Angular v16.2.12\n * (c) 2010-2022 Google LLC. https://angular.io/\n * License: MIT\n */\n\nimport * as i0 from '@angular/core';\nimport { ɵNG_MOD_DEF, Injector, ChangeDetectorRef, Testability, TestabilityRegistry, ApplicationRef, SimpleChange, NgZone, ComponentFactoryResolver, Version, ɵNOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR, PlatformRef, EventEmitter, Directive, NgModule } from '@angular/core';\nimport { platformBrowser } from '@angular/platform-browser';\n\nfunction noNg() {\n throw new Error('AngularJS v1.x is not loaded!');\n}\nconst noNgElement = (() => noNg());\nnoNgElement.cleanData = noNg;\nlet angular = {\n bootstrap: noNg,\n module: noNg,\n element: noNgElement,\n injector: noNg,\n version: undefined,\n resumeBootstrap: noNg,\n getTestability: noNg\n};\ntry {\n if (window.hasOwnProperty('angular')) {\n angular = window.angular;\n }\n}\ncatch {\n // ignore in CJS mode.\n}\n/**\n * @deprecated Use `setAngularJSGlobal` instead.\n *\n * @publicApi\n */\nfunction setAngularLib(ng) {\n setAngularJSGlobal(ng);\n}\n/**\n * @deprecated Use `getAngularJSGlobal` instead.\n *\n * @publicApi\n */\nfunction getAngularLib() {\n return getAngularJSGlobal();\n}\n/**\n * Resets the AngularJS global.\n *\n * Used when AngularJS is loaded lazily, and not available on `window`.\n *\n * @publicApi\n */\nfunction setAngularJSGlobal(ng) {\n angular = ng;\n}\n/**\n * Returns the current AngularJS global.\n *\n * @publicApi\n */\nfunction getAngularJSGlobal() {\n return angular;\n}\nconst bootstrap = (e, modules, config) => angular.bootstrap(e, modules, config);\n// Do not declare as `module` to avoid webpack bug\n// (see https://github.com/angular/angular/issues/30050).\nconst module_ = (prefix, dependencies) => angular.module(prefix, dependencies);\nconst element = (e => angular.element(e));\nelement.cleanData = nodes => angular.element.cleanData(nodes);\nconst injector = (modules, strictDi) => angular.injector(modules, strictDi);\nconst resumeBootstrap = () => angular.resumeBootstrap();\nconst getTestability = e => angular.getTestability(e);\n\nconst $COMPILE = '$compile';\nconst $CONTROLLER = '$controller';\nconst $DELEGATE = '$delegate';\nconst $EXCEPTION_HANDLER = '$exceptionHandler';\nconst $HTTP_BACKEND = '$httpBackend';\nconst $INJECTOR = '$injector';\nconst $INTERVAL = '$interval';\nconst $PARSE = '$parse';\nconst $PROVIDE = '$provide';\nconst $ROOT_ELEMENT = '$rootElement';\nconst $ROOT_SCOPE = '$rootScope';\nconst $SCOPE = '$scope';\nconst $TEMPLATE_CACHE = '$templateCache';\nconst $TEMPLATE_REQUEST = '$templateRequest';\nconst $$TESTABILITY = '$$testability';\nconst COMPILER_KEY = '$$angularCompiler';\nconst DOWNGRADED_MODULE_COUNT_KEY = '$$angularDowngradedModuleCount';\nconst GROUP_PROJECTABLE_NODES_KEY = '$$angularGroupProjectableNodes';\nconst INJECTOR_KEY = '$$angularInjector';\nconst LAZY_MODULE_REF = '$$angularLazyModuleRef';\nconst NG_ZONE_KEY = '$$angularNgZone';\nconst UPGRADE_APP_TYPE_KEY = '$$angularUpgradeAppType';\nconst REQUIRE_INJECTOR = '?^^' + INJECTOR_KEY;\nconst REQUIRE_NG_MODEL = '?ngModel';\nconst UPGRADE_MODULE_NAME = '$$UpgradeModule';\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 */\nclass PropertyBinding {\n constructor(prop, attr) {\n this.prop = prop;\n this.attr = attr;\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\nconst DIRECTIVE_PREFIX_REGEXP = /^(?:x|data)[:\\-_]/i;\nconst DIRECTIVE_SPECIAL_CHARS_REGEXP = /[:\\-_]+(.)/g;\nfunction onError(e) {\n // TODO: (misko): We seem to not have a stack trace here!\n console.error(e, e.stack);\n throw e;\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 */\nfunction cleanData(node) {\n element.cleanData([node]);\n if (isParentNode(node)) {\n element.cleanData(node.querySelectorAll('*'));\n }\n}\nfunction controllerKey(name) {\n return '$' + name + 'Controller';\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 */\nfunction destroyApp($injector) {\n const $rootElement = $injector.get($ROOT_ELEMENT);\n const $rootScope = $injector.get($ROOT_SCOPE);\n $rootScope.$destroy();\n cleanData($rootElement[0]);\n}\nfunction directiveNormalize(name) {\n return name.replace(DIRECTIVE_PREFIX_REGEXP, '')\n .replace(DIRECTIVE_SPECIAL_CHARS_REGEXP, (_, letter) => letter.toUpperCase());\n}\nfunction getTypeName(type) {\n // Return the name of the type or the first line of its stringified version.\n return type.overriddenName || type.name || type.toString().split('\\n')[0];\n}\nfunction getDowngradedModuleCount($injector) {\n return $injector.has(DOWNGRADED_MODULE_COUNT_KEY) ? $injector.get(DOWNGRADED_MODULE_COUNT_KEY) :\n 0;\n}\nfunction getUpgradeAppType($injector) {\n return $injector.has(UPGRADE_APP_TYPE_KEY) ? $injector.get(UPGRADE_APP_TYPE_KEY) :\n 0 /* UpgradeAppType.None */;\n}\nfunction isFunction(value) {\n return typeof value === 'function';\n}\nfunction isNgModuleType(value) {\n // NgModule class should have the `ɵmod` static property attached by AOT or JIT compiler.\n return isFunction(value) && !!value[ɵNG_MOD_DEF];\n}\nfunction isParentNode(node) {\n return isFunction(node.querySelectorAll);\n}\nfunction validateInjectionKey($injector, downgradedModule, injectionKey, attemptedAction) {\n const upgradeAppType = getUpgradeAppType($injector);\n const downgradedModuleCount = getDowngradedModuleCount($injector);\n // Check for common errors.\n switch (upgradeAppType) {\n case 1 /* UpgradeAppType.Dynamic */:\n case 2 /* UpgradeAppType.Static */:\n if (downgradedModule) {\n throw new Error(`Error while ${attemptedAction}: 'downgradedModule' unexpectedly specified.\\n` +\n 'You should not specify a value for \\'downgradedModule\\', unless you are downgrading ' +\n 'more than one Angular module (via \\'downgradeModule()\\').');\n }\n break;\n case 3 /* UpgradeAppType.Lite */:\n if (!downgradedModule && (downgradedModuleCount >= 2)) {\n throw new Error(`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 if (!$injector.has(injectionKey)) {\n throw new Error(`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 break;\n default:\n throw new Error(`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}\nclass Deferred {\n constructor() {\n this.promise = new Promise((res, rej) => {\n this.resolve = res;\n this.reject = rej;\n });\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) {\n return typeof component.writeValue === 'function' &&\n typeof component.registerOnChange === 'function';\n}\n/**\n * Glue the AngularJS `NgModelController` (if it exists) to the component\n * (if it implements the needed subset of the `ControlValueAccessor` interface).\n */\nfunction hookupNgModel(ngModel, component) {\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 * Test two values for strict equality, accounting for the fact that `NaN !== NaN`.\n */\nfunction strictEquals(val1, val2) {\n return val1 === val2 || (val1 !== val1 && val2 !== val2);\n}\n\nconst INITIAL_VALUE$1 = {\n __UNINITIALIZED__: true\n};\nclass DowngradeComponentAdapter {\n constructor(element, attrs, scope, ngModel, parentInjector, $compile, $parse, componentFactory, wrapCallback) {\n this.element = element;\n this.attrs = attrs;\n this.scope = scope;\n this.ngModel = ngModel;\n this.parentInjector = parentInjector;\n this.$compile = $compile;\n this.$parse = $parse;\n this.componentFactory = componentFactory;\n this.wrapCallback = wrapCallback;\n this.implementsOnChanges = false;\n this.inputChangeCount = 0;\n this.inputChanges = {};\n this.componentScope = scope.$new();\n }\n compileContents() {\n const compiledProjectableNodes = [];\n const projectableNodes = this.groupProjectableNodes();\n const linkFns = projectableNodes.map(nodes => this.$compile(nodes));\n this.element.empty();\n linkFns.forEach(linkFn => {\n linkFn(this.scope, (clone) => {\n compiledProjectableNodes.push(clone);\n this.element.append(clone);\n });\n });\n return compiledProjectableNodes;\n }\n createComponentAndSetup(projectableNodes, manuallyAttachView = false, propagateDigest = true) {\n const component = this.createComponent(projectableNodes);\n this.setupInputs(manuallyAttachView, propagateDigest, component);\n this.setupOutputs(component.componentRef);\n this.registerCleanup(component.componentRef);\n return component.componentRef;\n }\n createComponent(projectableNodes) {\n const providers = [{ provide: $SCOPE, useValue: this.componentScope }];\n const childInjector = Injector.create({ providers: providers, parent: this.parentInjector, name: 'DowngradeComponentAdapter' });\n const componentRef = this.componentFactory.create(childInjector, projectableNodes, this.element[0]);\n const viewChangeDetector = componentRef.injector.get(ChangeDetectorRef);\n const changeDetector = componentRef.changeDetectorRef;\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.get(TestabilityRegistry)\n .registerApplication(componentRef.location.nativeElement, testability);\n }\n hookupNgModel(this.ngModel, componentRef.instance);\n return { viewChangeDetector, componentRef, changeDetector };\n }\n setupInputs(manuallyAttachView, propagateDigest = true, { componentRef, changeDetector, viewChangeDetector }) {\n const attrs = this.attrs;\n const inputs = this.componentFactory.inputs || [];\n for (const input of inputs) {\n const inputBinding = new PropertyBinding(input.propName, input.templateName);\n let expr = null;\n if (attrs.hasOwnProperty(inputBinding.attr)) {\n const observeFn = (prop => {\n let prevValue = INITIAL_VALUE$1;\n return (currValue) => {\n // Initially, both `$observe()` and `$watch()` will call this function.\n if (!strictEquals(prevValue, currValue)) {\n if (prevValue === INITIAL_VALUE$1) {\n prevValue = currValue;\n }\n this.updateInput(componentRef, prop, prevValue, currValue);\n prevValue = currValue;\n }\n };\n })(inputBinding.prop);\n attrs.$observe(inputBinding.attr, observeFn);\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 = this.componentScope.$watch(() => {\n unwatch();\n unwatch = null;\n observeFn(attrs[inputBinding.attr]);\n });\n }\n else if (attrs.hasOwnProperty(inputBinding.bindAttr)) {\n expr = attrs[inputBinding.bindAttr];\n }\n else if (attrs.hasOwnProperty(inputBinding.bracketAttr)) {\n expr = attrs[inputBinding.bracketAttr];\n }\n else if (attrs.hasOwnProperty(inputBinding.bindonAttr)) {\n expr = attrs[inputBinding.bindonAttr];\n }\n else if (attrs.hasOwnProperty(inputBinding.bracketParenAttr)) {\n expr = attrs[inputBinding.bracketParenAttr];\n }\n if (expr != null) {\n const watchFn = ((prop) => (currValue, prevValue) => this.updateInput(componentRef, prop, prevValue, currValue))(inputBinding.prop);\n this.componentScope.$watch(expr, watchFn);\n }\n }\n // Invoke `ngOnChanges()` and Change Detection (when necessary)\n const detectChanges = () => changeDetector.detectChanges();\n const prototype = this.componentFactory.componentType.prototype;\n this.implementsOnChanges = !!(prototype && prototype.ngOnChanges);\n this.componentScope.$watch(() => this.inputChangeCount, this.wrapCallback(() => {\n // Invoke `ngOnChanges()`\n if (this.implementsOnChanges) {\n const inputChanges = this.inputChanges;\n this.inputChanges = {};\n componentRef.instance.ngOnChanges(inputChanges);\n }\n viewChangeDetector.markForCheck();\n // If opted out of propagating digests, invoke change detection when inputs change.\n if (!propagateDigest) {\n detectChanges();\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 // 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 = this.componentScope.$watch(() => {\n unwatch();\n unwatch = null;\n const appRef = this.parentInjector.get(ApplicationRef);\n appRef.attachView(componentRef.hostView);\n });\n }\n }\n setupOutputs(componentRef) {\n const attrs = this.attrs;\n const outputs = this.componentFactory.outputs || [];\n for (const output of outputs) {\n const outputBindings = new PropertyBinding(output.propName, output.templateName);\n const bindonAttr = outputBindings.bindonAttr.substring(0, outputBindings.bindonAttr.length - 6);\n const bracketParenAttr = `[(${outputBindings.bracketParenAttr.substring(2, outputBindings.bracketParenAttr.length - 8)})]`;\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 subscribeToOutput(componentRef, output, expr, isAssignment = false) {\n const getter = this.$parse(expr);\n const setter = getter.assign;\n if (isAssignment && !setter) {\n throw new Error(`Expression '${expr}' is not assignable!`);\n }\n const emitter = componentRef.instance[output.prop];\n if (emitter) {\n const subscription = emitter.subscribe({\n next: isAssignment ? (v) => setter(this.scope, v) :\n (v) => getter(this.scope, { '$event': v })\n });\n componentRef.onDestroy(() => subscription.unsubscribe());\n }\n else {\n throw new Error(`Missing emitter '${output.prop}' on component '${getTypeName(this.componentFactory.componentType)}'!`);\n }\n }\n registerCleanup(componentRef) {\n const testabilityRegistry = componentRef.injector.get(TestabilityRegistry);\n const destroyComponentRef = this.wrapCallback(() => componentRef.destroy());\n let destroyed = false;\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)\n this.componentScope.$destroy();\n });\n this.componentScope.$on('$destroy', () => {\n if (!destroyed) {\n destroyed = true;\n testabilityRegistry.unregisterApplication(componentRef.location.nativeElement);\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 destroyComponentRef();\n }\n });\n }\n updateInput(componentRef, prop, prevValue, currValue) {\n if (this.implementsOnChanges) {\n this.inputChanges[prop] = new SimpleChange(prevValue, currValue, prevValue === currValue);\n }\n this.inputChangeCount++;\n componentRef.instance[prop] = currValue;\n }\n groupProjectableNodes() {\n let ngContentSelectors = this.componentFactory.ngContentSelectors;\n return groupNodesBySelector(ngContentSelectors, this.element.contents());\n }\n}\n/**\n * Group a set of DOM nodes into `ngContent` groups, based on the given content selectors.\n */\nfunction groupNodesBySelector(ngContentSelectors, nodes) {\n const projectableNodes = [];\n for (let i = 0, ii = ngContentSelectors.length; i < ii; ++i) {\n projectableNodes[i] = [];\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 return projectableNodes;\n}\nfunction findMatchingNgContentIndex(element, ngContentSelectors) {\n const ngContentIndices = [];\n let wildcardNgContentIndex = -1;\n for (let i = 0; i < ngContentSelectors.length; i++) {\n const selector = ngContentSelectors[i];\n if (selector === '*') {\n wildcardNgContentIndex = i;\n }\n else {\n if (matchesSelector(element, selector)) {\n ngContentIndices.push(i);\n }\n }\n }\n ngContentIndices.sort();\n if (wildcardNgContentIndex !== -1) {\n ngContentIndices.push(wildcardNgContentIndex);\n }\n return ngContentIndices.length ? ngContentIndices[0] : null;\n}\nfunction matchesSelector(el, selector) {\n const elProto = Element.prototype;\n return el.nodeType === Node.ELEMENT_NODE\n // matches is supported by all browsers from 2014 onwards except non-chromium edge\n ?\n (elProto.matches ?? elProto.msMatchesSelector).call(el, selector) :\n false;\n}\n\nfunction isThenable(obj) {\n return !!obj && isFunction(obj.then);\n}\n/**\n * Synchronous, promise-like object.\n */\nclass SyncPromise {\n constructor() {\n this.resolved = false;\n this.callbacks = [];\n }\n static all(valuesOrPromises) {\n const aggrPromise = new SyncPromise();\n let resolvedCount = 0;\n const results = [];\n const resolve = (idx, value) => {\n results[idx] = value;\n if (++resolvedCount === valuesOrPromises.length)\n aggrPromise.resolve(results);\n };\n valuesOrPromises.forEach((p, idx) => {\n if (isThenable(p)) {\n p.then(v => resolve(idx, v));\n }\n else {\n resolve(idx, p);\n }\n });\n return aggrPromise;\n }\n resolve(value) {\n // Do nothing, if already resolved.\n if (this.resolved)\n return;\n this.value = value;\n this.resolved = true;\n // Run the queued callbacks.\n this.callbacks.forEach(callback => callback(value));\n this.callbacks.length = 0;\n }\n then(callback) {\n if (this.resolved) {\n callback(this.value);\n }\n else {\n this.callbacks.push(callback);\n }\n }\n}\n\n/**\n * @description\n *\n * A helper function that allows an Angular component to be used from AngularJS.\n *\n * *Part of the [upgrade/static](api?query=upgrade%2Fstatic)\n * library for hybrid upgrade apps that support AOT compilation*\n *\n * This helper function returns a factory function to be used for registering\n * an AngularJS wrapper directive for \"downgrading\" an Angular component.\n *\n * @usageNotes\n * ### Examples\n *\n * Let's assume that you have an Angular component called `ng2Heroes` that needs\n * to be made available in AngularJS templates.\n *\n * {@example upgrade/static/ts/full/module.ts region=\"ng2-heroes\"}\n *\n * We must create an AngularJS [directive](https://docs.angularjs.org/guide/directive)\n * that will make this Angular component available inside AngularJS templates.\n * The `downgradeComponent()` function returns a factory function that we\n * can use to define the AngularJS directive that wraps the \"downgraded\" component.\n *\n * {@example upgrade/static/ts/full/module.ts region=\"ng2-heroes-wrapper\"}\n *\n * For more details and examples on downgrading Angular components to AngularJS components please\n * visit the [Upgrade guide](guide/upgrade#using-angular-components-from-angularjs-code).\n *\n * @param info contains information about the Component that is being downgraded:\n *\n * - `component: Type`: 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 *
\n * (This option is only necessary when using `downgradeModule()` to downgrade more than one\n * Angular module.)\n * - `propagateDigest?: boolean`: Whether to perform {@link ChangeDetectorRef#detectChanges} on the\n * component on every\n * [$digest](https://docs.angularjs.org/api/ng/type/$rootScope.Scope#$digest). If set to `false`,\n * change detection will still be performed when any of the component's inputs changes.\n * (Default: true)\n *\n * @returns a factory function that can be used to register the component in an\n * AngularJS module.\n *\n * @publicApi\n */\nfunction downgradeComponent(info) {\n const directiveFactory = function ($compile, $injector, $parse) {\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) === 3 /* UpgradeAppType.Lite */;\n const wrapCallback = !isNgUpgradeLite ? cb => cb : cb => () => NgZone.isInAngularZone() ? cb() : ngZone.run(cb);\n let ngZone;\n // When downgrading multiple modules, special handling is needed wrt injectors.\n const hasMultipleDowngradedModules = isNgUpgradeLite && (getDowngradedModuleCount($injector) > 1);\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, element, attrs, required) => {\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 const ngModel = required[1];\n const parentInjector = required[0];\n let moduleInjector = undefined;\n let ranAsync = false;\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 validateInjectionKey($injector, downgradedModule, lazyModuleRefKey, attemptedAction);\n const lazyModuleRef = $injector.get(lazyModuleRefKey);\n moduleInjector = lazyModuleRef.injector ?? lazyModuleRef.promise;\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 // 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 // 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 const doDowngrade = (injector, moduleInjector) => {\n // Retrieve `ComponentFactoryResolver` from the injector tied to the `NgModule` this\n // component belongs to.\n const componentFactoryResolver = moduleInjector.get(ComponentFactoryResolver);\n const componentFactory = componentFactoryResolver.resolveComponentFactory(info.component);\n if (!componentFactory) {\n throw new Error(`Expecting ComponentFactory for: ${getTypeName(info.component)}`);\n }\n const injectorPromise = new ParentInjectorPromise(element);\n const facade = new DowngradeComponentAdapter(element, attrs, scope, ngModel, injector, $compile, $parse, componentFactory, wrapCallback);\n const projectableNodes = facade.compileContents();\n const componentRef = facade.createComponentAndSetup(projectableNodes, isNgUpgradeLite, info.propagateDigest);\n injectorPromise.resolve(componentRef.injector);\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 const downgradeFn = !isNgUpgradeLite ? doDowngrade : (pInjector, mInjector) => {\n if (!ngZone) {\n ngZone = pInjector.get(NgZone);\n }\n wrapCallback(() => doDowngrade(pInjector, mInjector))();\n };\n // NOTE:\n // Not using `ParentInjectorPromise.all()` (which is inherited from `SyncPromise`), because\n // Closure Compiler (or some related tool) complains:\n // `TypeError: ...$src$downgrade_component_ParentInjectorPromise.all is not a function`\n SyncPromise.all([finalParentInjector, finalModuleInjector])\n .then(([pInjector, mInjector]) => downgradeFn(pInjector, mInjector));\n ranAsync = true;\n }\n };\n };\n // bracket-notation because of closure - see #14441\n directiveFactory['$inject'] = [$COMPILE, $INJECTOR, $PARSE];\n return directiveFactory;\n}\n/**\n * Synchronous promise-like object to wrap parent injectors,\n * to preserve the synchronous nature of AngularJS's `$compile`.\n */\nclass ParentInjectorPromise extends SyncPromise {\n constructor(element) {\n super();\n this.element = element;\n this.injectorKey = controllerKey(INJECTOR_KEY);\n // Store the promise on the element.\n element.data(this.injectorKey, this);\n }\n resolve(injector) {\n // Store the real injector on the element.\n this.element.data(this.injectorKey, injector);\n // Release the element to prevent memory leaks.\n this.element = null;\n // Resolve the promise.\n super.resolve(injector);\n }\n}\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 *
\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 *
\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.
\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 */\nfunction downgradeInjectable(token, downgradedModule = '') {\n const factory = function ($injector) {\n const injectorKey = `${INJECTOR_KEY}${downgradedModule}`;\n const injectableName = isFunction(token) ? getTypeName(token) : String(token);\n const attemptedAction = `instantiating injectable '${injectableName}'`;\n validateInjectionKey($injector, downgradedModule, injectorKey, attemptedAction);\n try {\n const injector = $injector.get(injectorKey);\n return injector.get(token);\n }\n catch (err) {\n throw new Error(`Error while ${attemptedAction}: ${err.message || err}`);\n }\n };\n factory['$inject'] = [$INJECTOR];\n return factory;\n}\n\n/**\n * @module\n * @description\n * Entry point for all public APIs of the upgrade package.\n */\n/**\n * @publicApi\n */\nconst VERSION = new Version('16.2.12');\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 = null;\nfunction setTempInjectorRef(injector) {\n tempInjectorRef = injector;\n}\nfunction injectorFactory() {\n if (!tempInjectorRef) {\n throw new Error('Trying to get the AngularJS injector before it being set.');\n }\n const injector = tempInjectorRef;\n tempInjectorRef = null; // clear the value to prevent memory leaks\n return injector;\n}\nfunction rootScopeFactory(i) {\n return i.get('$rootScope');\n}\nfunction compileFactory(i) {\n return i.get('$compile');\n}\nfunction parseFactory(i) {\n return i.get('$parse');\n}\nconst 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\nclass NgAdapterInjector {\n constructor(modInjector) {\n this.modInjector = modInjector;\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, notFoundValue) {\n if (notFoundValue === ɵNOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR) {\n return notFoundValue;\n }\n return this.modInjector.get(token, notFoundValue);\n }\n}\n\nlet moduleUid = 0;\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](guide/upgrade-performance).\n *\n * @usageNotes\n *\n * Apart from `UpgradeModule`, you can use the rest of the `upgrade/static` helpers as usual to\n * build a hybrid application. Note that the Angular pieces (e.g. downgraded services) will not be\n * available until the downgraded module has been bootstrapped, i.e. by instantiating a downgraded\n * component.\n *\n *
\n *\n * You cannot use `downgradeModule()` and `UpgradeModule` in the same hybrid application.
\n * Use one or the other.\n *\n *
\n *\n * ### Differences with `UpgradeModule`\n *\n * Besides their different API, there are two important internal differences between\n * `downgradeModule()` and `UpgradeModule` that affect the behavior of hybrid applications:\n *\n * 1. Unlike `UpgradeModule`, `downgradeModule()` does not bootstrap the main AngularJS module\n * inside the {@link NgZone Angular zone}.\n * 2. Unlike `UpgradeModule`, `downgradeModule()` does not automatically run a\n * [$digest()](https://docs.angularjs.org/api/ng/type/$rootScope.Scope#$digest) when changes are\n * detected in the Angular part of the application.\n *\n * What this means is that applications using `UpgradeModule` will run change detection more\n * frequently in order to ensure that both frameworks are properly notified about possible changes.\n * This will inevitably result in more change detection runs than necessary.\n *\n * `downgradeModule()`, on the other side, does not try to tie the two change detection systems as\n * tightly, restricting the explicit change detection runs only to cases where it knows it is\n * necessary (e.g. when the inputs of a downgraded component change). This improves performance,\n * especially in change-detection-heavy applications, but leaves it up to the developer to manually\n * notify each framework as needed.\n *\n * For a more detailed discussion of the differences and their implications, see\n * [Upgrading for Performance](guide/upgrade-performance).\n *\n *
\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 *
\n *\n * ### Downgrading multiple modules\n *\n * It is possible to downgrade multiple modules and include them in an AngularJS application. In\n * that case, each downgraded module will be bootstrapped when an associated downgraded component or\n * injectable needs to be instantiated.\n *\n * Things to keep in mind, when downgrading multiple modules:\n *\n * - Each downgraded component/injectable needs to be explicitly associated with a downgraded\n * module. See `downgradeComponent()` and `downgradeInjectable()` for more details.\n *\n * - If you want some injectables to be shared among all downgraded modules, you can provide them as\n * `StaticProvider`s, when creating the `PlatformRef` (e.g. via `platformBrowser` or\n * `platformBrowserDynamic`).\n *\n * - When using {@link PlatformRef#bootstrapmodule `bootstrapModule()`} or\n * {@link PlatformRef#bootstrapmodulefactory `bootstrapModuleFactory()`} to bootstrap the\n * downgraded modules, each one is considered a \"root\" module. As a consequence, a new instance\n * will be created for every injectable provided in `\"root\"` (via\n * {@link Injectable#providedIn `providedIn`}).\n * If this is not your intention, you can have a shared module (that will act as act as the \"root\"\n * module) and create all downgraded modules using that module's injector:\n *\n * {@example upgrade/static/ts/lite-multi-shared/module.ts region=\"shared-root-module\"}\n *\n * @publicApi\n */\nfunction downgradeModule(moduleOrBootstrapFn) {\n const lazyModuleName = `${UPGRADE_MODULE_NAME}.lazy${++moduleUid}`;\n const lazyModuleRefKey = `${LAZY_MODULE_REF}${lazyModuleName}`;\n const lazyInjectorKey = `${INJECTOR_KEY}${lazyModuleName}`;\n let bootstrapFn;\n if (isNgModuleType(moduleOrBootstrapFn)) {\n // NgModule class\n bootstrapFn = (extraProviders) => platformBrowser(extraProviders).bootstrapModule(moduleOrBootstrapFn);\n }\n else if (!isFunction(moduleOrBootstrapFn)) {\n // NgModule factory\n bootstrapFn = (extraProviders) => platformBrowser(extraProviders).bootstrapModuleFactory(moduleOrBootstrapFn);\n }\n else {\n // bootstrap function\n bootstrapFn = moduleOrBootstrapFn;\n }\n let injector;\n // Create an ng1 module to bootstrap.\n module_(lazyModuleName, [])\n .constant(UPGRADE_APP_TYPE_KEY, 3 /* UpgradeAppType.Lite */)\n .factory(INJECTOR_KEY, [lazyInjectorKey, identity])\n .factory(lazyInjectorKey, () => {\n if (!injector) {\n throw new Error('Trying to get the Angular injector before bootstrapping the corresponding ' +\n 'Angular module.');\n }\n return injector;\n })\n .factory(LAZY_MODULE_REF, [lazyModuleRefKey, identity])\n .factory(lazyModuleRefKey, [\n $INJECTOR,\n ($injector) => {\n setTempInjectorRef($injector);\n const result = {\n promise: bootstrapFn(angular1Providers).then(ref => {\n injector = result.injector = new NgAdapterInjector(ref.injector);\n injector.get($INJECTOR);\n // Destroy the AngularJS app once the Angular `PlatformRef` is destroyed.\n // This does not happen in a typical SPA scenario, but it might be useful for\n // other use-cases where disposing of an Angular/AngularJS app is necessary\n // (such as Hot Module Replacement (HMR)).\n // See https://github.com/angular/angular/issues/39935.\n injector.get(PlatformRef).onDestroy(() => destroyApp($injector));\n return injector;\n })\n };\n return result;\n }\n ])\n .config([\n $INJECTOR, $PROVIDE,\n ($injector, $provide) => {\n $provide.constant(DOWNGRADED_MODULE_COUNT_KEY, getDowngradedModuleCount($injector) + 1);\n }\n ]);\n return lazyModuleName;\n}\nfunction identity(x) {\n return x;\n}\n\n// Constants\nconst REQUIRE_PREFIX_RE = /^(\\^\\^?)?(\\?)?(\\^\\^?)?/;\n// Classes\nclass UpgradeHelper {\n constructor(injector, name, elementRef, directive) {\n this.name = name;\n this.$injector = injector.get($INJECTOR);\n this.$compile = this.$injector.get($COMPILE);\n this.$controller = this.$injector.get($CONTROLLER);\n this.element = elementRef.nativeElement;\n this.$element = element(this.element);\n this.directive = directive ?? UpgradeHelper.getDirective(this.$injector, name);\n }\n static getDirective($injector, name) {\n const directives = $injector.get(name + 'Directive');\n if (directives.length > 1) {\n throw new Error(`Only support single directive definition for: ${name}`);\n }\n const directive = directives[0];\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)\n notSupported(name, 'compile');\n if (directive.replace)\n notSupported(name, 'replace');\n if (directive.terminal)\n notSupported(name, 'terminal');\n return directive;\n }\n static getTemplate($injector, directive, fetchRemoteTemplate = false, $element) {\n if (directive.template !== undefined) {\n return getOrCall(directive.template, $element);\n }\n else if (directive.templateUrl) {\n const $templateCache = $injector.get($TEMPLATE_CACHE);\n const url = getOrCall(directive.templateUrl, $element);\n const template = $templateCache.get(url);\n if (template !== undefined) {\n return template;\n }\n else if (!fetchRemoteTemplate) {\n throw new Error('loading directive templates asynchronously is not supported');\n }\n return new Promise((resolve, reject) => {\n const $httpBackend = $injector.get($HTTP_BACKEND);\n $httpBackend('GET', url, null, (status, response) => {\n if (status === 200) {\n resolve($templateCache.put(url, response));\n }\n else {\n reject(`GET component template from '${url}' returned '${status}: ${response}'`);\n }\n });\n });\n }\n else {\n throw new Error(`Directive '${directive.name}' is not a component, it is missing template.`);\n }\n }\n buildController(controllerType, $scope) {\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 this.$element.data?.(controllerKey(this.directive.name), controller);\n return controller;\n }\n compileTemplate(template) {\n if (template === undefined) {\n template =\n UpgradeHelper.getTemplate(this.$injector, this.directive, false, this.$element);\n }\n return this.compileHtml(template);\n }\n onDestroy($scope, controllerInstance) {\n if (controllerInstance && isFunction(controllerInstance.$onDestroy)) {\n controllerInstance.$onDestroy();\n }\n $scope.$destroy();\n cleanData(this.element);\n }\n prepareTransclusion() {\n const transclude = this.directive.transclude;\n const contentChildNodes = this.extractChildNodes();\n const attachChildrenFn = (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 if (transclude) {\n const slots = Object.create(null);\n if (typeof transclude === 'object') {\n $template = [];\n const slotMap = Object.create(null);\n const filledSlots = Object.create(null);\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 slotMap[selector] = slotName;\n slots[slotName] = null; // `null`: Defined but not yet filled.\n filledSlots[slotName] = optional; // Consider optional slots as filled.\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 }\n else {\n $template.push(node);\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 Object.keys(slots).filter(slotName => slots[slotName]).forEach(slotName => {\n const nodes = slots[slotName];\n slots[slotName] = (scope, cloneAttach) => {\n return cloneAttach(nodes, scope);\n };\n });\n }\n // Attach `$$slots` to default slot transclude fn.\n attachChildrenFn.$$slots = slots;\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 return attachChildrenFn;\n }\n resolveAndBindRequiredControllers(controllerInstance) {\n const directiveRequire = this.getDirectiveRequire();\n const requiredControllers = this.resolveRequire(directiveRequire);\n if (controllerInstance && this.directive.bindToController && isMap(directiveRequire)) {\n const requiredControllersMap = requiredControllers;\n Object.keys(requiredControllersMap).forEach(key => {\n controllerInstance[key] = requiredControllersMap[key];\n });\n }\n return requiredControllers;\n }\n compileHtml(html) {\n this.element.innerHTML = html;\n return this.$compile(this.element.childNodes);\n }\n extractChildNodes() {\n const childNodes = [];\n let childNode;\n while (childNode = this.element.firstChild) {\n this.element.removeChild(childNode);\n childNodes.push(childNode);\n }\n return childNodes;\n }\n getDirectiveRequire() {\n const require = this.directive.require || (this.directive.controller && this.directive.name);\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 if (!name) {\n require[key] = match[0] + key;\n }\n });\n }\n return require;\n }\n resolveRequire(require) {\n if (!require) {\n return null;\n }\n else if (Array.isArray(require)) {\n return require.map(req => this.resolveRequire(req));\n }\n else if (typeof require === 'object') {\n const value = {};\n Object.keys(require).forEach(key => value[key] = this.resolveRequire(require[key]));\n return value;\n }\n else if (typeof require === 'string') {\n const match = require.match(REQUIRE_PREFIX_RE);\n const inheritType = match[1] || match[3];\n const name = require.substring(match[0].length);\n const isOptional = !!match[2];\n const searchParents = !!inheritType;\n const startOnParent = inheritType === '^^';\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 if (!value && !isOptional) {\n throw new Error(`Unable to find required '${require}' in upgraded directive '${this.name}'.`);\n }\n return value;\n }\n else {\n throw new Error(`Unrecognized 'require' syntax on upgraded directive '${this.name}': ${require}`);\n }\n }\n}\nfunction getOrCall(property, ...args) {\n return isFunction(property) ? property(...args) : property;\n}\n// NOTE: Only works for `typeof T !== 'object'`.\nfunction isMap(value) {\n return value && !Array.isArray(value) && typeof value === 'object';\n}\nfunction notSupported(name, feature) {\n throw new Error(`Upgraded directive '${name}' contains unsupported feature: '${feature}'.`);\n}\n\nconst NOT_SUPPORTED = 'NOT_SUPPORTED';\nconst INITIAL_VALUE = {\n __UNINITIALIZED__: true\n};\nclass Bindings {\n constructor() {\n this.twoWayBoundProperties = [];\n this.twoWayBoundLastValues = [];\n this.expressionBoundProperties = [];\n this.propertyToOutputMap = {};\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 */\nclass UpgradeComponent {\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, elementRef, injector) {\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 this.pendingChanges = null;\n this.helper = new UpgradeHelper(injector, name, elementRef);\n this.$element = this.helper.$element;\n this.directive = this.helper.directive;\n this.bindings = this.initializeBindings(this.directive, name);\n // We ask for the AngularJS scope from the Angular injector, since\n // we will put the new component scope onto the new injector for each component\n const $parentScope = injector.get($SCOPE);\n // QUESTION 1: Should we create an isolated scope if the scope is only true?\n // QUESTION 2: Should we make the scope accessible through `$element.scope()/isolateScope()`?\n this.$componentScope = $parentScope.$new(!!this.directive.scope);\n this.initializeOutputs();\n }\n /** @nodoc */\n ngOnInit() {\n // Collect contents, insert and compile template\n const attachChildNodes = this.helper.prepareTransclusion();\n const linkFn = this.helper.compileTemplate();\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;\n if (!bindToController) {\n bindingDestination = this.$componentScope;\n }\n else if (controllerType && controllerInstance) {\n bindingDestination = controllerInstance;\n }\n else {\n throw new Error(`Upgraded directive '${this.directive.name}' specifies 'bindToController' but no controller.`);\n }\n this.controllerInstance = controllerInstance;\n this.bindingDestination = bindingDestination;\n // Set up outputs\n this.bindOutputs(bindingDestination);\n // Require other controllers\n const requiredControllers = this.helper.resolveAndBindRequiredControllers(controllerInstance);\n // Hook: $onChanges\n if (this.pendingChanges) {\n this.forwardChanges(this.pendingChanges, bindingDestination);\n this.pendingChanges = null;\n }\n // Hook: $onInit\n if (this.controllerInstance && isFunction(this.controllerInstance.$onInit)) {\n this.controllerInstance.$onInit();\n }\n // Hook: $doCheck\n if (controllerInstance && isFunction(controllerInstance.$doCheck)) {\n const callDoCheck = () => controllerInstance?.$doCheck?.();\n this.unregisterDoCheckWatcher = this.$componentScope.$parent.$watch(callDoCheck);\n callDoCheck();\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 = NOT_SUPPORTED;\n const transcludeFn = NOT_SUPPORTED;\n if (preLink) {\n preLink(this.$componentScope, this.$element, attrs, requiredControllers, transcludeFn);\n }\n linkFn(this.$componentScope, null, { parentBoundTranscludeFn: attachChildNodes });\n if (postLink) {\n postLink(this.$componentScope, this.$element, attrs, requiredControllers, transcludeFn);\n }\n // Hook: $postLink\n if (this.controllerInstance && isFunction(this.controllerInstance.$postLink)) {\n this.controllerInstance.$postLink();\n }\n }\n /** @nodoc */\n ngOnChanges(changes) {\n if (!this.bindingDestination) {\n this.pendingChanges = changes;\n }\n else {\n this.forwardChanges(changes, this.bindingDestination);\n }\n }\n /** @nodoc */\n ngDoCheck() {\n const twoWayBoundProperties = this.bindings.twoWayBoundProperties;\n const twoWayBoundLastValues = this.bindings.twoWayBoundLastValues;\n const propertyToOutputMap = this.bindings.propertyToOutputMap;\n twoWayBoundProperties.forEach((propName, idx) => {\n const newValue = this.bindingDestination?.[propName];\n const oldValue = twoWayBoundLastValues[idx];\n if (!Object.is(newValue, oldValue)) {\n const outputName = propertyToOutputMap[propName];\n const eventEmitter = this[outputName];\n eventEmitter.emit(newValue);\n twoWayBoundLastValues[idx] = newValue;\n }\n });\n }\n /** @nodoc */\n ngOnDestroy() {\n if (isFunction(this.unregisterDoCheckWatcher)) {\n this.unregisterDoCheckWatcher();\n }\n this.helper.onDestroy(this.$componentScope, this.controllerInstance);\n }\n initializeBindings(directive, name) {\n const btcIsObject = typeof directive.bindToController === 'object';\n if (btcIsObject && Object.keys(directive.scope).length) {\n throw new Error(`Binding definitions on scope and controller at the same time is not supported.`);\n }\n const context = btcIsObject ? directive.bindToController : directive.scope;\n const bindings = new Bindings();\n if (typeof context == 'object') {\n Object.keys(context).forEach(propName => {\n const definition = context[propName];\n const bindingType = definition.charAt(0);\n // QUESTION: What about `=*`? Ignore? Throw? Support?\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(`Unexpected mapping '${bindingType}' in '${json}' in '${name}' directive.`);\n }\n });\n }\n return bindings;\n }\n initializeOutputs() {\n // Initialize the outputs for `=` and `&` bindings\n this.bindings.twoWayBoundProperties.concat(this.bindings.expressionBoundProperties)\n .forEach(propName => {\n const outputName = this.bindings.propertyToOutputMap[propName];\n this[outputName] = new EventEmitter();\n });\n }\n bindOutputs(bindingDestination) {\n // Bind `&` bindings to the corresponding outputs\n this.bindings.expressionBoundProperties.forEach(propName => {\n const outputName = this.bindings.propertyToOutputMap[propName];\n const emitter = this[outputName];\n bindingDestination[propName] = (value) => emitter.emit(value);\n });\n }\n forwardChanges(changes, bindingDestination) {\n // Forward input changes to `bindingDestination`\n Object.keys(changes).forEach(propName => bindingDestination[propName] = changes[propName].currentValue);\n if (isFunction(bindingDestination.$onChanges)) {\n bindingDestination.$onChanges(changes);\n }\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"16.2.12\", ngImport: i0, type: UpgradeComponent, deps: \"invalid\", target: i0.ɵɵFactoryTarget.Directive }); }\n static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: \"14.0.0\", version: \"16.2.12\", type: UpgradeComponent, usesOnChanges: true, ngImport: i0 }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"16.2.12\", ngImport: i0, type: UpgradeComponent, decorators: [{\n type: Directive\n }], ctorParameters: function () { return [{ type: undefined }, { type: i0.ElementRef }, { type: i0.Injector }]; } });\n\n/**\n * @description\n *\n * An `NgModule`, which you import to provide AngularJS core services,\n * and has an instance method used to bootstrap the hybrid upgrade application.\n *\n * *Part of the [upgrade/static](api?query=upgrade/static)\n * library for hybrid upgrade apps that support AOT compilation*\n *\n * The `upgrade/static` package contains helpers that allow AngularJS and Angular components\n * to be used together inside a hybrid upgrade application, which supports AOT compilation.\n *\n * Specifically, the classes and functions in the `upgrade/static` module allow the following:\n *\n * 1. Creation of an Angular directive that wraps and exposes an AngularJS component so\n * that it can be used in an Angular template. See `UpgradeComponent`.\n * 2. Creation of an AngularJS directive that wraps and exposes an Angular component so\n * that it can be used in an AngularJS template. See `downgradeComponent`.\n * 3. Creation of an Angular root injector provider that wraps and exposes an AngularJS\n * service so that it can be injected into an Angular context. See\n * {@link UpgradeModule#upgrading-an-angular-1-service Upgrading an AngularJS service} below.\n * 4. Creation of an AngularJS service that wraps and exposes an Angular injectable\n * so that it can be injected into an AngularJS context. See `downgradeInjectable`.\n * 3. Bootstrapping of a hybrid Angular application which contains both of the frameworks\n * coexisting in a single application.\n *\n * @usageNotes\n *\n * ```ts\n * import {UpgradeModule} from '@angular/upgrade/static';\n * ```\n *\n * See also the {@link UpgradeModule#examples examples} below.\n *\n * ### Mental Model\n *\n * When reasoning about how a hybrid application works it is useful to have a mental model which\n * describes what is happening and explains what is happening at the lowest level.\n *\n * 1. There are two independent frameworks running in a single application, each framework treats\n * the other as a black box.\n * 2. Each DOM element on the page is owned exactly by one framework. Whichever framework\n * instantiated the element is the owner. Each framework only updates/interacts with its own\n * DOM elements and ignores others.\n * 3. AngularJS directives always execute inside the AngularJS framework codebase regardless of\n * where they are instantiated.\n * 4. Angular components always execute inside the Angular framework codebase regardless of\n * where they are instantiated.\n * 5. An AngularJS component can be \"upgraded\"\" to an Angular component. This is achieved by\n * defining an Angular directive, which bootstraps the AngularJS component at its location\n * in the DOM. See `UpgradeComponent`.\n * 6. An Angular component can be \"downgraded\" to an AngularJS component. This is achieved by\n * defining an AngularJS directive, which bootstraps the Angular component at its location\n * in the DOM. See `downgradeComponent`.\n * 7. Whenever an \"upgraded\"/\"downgraded\" component is instantiated the host element is owned by\n * the framework doing the instantiation. The other framework then instantiates and owns the\n * view for that component.\n * 1. This implies that the component bindings will always follow the semantics of the\n * instantiation framework.\n * 2. The DOM attributes are parsed by the framework that owns the current template. So\n * attributes in AngularJS templates must use kebab-case, while AngularJS templates must use\n * camelCase.\n * 3. However the template binding syntax will always use the Angular style, e.g. square\n * brackets (`[...]`) for property binding.\n * 8. Angular is bootstrapped first; AngularJS is bootstrapped second. AngularJS always owns the\n * root component of the application.\n * 9. The new application is running in an Angular zone, and therefore it no longer needs calls to\n * `$apply()`.\n *\n * ### The `UpgradeModule` class\n *\n * This class is an `NgModule`, which you import to provide AngularJS core services,\n * and has an instance method used to bootstrap the hybrid upgrade application.\n *\n * * Core AngularJS services
\n * Importing this `NgModule` will add providers for the core\n * [AngularJS services](https://docs.angularjs.org/api/ng/service) to the root injector.\n *\n * * Bootstrap
\n * The runtime instance of this class contains a {@link UpgradeModule#bootstrap `bootstrap()`}\n * method, which you use to bootstrap the top level AngularJS module onto an element in the\n * DOM for the hybrid upgrade app.\n *\n * It also contains properties to access the {@link UpgradeModule#injector root injector}, the\n * bootstrap `NgZone` and the\n * [AngularJS $injector](https://docs.angularjs.org/api/auto/service/$injector).\n *\n * ### Examples\n *\n * Import the `UpgradeModule` into your top level {@link NgModule Angular `NgModule`}.\n *\n * {@example upgrade/static/ts/full/module.ts region='ng2-module'}\n *\n * Then inject `UpgradeModule` into your Angular `NgModule` and use it to bootstrap the top level\n * [AngularJS module](https://docs.angularjs.org/api/ng/type/angular.Module) in the\n * `ngDoBootstrap()` method.\n *\n * {@example upgrade/static/ts/full/module.ts region='bootstrap-ng1'}\n *\n * Finally, kick off the whole process, by bootstrapping your top level Angular `NgModule`.\n *\n * {@example upgrade/static/ts/full/module.ts region='bootstrap-ng2'}\n *\n * {@a upgrading-an-angular-1-service}\n * ### Upgrading an AngularJS service\n *\n * There is no specific API for upgrading an AngularJS service. Instead you should just follow the\n * following recipe:\n *\n * Let's say you have an AngularJS service:\n *\n * {@example upgrade/static/ts/full/module.ts region=\"ng1-text-formatter-service\"}\n *\n * Then you should define an Angular provider to be included in your `NgModule` `providers`\n * property.\n *\n * {@example upgrade/static/ts/full/module.ts region=\"upgrade-ng1-service\"}\n *\n * Then you can use the \"upgraded\" AngularJS service by injecting it into an Angular component\n * or service.\n *\n * {@example upgrade/static/ts/full/module.ts region=\"use-ng1-upgraded-service\"}\n *\n * @publicApi\n */\nclass UpgradeModule {\n constructor(\n /** The root `Injector` for the upgrade application. */\n injector, \n /** The bootstrap zone for the upgrade application */\n 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 platformRef) {\n this.ngZone = ngZone;\n this.platformRef = platformRef;\n this.injector = new NgAdapterInjector(injector);\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(element$1, modules = [], config /*angular.IAngularBootstrapConfig*/) {\n const INIT_MODULE_NAME = UPGRADE_MODULE_NAME + '.init';\n // Create an ng1 module to bootstrap\n module_(INIT_MODULE_NAME, [])\n .constant(UPGRADE_APP_TYPE_KEY, 2 /* UpgradeAppType.Static */)\n .value(INJECTOR_KEY, this.injector)\n .factory(LAZY_MODULE_REF, [INJECTOR_KEY, (injector) => ({ injector })])\n .config([\n $PROVIDE, $INJECTOR,\n ($provide, $injector) => {\n if ($injector.has($$TESTABILITY)) {\n $provide.decorator($$TESTABILITY, [\n $DELEGATE,\n (testabilityDelegate) => {\n const originalWhenStable = testabilityDelegate.whenStable;\n const injector = this.injector;\n // Cannot use arrow function below because we need the context\n const newWhenStable = function (callback) {\n originalWhenStable.call(testabilityDelegate, function () {\n const ng2Testability = injector.get(Testability);\n if (ng2Testability.isStable()) {\n callback();\n }\n else {\n ng2Testability.whenStable(newWhenStable.bind(testabilityDelegate, callback));\n }\n });\n };\n testabilityDelegate.whenStable = newWhenStable;\n return testabilityDelegate;\n }\n ]);\n }\n if ($injector.has($INTERVAL)) {\n $provide.decorator($INTERVAL, [\n $DELEGATE,\n (intervalDelegate) => {\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 = (fn, delay, count, invokeApply, ...pass) => {\n return this.ngZone.runOutsideAngular(() => {\n return intervalDelegate((...args) => {\n // Run callback in the next VM turn - $interval calls\n // $rootScope.$apply, and running the callback in NgZone will\n // cause a '$digest already in progress' error if it's in the\n // same vm turn.\n setTimeout(() => {\n this.ngZone.run(() => fn(...args));\n });\n }, delay, count, invokeApply, ...pass);\n });\n };\n Object.keys(intervalDelegate)\n .forEach(prop => wrappedInterval[prop] = intervalDelegate[prop]);\n // the `flush` method will be present when ngMocks is used\n if (intervalDelegate.hasOwnProperty('flush')) {\n wrappedInterval['flush'] = () => {\n intervalDelegate['flush']();\n return wrappedInterval;\n };\n }\n return wrappedInterval;\n }\n ]);\n }\n }\n ])\n .run([\n $INJECTOR,\n ($injector) => {\n this.$injector = $injector;\n const $rootScope = $injector.get('$rootScope');\n // Initialize the ng1 $injector provider\n setTempInjectorRef($injector);\n this.injector.get($INJECTOR);\n // Put the injector on the DOM, so that it can be \"required\"\n element(element$1).data(controllerKey(INJECTOR_KEY), this.injector);\n // Destroy the AngularJS app once the Angular `PlatformRef` is destroyed.\n // This does not happen in a typical SPA scenario, but it might be useful for\n // other use-cases where disposing of an Angular/AngularJS app is necessary\n // (such as Hot Module Replacement (HMR)).\n // See https://github.com/angular/angular/issues/39935.\n this.platformRef.onDestroy(() => destroyApp($injector));\n // Wire up the ng1 rootScope to run a digest cycle whenever the zone settles\n // We need to do this in the next tick so that we don't prevent the bootup stabilizing\n setTimeout(() => {\n const subscription = this.ngZone.onMicrotaskEmpty.subscribe(() => {\n if ($rootScope.$$phase) {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n console.warn('A digest was triggered while one was already in progress. This may mean that something is triggering digests outside the Angular zone.');\n }\n return $rootScope.$evalAsync();\n }\n return $rootScope.$digest();\n });\n $rootScope.$on('$destroy', () => {\n subscription.unsubscribe();\n });\n }, 0);\n }\n ]);\n const upgradeModule = module_(UPGRADE_MODULE_NAME, [INIT_MODULE_NAME].concat(modules));\n // Make sure resumeBootstrap() only exists if the current bootstrap is deferred\n const windowAngular = window['angular'];\n windowAngular.resumeBootstrap = undefined;\n // Bootstrap the AngularJS application inside our zone\n const returnValue = this.ngZone.run(() => bootstrap(element$1, [upgradeModule.name], config));\n // Patch resumeBootstrap() to run inside the ngZone\n if (windowAngular.resumeBootstrap) {\n const originalResumeBootstrap = 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 return returnValue;\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"16.2.12\", ngImport: i0, type: UpgradeModule, deps: [{ token: i0.Injector }, { token: i0.NgZone }, { token: i0.PlatformRef }], target: i0.ɵɵFactoryTarget.NgModule }); }\n static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: \"14.0.0\", version: \"16.2.12\", ngImport: i0, type: UpgradeModule }); }\n static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: \"12.0.0\", version: \"16.2.12\", ngImport: i0, type: UpgradeModule, providers: [angular1Providers] }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"16.2.12\", ngImport: i0, type: UpgradeModule, decorators: [{\n type: NgModule,\n args: [{ providers: [angular1Providers] }]\n }], ctorParameters: function () { return [{ type: i0.Injector }, { type: i0.NgZone }, { type: i0.PlatformRef }]; } });\n\n// This file only re-exports items to appear in the public api. Keep it that way.\n\n// This file is not used to build this module. It is only used during editing\n\n/**\n * Generated bundle index. Do not edit.\n */\n\nexport { UpgradeComponent, UpgradeModule, VERSION, downgradeComponent, downgradeInjectable, downgradeModule, getAngularJSGlobal, getAngularLib, setAngularJSGlobal, setAngularLib };\n","/* tslint:disable:no-trailing-whitespace align */\n/**\n * Buildium patch for https://github.com/angular/angular/blob/10.2.5/packages/router/upgrade/src/upgrade.ts\n *\n * Fixes:\n * URL not changing when using browser back/forward button in some cases\n * https://buildium.atlassian.net/browse/H2-2910\n * \n * Symptom: \n * see diagram for \"Duplicate transition ignored\"\n * https://ui-router.github.io/guide/transitions#atomicity\n * \n * Workaround identified in this discussion:\n * setUpLocationSync causes an duplicate navigation events\n * https://github.com/angular/angular/issues/21610\n */\n\n\n\n/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n import {Location} from '@angular/common';\n import {APP_BOOTSTRAP_LISTENER, ComponentRef, InjectionToken} from '@angular/core';\n import {Router} from '@angular/router';\n import {UpgradeModule} from '@angular/upgrade/static';\n \n /**\n * Creates an initializer that sets up `ngRoute` integration\n * along with setting up the Angular router.\n *\n * @usageNotes\n *\n * \n * @NgModule({\n * imports: [\n * RouterModule.forRoot(SOME_ROUTES),\n * UpgradeModule\n * ],\n * providers: [\n * RouterUpgradeInitializer\n * ]\n * })\n * export class AppModule {\n * ngDoBootstrap() {}\n * }\n * \n *\n * @publicApi\n */\n export const RouterUpgradeInitializer = {\n provide: APP_BOOTSTRAP_LISTENER,\n multi: true,\n useFactory: locationSyncBootstrapListener as (ngUpgrade: UpgradeModule) => () => void,\n deps: [UpgradeModule]\n };\n \n /**\n * @internal\n */\n export function locationSyncBootstrapListener(ngUpgrade: UpgradeModule) {\n return () => {\n setUpLocationSync(ngUpgrade);\n };\n }\n \n /**\n * Sets up a location change listener to trigger `history.pushState`.\n * Works around the problem that `onPopState` does not trigger `history.pushState`.\n * Must be called *after* calling `UpgradeModule.bootstrap`.\n *\n * @param ngUpgrade The upgrade NgModule.\n * @param urlType The location strategy.\n * @see `HashLocationStrategy`\n * @see `PathLocationStrategy`\n *\n * @publicApi\n */\n export function setUpLocationSync(ngUpgrade: UpgradeModule, urlType: 'path'|'hash' = 'path') {\n if (!ngUpgrade.$injector) {\n throw new Error(`\n RouterUpgradeInitializer can be used only after UpgradeModule.bootstrap has been called.\n Remove RouterUpgradeInitializer and call setUpLocationSync after UpgradeModule.bootstrap.\n `);\n }\n \n const router: Router = ngUpgrade.injector.get(Router);\n const location: Location = ngUpgrade.injector.get(Location);\n \n // PATCH start\n // setUpLocationSync causes an duplicate navigation events\n // https://github.com/angular/angular/issues/21610#issuecomment-440445471\n ngUpgrade.$injector.get('$rootScope')\n .$on('$locationChangeStart', (_: any, next: string, current: string) => {\n const currentUrl = resolveUrl(current);\n const currentPath = location.normalize(currentUrl.pathname);\n const currentLocation = currentPath + currentUrl.search + currentUrl.hash;\n const nextUrl = resolveUrl(next);\n const nextPath = location.normalize(nextUrl.pathname);\n const nextLocation = nextPath + nextUrl.search + nextUrl.hash;\n \n if (currentLocation !== nextLocation) {\n router.navigateByUrl(nextLocation, { skipLocationChange: true });\n }\n });\n // PATCH end\n }\n \n /**\n * Normalizes and parses a URL.\n *\n * - Normalizing means that a relative URL will be resolved into an absolute URL in the context of\n * the application document.\n * - Parsing means that the anchor's `protocol`, `hostname`, `port`, `pathname` and related\n * properties are all populated to reflect the normalized URL.\n *\n * While this approach has wide compatibility, it doesn't work as expected on IE. On IE, normalizing\n * happens similar to other browsers, but the parsed components will not be set. (E.g. if you assign\n * `a.href = 'foo'`, then `a.protocol`, `a.host`, etc. will not be correctly updated.)\n * We work around that by performing the parsing in a 2nd step by taking a previously normalized URL\n * and assigning it again. This correctly populates all properties.\n *\n * See\n * https://github.com/angular/angular.js/blob/2c7400e7d07b0f6cec1817dab40b9250ce8ebce6/src/ng/urlUtils.js#L26-L33\n * for more info.\n */\n let anchor: HTMLAnchorElement|undefined;\n function resolveUrl(url: string): {pathname: string, search: string, hash: string} {\n if (!anchor) {\n anchor = document.createElement('a');\n }\n \n anchor.setAttribute('href', url);\n anchor.setAttribute('href', anchor.href);\n \n return {\n // IE does not start `pathname` with `/` like other browsers.\n pathname: `/${anchor.pathname.replace(/^\\//, '')}`,\n search: anchor.search,\n hash: anchor.hash\n };\n }\n","import angular from 'angular';\r\n\r\nexport const BuildiumCacheModule = angular.module('buildium.cache', [])\r\n .service('SeedData', angular.noop);\r\n","/**\r\n * API interceptor for 'Notify' \r\n * from NotificationsModule in @buildiumprivate/angularjs-core/dist/notifications\r\n*/\r\n\r\nexport function NotifyShimService(\r\n ToastMessageStateService,\r\n) {\r\n const service = {};\r\n\r\n service.success = function success(message) {\r\n return ToastMessageStateService.success(message);\r\n };\r\n\r\n service.error = function error(message) {\r\n return ToastMessageStateService.error(message);\r\n };\r\n\r\n service.confirmation = function confirmation(message, messageType) {\r\n if (messageType && messageType === 'Error') {\r\n return ToastMessageStateService.error(message);\r\n } else {\r\n return ToastMessageStateService.success(message);\r\n }\r\n };\r\n\r\n service.notifyOnNavigation = function notifyOnNavigation(message, messageType) {\r\n if (messageType && messageType === 'Error') {\r\n return ToastMessageStateService.errorAfterNavigate(message);\r\n } else {\r\n return ToastMessageStateService.successAfterNavigate(message);\r\n }\r\n };\r\n\r\n service.displayConfirmationMessage = function displayConfirmationMessage(message) {\r\n return ToastMessageStateService.displayMessageOnNavigate(message);\r\n };\r\n\r\n return service;\r\n}\r\nNotifyShimService.$inject = [\r\n 'ToastMessageStateService',\r\n];\r\n","import { Injectable } from '@angular/core';\r\nimport { BehaviorSubject } from 'rxjs';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class SiteChromeService {\r\n visible$: BehaviorSubject;\r\n\r\n constructor() {\r\n this.visible$ = new BehaviorSubject(true);\r\n }\r\n\r\n setVisibility(value: boolean): void {\r\n this.visible$.next(value);\r\n }\r\n}\r\n","// angularjs\nimport angular from 'angular';\nimport angularRedux from '@buildium/angular-redux';\nimport jQuery from 'jquery';\n\nimport { PublicAngularJSRoutingModule } from './app-routing.module.ajs';\nimport { BuildiumCacheModule } from '../../../../src/shared/cache.module';\nimport { environment } from '../environments/environment';\nimport { downgradeInjectable } from '@angular/upgrade/static';\nimport { NotifyShimService } from './page/notify-shim-service';\n// In general, we should NOT be importing services from other apps, but these will eventually come from a shared package\nimport { PageTitleService } from '../../../../src/app/services/page-title.service';\nimport { PageLoadingService } from '../../../../src/app/services/page-loading.service';\nimport { ToastMessageStateService } from '../../../../src/app/core/toast-message/services/toast-message.state.service';\nimport { FeatureFlagService } from '../../../../src/app/services/feature-flag.service';\nimport { SiteChromeService } from '../../../../src/app/core/app-shell/services/site-chrome.service';\n\n// feature modules\n// NOTE: to lazy load a feature module, do not import here\n// use angularJsFeatureModules to register the module in app-routing.module.ajs.ts\n\njQuery.migrateMute = true;\n\n// suppress ocLazyLoad error, due to known conflict between angular's UpgradeModule and ocLazyLoad\n// https://github.com/ocombe/ocLazyLoad/issues/250#issuecomment-948309569\nObject.defineProperty(angular.element.prototype, 'className', {\n get() {\n return this[0] === document ? 'ng:app:ng' : undefined;\n }\n});\n\nexport const PublicAngularJSModule = angularRedux.createApp('buildium-public', [\n PublicAngularJSRoutingModule,\n\n // TODO - remove. BuildiumCacheModule shouldn't be needed, once the app shell is acting like a SPA\n BuildiumCacheModule.name,\n])\n .factory('PageTitleService', downgradeInjectable(PageTitleService))\n .factory('PageLoadingService', downgradeInjectable(PageLoadingService))\n .factory('ToastMessageStateService', downgradeInjectable(ToastMessageStateService))\n .factory('FeatureFlagService', downgradeInjectable(FeatureFlagService))\n .factory('SiteChromeService', downgradeInjectable(SiteChromeService))\n .service('Notify', NotifyShimService)\n .name;\n\nif (!environment.production) {\n // eslint-disable-next-line no-console\n console.debug('[PublicAngularJSModule] AngularJS loaded, version', angular.version.full);\n}\n","import { Component, NgModule } from '@angular/core';\nimport { UpgradeModule } from '@angular/upgrade/static';\nimport { RouterModule } from '@angular/router';\n// TODO - monitor this PR, it may remove the need for this patch - https://github.com/angular/angular/pull/43441\nimport { setUpLocationSync } from './core/routes/angular-router-upgrade.patch';\n\nimport { PublicAngularJSModule } from '../ajs-app/app.module.ajs';\n\n/**\n * This module is written at the beginning of the upgrade process.\n * It does not need to change with the upgrade process.\n */\n\n@Component({ template: `` })\nexport class EmptyComponent { }\n\n@NgModule({\n declarations: [\n EmptyComponent\n ],\n imports: [\n UpgradeModule,\n RouterModule.forChild([\n {\n path: '**',\n component: EmptyComponent,\n data: {\n isAngularJsRoute: true\n }\n }\n ])\n ]\n})\nexport class Ng1WrapperModule {\n // The constructor is called only once, so we bootstrap the application\n // only once, when we first navigate to the legacy part of the app.\n constructor(upgrade: UpgradeModule) {\n upgrade.bootstrap(document.body, [PublicAngularJSModule], { strictDi: true });\n // BEWARE! setUpLocationSync causes an duplicate navigation events\n // https://github.com/angular/angular/issues/21610\n setUpLocationSync(upgrade);\n }\n}\n"],"x_google_ignoreList":[0]}