ng-implementation/implem/.angular/cache/20.1.4/babel-webpack/2c66c82234d42aebbb6a3c0a5661e7d2.json
2025-08-19 12:05:42 +02:00

1 line
No EOL
3.3 MiB
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{"ast":null,"code":"import _asyncToGenerator from \"/home/poule/encrypted/stockage-syncable/www/development/html/ng-implementation/implem/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\";\n/**\n * @license Angular v20.1.4\n * (c) 2010-2025 Google LLC. https://angular.io/\n * License: MIT\n */\n\nimport { attachInjectFlag, _global, ɵɵdefineInjectable as __defineInjectable, ɵɵdefineInjector as __defineInjector, ɵɵinject as __inject, ɵɵinvalidFactoryDep as __invalidFactoryDep, resolveForwardRef, newArray, EMPTY_OBJ, assertString, assertNotEqual, FLAGS, assertEqual, isInCheckNoChangesMode, PREORDER_HOOK_FLAGS, assertFirstCreatePass, assertDefined, throwError, assertNumber, assertGreaterThan, HEADER_OFFSET, DECLARATION_VIEW, NG_FACTORY_DEF, isForwardRef, getFactoryDef, assertIndexInRange, assertTNodeForLView, enterDI, runInInjectorProfilerContext, getCurrentTNode, getLView, emitInjectorToCreateInstanceEvent, emitInstanceCreatedByInjectorEvent, throwProviderNotFoundError, leaveDI, assertNodeInjector, stringifyForError, cyclicDependencyErrorWithDetails, cyclicDependencyError, setInjectorProfilerContext, setInjectImplementation, assertDirectiveDef, NG_ELEMENT_ID, convertToBitFlags, isRootView, T_HOST, TVIEW, injectRootLimpMode, isComponentDef, EMBEDDED_VIEW_INJECTOR, INJECTOR$1 as INJECTOR, DECLARATION_COMPONENT_VIEW, isComponentHost, RuntimeError, NG_PROV_DEF, getClosureSafeProperty, getNativeByTNode, flatten, arrayEquals, ID, isLView, assertDomNode, unwrapRNode, getComponentLViewByIndex, CONTEXT, EMPTY_ARRAY, assertLView, HOST, CHILD_HEAD, NEXT, isLContainer, getLViewParent, Injector, CLEANUP, getComponentDef, getDirectiveDef, InjectionToken, inject, isInSkipHydrationBlock as isInSkipHydrationBlock$1, HYDRATION, isContentQueryHost, setCurrentQueryIndex, XSS_SECURITY_URL, renderStringify, ENVIRONMENT, makeEnvironmentProviders, isDirectiveHost, formatRuntimeError, resetPreOrderHookFlags, PARENT, RENDERER, CHILD_TAIL, assertSame, assertFirstUpdatePass, getSelectedIndex, getTView, assertIndexInDeclRange, setSelectedIndex, assertLContainer, MOVED_VIEWS, isDestroyed, REACTIVE_TEMPLATE_CONSUMER, DECLARATION_LCONTAINER, QUERIES, assertNotReactive, ON_DESTROY_HOOKS, assertFunction, EFFECTS, assertProjectionSlots, NATIVE, assertParentView, CONTAINER_HEADER_OFFSET, assertNotSame, setCurrentDirectiveIndex, setCurrentTNode, getElementDepthCount, increaseElementDepthCount, wasLastNodeCreated, isCurrentTNodeParent, setCurrentTNodeAsNotParent, assertHasParent, INTERNAL_APPLICATION_ERROR_HANDLER, stringify, getCurrentDirectiveIndex, unwrapLView, isCreationMode, enterView, leaveView, AFTER_RENDER_SEQUENCES_TO_ADD, markAncestorsForTraversal, markViewForRefresh, setIsRefreshingViews, isExhaustiveCheckNoChanges, requiresRefreshOrTraversal, setIsInCheckNoChangesMode, CheckNoChangesMode, setBindingIndex, EFFECTS_TO_SCHEDULE, viewAttachedToChangeDetector, setBindingRootForHostBindings, isRefreshingViews, removeFromArray, addToArray, updateAncestorTraversalFlagsOnAttach, storeLViewOnDestroy, VIEW_REFS, assertGreaterThanOrEqual, isInI18nBlock, assertTNodeForTView, getCurrentParentTNode, getCurrentTNodePlaceholderOk, assertTNode, assertTIcu, assertNumberInRange, DEHYDRATED_VIEWS, getNgModuleDef, getPipeDef as getPipeDef$1, getNgModuleDefOrThrow, isStandalone, concatStringsWithSpace, assertInjectImplementationNotEqual, emitInjectEvent, getConstant, assertLessThan, getOrCreateTViewCleanup, getOrCreateLViewCleanup, assertNotDefined, nextBindingIndex, getSelectedTNode, getDirectiveDefOrThrow, getTNode, assertComponentType, debugStringifyTypeForError, ChangeDetectionScheduler, EnvironmentInjector, SVG_NAMESPACE, MATH_ML_NAMESPACE, viewAttachedToContainer, storeCleanupWithContext, signal, createInjectorWithoutInjectorInstances, R3Injector, getNullInjector, internalImportProvidersFrom, initNgDevMode, fillProperties, getBindingsEnabled, lastNodeWasCreated, isInInjectionContext, DestroyRef, PendingTasksInternal, noop, ErrorHandler, assertNotInReactiveContext, assertInInjectionContext, ViewContext, removeLViewOnDestroy, walkUpViews, getNativeByIndex, assertElement, arrayInsert2, arraySplice, setInjectorProfiler, NullInjector, ENVIRONMENT_INITIALIZER, INJECTOR_DEF_TYPES, walkProviderTree, getInjectorDef, deepForEach, isTypeProvider, isSignal, runInInjectionContext, ZONELESS_ENABLED, EffectScheduler, PendingTasks, assertTNodeCreationIndex, isSkipHydrationRootTNode, leaveSkipHydrationBlock, decreaseElementDepthCount, getNamespace, enterSkipHydrationBlock, getCurrentDirectiveDef, assertIndexInExpandoRange, getBindingIndex, assertOneOf, setInI18nBlock, nextContextImpl, getCurrentQueryIndex, getContextLView, load, keyValueArrayIndexOf, keyValueArraySet, keyValueArrayGet, incrementBindingIndex, isWritableSignal, store, providerToFactory, emitProviderConfiguredEvent, isClassProvider, getBindingRoot, NG_COMP_DEF, ɵɵresetView as __resetView, ɵɵnamespaceHTML as __namespaceHTML, ɵɵnamespaceMathML as __namespaceMathML, ɵɵnamespaceSVG as __namespaceSVG, ɵɵenableBindings as __enableBindings, ɵɵdisableBindings as __disableBindings, ɵɵrestoreView as __restoreView, forwardRef, NG_MOD_DEF, NG_INJ_DEF, NG_DIR_DEF, NG_PIPE_DEF, ZONELESS_SCHEDULER_DISABLED, SCHEDULE_IN_ROOT_ZONE, PROVIDED_ZONELESS, getNativeByTNodeOrNull } from './root_effect_scheduler.mjs';\nimport { setActiveConsumer, SIGNAL, consumerDestroy, REACTIVE_NODE, consumerPollProducersForChange, consumerBeforeComputation, getActiveConsumer, consumerAfterComputation, createComputed, setThrowInvalidWriteToSignalError } from './signal.mjs';\nimport { Subject, Subscription } from 'rxjs';\nimport { setActiveConsumer as setActiveConsumer$1 } from '@angular/core/primitives/signals';\nimport { map } from 'rxjs/operators';\nimport { Attribute as Attribute$1 } from './attribute.mjs';\n\n/**\n * Convince closure compiler that the wrapped function has no side-effects.\n *\n * Closure compiler always assumes that `toString` has no side-effects. We use this quirk to\n * allow us to execute a function but have closure compiler mark the call as no-side-effects.\n * It is important that the return value for the `noSideEffects` function be assigned\n * to something which is retained otherwise the call to `noSideEffects` will be removed by closure\n * compiler.\n */\nfunction noSideEffects(fn) {\n return {\n toString: fn\n }.toString();\n}\nconst ANNOTATIONS = '__annotations__';\nconst PARAMETERS = '__parameters__';\nconst PROP_METADATA = '__prop__metadata__';\n/**\n * @suppress {globalThis}\n */\nfunction makeDecorator(name, props, parentClass, additionalProcessing, typeFn) {\n return noSideEffects(() => {\n const metaCtor = makeMetadataCtor(props);\n function DecoratorFactory(...args) {\n if (this instanceof DecoratorFactory) {\n metaCtor.call(this, ...args);\n return this;\n }\n const annotationInstance = new DecoratorFactory(...args);\n return function TypeDecorator(cls) {\n if (typeFn) typeFn(cls, ...args);\n // Use of Object.defineProperty is important since it creates non-enumerable property which\n // prevents the property is copied during subclassing.\n const annotations = cls.hasOwnProperty(ANNOTATIONS) ? cls[ANNOTATIONS] : Object.defineProperty(cls, ANNOTATIONS, {\n value: []\n })[ANNOTATIONS];\n annotations.push(annotationInstance);\n return cls;\n };\n }\n if (parentClass) {\n DecoratorFactory.prototype = Object.create(parentClass.prototype);\n }\n DecoratorFactory.prototype.ngMetadataName = name;\n DecoratorFactory.annotationCls = DecoratorFactory;\n return DecoratorFactory;\n });\n}\nfunction makeMetadataCtor(props) {\n return function ctor(...args) {\n if (props) {\n const values = props(...args);\n for (const propName in values) {\n this[propName] = values[propName];\n }\n }\n };\n}\nfunction makeParamDecorator(name, props, parentClass) {\n return noSideEffects(() => {\n const metaCtor = makeMetadataCtor(props);\n function ParamDecoratorFactory(...args) {\n if (this instanceof ParamDecoratorFactory) {\n metaCtor.apply(this, args);\n return this;\n }\n const annotationInstance = new ParamDecoratorFactory(...args);\n ParamDecorator.annotation = annotationInstance;\n return ParamDecorator;\n function ParamDecorator(cls, unusedKey, index) {\n // Use of Object.defineProperty is important since it creates non-enumerable property which\n // prevents the property is copied during subclassing.\n const parameters = cls.hasOwnProperty(PARAMETERS) ? cls[PARAMETERS] : Object.defineProperty(cls, PARAMETERS, {\n value: []\n })[PARAMETERS];\n // there might be gaps if some in between parameters do not have annotations.\n // we pad with nulls.\n while (parameters.length <= index) {\n parameters.push(null);\n }\n (parameters[index] = parameters[index] || []).push(annotationInstance);\n return cls;\n }\n }\n ParamDecoratorFactory.prototype.ngMetadataName = name;\n ParamDecoratorFactory.annotationCls = ParamDecoratorFactory;\n return ParamDecoratorFactory;\n });\n}\nfunction makePropDecorator(name, props, parentClass, additionalProcessing) {\n return noSideEffects(() => {\n const metaCtor = makeMetadataCtor(props);\n function PropDecoratorFactory(...args) {\n if (this instanceof PropDecoratorFactory) {\n metaCtor.apply(this, args);\n return this;\n }\n const decoratorInstance = new PropDecoratorFactory(...args);\n function PropDecorator(target, name) {\n // target is undefined with standard decorators. This case is not supported and will throw\n // if this decorator is used in JIT mode with standard decorators.\n if (target === undefined) {\n throw new Error('Standard Angular field decorators are not supported in JIT mode.');\n }\n const constructor = target.constructor;\n // Use of Object.defineProperty is important because it creates a non-enumerable property\n // which prevents the property from being copied during subclassing.\n const meta = constructor.hasOwnProperty(PROP_METADATA) ? constructor[PROP_METADATA] : Object.defineProperty(constructor, PROP_METADATA, {\n value: {}\n })[PROP_METADATA];\n meta[name] = meta.hasOwnProperty(name) && meta[name] || [];\n meta[name].unshift(decoratorInstance);\n }\n return PropDecorator;\n }\n if (parentClass) {\n PropDecoratorFactory.prototype = Object.create(parentClass.prototype);\n }\n PropDecoratorFactory.prototype.ngMetadataName = name;\n PropDecoratorFactory.annotationCls = PropDecoratorFactory;\n return PropDecoratorFactory;\n });\n}\n\n/**\n * Inject decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nconst Inject = attachInjectFlag(\n// Disable tslint because `DecoratorFlags` is a const enum which gets inlined.\nmakeParamDecorator('Inject', token => ({\n token\n})), -1 /* DecoratorFlags.Inject */);\n/**\n * Optional decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nconst Optional =\n// Disable tslint because `InternalInjectFlags` is a const enum which gets inlined.\n// tslint:disable-next-line: no-toplevel-property-access\nattachInjectFlag(makeParamDecorator('Optional'), 8 /* InternalInjectFlags.Optional */);\n/**\n * Self decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nconst Self =\n// Disable tslint because `InternalInjectFlags` is a const enum which gets inlined.\n// tslint:disable-next-line: no-toplevel-property-access\nattachInjectFlag(makeParamDecorator('Self'), 2 /* InternalInjectFlags.Self */);\n/**\n * `SkipSelf` decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nconst SkipSelf =\n// Disable tslint because `InternalInjectFlags` is a const enum which gets inlined.\n// tslint:disable-next-line: no-toplevel-property-access\nattachInjectFlag(makeParamDecorator('SkipSelf'), 4 /* InternalInjectFlags.SkipSelf */);\n/**\n * Host decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nconst Host =\n// Disable tslint because `InternalInjectFlags` is a const enum which gets inlined.\n// tslint:disable-next-line: no-toplevel-property-access\nattachInjectFlag(makeParamDecorator('Host'), 1 /* InternalInjectFlags.Host */);\nfunction getCompilerFacade(request) {\n const globalNg = _global['ng'];\n if (globalNg && globalNg.ɵcompilerFacade) {\n return globalNg.ɵcompilerFacade;\n }\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n // Log the type as an error so that a developer can easily navigate to the type from the\n // console.\n console.error(`JIT compilation failed for ${request.kind}`, request.type);\n let message = `The ${request.kind} '${request.type.name}' needs to be compiled using the JIT compiler, but '@angular/compiler' is not available.\\n\\n`;\n if (request.usage === 1 /* JitCompilerUsage.PartialDeclaration */) {\n message += `The ${request.kind} is part of a library that has been partially compiled.\\n`;\n message += `However, the Angular Linker has not processed the library such that JIT compilation is used as fallback.\\n`;\n message += '\\n';\n message += `Ideally, the library is processed using the Angular Linker to become fully AOT compiled.\\n`;\n } else {\n message += `JIT compilation is discouraged for production use-cases! Consider using AOT mode instead.\\n`;\n }\n message += `Alternatively, the JIT compiler should be loaded by bootstrapping using '@angular/platform-browser-dynamic' or '@angular/platform-server',\\n`;\n message += `or manually provide the compiler with 'import \"@angular/compiler\";' before bootstrapping.`;\n throw new Error(message);\n } else {\n throw new Error('JIT compiler unavailable');\n }\n}\n\n/**\n * A mapping of the @angular/core API surface used in generated expressions to the actual symbols.\n *\n * This should be kept up to date with the public exports of @angular/core.\n */\nconst angularCoreDiEnv = {\n 'ɵɵdefineInjectable': __defineInjectable,\n 'ɵɵdefineInjector': __defineInjector,\n 'ɵɵinject': __inject,\n 'ɵɵinvalidFactoryDep': __invalidFactoryDep,\n 'resolveForwardRef': resolveForwardRef\n};\n\n/**\n * @description\n *\n * Represents a type that a Component or other object is instances of.\n *\n * An example of a `Type` is `MyCustomComponent` class, which in JavaScript is represented by\n * the `MyCustomComponent` constructor function.\n *\n * @publicApi\n */\nconst Type = Function;\nfunction isType(v) {\n return typeof v === 'function';\n}\n\n/*\n * #########################\n * Attention: These Regular expressions have to hold even if the code is minified!\n * ##########################\n */\n/**\n * Regular expression that detects pass-through constructors for ES5 output. This Regex\n * intends to capture the common delegation pattern emitted by TypeScript and Babel. Also\n * it intends to capture the pattern where existing constructors have been downleveled from\n * ES2015 to ES5 using TypeScript w/ downlevel iteration. e.g.\n *\n * ```ts\n * function MyClass() {\n * var _this = _super.apply(this, arguments) || this;\n * ```\n *\n * downleveled to ES5 with `downlevelIteration` for TypeScript < 4.2:\n * ```ts\n * function MyClass() {\n * var _this = _super.apply(this, __spread(arguments)) || this;\n * ```\n *\n * or downleveled to ES5 with `downlevelIteration` for TypeScript >= 4.2:\n * ```ts\n * function MyClass() {\n * var _this = _super.apply(this, __spreadArray([], __read(arguments), false)) || this;\n * ```\n *\n * More details can be found in: https://github.com/angular/angular/issues/38453.\n */\nconst ES5_DELEGATE_CTOR = /^function\\s+\\S+\\(\\)\\s*{[\\s\\S]+\\.apply\\(this,\\s*(arguments|(?:[^()]+\\(\\[\\],)?[^()]+\\(arguments\\).*)\\)/;\n/** Regular expression that detects ES2015 classes which extend from other classes. */\nconst ES2015_INHERITED_CLASS = /^class\\s+[A-Za-z\\d$_]*\\s*extends\\s+[^{]+{/;\n/**\n * Regular expression that detects ES2015 classes which extend from other classes and\n * have an explicit constructor defined.\n */\nconst ES2015_INHERITED_CLASS_WITH_CTOR = /^class\\s+[A-Za-z\\d$_]*\\s*extends\\s+[^{]+{[\\s\\S]*constructor\\s*\\(/;\n/**\n * Regular expression that detects ES2015 classes which extend from other classes\n * and inherit a constructor.\n */\nconst ES2015_INHERITED_CLASS_WITH_DELEGATE_CTOR = /^class\\s+[A-Za-z\\d$_]*\\s*extends\\s+[^{]+{[\\s\\S]*constructor\\s*\\(\\)\\s*{[^}]*super\\(\\.\\.\\.arguments\\)/;\n/**\n * Determine whether a stringified type is a class which delegates its constructor\n * to its parent.\n *\n * This is not trivial since compiled code can actually contain a constructor function\n * even if the original source code did not. For instance, when the child class contains\n * an initialized instance property.\n */\nfunction isDelegateCtor(typeStr) {\n return ES5_DELEGATE_CTOR.test(typeStr) || ES2015_INHERITED_CLASS_WITH_DELEGATE_CTOR.test(typeStr) || ES2015_INHERITED_CLASS.test(typeStr) && !ES2015_INHERITED_CLASS_WITH_CTOR.test(typeStr);\n}\nclass ReflectionCapabilities {\n _reflect;\n constructor(reflect) {\n this._reflect = reflect || _global['Reflect'];\n }\n factory(t) {\n return (...args) => new t(...args);\n }\n /** @internal */\n _zipTypesAndAnnotations(paramTypes, paramAnnotations) {\n let result;\n if (typeof paramTypes === 'undefined') {\n result = newArray(paramAnnotations.length);\n } else {\n result = newArray(paramTypes.length);\n }\n for (let i = 0; i < result.length; i++) {\n // TS outputs Object for parameters without types, while Traceur omits\n // the annotations. For now we preserve the Traceur behavior to aid\n // migration, but this can be revisited.\n if (typeof paramTypes === 'undefined') {\n result[i] = [];\n } else if (paramTypes[i] && paramTypes[i] != Object) {\n result[i] = [paramTypes[i]];\n } else {\n result[i] = [];\n }\n if (paramAnnotations && paramAnnotations[i] != null) {\n result[i] = result[i].concat(paramAnnotations[i]);\n }\n }\n return result;\n }\n _ownParameters(type, parentCtor) {\n const typeStr = type.toString();\n // If we have no decorators, we only have function.length as metadata.\n // In that case, to detect whether a child class declared an own constructor or not,\n // we need to look inside of that constructor to check whether it is\n // just calling the parent.\n // This also helps to work around for https://github.com/Microsoft/TypeScript/issues/12439\n // that sets 'design:paramtypes' to []\n // if a class inherits from another class but has no ctor declared itself.\n if (isDelegateCtor(typeStr)) {\n return null;\n }\n // Prefer the direct API.\n if (type.parameters && type.parameters !== parentCtor.parameters) {\n return type.parameters;\n }\n // API of tsickle for lowering decorators to properties on the class.\n const tsickleCtorParams = type.ctorParameters;\n if (tsickleCtorParams && tsickleCtorParams !== parentCtor.ctorParameters) {\n // Newer tsickle uses a function closure\n // Retain the non-function case for compatibility with older tsickle\n const ctorParameters = typeof tsickleCtorParams === 'function' ? tsickleCtorParams() : tsickleCtorParams;\n const paramTypes = ctorParameters.map(ctorParam => ctorParam && ctorParam.type);\n const paramAnnotations = ctorParameters.map(ctorParam => ctorParam && convertTsickleDecoratorIntoMetadata(ctorParam.decorators));\n return this._zipTypesAndAnnotations(paramTypes, paramAnnotations);\n }\n // API for metadata created by invoking the decorators.\n const paramAnnotations = type.hasOwnProperty(PARAMETERS) && type[PARAMETERS];\n const paramTypes = this._reflect && this._reflect.getOwnMetadata && this._reflect.getOwnMetadata('design:paramtypes', type);\n if (paramTypes || paramAnnotations) {\n return this._zipTypesAndAnnotations(paramTypes, paramAnnotations);\n }\n // If a class has no decorators, at least create metadata\n // based on function.length.\n // Note: We know that this is a real constructor as we checked\n // the content of the constructor above.\n return newArray(type.length);\n }\n parameters(type) {\n // Note: only report metadata if we have at least one class decorator\n // to stay in sync with the static reflector.\n if (!isType(type)) {\n return [];\n }\n const parentCtor = getParentCtor(type);\n let parameters = this._ownParameters(type, parentCtor);\n if (!parameters && parentCtor !== Object) {\n parameters = this.parameters(parentCtor);\n }\n return parameters || [];\n }\n _ownAnnotations(typeOrFunc, parentCtor) {\n // Prefer the direct API.\n if (typeOrFunc.annotations && typeOrFunc.annotations !== parentCtor.annotations) {\n let annotations = typeOrFunc.annotations;\n if (typeof annotations === 'function' && annotations.annotations) {\n annotations = annotations.annotations;\n }\n return annotations;\n }\n // API of tsickle for lowering decorators to properties on the class.\n if (typeOrFunc.decorators && typeOrFunc.decorators !== parentCtor.decorators) {\n return convertTsickleDecoratorIntoMetadata(typeOrFunc.decorators);\n }\n // API for metadata created by invoking the decorators.\n if (typeOrFunc.hasOwnProperty(ANNOTATIONS)) {\n return typeOrFunc[ANNOTATIONS];\n }\n return null;\n }\n annotations(typeOrFunc) {\n if (!isType(typeOrFunc)) {\n return [];\n }\n const parentCtor = getParentCtor(typeOrFunc);\n const ownAnnotations = this._ownAnnotations(typeOrFunc, parentCtor) || [];\n const parentAnnotations = parentCtor !== Object ? this.annotations(parentCtor) : [];\n return parentAnnotations.concat(ownAnnotations);\n }\n _ownPropMetadata(typeOrFunc, parentCtor) {\n // Prefer the direct API.\n if (typeOrFunc.propMetadata && typeOrFunc.propMetadata !== parentCtor.propMetadata) {\n let propMetadata = typeOrFunc.propMetadata;\n if (typeof propMetadata === 'function' && propMetadata.propMetadata) {\n propMetadata = propMetadata.propMetadata;\n }\n return propMetadata;\n }\n // API of tsickle for lowering decorators to properties on the class.\n if (typeOrFunc.propDecorators && typeOrFunc.propDecorators !== parentCtor.propDecorators) {\n const propDecorators = typeOrFunc.propDecorators;\n const propMetadata = {};\n Object.keys(propDecorators).forEach(prop => {\n propMetadata[prop] = convertTsickleDecoratorIntoMetadata(propDecorators[prop]);\n });\n return propMetadata;\n }\n // API for metadata created by invoking the decorators.\n if (typeOrFunc.hasOwnProperty(PROP_METADATA)) {\n return typeOrFunc[PROP_METADATA];\n }\n return null;\n }\n propMetadata(typeOrFunc) {\n if (!isType(typeOrFunc)) {\n return {};\n }\n const parentCtor = getParentCtor(typeOrFunc);\n const propMetadata = {};\n if (parentCtor !== Object) {\n const parentPropMetadata = this.propMetadata(parentCtor);\n Object.keys(parentPropMetadata).forEach(propName => {\n propMetadata[propName] = parentPropMetadata[propName];\n });\n }\n const ownPropMetadata = this._ownPropMetadata(typeOrFunc, parentCtor);\n if (ownPropMetadata) {\n Object.keys(ownPropMetadata).forEach(propName => {\n const decorators = [];\n if (propMetadata.hasOwnProperty(propName)) {\n decorators.push(...propMetadata[propName]);\n }\n decorators.push(...ownPropMetadata[propName]);\n propMetadata[propName] = decorators;\n });\n }\n return propMetadata;\n }\n ownPropMetadata(typeOrFunc) {\n if (!isType(typeOrFunc)) {\n return {};\n }\n return this._ownPropMetadata(typeOrFunc, getParentCtor(typeOrFunc)) || {};\n }\n hasLifecycleHook(type, lcProperty) {\n return type instanceof Type && lcProperty in type.prototype;\n }\n}\nfunction convertTsickleDecoratorIntoMetadata(decoratorInvocations) {\n if (!decoratorInvocations) {\n return [];\n }\n return decoratorInvocations.map(decoratorInvocation => {\n const decoratorType = decoratorInvocation.type;\n const annotationCls = decoratorType.annotationCls;\n const annotationArgs = decoratorInvocation.args ? decoratorInvocation.args : [];\n return new annotationCls(...annotationArgs);\n });\n}\nfunction getParentCtor(ctor) {\n const parentProto = ctor.prototype ? Object.getPrototypeOf(ctor.prototype) : null;\n const parentCtor = parentProto ? parentProto.constructor : null;\n // Note: We always use `Object` as the null value\n // to simplify checking later on.\n return parentCtor || Object;\n}\n\n/**\n * Represents a basic change from a previous to a new value for a single\n * property on a directive instance. Passed as a value in a\n * {@link SimpleChanges} object to the `ngOnChanges` hook.\n *\n * @see {@link OnChanges}\n *\n * @publicApi\n */\nclass SimpleChange {\n previousValue;\n currentValue;\n firstChange;\n constructor(previousValue, currentValue, firstChange) {\n this.previousValue = previousValue;\n this.currentValue = currentValue;\n this.firstChange = firstChange;\n }\n /**\n * Check whether the new value is the first value assigned.\n */\n isFirstChange() {\n return this.firstChange;\n }\n}\nfunction applyValueToInputField(instance, inputSignalNode, privateName, value) {\n if (inputSignalNode !== null) {\n inputSignalNode.applyValueToInputSignal(inputSignalNode, value);\n } else {\n instance[privateName] = value;\n }\n}\n\n/**\n * The NgOnChangesFeature decorates a component with support for the ngOnChanges\n * lifecycle hook, so it should be included in any component that implements\n * that hook.\n *\n * If the component or directive uses inheritance, the NgOnChangesFeature MUST\n * be included as a feature AFTER {@link InheritDefinitionFeature}, otherwise\n * inherited properties will not be propagated to the ngOnChanges lifecycle\n * hook.\n *\n * Example usage:\n *\n * ```ts\n * static ɵcmp = defineComponent({\n * ...\n * inputs: {name: 'publicName'},\n * features: [NgOnChangesFeature]\n * });\n * ```\n *\n * @codeGenApi\n */\nconst ɵɵNgOnChangesFeature = /* @__PURE__ */(() => {\n const ɵɵNgOnChangesFeatureImpl = () => NgOnChangesFeatureImpl;\n // This option ensures that the ngOnChanges lifecycle hook will be inherited\n // from superclasses (in InheritDefinitionFeature).\n /** @nocollapse */\n ɵɵNgOnChangesFeatureImpl.ngInherit = true;\n return ɵɵNgOnChangesFeatureImpl;\n})();\nfunction NgOnChangesFeatureImpl(definition) {\n if (definition.type.prototype.ngOnChanges) {\n definition.setInput = ngOnChangesSetInput;\n }\n return rememberChangeHistoryAndInvokeOnChangesHook;\n}\n/**\n * This is a synthetic lifecycle hook which gets inserted into `TView.preOrderHooks` to simulate\n * `ngOnChanges`.\n *\n * The hook reads the `NgSimpleChangesStore` data from the component instance and if changes are\n * found it invokes `ngOnChanges` on the component instance.\n *\n * @param this Component instance. Because this function gets inserted into `TView.preOrderHooks`,\n * it is guaranteed to be called with component instance.\n */\nfunction rememberChangeHistoryAndInvokeOnChangesHook() {\n const simpleChangesStore = getSimpleChangesStore(this);\n const current = simpleChangesStore?.current;\n if (current) {\n const previous = simpleChangesStore.previous;\n if (previous === EMPTY_OBJ) {\n simpleChangesStore.previous = current;\n } else {\n // New changes are copied to the previous store, so that we don't lose history for inputs\n // which were not changed this time\n for (let key in current) {\n previous[key] = current[key];\n }\n }\n simpleChangesStore.current = null;\n this.ngOnChanges(current);\n }\n}\nfunction ngOnChangesSetInput(instance, inputSignalNode, value, publicName, privateName) {\n const declaredName = this.declaredInputs[publicName];\n ngDevMode && assertString(declaredName, 'Name of input in ngOnChanges has to be a string');\n const simpleChangesStore = getSimpleChangesStore(instance) || setSimpleChangesStore(instance, {\n previous: EMPTY_OBJ,\n current: null\n });\n const current = simpleChangesStore.current || (simpleChangesStore.current = {});\n const previous = simpleChangesStore.previous;\n const previousChange = previous[declaredName];\n current[declaredName] = new SimpleChange(previousChange && previousChange.currentValue, value, previous === EMPTY_OBJ);\n applyValueToInputField(instance, inputSignalNode, privateName, value);\n}\nconst SIMPLE_CHANGES_STORE = '__ngSimpleChanges__';\nfunction getSimpleChangesStore(instance) {\n return instance[SIMPLE_CHANGES_STORE] || null;\n}\nfunction setSimpleChangesStore(instance, store) {\n return instance[SIMPLE_CHANGES_STORE] = store;\n}\nconst profilerCallbacks = [];\nconst NOOP_PROFILER_REMOVAL = () => {};\nfunction removeProfiler(profiler) {\n const profilerIdx = profilerCallbacks.indexOf(profiler);\n if (profilerIdx !== -1) {\n profilerCallbacks.splice(profilerIdx, 1);\n }\n}\n/**\n * Adds a callback function which will be invoked before and after performing certain actions at\n * runtime (for example, before and after running change detection). Multiple profiler callbacks can be set:\n * in this case profiling events are reported to every registered callback.\n *\n * Warning: this function is *INTERNAL* and should not be relied upon in application's code.\n * The contract of the function might be changed in any release and/or the function can be removed\n * completely.\n *\n * @param profiler function provided by the caller or null value to disable all profilers.\n * @returns a cleanup function that, when invoked, removes a given profiler callback.\n */\nfunction setProfiler(profiler) {\n if (profiler !== null) {\n if (!profilerCallbacks.includes(profiler)) {\n profilerCallbacks.push(profiler);\n }\n return () => removeProfiler(profiler);\n } else {\n profilerCallbacks.length = 0;\n return NOOP_PROFILER_REMOVAL;\n }\n}\n/**\n * Profiler function which wraps user code executed by the runtime.\n *\n * @param event ProfilerEvent corresponding to the execution context\n * @param instance component instance\n * @param eventFn function associated with event.\n * For example a template function, lifecycle hook, or output listener.\n * The value depends on the execution context\n */\nconst profiler = function (event, instance = null, eventFn) {\n for (let i = 0; i < profilerCallbacks.length; i++) {\n const profilerCallback = profilerCallbacks[i];\n profilerCallback(event, instance, eventFn);\n }\n};\n\n/**\n * Adds all directive lifecycle hooks from the given `DirectiveDef` to the given `TView`.\n *\n * Must be run *only* on the first template pass.\n *\n * Sets up the pre-order hooks on the provided `tView`,\n * see {@link HookData} for details about the data structure.\n *\n * @param directiveIndex The index of the directive in LView\n * @param directiveDef The definition containing the hooks to setup in tView\n * @param tView The current TView\n */\nfunction registerPreOrderHooks(directiveIndex, directiveDef, tView) {\n ngDevMode && assertFirstCreatePass(tView);\n const {\n ngOnChanges,\n ngOnInit,\n ngDoCheck\n } = directiveDef.type.prototype;\n if (ngOnChanges) {\n const wrappedOnChanges = NgOnChangesFeatureImpl(directiveDef);\n (tView.preOrderHooks ??= []).push(directiveIndex, wrappedOnChanges);\n (tView.preOrderCheckHooks ??= []).push(directiveIndex, wrappedOnChanges);\n }\n if (ngOnInit) {\n (tView.preOrderHooks ??= []).push(0 - directiveIndex, ngOnInit);\n }\n if (ngDoCheck) {\n (tView.preOrderHooks ??= []).push(directiveIndex, ngDoCheck);\n (tView.preOrderCheckHooks ??= []).push(directiveIndex, ngDoCheck);\n }\n}\n/**\n *\n * Loops through the directives on the provided `tNode` and queues hooks to be\n * run that are not initialization hooks.\n *\n * Should be executed during `elementEnd()` and similar to\n * preserve hook execution order. Content, view, and destroy hooks for projected\n * components and directives must be called *before* their hosts.\n *\n * Sets up the content, view, and destroy hooks on the provided `tView`,\n * see {@link HookData} for details about the data structure.\n *\n * NOTE: This does not set up `onChanges`, `onInit` or `doCheck`, those are set up\n * separately at `elementStart`.\n *\n * @param tView The current TView\n * @param tNode The TNode whose directives are to be searched for hooks to queue\n */\nfunction registerPostOrderHooks(tView, tNode) {\n ngDevMode && assertFirstCreatePass(tView);\n // It's necessary to loop through the directives at elementEnd() (rather than processing in\n // directiveCreate) so we can preserve the current hook order. Content, view, and destroy\n // hooks for projected components and directives must be called *before* their hosts.\n for (let i = tNode.directiveStart, end = tNode.directiveEnd; i < end; i++) {\n const directiveDef = tView.data[i];\n ngDevMode && assertDefined(directiveDef, 'Expecting DirectiveDef');\n const lifecycleHooks = directiveDef.type.prototype;\n const {\n ngAfterContentInit,\n ngAfterContentChecked,\n ngAfterViewInit,\n ngAfterViewChecked,\n ngOnDestroy\n } = lifecycleHooks;\n if (ngAfterContentInit) {\n (tView.contentHooks ??= []).push(-i, ngAfterContentInit);\n }\n if (ngAfterContentChecked) {\n (tView.contentHooks ??= []).push(i, ngAfterContentChecked);\n (tView.contentCheckHooks ??= []).push(i, ngAfterContentChecked);\n }\n if (ngAfterViewInit) {\n (tView.viewHooks ??= []).push(-i, ngAfterViewInit);\n }\n if (ngAfterViewChecked) {\n (tView.viewHooks ??= []).push(i, ngAfterViewChecked);\n (tView.viewCheckHooks ??= []).push(i, ngAfterViewChecked);\n }\n if (ngOnDestroy != null) {\n (tView.destroyHooks ??= []).push(i, ngOnDestroy);\n }\n }\n}\n/**\n * Executing hooks requires complex logic as we need to deal with 2 constraints.\n *\n * 1. Init hooks (ngOnInit, ngAfterContentInit, ngAfterViewInit) must all be executed once and only\n * once, across many change detection cycles. This must be true even if some hooks throw, or if\n * some recursively trigger a change detection cycle.\n * To solve that, it is required to track the state of the execution of these init hooks.\n * This is done by storing and maintaining flags in the view: the {@link InitPhaseState},\n * and the index within that phase. They can be seen as a cursor in the following structure:\n * [[onInit1, onInit2], [afterContentInit1], [afterViewInit1, afterViewInit2, afterViewInit3]]\n * They are stored as flags in LView[FLAGS].\n *\n * 2. Pre-order hooks can be executed in batches, because of the select instruction.\n * To be able to pause and resume their execution, we also need some state about the hook's array\n * that is being processed:\n * - the index of the next hook to be executed\n * - the number of init hooks already found in the processed part of the array\n * They are stored as flags in LView[PREORDER_HOOK_FLAGS].\n */\n/**\n * Executes pre-order check hooks ( OnChanges, DoChanges) given a view where all the init hooks were\n * executed once. This is a light version of executeInitAndCheckPreOrderHooks where we can skip read\n * / write of the init-hooks related flags.\n * @param lView The LView where hooks are defined\n * @param hooks Hooks to be run\n * @param nodeIndex 3 cases depending on the value:\n * - undefined: all hooks from the array should be executed (post-order case)\n * - null: execute hooks only from the saved index until the end of the array (pre-order case, when\n * flushing the remaining hooks)\n * - number: execute hooks only from the saved index until that node index exclusive (pre-order\n * case, when executing select(number))\n */\nfunction executeCheckHooks(lView, hooks, nodeIndex) {\n callHooks(lView, hooks, 3 /* InitPhaseState.InitPhaseCompleted */, nodeIndex);\n}\n/**\n * Executes post-order init and check hooks (one of AfterContentInit, AfterContentChecked,\n * AfterViewInit, AfterViewChecked) given a view where there are pending init hooks to be executed.\n * @param lView The LView where hooks are defined\n * @param hooks Hooks to be run\n * @param initPhase A phase for which hooks should be run\n * @param nodeIndex 3 cases depending on the value:\n * - undefined: all hooks from the array should be executed (post-order case)\n * - null: execute hooks only from the saved index until the end of the array (pre-order case, when\n * flushing the remaining hooks)\n * - number: execute hooks only from the saved index until that node index exclusive (pre-order\n * case, when executing select(number))\n */\nfunction executeInitAndCheckHooks(lView, hooks, initPhase, nodeIndex) {\n ngDevMode && assertNotEqual(initPhase, 3 /* InitPhaseState.InitPhaseCompleted */, 'Init pre-order hooks should not be called more than once');\n if ((lView[FLAGS] & 3 /* LViewFlags.InitPhaseStateMask */) === initPhase) {\n callHooks(lView, hooks, initPhase, nodeIndex);\n }\n}\nfunction incrementInitPhaseFlags(lView, initPhase) {\n ngDevMode && assertNotEqual(initPhase, 3 /* InitPhaseState.InitPhaseCompleted */, 'Init hooks phase should not be incremented after all init hooks have been run.');\n let flags = lView[FLAGS];\n if ((flags & 3 /* LViewFlags.InitPhaseStateMask */) === initPhase) {\n flags &= 16383 /* LViewFlags.IndexWithinInitPhaseReset */;\n flags += 1 /* LViewFlags.InitPhaseStateIncrementer */;\n lView[FLAGS] = flags;\n }\n}\n/**\n * Calls lifecycle hooks with their contexts, skipping init hooks if it's not\n * the first LView pass\n *\n * @param currentView The current view\n * @param arr The array in which the hooks are found\n * @param initPhaseState the current state of the init phase\n * @param currentNodeIndex 3 cases depending on the value:\n * - undefined: all hooks from the array should be executed (post-order case)\n * - null: execute hooks only from the saved index until the end of the array (pre-order case, when\n * flushing the remaining hooks)\n * - number: execute hooks only from the saved index until that node index exclusive (pre-order\n * case, when executing select(number))\n */\nfunction callHooks(currentView, arr, initPhase, currentNodeIndex) {\n ngDevMode && assertEqual(isInCheckNoChangesMode(), false, 'Hooks should never be run when in check no changes mode.');\n const startIndex = currentNodeIndex !== undefined ? currentView[PREORDER_HOOK_FLAGS] & 65535 /* PreOrderHookFlags.IndexOfTheNextPreOrderHookMaskMask */ : 0;\n const nodeIndexLimit = currentNodeIndex != null ? currentNodeIndex : -1;\n const max = arr.length - 1; // Stop the loop at length - 1, because we look for the hook at i + 1\n let lastNodeIndexFound = 0;\n for (let i = startIndex; i < max; i++) {\n const hook = arr[i + 1];\n if (typeof hook === 'number') {\n lastNodeIndexFound = arr[i];\n if (currentNodeIndex != null && lastNodeIndexFound >= currentNodeIndex) {\n break;\n }\n } else {\n const isInitHook = arr[i] < 0;\n if (isInitHook) {\n currentView[PREORDER_HOOK_FLAGS] += 65536 /* PreOrderHookFlags.NumberOfInitHooksCalledIncrementer */;\n }\n if (lastNodeIndexFound < nodeIndexLimit || nodeIndexLimit == -1) {\n callHook(currentView, initPhase, arr, i);\n currentView[PREORDER_HOOK_FLAGS] = (currentView[PREORDER_HOOK_FLAGS] & 4294901760 /* PreOrderHookFlags.NumberOfInitHooksCalledMask */) + i + 2;\n }\n i++;\n }\n }\n}\n/**\n * Executes a single lifecycle hook, making sure that:\n * - it is called in the non-reactive context;\n * - profiling data are registered.\n */\nfunction callHookInternal(directive, hook) {\n profiler(4 /* ProfilerEvent.LifecycleHookStart */, directive, hook);\n const prevConsumer = setActiveConsumer(null);\n try {\n hook.call(directive);\n } finally {\n setActiveConsumer(prevConsumer);\n profiler(5 /* ProfilerEvent.LifecycleHookEnd */, directive, hook);\n }\n}\n/**\n * Execute one hook against the current `LView`.\n *\n * @param currentView The current view\n * @param initPhaseState the current state of the init phase\n * @param arr The array in which the hooks are found\n * @param i The current index within the hook data array\n */\nfunction callHook(currentView, initPhase, arr, i) {\n const isInitHook = arr[i] < 0;\n const hook = arr[i + 1];\n const directiveIndex = isInitHook ? -arr[i] : arr[i];\n const directive = currentView[directiveIndex];\n if (isInitHook) {\n const indexWithintInitPhase = currentView[FLAGS] >> 14 /* LViewFlags.IndexWithinInitPhaseShift */;\n // The init phase state must be always checked here as it may have been recursively updated.\n if (indexWithintInitPhase < currentView[PREORDER_HOOK_FLAGS] >> 16 /* PreOrderHookFlags.NumberOfInitHooksCalledShift */ && (currentView[FLAGS] & 3 /* LViewFlags.InitPhaseStateMask */) === initPhase) {\n currentView[FLAGS] += 16384 /* LViewFlags.IndexWithinInitPhaseIncrementer */;\n callHookInternal(directive, hook);\n }\n } else {\n callHookInternal(directive, hook);\n }\n}\nconst NO_PARENT_INJECTOR = -1;\n/**\n * Each injector is saved in 9 contiguous slots in `LView` and 9 contiguous slots in\n * `TView.data`. This allows us to store information about the current node's tokens (which\n * can be shared in `TView`) as well as the tokens of its ancestor nodes (which cannot be\n * shared, so they live in `LView`).\n *\n * Each of these slots (aside from the last slot) contains a bloom filter. This bloom filter\n * determines whether a directive is available on the associated node or not. This prevents us\n * from searching the directives array at this level unless it's probable the directive is in it.\n *\n * See: https://en.wikipedia.org/wiki/Bloom_filter for more about bloom filters.\n *\n * Because all injectors have been flattened into `LView` and `TViewData`, they cannot typed\n * using interfaces as they were previously. The start index of each `LInjector` and `TInjector`\n * will differ based on where it is flattened into the main array, so it's not possible to know\n * the indices ahead of time and save their types here. The interfaces are still included here\n * for documentation purposes.\n *\n * export interface LInjector extends Array<any> {\n *\n * // Cumulative bloom for directive IDs 0-31 (IDs are % BLOOM_SIZE)\n * [0]: number;\n *\n * // Cumulative bloom for directive IDs 32-63\n * [1]: number;\n *\n * // Cumulative bloom for directive IDs 64-95\n * [2]: number;\n *\n * // Cumulative bloom for directive IDs 96-127\n * [3]: number;\n *\n * // Cumulative bloom for directive IDs 128-159\n * [4]: number;\n *\n * // Cumulative bloom for directive IDs 160 - 191\n * [5]: number;\n *\n * // Cumulative bloom for directive IDs 192 - 223\n * [6]: number;\n *\n * // Cumulative bloom for directive IDs 224 - 255\n * [7]: number;\n *\n * // We need to store a reference to the injector's parent so DI can keep looking up\n * // the injector tree until it finds the dependency it's looking for.\n * [PARENT_INJECTOR]: number;\n * }\n *\n * export interface TInjector extends Array<any> {\n *\n * // Shared node bloom for directive IDs 0-31 (IDs are % BLOOM_SIZE)\n * [0]: number;\n *\n * // Shared node bloom for directive IDs 32-63\n * [1]: number;\n *\n * // Shared node bloom for directive IDs 64-95\n * [2]: number;\n *\n * // Shared node bloom for directive IDs 96-127\n * [3]: number;\n *\n * // Shared node bloom for directive IDs 128-159\n * [4]: number;\n *\n * // Shared node bloom for directive IDs 160 - 191\n * [5]: number;\n *\n * // Shared node bloom for directive IDs 192 - 223\n * [6]: number;\n *\n * // Shared node bloom for directive IDs 224 - 255\n * [7]: number;\n *\n * // Necessary to find directive indices for a particular node.\n * [TNODE]: TElementNode|TElementContainerNode|TContainerNode;\n * }\n */\n/**\n * Factory for creating instances of injectors in the NodeInjector.\n *\n * This factory is complicated by the fact that it can resolve `multi` factories as well.\n *\n * NOTE: Some of the fields are optional which means that this class has two hidden classes.\n * - One without `multi` support (most common)\n * - One with `multi` values, (rare).\n *\n * Since VMs can cache up to 4 inline hidden classes this is OK.\n *\n * - Single factory: Only `resolving` and `factory` is defined.\n * - `providers` factory: `componentProviders` is a number and `index = -1`.\n * - `viewProviders` factory: `componentProviders` is a number and `index` points to `providers`.\n */\nclass NodeInjectorFactory {\n factory;\n name;\n /**\n * The inject implementation to be activated when using the factory.\n */\n injectImpl;\n /**\n * Marker set to true during factory invocation to see if we get into recursive loop.\n * Recursive loop causes an error to be displayed.\n */\n resolving = false;\n /**\n * Marks that the token can see other Tokens declared in `viewProviders` on the same node.\n */\n canSeeViewProviders;\n /**\n * An array of factories to use in case of `multi` provider.\n */\n multi;\n /**\n * Number of `multi`-providers which belong to the component.\n *\n * This is needed because when multiple components and directives declare the `multi` provider\n * they have to be concatenated in the correct order.\n *\n * Example:\n *\n * If we have a component and directive active an a single element as declared here\n * ```ts\n * component:\n * providers: [ {provide: String, useValue: 'component', multi: true} ],\n * viewProviders: [ {provide: String, useValue: 'componentView', multi: true} ],\n *\n * directive:\n * providers: [ {provide: String, useValue: 'directive', multi: true} ],\n * ```\n *\n * Then the expected results are:\n *\n * ```ts\n * providers: ['component', 'directive']\n * viewProviders: ['component', 'componentView', 'directive']\n * ```\n *\n * The way to think about it is that the `viewProviders` have been inserted after the component\n * but before the directives, which is why we need to know how many `multi`s have been declared by\n * the component.\n */\n componentProviders;\n /**\n * Current index of the Factory in the `data`. Needed for `viewProviders` and `providers` merging.\n * See `providerFactory`.\n */\n index;\n /**\n * Because the same `multi` provider can be declared in `providers` and `viewProviders` it is\n * possible for `viewProviders` to shadow the `providers`. For this reason we store the\n * `provideFactory` of the `providers` so that `providers` can be extended with `viewProviders`.\n *\n * Example:\n *\n * Given:\n * ```ts\n * providers: [ {provide: String, useValue: 'all', multi: true} ],\n * viewProviders: [ {provide: String, useValue: 'viewOnly', multi: true} ],\n * ```\n *\n * We have to return `['all']` in case of content injection, but `['all', 'viewOnly']` in case\n * of view injection. We further have to make sure that the shared instances (in our case\n * `all`) are the exact same instance in both the content as well as the view injection. (We\n * have to make sure that we don't double instantiate.) For this reason the `viewProviders`\n * `Factory` has a pointer to the shadowed `providers` factory so that it can instantiate the\n * `providers` (`['all']`) and then extend it with `viewProviders` (`['all'] + ['viewOnly'] =\n * ['all', 'viewOnly']`).\n */\n providerFactory;\n constructor(\n /**\n * Factory to invoke in order to create a new instance.\n */\n factory,\n /**\n * Set to `true` if the token is declared in `viewProviders` (or if it is component).\n */\n isViewProvider, injectImplementation,\n // Expect `null` in devmode\n name) {\n this.factory = factory;\n this.name = name;\n ngDevMode && assertDefined(factory, 'Factory not specified');\n ngDevMode && assertEqual(typeof factory, 'function', 'Expected factory function.');\n this.canSeeViewProviders = isViewProvider;\n this.injectImpl = injectImplementation;\n }\n}\n\n/**\n * Converts `TNodeType` into human readable text.\n * Make sure this matches with `TNodeType`\n */\nfunction toTNodeTypeAsString(tNodeType) {\n let text = '';\n tNodeType & 1 /* TNodeType.Text */ && (text += '|Text');\n tNodeType & 2 /* TNodeType.Element */ && (text += '|Element');\n tNodeType & 4 /* TNodeType.Container */ && (text += '|Container');\n tNodeType & 8 /* TNodeType.ElementContainer */ && (text += '|ElementContainer');\n tNodeType & 16 /* TNodeType.Projection */ && (text += '|Projection');\n tNodeType & 32 /* TNodeType.Icu */ && (text += '|IcuContainer');\n tNodeType & 64 /* TNodeType.Placeholder */ && (text += '|Placeholder');\n tNodeType & 128 /* TNodeType.LetDeclaration */ && (text += '|LetDeclaration');\n return text.length > 0 ? text.substring(1) : text;\n}\n/**\n * Helper function to detect if a given value matches a `TNode` shape.\n *\n * The logic uses the `insertBeforeIndex` and its possible values as\n * a way to differentiate a TNode shape from other types of objects\n * within the `TView.data`. This is not a perfect check, but it can\n * be a reasonable differentiator, since we control the shapes of objects\n * within `TView.data`.\n */\nfunction isTNodeShape(value) {\n return value != null && typeof value === 'object' && (value.insertBeforeIndex === null || typeof value.insertBeforeIndex === 'number' || Array.isArray(value.insertBeforeIndex));\n}\nfunction isLetDeclaration(tNode) {\n return !!(tNode.type & 128 /* TNodeType.LetDeclaration */);\n}\n/**\n * Returns `true` if the `TNode` has a directive which has `@Input()` for `class` binding.\n *\n * ```html\n * <div my-dir [class]=\"exp\"></div>\n * ```\n * and\n * ```ts\n * @Directive({\n * })\n * class MyDirective {\n * @Input()\n * class: string;\n * }\n * ```\n *\n * In the above case it is necessary to write the reconciled styling information into the\n * directive's input.\n *\n * @param tNode\n */\nfunction hasClassInput(tNode) {\n return (tNode.flags & 8 /* TNodeFlags.hasClassInput */) !== 0;\n}\n/**\n * Returns `true` if the `TNode` has a directive which has `@Input()` for `style` binding.\n *\n * ```html\n * <div my-dir [style]=\"exp\"></div>\n * ```\n * and\n * ```ts\n * @Directive({\n * })\n * class MyDirective {\n * @Input()\n * class: string;\n * }\n * ```\n *\n * In the above case it is necessary to write the reconciled styling information into the\n * directive's input.\n *\n * @param tNode\n */\nfunction hasStyleInput(tNode) {\n return (tNode.flags & 16 /* TNodeFlags.hasStyleInput */) !== 0;\n}\nfunction assertTNodeType(tNode, expectedTypes, message) {\n assertDefined(tNode, 'should be called with a TNode');\n if ((tNode.type & expectedTypes) === 0) {\n throwError(message || `Expected [${toTNodeTypeAsString(expectedTypes)}] but got ${toTNodeTypeAsString(tNode.type)}.`);\n }\n}\nfunction assertPureTNodeType(type) {\n if (!(type === 2 /* TNodeType.Element */ || type === 1 /* TNodeType.Text */ || type === 4 /* TNodeType.Container */ || type === 8 /* TNodeType.ElementContainer */ || type === 32 /* TNodeType.Icu */ || type === 16 /* TNodeType.Projection */ || type === 64 /* TNodeType.Placeholder */ || type === 128 /* TNodeType.LetDeclaration */)) {\n throwError(`Expected TNodeType to have only a single type selected, but got ${toTNodeTypeAsString(type)}.`);\n }\n}\n\n/**\n * Assigns all attribute values to the provided element via the inferred renderer.\n *\n * This function accepts two forms of attribute entries:\n *\n * default: (key, value):\n * attrs = [key1, value1, key2, value2]\n *\n * namespaced: (NAMESPACE_MARKER, uri, name, value)\n * attrs = [NAMESPACE_MARKER, uri, name, value, NAMESPACE_MARKER, uri, name, value]\n *\n * The `attrs` array can contain a mix of both the default and namespaced entries.\n * The \"default\" values are set without a marker, but if the function comes across\n * a marker value then it will attempt to set a namespaced value. If the marker is\n * not of a namespaced value then the function will quit and return the index value\n * where it stopped during the iteration of the attrs array.\n *\n * See [AttributeMarker] to understand what the namespace marker value is.\n *\n * Note that this instruction does not support assigning style and class values to\n * an element. See `elementStart` and `elementHostAttrs` to learn how styling values\n * are applied to an element.\n * @param renderer The renderer to be used\n * @param native The element that the attributes will be assigned to\n * @param attrs The attribute array of values that will be assigned to the element\n * @returns the index value that was last accessed in the attributes array\n */\nfunction setUpAttributes(renderer, native, attrs) {\n let i = 0;\n while (i < attrs.length) {\n const value = attrs[i];\n if (typeof value === 'number') {\n // only namespaces are supported. Other value types (such as style/class\n // entries) are not supported in this function.\n if (value !== 0 /* AttributeMarker.NamespaceURI */) {\n break;\n }\n // we just landed on the marker value ... therefore\n // we should skip to the next entry\n i++;\n const namespaceURI = attrs[i++];\n const attrName = attrs[i++];\n const attrVal = attrs[i++];\n renderer.setAttribute(native, attrName, attrVal, namespaceURI);\n } else {\n // attrName is string;\n const attrName = value;\n const attrVal = attrs[++i];\n // Standard attributes\n if (isAnimationProp(attrName)) {\n renderer.setProperty(native, attrName, attrVal);\n } else {\n renderer.setAttribute(native, attrName, attrVal);\n }\n i++;\n }\n }\n // another piece of code may iterate over the same attributes array. Therefore\n // it may be helpful to return the exact spot where the attributes array exited\n // whether by running into an unsupported marker or if all the static values were\n // iterated over.\n return i;\n}\n/**\n * Test whether the given value is a marker that indicates that the following\n * attribute values in a `TAttributes` array are only the names of attributes,\n * and not name-value pairs.\n * @param marker The attribute marker to test.\n * @returns true if the marker is a \"name-only\" marker (e.g. `Bindings`, `Template` or `I18n`).\n */\nfunction isNameOnlyAttributeMarker(marker) {\n return marker === 3 /* AttributeMarker.Bindings */ || marker === 4 /* AttributeMarker.Template */ || marker === 6 /* AttributeMarker.I18n */;\n}\nfunction isAnimationProp(name) {\n // Perf note: accessing charCodeAt to check for the first character of a string is faster as\n // compared to accessing a character at index 0 (ex. name[0]). The main reason for this is that\n // charCodeAt doesn't allocate memory to return a substring.\n return name.charCodeAt(0) === 64 /* CharCode.AT_SIGN */;\n}\n/**\n * Merges `src` `TAttributes` into `dst` `TAttributes` removing any duplicates in the process.\n *\n * This merge function keeps the order of attrs same.\n *\n * @param dst Location of where the merged `TAttributes` should end up.\n * @param src `TAttributes` which should be appended to `dst`\n */\nfunction mergeHostAttrs(dst, src) {\n if (src === null || src.length === 0) ;else if (dst === null || dst.length === 0) {\n // We have source, but dst is empty, just make a copy.\n dst = src.slice();\n } else {\n let srcMarker = -1 /* AttributeMarker.ImplicitAttributes */;\n for (let i = 0; i < src.length; i++) {\n const item = src[i];\n if (typeof item === 'number') {\n srcMarker = item;\n } else {\n if (srcMarker === 0 /* AttributeMarker.NamespaceURI */) ;else if (srcMarker === -1 /* AttributeMarker.ImplicitAttributes */ || srcMarker === 2 /* AttributeMarker.Styles */) {\n // Case where we have to consume `key1` and `value` only.\n mergeHostAttribute(dst, srcMarker, item, null, src[++i]);\n } else {\n // Case where we have to consume `key1` only.\n mergeHostAttribute(dst, srcMarker, item, null, null);\n }\n }\n }\n }\n return dst;\n}\n/**\n * Append `key`/`value` to existing `TAttributes` taking region marker and duplicates into account.\n *\n * @param dst `TAttributes` to append to.\n * @param marker Region where the `key`/`value` should be added.\n * @param key1 Key to add to `TAttributes`\n * @param key2 Key to add to `TAttributes` (in case of `AttributeMarker.NamespaceURI`)\n * @param value Value to add or to overwrite to `TAttributes` Only used if `marker` is not Class.\n */\nfunction mergeHostAttribute(dst, marker, key1, key2, value) {\n let i = 0;\n // Assume that new markers will be inserted at the end.\n let markerInsertPosition = dst.length;\n // scan until correct type.\n if (marker === -1 /* AttributeMarker.ImplicitAttributes */) {\n markerInsertPosition = -1;\n } else {\n while (i < dst.length) {\n const dstValue = dst[i++];\n if (typeof dstValue === 'number') {\n if (dstValue === marker) {\n markerInsertPosition = -1;\n break;\n } else if (dstValue > marker) {\n // We need to save this as we want the markers to be inserted in specific order.\n markerInsertPosition = i - 1;\n break;\n }\n }\n }\n }\n // search until you find place of insertion\n while (i < dst.length) {\n const item = dst[i];\n if (typeof item === 'number') {\n // since `i` started as the index after the marker, we did not find it if we are at the next\n // marker\n break;\n } else if (item === key1) {\n // We already have same token\n {\n if (value !== null) {\n dst[i + 1] = value;\n }\n return;\n }\n }\n // Increment counter.\n i++;\n if (value !== null) i++;\n }\n // insert at location.\n if (markerInsertPosition !== -1) {\n dst.splice(markerInsertPosition, 0, marker);\n i = markerInsertPosition + 1;\n }\n dst.splice(i++, 0, key1);\n if (value !== null) {\n dst.splice(i++, 0, value);\n }\n}\n\n/// Parent Injector Utils ///////////////////////////////////////////////////////////////\nfunction hasParentInjector(parentLocation) {\n return parentLocation !== NO_PARENT_INJECTOR;\n}\nfunction getParentInjectorIndex(parentLocation) {\n if (ngDevMode) {\n assertNumber(parentLocation, 'Number expected');\n assertNotEqual(parentLocation, -1, 'Not a valid state.');\n const parentInjectorIndex = parentLocation & 32767 /* RelativeInjectorLocationFlags.InjectorIndexMask */;\n assertGreaterThan(parentInjectorIndex, HEADER_OFFSET, 'Parent injector must be pointing past HEADER_OFFSET.');\n }\n return parentLocation & 32767 /* RelativeInjectorLocationFlags.InjectorIndexMask */;\n}\nfunction getParentInjectorViewOffset(parentLocation) {\n return parentLocation >> 16 /* RelativeInjectorLocationFlags.ViewOffsetShift */;\n}\n/**\n * Unwraps a parent injector location number to find the view offset from the current injector,\n * then walks up the declaration view tree until the view is found that contains the parent\n * injector.\n *\n * @param location The location of the parent injector, which contains the view offset\n * @param startView The LView instance from which to start walking up the view tree\n * @returns The LView instance that contains the parent injector\n */\nfunction getParentInjectorView(location, startView) {\n let viewOffset = getParentInjectorViewOffset(location);\n let parentView = startView;\n // For most cases, the parent injector can be found on the host node (e.g. for component\n // or container), but we must keep the loop here to support the rarer case of deeply nested\n // <ng-template> tags or inline views, where the parent injector might live many views\n // above the child injector.\n while (viewOffset > 0) {\n parentView = parentView[DECLARATION_VIEW];\n viewOffset--;\n }\n return parentView;\n}\n\n/**\n * Defines if the call to `inject` should include `viewProviders` in its resolution.\n *\n * This is set to true when we try to instantiate a component. This value is reset in\n * `getNodeInjectable` to a value which matches the declaration location of the token about to be\n * instantiated. This is done so that if we are injecting a token which was declared outside of\n * `viewProviders` we don't accidentally pull `viewProviders` in.\n *\n * Example:\n *\n * ```ts\n * @Injectable()\n * class MyService {\n * constructor(public value: String) {}\n * }\n *\n * @Component({\n * providers: [\n * MyService,\n * {provide: String, value: 'providers' }\n * ]\n * viewProviders: [\n * {provide: String, value: 'viewProviders'}\n * ]\n * })\n * class MyComponent {\n * constructor(myService: MyService, value: String) {\n * // We expect that Component can see into `viewProviders`.\n * expect(value).toEqual('viewProviders');\n * // `MyService` was not declared in `viewProviders` hence it can't see it.\n * expect(myService.value).toEqual('providers');\n * }\n * }\n *\n * ```\n */\nlet includeViewProviders = true;\nfunction setIncludeViewProviders(v) {\n const oldValue = includeViewProviders;\n includeViewProviders = v;\n return oldValue;\n}\n/**\n * The number of slots in each bloom filter (used by DI). The larger this number, the fewer\n * directives that will share slots, and thus, the fewer false positives when checking for\n * the existence of a directive.\n */\nconst BLOOM_SIZE = 256;\nconst BLOOM_MASK = BLOOM_SIZE - 1;\n/**\n * The number of bits that is represented by a single bloom bucket. JS bit operations are 32 bits,\n * so each bucket represents 32 distinct tokens which accounts for log2(32) = 5 bits of a bloom hash\n * number.\n */\nconst BLOOM_BUCKET_BITS = 5;\n/** Counter used to generate unique IDs for directives. */\nlet nextNgElementId = 0;\n/** Value used when something wasn't found by an injector. */\nconst NOT_FOUND = {};\n/**\n * Registers this directive as present in its node's injector by flipping the directive's\n * corresponding bit in the injector's bloom filter.\n *\n * @param injectorIndex The index of the node injector where this token should be registered\n * @param tView The TView for the injector's bloom filters\n * @param type The directive token to register\n */\nfunction bloomAdd(injectorIndex, tView, type) {\n ngDevMode && assertEqual(tView.firstCreatePass, true, 'expected firstCreatePass to be true');\n let id;\n if (typeof type === 'string') {\n id = type.charCodeAt(0) || 0;\n } else if (type.hasOwnProperty(NG_ELEMENT_ID)) {\n id = type[NG_ELEMENT_ID];\n }\n // Set a unique ID on the directive type, so if something tries to inject the directive,\n // we can easily retrieve the ID and hash it into the bloom bit that should be checked.\n if (id == null) {\n id = type[NG_ELEMENT_ID] = nextNgElementId++;\n }\n // We only have BLOOM_SIZE (256) slots in our bloom filter (8 buckets * 32 bits each),\n // so all unique IDs must be modulo-ed into a number from 0 - 255 to fit into the filter.\n const bloomHash = id & BLOOM_MASK;\n // Create a mask that targets the specific bit associated with the directive.\n // JS bit operations are 32 bits, so this will be a number between 2^0 and 2^31, corresponding\n // to bit positions 0 - 31 in a 32 bit integer.\n const mask = 1 << bloomHash;\n // Each bloom bucket in `tData` represents `BLOOM_BUCKET_BITS` number of bits of `bloomHash`.\n // Any bits in `bloomHash` beyond `BLOOM_BUCKET_BITS` indicate the bucket offset that the mask\n // should be written to.\n tView.data[injectorIndex + (bloomHash >> BLOOM_BUCKET_BITS)] |= mask;\n}\n/**\n * Creates (or gets an existing) injector for a given element or container.\n *\n * @param tNode for which an injector should be retrieved / created.\n * @param lView View where the node is stored\n * @returns Node injector\n */\nfunction getOrCreateNodeInjectorForNode(tNode, lView) {\n const existingInjectorIndex = getInjectorIndex(tNode, lView);\n if (existingInjectorIndex !== -1) {\n return existingInjectorIndex;\n }\n const tView = lView[TVIEW];\n if (tView.firstCreatePass) {\n tNode.injectorIndex = lView.length;\n insertBloom(tView.data, tNode); // foundation for node bloom\n insertBloom(lView, null); // foundation for cumulative bloom\n insertBloom(tView.blueprint, null);\n }\n const parentLoc = getParentInjectorLocation(tNode, lView);\n const injectorIndex = tNode.injectorIndex;\n // If a parent injector can't be found, its location is set to -1.\n // In that case, we don't need to set up a cumulative bloom\n if (hasParentInjector(parentLoc)) {\n const parentIndex = getParentInjectorIndex(parentLoc);\n const parentLView = getParentInjectorView(parentLoc, lView);\n const parentData = parentLView[TVIEW].data;\n // Creates a cumulative bloom filter that merges the parent's bloom filter\n // and its own cumulative bloom (which contains tokens for all ancestors)\n for (let i = 0; i < 8 /* NodeInjectorOffset.BLOOM_SIZE */; i++) {\n lView[injectorIndex + i] = parentLView[parentIndex + i] | parentData[parentIndex + i];\n }\n }\n lView[injectorIndex + 8 /* NodeInjectorOffset.PARENT */] = parentLoc;\n return injectorIndex;\n}\nfunction insertBloom(arr, footer) {\n arr.push(0, 0, 0, 0, 0, 0, 0, 0, footer);\n}\nfunction getInjectorIndex(tNode, lView) {\n if (tNode.injectorIndex === -1 ||\n // If the injector index is the same as its parent's injector index, then the index has been\n // copied down from the parent node. No injector has been created yet on this node.\n tNode.parent && tNode.parent.injectorIndex === tNode.injectorIndex ||\n // After the first template pass, the injector index might exist but the parent values\n // might not have been calculated yet for this instance\n lView[tNode.injectorIndex + 8 /* NodeInjectorOffset.PARENT */] === null) {\n return -1;\n } else {\n ngDevMode && assertIndexInRange(lView, tNode.injectorIndex);\n return tNode.injectorIndex;\n }\n}\n/**\n * Finds the index of the parent injector, with a view offset if applicable. Used to set the\n * parent injector initially.\n *\n * @returns Returns a number that is the combination of the number of LViews that we have to go up\n * to find the LView containing the parent inject AND the index of the injector within that LView.\n */\nfunction getParentInjectorLocation(tNode, lView) {\n if (tNode.parent && tNode.parent.injectorIndex !== -1) {\n // If we have a parent `TNode` and there is an injector associated with it we are done, because\n // the parent injector is within the current `LView`.\n return tNode.parent.injectorIndex; // ViewOffset is 0\n }\n // When parent injector location is computed it may be outside of the current view. (ie it could\n // be pointing to a declared parent location). This variable stores number of declaration parents\n // we need to walk up in order to find the parent injector location.\n let declarationViewOffset = 0;\n let parentTNode = null;\n let lViewCursor = lView;\n // The parent injector is not in the current `LView`. We will have to walk the declared parent\n // `LView` hierarchy and look for it. If we walk of the top, that means that there is no parent\n // `NodeInjector`.\n while (lViewCursor !== null) {\n parentTNode = getTNodeFromLView(lViewCursor);\n if (parentTNode === null) {\n // If we have no parent, than we are done.\n return NO_PARENT_INJECTOR;\n }\n ngDevMode && parentTNode && assertTNodeForLView(parentTNode, lViewCursor[DECLARATION_VIEW]);\n // Every iteration of the loop requires that we go to the declared parent.\n declarationViewOffset++;\n lViewCursor = lViewCursor[DECLARATION_VIEW];\n if (parentTNode.injectorIndex !== -1) {\n // We found a NodeInjector which points to something.\n return parentTNode.injectorIndex | declarationViewOffset << 16 /* RelativeInjectorLocationFlags.ViewOffsetShift */;\n }\n }\n return NO_PARENT_INJECTOR;\n}\n/**\n * Makes a type or an injection token public to the DI system by adding it to an\n * injector's bloom filter.\n *\n * @param di The node injector in which a directive will be added\n * @param token The type or the injection token to be made public\n */\nfunction diPublicInInjector(injectorIndex, tView, token) {\n bloomAdd(injectorIndex, tView, token);\n}\n/**\n * Inject static attribute value into directive constructor.\n *\n * This method is used with `factory` functions which are generated as part of\n * `defineDirective` or `defineComponent`. The method retrieves the static value\n * of an attribute. (Dynamic attributes are not supported since they are not resolved\n * at the time of injection and can change over time.)\n *\n * # Example\n * Given:\n * ```ts\n * @Component(...)\n * class MyComponent {\n * constructor(@Attribute('title') title: string) { ... }\n * }\n * ```\n * When instantiated with\n * ```html\n * <my-component title=\"Hello\"></my-component>\n * ```\n *\n * Then factory method generated is:\n * ```ts\n * MyComponent.ɵcmp = defineComponent({\n * factory: () => new MyComponent(injectAttribute('title'))\n * ...\n * })\n * ```\n *\n * @publicApi\n */\nfunction injectAttributeImpl(tNode, attrNameToInject) {\n ngDevMode && assertTNodeType(tNode, 12 /* TNodeType.AnyContainer */ | 3 /* TNodeType.AnyRNode */);\n ngDevMode && assertDefined(tNode, 'expecting tNode');\n if (attrNameToInject === 'class') {\n return tNode.classes;\n }\n if (attrNameToInject === 'style') {\n return tNode.styles;\n }\n const attrs = tNode.attrs;\n if (attrs) {\n const attrsLength = attrs.length;\n let i = 0;\n while (i < attrsLength) {\n const value = attrs[i];\n // If we hit a `Bindings` or `Template` marker then we are done.\n if (isNameOnlyAttributeMarker(value)) break;\n // Skip namespaced attributes\n if (value === 0 /* AttributeMarker.NamespaceURI */) {\n // we skip the next two values\n // as namespaced attributes looks like\n // [..., AttributeMarker.NamespaceURI, 'http://someuri.com/test', 'test:exist',\n // 'existValue', ...]\n i = i + 2;\n } else if (typeof value === 'number') {\n // Skip to the first value of the marked attribute.\n i++;\n while (i < attrsLength && typeof attrs[i] === 'string') {\n i++;\n }\n } else if (value === attrNameToInject) {\n return attrs[i + 1];\n } else {\n i = i + 2;\n }\n }\n }\n return null;\n}\nfunction notFoundValueOrThrow(notFoundValue, token, flags) {\n if (flags & 8 /* InternalInjectFlags.Optional */ || notFoundValue !== undefined) {\n return notFoundValue;\n } else {\n throwProviderNotFoundError(token, 'NodeInjector');\n }\n}\n/**\n * Returns the value associated to the given token from the ModuleInjector or throws exception\n *\n * @param lView The `LView` that contains the `tNode`\n * @param token The token to look for\n * @param flags Injection flags\n * @param notFoundValue The value to return when the injection flags is `InternalInjectFlags.Optional`\n * @returns the value from the injector or throws an exception\n */\nfunction lookupTokenUsingModuleInjector(lView, token, flags, notFoundValue) {\n if (flags & 8 /* InternalInjectFlags.Optional */ && notFoundValue === undefined) {\n // This must be set or the NullInjector will throw for optional deps\n notFoundValue = null;\n }\n if ((flags & (2 /* InternalInjectFlags.Self */ | 1 /* InternalInjectFlags.Host */)) === 0) {\n const moduleInjector = lView[INJECTOR];\n // switch to `injectInjectorOnly` implementation for module injector, since module injector\n // should not have access to Component/Directive DI scope (that may happen through\n // `directiveInject` implementation)\n const previousInjectImplementation = setInjectImplementation(undefined);\n try {\n if (moduleInjector) {\n return moduleInjector.get(token, notFoundValue, flags & 8 /* InternalInjectFlags.Optional */);\n } else {\n return injectRootLimpMode(token, notFoundValue, flags & 8 /* InternalInjectFlags.Optional */);\n }\n } finally {\n setInjectImplementation(previousInjectImplementation);\n }\n }\n return notFoundValueOrThrow(notFoundValue, token, flags);\n}\n/**\n * Returns the value associated to the given token from the NodeInjectors => ModuleInjector.\n *\n * Look for the injector providing the token by walking up the node injector tree and then\n * the module injector tree.\n *\n * This function patches `token` with `__NG_ELEMENT_ID__` which contains the id for the bloom\n * filter. `-1` is reserved for injecting `Injector` (implemented by `NodeInjector`)\n *\n * @param tNode The Node where the search for the injector should start\n * @param lView The `LView` that contains the `tNode`\n * @param token The token to look for\n * @param flags Injection flags\n * @param notFoundValue The value to return when the injection flags is `InternalInjectFlags.Optional`\n * @returns the value from the injector, `null` when not found, or `notFoundValue` if provided\n */\nfunction getOrCreateInjectable(tNode, lView, token, flags = 0 /* InternalInjectFlags.Default */, notFoundValue) {\n if (tNode !== null) {\n // If the view or any of its ancestors have an embedded\n // view injector, we have to look it up there first.\n if (lView[FLAGS] & 2048 /* LViewFlags.HasEmbeddedViewInjector */ &&\n // The token must be present on the current node injector when the `Self`\n // flag is set, so the lookup on embedded view injector(s) can be skipped.\n !(flags & 2 /* InternalInjectFlags.Self */)) {\n const embeddedInjectorValue = lookupTokenUsingEmbeddedInjector(tNode, lView, token, flags, NOT_FOUND);\n if (embeddedInjectorValue !== NOT_FOUND) {\n return embeddedInjectorValue;\n }\n }\n // Otherwise try the node injector.\n const value = lookupTokenUsingNodeInjector(tNode, lView, token, flags, NOT_FOUND);\n if (value !== NOT_FOUND) {\n return value;\n }\n }\n // Finally, fall back to the module injector.\n return lookupTokenUsingModuleInjector(lView, token, flags, notFoundValue);\n}\n/**\n * Returns the value associated to the given token from the node injector.\n *\n * @param tNode The Node where the search for the injector should start\n * @param lView The `LView` that contains the `tNode`\n * @param token The token to look for\n * @param flags Injection flags\n * @param notFoundValue The value to return when the injection flags is `InternalInjectFlags.Optional`\n * @returns the value from the injector, `null` when not found, or `notFoundValue` if provided\n */\nfunction lookupTokenUsingNodeInjector(tNode, lView, token, flags, notFoundValue) {\n const bloomHash = bloomHashBitOrFactory(token);\n // If the ID stored here is a function, this is a special object like ElementRef or TemplateRef\n // so just call the factory function to create it.\n if (typeof bloomHash === 'function') {\n if (!enterDI(lView, tNode, flags)) {\n // Failed to enter DI, try module injector instead. If a token is injected with the @Host\n // flag, the module injector is not searched for that token in Ivy.\n return flags & 1 /* InternalInjectFlags.Host */ ? notFoundValueOrThrow(notFoundValue, token, flags) : lookupTokenUsingModuleInjector(lView, token, flags, notFoundValue);\n }\n try {\n let value;\n if (ngDevMode) {\n runInInjectorProfilerContext(new NodeInjector(getCurrentTNode(), getLView()), token, () => {\n emitInjectorToCreateInstanceEvent(token);\n value = bloomHash(flags);\n emitInstanceCreatedByInjectorEvent(value);\n });\n } else {\n value = bloomHash(flags);\n }\n if (value == null && !(flags & 8 /* InternalInjectFlags.Optional */)) {\n throwProviderNotFoundError(token);\n } else {\n return value;\n }\n } finally {\n leaveDI();\n }\n } else if (typeof bloomHash === 'number') {\n // A reference to the previous injector TView that was found while climbing the element\n // injector tree. This is used to know if viewProviders can be accessed on the current\n // injector.\n let previousTView = null;\n let injectorIndex = getInjectorIndex(tNode, lView);\n let parentLocation = NO_PARENT_INJECTOR;\n let hostTElementNode = flags & 1 /* InternalInjectFlags.Host */ ? lView[DECLARATION_COMPONENT_VIEW][T_HOST] : null;\n // If we should skip this injector, or if there is no injector on this node, start by\n // searching the parent injector.\n if (injectorIndex === -1 || flags & 4 /* InternalInjectFlags.SkipSelf */) {\n parentLocation = injectorIndex === -1 ? getParentInjectorLocation(tNode, lView) : lView[injectorIndex + 8 /* NodeInjectorOffset.PARENT */];\n if (parentLocation === NO_PARENT_INJECTOR || !shouldSearchParent(flags, false)) {\n injectorIndex = -1;\n } else {\n previousTView = lView[TVIEW];\n injectorIndex = getParentInjectorIndex(parentLocation);\n lView = getParentInjectorView(parentLocation, lView);\n }\n }\n // Traverse up the injector tree until we find a potential match or until we know there\n // *isn't* a match.\n while (injectorIndex !== -1) {\n ngDevMode && assertNodeInjector(lView, injectorIndex);\n // Check the current injector. If it matches, see if it contains token.\n const tView = lView[TVIEW];\n ngDevMode && assertTNodeForLView(tView.data[injectorIndex + 8 /* NodeInjectorOffset.TNODE */], lView);\n if (bloomHasToken(bloomHash, injectorIndex, tView.data)) {\n // At this point, we have an injector which *may* contain the token, so we step through\n // the providers and directives associated with the injector's corresponding node to get\n // the instance.\n const instance = searchTokensOnInjector(injectorIndex, lView, token, previousTView, flags, hostTElementNode);\n if (instance !== NOT_FOUND) {\n return instance;\n }\n }\n parentLocation = lView[injectorIndex + 8 /* NodeInjectorOffset.PARENT */];\n if (parentLocation !== NO_PARENT_INJECTOR && shouldSearchParent(flags, lView[TVIEW].data[injectorIndex + 8 /* NodeInjectorOffset.TNODE */] === hostTElementNode) && bloomHasToken(bloomHash, injectorIndex, lView)) {\n // The def wasn't found anywhere on this node, so it was a false positive.\n // Traverse up the tree and continue searching.\n previousTView = tView;\n injectorIndex = getParentInjectorIndex(parentLocation);\n lView = getParentInjectorView(parentLocation, lView);\n } else {\n // If we should not search parent OR If the ancestor bloom filter value does not have the\n // bit corresponding to the directive we can give up on traversing up to find the specific\n // injector.\n injectorIndex = -1;\n }\n }\n }\n return notFoundValue;\n}\nfunction searchTokensOnInjector(injectorIndex, lView, token, previousTView, flags, hostTElementNode) {\n const currentTView = lView[TVIEW];\n const tNode = currentTView.data[injectorIndex + 8 /* NodeInjectorOffset.TNODE */];\n // First, we need to determine if view providers can be accessed by the starting element.\n // There are two possibilities\n const canAccessViewProviders = previousTView == null ?\n // 1) This is the first invocation `previousTView == null` which means that we are at the\n // `TNode` of where injector is starting to look. In such a case the only time we are allowed\n // to look into the ViewProviders is if:\n // - we are on a component\n // - AND the injector set `includeViewProviders` to true (implying that the token can see\n // ViewProviders because it is the Component or a Service which itself was declared in\n // ViewProviders)\n isComponentHost(tNode) && includeViewProviders :\n // 2) `previousTView != null` which means that we are now walking across the parent nodes.\n // In such a case we are only allowed to look into the ViewProviders if:\n // - We just crossed from child View to Parent View `previousTView != currentTView`\n // - AND the parent TNode is an Element.\n // This means that we just came from the Component's View and therefore are allowed to see\n // into the ViewProviders.\n previousTView != currentTView && (tNode.type & 3 /* TNodeType.AnyRNode */) !== 0;\n // This special case happens when there is a @host on the inject and when we are searching\n // on the host element node.\n const isHostSpecialCase = flags & 1 /* InternalInjectFlags.Host */ && hostTElementNode === tNode;\n const injectableIdx = locateDirectiveOrProvider(tNode, currentTView, token, canAccessViewProviders, isHostSpecialCase);\n if (injectableIdx !== null) {\n return getNodeInjectable(lView, currentTView, injectableIdx, tNode, flags);\n } else {\n return NOT_FOUND;\n }\n}\n/**\n * Searches for the given token among the node's directives and providers.\n *\n * @param tNode TNode on which directives are present.\n * @param tView The tView we are currently processing\n * @param token Provider token or type of a directive to look for.\n * @param canAccessViewProviders Whether view providers should be considered.\n * @param isHostSpecialCase Whether the host special case applies.\n * @returns Index of a found directive or provider, or null when none found.\n */\nfunction locateDirectiveOrProvider(tNode, tView, token, canAccessViewProviders, isHostSpecialCase) {\n const nodeProviderIndexes = tNode.providerIndexes;\n const tInjectables = tView.data;\n const injectablesStart = nodeProviderIndexes & 1048575 /* TNodeProviderIndexes.ProvidersStartIndexMask */;\n const directivesStart = tNode.directiveStart;\n const directiveEnd = tNode.directiveEnd;\n const cptViewProvidersCount = nodeProviderIndexes >> 20 /* TNodeProviderIndexes.CptViewProvidersCountShift */;\n const startingIndex = canAccessViewProviders ? injectablesStart : injectablesStart + cptViewProvidersCount;\n // When the host special case applies, only the viewProviders and the component are visible\n const endIndex = isHostSpecialCase ? injectablesStart + cptViewProvidersCount : directiveEnd;\n for (let i = startingIndex; i < endIndex; i++) {\n const providerTokenOrDef = tInjectables[i];\n if (i < directivesStart && token === providerTokenOrDef || i >= directivesStart && providerTokenOrDef.type === token) {\n return i;\n }\n }\n if (isHostSpecialCase) {\n const dirDef = tInjectables[directivesStart];\n if (dirDef && isComponentDef(dirDef) && dirDef.type === token) {\n return directivesStart;\n }\n }\n return null;\n}\n/**\n * Used in ngDevMode to keep the injection path in case of cycles in DI.\n */\nlet injectionPath = [];\n/**\n * Retrieve or instantiate the injectable from the `LView` at particular `index`.\n *\n * This function checks to see if the value has already been instantiated and if so returns the\n * cached `injectable`. Otherwise if it detects that the value is still a factory it\n * instantiates the `injectable` and caches the value.\n */\nfunction getNodeInjectable(lView, tView, index, tNode, flags) {\n let value = lView[index];\n const tData = tView.data;\n if (value instanceof NodeInjectorFactory) {\n const factory = value;\n ngDevMode && injectionPath.push(factory.name ?? 'unknown');\n if (factory.resolving) {\n const token = stringifyForError(tData[index]);\n if (ngDevMode) {\n throw cyclicDependencyErrorWithDetails(token, injectionPath);\n } else {\n throw cyclicDependencyError(token);\n }\n }\n const previousIncludeViewProviders = setIncludeViewProviders(factory.canSeeViewProviders);\n factory.resolving = true;\n // tData indexes mirror the concrete instances in its corresponding LView.\n // lView[index] here is either the injectable instance itself or a factory,\n // therefore tData[index] is the constructor of that injectable or a\n // definition object that contains the constructor in a `.type` field.\n const token = tData[index].type || tData[index];\n let prevInjectContext;\n if (ngDevMode) {\n const injector = new NodeInjector(tNode, lView);\n prevInjectContext = setInjectorProfilerContext({\n injector,\n token\n });\n }\n const previousInjectImplementation = factory.injectImpl ? setInjectImplementation(factory.injectImpl) : null;\n const success = enterDI(lView, tNode, 0 /* InternalInjectFlags.Default */);\n ngDevMode && assertEqual(success, true, \"Because flags do not contain `SkipSelf' we expect this to always succeed.\");\n try {\n ngDevMode && emitInjectorToCreateInstanceEvent(token);\n value = lView[index] = factory.factory(undefined, flags, tData, lView, tNode);\n ngDevMode && emitInstanceCreatedByInjectorEvent(value);\n // This code path is hit for both directives and providers.\n // For perf reasons, we want to avoid searching for hooks on providers.\n // It does no harm to try (the hooks just won't exist), but the extra\n // checks are unnecessary and this is a hot path. So we check to see\n // if the index of the dependency is in the directive range for this\n // tNode. If it's not, we know it's a provider and skip hook registration.\n if (tView.firstCreatePass && index >= tNode.directiveStart) {\n ngDevMode && assertDirectiveDef(tData[index]);\n registerPreOrderHooks(index, tData[index], tView);\n }\n } finally {\n ngDevMode && setInjectorProfilerContext(prevInjectContext);\n previousInjectImplementation !== null && setInjectImplementation(previousInjectImplementation);\n setIncludeViewProviders(previousIncludeViewProviders);\n factory.resolving = false;\n leaveDI();\n ngDevMode && (injectionPath = []);\n }\n }\n return value;\n}\n/**\n * Returns the bit in an injector's bloom filter that should be used to determine whether or not\n * the directive might be provided by the injector.\n *\n * When a directive is public, it is added to the bloom filter and given a unique ID that can be\n * retrieved on the Type. When the directive isn't public or the token is not a directive `null`\n * is returned as the node injector can not possibly provide that token.\n *\n * @param token the injection token\n * @returns the matching bit to check in the bloom filter or `null` if the token is not known.\n * When the returned value is negative then it represents special values such as `Injector`.\n */\nfunction bloomHashBitOrFactory(token) {\n ngDevMode && assertDefined(token, 'token must be defined');\n if (typeof token === 'string') {\n return token.charCodeAt(0) || 0;\n }\n const tokenId =\n // First check with `hasOwnProperty` so we don't get an inherited ID.\n token.hasOwnProperty(NG_ELEMENT_ID) ? token[NG_ELEMENT_ID] : undefined;\n // Negative token IDs are used for special objects such as `Injector`\n if (typeof tokenId === 'number') {\n if (tokenId >= 0) {\n return tokenId & BLOOM_MASK;\n } else {\n ngDevMode && assertEqual(tokenId, -1 /* InjectorMarkers.Injector */, 'Expecting to get Special Injector Id');\n return createNodeInjector;\n }\n } else {\n return tokenId;\n }\n}\nfunction bloomHasToken(bloomHash, injectorIndex, injectorView) {\n // Create a mask that targets the specific bit associated with the directive we're looking for.\n // JS bit operations are 32 bits, so this will be a number between 2^0 and 2^31, corresponding\n // to bit positions 0 - 31 in a 32 bit integer.\n const mask = 1 << bloomHash;\n // Each bloom bucket in `injectorView` represents `BLOOM_BUCKET_BITS` number of bits of\n // `bloomHash`. Any bits in `bloomHash` beyond `BLOOM_BUCKET_BITS` indicate the bucket offset\n // that should be used.\n const value = injectorView[injectorIndex + (bloomHash >> BLOOM_BUCKET_BITS)];\n // If the bloom filter value has the bit corresponding to the directive's bloomBit flipped on,\n // this injector is a potential match.\n return !!(value & mask);\n}\n/** Returns true if flags prevent parent injector from being searched for tokens */\nfunction shouldSearchParent(flags, isFirstHostTNode) {\n return !(flags & 2 /* InternalInjectFlags.Self */) && !(flags & 1 /* InternalInjectFlags.Host */ && isFirstHostTNode);\n}\nfunction getNodeInjectorLView(nodeInjector) {\n return nodeInjector._lView;\n}\nfunction getNodeInjectorTNode(nodeInjector) {\n return nodeInjector._tNode;\n}\nclass NodeInjector {\n _tNode;\n _lView;\n constructor(_tNode, _lView) {\n this._tNode = _tNode;\n this._lView = _lView;\n }\n get(token, notFoundValue, flags) {\n return getOrCreateInjectable(this._tNode, this._lView, token, convertToBitFlags(flags), notFoundValue);\n }\n}\n/** Creates a `NodeInjector` for the current node. */\nfunction createNodeInjector() {\n return new NodeInjector(getCurrentTNode(), getLView());\n}\n/**\n * @codeGenApi\n */\nfunction ɵɵgetInheritedFactory(type) {\n return noSideEffects(() => {\n const ownConstructor = type.prototype.constructor;\n const ownFactory = ownConstructor[NG_FACTORY_DEF] || getFactoryOf(ownConstructor);\n const objectPrototype = Object.prototype;\n let parent = Object.getPrototypeOf(type.prototype).constructor;\n // Go up the prototype until we hit `Object`.\n while (parent && parent !== objectPrototype) {\n const factory = parent[NG_FACTORY_DEF] || getFactoryOf(parent);\n // If we hit something that has a factory and the factory isn't the same as the type,\n // we've found the inherited factory. Note the check that the factory isn't the type's\n // own factory is redundant in most cases, but if the user has custom decorators on the\n // class, this lookup will start one level down in the prototype chain, causing us to\n // find the own factory first and potentially triggering an infinite loop downstream.\n if (factory && factory !== ownFactory) {\n return factory;\n }\n parent = Object.getPrototypeOf(parent);\n }\n // There is no factory defined. Either this was improper usage of inheritance\n // (no Angular decorator on the superclass) or there is no constructor at all\n // in the inheritance chain. Since the two cases cannot be distinguished, the\n // latter has to be assumed.\n return t => new t();\n });\n}\nfunction getFactoryOf(type) {\n if (isForwardRef(type)) {\n return () => {\n const factory = getFactoryOf(resolveForwardRef(type));\n return factory && factory();\n };\n }\n return getFactoryDef(type);\n}\n/**\n * Returns a value from the closest embedded or node injector.\n *\n * @param tNode The Node where the search for the injector should start\n * @param lView The `LView` that contains the `tNode`\n * @param token The token to look for\n * @param flags Injection flags\n * @param notFoundValue The value to return when the injection flags is `InternalInjectFlags.Optional`\n * @returns the value from the injector, `null` when not found, or `notFoundValue` if provided\n */\nfunction lookupTokenUsingEmbeddedInjector(tNode, lView, token, flags, notFoundValue) {\n let currentTNode = tNode;\n let currentLView = lView;\n // When an LView with an embedded view injector is inserted, it'll likely be interlaced with\n // nodes who may have injectors (e.g. node injector -> embedded view injector -> node injector).\n // Since the bloom filters for the node injectors have already been constructed and we don't\n // have a way of extracting the records from an injector, the only way to maintain the correct\n // hierarchy when resolving the value is to walk it node-by-node while attempting to resolve\n // the token at each level.\n while (currentTNode !== null && currentLView !== null && currentLView[FLAGS] & 2048 /* LViewFlags.HasEmbeddedViewInjector */ && !isRootView(currentLView)) {\n ngDevMode && assertTNodeForLView(currentTNode, currentLView);\n // Note that this lookup on the node injector is using the `Self` flag, because\n // we don't want the node injector to look at any parent injectors since we\n // may hit the embedded view injector first.\n const nodeInjectorValue = lookupTokenUsingNodeInjector(currentTNode, currentLView, token, flags | 2 /* InternalInjectFlags.Self */, NOT_FOUND);\n if (nodeInjectorValue !== NOT_FOUND) {\n return nodeInjectorValue;\n }\n // Has an explicit type due to a TS bug: https://github.com/microsoft/TypeScript/issues/33191\n let parentTNode = currentTNode.parent;\n // `TNode.parent` includes the parent within the current view only. If it doesn't exist,\n // it means that we've hit the view boundary and we need to go up to the next view.\n if (!parentTNode) {\n // Before we go to the next LView, check if the token exists on the current embedded injector.\n const embeddedViewInjector = currentLView[EMBEDDED_VIEW_INJECTOR];\n if (embeddedViewInjector) {\n const embeddedViewInjectorValue = embeddedViewInjector.get(token, NOT_FOUND, flags);\n if (embeddedViewInjectorValue !== NOT_FOUND) {\n return embeddedViewInjectorValue;\n }\n }\n // Otherwise keep going up the tree.\n parentTNode = getTNodeFromLView(currentLView);\n currentLView = currentLView[DECLARATION_VIEW];\n }\n currentTNode = parentTNode;\n }\n return notFoundValue;\n}\n/** Gets the TNode associated with an LView inside of the declaration view. */\nfunction getTNodeFromLView(lView) {\n const tView = lView[TVIEW];\n const tViewType = tView.type;\n // The parent pointer differs based on `TView.type`.\n if (tViewType === 2 /* TViewType.Embedded */) {\n ngDevMode && assertDefined(tView.declTNode, 'Embedded TNodes should have declaration parents.');\n return tView.declTNode;\n } else if (tViewType === 1 /* TViewType.Component */) {\n // Components don't have `TView.declTNode` because each instance of component could be\n // inserted in different location, hence `TView.declTNode` is meaningless.\n return lView[T_HOST];\n }\n return null;\n}\n\n/**\n * Facade for the attribute injection from DI.\n *\n * @codeGenApi\n */\nfunction ɵɵinjectAttribute(attrNameToInject) {\n return injectAttributeImpl(getCurrentTNode(), attrNameToInject);\n}\n\n/**\n * Attribute decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nconst Attribute = makeParamDecorator('Attribute', attributeName => ({\n attributeName,\n __NG_ELEMENT_ID__: () => ɵɵinjectAttribute(attributeName)\n}));\nlet _reflect = null;\nfunction getReflect() {\n return _reflect = _reflect || new ReflectionCapabilities();\n}\nfunction reflectDependencies(type) {\n return convertDependencies(getReflect().parameters(type));\n}\nfunction convertDependencies(deps) {\n return deps.map(dep => reflectDependency(dep));\n}\nfunction reflectDependency(dep) {\n const meta = {\n token: null,\n attribute: null,\n host: false,\n optional: false,\n self: false,\n skipSelf: false\n };\n if (Array.isArray(dep) && dep.length > 0) {\n for (let j = 0; j < dep.length; j++) {\n const param = dep[j];\n if (param === undefined) {\n // param may be undefined if type of dep is not set by ngtsc\n continue;\n }\n const proto = Object.getPrototypeOf(param);\n if (param instanceof Optional || proto.ngMetadataName === 'Optional') {\n meta.optional = true;\n } else if (param instanceof SkipSelf || proto.ngMetadataName === 'SkipSelf') {\n meta.skipSelf = true;\n } else if (param instanceof Self || proto.ngMetadataName === 'Self') {\n meta.self = true;\n } else if (param instanceof Host || proto.ngMetadataName === 'Host') {\n meta.host = true;\n } else if (param instanceof Inject) {\n meta.token = param.token;\n } else if (param instanceof Attribute) {\n if (param.attributeName === undefined) {\n throw new RuntimeError(204 /* RuntimeErrorCode.INVALID_INJECTION_TOKEN */, ngDevMode && `Attribute name must be defined.`);\n }\n meta.attribute = param.attributeName;\n } else {\n meta.token = param;\n }\n }\n } else if (dep === undefined || Array.isArray(dep) && dep.length === 0) {\n meta.token = null;\n } else {\n meta.token = dep;\n }\n return meta;\n}\n\n/**\n * Compile an Angular injectable according to its `Injectable` metadata, and patch the resulting\n * injectable def (`ɵprov`) onto the injectable type.\n */\nfunction compileInjectable(type, meta) {\n let ngInjectableDef = null;\n let ngFactoryDef = null;\n // if NG_PROV_DEF is already defined on this class then don't overwrite it\n if (!type.hasOwnProperty(NG_PROV_DEF)) {\n Object.defineProperty(type, NG_PROV_DEF, {\n get: () => {\n if (ngInjectableDef === null) {\n const compiler = getCompilerFacade({\n usage: 0 /* JitCompilerUsage.Decorator */,\n kind: 'injectable',\n type\n });\n ngInjectableDef = compiler.compileInjectable(angularCoreDiEnv, `ng:///${type.name}/ɵprov.js`, getInjectableMetadata(type, meta));\n }\n return ngInjectableDef;\n }\n });\n }\n // if NG_FACTORY_DEF is already defined on this class then don't overwrite it\n if (!type.hasOwnProperty(NG_FACTORY_DEF)) {\n Object.defineProperty(type, NG_FACTORY_DEF, {\n get: () => {\n if (ngFactoryDef === null) {\n const compiler = getCompilerFacade({\n usage: 0 /* JitCompilerUsage.Decorator */,\n kind: 'injectable',\n type\n });\n ngFactoryDef = compiler.compileFactory(angularCoreDiEnv, `ng:///${type.name}/ɵfac.js`, {\n name: type.name,\n type,\n typeArgumentCount: 0,\n // In JIT mode types are not available nor used.\n deps: reflectDependencies(type),\n target: compiler.FactoryTarget.Injectable\n });\n }\n return ngFactoryDef;\n },\n // Leave this configurable so that the factories from directives or pipes can take precedence.\n configurable: true\n });\n }\n}\nconst USE_VALUE = getClosureSafeProperty({\n provide: String,\n useValue: getClosureSafeProperty\n});\nfunction isUseClassProvider(meta) {\n return meta.useClass !== undefined;\n}\nfunction isUseValueProvider(meta) {\n return USE_VALUE in meta;\n}\nfunction isUseFactoryProvider(meta) {\n return meta.useFactory !== undefined;\n}\nfunction isUseExistingProvider(meta) {\n return meta.useExisting !== undefined;\n}\nfunction getInjectableMetadata(type, srcMeta) {\n // Allow the compilation of a class with a `@Injectable()` decorator without parameters\n const meta = srcMeta || {\n providedIn: null\n };\n const compilerMeta = {\n name: type.name,\n type: type,\n typeArgumentCount: 0,\n providedIn: meta.providedIn\n };\n if ((isUseClassProvider(meta) || isUseFactoryProvider(meta)) && meta.deps !== undefined) {\n compilerMeta.deps = convertDependencies(meta.deps);\n }\n // Check to see if the user explicitly provided a `useXxxx` property.\n if (isUseClassProvider(meta)) {\n compilerMeta.useClass = meta.useClass;\n } else if (isUseValueProvider(meta)) {\n compilerMeta.useValue = meta.useValue;\n } else if (isUseFactoryProvider(meta)) {\n compilerMeta.useFactory = meta.useFactory;\n } else if (isUseExistingProvider(meta)) {\n compilerMeta.useExisting = meta.useExisting;\n }\n return compilerMeta;\n}\n\n/**\n * Injectable decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nconst Injectable = makeDecorator('Injectable', undefined, undefined, undefined, (type, meta) => compileInjectable(type, meta));\n\n/**\n * Creates an ElementRef from the most recent node.\n *\n * @returns The ElementRef instance to use\n */\nfunction injectElementRef() {\n return createElementRef(getCurrentTNode(), getLView());\n}\n/**\n * Creates an ElementRef given a node.\n *\n * @param tNode The node for which you'd like an ElementRef\n * @param lView The view to which the node belongs\n * @returns The ElementRef instance to use\n */\nfunction createElementRef(tNode, lView) {\n return new ElementRef(getNativeByTNode(tNode, lView));\n}\n/**\n * A wrapper around a native element inside of a View.\n *\n * An `ElementRef` is backed by a render-specific element. In the browser, this is usually a DOM\n * element.\n *\n * @security Permitting direct access to the DOM can make your application more vulnerable to\n * XSS attacks. Carefully review any use of `ElementRef` in your code. For more detail, see the\n * [Security Guide](https://g.co/ng/security).\n *\n * @publicApi\n */\n// Note: We don't expose things like `Injector`, `ViewContainer`, ... here,\n// i.e. users have to ask for what they need. With that, we can build better analysis tools\n// and could do better codegen in the future.\nclass ElementRef {\n /**\n * <div class=\"docs-alert docs-alert-important\">\n * <header>Use with caution</header>\n * <p>\n * Use this API as the last resort when direct access to DOM is needed. Use templating and\n * data-binding provided by Angular instead. If used, it is recommended in combination with\n * {@link /best-practices/security#direct-use-of-the-dom-apis-and-explicit-sanitization-calls DomSanitizer}\n * for maxiumum security;\n * </p>\n * </div>\n */\n nativeElement;\n constructor(nativeElement) {\n this.nativeElement = nativeElement;\n }\n /**\n * @internal\n * @nocollapse\n */\n static __NG_ELEMENT_ID__ = injectElementRef;\n}\n/**\n * Unwraps `ElementRef` and return the `nativeElement`.\n *\n * @param value value to unwrap\n * @returns `nativeElement` if `ElementRef` otherwise returns value as is.\n */\nfunction unwrapElementRef(value) {\n return value instanceof ElementRef ? value.nativeElement : value;\n}\nfunction symbolIterator() {\n // @ts-expect-error accessing a private member\n return this._results[Symbol.iterator]();\n}\n/**\n * An unmodifiable list of items that Angular keeps up to date when the state\n * of the application changes.\n *\n * The type of object that {@link ViewChildren}, {@link ContentChildren}, and {@link QueryList}\n * provide.\n *\n * Implements an iterable interface, therefore it can be used in both ES6\n * javascript `for (var i of items)` loops as well as in Angular templates with\n * `@for(i of myList; track $index)`.\n *\n * Changes can be observed by subscribing to the `changes` `Observable`.\n * *\n * @usageNotes\n * ### Example\n * ```ts\n * @Component({...})\n * class Container {\n * @ViewChildren(Item) items:QueryList<Item>;\n * }\n * ```\n *\n * @publicApi\n */\nclass QueryList {\n _emitDistinctChangesOnly;\n dirty = true;\n _onDirty = undefined;\n _results = [];\n _changesDetected = false;\n _changes = undefined;\n length = 0;\n first = undefined;\n last = undefined;\n /**\n * Returns `Observable` of `QueryList` notifying the subscriber of changes.\n */\n get changes() {\n return this._changes ??= new Subject();\n }\n /**\n * @param emitDistinctChangesOnly Whether `QueryList.changes` should fire only when actual change\n * has occurred. Or if it should fire when query is recomputed. (recomputing could resolve in\n * the same result)\n */\n constructor(_emitDistinctChangesOnly = false) {\n this._emitDistinctChangesOnly = _emitDistinctChangesOnly;\n }\n /**\n * Returns the QueryList entry at `index`.\n */\n get(index) {\n return this._results[index];\n }\n /**\n * See\n * [Array.map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)\n */\n map(fn) {\n return this._results.map(fn);\n }\n filter(fn) {\n return this._results.filter(fn);\n }\n /**\n * See\n * [Array.find](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find)\n */\n find(fn) {\n return this._results.find(fn);\n }\n /**\n * See\n * [Array.reduce](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce)\n */\n reduce(fn, init) {\n return this._results.reduce(fn, init);\n }\n /**\n * See\n * [Array.forEach](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach)\n */\n forEach(fn) {\n this._results.forEach(fn);\n }\n /**\n * See\n * [Array.some](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some)\n */\n some(fn) {\n return this._results.some(fn);\n }\n /**\n * Returns a copy of the internal results list as an Array.\n */\n toArray() {\n return this._results.slice();\n }\n toString() {\n return this._results.toString();\n }\n /**\n * Updates the stored data of the query list, and resets the `dirty` flag to `false`, so that\n * on change detection, it will not notify of changes to the queries, unless a new change\n * occurs.\n *\n * @param resultsTree The query results to store\n * @param identityAccessor Optional function for extracting stable object identity from a value\n * in the array. This function is executed for each element of the query result list while\n * comparing current query list with the new one (provided as a first argument of the `reset`\n * function) to detect if the lists are different. If the function is not provided, elements\n * are compared as is (without any pre-processing).\n */\n reset(resultsTree, identityAccessor) {\n this.dirty = false;\n const newResultFlat = flatten(resultsTree);\n if (this._changesDetected = !arrayEquals(this._results, newResultFlat, identityAccessor)) {\n this._results = newResultFlat;\n this.length = newResultFlat.length;\n this.last = newResultFlat[this.length - 1];\n this.first = newResultFlat[0];\n }\n }\n /**\n * Triggers a change event by emitting on the `changes` {@link EventEmitter}.\n */\n notifyOnChanges() {\n if (this._changes !== undefined && (this._changesDetected || !this._emitDistinctChangesOnly)) this._changes.next(this);\n }\n /** @internal */\n onDirty(cb) {\n this._onDirty = cb;\n }\n /** internal */\n setDirty() {\n this.dirty = true;\n this._onDirty?.();\n }\n /** internal */\n destroy() {\n if (this._changes !== undefined) {\n this._changes.complete();\n this._changes.unsubscribe();\n }\n }\n [Symbol.iterator] = (() => symbolIterator)();\n}\n\n/**\n * The name of an attribute that can be added to the hydration boundary node\n * (component host node) to disable hydration for the content within that boundary.\n */\nconst SKIP_HYDRATION_ATTR_NAME = 'ngSkipHydration';\n/** Lowercase name of the `ngSkipHydration` attribute used for case-insensitive comparisons. */\nconst SKIP_HYDRATION_ATTR_NAME_LOWER_CASE = 'ngskiphydration';\n/**\n * Helper function to check if a given TNode has the 'ngSkipHydration' attribute.\n */\nfunction hasSkipHydrationAttrOnTNode(tNode) {\n const attrs = tNode.mergedAttrs;\n if (attrs === null) return false;\n // only ever look at the attribute name and skip the values\n for (let i = 0; i < attrs.length; i += 2) {\n const value = attrs[i];\n // This is a marker, which means that the static attributes section is over,\n // so we can exit early.\n if (typeof value === 'number') return false;\n if (typeof value === 'string' && value.toLowerCase() === SKIP_HYDRATION_ATTR_NAME_LOWER_CASE) {\n return true;\n }\n }\n return false;\n}\n/**\n * Helper function to check if a given RElement has the 'ngSkipHydration' attribute.\n */\nfunction hasSkipHydrationAttrOnRElement(rNode) {\n return rNode.hasAttribute(SKIP_HYDRATION_ATTR_NAME);\n}\n/**\n * Checks whether a TNode has a flag to indicate that it's a part of\n * a skip hydration block.\n */\nfunction hasInSkipHydrationBlockFlag(tNode) {\n return (tNode.flags & 128 /* TNodeFlags.inSkipHydrationBlock */) === 128 /* TNodeFlags.inSkipHydrationBlock */;\n}\n/**\n * Helper function that determines if a given node is within a skip hydration block\n * by navigating up the TNode tree to see if any parent nodes have skip hydration\n * attribute.\n */\nfunction isInSkipHydrationBlock(tNode) {\n if (hasInSkipHydrationBlockFlag(tNode)) {\n return true;\n }\n let currentTNode = tNode.parent;\n while (currentTNode) {\n if (hasInSkipHydrationBlockFlag(tNode) || hasSkipHydrationAttrOnTNode(currentTNode)) {\n return true;\n }\n currentTNode = currentTNode.parent;\n }\n return false;\n}\n/**\n * Check if an i18n block is in a skip hydration section by looking at a parent TNode\n * to determine if this TNode is in a skip hydration section or the TNode has\n * the `ngSkipHydration` attribute.\n */\nfunction isI18nInSkipHydrationBlock(parentTNode) {\n return hasInSkipHydrationBlockFlag(parentTNode) || hasSkipHydrationAttrOnTNode(parentTNode) || isInSkipHydrationBlock(parentTNode);\n}\n\n/**\n * The strategy that the default change detector uses to detect changes.\n * When set, takes effect the next time change detection is triggered.\n *\n * @see {@link /api/core/ChangeDetectorRef?tab=usage-notes Change detection usage}\n * @see {@link /best-practices/skipping-subtrees Skipping component subtrees}\n *\n * @publicApi\n */\nvar ChangeDetectionStrategy;\n(function (ChangeDetectionStrategy) {\n /**\n * Use the `CheckOnce` strategy, meaning that automatic change detection is deactivated\n * until reactivated by setting the strategy to `Default` (`CheckAlways`).\n * Change detection can still be explicitly invoked.\n * This strategy applies to all child directives and cannot be overridden.\n */\n ChangeDetectionStrategy[ChangeDetectionStrategy[\"OnPush\"] = 0] = \"OnPush\";\n /**\n * Use the default `CheckAlways` strategy, in which change detection is automatic until\n * explicitly deactivated.\n */\n ChangeDetectionStrategy[ChangeDetectionStrategy[\"Default\"] = 1] = \"Default\";\n})(ChangeDetectionStrategy || (ChangeDetectionStrategy = {}));\n\n// Keeps track of the currently-active LViews.\nconst TRACKED_LVIEWS = new Map();\n// Used for generating unique IDs for LViews.\nlet uniqueIdCounter = 0;\n/** Gets a unique ID that can be assigned to an LView. */\nfunction getUniqueLViewId() {\n return uniqueIdCounter++;\n}\n/** Starts tracking an LView. */\nfunction registerLView(lView) {\n ngDevMode && assertNumber(lView[ID], 'LView must have an ID in order to be registered');\n TRACKED_LVIEWS.set(lView[ID], lView);\n}\n/** Gets an LView by its unique ID. */\nfunction getLViewById(id) {\n ngDevMode && assertNumber(id, 'ID used for LView lookup must be a number');\n return TRACKED_LVIEWS.get(id) || null;\n}\n/** Stops tracking an LView. */\nfunction unregisterLView(lView) {\n ngDevMode && assertNumber(lView[ID], 'Cannot stop tracking an LView that does not have an ID');\n TRACKED_LVIEWS.delete(lView[ID]);\n}\n/** Gets the currently-tracked views. */\nfunction getTrackedLViews() {\n return TRACKED_LVIEWS;\n}\n\n/**\n * The internal view context which is specific to a given DOM element, directive or\n * component instance. Each value in here (besides the LView and element node details)\n * can be present, null or undefined. If undefined then it implies the value has not been\n * looked up yet, otherwise, if null, then a lookup was executed and nothing was found.\n *\n * Each value will get filled when the respective value is examined within the getContext\n * function. The component, element and each directive instance will share the same instance\n * of the context.\n */\nclass LContext {\n lViewId;\n nodeIndex;\n native;\n /**\n * The instance of the Component node.\n */\n component;\n /**\n * The list of active directives that exist on this element.\n */\n directives;\n /**\n * The map of local references (local reference name => element or directive instance) that\n * exist on this element.\n */\n localRefs;\n /** Component's parent view data. */\n get lView() {\n return getLViewById(this.lViewId);\n }\n constructor(\n /**\n * ID of the component's parent view data.\n */\n lViewId,\n /**\n * The index instance of the node.\n */\n nodeIndex,\n /**\n * The instance of the DOM node that is attached to the lNode.\n */\n native) {\n this.lViewId = lViewId;\n this.nodeIndex = nodeIndex;\n this.native = native;\n }\n}\n\n/**\n * Returns the matching `LContext` data for a given DOM node, directive or component instance.\n *\n * This function will examine the provided DOM element, component, or directive instance\\'s\n * monkey-patched property to derive the `LContext` data. Once called then the monkey-patched\n * value will be that of the newly created `LContext`.\n *\n * If the monkey-patched value is the `LView` instance then the context value for that\n * target will be created and the monkey-patch reference will be updated. Therefore when this\n * function is called it may mutate the provided element\\'s, component\\'s or any of the associated\n * directive\\'s monkey-patch values.\n *\n * If the monkey-patch value is not detected then the code will walk up the DOM until an element\n * is found which contains a monkey-patch reference. When that occurs then the provided element\n * will be updated with a new context (which is then returned). If the monkey-patch value is not\n * detected for a component/directive instance then it will throw an error (all components and\n * directives should be automatically monkey-patched by ivy).\n *\n * @param target Component, Directive or DOM Node.\n */\nfunction getLContext(target) {\n let mpValue = readPatchedData(target);\n if (mpValue) {\n // only when it's an array is it considered an LView instance\n // ... otherwise it's an already constructed LContext instance\n if (isLView(mpValue)) {\n const lView = mpValue;\n let nodeIndex;\n let component = undefined;\n let directives = undefined;\n if (isComponentInstance(target)) {\n nodeIndex = findViaComponent(lView, target);\n if (nodeIndex == -1) {\n throw new Error('The provided component was not found in the application');\n }\n component = target;\n } else if (isDirectiveInstance(target)) {\n nodeIndex = findViaDirective(lView, target);\n if (nodeIndex == -1) {\n throw new Error('The provided directive was not found in the application');\n }\n directives = getDirectivesAtNodeIndex(nodeIndex, lView);\n } else {\n nodeIndex = findViaNativeElement(lView, target);\n if (nodeIndex == -1) {\n return null;\n }\n }\n // the goal is not to fill the entire context full of data because the lookups\n // are expensive. Instead, only the target data (the element, component, container, ICU\n // expression or directive details) are filled into the context. If called multiple times\n // with different target values then the missing target data will be filled in.\n const native = unwrapRNode(lView[nodeIndex]);\n const existingCtx = readPatchedData(native);\n const context = existingCtx && !Array.isArray(existingCtx) ? existingCtx : createLContext(lView, nodeIndex, native);\n // only when the component has been discovered then update the monkey-patch\n if (component && context.component === undefined) {\n context.component = component;\n attachPatchData(context.component, context);\n }\n // only when the directives have been discovered then update the monkey-patch\n if (directives && context.directives === undefined) {\n context.directives = directives;\n for (let i = 0; i < directives.length; i++) {\n attachPatchData(directives[i], context);\n }\n }\n attachPatchData(context.native, context);\n mpValue = context;\n }\n } else {\n const rElement = target;\n ngDevMode && assertDomNode(rElement);\n // if the context is not found then we need to traverse upwards up the DOM\n // to find the nearest element that has already been monkey patched with data\n let parent = rElement;\n while (parent = parent.parentNode) {\n const parentContext = readPatchedData(parent);\n if (parentContext) {\n const lView = Array.isArray(parentContext) ? parentContext : parentContext.lView;\n // the edge of the app was also reached here through another means\n // (maybe because the DOM was changed manually).\n if (!lView) {\n return null;\n }\n const index = findViaNativeElement(lView, rElement);\n if (index >= 0) {\n const native = unwrapRNode(lView[index]);\n const context = createLContext(lView, index, native);\n attachPatchData(native, context);\n mpValue = context;\n break;\n }\n }\n }\n }\n return mpValue || null;\n}\n/**\n * Creates an empty instance of a `LContext` context\n */\nfunction createLContext(lView, nodeIndex, native) {\n return new LContext(lView[ID], nodeIndex, native);\n}\n/**\n * Takes a component instance and returns the view for that component.\n *\n * @param componentInstance\n * @returns The component's view\n */\nfunction getComponentViewByInstance(componentInstance) {\n let patchedData = readPatchedData(componentInstance);\n let lView;\n if (isLView(patchedData)) {\n const contextLView = patchedData;\n const nodeIndex = findViaComponent(contextLView, componentInstance);\n lView = getComponentLViewByIndex(nodeIndex, contextLView);\n const context = createLContext(contextLView, nodeIndex, lView[HOST]);\n context.component = componentInstance;\n attachPatchData(componentInstance, context);\n attachPatchData(context.native, context);\n } else {\n const context = patchedData;\n const contextLView = context.lView;\n ngDevMode && assertLView(contextLView);\n lView = getComponentLViewByIndex(context.nodeIndex, contextLView);\n }\n return lView;\n}\n/**\n * This property will be monkey-patched on elements, components and directives.\n */\nconst MONKEY_PATCH_KEY_NAME = '__ngContext__';\n/**\n * Assigns the given data to the given target (which could be a component,\n * directive or DOM node instance) using monkey-patching.\n */\nfunction attachPatchData(target, data) {\n ngDevMode && assertDefined(target, 'Target expected');\n // Only attach the ID of the view in order to avoid memory leaks (see #41047). We only do this\n // for `LView`, because we have control over when an `LView` is created and destroyed, whereas\n // we can't know when to remove an `LContext`.\n if (isLView(data)) {\n target[MONKEY_PATCH_KEY_NAME] = data[ID];\n registerLView(data);\n } else {\n target[MONKEY_PATCH_KEY_NAME] = data;\n }\n}\n/**\n * Returns the monkey-patch value data present on the target (which could be\n * a component, directive or a DOM node).\n */\nfunction readPatchedData(target) {\n ngDevMode && assertDefined(target, 'Target expected');\n const data = target[MONKEY_PATCH_KEY_NAME];\n return typeof data === 'number' ? getLViewById(data) : data || null;\n}\nfunction readPatchedLView(target) {\n const value = readPatchedData(target);\n if (value) {\n return isLView(value) ? value : value.lView;\n }\n return null;\n}\nfunction isComponentInstance(instance) {\n return instance && instance.constructor && instance.constructor.ɵcmp;\n}\nfunction isDirectiveInstance(instance) {\n return instance && instance.constructor && instance.constructor.ɵdir;\n}\n/**\n * Locates the element within the given LView and returns the matching index\n */\nfunction findViaNativeElement(lView, target) {\n const tView = lView[TVIEW];\n for (let i = HEADER_OFFSET; i < tView.bindingStartIndex; i++) {\n if (unwrapRNode(lView[i]) === target) {\n return i;\n }\n }\n return -1;\n}\n/**\n * Locates the next tNode (child, sibling or parent).\n */\nfunction traverseNextElement(tNode) {\n if (tNode.child) {\n return tNode.child;\n } else if (tNode.next) {\n return tNode.next;\n } else {\n // Let's take the following template: <div><span>text</span></div><component/>\n // After checking the text node, we need to find the next parent that has a \"next\" TNode,\n // in this case the parent `div`, so that we can find the component.\n while (tNode.parent && !tNode.parent.next) {\n tNode = tNode.parent;\n }\n return tNode.parent && tNode.parent.next;\n }\n}\n/**\n * Locates the component within the given LView and returns the matching index\n */\nfunction findViaComponent(lView, componentInstance) {\n const componentIndices = lView[TVIEW].components;\n if (componentIndices) {\n for (let i = 0; i < componentIndices.length; i++) {\n const elementComponentIndex = componentIndices[i];\n const componentView = getComponentLViewByIndex(elementComponentIndex, lView);\n if (componentView[CONTEXT] === componentInstance) {\n return elementComponentIndex;\n }\n }\n } else {\n const rootComponentView = getComponentLViewByIndex(HEADER_OFFSET, lView);\n const rootComponent = rootComponentView[CONTEXT];\n if (rootComponent === componentInstance) {\n // we are dealing with the root element here therefore we know that the\n // element is the very first element after the HEADER data in the lView\n return HEADER_OFFSET;\n }\n }\n return -1;\n}\n/**\n * Locates the directive within the given LView and returns the matching index\n */\nfunction findViaDirective(lView, directiveInstance) {\n // if a directive is monkey patched then it will (by default)\n // have a reference to the LView of the current view. The\n // element bound to the directive being search lives somewhere\n // in the view data. We loop through the nodes and check their\n // list of directives for the instance.\n let tNode = lView[TVIEW].firstChild;\n while (tNode) {\n const directiveIndexStart = tNode.directiveStart;\n const directiveIndexEnd = tNode.directiveEnd;\n for (let i = directiveIndexStart; i < directiveIndexEnd; i++) {\n if (lView[i] === directiveInstance) {\n return tNode.index;\n }\n }\n tNode = traverseNextElement(tNode);\n }\n return -1;\n}\n/**\n * Returns a list of directives applied to a node at a specific index. The list includes\n * directives matched by selector and any host directives, but it excludes components.\n * Use `getComponentAtNodeIndex` to find the component applied to a node.\n *\n * @param nodeIndex The node index\n * @param lView The target view data\n */\nfunction getDirectivesAtNodeIndex(nodeIndex, lView) {\n const tNode = lView[TVIEW].data[nodeIndex];\n if (tNode.directiveStart === 0) return EMPTY_ARRAY;\n const results = [];\n for (let i = tNode.directiveStart; i < tNode.directiveEnd; i++) {\n const directiveInstance = lView[i];\n if (!isComponentInstance(directiveInstance)) {\n results.push(directiveInstance);\n }\n }\n return results;\n}\nfunction getComponentAtNodeIndex(nodeIndex, lView) {\n const tNode = lView[TVIEW].data[nodeIndex];\n return isComponentHost(tNode) ? lView[tNode.directiveStart + tNode.componentOffset] : null;\n}\n/**\n * Returns a map of local references (local reference name => element or directive instance) that\n * exist on a given element.\n */\nfunction discoverLocalRefs(lView, nodeIndex) {\n const tNode = lView[TVIEW].data[nodeIndex];\n if (tNode && tNode.localNames) {\n const result = {};\n let localIndex = tNode.index + 1;\n for (let i = 0; i < tNode.localNames.length; i += 2) {\n result[tNode.localNames[i]] = lView[localIndex];\n localIndex++;\n }\n return result;\n }\n return null;\n}\n\n/**\n * Retrieve the root view from any component or `LView` by walking the parent `LView` until\n * reaching the root `LView`.\n *\n * @param componentOrLView any component or `LView`\n */\nfunction getRootView(componentOrLView) {\n ngDevMode && assertDefined(componentOrLView, 'component');\n let lView = isLView(componentOrLView) ? componentOrLView : readPatchedLView(componentOrLView);\n while (lView && !isRootView(lView)) {\n lView = getLViewParent(lView);\n }\n ngDevMode && assertLView(lView);\n return lView;\n}\n/**\n * Returns the context information associated with the application where the target is situated. It\n * does this by walking the parent views until it gets to the root view, then getting the context\n * off of that.\n *\n * @param viewOrComponent the `LView` or component to get the root context for.\n */\nfunction getRootContext(viewOrComponent) {\n const rootView = getRootView(viewOrComponent);\n ngDevMode && assertDefined(rootView[CONTEXT], 'Root view has no context. Perhaps it is disconnected?');\n return rootView[CONTEXT];\n}\n/**\n * Gets the first `LContainer` in the LView or `null` if none exists.\n */\nfunction getFirstLContainer(lView) {\n return getNearestLContainer(lView[CHILD_HEAD]);\n}\n/**\n * Gets the next `LContainer` that is a sibling of the given container.\n */\nfunction getNextLContainer(container) {\n return getNearestLContainer(container[NEXT]);\n}\nfunction getNearestLContainer(viewOrContainer) {\n while (viewOrContainer !== null && !isLContainer(viewOrContainer)) {\n viewOrContainer = viewOrContainer[NEXT];\n }\n return viewOrContainer;\n}\n\n/**\n * Retrieves the component instance associated with a given DOM element.\n *\n * @usageNotes\n * Given the following DOM structure:\n *\n * ```html\n * <app-root>\n * <div>\n * <child-comp></child-comp>\n * </div>\n * </app-root>\n * ```\n *\n * Calling `getComponent` on `<child-comp>` will return the instance of `ChildComponent`\n * associated with this DOM element.\n *\n * Calling the function on `<app-root>` will return the `MyApp` instance.\n *\n *\n * @param element DOM element from which the component should be retrieved.\n * @returns Component instance associated with the element or `null` if there\n * is no component associated with it.\n *\n * @publicApi\n */\nfunction getComponent(element) {\n ngDevMode && assertDomElement(element);\n const context = getLContext(element);\n if (context === null) return null;\n if (context.component === undefined) {\n const lView = context.lView;\n if (lView === null) {\n return null;\n }\n context.component = getComponentAtNodeIndex(context.nodeIndex, lView);\n }\n return context.component;\n}\n/**\n * If inside an embedded view (e.g. `*ngIf` or `*ngFor`), retrieves the context of the embedded\n * view that the element is part of. Otherwise retrieves the instance of the component whose view\n * owns the element (in this case, the result is the same as calling `getOwningComponent`).\n *\n * @param element Element for which to get the surrounding component instance.\n * @returns Instance of the component that is around the element or null if the element isn't\n * inside any component.\n *\n * @publicApi\n */\nfunction getContext(element) {\n assertDomElement(element);\n const context = getLContext(element);\n const lView = context ? context.lView : null;\n return lView === null ? null : lView[CONTEXT];\n}\n/**\n * Retrieves the component instance whose view contains the DOM element.\n *\n * For example, if `<child-comp>` is used in the template of `<app-comp>`\n * (i.e. a `ViewChild` of `<app-comp>`), calling `getOwningComponent` on `<child-comp>`\n * would return `<app-comp>`.\n *\n * @param elementOrDir DOM element, component or directive instance\n * for which to retrieve the root components.\n * @returns Component instance whose view owns the DOM element or null if the element is not\n * part of a component view.\n *\n * @publicApi\n */\nfunction getOwningComponent(elementOrDir) {\n const context = getLContext(elementOrDir);\n let lView = context ? context.lView : null;\n if (lView === null) return null;\n let parent;\n while (lView[TVIEW].type === 2 /* TViewType.Embedded */ && (parent = getLViewParent(lView))) {\n lView = parent;\n }\n return isRootView(lView) ? null : lView[CONTEXT];\n}\n/**\n * Retrieves all root components associated with a DOM element, directive or component instance.\n * Root components are those which have been bootstrapped by Angular.\n *\n * @param elementOrDir DOM element, component or directive instance\n * for which to retrieve the root components.\n * @returns Root components associated with the target object.\n *\n * @publicApi\n */\nfunction getRootComponents(elementOrDir) {\n const lView = readPatchedLView(elementOrDir);\n return lView !== null ? [getRootContext(lView)] : [];\n}\n/**\n * Retrieves an `Injector` associated with an element, component or directive instance.\n *\n * @param elementOrDir DOM element, component or directive instance for which to\n * retrieve the injector.\n * @returns Injector associated with the element, component or directive instance.\n *\n * @publicApi\n */\nfunction getInjector(elementOrDir) {\n const context = getLContext(elementOrDir);\n const lView = context ? context.lView : null;\n if (lView === null) return Injector.NULL;\n const tNode = lView[TVIEW].data[context.nodeIndex];\n return new NodeInjector(tNode, lView);\n}\n/**\n * Retrieve a set of injection tokens at a given DOM node.\n *\n * @param element Element for which the injection tokens should be retrieved.\n */\nfunction getInjectionTokens(element) {\n const context = getLContext(element);\n const lView = context ? context.lView : null;\n if (lView === null) return [];\n const tView = lView[TVIEW];\n const tNode = tView.data[context.nodeIndex];\n const providerTokens = [];\n const startIndex = tNode.providerIndexes & 1048575 /* TNodeProviderIndexes.ProvidersStartIndexMask */;\n const endIndex = tNode.directiveEnd;\n for (let i = startIndex; i < endIndex; i++) {\n let value = tView.data[i];\n if (isDirectiveDefHack(value)) {\n // The fact that we sometimes store Type and sometimes DirectiveDef in this location is a\n // design flaw. We should always store same type so that we can be monomorphic. The issue\n // is that for Components/Directives we store the def instead the type. The correct behavior\n // is that we should always be storing injectable type in this location.\n value = value.type;\n }\n providerTokens.push(value);\n }\n return providerTokens;\n}\n/**\n * Retrieves directive instances associated with a given DOM node. Does not include\n * component instances.\n *\n * @usageNotes\n * Given the following DOM structure:\n *\n * ```html\n * <app-root>\n * <button my-button></button>\n * <my-comp></my-comp>\n * </app-root>\n * ```\n *\n * Calling `getDirectives` on `<button>` will return an array with an instance of the `MyButton`\n * directive that is associated with the DOM node.\n *\n * Calling `getDirectives` on `<my-comp>` will return an empty array.\n *\n * @param node DOM node for which to get the directives.\n * @returns Array of directives associated with the node.\n *\n * @publicApi\n */\nfunction getDirectives(node) {\n // Skip text nodes because we can't have directives associated with them.\n if (node instanceof Text) {\n return [];\n }\n const context = getLContext(node);\n const lView = context ? context.lView : null;\n if (lView === null) {\n return [];\n }\n const tView = lView[TVIEW];\n const nodeIndex = context.nodeIndex;\n if (!tView?.data[nodeIndex]) {\n return [];\n }\n if (context.directives === undefined) {\n context.directives = getDirectivesAtNodeIndex(nodeIndex, lView);\n }\n // The `directives` in this case are a named array called `LComponentView`. Clone the\n // result so we don't expose an internal data structure in the user's console.\n return context.directives === null ? [] : [...context.directives];\n}\n/** The framework used to author a particular application or component. */\nvar Framework;\n(function (Framework) {\n Framework[\"Angular\"] = \"angular\";\n Framework[\"ACX\"] = \"acx\";\n Framework[\"Wiz\"] = \"wiz\";\n})(Framework || (Framework = {}));\n/** ACX change detection strategies. */\nvar AcxChangeDetectionStrategy;\n(function (AcxChangeDetectionStrategy) {\n AcxChangeDetectionStrategy[AcxChangeDetectionStrategy[\"Default\"] = 0] = \"Default\";\n AcxChangeDetectionStrategy[AcxChangeDetectionStrategy[\"OnPush\"] = 1] = \"OnPush\";\n})(AcxChangeDetectionStrategy || (AcxChangeDetectionStrategy = {}));\n/** ACX view encapsulation modes. */\nvar AcxViewEncapsulation;\n(function (AcxViewEncapsulation) {\n AcxViewEncapsulation[AcxViewEncapsulation[\"Emulated\"] = 0] = \"Emulated\";\n AcxViewEncapsulation[AcxViewEncapsulation[\"None\"] = 1] = \"None\";\n})(AcxViewEncapsulation || (AcxViewEncapsulation = {}));\n/**\n * Returns the debug (partial) metadata for a particular directive or component instance.\n * The function accepts an instance of a directive or component and returns the corresponding\n * metadata.\n *\n * @param directiveOrComponentInstance Instance of a directive or component\n * @returns metadata of the passed directive or component\n *\n * @publicApi\n */\nfunction getDirectiveMetadata$1(directiveOrComponentInstance) {\n const {\n constructor\n } = directiveOrComponentInstance;\n if (!constructor) {\n throw new Error('Unable to find the instance constructor');\n }\n // In case a component inherits from a directive, we may have component and directive metadata\n // To ensure we don't get the metadata of the directive, we want to call `getComponentDef` first.\n const componentDef = getComponentDef(constructor);\n if (componentDef) {\n const inputs = extractInputDebugMetadata(componentDef.inputs);\n return {\n inputs,\n outputs: componentDef.outputs,\n encapsulation: componentDef.encapsulation,\n changeDetection: componentDef.onPush ? ChangeDetectionStrategy.OnPush : ChangeDetectionStrategy.Default\n };\n }\n const directiveDef = getDirectiveDef(constructor);\n if (directiveDef) {\n const inputs = extractInputDebugMetadata(directiveDef.inputs);\n return {\n inputs,\n outputs: directiveDef.outputs\n };\n }\n return null;\n}\n/**\n * Retrieve map of local references.\n *\n * The references are retrieved as a map of local reference name to element or directive instance.\n *\n * @param target DOM element, component or directive instance for which to retrieve\n * the local references.\n */\nfunction getLocalRefs(target) {\n const context = getLContext(target);\n if (context === null) return {};\n if (context.localRefs === undefined) {\n const lView = context.lView;\n if (lView === null) {\n return {};\n }\n context.localRefs = discoverLocalRefs(lView, context.nodeIndex);\n }\n return context.localRefs || {};\n}\n/**\n * Retrieves the host element of a component or directive instance.\n * The host element is the DOM element that matched the selector of the directive.\n *\n * @param componentOrDirective Component or directive instance for which the host\n * element should be retrieved.\n * @returns Host element of the target.\n *\n * @publicApi\n */\nfunction getHostElement(componentOrDirective) {\n return getLContext(componentOrDirective).native;\n}\n/**\n * Retrieves a list of event listeners associated with a DOM element. The list does include host\n * listeners, but it does not include event listeners defined outside of the Angular context\n * (e.g. through `addEventListener`).\n *\n * @usageNotes\n * Given the following DOM structure:\n *\n * ```html\n * <app-root>\n * <div (click)=\"doSomething()\"></div>\n * </app-root>\n * ```\n *\n * Calling `getListeners` on `<div>` will return an object that looks as follows:\n *\n * ```ts\n * {\n * name: 'click',\n * element: <div>,\n * callback: () => doSomething(),\n * useCapture: false\n * }\n * ```\n *\n * @param element Element for which the DOM listeners should be retrieved.\n * @returns Array of event listeners on the DOM element.\n *\n * @publicApi\n */\nfunction getListeners(element) {\n ngDevMode && assertDomElement(element);\n const lContext = getLContext(element);\n const lView = lContext === null ? null : lContext.lView;\n if (lView === null) return [];\n const tView = lView[TVIEW];\n const lCleanup = lView[CLEANUP];\n const tCleanup = tView.cleanup;\n const listeners = [];\n if (tCleanup && lCleanup) {\n for (let i = 0; i < tCleanup.length;) {\n const firstParam = tCleanup[i++];\n const secondParam = tCleanup[i++];\n if (typeof firstParam === 'string') {\n const name = firstParam;\n const listenerElement = unwrapRNode(lView[secondParam]);\n const callback = lCleanup[tCleanup[i++]];\n const useCaptureOrIndx = tCleanup[i++];\n // if useCaptureOrIndx is boolean then report it as is.\n // if useCaptureOrIndx is positive number then it in unsubscribe method\n // if useCaptureOrIndx is negative number then it is a Subscription\n const type = typeof useCaptureOrIndx === 'boolean' || useCaptureOrIndx >= 0 ? 'dom' : 'output';\n const useCapture = typeof useCaptureOrIndx === 'boolean' ? useCaptureOrIndx : false;\n if (element == listenerElement) {\n listeners.push({\n element,\n name,\n callback,\n useCapture,\n type\n });\n }\n }\n }\n }\n listeners.sort(sortListeners);\n return listeners;\n}\nfunction sortListeners(a, b) {\n if (a.name == b.name) return 0;\n return a.name < b.name ? -1 : 1;\n}\n/**\n * This function should not exist because it is megamorphic and only mostly correct.\n *\n * See call site for more info.\n */\nfunction isDirectiveDefHack(obj) {\n return obj.type !== undefined && obj.declaredInputs !== undefined && obj.resolveHostDirectives !== undefined;\n}\n/** Asserts that a value is a DOM Element. */\nfunction assertDomElement(value) {\n if (typeof Element !== 'undefined' && !(value instanceof Element)) {\n throw new Error('Expecting instance of DOM Element');\n }\n}\n/**\n * A directive definition holds additional metadata using bitwise flags to indicate\n * for example whether it is signal based.\n *\n * This information needs to be separate from the `publicName -> minifiedName`\n * mappings for backwards compatibility.\n */\nfunction extractInputDebugMetadata(inputs) {\n const res = {};\n for (const key in inputs) {\n if (inputs.hasOwnProperty(key)) {\n const value = inputs[key];\n if (value !== undefined) {\n res[key] = value[0];\n }\n }\n }\n return res;\n}\n\n/**\n * Most of the use of `document` in Angular is from within the DI system so it is possible to simply\n * inject the `DOCUMENT` token and are done.\n *\n * Ivy is special because it does not rely upon the DI and must get hold of the document some other\n * way.\n *\n * The solution is to define `getDocument()` and `setDocument()` top-level functions for ivy.\n * Wherever ivy needs the global document, it calls `getDocument()` instead.\n *\n * When running ivy outside of a browser environment, it is necessary to call `setDocument()` to\n * tell ivy what the global `document` is.\n *\n * Angular does this for us in each of the standard platforms (`Browser` and `Server`)\n * by calling `setDocument()` when providing the `DOCUMENT` token.\n */\nlet DOCUMENT = undefined;\n/**\n * Tell ivy what the `document` is for this platform.\n *\n * It is only necessary to call this if the current platform is not a browser.\n *\n * @param document The object representing the global `document` in this environment.\n */\nfunction setDocument(document) {\n DOCUMENT = document;\n}\n/**\n * Access the object that represents the `document` for this platform.\n *\n * Ivy calls this whenever it needs to access the `document` object.\n * For example to create the renderer or to do sanitization.\n */\nfunction getDocument() {\n if (DOCUMENT !== undefined) {\n return DOCUMENT;\n } else if (typeof document !== 'undefined') {\n return document;\n }\n throw new RuntimeError(210 /* RuntimeErrorCode.MISSING_DOCUMENT */, (typeof ngDevMode === 'undefined' || ngDevMode) && `The document object is not available in this context. Make sure the DOCUMENT injection token is provided.`);\n // No \"document\" can be found. This should only happen if we are running ivy outside Angular and\n // the current platform is not a browser. Since this is not a supported scenario at the moment\n // this should not happen in Angular apps.\n // Once we support running ivy outside of Angular we will need to publish `setDocument()` as a\n // public API.\n}\n\n/**\n * A DI token representing a string ID, used\n * primarily for prefixing application attributes and CSS styles when\n * {@link ViewEncapsulation#Emulated} is being used.\n *\n * The token is needed in cases when multiple applications are bootstrapped on a page\n * (for example, using `bootstrapApplication` calls). In this case, ensure that those applications\n * have different `APP_ID` value setup. For example:\n *\n * ```ts\n * bootstrapApplication(ComponentA, {\n * providers: [\n * { provide: APP_ID, useValue: 'app-a' },\n * // ... other providers ...\n * ]\n * });\n *\n * bootstrapApplication(ComponentB, {\n * providers: [\n * { provide: APP_ID, useValue: 'app-b' },\n * // ... other providers ...\n * ]\n * });\n * ```\n *\n * By default, when there is only one application bootstrapped, you don't need to provide the\n * `APP_ID` token (the `ng` will be used as an app ID).\n *\n * @publicApi\n */\nconst APP_ID = new InjectionToken(ngDevMode ? 'AppId' : '', {\n providedIn: 'root',\n factory: () => DEFAULT_APP_ID\n});\n/** Default value of the `APP_ID` token. */\nconst DEFAULT_APP_ID = 'ng';\n/**\n * A function that is executed when a platform is initialized.\n *\n * @deprecated from v19.0.0, use providePlatformInitializer instead\n *\n * @see {@link providePlatformInitializer}\n *\n * @publicApi\n */\nconst PLATFORM_INITIALIZER = new InjectionToken(ngDevMode ? 'Platform Initializer' : '');\n/**\n * A token that indicates an opaque platform ID.\n * @publicApi\n */\nconst PLATFORM_ID = new InjectionToken(ngDevMode ? 'Platform ID' : '', {\n providedIn: 'platform',\n factory: () => 'unknown' // set a default platform name, when none set explicitly\n});\n/**\n * A DI token that indicates the root directory of\n * the application\n * @publicApi\n * @deprecated\n */\nconst PACKAGE_ROOT_URL = new InjectionToken(ngDevMode ? 'Application Packages Root URL' : '');\n// We keep this token here, rather than the animations package, so that modules that only care\n// about which animations module is loaded (e.g. the CDK) can retrieve it without having to\n// include extra dependencies. See #44970 for more context.\n/**\n * A [DI token](api/core/InjectionToken) that indicates which animations\n * module has been loaded.\n * @publicApi\n */\nconst ANIMATION_MODULE_TYPE = new InjectionToken(ngDevMode ? 'AnimationModuleType' : '');\n// TODO(crisbeto): link to CSP guide here.\n/**\n * Token used to configure the [Content Security Policy](https://web.dev/strict-csp/) nonce that\n * Angular will apply when inserting inline styles. If not provided, Angular will look up its value\n * from the `ngCspNonce` attribute of the application root node.\n *\n * @publicApi\n */\nconst CSP_NONCE = new InjectionToken(ngDevMode ? 'CSP nonce' : '', {\n providedIn: 'root',\n factory: () => {\n // Ideally we wouldn't have to use `querySelector` here since we know that the nonce will be on\n // the root node, but because the token value is used in renderers, it has to be available\n // *very* early in the bootstrapping process. This should be a fairly shallow search, because\n // the app won't have been added to the DOM yet. Some approaches that were considered:\n // 1. Find the root node through `ApplicationRef.components[i].location` - normally this would\n // be enough for our purposes, but the token is injected very early so the `components` array\n // isn't populated yet.\n // 2. Find the root `LView` through the current `LView` - renderers are a prerequisite to\n // creating the `LView`. This means that no `LView` will have been entered when this factory is\n // invoked for the root component.\n // 3. Have the token factory return `() => string` which is invoked when a nonce is requested -\n // the slightly later execution does allow us to get an `LView` reference, but the fact that\n // it is a function means that it could be executed at *any* time (including immediately) which\n // may lead to weird bugs.\n // 4. Have the `ComponentFactory` read the attribute and provide it to the injector under the\n // hood - has the same problem as #1 and #2 in that the renderer is used to query for the root\n // node and the nonce value needs to be available when the renderer is created.\n return getDocument().body?.querySelector('[ngCspNonce]')?.getAttribute('ngCspNonce') || null;\n }\n});\nconst IMAGE_CONFIG_DEFAULTS = {\n breakpoints: [16, 32, 48, 64, 96, 128, 256, 384, 640, 750, 828, 1080, 1200, 1920, 2048, 3840],\n placeholderResolution: 30,\n disableImageSizeWarning: false,\n disableImageLazyLoadWarning: false\n};\n/**\n * Injection token that configures the image optimized image functionality.\n * See {@link ImageConfig} for additional information about parameters that\n * can be used.\n *\n * @see {@link NgOptimizedImage}\n * @see {@link ImageConfig}\n * @publicApi\n */\nconst IMAGE_CONFIG = new InjectionToken(ngDevMode ? 'ImageConfig' : '', {\n providedIn: 'root',\n factory: () => IMAGE_CONFIG_DEFAULTS\n});\n\n/**\n * Create a `StateKey<T>` that can be used to store value of type T with `TransferState`.\n *\n * Example:\n *\n * ```ts\n * const COUNTER_KEY = makeStateKey<number>('counter');\n * let value = 10;\n *\n * transferState.set(COUNTER_KEY, value);\n * ```\n *\n * @publicApi\n */\nfunction makeStateKey(key) {\n return key;\n}\nfunction initTransferState() {\n const transferState = new TransferState();\n if (typeof ngServerMode === 'undefined' || !ngServerMode) {\n transferState.store = retrieveTransferredState(getDocument(), inject(APP_ID));\n }\n return transferState;\n}\n/**\n * A key value store that is transferred from the application on the server side to the application\n * on the client side.\n *\n * The `TransferState` is available as an injectable token.\n * On the client, just inject this token using DI and use it, it will be lazily initialized.\n * On the server it's already included if `renderApplication` function is used. Otherwise, import\n * the `ServerTransferStateModule` module to make the `TransferState` available.\n *\n * The values in the store are serialized/deserialized using JSON.stringify/JSON.parse. So only\n * boolean, number, string, null and non-class objects will be serialized and deserialized in a\n * non-lossy manner.\n *\n * @publicApi\n */\nclass TransferState {\n /** @nocollapse */\n static ɵprov = /** @pureOrBreakMyCode */ /* @__PURE__ */__defineInjectable({\n token: TransferState,\n providedIn: 'root',\n factory: initTransferState\n });\n /** @internal */\n store = {};\n onSerializeCallbacks = {};\n /**\n * Get the value corresponding to a key. Return `defaultValue` if key is not found.\n */\n get(key, defaultValue) {\n return this.store[key] !== undefined ? this.store[key] : defaultValue;\n }\n /**\n * Set the value corresponding to a key.\n */\n set(key, value) {\n this.store[key] = value;\n }\n /**\n * Remove a key from the store.\n */\n remove(key) {\n delete this.store[key];\n }\n /**\n * Test whether a key exists in the store.\n */\n hasKey(key) {\n return this.store.hasOwnProperty(key);\n }\n /**\n * Indicates whether the state is empty.\n */\n get isEmpty() {\n return Object.keys(this.store).length === 0;\n }\n /**\n * Register a callback to provide the value for a key when `toJson` is called.\n */\n onSerialize(key, callback) {\n this.onSerializeCallbacks[key] = callback;\n }\n /**\n * Serialize the current state of the store to JSON.\n */\n toJson() {\n // Call the onSerialize callbacks and put those values into the store.\n for (const key in this.onSerializeCallbacks) {\n if (this.onSerializeCallbacks.hasOwnProperty(key)) {\n try {\n this.store[key] = this.onSerializeCallbacks[key]();\n } catch (e) {\n console.warn('Exception in onSerialize callback: ', e);\n }\n }\n }\n // Escape script tag to avoid break out of <script> tag in serialized output.\n // Encoding of `<` is the same behaviour as G3 script_builders.\n return JSON.stringify(this.store).replace(/</g, '\\\\u003C');\n }\n}\nfunction retrieveTransferredState(doc, appId) {\n // Locate the script tag with the JSON data transferred from the server.\n // The id of the script tag is set to the Angular appId + 'state'.\n const script = doc.getElementById(appId + '-state');\n if (script?.textContent) {\n try {\n // Avoid using any here as it triggers lint errors in google3 (any is not allowed).\n // Decoding of `<` is done of the box by browsers and node.js, same behaviour as G3\n // script_builders.\n return JSON.parse(script.textContent);\n } catch (e) {\n console.warn('Exception while restoring TransferState for app ' + appId, e);\n }\n }\n return {};\n}\n\n/** Encodes that the node lookup should start from the host node of this component. */\nconst REFERENCE_NODE_HOST = 'h';\n/** Encodes that the node lookup should start from the document body node. */\nconst REFERENCE_NODE_BODY = 'b';\nconst NODE_NAVIGATION_STEP_FIRST_CHILD = 'f';\nconst NODE_NAVIGATION_STEP_NEXT_SIBLING = 'n';\n/**\n * Keys within serialized view data structure to represent various\n * parts. See the `SerializedView` interface below for additional information.\n */\nconst ELEMENT_CONTAINERS = 'e';\nconst TEMPLATES = 't';\nconst CONTAINERS = 'c';\nconst MULTIPLIER = 'x';\nconst NUM_ROOT_NODES = 'r';\nconst TEMPLATE_ID = 'i'; // as it's also an \"id\"\nconst NODES = 'n';\nconst DISCONNECTED_NODES = 'd';\nconst I18N_DATA = 'l';\nconst DEFER_BLOCK_ID = 'di';\nconst DEFER_BLOCK_STATE$1 = 's';\nconst DEFER_PARENT_BLOCK_ID = 'p';\nconst DEFER_HYDRATE_TRIGGERS = 't';\n\n/**\n * Internal token that specifies whether DOM reuse logic\n * during hydration is enabled.\n */\nconst IS_HYDRATION_DOM_REUSE_ENABLED = new InjectionToken(typeof ngDevMode === 'undefined' || !!ngDevMode ? 'IS_HYDRATION_DOM_REUSE_ENABLED' : '');\n// By default (in client rendering mode), we remove all the contents\n// of the host element and render an application after that.\nconst PRESERVE_HOST_CONTENT_DEFAULT = false;\n/**\n * Internal token that indicates whether host element content should be\n * retained during the bootstrap.\n */\nconst PRESERVE_HOST_CONTENT = new InjectionToken(typeof ngDevMode === 'undefined' || !!ngDevMode ? 'PRESERVE_HOST_CONTENT' : '', {\n providedIn: 'root',\n factory: () => PRESERVE_HOST_CONTENT_DEFAULT\n});\n/**\n * Internal token that indicates whether hydration support for i18n\n * is enabled.\n */\nconst IS_I18N_HYDRATION_ENABLED = new InjectionToken(typeof ngDevMode === 'undefined' || !!ngDevMode ? 'IS_I18N_HYDRATION_ENABLED' : '');\n/**\n * Internal token that indicates whether event replay support for SSR\n * is enabled.\n */\nconst IS_EVENT_REPLAY_ENABLED = new InjectionToken(typeof ngDevMode === 'undefined' || !!ngDevMode ? 'IS_EVENT_REPLAY_ENABLED' : '');\nconst EVENT_REPLAY_ENABLED_DEFAULT = false;\n/**\n * Internal token that indicates whether incremental hydration support\n * is enabled.\n */\nconst IS_INCREMENTAL_HYDRATION_ENABLED = new InjectionToken(typeof ngDevMode === 'undefined' || !!ngDevMode ? 'IS_INCREMENTAL_HYDRATION_ENABLED' : '');\n/**\n * A map of DOM elements with `jsaction` attributes grouped by action names.\n */\nconst JSACTION_BLOCK_ELEMENT_MAP = new InjectionToken(ngDevMode ? 'JSACTION_BLOCK_ELEMENT_MAP' : '', {\n providedIn: 'root',\n factory: () => new Map()\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/** Configuration object used to register passive and capturing events. */\nconst eventListenerOptions = {\n passive: true,\n capture: true\n};\n/** Keeps track of the currently-registered `on hover` triggers. */\nconst hoverTriggers = new WeakMap();\n/** Keeps track of the currently-registered `on interaction` triggers. */\nconst interactionTriggers = new WeakMap();\n/** Currently-registered `viewport` triggers. */\nconst viewportTriggers = new WeakMap();\n/** Names of the events considered as interaction events. */\nconst interactionEventNames = ['click', 'keydown'];\n/** Names of the events considered as hover events. */\nconst hoverEventNames = ['mouseenter', 'mouseover', 'focusin'];\n/** `IntersectionObserver` used to observe `viewport` triggers. */\nlet intersectionObserver = null;\n/** Number of elements currently observed with `viewport` triggers. */\nlet observedViewportElements = 0;\n/** Object keeping track of registered callbacks for a deferred block trigger. */\nclass DeferEventEntry {\n callbacks = new Set();\n listener = () => {\n for (const callback of this.callbacks) {\n callback();\n }\n };\n}\n/**\n * Registers an interaction trigger.\n * @param trigger Element that is the trigger.\n * @param callback Callback to be invoked when the trigger is interacted with.\n * @return cleanup function which removes trigger Element from interactionTriggers map\n * and interaction event listeners from the trigger Element\n */\nfunction onInteraction(trigger, callback) {\n let entry = interactionTriggers.get(trigger);\n // If this is the first entry for this element, add the listeners.\n if (!entry) {\n // Note that managing events centrally like this lends itself well to using global\n // event delegation. It currently does delegation at the element level, rather than the\n // document level, because:\n // 1. Global delegation is the most effective when there are a lot of events being registered\n // at the same time. Deferred blocks are unlikely to be used in such a way.\n // 2. Matching events to their target isn't free. For each `click` and `keydown` event we\n // would have look through all the triggers and check if the target either is the element\n // itself or it's contained within the element. Given that `click` and `keydown` are some\n // of the most common events, this may end up introducing a lot of runtime overhead.\n // 3. We're still registering only two events per element, no matter how many deferred blocks\n // are referencing it.\n entry = new DeferEventEntry();\n interactionTriggers.set(trigger, entry);\n for (const name of interactionEventNames) {\n trigger.addEventListener(name, entry.listener, eventListenerOptions);\n }\n }\n entry.callbacks.add(callback);\n return () => {\n const {\n callbacks,\n listener\n } = entry;\n callbacks.delete(callback);\n if (callbacks.size === 0) {\n interactionTriggers.delete(trigger);\n for (const name of interactionEventNames) {\n trigger.removeEventListener(name, listener, eventListenerOptions);\n }\n }\n };\n}\n/**\n * Registers a hover trigger.\n * @param trigger Element that is the trigger.\n * @param callback Callback to be invoked when the trigger is hovered over.\n * @return cleanup function which removes trigger element from hoverTriggers map\n * and removes hover interaction event listeners from the trigger element\n */\nfunction onHover(trigger, callback) {\n let entry = hoverTriggers.get(trigger);\n // If this is the first entry for this element, add the listener.\n if (!entry) {\n entry = new DeferEventEntry();\n hoverTriggers.set(trigger, entry);\n for (const name of hoverEventNames) {\n trigger.addEventListener(name, entry.listener, eventListenerOptions);\n }\n }\n entry.callbacks.add(callback);\n return () => {\n const {\n callbacks,\n listener\n } = entry;\n callbacks.delete(callback);\n if (callbacks.size === 0) {\n for (const name of hoverEventNames) {\n trigger.removeEventListener(name, listener, eventListenerOptions);\n }\n hoverTriggers.delete(trigger);\n }\n };\n}\n/**\n * Used to create an IntersectionObserver instance.\n * @return IntersectionObserver that is used by onViewport\n */\nfunction createIntersectionObserver() {\n return new IntersectionObserver(entries => {\n for (const current of entries) {\n if (current.isIntersecting && viewportTriggers.has(current.target)) {\n viewportTriggers.get(current.target).listener();\n }\n }\n });\n}\n/**\n * Registers a viewport trigger.\n * @param trigger Element that is the trigger.\n * @param callback Callback to be invoked when the trigger comes into the viewport.\n * @param observerFactoryFn Factory function which returns an IntersectionObserver\n * @return cleanup function which removes trigger Element from viewportTriggers map\n * and tells the intersection observer to stop observing trigger Element and set\n * intersectionObserver to null if there are no more Elements to observe\n */\nfunction onViewport(trigger, callback, observerFactoryFn) {\n let entry = viewportTriggers.get(trigger);\n intersectionObserver = intersectionObserver || observerFactoryFn();\n if (!entry) {\n entry = new DeferEventEntry();\n intersectionObserver.observe(trigger);\n viewportTriggers.set(trigger, entry);\n observedViewportElements++;\n }\n entry.callbacks.add(callback);\n return () => {\n if (!viewportTriggers.has(trigger)) {\n return;\n }\n entry.callbacks.delete(callback);\n if (entry.callbacks.size === 0) {\n intersectionObserver?.unobserve(trigger);\n viewportTriggers.delete(trigger);\n observedViewportElements--;\n }\n if (observedViewportElements === 0) {\n intersectionObserver?.disconnect();\n intersectionObserver = null;\n }\n };\n}\nconst DEFER_BLOCK_SSR_ID_ATTRIBUTE = 'ngb';\nfunction setJSActionAttributes(nativeElement, eventTypes, parentDeferBlockId = null) {\n // jsaction attributes specifically should be applied to elements and not comment nodes.\n // Comment nodes also have no setAttribute function. So this avoids errors.\n if (eventTypes.length === 0 || nativeElement.nodeType !== Node.ELEMENT_NODE) {\n return;\n }\n const existingAttr = nativeElement.getAttribute(Attribute$1.JSACTION);\n // we dedupe cases where hydrate triggers are used as it's possible that\n // someone may have added an event binding to the root node that matches what the\n // hydrate trigger adds.\n const parts = eventTypes.reduce((prev, curr) => {\n // if there is no existing attribute OR it's not in the existing one, we need to add it\n return (existingAttr?.indexOf(curr) ?? -1) === -1 ? prev + curr + ':;' : prev;\n }, '');\n // This is required to be a module accessor to appease security tests on setAttribute.\n nativeElement.setAttribute(Attribute$1.JSACTION, `${existingAttr ?? ''}${parts}`);\n const blockName = parentDeferBlockId ?? '';\n if (blockName !== '' && parts.length > 0) {\n nativeElement.setAttribute(DEFER_BLOCK_SSR_ID_ATTRIBUTE, blockName);\n }\n}\nconst sharedStashFunction = (rEl, eventType, listenerFn) => {\n const el = rEl;\n const eventListenerMap = el.__jsaction_fns ?? new Map();\n const eventListeners = eventListenerMap.get(eventType) ?? [];\n eventListeners.push(listenerFn);\n eventListenerMap.set(eventType, eventListeners);\n el.__jsaction_fns = eventListenerMap;\n};\nconst sharedMapFunction = (rEl, jsActionMap) => {\n const el = rEl;\n let blockName = el.getAttribute(DEFER_BLOCK_SSR_ID_ATTRIBUTE) ?? '';\n const blockSet = jsActionMap.get(blockName) ?? new Set();\n if (!blockSet.has(el)) {\n blockSet.add(el);\n }\n jsActionMap.set(blockName, blockSet);\n};\nfunction removeListenersFromBlocks(blockNames, jsActionMap) {\n if (blockNames.length > 0) {\n let blockList = [];\n for (let blockName of blockNames) {\n if (jsActionMap.has(blockName)) {\n blockList = [...blockList, ...jsActionMap.get(blockName)];\n }\n }\n const replayList = new Set(blockList);\n replayList.forEach(removeListeners);\n }\n}\nconst removeListeners = el => {\n el.removeAttribute(Attribute$1.JSACTION);\n el.removeAttribute(DEFER_BLOCK_SSR_ID_ATTRIBUTE);\n el.__jsaction_fns = undefined;\n};\nconst JSACTION_EVENT_CONTRACT = new InjectionToken(ngDevMode ? 'EVENT_CONTRACT_DETAILS' : '', {\n providedIn: 'root',\n factory: () => ({})\n});\nfunction invokeListeners(event, currentTarget) {\n const handlerFns = currentTarget?.__jsaction_fns?.get(event.type);\n if (!handlerFns || !currentTarget?.isConnected) {\n return;\n }\n for (const handler of handlerFns) {\n handler(event);\n }\n}\nconst stashEventListeners = new Map();\n/**\n * Registers a stashing function for a specific application ID.\n *\n * @param appId The unique identifier for the application instance.\n * @param fn The stashing function to associate with this app ID.\n * @returns A cleanup function that removes the stashing function when called.\n */\nfunction setStashFn(appId, fn) {\n stashEventListeners.set(appId, fn);\n return () => stashEventListeners.delete(appId);\n}\n/**\n * Indicates whether the stashing code was added, prevents adding it multiple times.\n */\nlet isStashEventListenerImplEnabled = false;\nlet _stashEventListenerImpl = (lView, target, eventName, wrappedListener) => {};\n/**\n * Optionally stashes an event listener for later replay during hydration.\n *\n * This function delegates to an internal `_stashEventListenerImpl`, which may\n * be a no-op unless the event replay feature is enabled. When active, this\n * allows capturing event listener metadata before hydration completes, so that\n * user interactions during SSR can be replayed.\n *\n * @param lView The logical view (LView) where the listener is being registered.\n * @param target The DOM element or event target the listener is attached to.\n * @param eventName The name of the event being listened for (e.g., 'click').\n * @param wrappedListener The event handler that was registered.\n */\nfunction stashEventListenerImpl(lView, target, eventName, wrappedListener) {\n _stashEventListenerImpl(lView, target, eventName, wrappedListener);\n}\n/**\n * Enables the event listener stashing logic in a tree-shakable way.\n *\n * This function lazily sets the implementation of `_stashEventListenerImpl`\n * so that it becomes active only when `withEventReplay` is invoked. This ensures\n * that the stashing logic is excluded from production builds unless needed.\n */\nfunction enableStashEventListenerImpl() {\n if (!isStashEventListenerImplEnabled) {\n _stashEventListenerImpl = (lView, target, eventName, wrappedListener) => {\n const appId = lView[INJECTOR].get(APP_ID);\n const stashEventListener = stashEventListeners.get(appId);\n stashEventListener?.(target, eventName, wrappedListener);\n };\n isStashEventListenerImplEnabled = true;\n }\n}\n\n/**\n * An internal injection token to reference `DehydratedBlockRegistry` implementation\n * in a tree-shakable way.\n */\nconst DEHYDRATED_BLOCK_REGISTRY = new InjectionToken(ngDevMode ? 'DEHYDRATED_BLOCK_REGISTRY' : '');\n/**\n * The DehydratedBlockRegistry is used for incremental hydration purposes. It keeps\n * track of the Defer Blocks that need hydration so we can effectively\n * navigate up to the top dehydrated defer block and fire appropriate cleanup\n * functions post hydration.\n */\nclass DehydratedBlockRegistry {\n registry = new Map();\n cleanupFns = new Map();\n jsActionMap = inject(JSACTION_BLOCK_ELEMENT_MAP);\n contract = inject(JSACTION_EVENT_CONTRACT);\n add(blockId, info) {\n this.registry.set(blockId, info);\n // It's possible that hydration is queued that's waiting for the\n // resolution of a lazy loaded route. In this case, we ensure\n // the callback function is called to continue the hydration process\n // for the queued block set.\n if (this.awaitingCallbacks.has(blockId)) {\n const awaitingCallbacks = this.awaitingCallbacks.get(blockId);\n for (const cb of awaitingCallbacks) {\n cb();\n }\n }\n }\n get(blockId) {\n return this.registry.get(blockId) ?? null;\n }\n has(blockId) {\n return this.registry.has(blockId);\n }\n cleanup(hydratedBlocks) {\n removeListenersFromBlocks(hydratedBlocks, this.jsActionMap);\n for (let blockId of hydratedBlocks) {\n this.registry.delete(blockId);\n this.jsActionMap.delete(blockId);\n this.invokeTriggerCleanupFns(blockId);\n this.hydrating.delete(blockId);\n this.awaitingCallbacks.delete(blockId);\n }\n if (this.size === 0) {\n this.contract.instance?.cleanUp();\n }\n }\n get size() {\n return this.registry.size;\n }\n // we have to leave the lowest block Id in the registry\n // unless that block has no children\n addCleanupFn(blockId, fn) {\n let cleanupFunctions = [];\n if (this.cleanupFns.has(blockId)) {\n cleanupFunctions = this.cleanupFns.get(blockId);\n }\n cleanupFunctions.push(fn);\n this.cleanupFns.set(blockId, cleanupFunctions);\n }\n invokeTriggerCleanupFns(blockId) {\n const fns = this.cleanupFns.get(blockId) ?? [];\n for (let fn of fns) {\n fn();\n }\n this.cleanupFns.delete(blockId);\n }\n // Blocks that are being hydrated.\n hydrating = new Map();\n // Blocks that are awaiting a defer instruction finish.\n awaitingCallbacks = new Map();\n awaitParentBlock(topmostParentBlock, callback) {\n const parentBlockAwaitCallbacks = this.awaitingCallbacks.get(topmostParentBlock) ?? [];\n parentBlockAwaitCallbacks.push(callback);\n this.awaitingCallbacks.set(topmostParentBlock, parentBlockAwaitCallbacks);\n }\n /** @nocollapse */\n static ɵprov = /** @pureOrBreakMyCode */ /* @__PURE__ */__defineInjectable({\n token: DehydratedBlockRegistry,\n providedIn: null,\n factory: () => new DehydratedBlockRegistry()\n });\n}\n\n/**\n * Checks whether a TNode is considered detached, i.e. not present in the\n * translated i18n template. We should not attempt hydration for such nodes\n * and instead, use a regular \"creation mode\".\n */\nfunction isDetachedByI18n(tNode) {\n return (tNode.flags & 32 /* TNodeFlags.isDetached */) === 32 /* TNodeFlags.isDetached */;\n}\n\n/**\n * The name of the key used in the TransferState collection,\n * where hydration information is located.\n */\nconst TRANSFER_STATE_TOKEN_ID = '__nghData__';\n/**\n * Lookup key used to reference DOM hydration data (ngh) in `TransferState`.\n */\nconst NGH_DATA_KEY = makeStateKey(TRANSFER_STATE_TOKEN_ID);\n/**\n * The name of the key used in the TransferState collection,\n * where serialized defer block information is located.\n */\nconst TRANSFER_STATE_DEFER_BLOCKS_INFO = '__nghDeferData__';\n/**\n * Lookup key used to retrieve defer block datain `TransferState`.\n */\nconst NGH_DEFER_BLOCKS_KEY = makeStateKey(TRANSFER_STATE_DEFER_BLOCKS_INFO);\n/**\n * Checks whether a given key is used by the framework for transferring hydration data.\n */\nfunction isInternalHydrationTransferStateKey(key) {\n return key === TRANSFER_STATE_TOKEN_ID || key === TRANSFER_STATE_DEFER_BLOCKS_INFO;\n}\n/**\n * The name of the attribute that would be added to host component\n * nodes and contain a reference to a particular slot in transferred\n * state that contains the necessary hydration info for this component.\n */\nconst NGH_ATTR_NAME = 'ngh';\n/**\n * Marker used in a comment node to ensure hydration content integrity\n */\nconst SSR_CONTENT_INTEGRITY_MARKER = 'nghm';\n/**\n * Reference to a function that reads `ngh` attribute value from a given RNode\n * and retrieves hydration information from the TransferState using that value\n * as an index. Returns `null` by default, when hydration is not enabled.\n *\n * @param rNode Component's host element.\n * @param injector Injector that this component has access to.\n * @param isRootView Specifies whether we trying to read hydration info for the root view.\n */\nlet _retrieveHydrationInfoImpl = () => null;\nfunction retrieveHydrationInfoImpl(rNode, injector, isRootView = false) {\n let nghAttrValue = rNode.getAttribute(NGH_ATTR_NAME);\n if (nghAttrValue == null) return null;\n // For cases when a root component also acts as an anchor node for a ViewContainerRef\n // (for example, when ViewContainerRef is injected in a root component), there is a need\n // to serialize information about the component itself, as well as an LContainer that\n // represents this ViewContainerRef. Effectively, we need to serialize 2 pieces of info:\n // (1) hydration info for the root component itself and (2) hydration info for the\n // ViewContainerRef instance (an LContainer). Each piece of information is included into\n // the hydration data (in the TransferState object) separately, thus we end up with 2 ids.\n // Since we only have 1 root element, we encode both bits of info into a single string:\n // ids are separated by the `|` char (e.g. `10|25`, where `10` is the ngh for a component view\n // and 25 is the `ngh` for a root view which holds LContainer).\n const [componentViewNgh, rootViewNgh] = nghAttrValue.split('|');\n nghAttrValue = isRootView ? rootViewNgh : componentViewNgh;\n if (!nghAttrValue) return null;\n // We've read one of the ngh ids, keep the remaining one, so that\n // we can set it back on the DOM element.\n const rootNgh = rootViewNgh ? `|${rootViewNgh}` : '';\n const remainingNgh = isRootView ? componentViewNgh : rootNgh;\n let data = {};\n // An element might have an empty `ngh` attribute value (e.g. `<comp ngh=\"\" />`),\n // which means that no special annotations are required. Do not attempt to read\n // from the TransferState in this case.\n if (nghAttrValue !== '') {\n const transferState = injector.get(TransferState, null, {\n optional: true\n });\n if (transferState !== null) {\n const nghData = transferState.get(NGH_DATA_KEY, []);\n // The nghAttrValue is always a number referencing an index\n // in the hydration TransferState data.\n data = nghData[Number(nghAttrValue)];\n // If the `ngh` attribute exists and has a non-empty value,\n // the hydration info *must* be present in the TransferState.\n // If there is no data for some reasons, this is an error.\n ngDevMode && assertDefined(data, 'Unable to retrieve hydration info from the TransferState.');\n }\n }\n const dehydratedView = {\n data,\n firstChild: rNode.firstChild ?? null\n };\n if (isRootView) {\n // If there is hydration info present for the root view, it means that there was\n // a ViewContainerRef injected in the root component. The root component host element\n // acted as an anchor node in this scenario. As a result, the DOM nodes that represent\n // embedded views in this ViewContainerRef are located as siblings to the host node,\n // i.e. `<app-root /><#VIEW1><#VIEW2>...<!--container-->`. In this case, the current\n // node becomes the first child of this root view and the next sibling is the first\n // element in the DOM segment.\n dehydratedView.firstChild = rNode;\n // We use `0` here, since this is the slot (right after the HEADER_OFFSET)\n // where a component LView or an LContainer is located in a root LView.\n setSegmentHead(dehydratedView, 0, rNode.nextSibling);\n }\n if (remainingNgh) {\n // If we have only used one of the ngh ids, store the remaining one\n // back on this RNode.\n rNode.setAttribute(NGH_ATTR_NAME, remainingNgh);\n } else {\n // The `ngh` attribute is cleared from the DOM node now\n // that the data has been retrieved for all indices.\n rNode.removeAttribute(NGH_ATTR_NAME);\n }\n // Note: don't check whether this node was claimed for hydration,\n // because this node might've been previously claimed while processing\n // template instructions.\n ngDevMode && markRNodeAsClaimedByHydration(rNode, /* checkIfAlreadyClaimed */false);\n ngDevMode && ngDevMode.hydratedComponents++;\n return dehydratedView;\n}\n/**\n * Sets the implementation for the `retrieveHydrationInfo` function.\n */\nfunction enableRetrieveHydrationInfoImpl() {\n _retrieveHydrationInfoImpl = retrieveHydrationInfoImpl;\n}\n/**\n * Retrieves hydration info by reading the value from the `ngh` attribute\n * and accessing a corresponding slot in TransferState storage.\n */\nfunction retrieveHydrationInfo(rNode, injector, isRootView = false) {\n return _retrieveHydrationInfoImpl(rNode, injector, isRootView);\n}\n/**\n * Retrieves the necessary object from a given ViewRef to serialize:\n * - an LView for component views\n * - an LContainer for cases when component acts as a ViewContainerRef anchor\n * - `null` in case of an embedded view\n */\nfunction getLNodeForHydration(viewRef) {\n // Reading an internal field from `ViewRef` instance.\n let lView = viewRef._lView;\n const tView = lView[TVIEW];\n // A registered ViewRef might represent an instance of an\n // embedded view, in which case we do not need to annotate it.\n if (tView.type === 2 /* TViewType.Embedded */) {\n return null;\n }\n // Check if it's a root view and if so, retrieve component's\n // LView from the first slot after the header.\n if (isRootView(lView)) {\n lView = lView[HEADER_OFFSET];\n }\n return lView;\n}\nfunction getTextNodeContent(node) {\n return node.textContent?.replace(/\\s/gm, '');\n}\n/**\n * Restores text nodes and separators into the DOM that were lost during SSR\n * serialization. The hydration process replaces empty text nodes and text\n * nodes that are immediately adjacent to other text nodes with comment nodes\n * that this method filters on to restore those missing nodes that the\n * hydration process is expecting to be present.\n *\n * @param node The app's root HTML Element\n */\nfunction processTextNodeMarkersBeforeHydration(node) {\n const doc = getDocument();\n const commentNodesIterator = doc.createNodeIterator(node, NodeFilter.SHOW_COMMENT, {\n acceptNode(node) {\n const content = getTextNodeContent(node);\n const isTextNodeMarker = content === \"ngetn\" /* TextNodeMarker.EmptyNode */ || content === \"ngtns\" /* TextNodeMarker.Separator */;\n return isTextNodeMarker ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_REJECT;\n }\n });\n let currentNode;\n // We cannot modify the DOM while using the commentIterator,\n // because it throws off the iterator state.\n // So we collect all marker nodes first and then follow up with\n // applying the changes to the DOM: either inserting an empty node\n // or just removing the marker if it was used as a separator.\n const nodes = [];\n while (currentNode = commentNodesIterator.nextNode()) {\n nodes.push(currentNode);\n }\n for (const node of nodes) {\n if (node.textContent === \"ngetn\" /* TextNodeMarker.EmptyNode */) {\n node.replaceWith(doc.createTextNode(''));\n } else {\n node.remove();\n }\n }\n}\n/**\n * Internal type that represents a claimed node.\n * Only used in dev mode.\n */\nvar HydrationStatus;\n(function (HydrationStatus) {\n HydrationStatus[\"Hydrated\"] = \"hydrated\";\n HydrationStatus[\"Skipped\"] = \"skipped\";\n HydrationStatus[\"Mismatched\"] = \"mismatched\";\n})(HydrationStatus || (HydrationStatus = {}));\nconst HYDRATION_INFO_KEY = '__ngDebugHydrationInfo__';\nfunction patchHydrationInfo(node, info) {\n node[HYDRATION_INFO_KEY] = info;\n}\nfunction readHydrationInfo(node) {\n return node[HYDRATION_INFO_KEY] ?? null;\n}\n/**\n * Marks a node as \"claimed\" by hydration process.\n * This is needed to make assessments in tests whether\n * the hydration process handled all nodes.\n */\nfunction markRNodeAsClaimedByHydration(node, checkIfAlreadyClaimed = true) {\n if (!ngDevMode) {\n throw new Error('Calling `markRNodeAsClaimedByHydration` in prod mode ' + 'is not supported and likely a mistake.');\n }\n if (checkIfAlreadyClaimed && isRNodeClaimedForHydration(node)) {\n throw new Error('Trying to claim a node, which was claimed already.');\n }\n patchHydrationInfo(node, {\n status: HydrationStatus.Hydrated\n });\n ngDevMode.hydratedNodes++;\n}\nfunction markRNodeAsSkippedByHydration(node) {\n if (!ngDevMode) {\n throw new Error('Calling `markRNodeAsSkippedByHydration` in prod mode ' + 'is not supported and likely a mistake.');\n }\n patchHydrationInfo(node, {\n status: HydrationStatus.Skipped\n });\n ngDevMode.componentsSkippedHydration++;\n}\nfunction countBlocksSkippedByHydration(injector) {\n const transferState = injector.get(TransferState);\n const nghDeferData = transferState.get(NGH_DEFER_BLOCKS_KEY, {});\n if (ngDevMode) {\n ngDevMode.deferBlocksWithIncrementalHydration = Object.keys(nghDeferData).length;\n }\n}\nfunction markRNodeAsHavingHydrationMismatch(node, expectedNodeDetails = null, actualNodeDetails = null) {\n if (!ngDevMode) {\n throw new Error('Calling `markRNodeAsMismatchedByHydration` in prod mode ' + 'is not supported and likely a mistake.');\n }\n // The RNode can be a standard HTMLElement (not an Angular component or directive)\n // The devtools component tree only displays Angular components & directives\n // Therefore we attach the debug info to the closest component/directive\n while (node && !getComponent(node)) {\n node = node?.parentNode;\n }\n if (node) {\n patchHydrationInfo(node, {\n status: HydrationStatus.Mismatched,\n expectedNodeDetails,\n actualNodeDetails\n });\n }\n}\nfunction isRNodeClaimedForHydration(node) {\n return readHydrationInfo(node)?.status === HydrationStatus.Hydrated;\n}\nfunction setSegmentHead(hydrationInfo, index, node) {\n hydrationInfo.segmentHeads ??= {};\n hydrationInfo.segmentHeads[index] = node;\n}\nfunction getSegmentHead(hydrationInfo, index) {\n return hydrationInfo.segmentHeads?.[index] ?? null;\n}\nfunction isIncrementalHydrationEnabled(injector) {\n return injector.get(IS_INCREMENTAL_HYDRATION_ENABLED, false, {\n optional: true\n });\n}\n/** Throws an error if the incremental hydration is not enabled */\nfunction assertIncrementalHydrationIsConfigured(injector) {\n if (!isIncrementalHydrationEnabled(injector)) {\n throw new RuntimeError(508 /* RuntimeErrorCode.MISCONFIGURED_INCREMENTAL_HYDRATION */, 'Angular has detected that some `@defer` blocks use `hydrate` triggers, ' + 'but incremental hydration was not enabled. Please ensure that the `withIncrementalHydration()` ' + 'call is added as an argument for the `provideClientHydration()` function call ' + 'in your application config.');\n }\n}\n/** Throws an error if the ssrUniqueId on the LDeferBlockDetails is not present */\nfunction assertSsrIdDefined(ssrUniqueId) {\n assertDefined(ssrUniqueId, 'Internal error: expecting an SSR id for a defer block that should be hydrated, but the id is not present');\n}\n/**\n * Returns the size of an <ng-container>, using either the information\n * serialized in `ELEMENT_CONTAINERS` (element container size) or by\n * computing the sum of root nodes in all dehydrated views in a given\n * container (in case this `<ng-container>` was also used as a view\n * container host node, e.g. <ng-container *ngIf>).\n */\nfunction getNgContainerSize(hydrationInfo, index) {\n const data = hydrationInfo.data;\n let size = data[ELEMENT_CONTAINERS]?.[index] ?? null;\n // If there is no serialized information available in the `ELEMENT_CONTAINERS` slot,\n // check if we have info about view containers at this location (e.g.\n // `<ng-container *ngIf>`) and use container size as a number of root nodes in this\n // element container.\n if (size === null && data[CONTAINERS]?.[index]) {\n size = calcSerializedContainerSize(hydrationInfo, index);\n }\n return size;\n}\nfunction isSerializedElementContainer(hydrationInfo, index) {\n return hydrationInfo.data[ELEMENT_CONTAINERS]?.[index] !== undefined;\n}\nfunction getSerializedContainerViews(hydrationInfo, index) {\n return hydrationInfo.data[CONTAINERS]?.[index] ?? null;\n}\n/**\n * Computes the size of a serialized container (the number of root nodes)\n * by calculating the sum of root nodes in all dehydrated views in this container.\n */\nfunction calcSerializedContainerSize(hydrationInfo, index) {\n const views = getSerializedContainerViews(hydrationInfo, index) ?? [];\n let numNodes = 0;\n for (let view of views) {\n numNodes += view[NUM_ROOT_NODES] * (view[MULTIPLIER] ?? 1);\n }\n return numNodes;\n}\n/**\n * Attempt to initialize the `disconnectedNodes` field of the given\n * `DehydratedView`. Returns the initialized value.\n */\nfunction initDisconnectedNodes(hydrationInfo) {\n // Check if we are processing disconnected info for the first time.\n if (typeof hydrationInfo.disconnectedNodes === 'undefined') {\n const nodeIds = hydrationInfo.data[DISCONNECTED_NODES];\n hydrationInfo.disconnectedNodes = nodeIds ? new Set(nodeIds) : null;\n }\n return hydrationInfo.disconnectedNodes;\n}\n/**\n * Checks whether a node is annotated as \"disconnected\", i.e. not present\n * in the DOM at serialization time. We should not attempt hydration for\n * such nodes and instead, use a regular \"creation mode\".\n */\nfunction isDisconnectedNode$1(hydrationInfo, index) {\n // Check if we are processing disconnected info for the first time.\n if (typeof hydrationInfo.disconnectedNodes === 'undefined') {\n const nodeIds = hydrationInfo.data[DISCONNECTED_NODES];\n hydrationInfo.disconnectedNodes = nodeIds ? new Set(nodeIds) : null;\n }\n return !!initDisconnectedNodes(hydrationInfo)?.has(index);\n}\n/**\n * Checks whether a node can be hydrated.\n * @param lView View in which the node instance is placed.\n * @param tNode Node to be checked.\n */\nfunction canHydrateNode(lView, tNode) {\n const hydrationInfo = lView[HYDRATION];\n return hydrationInfo !== null && !isInSkipHydrationBlock$1() && !isDetachedByI18n(tNode) && !isDisconnectedNode$1(hydrationInfo, tNode.index - HEADER_OFFSET);\n}\n/**\n * Helper function to prepare text nodes for serialization by ensuring\n * that seperate logical text blocks in the DOM remain separate after\n * serialization.\n */\nfunction processTextNodeBeforeSerialization(context, node) {\n // Handle cases where text nodes can be lost after DOM serialization:\n // 1. When there is an *empty text node* in DOM: in this case, this\n // node would not make it into the serialized string and as a result,\n // this node wouldn't be created in a browser. This would result in\n // a mismatch during the hydration, where the runtime logic would expect\n // a text node to be present in live DOM, but no text node would exist.\n // Example: `<span>{{ name }}</span>` when the `name` is an empty string.\n // This would result in `<span></span>` string after serialization and\n // in a browser only the `span` element would be created. To resolve that,\n // an extra comment node is appended in place of an empty text node and\n // that special comment node is replaced with an empty text node *before*\n // hydration.\n // 2. When there are 2 consecutive text nodes present in the DOM.\n // Example: `<div>Hello <ng-container *ngIf=\"true\">world</ng-container></div>`.\n // In this scenario, the live DOM would look like this:\n // <div>#text('Hello ') #text('world') #comment('container')</div>\n // Serialized string would look like this: `<div>Hello world<!--container--></div>`.\n // The live DOM in a browser after that would be:\n // <div>#text('Hello world') #comment('container')</div>\n // Notice how 2 text nodes are now \"merged\" into one. This would cause hydration\n // logic to fail, since it'd expect 2 text nodes being present, not one.\n // To fix this, we insert a special comment node in between those text nodes, so\n // serialized representation is: `<div>Hello <!--ngtns-->world<!--container--></div>`.\n // This forces browser to create 2 text nodes separated by a comment node.\n // Before running a hydration process, this special comment node is removed, so the\n // live DOM has exactly the same state as it was before serialization.\n // Collect this node as required special annotation only when its\n // contents is empty. Otherwise, such text node would be present on\n // the client after server-side rendering and no special handling needed.\n const el = node;\n const corruptedTextNodes = context.corruptedTextNodes;\n if (el.textContent === '') {\n corruptedTextNodes.set(el, \"ngetn\" /* TextNodeMarker.EmptyNode */);\n } else if (el.nextSibling?.nodeType === Node.TEXT_NODE) {\n corruptedTextNodes.set(el, \"ngtns\" /* TextNodeMarker.Separator */);\n }\n}\nfunction convertHydrateTriggersToJsAction(triggers) {\n let actionList = [];\n if (triggers !== null) {\n if (triggers.has(4 /* DeferBlockTrigger.Hover */)) {\n actionList.push(...hoverEventNames);\n }\n if (triggers.has(3 /* DeferBlockTrigger.Interaction */)) {\n actionList.push(...interactionEventNames);\n }\n }\n return actionList;\n}\n/**\n * Builds a queue of blocks that need to be hydrated, looking up the\n * tree to the topmost defer block that exists in the tree that hasn't\n * been hydrated, but exists in the registry. This queue is in top down\n * hierarchical order as a list of defer block ids.\n * Note: This is utilizing serialized information to navigate up the tree\n */\nfunction getParentBlockHydrationQueue(deferBlockId, injector) {\n const dehydratedBlockRegistry = injector.get(DEHYDRATED_BLOCK_REGISTRY);\n const transferState = injector.get(TransferState);\n const deferBlockParents = transferState.get(NGH_DEFER_BLOCKS_KEY, {});\n let isTopMostDeferBlock = false;\n let currentBlockId = deferBlockId;\n let parentBlockPromise = null;\n const hydrationQueue = [];\n while (!isTopMostDeferBlock && currentBlockId) {\n ngDevMode && assertEqual(hydrationQueue.indexOf(currentBlockId), -1, 'Internal error: defer block hierarchy has a cycle.');\n isTopMostDeferBlock = dehydratedBlockRegistry.has(currentBlockId);\n const hydratingParentBlock = dehydratedBlockRegistry.hydrating.get(currentBlockId);\n if (parentBlockPromise === null && hydratingParentBlock != null) {\n parentBlockPromise = hydratingParentBlock.promise;\n break;\n }\n hydrationQueue.unshift(currentBlockId);\n currentBlockId = deferBlockParents[currentBlockId][DEFER_PARENT_BLOCK_ID];\n }\n return {\n parentBlockPromise,\n hydrationQueue\n };\n}\nfunction gatherDeferBlocksByJSActionAttribute(doc) {\n const jsactionNodes = doc.body.querySelectorAll('[jsaction]');\n const blockMap = new Set();\n const eventTypes = [hoverEventNames.join(':;'), interactionEventNames.join(':;')].join('|');\n for (let node of jsactionNodes) {\n const attr = node.getAttribute('jsaction');\n const blockId = node.getAttribute('ngb');\n if (attr?.match(eventTypes) && blockId !== null) {\n blockMap.add(node);\n }\n }\n return blockMap;\n}\nfunction appendDeferBlocksToJSActionMap(doc, injector) {\n const blockMap = gatherDeferBlocksByJSActionAttribute(doc);\n const jsActionMap = injector.get(JSACTION_BLOCK_ELEMENT_MAP);\n for (let rNode of blockMap) {\n sharedMapFunction(rNode, jsActionMap);\n }\n}\n/**\n * Retrieves defer block hydration information from the TransferState.\n *\n * @param injector Injector that this component has access to.\n */\nlet _retrieveDeferBlockDataImpl = () => {\n return {};\n};\nfunction retrieveDeferBlockDataImpl(injector) {\n const transferState = injector.get(TransferState, null, {\n optional: true\n });\n if (transferState !== null) {\n const nghDeferData = transferState.get(NGH_DEFER_BLOCKS_KEY, {});\n ngDevMode && assertDefined(nghDeferData, 'Unable to retrieve defer block info from the TransferState.');\n return nghDeferData;\n }\n return {};\n}\n/**\n * Sets the implementation for the `retrieveDeferBlockData` function.\n */\nfunction enableRetrieveDeferBlockDataImpl() {\n _retrieveDeferBlockDataImpl = retrieveDeferBlockDataImpl;\n}\n/**\n * Retrieves defer block data from TransferState storage\n */\nfunction retrieveDeferBlockData(injector) {\n return _retrieveDeferBlockDataImpl(injector);\n}\nfunction isTimerTrigger(triggerInfo) {\n return typeof triggerInfo === 'object' && triggerInfo.trigger === 5 /* DeferBlockTrigger.Timer */;\n}\nfunction getHydrateTimerTrigger(blockData) {\n const trigger = blockData[DEFER_HYDRATE_TRIGGERS]?.find(t => isTimerTrigger(t));\n return trigger?.delay ?? null;\n}\nfunction hasHydrateTrigger(blockData, trigger) {\n return blockData[DEFER_HYDRATE_TRIGGERS]?.includes(trigger) ?? false;\n}\n/**\n * Creates a summary of the given serialized defer block, which is used later to properly initialize\n * specific triggers.\n */\nfunction createBlockSummary(blockInfo) {\n return {\n data: blockInfo,\n hydrate: {\n idle: hasHydrateTrigger(blockInfo, 0 /* DeferBlockTrigger.Idle */),\n immediate: hasHydrateTrigger(blockInfo, 1 /* DeferBlockTrigger.Immediate */),\n timer: getHydrateTimerTrigger(blockInfo),\n viewport: hasHydrateTrigger(blockInfo, 2 /* DeferBlockTrigger.Viewport */)\n }\n };\n}\n/**\n * Processes all of the defer block data in the transfer state and creates a map of the summaries\n */\nfunction processBlockData(injector) {\n const blockData = retrieveDeferBlockData(injector);\n let blockDetails = new Map();\n for (let blockId in blockData) {\n blockDetails.set(blockId, createBlockSummary(blockData[blockId]));\n }\n return blockDetails;\n}\nfunction isSsrContentsIntegrity(node) {\n return !!node && node.nodeType === Node.COMMENT_NODE && node.textContent?.trim() === SSR_CONTENT_INTEGRITY_MARKER;\n}\nfunction skipTextNodes(node) {\n // Ignore whitespace. Before the <body>, we shouldn't find text nodes that aren't whitespace.\n while (node && node.nodeType === Node.TEXT_NODE) {\n node = node.previousSibling;\n }\n return node;\n}\n/**\n * Verifies whether the DOM contains a special marker added during SSR time to make sure\n * there is no SSR'ed contents transformations happen after SSR is completed. Typically that\n * happens either by CDN or during the build process as an optimization to remove comment nodes.\n * Hydration process requires comment nodes produced by Angular to locate correct DOM segments.\n * When this special marker is *not* present - throw an error and do not proceed with hydration,\n * since it will not be able to function correctly.\n *\n * Note: this function is invoked only on the client, so it's safe to use DOM APIs.\n */\nfunction verifySsrContentsIntegrity(doc) {\n for (const node of doc.body.childNodes) {\n if (isSsrContentsIntegrity(node)) {\n return;\n }\n }\n // Check if the HTML parser may have moved the marker to just before the <body> tag,\n // e.g. because the body tag was implicit and not present in the markup. An implicit body\n // tag is unlikely to interfer with whitespace/comments inside of the app's root element.\n // Case 1: Implicit body. Example:\n // <!doctype html><head><title>Hi</title></head><!--nghm--><app-root></app-root>\n const beforeBody = skipTextNodes(doc.body.previousSibling);\n if (isSsrContentsIntegrity(beforeBody)) {\n return;\n }\n // Case 2: Implicit body & head. Example:\n // <!doctype html><head><title>Hi</title><!--nghm--><app-root></app-root>\n let endOfHead = skipTextNodes(doc.head.lastChild);\n if (isSsrContentsIntegrity(endOfHead)) {\n return;\n }\n throw new RuntimeError(-507 /* RuntimeErrorCode.MISSING_SSR_CONTENT_INTEGRITY_MARKER */, typeof ngDevMode !== 'undefined' && ngDevMode && 'Angular hydration logic detected that HTML content of this page was modified after it ' + 'was produced during server side rendering. Make sure that there are no optimizations ' + 'that remove comment nodes from HTML enabled on your CDN. Angular hydration ' + 'relies on HTML produced by the server, including whitespaces and comment nodes.');\n}\n\n/** Refreshes all content queries declared by directives in a given view */\nfunction refreshContentQueries(tView, lView) {\n const contentQueries = tView.contentQueries;\n if (contentQueries !== null) {\n const prevConsumer = setActiveConsumer(null);\n try {\n for (let i = 0; i < contentQueries.length; i += 2) {\n const queryStartIdx = contentQueries[i];\n const directiveDefIdx = contentQueries[i + 1];\n if (directiveDefIdx !== -1) {\n const directiveDef = tView.data[directiveDefIdx];\n ngDevMode && assertDefined(directiveDef, 'DirectiveDef not found.');\n ngDevMode && assertDefined(directiveDef.contentQueries, 'contentQueries function should be defined');\n setCurrentQueryIndex(queryStartIdx);\n directiveDef.contentQueries(2 /* RenderFlags.Update */, lView[directiveDefIdx], directiveDefIdx);\n }\n }\n } finally {\n setActiveConsumer(prevConsumer);\n }\n }\n}\nfunction executeViewQueryFn(flags, viewQueryFn, component) {\n ngDevMode && assertDefined(viewQueryFn, 'View queries function to execute must be defined.');\n setCurrentQueryIndex(0);\n const prevConsumer = setActiveConsumer(null);\n try {\n viewQueryFn(flags, component);\n } finally {\n setActiveConsumer(prevConsumer);\n }\n}\nfunction executeContentQueries(tView, tNode, lView) {\n if (isContentQueryHost(tNode)) {\n const prevConsumer = setActiveConsumer(null);\n try {\n const start = tNode.directiveStart;\n const end = tNode.directiveEnd;\n for (let directiveIndex = start; directiveIndex < end; directiveIndex++) {\n const def = tView.data[directiveIndex];\n if (def.contentQueries) {\n const directiveInstance = lView[directiveIndex];\n ngDevMode && assertDefined(directiveIndex, 'Incorrect reference to a directive defining a content query');\n def.contentQueries(1 /* RenderFlags.Create */, directiveInstance, directiveIndex);\n }\n }\n } finally {\n setActiveConsumer(prevConsumer);\n }\n }\n}\n\n/**\n * Defines the CSS styles encapsulation policies for the {@link /api/core/Component Component} decorator's\n * `encapsulation` option.\n *\n * See {@link Component#encapsulation encapsulation}.\n *\n * @usageNotes\n * ### Example\n *\n * {@example core/ts/metadata/encapsulation.ts region='longform'}\n *\n * @publicApi\n */\nvar ViewEncapsulation;\n(function (ViewEncapsulation) {\n // TODO: consider making `ViewEncapsulation` a `const enum` instead. See\n // https://github.com/angular/angular/issues/44119 for additional information.\n /**\n * Emulates a native Shadow DOM encapsulation behavior by adding a specific attribute to the\n * component's host element and applying the same attribute to all the CSS selectors provided\n * via {@link Component#styles styles} or {@link Component#styleUrls styleUrls}.\n *\n * This is the default option.\n */\n ViewEncapsulation[ViewEncapsulation[\"Emulated\"] = 0] = \"Emulated\";\n // Historically the 1 value was for `Native` encapsulation which has been removed as of v11.\n /**\n * Doesn't provide any sort of CSS style encapsulation, meaning that all the styles provided\n * via {@link Component#styles styles} or {@link Component#styleUrls styleUrls} are applicable\n * to any HTML element of the application regardless of their host Component.\n */\n ViewEncapsulation[ViewEncapsulation[\"None\"] = 2] = \"None\";\n /**\n * Uses the browser's native Shadow DOM API to encapsulate CSS styles, meaning that it creates\n * a ShadowRoot for the component's host element which is then used to encapsulate\n * all the Component's styling.\n */\n ViewEncapsulation[ViewEncapsulation[\"ShadowDom\"] = 3] = \"ShadowDom\";\n})(ViewEncapsulation || (ViewEncapsulation = {}));\n\n/**\n * @fileoverview\n * A module to facilitate use of a Trusted Types policy internally within\n * Angular. It lazily constructs the Trusted Types policy, providing helper\n * utilities for promoting strings to Trusted Types. When Trusted Types are not\n * 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/**\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$1;\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$1() {\n if (policy$1 === undefined) {\n policy$1 = null;\n if (_global.trustedTypes) {\n try {\n policy$1 = _global.trustedTypes.createPolicy('angular', {\n createHTML: s => s,\n createScript: s => s,\n createScriptURL: s => 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$1;\n}\n/**\n * Unsafely promote a string to a TrustedHTML, falling back to strings when\n * 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, it must be assured that the\n * provided string will never cause an XSS vulnerability if used in a context\n * that will be interpreted as HTML by a browser, e.g. when assigning to\n * element.innerHTML.\n */\nfunction trustedHTMLFromString(html) {\n return getPolicy$1()?.createHTML(html) || html;\n}\n/**\n * Unsafely promote a string to a TrustedScriptURL, falling back to strings\n * 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, it must be assured that the\n * provided string will never cause an XSS vulnerability if used in a context\n * that will cause a browser to load and execute a resource, e.g. when\n * assigning to script.src.\n */\nfunction trustedScriptURLFromString(url) {\n return getPolicy$1()?.createScriptURL(url) || url;\n}\n\n/**\n * @fileoverview\n * A module to facilitate use of a Trusted Types policy internally within\n * Angular specifically for bypassSecurityTrust* and custom sanitizers. It\n * lazily constructs the Trusted Types policy, providing helper utilities for\n * promoting strings to Trusted Types. When Trusted Types are not available,\n * 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/**\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;\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() {\n if (policy === undefined) {\n policy = null;\n if (_global.trustedTypes) {\n try {\n policy = _global.trustedTypes.createPolicy('angular#unsafe-bypass', {\n createHTML: s => s,\n createScript: s => s,\n createScriptURL: s => 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 * Unsafely promote a string to a TrustedHTML, falling back to strings when\n * 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, it must be assured that it\n * is only passed strings that come directly from custom sanitizers or the\n * bypassSecurityTrust* functions.\n */\nfunction trustedHTMLFromStringBypass(html) {\n return getPolicy()?.createHTML(html) || html;\n}\n/**\n * Unsafely promote a string to a TrustedScript, falling back to strings when\n * 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, it must be assured that it\n * is only passed strings that come directly from custom sanitizers or the\n * bypassSecurityTrust* functions.\n */\nfunction trustedScriptFromStringBypass(script) {\n return getPolicy()?.createScript(script) || script;\n}\n/**\n * Unsafely promote a string to a TrustedScriptURL, falling back to strings\n * 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, it must be assured that it\n * is only passed strings that come directly from custom sanitizers or the\n * bypassSecurityTrust* functions.\n */\nfunction trustedScriptURLFromStringBypass(url) {\n return getPolicy()?.createScriptURL(url) || url;\n}\nclass SafeValueImpl {\n changingThisBreaksApplicationSecurity;\n constructor(changingThisBreaksApplicationSecurity) {\n this.changingThisBreaksApplicationSecurity = changingThisBreaksApplicationSecurity;\n }\n toString() {\n return `SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity}` + ` (see ${XSS_SECURITY_URL})`;\n }\n}\nclass SafeHtmlImpl extends SafeValueImpl {\n getTypeName() {\n return \"HTML\" /* BypassType.Html */;\n }\n}\nclass SafeStyleImpl extends SafeValueImpl {\n getTypeName() {\n return \"Style\" /* BypassType.Style */;\n }\n}\nclass SafeScriptImpl extends SafeValueImpl {\n getTypeName() {\n return \"Script\" /* BypassType.Script */;\n }\n}\nclass SafeUrlImpl extends SafeValueImpl {\n getTypeName() {\n return \"URL\" /* BypassType.Url */;\n }\n}\nclass SafeResourceUrlImpl extends SafeValueImpl {\n getTypeName() {\n return \"ResourceURL\" /* BypassType.ResourceUrl */;\n }\n}\nfunction unwrapSafeValue(value) {\n return value instanceof SafeValueImpl ? value.changingThisBreaksApplicationSecurity : value;\n}\nfunction allowSanitizationBypassAndThrow(value, type) {\n const actualType = getSanitizationBypassType(value);\n if (actualType != null && actualType !== type) {\n // Allow ResourceURLs in URL contexts, they are strictly more trusted.\n if (actualType === \"ResourceURL\" /* BypassType.ResourceUrl */ && type === \"URL\" /* BypassType.Url */) return true;\n throw new Error(`Required a safe ${type}, got a ${actualType} (see ${XSS_SECURITY_URL})`);\n }\n return actualType === type;\n}\nfunction getSanitizationBypassType(value) {\n return value instanceof SafeValueImpl && value.getTypeName() || null;\n}\n/**\n * Mark `html` string as trusted.\n *\n * This function wraps the trusted string in `String` and brands it in a way which makes it\n * recognizable to {@link htmlSanitizer} to be trusted implicitly.\n *\n * @param trustedHtml `html` string which needs to be implicitly trusted.\n * @returns a `html` which has been branded to be implicitly trusted.\n */\nfunction bypassSanitizationTrustHtml(trustedHtml) {\n return new SafeHtmlImpl(trustedHtml);\n}\n/**\n * Mark `style` string as trusted.\n *\n * This function wraps the trusted string in `String` and brands it in a way which makes it\n * recognizable to {@link styleSanitizer} to be trusted implicitly.\n *\n * @param trustedStyle `style` string which needs to be implicitly trusted.\n * @returns a `style` hich has been branded to be implicitly trusted.\n */\nfunction bypassSanitizationTrustStyle(trustedStyle) {\n return new SafeStyleImpl(trustedStyle);\n}\n/**\n * Mark `script` string as trusted.\n *\n * This function wraps the trusted string in `String` and brands it in a way which makes it\n * recognizable to {@link scriptSanitizer} to be trusted implicitly.\n *\n * @param trustedScript `script` string which needs to be implicitly trusted.\n * @returns a `script` which has been branded to be implicitly trusted.\n */\nfunction bypassSanitizationTrustScript(trustedScript) {\n return new SafeScriptImpl(trustedScript);\n}\n/**\n * Mark `url` string as trusted.\n *\n * This function wraps the trusted string in `String` and brands it in a way which makes it\n * recognizable to {@link urlSanitizer} to be trusted implicitly.\n *\n * @param trustedUrl `url` string which needs to be implicitly trusted.\n * @returns a `url` which has been branded to be implicitly trusted.\n */\nfunction bypassSanitizationTrustUrl(trustedUrl) {\n return new SafeUrlImpl(trustedUrl);\n}\n/**\n * Mark `url` string as trusted.\n *\n * This function wraps the trusted string in `String` and brands it in a way which makes it\n * recognizable to {@link resourceUrlSanitizer} to be trusted implicitly.\n *\n * @param trustedResourceUrl `url` string which needs to be implicitly trusted.\n * @returns a `url` which has been branded to be implicitly trusted.\n */\nfunction bypassSanitizationTrustResourceUrl(trustedResourceUrl) {\n return new SafeResourceUrlImpl(trustedResourceUrl);\n}\n\n/**\n * This helper is used to get hold of an inert tree of DOM elements containing dirty HTML\n * that needs sanitizing.\n * Depending upon browser support we use one of two strategies for doing this.\n * Default: DOMParser strategy\n * Fallback: InertDocument strategy\n */\nfunction getInertBodyHelper(defaultDoc) {\n const inertDocumentHelper = new InertDocumentHelper(defaultDoc);\n return isDOMParserAvailable() ? new DOMParserHelper(inertDocumentHelper) : inertDocumentHelper;\n}\n/**\n * Uses DOMParser to create and fill an inert body element.\n * This is the default strategy used in browsers that support it.\n */\nclass DOMParserHelper {\n inertDocumentHelper;\n constructor(inertDocumentHelper) {\n this.inertDocumentHelper = inertDocumentHelper;\n }\n getInertBodyElement(html) {\n // We add these extra elements to ensure that the rest of the content is parsed as expected\n // e.g. leading whitespace is maintained and tags like `<meta>` do not get hoisted to the\n // `<head>` tag. Note that the `<body>` tag is closed implicitly to prevent unclosed tags\n // in `html` from consuming the otherwise explicit `</body>` tag.\n html = '<body><remove></remove>' + html;\n try {\n const body = new window.DOMParser().parseFromString(trustedHTMLFromString(html), 'text/html').body;\n if (body === null) {\n // In some browsers (e.g. Mozilla/5.0 iPad AppleWebKit Mobile) the `body` property only\n // becomes available in the following tick of the JS engine. In that case we fall back to\n // the `inertDocumentHelper` instead.\n return this.inertDocumentHelper.getInertBodyElement(html);\n }\n body.firstChild?.remove();\n return body;\n } catch {\n return null;\n }\n }\n}\n/**\n * Use an HTML5 `template` element to create and fill an inert DOM element.\n * This is the fallback strategy if the browser does not support DOMParser.\n */\nclass InertDocumentHelper {\n defaultDoc;\n inertDocument;\n constructor(defaultDoc) {\n this.defaultDoc = defaultDoc;\n this.inertDocument = this.defaultDoc.implementation.createHTMLDocument('sanitization-inert');\n }\n getInertBodyElement(html) {\n const templateEl = this.inertDocument.createElement('template');\n templateEl.innerHTML = trustedHTMLFromString(html);\n return templateEl;\n }\n}\n/**\n * We need to determine whether the DOMParser exists in the global context and\n * supports parsing HTML; HTML parsing support is not as wide as other formats, see\n * https://developer.mozilla.org/en-US/docs/Web/API/DOMParser#Browser_compatibility.\n *\n * @suppress {uselessCode}\n */\nfunction isDOMParserAvailable() {\n try {\n return !!new window.DOMParser().parseFromString(trustedHTMLFromString(''), 'text/html');\n } catch {\n return false;\n }\n}\n\n/**\n * A pattern that recognizes URLs that are safe wrt. XSS in URL navigation\n * contexts.\n *\n * This regular expression matches a subset of URLs that will not cause script\n * execution if used in URL context within a HTML document. Specifically, this\n * regular expression matches if:\n * (1) Either a protocol that is not javascript:, and that has valid characters\n * (alphanumeric or [+-.]).\n * (2) or no protocol. A protocol must be followed by a colon. The below\n * allows that by allowing colons only after one of the characters [/?#].\n * A colon after a hash (#) must be in the fragment.\n * Otherwise, a colon after a (?) must be in a query.\n * Otherwise, a colon after a single solidus (/) must be in a path.\n * Otherwise, a colon after a double solidus (//) must be in the authority\n * (before port).\n *\n * The pattern disallows &, used in HTML entity declarations before\n * one of the characters in [/?#]. This disallows HTML entities used in the\n * protocol name, which should never happen, e.g. \"h&#116;tp\" for \"http\".\n * It also disallows HTML entities in the first path part of a relative path,\n * e.g. \"foo&lt;bar/baz\". Our existing escaping functions should not produce\n * that. More importantly, it disallows masking of a colon,\n * e.g. \"javascript&#58;...\".\n *\n * This regular expression was taken from the Closure sanitization library.\n */\nconst SAFE_URL_PATTERN = /^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:\\/?#]*(?:[\\/?#]|$))/i;\nfunction _sanitizeUrl(url) {\n url = String(url);\n if (url.match(SAFE_URL_PATTERN)) return url;\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n console.warn(`WARNING: sanitizing unsafe URL value ${url} (see ${XSS_SECURITY_URL})`);\n }\n return 'unsafe:' + url;\n}\nfunction tagSet(tags) {\n const res = {};\n for (const t of tags.split(',')) res[t] = true;\n return res;\n}\nfunction merge(...sets) {\n const res = {};\n for (const s of sets) {\n for (const v in s) {\n if (s.hasOwnProperty(v)) res[v] = true;\n }\n }\n return res;\n}\n// Good source of info about elements and attributes\n// https://html.spec.whatwg.org/#semantics\n// https://simon.html5.org/html-elements\n// Safe Void Elements - HTML5\n// https://html.spec.whatwg.org/#void-elements\nconst VOID_ELEMENTS = tagSet('area,br,col,hr,img,wbr');\n// Elements that you can, intentionally, leave open (and which close themselves)\n// https://html.spec.whatwg.org/#optional-tags\nconst OPTIONAL_END_TAG_BLOCK_ELEMENTS = tagSet('colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr');\nconst OPTIONAL_END_TAG_INLINE_ELEMENTS = tagSet('rp,rt');\nconst OPTIONAL_END_TAG_ELEMENTS = merge(OPTIONAL_END_TAG_INLINE_ELEMENTS, OPTIONAL_END_TAG_BLOCK_ELEMENTS);\n// Safe Block Elements - HTML5\nconst BLOCK_ELEMENTS = merge(OPTIONAL_END_TAG_BLOCK_ELEMENTS, tagSet('address,article,' + 'aside,blockquote,caption,center,del,details,dialog,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,' + 'h6,header,hgroup,hr,ins,main,map,menu,nav,ol,pre,section,summary,table,ul'));\n// Inline Elements - HTML5\nconst INLINE_ELEMENTS = merge(OPTIONAL_END_TAG_INLINE_ELEMENTS, tagSet('a,abbr,acronym,audio,b,' + 'bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,picture,q,ruby,rp,rt,s,' + 'samp,small,source,span,strike,strong,sub,sup,time,track,tt,u,var,video'));\nconst VALID_ELEMENTS = merge(VOID_ELEMENTS, BLOCK_ELEMENTS, INLINE_ELEMENTS, OPTIONAL_END_TAG_ELEMENTS);\n// Attributes that have href and hence need to be sanitized\nconst URI_ATTRS = tagSet('background,cite,href,itemtype,longdesc,poster,src,xlink:href');\nconst HTML_ATTRS = tagSet('abbr,accesskey,align,alt,autoplay,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,' + 'compact,controls,coords,datetime,default,dir,download,face,headers,height,hidden,hreflang,hspace,' + 'ismap,itemscope,itemprop,kind,label,lang,language,loop,media,muted,nohref,nowrap,open,preload,rel,rev,role,rows,rowspan,rules,' + 'scope,scrolling,shape,size,sizes,span,srclang,srcset,start,summary,tabindex,target,title,translate,type,usemap,' + 'valign,value,vspace,width');\n// Accessibility attributes as per WAI-ARIA 1.1 (W3C Working Draft 14 December 2018)\nconst ARIA_ATTRS = tagSet('aria-activedescendant,aria-atomic,aria-autocomplete,aria-busy,aria-checked,aria-colcount,aria-colindex,' + 'aria-colspan,aria-controls,aria-current,aria-describedby,aria-details,aria-disabled,aria-dropeffect,' + 'aria-errormessage,aria-expanded,aria-flowto,aria-grabbed,aria-haspopup,aria-hidden,aria-invalid,' + 'aria-keyshortcuts,aria-label,aria-labelledby,aria-level,aria-live,aria-modal,aria-multiline,' + 'aria-multiselectable,aria-orientation,aria-owns,aria-placeholder,aria-posinset,aria-pressed,aria-readonly,' + 'aria-relevant,aria-required,aria-roledescription,aria-rowcount,aria-rowindex,aria-rowspan,aria-selected,' + 'aria-setsize,aria-sort,aria-valuemax,aria-valuemin,aria-valuenow,aria-valuetext');\n// NB: This currently consciously doesn't support SVG. SVG sanitization has had several security\n// issues in the past, so it seems safer to leave it out if possible. If support for binding SVG via\n// innerHTML is required, SVG attributes should be added here.\n// NB: Sanitization does not allow <form> elements or other active elements (<button> etc). Those\n// can be sanitized, but they increase security surface area without a legitimate use case, so they\n// are left out here.\nconst VALID_ATTRS = merge(URI_ATTRS, HTML_ATTRS, ARIA_ATTRS);\n// Elements whose content should not be traversed/preserved, if the elements themselves are invalid.\n//\n// Typically, `<invalid>Some content</invalid>` would traverse (and in this case preserve)\n// `Some content`, but strip `invalid-element` opening/closing tags. For some elements, though, we\n// don't want to preserve the content, if the elements themselves are going to be removed.\nconst SKIP_TRAVERSING_CONTENT_IF_INVALID_ELEMENTS = tagSet('script,style,template');\n/**\n * SanitizingHtmlSerializer serializes a DOM fragment, stripping out any unsafe elements and unsafe\n * attributes.\n */\nclass SanitizingHtmlSerializer {\n // Explicitly track if something was stripped, to avoid accidentally warning of sanitization just\n // because characters were re-encoded.\n sanitizedSomething = false;\n buf = [];\n sanitizeChildren(el) {\n // This cannot use a TreeWalker, as it has to run on Angular's various DOM adapters.\n // However this code never accesses properties off of `document` before deleting its contents\n // again, so it shouldn't be vulnerable to DOM clobbering.\n let current = el.firstChild;\n let traverseContent = true;\n let parentNodes = [];\n while (current) {\n if (current.nodeType === Node.ELEMENT_NODE) {\n traverseContent = this.startElement(current);\n } else if (current.nodeType === Node.TEXT_NODE) {\n this.chars(current.nodeValue);\n } else {\n // Strip non-element, non-text nodes.\n this.sanitizedSomething = true;\n }\n if (traverseContent && current.firstChild) {\n // Push current node to the parent stack before entering its content.\n parentNodes.push(current);\n current = getFirstChild(current);\n continue;\n }\n while (current) {\n // Leaving the element.\n // Walk up and to the right, closing tags as we go.\n if (current.nodeType === Node.ELEMENT_NODE) {\n this.endElement(current);\n }\n let next = getNextSibling(current);\n if (next) {\n current = next;\n break;\n }\n // There was no next sibling, walk up to the parent node (extract it from the stack).\n current = parentNodes.pop();\n }\n }\n return this.buf.join('');\n }\n /**\n * Sanitizes an opening element tag (if valid) and returns whether the element's contents should\n * be traversed. Element content must always be traversed (even if the element itself is not\n * valid/safe), unless the element is one of `SKIP_TRAVERSING_CONTENT_IF_INVALID_ELEMENTS`.\n *\n * @param element The element to sanitize.\n * @return True if the element's contents should be traversed.\n */\n startElement(element) {\n const tagName = getNodeName(element).toLowerCase();\n if (!VALID_ELEMENTS.hasOwnProperty(tagName)) {\n this.sanitizedSomething = true;\n return !SKIP_TRAVERSING_CONTENT_IF_INVALID_ELEMENTS.hasOwnProperty(tagName);\n }\n this.buf.push('<');\n this.buf.push(tagName);\n const elAttrs = element.attributes;\n for (let i = 0; i < elAttrs.length; i++) {\n const elAttr = elAttrs.item(i);\n const attrName = elAttr.name;\n const lower = attrName.toLowerCase();\n if (!VALID_ATTRS.hasOwnProperty(lower)) {\n this.sanitizedSomething = true;\n continue;\n }\n let value = elAttr.value;\n // TODO(martinprobst): Special case image URIs for data:image/...\n if (URI_ATTRS[lower]) value = _sanitizeUrl(value);\n this.buf.push(' ', attrName, '=\"', encodeEntities(value), '\"');\n }\n this.buf.push('>');\n return true;\n }\n endElement(current) {\n const tagName = getNodeName(current).toLowerCase();\n if (VALID_ELEMENTS.hasOwnProperty(tagName) && !VOID_ELEMENTS.hasOwnProperty(tagName)) {\n this.buf.push('</');\n this.buf.push(tagName);\n this.buf.push('>');\n }\n }\n chars(chars) {\n this.buf.push(encodeEntities(chars));\n }\n}\n/**\n * Verifies whether a given child node is a descendant of a given parent node.\n * It may not be the case when properties like `.firstChild` are clobbered and\n * accessing `.firstChild` results in an unexpected node returned.\n */\nfunction isClobberedElement(parentNode, childNode) {\n return (parentNode.compareDocumentPosition(childNode) & Node.DOCUMENT_POSITION_CONTAINED_BY) !== Node.DOCUMENT_POSITION_CONTAINED_BY;\n}\n/**\n * Retrieves next sibling node and makes sure that there is no\n * clobbering of the `nextSibling` property happening.\n */\nfunction getNextSibling(node) {\n const nextSibling = node.nextSibling;\n // Make sure there is no `nextSibling` clobbering: navigating to\n // the next sibling and going back to the previous one should result\n // in the original node.\n if (nextSibling && node !== nextSibling.previousSibling) {\n throw clobberedElementError(nextSibling);\n }\n return nextSibling;\n}\n/**\n * Retrieves first child node and makes sure that there is no\n * clobbering of the `firstChild` property happening.\n */\nfunction getFirstChild(node) {\n const firstChild = node.firstChild;\n if (firstChild && isClobberedElement(node, firstChild)) {\n throw clobberedElementError(firstChild);\n }\n return firstChild;\n}\n/** Gets a reasonable nodeName, even for clobbered nodes. */\nfunction getNodeName(node) {\n const nodeName = node.nodeName;\n // If the property is clobbered, assume it is an `HTMLFormElement`.\n return typeof nodeName === 'string' ? nodeName : 'FORM';\n}\nfunction clobberedElementError(node) {\n return new Error(`Failed to sanitize html because the element is clobbered: ${node.outerHTML}`);\n}\n// Regular Expressions for parsing tags and attributes\nconst SURROGATE_PAIR_REGEXP = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g;\n// ! to ~ is the ASCII range.\nconst NON_ALPHANUMERIC_REGEXP = /([^\\#-~ |!])/g;\n/**\n * Escapes all potentially dangerous characters, so that the\n * resulting string can be safely inserted into attribute or\n * element text.\n * @param value\n */\nfunction encodeEntities(value) {\n return value.replace(/&/g, '&amp;').replace(SURROGATE_PAIR_REGEXP, function (match) {\n const hi = match.charCodeAt(0);\n const low = match.charCodeAt(1);\n return '&#' + ((hi - 0xd800) * 0x400 + (low - 0xdc00) + 0x10000) + ';';\n }).replace(NON_ALPHANUMERIC_REGEXP, function (match) {\n return '&#' + match.charCodeAt(0) + ';';\n }).replace(/</g, '&lt;').replace(/>/g, '&gt;');\n}\nlet inertBodyHelper;\n/**\n * Sanitizes the given unsafe, untrusted HTML fragment, and returns HTML text that is safe to add to\n * the DOM in a browser environment.\n */\nfunction _sanitizeHtml(defaultDoc, unsafeHtmlInput) {\n let inertBodyElement = null;\n try {\n inertBodyHelper = inertBodyHelper || getInertBodyHelper(defaultDoc);\n // Make sure unsafeHtml is actually a string (TypeScript types are not enforced at runtime).\n let unsafeHtml = unsafeHtmlInput ? String(unsafeHtmlInput) : '';\n inertBodyElement = inertBodyHelper.getInertBodyElement(unsafeHtml);\n // mXSS protection. Repeatedly parse the document to make sure it stabilizes, so that a browser\n // trying to auto-correct incorrect HTML cannot cause formerly inert HTML to become dangerous.\n let mXSSAttempts = 5;\n let parsedHtml = unsafeHtml;\n do {\n if (mXSSAttempts === 0) {\n throw new Error('Failed to sanitize html because the input is unstable');\n }\n mXSSAttempts--;\n unsafeHtml = parsedHtml;\n parsedHtml = inertBodyElement.innerHTML;\n inertBodyElement = inertBodyHelper.getInertBodyElement(unsafeHtml);\n } while (unsafeHtml !== parsedHtml);\n const sanitizer = new SanitizingHtmlSerializer();\n const safeHtml = sanitizer.sanitizeChildren(getTemplateContent(inertBodyElement) || inertBodyElement);\n if ((typeof ngDevMode === 'undefined' || ngDevMode) && sanitizer.sanitizedSomething) {\n console.warn(`WARNING: sanitizing HTML stripped some content, see ${XSS_SECURITY_URL}`);\n }\n return trustedHTMLFromString(safeHtml);\n } finally {\n // In case anything goes wrong, clear out inertElement to reset the entire DOM structure.\n if (inertBodyElement) {\n const parent = getTemplateContent(inertBodyElement) || inertBodyElement;\n while (parent.firstChild) {\n parent.firstChild.remove();\n }\n }\n }\n}\nfunction getTemplateContent(el) {\n return 'content' in el /** Microsoft/TypeScript#21517 */ && isTemplateElement(el) ? el.content : null;\n}\nfunction isTemplateElement(el) {\n return el.nodeType === Node.ELEMENT_NODE && el.nodeName === 'TEMPLATE';\n}\n\n/**\n * A SecurityContext marks a location that has dangerous security implications, e.g. a DOM property\n * like `innerHTML` that could cause Cross Site Scripting (XSS) security bugs when improperly\n * handled.\n *\n * See DomSanitizer for more details on security in Angular applications.\n *\n * @publicApi\n */\nvar SecurityContext;\n(function (SecurityContext) {\n SecurityContext[SecurityContext[\"NONE\"] = 0] = \"NONE\";\n SecurityContext[SecurityContext[\"HTML\"] = 1] = \"HTML\";\n SecurityContext[SecurityContext[\"STYLE\"] = 2] = \"STYLE\";\n SecurityContext[SecurityContext[\"SCRIPT\"] = 3] = \"SCRIPT\";\n SecurityContext[SecurityContext[\"URL\"] = 4] = \"URL\";\n SecurityContext[SecurityContext[\"RESOURCE_URL\"] = 5] = \"RESOURCE_URL\";\n})(SecurityContext || (SecurityContext = {}));\n\n/**\n * An `html` sanitizer which converts untrusted `html` **string** into trusted string by removing\n * dangerous content.\n *\n * This method parses the `html` and locates potentially dangerous content (such as urls and\n * javascript) and removes it.\n *\n * It is possible to mark a string as trusted by calling {@link bypassSanitizationTrustHtml}.\n *\n * @param unsafeHtml untrusted `html`, typically from the user.\n * @returns `html` string which is safe to display to user, because all of the dangerous javascript\n * and urls have been removed.\n *\n * @codeGenApi\n */\nfunction ɵɵsanitizeHtml(unsafeHtml) {\n const sanitizer = getSanitizer();\n if (sanitizer) {\n return trustedHTMLFromStringBypass(sanitizer.sanitize(SecurityContext.HTML, unsafeHtml) || '');\n }\n if (allowSanitizationBypassAndThrow(unsafeHtml, \"HTML\" /* BypassType.Html */)) {\n return trustedHTMLFromStringBypass(unwrapSafeValue(unsafeHtml));\n }\n return _sanitizeHtml(getDocument(), renderStringify(unsafeHtml));\n}\n/**\n * A `style` sanitizer which converts untrusted `style` **string** into trusted string by removing\n * dangerous content.\n *\n * It is possible to mark a string as trusted by calling {@link bypassSanitizationTrustStyle}.\n *\n * @param unsafeStyle untrusted `style`, typically from the user.\n * @returns `style` string which is safe to bind to the `style` properties.\n *\n * @codeGenApi\n */\nfunction ɵɵsanitizeStyle(unsafeStyle) {\n const sanitizer = getSanitizer();\n if (sanitizer) {\n return sanitizer.sanitize(SecurityContext.STYLE, unsafeStyle) || '';\n }\n if (allowSanitizationBypassAndThrow(unsafeStyle, \"Style\" /* BypassType.Style */)) {\n return unwrapSafeValue(unsafeStyle);\n }\n return renderStringify(unsafeStyle);\n}\n/**\n * A `url` sanitizer which converts untrusted `url` **string** into trusted string by removing\n * dangerous\n * content.\n *\n * This method parses the `url` and locates potentially dangerous content (such as javascript) and\n * removes it.\n *\n * It is possible to mark a string as trusted by calling {@link bypassSanitizationTrustUrl}.\n *\n * @param unsafeUrl untrusted `url`, typically from the user.\n * @returns `url` string which is safe to bind to the `src` properties such as `<img src>`, because\n * all of the dangerous javascript has been removed.\n *\n * @codeGenApi\n */\nfunction ɵɵsanitizeUrl(unsafeUrl) {\n const sanitizer = getSanitizer();\n if (sanitizer) {\n return sanitizer.sanitize(SecurityContext.URL, unsafeUrl) || '';\n }\n if (allowSanitizationBypassAndThrow(unsafeUrl, \"URL\" /* BypassType.Url */)) {\n return unwrapSafeValue(unsafeUrl);\n }\n return _sanitizeUrl(renderStringify(unsafeUrl));\n}\n/**\n * A `url` sanitizer which only lets trusted `url`s through.\n *\n * This passes only `url`s marked trusted by calling {@link bypassSanitizationTrustResourceUrl}.\n *\n * @param unsafeResourceUrl untrusted `url`, typically from the user.\n * @returns `url` string which is safe to bind to the `src` properties such as `<img src>`, because\n * only trusted `url`s have been allowed to pass.\n *\n * @codeGenApi\n */\nfunction ɵɵsanitizeResourceUrl(unsafeResourceUrl) {\n const sanitizer = getSanitizer();\n if (sanitizer) {\n return trustedScriptURLFromStringBypass(sanitizer.sanitize(SecurityContext.RESOURCE_URL, unsafeResourceUrl) || '');\n }\n if (allowSanitizationBypassAndThrow(unsafeResourceUrl, \"ResourceURL\" /* BypassType.ResourceUrl */)) {\n return trustedScriptURLFromStringBypass(unwrapSafeValue(unsafeResourceUrl));\n }\n throw new RuntimeError(904 /* RuntimeErrorCode.UNSAFE_VALUE_IN_RESOURCE_URL */, ngDevMode && `unsafe value used in a resource URL context (see ${XSS_SECURITY_URL})`);\n}\n/**\n * A `script` sanitizer which only lets trusted javascript through.\n *\n * This passes only `script`s marked trusted by calling {@link\n * bypassSanitizationTrustScript}.\n *\n * @param unsafeScript untrusted `script`, typically from the user.\n * @returns `url` string which is safe to bind to the `<script>` element such as `<img src>`,\n * because only trusted `scripts` have been allowed to pass.\n *\n * @codeGenApi\n */\nfunction ɵɵsanitizeScript(unsafeScript) {\n const sanitizer = getSanitizer();\n if (sanitizer) {\n return trustedScriptFromStringBypass(sanitizer.sanitize(SecurityContext.SCRIPT, unsafeScript) || '');\n }\n if (allowSanitizationBypassAndThrow(unsafeScript, \"Script\" /* BypassType.Script */)) {\n return trustedScriptFromStringBypass(unwrapSafeValue(unsafeScript));\n }\n throw new RuntimeError(905 /* RuntimeErrorCode.UNSAFE_VALUE_IN_SCRIPT */, ngDevMode && 'unsafe value used in a script context');\n}\n/**\n * A template tag function for promoting the associated constant literal to a\n * TrustedHTML. Interpolation is explicitly not allowed.\n *\n * @param html constant template literal containing trusted HTML.\n * @returns TrustedHTML wrapping `html`.\n *\n * @security This is a security-sensitive function and should only be used to\n * convert constant values of attributes and properties found in\n * application-provided Angular templates to TrustedHTML.\n *\n * @codeGenApi\n */\nfunction ɵɵtrustConstantHtml(html) {\n // The following runtime check ensures that the function was called as a\n // template tag (e.g. ɵɵtrustConstantHtml`content`), without any interpolation\n // (e.g. not ɵɵtrustConstantHtml`content ${variable}`). A TemplateStringsArray\n // is an array with a `raw` property that is also an array. The associated\n // template literal has no interpolation if and only if the length of the\n // TemplateStringsArray is 1.\n if (ngDevMode && (!Array.isArray(html) || !Array.isArray(html.raw) || html.length !== 1)) {\n throw new Error(`Unexpected interpolation in trusted HTML constant: ${html.join('?')}`);\n }\n return trustedHTMLFromString(html[0]);\n}\n/**\n * A template tag function for promoting the associated constant literal to a\n * TrustedScriptURL. Interpolation is explicitly not allowed.\n *\n * @param url constant template literal containing a trusted script URL.\n * @returns TrustedScriptURL wrapping `url`.\n *\n * @security This is a security-sensitive function and should only be used to\n * convert constant values of attributes and properties found in\n * application-provided Angular templates to TrustedScriptURL.\n *\n * @codeGenApi\n */\nfunction ɵɵtrustConstantResourceUrl(url) {\n // The following runtime check ensures that the function was called as a\n // template tag (e.g. ɵɵtrustConstantResourceUrl`content`), without any\n // interpolation (e.g. not ɵɵtrustConstantResourceUrl`content ${variable}`). A\n // TemplateStringsArray is an array with a `raw` property that is also an\n // array. The associated template literal has no interpolation if and only if\n // the length of the TemplateStringsArray is 1.\n if (ngDevMode && (!Array.isArray(url) || !Array.isArray(url.raw) || url.length !== 1)) {\n throw new Error(`Unexpected interpolation in trusted URL constant: ${url.join('?')}`);\n }\n return trustedScriptURLFromString(url[0]);\n}\n/**\n * Detects which sanitizer to use for URL property, based on tag name and prop name.\n *\n * The rules are based on the RESOURCE_URL context config from\n * `packages/compiler/src/schema/dom_security_schema.ts`.\n * If tag and prop names don't match Resource URL schema, use URL sanitizer.\n */\nfunction getUrlSanitizer(tag, prop) {\n if (prop === 'src' && (tag === 'embed' || tag === 'frame' || tag === 'iframe' || tag === 'media' || tag === 'script') || prop === 'href' && (tag === 'base' || tag === 'link')) {\n return ɵɵsanitizeResourceUrl;\n }\n return ɵɵsanitizeUrl;\n}\n/**\n * Sanitizes URL, selecting sanitizer function based on tag and property names.\n *\n * This function is used in case we can't define security context at compile time, when only prop\n * name is available. This happens when we generate host bindings for Directives/Components. The\n * host element is unknown at compile time, so we defer calculation of specific sanitizer to\n * runtime.\n *\n * @param unsafeUrl untrusted `url`, typically from the user.\n * @param tag target element tag name.\n * @param prop name of the property that contains the value.\n * @returns `url` string which is safe to bind.\n *\n * @codeGenApi\n */\nfunction ɵɵsanitizeUrlOrResourceUrl(unsafeUrl, tag, prop) {\n return getUrlSanitizer(tag, prop)(unsafeUrl);\n}\nfunction validateAgainstEventProperties(name) {\n if (name.toLowerCase().startsWith('on')) {\n const errorMessage = `Binding to event property '${name}' is disallowed for security reasons, ` + `please use (${name.slice(2)})=...` + `\\nIf '${name}' is a directive input, make sure the directive is imported by the` + ` current module.`;\n throw new RuntimeError(306 /* RuntimeErrorCode.INVALID_EVENT_BINDING */, errorMessage);\n }\n}\nfunction validateAgainstEventAttributes(name) {\n if (name.toLowerCase().startsWith('on')) {\n const errorMessage = `Binding to event attribute '${name}' is disallowed for security reasons, ` + `please use (${name.slice(2)})=...`;\n throw new RuntimeError(306 /* RuntimeErrorCode.INVALID_EVENT_BINDING */, errorMessage);\n }\n}\nfunction getSanitizer() {\n const lView = getLView();\n return lView && lView[ENVIRONMENT].sanitizer;\n}\n\n/**\n * Disallowed strings in the comment.\n *\n * see: https://html.spec.whatwg.org/multipage/syntax.html#comments\n */\nconst COMMENT_DISALLOWED = /^>|^->|<!--|-->|--!>|<!-$/g;\n/**\n * Delimiter in the disallowed strings which needs to be wrapped with zero with character.\n */\nconst COMMENT_DELIMITER = /(<|>)/g;\nconst COMMENT_DELIMITER_ESCAPED = '\\u200B$1\\u200B';\n/**\n * Escape the content of comment strings so that it can be safely inserted into a comment node.\n *\n * The issue is that HTML does not specify any way to escape comment end text inside the comment.\n * Consider: `<!-- The way you close a comment is with \">\", and \"->\" at the beginning or by \"-->\" or\n * \"--!>\" at the end. -->`. Above the `\"-->\"` is meant to be text not an end to the comment. This\n * can be created programmatically through DOM APIs. (`<!--` are also disallowed.)\n *\n * see: https://html.spec.whatwg.org/multipage/syntax.html#comments\n *\n * ```ts\n * div.innerHTML = div.innerHTML\n * ```\n *\n * One would expect that the above code would be safe to do, but it turns out that because comment\n * text is not escaped, the comment may contain text which will prematurely close the comment\n * opening up the application for XSS attack. (In SSR we programmatically create comment nodes which\n * may contain such text and expect them to be safe.)\n *\n * This function escapes the comment text by looking for comment delimiters (`<` and `>`) and\n * surrounding them with `_>_` where the `_` is a zero width space `\\u200B`. The result is that if a\n * comment contains any of the comment start/end delimiters (such as `<!--`, `-->` or `--!>`) the\n * text it will render normally but it will not cause the HTML parser to close/open the comment.\n *\n * @param value text to make safe for comment node by escaping the comment open/close character\n * sequence.\n */\nfunction escapeCommentText(value) {\n return value.replace(COMMENT_DISALLOWED, text => text.replace(COMMENT_DELIMITER, COMMENT_DELIMITER_ESCAPED));\n}\n\n/** Defines the default value of the `NG_REFLECT_ATTRS_FLAG` flag. */\nconst NG_REFLECT_ATTRS_FLAG_DEFAULT = false;\n/**\n * Defines an internal flag that indicates whether the runtime code should be\n * producing `ng-reflect-*` attributes.\n */\nconst NG_REFLECT_ATTRS_FLAG = new InjectionToken(typeof ngDevMode === 'undefined' || ngDevMode ? 'NG_REFLECT_FLAG' : '', {\n providedIn: 'root',\n factory: () => NG_REFLECT_ATTRS_FLAG_DEFAULT\n});\n/**\n * Enables the logic to produce `ng-reflect-*` attributes on elements with bindings.\n *\n * Note: this is a dev-mode only setting and it will have no effect in production mode.\n * In production mode, the `ng-reflect-*` attributes are *never* produced by Angular.\n *\n * Important: using and relying on the `ng-reflect-*` attributes is not recommended,\n * they are deprecated and only present for backwards compatibility. Angular will stop\n * producing them in one of the future versions.\n *\n * @publicApi\n */\nfunction provideNgReflectAttributes() {\n const providers = typeof ngDevMode === 'undefined' || ngDevMode ? [{\n provide: NG_REFLECT_ATTRS_FLAG,\n useValue: true\n }] : [];\n return makeEnvironmentProviders(providers);\n}\nfunction normalizeDebugBindingName(name) {\n // Attribute names with `$` (eg `x-y$`) are valid per spec, but unsupported by some browsers\n name = camelCaseToDashCase(name.replace(/[$@]/g, '_'));\n return `ng-reflect-${name}`;\n}\nconst CAMEL_CASE_REGEXP = /([A-Z])/g;\nfunction camelCaseToDashCase(input) {\n return input.replace(CAMEL_CASE_REGEXP, (...m) => '-' + m[1].toLowerCase());\n}\nfunction normalizeDebugBindingValue(value) {\n try {\n // Limit the size of the value as otherwise the DOM just gets polluted.\n return value != null ? value.toString().slice(0, 30) : value;\n } catch (e) {\n return '[ERROR] Exception while trying to serialize the value';\n }\n}\n\n/**\n * Defines a schema that allows an NgModule to contain the following:\n * - Non-Angular elements named with dash case (`-`).\n * - Element properties named with dash case (`-`).\n * Dash case is the naming convention for custom elements.\n *\n * @publicApi\n */\nconst CUSTOM_ELEMENTS_SCHEMA = {\n name: 'custom-elements'\n};\n/**\n * Defines a schema that allows any property on any element.\n *\n * This schema allows you to ignore the errors related to any unknown elements or properties in a\n * template. The usage of this schema is generally discouraged because it prevents useful validation\n * and may hide real errors in your template. Consider using the `CUSTOM_ELEMENTS_SCHEMA` instead.\n *\n * @publicApi\n */\nconst NO_ERRORS_SCHEMA = {\n name: 'no-errors-schema'\n};\nlet shouldThrowErrorOnUnknownElement = false;\n/**\n * Sets a strict mode for JIT-compiled components to throw an error on unknown elements,\n * instead of just logging the error.\n * (for AOT-compiled ones this check happens at build time).\n */\nfunction ɵsetUnknownElementStrictMode(shouldThrow) {\n shouldThrowErrorOnUnknownElement = shouldThrow;\n}\n/**\n * Gets the current value of the strict mode.\n */\nfunction ɵgetUnknownElementStrictMode() {\n return shouldThrowErrorOnUnknownElement;\n}\nlet shouldThrowErrorOnUnknownProperty = false;\n/**\n * Sets a strict mode for JIT-compiled components to throw an error on unknown properties,\n * instead of just logging the error.\n * (for AOT-compiled ones this check happens at build time).\n */\nfunction ɵsetUnknownPropertyStrictMode(shouldThrow) {\n shouldThrowErrorOnUnknownProperty = shouldThrow;\n}\n/**\n * Gets the current value of the strict mode.\n */\nfunction ɵgetUnknownPropertyStrictMode() {\n return shouldThrowErrorOnUnknownProperty;\n}\n/**\n * Validates that the element is known at runtime and produces\n * an error if it's not the case.\n * This check is relevant for JIT-compiled components (for AOT-compiled\n * ones this check happens at build time).\n *\n * The element is considered known if either:\n * - it's a known HTML element\n * - it's a known custom element\n * - the element matches any directive\n * - the element is allowed by one of the schemas\n *\n * @param lView An `LView` associated with a template is being rendered\n * @param tNode TNode representing an element to be validated\n */\nfunction validateElementIsKnown(lView, tNode) {\n const tView = lView[TVIEW];\n // If `schemas` is set to `null`, that's an indication that this Component was compiled in AOT\n // mode where this check happens at compile time. In JIT mode, `schemas` is always present and\n // defined as an array (as an empty array in case `schemas` field is not defined) and we should\n // execute the check below.\n if (tView.schemas === null) return;\n const tagName = tNode.value;\n // If the element matches any directive, it's considered as valid.\n if (!isDirectiveHost(tNode) && tagName !== null) {\n // The element is unknown if it's an instance of HTMLUnknownElement, or it isn't registered\n // as a custom element. Note that unknown elements with a dash in their name won't be instances\n // of HTMLUnknownElement in browsers that support web components.\n const isUnknown =\n // Note that we can't check for `typeof HTMLUnknownElement === 'function'` because\n // Domino doesn't expose HTMLUnknownElement globally.\n typeof HTMLUnknownElement !== 'undefined' && HTMLUnknownElement && getNativeByTNode(tNode, lView) instanceof HTMLUnknownElement || typeof customElements !== 'undefined' && tagName.indexOf('-') > -1 && !customElements.get(tagName);\n if (isUnknown && !matchingSchemas(tView.schemas, tagName)) {\n const isHostStandalone = isHostComponentStandalone(lView);\n const templateLocation = getTemplateLocationDetails(lView);\n const schemas = `'${isHostStandalone ? '@Component' : '@NgModule'}.schemas'`;\n let message = `'${tagName}' is not a known element${templateLocation}:\\n`;\n message += `1. If '${tagName}' is an Angular component, then verify that it is ${isHostStandalone ? \"included in the '@Component.imports' of this component\" : 'a part of an @NgModule where this component is declared'}.\\n`;\n if (tagName && tagName.indexOf('-') > -1) {\n message += `2. If '${tagName}' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the ${schemas} of this component to suppress this message.`;\n } else {\n message += `2. To allow any element add 'NO_ERRORS_SCHEMA' to the ${schemas} of this component.`;\n }\n if (shouldThrowErrorOnUnknownElement) {\n throw new RuntimeError(304 /* RuntimeErrorCode.UNKNOWN_ELEMENT */, message);\n } else {\n console.error(formatRuntimeError(304 /* RuntimeErrorCode.UNKNOWN_ELEMENT */, message));\n }\n }\n }\n}\n/**\n * Validates that the property of the element is known at runtime and returns\n * false if it's not the case.\n * This check is relevant for JIT-compiled components (for AOT-compiled\n * ones this check happens at build time).\n *\n * The property is considered known if either:\n * - it's a known property of the element\n * - the element is allowed by one of the schemas\n * - the property is used for animations\n *\n * @param element Element to validate\n * @param propName Name of the property to check\n * @param tagName Name of the tag hosting the property\n * @param schemas Array of schemas\n */\nfunction isPropertyValid(element, propName, tagName, schemas) {\n // If `schemas` is set to `null`, that's an indication that this Component was compiled in AOT\n // mode where this check happens at compile time. In JIT mode, `schemas` is always present and\n // defined as an array (as an empty array in case `schemas` field is not defined) and we should\n // execute the check below.\n if (schemas === null) return true;\n // The property is considered valid if the element matches the schema, it exists on the element,\n // or it is synthetic.\n if (matchingSchemas(schemas, tagName) || propName in element || isAnimationProp(propName)) {\n return true;\n }\n // Note: `typeof Node` returns 'function' in most browsers, but is undefined with domino.\n return typeof Node === 'undefined' || Node === null || !(element instanceof Node);\n}\n/**\n * Logs or throws an error that a property is not supported on an element.\n *\n * @param propName Name of the invalid property\n * @param tagName Name of the tag hosting the property\n * @param nodeType Type of the node hosting the property\n * @param lView An `LView` that represents a current component\n */\nfunction handleUnknownPropertyError(propName, tagName, nodeType, lView) {\n // Special-case a situation when a structural directive is applied to\n // an `<ng-template>` element, for example: `<ng-template *ngIf=\"true\">`.\n // In this case the compiler generates the `ɵɵtemplate` instruction with\n // the `null` as the tagName. The directive matching logic at runtime relies\n // on this effect (see `isInlineTemplate`), thus using the 'ng-template' as\n // a default value of the `tNode.value` is not feasible at this moment.\n if (!tagName && nodeType === 4 /* TNodeType.Container */) {\n tagName = 'ng-template';\n }\n const isHostStandalone = isHostComponentStandalone(lView);\n const templateLocation = getTemplateLocationDetails(lView);\n let message = `Can't bind to '${propName}' since it isn't a known property of '${tagName}'${templateLocation}.`;\n const schemas = `'${isHostStandalone ? '@Component' : '@NgModule'}.schemas'`;\n const importLocation = isHostStandalone ? \"included in the '@Component.imports' of this component\" : 'a part of an @NgModule where this component is declared';\n if (KNOWN_CONTROL_FLOW_DIRECTIVES.has(propName)) {\n // Most likely this is a control flow directive (such as `*ngIf`) used in\n // a template, but the directive or the `CommonModule` is not imported.\n const correspondingImport = KNOWN_CONTROL_FLOW_DIRECTIVES.get(propName);\n message += `\\nIf the '${propName}' is an Angular control flow directive, ` + `please make sure that either the '${correspondingImport}' directive or the 'CommonModule' is ${importLocation}.`;\n } else {\n // May be an Angular component, which is not imported/declared?\n message += `\\n1. If '${tagName}' is an Angular component and it has the ` + `'${propName}' input, then verify that it is ${importLocation}.`;\n // May be a Web Component?\n if (tagName && tagName.indexOf('-') > -1) {\n message += `\\n2. If '${tagName}' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' ` + `to the ${schemas} of this component to suppress this message.`;\n message += `\\n3. To allow any property add 'NO_ERRORS_SCHEMA' to ` + `the ${schemas} of this component.`;\n } else {\n // If it's expected, the error can be suppressed by the `NO_ERRORS_SCHEMA` schema.\n message += `\\n2. To allow any property add 'NO_ERRORS_SCHEMA' to ` + `the ${schemas} of this component.`;\n }\n }\n reportUnknownPropertyError(message);\n}\nfunction reportUnknownPropertyError(message) {\n if (shouldThrowErrorOnUnknownProperty) {\n throw new RuntimeError(303 /* RuntimeErrorCode.UNKNOWN_BINDING */, message);\n } else {\n console.error(formatRuntimeError(303 /* RuntimeErrorCode.UNKNOWN_BINDING */, message));\n }\n}\n/**\n * WARNING: this is a **dev-mode only** function (thus should always be guarded by the `ngDevMode`)\n * and must **not** be used in production bundles. The function makes megamorphic reads, which might\n * be too slow for production mode and also it relies on the constructor function being available.\n *\n * Gets a reference to the host component def (where a current component is declared).\n *\n * @param lView An `LView` that represents a current component that is being rendered.\n */\nfunction getDeclarationComponentDef(lView) {\n !ngDevMode && throwError('Must never be called in production mode');\n const declarationLView = lView[DECLARATION_COMPONENT_VIEW];\n const context = declarationLView[CONTEXT];\n // Unable to obtain a context.\n if (!context) return null;\n return context.constructor ? getComponentDef(context.constructor) : null;\n}\n/**\n * WARNING: this is a **dev-mode only** function (thus should always be guarded by the `ngDevMode`)\n * and must **not** be used in production bundles. The function makes megamorphic reads, which might\n * be too slow for production mode.\n *\n * Checks if the current component is declared inside of a standalone component template.\n *\n * @param lView An `LView` that represents a current component that is being rendered.\n */\nfunction isHostComponentStandalone(lView) {\n !ngDevMode && throwError('Must never be called in production mode');\n const componentDef = getDeclarationComponentDef(lView);\n // Treat host component as non-standalone if we can't obtain the def.\n return !!componentDef?.standalone;\n}\n/**\n * WARNING: this is a **dev-mode only** function (thus should always be guarded by the `ngDevMode`)\n * and must **not** be used in production bundles. The function makes megamorphic reads, which might\n * be too slow for production mode.\n *\n * Constructs a string describing the location of the host component template. The function is used\n * in dev mode to produce error messages.\n *\n * @param lView An `LView` that represents a current component that is being rendered.\n */\nfunction getTemplateLocationDetails(lView) {\n !ngDevMode && throwError('Must never be called in production mode');\n const hostComponentDef = getDeclarationComponentDef(lView);\n const componentClassName = hostComponentDef?.type?.name;\n return componentClassName ? ` (used in the '${componentClassName}' component template)` : '';\n}\n/**\n * The set of known control flow directives and their corresponding imports.\n * We use this set to produce a more precises error message with a note\n * that the `CommonModule` should also be included.\n */\nconst KNOWN_CONTROL_FLOW_DIRECTIVES = new Map([['ngIf', 'NgIf'], ['ngFor', 'NgFor'], ['ngSwitchCase', 'NgSwitchCase'], ['ngSwitchDefault', 'NgSwitchDefault']]);\n/**\n * Returns true if the tag name is allowed by specified schemas.\n * @param schemas Array of schemas\n * @param tagName Name of the tag\n */\nfunction matchingSchemas(schemas, tagName) {\n if (schemas !== null) {\n for (let i = 0; i < schemas.length; i++) {\n const schema = schemas[i];\n if (schema === NO_ERRORS_SCHEMA || schema === CUSTOM_ELEMENTS_SCHEMA && tagName && tagName.indexOf('-') > -1) {\n return true;\n }\n }\n }\n return false;\n}\n\n/**\n *\n * @codeGenApi\n */\nfunction ɵɵresolveWindow(element) {\n return element.ownerDocument.defaultView;\n}\n/**\n *\n * @codeGenApi\n */\nfunction ɵɵresolveDocument(element) {\n return element.ownerDocument;\n}\n/**\n *\n * @codeGenApi\n */\nfunction ɵɵresolveBody(element) {\n return element.ownerDocument.body;\n}\n/**\n * The special delimiter we use to separate property names, prefixes, and suffixes\n * in property binding metadata. See storeBindingMetadata().\n *\n * We intentionally use the Unicode \"REPLACEMENT CHARACTER\" (U+FFFD) as a delimiter\n * because it is a very uncommon character that is unlikely to be part of a user's\n * property names or interpolation strings. If it is in fact used in a property\n * binding, DebugElement.properties will not return the correct value for that\n * binding. However, there should be no runtime effect for real applications.\n *\n * This character is typically rendered as a question mark inside of a diamond.\n * See https://en.wikipedia.org/wiki/Specials_(Unicode_block)\n *\n */\nconst INTERPOLATION_DELIMITER = `<60>`;\n/**\n * Unwrap a value which might be behind a closure (for forward declaration reasons).\n */\nfunction maybeUnwrapFn(value) {\n if (value instanceof Function) {\n return value();\n } else {\n return value;\n }\n}\n\n/**\n * The max length of the string representation of a value in an error message\n */\nconst VALUE_STRING_LENGTH_LIMIT = 200;\n/** Verifies that a given type is a Standalone Component. */\nfunction assertStandaloneComponentType(type) {\n assertComponentDef(type);\n const componentDef = getComponentDef(type);\n if (!componentDef.standalone) {\n throw new RuntimeError(907 /* RuntimeErrorCode.TYPE_IS_NOT_STANDALONE */, `The ${stringifyForError(type)} component is not marked as standalone, ` + `but Angular expects to have a standalone component here. ` + `Please make sure the ${stringifyForError(type)} component has ` + `the \\`standalone: true\\` flag in the decorator.`);\n }\n}\n/** Verifies whether a given type is a component */\nfunction assertComponentDef(type) {\n if (!getComponentDef(type)) {\n throw new RuntimeError(906 /* RuntimeErrorCode.MISSING_GENERATED_DEF */, `The ${stringifyForError(type)} is not an Angular component, ` + `make sure it has the \\`@Component\\` decorator.`);\n }\n}\n/** Called when there are multiple component selectors that match a given node */\nfunction throwMultipleComponentError(tNode, first, second) {\n throw new RuntimeError(-300 /* RuntimeErrorCode.MULTIPLE_COMPONENTS_MATCH */, `Multiple components match node with tagname ${tNode.value}: ` + `${stringifyForError(first)} and ` + `${stringifyForError(second)}`);\n}\n/** Throws an ExpressionChangedAfterChecked error if checkNoChanges mode is on. */\nfunction throwErrorIfNoChangesMode(creationMode, oldValue, currValue, propName, lView) {\n const hostComponentDef = getDeclarationComponentDef(lView);\n const componentClassName = hostComponentDef?.type?.name;\n const field = propName ? ` for '${propName}'` : '';\n let msg = `ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value${field}: '${formatValue(oldValue)}'. Current value: '${formatValue(currValue)}'.${componentClassName ? ` Expression location: ${componentClassName} component` : ''}`;\n if (creationMode) {\n msg += ` It seems like the view has been created after its parent and its children have been dirty checked.` + ` Has it been created in a change detection hook?`;\n }\n throw new RuntimeError(-100 /* RuntimeErrorCode.EXPRESSION_CHANGED_AFTER_CHECKED */, msg);\n}\nfunction formatValue(value) {\n let strValue = String(value);\n // JSON.stringify will throw on circular references\n try {\n if (Array.isArray(value) || strValue === '[object Object]') {\n strValue = JSON.stringify(value);\n }\n } catch (error) {}\n return strValue.length > VALUE_STRING_LENGTH_LIMIT ? strValue.substring(0, VALUE_STRING_LENGTH_LIMIT) + '…' : strValue;\n}\nfunction constructDetailsForInterpolation(lView, rootIndex, expressionIndex, meta, changedValue) {\n const [propName, prefix, ...chunks] = meta.split(INTERPOLATION_DELIMITER);\n let oldValue = prefix,\n newValue = prefix;\n for (let i = 0; i < chunks.length; i++) {\n const slotIdx = rootIndex + i;\n oldValue += `${lView[slotIdx]}${chunks[i]}`;\n newValue += `${slotIdx === expressionIndex ? changedValue : lView[slotIdx]}${chunks[i]}`;\n }\n return {\n propName,\n oldValue,\n newValue\n };\n}\n/**\n * Constructs an object that contains details for the ExpressionChangedAfterItHasBeenCheckedError:\n * - property name (for property bindings or interpolations)\n * - old and new values, enriched using information from metadata\n *\n * More information on the metadata storage format can be found in `storePropertyBindingMetadata`\n * function description.\n */\nfunction getExpressionChangedErrorDetails(lView, bindingIndex, oldValue, newValue) {\n const tData = lView[TVIEW].data;\n const metadata = tData[bindingIndex];\n if (typeof metadata === 'string') {\n // metadata for property interpolation\n if (metadata.indexOf(INTERPOLATION_DELIMITER) > -1) {\n return constructDetailsForInterpolation(lView, bindingIndex, bindingIndex, metadata, newValue);\n }\n // metadata for property binding\n return {\n propName: metadata,\n oldValue,\n newValue\n };\n }\n // metadata is not available for this expression, check if this expression is a part of the\n // property interpolation by going from the current binding index left and look for a string that\n // contains INTERPOLATION_DELIMITER, the layout in tView.data for this case will look like this:\n // [..., 'id<69>Prefix <20> and <20> suffix', null, null, null, ...]\n if (metadata === null) {\n let idx = bindingIndex - 1;\n while (typeof tData[idx] !== 'string' && tData[idx + 1] === null) {\n idx--;\n }\n const meta = tData[idx];\n if (typeof meta === 'string') {\n const matches = meta.match(new RegExp(INTERPOLATION_DELIMITER, 'g'));\n // first interpolation delimiter separates property name from interpolation parts (in case of\n // property interpolations), so we subtract one from total number of found delimiters\n if (matches && matches.length - 1 > bindingIndex - idx) {\n return constructDetailsForInterpolation(lView, idx, bindingIndex, meta, newValue);\n }\n }\n }\n return {\n propName: undefined,\n oldValue,\n newValue\n };\n}\n\n/**\n * Returns an index of `classToSearch` in `className` taking token boundaries into account.\n *\n * `classIndexOf('AB A', 'A', 0)` will be 3 (not 0 since `AB!==A`)\n *\n * @param className A string containing classes (whitespace separated)\n * @param classToSearch A class name to locate\n * @param startingIndex Starting location of search\n * @returns an index of the located class (or -1 if not found)\n */\nfunction classIndexOf(className, classToSearch, startingIndex) {\n ngDevMode && assertNotEqual(classToSearch, '', 'can not look for \"\" string.');\n let end = className.length;\n while (true) {\n const foundIndex = className.indexOf(classToSearch, startingIndex);\n if (foundIndex === -1) return foundIndex;\n if (foundIndex === 0 || className.charCodeAt(foundIndex - 1) <= 32 /* CharCode.SPACE */) {\n // Ensure that it has leading whitespace\n const length = classToSearch.length;\n if (foundIndex + length === end || className.charCodeAt(foundIndex + length) <= 32 /* CharCode.SPACE */) {\n // Ensure that it has trailing whitespace\n return foundIndex;\n }\n }\n // False positive, keep searching from where we left off.\n startingIndex = foundIndex + 1;\n }\n}\nconst NG_TEMPLATE_SELECTOR = 'ng-template';\n/**\n * Search the `TAttributes` to see if it contains `cssClassToMatch` (case insensitive)\n *\n * @param tNode static data of the node to match\n * @param attrs `TAttributes` to search through.\n * @param cssClassToMatch class to match (lowercase)\n * @param isProjectionMode Whether or not class matching should look into the attribute `class` in\n * addition to the `AttributeMarker.Classes`.\n */\nfunction isCssClassMatching(tNode, attrs, cssClassToMatch, isProjectionMode) {\n ngDevMode && assertEqual(cssClassToMatch, cssClassToMatch.toLowerCase(), 'Class name expected to be lowercase.');\n let i = 0;\n if (isProjectionMode) {\n for (; i < attrs.length && typeof attrs[i] === 'string'; i += 2) {\n // Search for an implicit `class` attribute and check if its value matches `cssClassToMatch`.\n if (attrs[i] === 'class' && classIndexOf(attrs[i + 1].toLowerCase(), cssClassToMatch, 0) !== -1) {\n return true;\n }\n }\n } else if (isInlineTemplate(tNode)) {\n // Matching directives (i.e. when not matching for projection mode) should not consider the\n // class bindings that are present on inline templates, as those class bindings only target\n // the root node of the template, not the template itself.\n return false;\n }\n // Resume the search for classes after the `Classes` marker.\n i = attrs.indexOf(1 /* AttributeMarker.Classes */, i);\n if (i > -1) {\n // We found the classes section. Start searching for the class.\n let item;\n while (++i < attrs.length && typeof (item = attrs[i]) === 'string') {\n if (item.toLowerCase() === cssClassToMatch) {\n return true;\n }\n }\n }\n return false;\n}\n/**\n * Checks whether the `tNode` represents an inline template (e.g. `*ngFor`).\n *\n * @param tNode current TNode\n */\nfunction isInlineTemplate(tNode) {\n return tNode.type === 4 /* TNodeType.Container */ && tNode.value !== NG_TEMPLATE_SELECTOR;\n}\n/**\n * Function that checks whether a given tNode matches tag-based selector and has a valid type.\n *\n * Matching can be performed in 2 modes: projection mode (when we project nodes) and regular\n * directive matching mode:\n * - in the \"directive matching\" mode we do _not_ take TContainer's tagName into account if it is\n * different from NG_TEMPLATE_SELECTOR (value different from NG_TEMPLATE_SELECTOR indicates that a\n * tag name was extracted from * syntax so we would match the same directive twice);\n * - in the \"projection\" mode, we use a tag name potentially extracted from the * syntax processing\n * (applicable to TNodeType.Container only).\n */\nfunction hasTagAndTypeMatch(tNode, currentSelector, isProjectionMode) {\n const tagNameToCompare = tNode.type === 4 /* TNodeType.Container */ && !isProjectionMode ? NG_TEMPLATE_SELECTOR : tNode.value;\n return currentSelector === tagNameToCompare;\n}\n/**\n * A utility function to match an Ivy node static data against a simple CSS selector\n *\n * @param tNode static data of the node to match\n * @param selector The selector to try matching against the node.\n * @param isProjectionMode if `true` we are matching for content projection, otherwise we are doing\n * directive matching.\n * @returns true if node matches the selector.\n */\nfunction isNodeMatchingSelector(tNode, selector, isProjectionMode) {\n ngDevMode && assertDefined(selector[0], 'Selector should have a tag name');\n let mode = 4 /* SelectorFlags.ELEMENT */;\n const nodeAttrs = tNode.attrs;\n // Find the index of first attribute that has no value, only a name.\n const nameOnlyMarkerIdx = nodeAttrs !== null ? getNameOnlyMarkerIndex(nodeAttrs) : 0;\n // When processing \":not\" selectors, we skip to the next \":not\" if the\n // current one doesn't match\n let skipToNextSelector = false;\n for (let i = 0; i < selector.length; i++) {\n const current = selector[i];\n if (typeof current === 'number') {\n // If we finish processing a :not selector and it hasn't failed, return false\n if (!skipToNextSelector && !isPositive(mode) && !isPositive(current)) {\n return false;\n }\n // If we are skipping to the next :not() and this mode flag is positive,\n // it's a part of the current :not() selector, and we should keep skipping\n if (skipToNextSelector && isPositive(current)) continue;\n skipToNextSelector = false;\n mode = current | mode & 1 /* SelectorFlags.NOT */;\n continue;\n }\n if (skipToNextSelector) continue;\n if (mode & 4 /* SelectorFlags.ELEMENT */) {\n mode = 2 /* SelectorFlags.ATTRIBUTE */ | mode & 1 /* SelectorFlags.NOT */;\n if (current !== '' && !hasTagAndTypeMatch(tNode, current, isProjectionMode) || current === '' && selector.length === 1) {\n if (isPositive(mode)) return false;\n skipToNextSelector = true;\n }\n } else if (mode & 8 /* SelectorFlags.CLASS */) {\n if (nodeAttrs === null || !isCssClassMatching(tNode, nodeAttrs, current, isProjectionMode)) {\n if (isPositive(mode)) return false;\n skipToNextSelector = true;\n }\n } else {\n const selectorAttrValue = selector[++i];\n const attrIndexInNode = findAttrIndexInNode(current, nodeAttrs, isInlineTemplate(tNode), isProjectionMode);\n if (attrIndexInNode === -1) {\n if (isPositive(mode)) return false;\n skipToNextSelector = true;\n continue;\n }\n if (selectorAttrValue !== '') {\n let nodeAttrValue;\n if (attrIndexInNode > nameOnlyMarkerIdx) {\n nodeAttrValue = '';\n } else {\n ngDevMode && assertNotEqual(nodeAttrs[attrIndexInNode], 0 /* AttributeMarker.NamespaceURI */, 'We do not match directives on namespaced attributes');\n // we lowercase the attribute value to be able to match\n // selectors without case-sensitivity\n // (selectors are already in lowercase when generated)\n nodeAttrValue = nodeAttrs[attrIndexInNode + 1].toLowerCase();\n }\n if (mode & 2 /* SelectorFlags.ATTRIBUTE */ && selectorAttrValue !== nodeAttrValue) {\n if (isPositive(mode)) return false;\n skipToNextSelector = true;\n }\n }\n }\n }\n return isPositive(mode) || skipToNextSelector;\n}\nfunction isPositive(mode) {\n return (mode & 1 /* SelectorFlags.NOT */) === 0;\n}\n/**\n * Examines the attribute's definition array for a node to find the index of the\n * attribute that matches the given `name`.\n *\n * NOTE: This will not match namespaced attributes.\n *\n * Attribute matching depends upon `isInlineTemplate` and `isProjectionMode`.\n * The following table summarizes which types of attributes we attempt to match:\n *\n * ===========================================================================================================\n * Modes | Normal Attributes | Bindings Attributes | Template Attributes | I18n\n * Attributes\n * ===========================================================================================================\n * Inline + Projection | YES | YES | NO | YES\n * -----------------------------------------------------------------------------------------------------------\n * Inline + Directive | NO | NO | YES | NO\n * -----------------------------------------------------------------------------------------------------------\n * Non-inline + Projection | YES | YES | NO | YES\n * -----------------------------------------------------------------------------------------------------------\n * Non-inline + Directive | YES | YES | NO | YES\n * ===========================================================================================================\n *\n * @param name the name of the attribute to find\n * @param attrs the attribute array to examine\n * @param isInlineTemplate true if the node being matched is an inline template (e.g. `*ngFor`)\n * rather than a manually expanded template node (e.g `<ng-template>`).\n * @param isProjectionMode true if we are matching against content projection otherwise we are\n * matching against directives.\n */\nfunction findAttrIndexInNode(name, attrs, isInlineTemplate, isProjectionMode) {\n if (attrs === null) return -1;\n let i = 0;\n if (isProjectionMode || !isInlineTemplate) {\n let bindingsMode = false;\n while (i < attrs.length) {\n const maybeAttrName = attrs[i];\n if (maybeAttrName === name) {\n return i;\n } else if (maybeAttrName === 3 /* AttributeMarker.Bindings */ || maybeAttrName === 6 /* AttributeMarker.I18n */) {\n bindingsMode = true;\n } else if (maybeAttrName === 1 /* AttributeMarker.Classes */ || maybeAttrName === 2 /* AttributeMarker.Styles */) {\n let value = attrs[++i];\n // We should skip classes here because we have a separate mechanism for\n // matching classes in projection mode.\n while (typeof value === 'string') {\n value = attrs[++i];\n }\n continue;\n } else if (maybeAttrName === 4 /* AttributeMarker.Template */) {\n // We do not care about Template attributes in this scenario.\n break;\n } else if (maybeAttrName === 0 /* AttributeMarker.NamespaceURI */) {\n // Skip the whole namespaced attribute and value. This is by design.\n i += 4;\n continue;\n }\n // In binding mode there are only names, rather than name-value pairs.\n i += bindingsMode ? 1 : 2;\n }\n // We did not match the attribute\n return -1;\n } else {\n return matchTemplateAttribute(attrs, name);\n }\n}\nfunction isNodeMatchingSelectorList(tNode, selector, isProjectionMode = false) {\n for (let i = 0; i < selector.length; i++) {\n if (isNodeMatchingSelector(tNode, selector[i], isProjectionMode)) {\n return true;\n }\n }\n return false;\n}\nfunction getProjectAsAttrValue(tNode) {\n const nodeAttrs = tNode.attrs;\n if (nodeAttrs != null) {\n const ngProjectAsAttrIdx = nodeAttrs.indexOf(5 /* AttributeMarker.ProjectAs */);\n // only check for ngProjectAs in attribute names, don't accidentally match attribute's value\n // (attribute names are stored at even indexes)\n if ((ngProjectAsAttrIdx & 1) === 0) {\n return nodeAttrs[ngProjectAsAttrIdx + 1];\n }\n }\n return null;\n}\nfunction getNameOnlyMarkerIndex(nodeAttrs) {\n for (let i = 0; i < nodeAttrs.length; i++) {\n const nodeAttr = nodeAttrs[i];\n if (isNameOnlyAttributeMarker(nodeAttr)) {\n return i;\n }\n }\n return nodeAttrs.length;\n}\nfunction matchTemplateAttribute(attrs, name) {\n let i = attrs.indexOf(4 /* AttributeMarker.Template */);\n if (i > -1) {\n i++;\n while (i < attrs.length) {\n const attr = attrs[i];\n // Return in case we checked all template attrs and are switching to the next section in the\n // attrs array (that starts with a number that represents an attribute marker).\n if (typeof attr === 'number') return -1;\n if (attr === name) return i;\n i++;\n }\n }\n return -1;\n}\n/**\n * Checks whether a selector is inside a CssSelectorList\n * @param selector Selector to be checked.\n * @param list List in which to look for the selector.\n */\nfunction isSelectorInSelectorList(selector, list) {\n selectorListLoop: for (let i = 0; i < list.length; i++) {\n const currentSelectorInList = list[i];\n if (selector.length !== currentSelectorInList.length) {\n continue;\n }\n for (let j = 0; j < selector.length; j++) {\n if (selector[j] !== currentSelectorInList[j]) {\n continue selectorListLoop;\n }\n }\n return true;\n }\n return false;\n}\nfunction maybeWrapInNotSelector(isNegativeMode, chunk) {\n return isNegativeMode ? ':not(' + chunk.trim() + ')' : chunk;\n}\nfunction stringifyCSSSelector(selector) {\n let result = selector[0];\n let i = 1;\n let mode = 2 /* SelectorFlags.ATTRIBUTE */;\n let currentChunk = '';\n let isNegativeMode = false;\n while (i < selector.length) {\n let valueOrMarker = selector[i];\n if (typeof valueOrMarker === 'string') {\n if (mode & 2 /* SelectorFlags.ATTRIBUTE */) {\n const attrValue = selector[++i];\n currentChunk += '[' + valueOrMarker + (attrValue.length > 0 ? '=\"' + attrValue + '\"' : '') + ']';\n } else if (mode & 8 /* SelectorFlags.CLASS */) {\n currentChunk += '.' + valueOrMarker;\n } else if (mode & 4 /* SelectorFlags.ELEMENT */) {\n currentChunk += ' ' + valueOrMarker;\n }\n } else {\n //\n // Append current chunk to the final result in case we come across SelectorFlag, which\n // indicates that the previous section of a selector is over. We need to accumulate content\n // between flags to make sure we wrap the chunk later in :not() selector if needed, e.g.\n // ```\n // ['', Flags.CLASS, '.classA', Flags.CLASS | Flags.NOT, '.classB', '.classC']\n // ```\n // should be transformed to `.classA :not(.classB .classC)`.\n //\n // Note: for negative selector part, we accumulate content between flags until we find the\n // next negative flag. This is needed to support a case where `:not()` rule contains more than\n // one chunk, e.g. the following selector:\n // ```\n // ['', Flags.ELEMENT | Flags.NOT, 'p', Flags.CLASS, 'foo', Flags.CLASS | Flags.NOT, 'bar']\n // ```\n // should be stringified to `:not(p.foo) :not(.bar)`\n //\n if (currentChunk !== '' && !isPositive(valueOrMarker)) {\n result += maybeWrapInNotSelector(isNegativeMode, currentChunk);\n currentChunk = '';\n }\n mode = valueOrMarker;\n // According to CssSelector spec, once we come across `SelectorFlags.NOT` flag, the negative\n // mode is maintained for remaining chunks of a selector.\n isNegativeMode = isNegativeMode || !isPositive(mode);\n }\n i++;\n }\n if (currentChunk !== '') {\n result += maybeWrapInNotSelector(isNegativeMode, currentChunk);\n }\n return result;\n}\n/**\n * Generates string representation of CSS selector in parsed form.\n *\n * ComponentDef and DirectiveDef are generated with the selector in parsed form to avoid doing\n * additional parsing at runtime (for example, for directive matching). However in some cases (for\n * example, while bootstrapping a component), a string version of the selector is required to query\n * for the host element on the page. This function takes the parsed form of a selector and returns\n * its string representation.\n *\n * @param selectorList selector in parsed form\n * @returns string representation of a given selector\n */\nfunction stringifyCSSSelectorList(selectorList) {\n return selectorList.map(stringifyCSSSelector).join(',');\n}\n/**\n * Extracts attributes and classes information from a given CSS selector.\n *\n * This function is used while creating a component dynamically. In this case, the host element\n * (that is created dynamically) should contain attributes and classes specified in component's CSS\n * selector.\n *\n * @param selector CSS selector in parsed form (in a form of array)\n * @returns object with `attrs` and `classes` fields that contain extracted information\n */\nfunction extractAttrsAndClassesFromSelector(selector) {\n const attrs = [];\n const classes = [];\n let i = 1;\n let mode = 2 /* SelectorFlags.ATTRIBUTE */;\n while (i < selector.length) {\n let valueOrMarker = selector[i];\n if (typeof valueOrMarker === 'string') {\n if (mode === 2 /* SelectorFlags.ATTRIBUTE */) {\n if (valueOrMarker !== '') {\n attrs.push(valueOrMarker, selector[++i]);\n }\n } else if (mode === 8 /* SelectorFlags.CLASS */) {\n classes.push(valueOrMarker);\n }\n } else {\n // According to CssSelector spec, once we come across `SelectorFlags.NOT` flag, the negative\n // mode is maintained for remaining chunks of a selector. Since attributes and classes are\n // extracted only for \"positive\" part of the selector, we can stop here.\n if (!isPositive(mode)) break;\n mode = valueOrMarker;\n }\n i++;\n }\n if (classes.length) {\n attrs.push(1 /* AttributeMarker.Classes */, ...classes);\n }\n return attrs;\n}\n\n/** A special value which designates that a value has not changed. */\nconst NO_CHANGE = typeof ngDevMode === 'undefined' || ngDevMode ? {\n __brand__: 'NO_CHANGE'\n} : {};\nfunction createTextNode(renderer, value) {\n return renderer.createText(value);\n}\nfunction updateTextNode(renderer, rNode, value) {\n renderer.setValue(rNode, value);\n}\nfunction createCommentNode(renderer, value) {\n return renderer.createComment(escapeCommentText(value));\n}\n/**\n * Creates a native element from a tag name, using a renderer.\n * @param renderer A renderer to use\n * @param name the tag name\n * @param namespace Optional namespace for element.\n * @returns the element created\n */\nfunction createElementNode(renderer, name, namespace) {\n return renderer.createElement(name, namespace);\n}\n/**\n * Inserts a native node before another native node for a given parent.\n * This is a utility function that can be used when native nodes were determined.\n */\nfunction nativeInsertBefore(renderer, parent, child, beforeNode, isMove) {\n renderer.insertBefore(parent, child, beforeNode, isMove);\n}\nfunction nativeAppendChild(renderer, parent, child) {\n ngDevMode && assertDefined(parent, 'parent node must be defined');\n renderer.appendChild(parent, child);\n}\nfunction nativeAppendOrInsertBefore(renderer, parent, child, beforeNode, isMove) {\n if (beforeNode !== null) {\n nativeInsertBefore(renderer, parent, child, beforeNode, isMove);\n } else {\n nativeAppendChild(renderer, parent, child);\n }\n}\n/**\n * Removes a native node itself using a given renderer. To remove the node we are looking up its\n * parent from the native tree as not all platforms / browsers support the equivalent of\n * node.remove().\n *\n * @param renderer A renderer to be used\n * @param rNode The native node that should be removed\n * @param isHostElement A flag indicating if a node to be removed is a host of a component.\n */\nfunction nativeRemoveNode(renderer, rNode, isHostElement) {\n renderer.removeChild(null, rNode, isHostElement);\n}\n/**\n * Clears the contents of a given RElement.\n *\n * @param rElement the native RElement to be cleared\n */\nfunction clearElementContents(rElement) {\n rElement.textContent = '';\n}\n/**\n * Write `cssText` to `RElement`.\n *\n * This function does direct write without any reconciliation. Used for writing initial values, so\n * that static styling values do not pull in the style parser.\n *\n * @param renderer Renderer to use\n * @param element The element which needs to be updated.\n * @param newValue The new class list to write.\n */\nfunction writeDirectStyle(renderer, element, newValue) {\n ngDevMode && assertString(newValue, \"'newValue' should be a string\");\n renderer.setAttribute(element, 'style', newValue);\n}\n/**\n * Write `className` to `RElement`.\n *\n * This function does direct write without any reconciliation. Used for writing initial values, so\n * that static styling values do not pull in the style parser.\n *\n * @param renderer Renderer to use\n * @param element The element which needs to be updated.\n * @param newValue The new class list to write.\n */\nfunction writeDirectClass(renderer, element, newValue) {\n ngDevMode && assertString(newValue, \"'newValue' should be a string\");\n if (newValue === '') {\n // There are tests in `google3` which expect `element.getAttribute('class')` to be `null`.\n renderer.removeAttribute(element, 'class');\n } else {\n renderer.setAttribute(element, 'class', newValue);\n }\n}\n/** Sets up the static DOM attributes on an `RNode`. */\nfunction setupStaticAttributes(renderer, element, tNode) {\n const {\n mergedAttrs,\n classes,\n styles\n } = tNode;\n if (mergedAttrs !== null) {\n setUpAttributes(renderer, element, mergedAttrs);\n }\n if (classes !== null) {\n writeDirectClass(renderer, element, classes);\n }\n if (styles !== null) {\n writeDirectStyle(renderer, element, styles);\n }\n}\n\n/**\n * Creates a TView instance\n *\n * @param type Type of `TView`.\n * @param declTNode Declaration location of this `TView`.\n * @param templateFn Template function\n * @param decls The number of nodes, local refs, and pipes in this template\n * @param directives Registry of directives for this view\n * @param pipes Registry of pipes for this view\n * @param viewQuery View queries for this view\n * @param schemas Schemas for this view\n * @param consts Constants for this view\n */\nfunction createTView(type, declTNode, templateFn, decls, vars, directives, pipes, viewQuery, schemas, constsOrFactory, ssrId) {\n const bindingStartIndex = HEADER_OFFSET + decls;\n // This length does not yet contain host bindings from child directives because at this point,\n // we don't know which directives are active on this template. As soon as a directive is matched\n // that has a host binding, we will update the blueprint with that def's hostVars count.\n const initialViewLength = bindingStartIndex + vars;\n const blueprint = createViewBlueprint(bindingStartIndex, initialViewLength);\n const consts = typeof constsOrFactory === 'function' ? constsOrFactory() : constsOrFactory;\n const tView = blueprint[TVIEW] = {\n type: type,\n blueprint: blueprint,\n template: templateFn,\n queries: null,\n viewQuery: viewQuery,\n declTNode: declTNode,\n data: blueprint.slice().fill(null, bindingStartIndex),\n bindingStartIndex: bindingStartIndex,\n expandoStartIndex: initialViewLength,\n hostBindingOpCodes: null,\n firstCreatePass: true,\n firstUpdatePass: true,\n staticViewQueries: false,\n staticContentQueries: false,\n preOrderHooks: null,\n preOrderCheckHooks: null,\n contentHooks: null,\n contentCheckHooks: null,\n viewHooks: null,\n viewCheckHooks: null,\n destroyHooks: null,\n cleanup: null,\n contentQueries: null,\n components: null,\n directiveRegistry: typeof directives === 'function' ? directives() : directives,\n pipeRegistry: typeof pipes === 'function' ? pipes() : pipes,\n firstChild: null,\n schemas: schemas,\n consts: consts,\n incompleteFirstPass: false,\n ssrId\n };\n if (ngDevMode) {\n // For performance reasons it is important that the tView retains the same shape during runtime.\n // (To make sure that all of the code is monomorphic.) For this reason we seal the object to\n // prevent class transitions.\n Object.seal(tView);\n }\n return tView;\n}\nfunction createViewBlueprint(bindingStartIndex, initialViewLength) {\n const blueprint = [];\n for (let i = 0; i < initialViewLength; i++) {\n blueprint.push(i < bindingStartIndex ? null : NO_CHANGE);\n }\n return blueprint;\n}\n/**\n * Gets TView from a template function or creates a new TView\n * if it doesn't already exist.\n *\n * @param def ComponentDef\n * @returns TView\n */\nfunction getOrCreateComponentTView(def) {\n const tView = def.tView;\n // Create a TView if there isn't one, or recreate it if the first create pass didn't\n // complete successfully since we can't know for sure whether it's in a usable shape.\n if (tView === null || tView.incompleteFirstPass) {\n // Declaration node here is null since this function is called when we dynamically create a\n // component and hence there is no declaration.\n const declTNode = null;\n return def.tView = createTView(1 /* TViewType.Component */, declTNode, def.template, def.decls, def.vars, def.directiveDefs, def.pipeDefs, def.viewQuery, def.schemas, def.consts, def.id);\n }\n return tView;\n}\nfunction createLView(parentLView, tView, context, flags, host, tHostNode, environment, renderer, injector, embeddedViewInjector, hydrationInfo) {\n const lView = tView.blueprint.slice();\n lView[HOST] = host;\n lView[FLAGS] = flags | 4 /* LViewFlags.CreationMode */ | 128 /* LViewFlags.Attached */ | 8 /* LViewFlags.FirstLViewPass */ | 64 /* LViewFlags.Dirty */ | 1024 /* LViewFlags.RefreshView */;\n if (embeddedViewInjector !== null || parentLView && parentLView[FLAGS] & 2048 /* LViewFlags.HasEmbeddedViewInjector */) {\n lView[FLAGS] |= 2048 /* LViewFlags.HasEmbeddedViewInjector */;\n }\n resetPreOrderHookFlags(lView);\n ngDevMode && tView.declTNode && parentLView && assertTNodeForLView(tView.declTNode, parentLView);\n lView[PARENT] = lView[DECLARATION_VIEW] = parentLView;\n lView[CONTEXT] = context;\n lView[ENVIRONMENT] = environment || parentLView && parentLView[ENVIRONMENT];\n ngDevMode && assertDefined(lView[ENVIRONMENT], 'LViewEnvironment is required');\n lView[RENDERER] = renderer || parentLView && parentLView[RENDERER];\n ngDevMode && assertDefined(lView[RENDERER], 'Renderer is required');\n lView[INJECTOR] = injector || parentLView && parentLView[INJECTOR] || null;\n lView[T_HOST] = tHostNode;\n lView[ID] = getUniqueLViewId();\n lView[HYDRATION] = hydrationInfo;\n lView[EMBEDDED_VIEW_INJECTOR] = embeddedViewInjector;\n ngDevMode && assertEqual(tView.type == 2 /* TViewType.Embedded */ ? parentLView !== null : true, true, 'Embedded views must have parentLView');\n lView[DECLARATION_COMPONENT_VIEW] = tView.type == 2 /* TViewType.Embedded */ ? parentLView[DECLARATION_COMPONENT_VIEW] : lView;\n return lView;\n}\nfunction createComponentLView(lView, hostTNode, def) {\n const native = getNativeByTNode(hostTNode, lView);\n const tView = getOrCreateComponentTView(def);\n // Only component views should be added to the view tree directly. Embedded views are\n // accessed through their containers because they may be removed / re-added later.\n const rendererFactory = lView[ENVIRONMENT].rendererFactory;\n const componentView = addToEndOfViewTree(lView, createLView(lView, tView, null, getInitialLViewFlagsFromDef(def), native, hostTNode, null, rendererFactory.createRenderer(native, def), null, null, null));\n // Component view will always be created before any injected LContainers,\n // so this is a regular element, wrap it with the component view\n return lView[hostTNode.index] = componentView;\n}\n/**\n * Gets the initial set of LView flags based on the component definition that the LView represents.\n * @param def Component definition from which to determine the flags.\n */\nfunction getInitialLViewFlagsFromDef(def) {\n let flags = 16 /* LViewFlags.CheckAlways */;\n if (def.signals) {\n flags = 4096 /* LViewFlags.SignalView */;\n } else if (def.onPush) {\n flags = 64 /* LViewFlags.Dirty */;\n }\n return flags;\n}\n/**\n * When elements are created dynamically after a view blueprint is created (e.g. through\n * i18nApply()), we need to adjust the blueprint for future template passes.\n *\n * @param tView `TView` associated with `LView`\n * @param lView The `LView` containing the blueprint to adjust\n * @param numSlotsToAlloc The number of slots to alloc in the LView, should be >0\n * @param initialValue Initial value to store in blueprint\n */\nfunction allocExpando(tView, lView, numSlotsToAlloc, initialValue) {\n if (numSlotsToAlloc === 0) return -1;\n if (ngDevMode) {\n assertFirstCreatePass(tView);\n assertSame(tView, lView[TVIEW], '`LView` must be associated with `TView`!');\n assertEqual(tView.data.length, lView.length, 'Expecting LView to be same size as TView');\n assertEqual(tView.data.length, tView.blueprint.length, 'Expecting Blueprint to be same size as TView');\n assertFirstUpdatePass(tView);\n }\n const allocIdx = lView.length;\n for (let i = 0; i < numSlotsToAlloc; i++) {\n lView.push(initialValue);\n tView.blueprint.push(initialValue);\n tView.data.push(null);\n }\n return allocIdx;\n}\n/**\n * Adds LView or LContainer to the end of the current view tree.\n *\n * This structure will be used to traverse through nested views to remove listeners\n * and call onDestroy callbacks.\n *\n * @param lView The view where LView or LContainer should be added\n * @param adjustedHostIndex Index of the view's host node in LView[], adjusted for header\n * @param lViewOrLContainer The LView or LContainer to add to the view tree\n * @returns The state passed in\n */\nfunction addToEndOfViewTree(lView, lViewOrLContainer) {\n // TODO(benlesh/misko): This implementation is incorrect, because it always adds the LContainer\n // to the end of the queue, which means if the developer retrieves the LContainers from RNodes out\n // of order, the change detection will run out of order, as the act of retrieving the the\n // LContainer from the RNode is what adds it to the queue.\n if (lView[CHILD_HEAD]) {\n lView[CHILD_TAIL][NEXT] = lViewOrLContainer;\n } else {\n lView[CHILD_HEAD] = lViewOrLContainer;\n }\n lView[CHILD_TAIL] = lViewOrLContainer;\n return lViewOrLContainer;\n}\n\n/**\n * Advances to an element for later binding instructions.\n *\n * Used in conjunction with instructions like {@link property} to act on elements with specified\n * indices, for example those created with {@link element} or {@link elementStart}.\n *\n * ```ts\n * (rf: RenderFlags, ctx: any) => {\n * if (rf & 1) {\n * text(0, 'Hello');\n * text(1, 'Goodbye')\n * element(2, 'div');\n * }\n * if (rf & 2) {\n * advance(2); // Advance twice to the <div>.\n * property('title', 'test');\n * }\n * }\n * ```\n * @param delta Number of elements to advance forwards by.\n *\n * @codeGenApi\n */\nfunction ɵɵadvance(delta = 1) {\n ngDevMode && assertGreaterThan(delta, 0, 'Can only advance forward');\n selectIndexInternal(getTView(), getLView(), getSelectedIndex() + delta, !!ngDevMode && isInCheckNoChangesMode());\n}\nfunction selectIndexInternal(tView, lView, index, checkNoChangesMode) {\n ngDevMode && assertIndexInDeclRange(lView[TVIEW], index);\n // Flush the initial hooks for elements in the view that have been added up to this point.\n // PERF WARNING: do NOT extract this to a separate function without running benchmarks\n if (!checkNoChangesMode) {\n const hooksInitPhaseCompleted = (lView[FLAGS] & 3 /* LViewFlags.InitPhaseStateMask */) === 3 /* InitPhaseState.InitPhaseCompleted */;\n if (hooksInitPhaseCompleted) {\n const preOrderCheckHooks = tView.preOrderCheckHooks;\n if (preOrderCheckHooks !== null) {\n executeCheckHooks(lView, preOrderCheckHooks, index);\n }\n } else {\n const preOrderHooks = tView.preOrderHooks;\n if (preOrderHooks !== null) {\n executeInitAndCheckHooks(lView, preOrderHooks, 0 /* InitPhaseState.OnInitHooksToBeRun */, index);\n }\n }\n }\n // We must set the selected index *after* running the hooks, because hooks may have side-effects\n // that cause other template functions to run, thus updating the selected index, which is global\n // state. If we run `setSelectedIndex` *before* we run the hooks, in some cases the selected index\n // will be altered by the time we leave the `ɵɵadvance` instruction.\n setSelectedIndex(index);\n}\n\n/** Flags describing an input for a directive. */\nvar InputFlags;\n(function (InputFlags) {\n InputFlags[InputFlags[\"None\"] = 0] = \"None\";\n InputFlags[InputFlags[\"SignalBased\"] = 1] = \"SignalBased\";\n InputFlags[InputFlags[\"HasDecoratorInputTransform\"] = 2] = \"HasDecoratorInputTransform\";\n})(InputFlags || (InputFlags = {}));\nfunction writeToDirectiveInput(def, instance, publicName, value) {\n const prevConsumer = setActiveConsumer(null);\n try {\n if (ngDevMode) {\n if (!def.inputs.hasOwnProperty(publicName)) {\n throw new Error(`ASSERTION ERROR: Directive ${def.type.name} does not have an input with a public name of \"${publicName}\"`);\n }\n // Usually we resolve the directive instance using `LView[someIndex]` before writing to an\n // input, however if the read happens to early, the `LView[someIndex]` might actually be a\n // `NodeInjectorFactory`. Check for this specific case here since it can break in subtle ways.\n if (instance instanceof NodeInjectorFactory) {\n throw new Error(`ASSERTION ERROR: Cannot write input to factory for type ${def.type.name}. Directive has not been created yet.`);\n }\n }\n const [privateName, flags, transform] = def.inputs[publicName];\n // If we know we are dealing with a signal input, we cache its reference\n // in a tree-shakable way. The input signal node can then be used for\n // value transform execution or actual value updates without introducing\n // additional megamorphic accesses for accessing the instance field.\n let inputSignalNode = null;\n if ((flags & InputFlags.SignalBased) !== 0) {\n const field = instance[privateName];\n inputSignalNode = field[SIGNAL];\n }\n // If there is a signal node and a transform, run it before potentially\n // delegating to features like `NgOnChanges`.\n if (inputSignalNode !== null && inputSignalNode.transformFn !== undefined) {\n value = inputSignalNode.transformFn(value);\n } else if (transform !== null) {\n // If there is a decorator input transform, run it.\n value = transform.call(instance, value);\n }\n if (def.setInput !== null) {\n def.setInput(instance, inputSignalNode, value, publicName, privateName);\n } else {\n applyValueToInputField(instance, inputSignalNode, privateName, value);\n }\n } finally {\n setActiveConsumer(prevConsumer);\n }\n}\n\n/**\n * Flags for renderer-specific style modifiers.\n * @publicApi\n */\nvar RendererStyleFlags2;\n(function (RendererStyleFlags2) {\n // TODO(misko): This needs to be refactored into a separate file so that it can be imported from\n // `node_manipulation.ts` Currently doing the import cause resolution order to change and fails\n // the tests. The work around is to have hard coded value in `node_manipulation.ts` for now.\n /**\n * Marks a style as important.\n */\n RendererStyleFlags2[RendererStyleFlags2[\"Important\"] = 1] = \"Important\";\n /**\n * Marks a style as using dash case naming (this-is-dash-case).\n */\n RendererStyleFlags2[RendererStyleFlags2[\"DashCase\"] = 2] = \"DashCase\";\n})(RendererStyleFlags2 || (RendererStyleFlags2 = {}));\nlet _icuContainerIterate;\n/**\n * Iterator which provides ability to visit all of the `TIcuContainerNode` root `RNode`s.\n */\nfunction icuContainerIterate(tIcuContainerNode, lView) {\n return _icuContainerIterate(tIcuContainerNode, lView);\n}\n/**\n * Ensures that `IcuContainerVisitor`'s implementation is present.\n *\n * This function is invoked when i18n instruction comes across an ICU. The purpose is to allow the\n * bundler to tree shake ICU logic and only load it if ICU instruction is executed.\n */\nfunction ensureIcuContainerVisitorLoaded(loader) {\n if (_icuContainerIterate === undefined) {\n // Do not inline this function. We want to keep `ensureIcuContainerVisitorLoaded` light, so it\n // can be inlined into call-site.\n _icuContainerIterate = loader();\n }\n}\n\n/**\n * NOTE: for performance reasons, the possible actions are inlined within the function instead of\n * being passed as an argument.\n */\nfunction applyToElementOrContainer(action, renderer, parent, lNodeToHandle, beforeNode) {\n // If this slot was allocated for a text node dynamically created by i18n, the text node itself\n // won't be created until i18nApply() in the update block, so this node should be skipped.\n // For more info, see \"ICU expressions should work inside an ngTemplateOutlet inside an ngFor\"\n // in `i18n_spec.ts`.\n if (lNodeToHandle != null) {\n let lContainer;\n let isComponent = false;\n // We are expecting an RNode, but in the case of a component or LContainer the `RNode` is\n // wrapped in an array which needs to be unwrapped. We need to know if it is a component and if\n // it has LContainer so that we can process all of those cases appropriately.\n if (isLContainer(lNodeToHandle)) {\n lContainer = lNodeToHandle;\n } else if (isLView(lNodeToHandle)) {\n isComponent = true;\n ngDevMode && assertDefined(lNodeToHandle[HOST], 'HOST must be defined for a component LView');\n lNodeToHandle = lNodeToHandle[HOST];\n }\n const rNode = unwrapRNode(lNodeToHandle);\n if (action === 0 /* WalkTNodeTreeAction.Create */ && parent !== null) {\n if (beforeNode == null) {\n nativeAppendChild(renderer, parent, rNode);\n } else {\n nativeInsertBefore(renderer, parent, rNode, beforeNode || null, true);\n }\n } else if (action === 1 /* WalkTNodeTreeAction.Insert */ && parent !== null) {\n nativeInsertBefore(renderer, parent, rNode, beforeNode || null, true);\n } else if (action === 2 /* WalkTNodeTreeAction.Detach */) {\n nativeRemoveNode(renderer, rNode, isComponent);\n } else if (action === 3 /* WalkTNodeTreeAction.Destroy */) {\n renderer.destroyNode(rNode);\n }\n if (lContainer != null) {\n applyContainer(renderer, action, lContainer, parent, beforeNode);\n }\n }\n}\n/**\n * Removes all DOM elements associated with a view.\n *\n * Because some root nodes of the view may be containers, we sometimes need\n * to propagate deeply into the nested containers to remove all elements in the\n * views beneath it.\n *\n * @param tView The `TView' of the `LView` from which elements should be added or removed\n * @param lView The view from which elements should be added or removed\n */\nfunction removeViewFromDOM(tView, lView) {\n detachViewFromDOM(tView, lView);\n lView[HOST] = null;\n lView[T_HOST] = null;\n}\n/**\n * Adds all DOM elements associated with a view.\n *\n * Because some root nodes of the view may be containers, we sometimes need\n * to propagate deeply into the nested containers to add all elements in the\n * views beneath it.\n *\n * @param tView The `TView' of the `LView` from which elements should be added or removed\n * @param parentTNode The `TNode` where the `LView` should be attached to.\n * @param renderer Current renderer to use for DOM manipulations.\n * @param lView The view from which elements should be added or removed\n * @param parentNativeNode The parent `RElement` where it should be inserted into.\n * @param beforeNode The node before which elements should be added, if insert mode\n */\nfunction addViewToDOM(tView, parentTNode, renderer, lView, parentNativeNode, beforeNode) {\n lView[HOST] = parentNativeNode;\n lView[T_HOST] = parentTNode;\n applyView(tView, lView, renderer, 1 /* WalkTNodeTreeAction.Insert */, parentNativeNode, beforeNode);\n}\n/**\n * Detach a `LView` from the DOM by detaching its nodes.\n *\n * @param tView The `TView' of the `LView` to be detached\n * @param lView the `LView` to be detached.\n */\nfunction detachViewFromDOM(tView, lView) {\n // When we remove a view from the DOM, we need to rerun afterRender hooks\n // We don't necessarily needs to run change detection. DOM removal only requires\n // change detection if animations are enabled (this notification is handled by animations).\n lView[ENVIRONMENT].changeDetectionScheduler?.notify(9 /* NotificationSource.ViewDetachedFromDOM */);\n applyView(tView, lView, lView[RENDERER], 2 /* WalkTNodeTreeAction.Detach */, null, null);\n}\n/**\n * Traverses down and up the tree of views and containers to remove listeners and\n * call onDestroy callbacks.\n *\n * Notes:\n * - Because it's used for onDestroy calls, it needs to be bottom-up.\n * - Must process containers instead of their views to avoid splicing\n * when views are destroyed and re-added.\n * - Using a while loop because it's faster than recursion\n * - Destroy only called on movement to sibling or movement to parent (laterally or up)\n *\n * @param rootView The view to destroy\n */\nfunction destroyViewTree(rootView) {\n // If the view has no children, we can clean it up and return early.\n let lViewOrLContainer = rootView[CHILD_HEAD];\n if (!lViewOrLContainer) {\n return cleanUpView(rootView[TVIEW], rootView);\n }\n while (lViewOrLContainer) {\n let next = null;\n if (isLView(lViewOrLContainer)) {\n // If LView, traverse down to child.\n next = lViewOrLContainer[CHILD_HEAD];\n } else {\n ngDevMode && assertLContainer(lViewOrLContainer);\n // If container, traverse down to its first LView.\n const firstView = lViewOrLContainer[CONTAINER_HEADER_OFFSET];\n if (firstView) next = firstView;\n }\n if (!next) {\n // Only clean up view when moving to the side or up, as destroy hooks\n // should be called in order from the bottom up.\n while (lViewOrLContainer && !lViewOrLContainer[NEXT] && lViewOrLContainer !== rootView) {\n if (isLView(lViewOrLContainer)) {\n cleanUpView(lViewOrLContainer[TVIEW], lViewOrLContainer);\n }\n lViewOrLContainer = lViewOrLContainer[PARENT];\n }\n if (lViewOrLContainer === null) lViewOrLContainer = rootView;\n if (isLView(lViewOrLContainer)) {\n cleanUpView(lViewOrLContainer[TVIEW], lViewOrLContainer);\n }\n next = lViewOrLContainer && lViewOrLContainer[NEXT];\n }\n lViewOrLContainer = next;\n }\n}\nfunction detachMovedView(declarationContainer, lView) {\n ngDevMode && assertLContainer(declarationContainer);\n ngDevMode && assertDefined(declarationContainer[MOVED_VIEWS], 'A projected view should belong to a non-empty projected views collection');\n const movedViews = declarationContainer[MOVED_VIEWS];\n const declarationViewIndex = movedViews.indexOf(lView);\n movedViews.splice(declarationViewIndex, 1);\n}\n/**\n * A standalone function which destroys an LView,\n * conducting clean up (e.g. removing listeners, calling onDestroys).\n *\n * @param tView The `TView' of the `LView` to be destroyed\n * @param lView The view to be destroyed.\n */\nfunction destroyLView(tView, lView) {\n if (isDestroyed(lView)) {\n return;\n }\n const renderer = lView[RENDERER];\n if (renderer.destroyNode) {\n applyView(tView, lView, renderer, 3 /* WalkTNodeTreeAction.Destroy */, null, null);\n }\n destroyViewTree(lView);\n}\n/**\n * Calls onDestroys hooks for all directives and pipes in a given view and then removes all\n * listeners. Listeners are removed as the last step so events delivered in the onDestroys hooks\n * can be propagated to @Output listeners.\n *\n * @param tView `TView` for the `LView` to clean up.\n * @param lView The LView to clean up\n */\nfunction cleanUpView(tView, lView) {\n if (isDestroyed(lView)) {\n return;\n }\n const prevConsumer = setActiveConsumer(null);\n try {\n // Usually the Attached flag is removed when the view is detached from its parent, however\n // if it's a root view, the flag won't be unset hence why we're also removing on destroy.\n lView[FLAGS] &= ~128 /* LViewFlags.Attached */;\n // Mark the LView as destroyed *before* executing the onDestroy hooks. An onDestroy hook\n // runs arbitrary user code, which could include its own `viewRef.destroy()` (or similar). If\n // We don't flag the view as destroyed before the hooks, this could lead to an infinite loop.\n // This also aligns with the ViewEngine behavior. It also means that the onDestroy hook is\n // really more of an \"afterDestroy\" hook if you think about it.\n lView[FLAGS] |= 256 /* LViewFlags.Destroyed */;\n lView[REACTIVE_TEMPLATE_CONSUMER] && consumerDestroy(lView[REACTIVE_TEMPLATE_CONSUMER]);\n executeOnDestroys(tView, lView);\n processCleanups(tView, lView);\n // For component views only, the local renderer is destroyed at clean up time.\n if (lView[TVIEW].type === 1 /* TViewType.Component */) {\n lView[RENDERER].destroy();\n }\n const declarationContainer = lView[DECLARATION_LCONTAINER];\n // we are dealing with an embedded view that is still inserted into a container\n if (declarationContainer !== null && isLContainer(lView[PARENT])) {\n // and this is a projected view\n if (declarationContainer !== lView[PARENT]) {\n detachMovedView(declarationContainer, lView);\n }\n // For embedded views still attached to a container: remove query result from this view.\n const lQueries = lView[QUERIES];\n if (lQueries !== null) {\n lQueries.detachView(tView);\n }\n }\n // Unregister the view once everything else has been cleaned up.\n unregisterLView(lView);\n } finally {\n setActiveConsumer(prevConsumer);\n }\n}\n/** Removes listeners and unsubscribes from output subscriptions */\nfunction processCleanups(tView, lView) {\n ngDevMode && assertNotReactive(processCleanups.name);\n const tCleanup = tView.cleanup;\n const lCleanup = lView[CLEANUP];\n if (tCleanup !== null) {\n for (let i = 0; i < tCleanup.length - 1; i += 2) {\n if (typeof tCleanup[i] === 'string') {\n // This is a native DOM listener. It will occupy 4 entries in the TCleanup array (hence i +=\n // 2 at the end of this block).\n const targetIdx = tCleanup[i + 3];\n ngDevMode && assertNumber(targetIdx, 'cleanup target must be a number');\n if (targetIdx >= 0) {\n // Destroy anything whose teardown is a function call (e.g. QueryList, ModelSignal).\n lCleanup[targetIdx]();\n } else {\n // Subscription\n lCleanup[-targetIdx].unsubscribe();\n }\n i += 2;\n } else {\n // This is a cleanup function that is grouped with the index of its context\n const context = lCleanup[tCleanup[i + 1]];\n tCleanup[i].call(context);\n }\n }\n }\n if (lCleanup !== null) {\n lView[CLEANUP] = null;\n }\n const destroyHooks = lView[ON_DESTROY_HOOKS];\n if (destroyHooks !== null) {\n // Reset the ON_DESTROY_HOOKS array before iterating over it to prevent hooks that unregister\n // themselves from mutating the array during iteration.\n lView[ON_DESTROY_HOOKS] = null;\n for (let i = 0; i < destroyHooks.length; i++) {\n const destroyHooksFn = destroyHooks[i];\n ngDevMode && assertFunction(destroyHooksFn, 'Expecting destroy hook to be a function.');\n destroyHooksFn();\n }\n }\n // Destroy effects registered to the view. Many of these will have been processed above.\n const effects = lView[EFFECTS];\n if (effects !== null) {\n lView[EFFECTS] = null;\n for (const effect of effects) {\n effect.destroy();\n }\n }\n}\n/** Calls onDestroy hooks for this view */\nfunction executeOnDestroys(tView, lView) {\n ngDevMode && assertNotReactive(executeOnDestroys.name);\n let destroyHooks;\n if (tView != null && (destroyHooks = tView.destroyHooks) != null) {\n for (let i = 0; i < destroyHooks.length; i += 2) {\n const context = lView[destroyHooks[i]];\n // Only call the destroy hook if the context has been requested.\n if (!(context instanceof NodeInjectorFactory)) {\n const toCall = destroyHooks[i + 1];\n if (Array.isArray(toCall)) {\n for (let j = 0; j < toCall.length; j += 2) {\n const callContext = context[toCall[j]];\n const hook = toCall[j + 1];\n profiler(4 /* ProfilerEvent.LifecycleHookStart */, callContext, hook);\n try {\n hook.call(callContext);\n } finally {\n profiler(5 /* ProfilerEvent.LifecycleHookEnd */, callContext, hook);\n }\n }\n } else {\n profiler(4 /* ProfilerEvent.LifecycleHookStart */, context, toCall);\n try {\n toCall.call(context);\n } finally {\n profiler(5 /* ProfilerEvent.LifecycleHookEnd */, context, toCall);\n }\n }\n }\n }\n }\n}\n/**\n * Returns a native element if a node can be inserted into the given parent.\n *\n * There are two reasons why we may not be able to insert a element immediately.\n * - Projection: When creating a child content element of a component, we have to skip the\n * insertion because the content of a component will be projected.\n * `<component><content>delayed due to projection</content></component>`\n * - Parent container is disconnected: This can happen when we are inserting a view into\n * parent container, which itself is disconnected. For example the parent container is part\n * of a View which has not be inserted or is made for projection but has not been inserted\n * into destination.\n *\n * @param tView: Current `TView`.\n * @param tNode: `TNode` for which we wish to retrieve render parent.\n * @param lView: Current `LView`.\n */\nfunction getParentRElement(tView, tNode, lView) {\n return getClosestRElement(tView, tNode.parent, lView);\n}\n/**\n * Get closest `RElement` or `null` if it can't be found.\n *\n * If `TNode` is `TNodeType.Element` => return `RElement` at `LView[tNode.index]` location.\n * If `TNode` is `TNodeType.ElementContainer|IcuContain` => return the parent (recursively).\n * If `TNode` is `null` then return host `RElement`:\n * - return `null` if projection\n * - return `null` if parent container is disconnected (we have no parent.)\n *\n * @param tView: Current `TView`.\n * @param tNode: `TNode` for which we wish to retrieve `RElement` (or `null` if host element is\n * needed).\n * @param lView: Current `LView`.\n * @returns `null` if the `RElement` can't be determined at this time (no parent / projection)\n */\nfunction getClosestRElement(tView, tNode, lView) {\n let parentTNode = tNode;\n // Skip over element and ICU containers as those are represented by a comment node and\n // can't be used as a render parent. Also skip let declarations since they don't have a\n // corresponding DOM node at all.\n while (parentTNode !== null && parentTNode.type & (8 /* TNodeType.ElementContainer */ | 32 /* TNodeType.Icu */ | 128 /* TNodeType.LetDeclaration */)) {\n tNode = parentTNode;\n parentTNode = tNode.parent;\n }\n // If the parent tNode is null, then we are inserting across views: either into an embedded view\n // or a component view.\n if (parentTNode === null) {\n // We are inserting a root element of the component view into the component host element and\n // it should always be eager.\n return lView[HOST];\n } else {\n ngDevMode && assertTNodeType(parentTNode, 3 /* TNodeType.AnyRNode */ | 4 /* TNodeType.Container */);\n if (isComponentHost(parentTNode)) {\n ngDevMode && assertTNodeForLView(parentTNode, lView);\n const {\n encapsulation\n } = tView.data[parentTNode.directiveStart + parentTNode.componentOffset];\n // We've got a parent which is an element in the current view. We just need to verify if the\n // parent element is not a component. Component's content nodes are not inserted immediately\n // because they will be projected, and so doing insert at this point would be wasteful.\n // Since the projection would then move it to its final destination. Note that we can't\n // make this assumption when using the Shadow DOM, because the native projection placeholders\n // (<content> or <slot>) have to be in place as elements are being inserted.\n if (encapsulation === ViewEncapsulation.None || encapsulation === ViewEncapsulation.Emulated) {\n return null;\n }\n }\n return getNativeByTNode(parentTNode, lView);\n }\n}\n/**\n * Find a node in front of which `currentTNode` should be inserted.\n *\n * This method determines the `RNode` in front of which we should insert the `currentRNode`. This\n * takes `TNode.insertBeforeIndex` into account if i18n code has been invoked.\n *\n * @param parentTNode parent `TNode`\n * @param currentTNode current `TNode` (The node which we would like to insert into the DOM)\n * @param lView current `LView`\n */\nfunction getInsertInFrontOfRNode(parentTNode, currentTNode, lView) {\n return _getInsertInFrontOfRNodeWithI18n(parentTNode, currentTNode, lView);\n}\n/**\n * Find a node in front of which `currentTNode` should be inserted. (Does not take i18n into\n * account)\n *\n * This method determines the `RNode` in front of which we should insert the `currentRNode`. This\n * does not take `TNode.insertBeforeIndex` into account.\n *\n * @param parentTNode parent `TNode`\n * @param currentTNode current `TNode` (The node which we would like to insert into the DOM)\n * @param lView current `LView`\n */\nfunction getInsertInFrontOfRNodeWithNoI18n(parentTNode, currentTNode, lView) {\n if (parentTNode.type & (8 /* TNodeType.ElementContainer */ | 32 /* TNodeType.Icu */)) {\n return getNativeByTNode(parentTNode, lView);\n }\n return null;\n}\n/**\n * Tree shakable boundary for `getInsertInFrontOfRNodeWithI18n` function.\n *\n * This function will only be set if i18n code runs.\n */\nlet _getInsertInFrontOfRNodeWithI18n = getInsertInFrontOfRNodeWithNoI18n;\n/**\n * Tree shakable boundary for `processI18nInsertBefore` function.\n *\n * This function will only be set if i18n code runs.\n */\nlet _processI18nInsertBefore;\nfunction setI18nHandling(getInsertInFrontOfRNodeWithI18n, processI18nInsertBefore) {\n _getInsertInFrontOfRNodeWithI18n = getInsertInFrontOfRNodeWithI18n;\n _processI18nInsertBefore = processI18nInsertBefore;\n}\n/**\n * Appends the `child` native node (or a collection of nodes) to the `parent`.\n *\n * @param tView The `TView' to be appended\n * @param lView The current LView\n * @param childRNode The native child (or children) that should be appended\n * @param childTNode The TNode of the child element\n */\nfunction appendChild(tView, lView, childRNode, childTNode) {\n const parentRNode = getParentRElement(tView, childTNode, lView);\n const renderer = lView[RENDERER];\n const parentTNode = childTNode.parent || lView[T_HOST];\n const anchorNode = getInsertInFrontOfRNode(parentTNode, childTNode, lView);\n if (parentRNode != null) {\n if (Array.isArray(childRNode)) {\n for (let i = 0; i < childRNode.length; i++) {\n nativeAppendOrInsertBefore(renderer, parentRNode, childRNode[i], anchorNode, false);\n }\n } else {\n nativeAppendOrInsertBefore(renderer, parentRNode, childRNode, anchorNode, false);\n }\n }\n _processI18nInsertBefore !== undefined && _processI18nInsertBefore(renderer, childTNode, lView, childRNode, parentRNode);\n}\n/**\n * Returns the first native node for a given LView, starting from the provided TNode.\n *\n * Native nodes are returned in the order in which those appear in the native tree (DOM).\n */\nfunction getFirstNativeNode(lView, tNode) {\n if (tNode !== null) {\n ngDevMode && assertTNodeType(tNode, 3 /* TNodeType.AnyRNode */ | 12 /* TNodeType.AnyContainer */ | 32 /* TNodeType.Icu */ | 16 /* TNodeType.Projection */ | 128 /* TNodeType.LetDeclaration */);\n const tNodeType = tNode.type;\n if (tNodeType & 3 /* TNodeType.AnyRNode */) {\n return getNativeByTNode(tNode, lView);\n } else if (tNodeType & 4 /* TNodeType.Container */) {\n return getBeforeNodeForView(-1, lView[tNode.index]);\n } else if (tNodeType & 8 /* TNodeType.ElementContainer */) {\n const elIcuContainerChild = tNode.child;\n if (elIcuContainerChild !== null) {\n return getFirstNativeNode(lView, elIcuContainerChild);\n } else {\n const rNodeOrLContainer = lView[tNode.index];\n if (isLContainer(rNodeOrLContainer)) {\n return getBeforeNodeForView(-1, rNodeOrLContainer);\n } else {\n return unwrapRNode(rNodeOrLContainer);\n }\n }\n } else if (tNodeType & 128 /* TNodeType.LetDeclaration */) {\n return getFirstNativeNode(lView, tNode.next);\n } else if (tNodeType & 32 /* TNodeType.Icu */) {\n let nextRNode = icuContainerIterate(tNode, lView);\n let rNode = nextRNode();\n // If the ICU container has no nodes, than we use the ICU anchor as the node.\n return rNode || unwrapRNode(lView[tNode.index]);\n } else {\n const projectionNodes = getProjectionNodes(lView, tNode);\n if (projectionNodes !== null) {\n if (Array.isArray(projectionNodes)) {\n return projectionNodes[0];\n }\n const parentView = getLViewParent(lView[DECLARATION_COMPONENT_VIEW]);\n ngDevMode && assertParentView(parentView);\n return getFirstNativeNode(parentView, projectionNodes);\n } else {\n return getFirstNativeNode(lView, tNode.next);\n }\n }\n }\n return null;\n}\nfunction getProjectionNodes(lView, tNode) {\n if (tNode !== null) {\n const componentView = lView[DECLARATION_COMPONENT_VIEW];\n const componentHost = componentView[T_HOST];\n const slotIdx = tNode.projection;\n ngDevMode && assertProjectionSlots(lView);\n return componentHost.projection[slotIdx];\n }\n return null;\n}\nfunction getBeforeNodeForView(viewIndexInContainer, lContainer) {\n const nextViewIndex = CONTAINER_HEADER_OFFSET + viewIndexInContainer + 1;\n if (nextViewIndex < lContainer.length) {\n const lView = lContainer[nextViewIndex];\n const firstTNodeOfView = lView[TVIEW].firstChild;\n if (firstTNodeOfView !== null) {\n return getFirstNativeNode(lView, firstTNodeOfView);\n }\n }\n return lContainer[NATIVE];\n}\n/**\n * Performs the operation of `action` on the node. Typically this involves inserting or removing\n * nodes on the LView or projection boundary.\n */\nfunction applyNodes(renderer, action, tNode, lView, parentRElement, beforeNode, isProjection) {\n while (tNode != null) {\n ngDevMode && assertTNodeForLView(tNode, lView);\n // Let declarations don't have corresponding DOM nodes so we skip over them.\n if (tNode.type === 128 /* TNodeType.LetDeclaration */) {\n tNode = tNode.next;\n continue;\n }\n ngDevMode && assertTNodeType(tNode, 3 /* TNodeType.AnyRNode */ | 12 /* TNodeType.AnyContainer */ | 16 /* TNodeType.Projection */ | 32 /* TNodeType.Icu */);\n const rawSlotValue = lView[tNode.index];\n const tNodeType = tNode.type;\n if (isProjection) {\n if (action === 0 /* WalkTNodeTreeAction.Create */) {\n rawSlotValue && attachPatchData(unwrapRNode(rawSlotValue), lView);\n tNode.flags |= 2 /* TNodeFlags.isProjected */;\n }\n }\n if (!isDetachedByI18n(tNode)) {\n if (tNodeType & 8 /* TNodeType.ElementContainer */) {\n applyNodes(renderer, action, tNode.child, lView, parentRElement, beforeNode, false);\n applyToElementOrContainer(action, renderer, parentRElement, rawSlotValue, beforeNode);\n } else if (tNodeType & 32 /* TNodeType.Icu */) {\n const nextRNode = icuContainerIterate(tNode, lView);\n let rNode;\n while (rNode = nextRNode()) {\n applyToElementOrContainer(action, renderer, parentRElement, rNode, beforeNode);\n }\n applyToElementOrContainer(action, renderer, parentRElement, rawSlotValue, beforeNode);\n } else if (tNodeType & 16 /* TNodeType.Projection */) {\n applyProjectionRecursive(renderer, action, lView, tNode, parentRElement, beforeNode);\n } else {\n ngDevMode && assertTNodeType(tNode, 3 /* TNodeType.AnyRNode */ | 4 /* TNodeType.Container */);\n applyToElementOrContainer(action, renderer, parentRElement, rawSlotValue, beforeNode);\n }\n }\n tNode = isProjection ? tNode.projectionNext : tNode.next;\n }\n}\nfunction applyView(tView, lView, renderer, action, parentRElement, beforeNode) {\n applyNodes(renderer, action, tView.firstChild, lView, parentRElement, beforeNode, false);\n}\n/**\n * `applyProjection` performs operation on the projection.\n *\n * Inserting a projection requires us to locate the projected nodes from the parent component. The\n * complication is that those nodes themselves could be re-projected from their parent component.\n *\n * @param tView The `TView` of `LView` which needs to be inserted, detached, destroyed\n * @param lView The `LView` which needs to be inserted, detached, destroyed.\n * @param tProjectionNode node to project\n */\nfunction applyProjection(tView, lView, tProjectionNode) {\n const renderer = lView[RENDERER];\n const parentRNode = getParentRElement(tView, tProjectionNode, lView);\n const parentTNode = tProjectionNode.parent || lView[T_HOST];\n let beforeNode = getInsertInFrontOfRNode(parentTNode, tProjectionNode, lView);\n applyProjectionRecursive(renderer, 0 /* WalkTNodeTreeAction.Create */, lView, tProjectionNode, parentRNode, beforeNode);\n}\n/**\n * `applyProjectionRecursive` performs operation on the projection specified by `action` (insert,\n * detach, destroy)\n *\n * Inserting a projection requires us to locate the projected nodes from the parent component. The\n * complication is that those nodes themselves could be re-projected from their parent component.\n *\n * @param renderer Render to use\n * @param action action to perform (insert, detach, destroy)\n * @param lView The LView which needs to be inserted, detached, destroyed.\n * @param tProjectionNode node to project\n * @param parentRElement parent DOM element for insertion/removal.\n * @param beforeNode Before which node the insertions should happen.\n */\nfunction applyProjectionRecursive(renderer, action, lView, tProjectionNode, parentRElement, beforeNode) {\n const componentLView = lView[DECLARATION_COMPONENT_VIEW];\n const componentNode = componentLView[T_HOST];\n ngDevMode && assertEqual(typeof tProjectionNode.projection, 'number', 'expecting projection index');\n const nodeToProjectOrRNodes = componentNode.projection[tProjectionNode.projection];\n if (Array.isArray(nodeToProjectOrRNodes)) {\n // This should not exist, it is a bit of a hack. When we bootstrap a top level node and we\n // need to support passing projectable nodes, so we cheat and put them in the TNode\n // of the Host TView. (Yes we put instance info at the T Level). We can get away with it\n // because we know that TView is not shared and therefore it will not be a problem.\n // This should be refactored and cleaned up.\n for (let i = 0; i < nodeToProjectOrRNodes.length; i++) {\n const rNode = nodeToProjectOrRNodes[i];\n applyToElementOrContainer(action, renderer, parentRElement, rNode, beforeNode);\n }\n } else {\n let nodeToProject = nodeToProjectOrRNodes;\n const projectedComponentLView = componentLView[PARENT];\n // If a parent <ng-content> is located within a skip hydration block,\n // annotate an actual node that is being projected with the same flag too.\n if (hasInSkipHydrationBlockFlag(tProjectionNode)) {\n nodeToProject.flags |= 128 /* TNodeFlags.inSkipHydrationBlock */;\n }\n applyNodes(renderer, action, nodeToProject, projectedComponentLView, parentRElement, beforeNode, true);\n }\n}\n/**\n * `applyContainer` performs an operation on the container and its views as specified by\n * `action` (insert, detach, destroy)\n *\n * Inserting a Container is complicated by the fact that the container may have Views which\n * themselves have containers or projections.\n *\n * @param renderer Renderer to use\n * @param action action to perform (insert, detach, destroy)\n * @param lContainer The LContainer which needs to be inserted, detached, destroyed.\n * @param parentRElement parent DOM element for insertion/removal.\n * @param beforeNode Before which node the insertions should happen.\n */\nfunction applyContainer(renderer, action, lContainer, parentRElement, beforeNode) {\n ngDevMode && assertLContainer(lContainer);\n const anchor = lContainer[NATIVE]; // LContainer has its own before node.\n const native = unwrapRNode(lContainer);\n // An LContainer can be created dynamically on any node by injecting ViewContainerRef.\n // Asking for a ViewContainerRef on an element will result in a creation of a separate anchor\n // node (comment in the DOM) that will be different from the LContainer's host node. In this\n // particular case we need to execute action on 2 nodes:\n // - container's host node (this is done in the executeActionOnElementOrContainer)\n // - container's host node (this is done here)\n if (anchor !== native) {\n // This is very strange to me (Misko). I would expect that the native is same as anchor. I\n // don't see a reason why they should be different, but they are.\n //\n // If they are we need to process the second anchor as well.\n applyToElementOrContainer(action, renderer, parentRElement, anchor, beforeNode);\n }\n for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {\n const lView = lContainer[i];\n applyView(lView[TVIEW], lView, renderer, action, parentRElement, anchor);\n }\n}\n/**\n * Writes class/style to element.\n *\n * @param renderer Renderer to use.\n * @param isClassBased `true` if it should be written to `class` (`false` to write to `style`)\n * @param rNode The Node to write to.\n * @param prop Property to write to. This would be the class/style name.\n * @param value Value to write. If `null`/`undefined`/`false` this is considered a remove (set/add\n * otherwise).\n */\nfunction applyStyling(renderer, isClassBased, rNode, prop, value) {\n if (isClassBased) {\n // We actually want JS true/false here because any truthy value should add the class\n if (!value) {\n renderer.removeClass(rNode, prop);\n } else {\n renderer.addClass(rNode, prop);\n }\n } else {\n let flags = prop.indexOf('-') === -1 ? undefined : RendererStyleFlags2.DashCase;\n if (value == null /** || value === undefined */) {\n renderer.removeStyle(rNode, prop, flags);\n } else {\n // A value is important if it ends with `!important`. The style\n // parser strips any semicolons at the end of the value.\n const isImportant = typeof value === 'string' ? value.endsWith('!important') : false;\n if (isImportant) {\n // !important has to be stripped from the value for it to be valid.\n value = value.slice(0, -10);\n flags |= RendererStyleFlags2.Important;\n }\n renderer.setStyle(rNode, prop, value, flags);\n }\n }\n}\nfunction executeTemplate(tView, lView, templateFn, rf, context) {\n const prevSelectedIndex = getSelectedIndex();\n const isUpdatePhase = rf & 2 /* RenderFlags.Update */;\n try {\n setSelectedIndex(-1);\n if (isUpdatePhase && lView.length > HEADER_OFFSET) {\n // When we're updating, inherently select 0 so we don't\n // have to generate that instruction for most update blocks.\n selectIndexInternal(tView, lView, HEADER_OFFSET, !!ngDevMode && isInCheckNoChangesMode());\n }\n const preHookType = isUpdatePhase ? 2 /* ProfilerEvent.TemplateUpdateStart */ : 0 /* ProfilerEvent.TemplateCreateStart */;\n profiler(preHookType, context, templateFn);\n templateFn(rf, context);\n } finally {\n setSelectedIndex(prevSelectedIndex);\n const postHookType = isUpdatePhase ? 3 /* ProfilerEvent.TemplateUpdateEnd */ : 1 /* ProfilerEvent.TemplateCreateEnd */;\n profiler(postHookType, context, templateFn);\n }\n}\n/**\n * Creates directive instances.\n */\nfunction createDirectivesInstances(tView, lView, tNode) {\n instantiateAllDirectives(tView, lView, tNode);\n if ((tNode.flags & 64 /* TNodeFlags.hasHostBindings */) === 64 /* TNodeFlags.hasHostBindings */) {\n invokeDirectivesHostBindings(tView, lView, tNode);\n }\n}\n/**\n * Takes a list of local names and indices and pushes the resolved local variable values\n * to LView in the same order as they are loaded in the template with load().\n */\nfunction saveResolvedLocalsInData(viewData, tNode, localRefExtractor = getNativeByTNode) {\n const localNames = tNode.localNames;\n if (localNames !== null) {\n let localIndex = tNode.index + 1;\n for (let i = 0; i < localNames.length; i += 2) {\n const index = localNames[i + 1];\n const value = index === -1 ? localRefExtractor(tNode, viewData) : viewData[index];\n viewData[localIndex++] = value;\n }\n }\n}\n/**\n * Locates the host native element, used for bootstrapping existing nodes into rendering pipeline.\n *\n * @param renderer the renderer used to locate the element.\n * @param elementOrSelector Render element or CSS selector to locate the element.\n * @param encapsulation View Encapsulation defined for component that requests host element.\n * @param injector Root view injector instance.\n */\nfunction locateHostElement(renderer, elementOrSelector, encapsulation, injector) {\n // Note: we use default value for the `PRESERVE_HOST_CONTENT` here even though it's a\n // tree-shakable one (providedIn:'root'). This code path can be triggered during dynamic\n // component creation (after calling ViewContainerRef.createComponent) when an injector\n // instance can be provided. The injector instance might be disconnected from the main DI\n // tree, thus the `PRESERVE_HOST_CONTENT` would not be able to instantiate. In this case, the\n // default value will be used.\n const preserveHostContent = injector.get(PRESERVE_HOST_CONTENT, PRESERVE_HOST_CONTENT_DEFAULT);\n // When using native Shadow DOM, do not clear host element to allow native slot\n // projection.\n const preserveContent = preserveHostContent || encapsulation === ViewEncapsulation.ShadowDom;\n const rootElement = renderer.selectRootElement(elementOrSelector, preserveContent);\n applyRootElementTransform(rootElement);\n return rootElement;\n}\n/**\n * Applies any root element transformations that are needed. If hydration is enabled,\n * this will process corrupted text nodes.\n *\n * @param rootElement the app root HTML Element\n */\nfunction applyRootElementTransform(rootElement) {\n _applyRootElementTransformImpl(rootElement);\n}\n/**\n * Reference to a function that applies transformations to the root HTML element\n * of an app. When hydration is enabled, this processes any corrupt text nodes\n * so they are properly hydratable on the client.\n *\n * @param rootElement the app root HTML Element\n */\nlet _applyRootElementTransformImpl = () => null;\n/**\n * Processes text node markers before hydration begins. This replaces any special comment\n * nodes that were added prior to serialization are swapped out to restore proper text\n * nodes before hydration.\n *\n * @param rootElement the app root HTML Element\n */\nfunction applyRootElementTransformImpl(rootElement) {\n if (hasSkipHydrationAttrOnRElement(rootElement)) {\n // Handle a situation when the `ngSkipHydration` attribute is applied\n // to the root node of an application. In this case, we should clear\n // the contents and render everything from scratch.\n clearElementContents(rootElement);\n } else {\n processTextNodeMarkersBeforeHydration(rootElement);\n }\n}\n/**\n * Sets the implementation for the `applyRootElementTransform` function.\n */\nfunction enableApplyRootElementTransformImpl() {\n _applyRootElementTransformImpl = applyRootElementTransformImpl;\n}\n/**\n * Mapping between attributes names that don't correspond to their element property names.\n *\n * Performance note: this function is written as a series of if checks (instead of, say, a property\n * object lookup) for performance reasons - the series of `if` checks seems to be the fastest way of\n * mapping property names. Do NOT change without benchmarking.\n *\n * Note: this mapping has to be kept in sync with the equivalent mappings in the compiler.\n */\nfunction mapPropName(name) {\n if (name === 'class') return 'className';\n if (name === 'for') return 'htmlFor';\n if (name === 'formaction') return 'formAction';\n if (name === 'innerHtml') return 'innerHTML';\n if (name === 'readonly') return 'readOnly';\n if (name === 'tabindex') return 'tabIndex';\n return name;\n}\nfunction setPropertyAndInputs(tNode, lView, propName, value, renderer, sanitizer) {\n ngDevMode && assertNotSame(value, NO_CHANGE, 'Incoming value should never be NO_CHANGE.');\n const tView = lView[TVIEW];\n const hasSetInput = setAllInputsForProperty(tNode, tView, lView, propName, value);\n if (hasSetInput) {\n isComponentHost(tNode) && markDirtyIfOnPush(lView, tNode.index);\n ngDevMode && setNgReflectProperties(lView, tView, tNode, propName, value);\n return; // Stop propcessing if we've matched at least one input.\n }\n // If the property is going to a DOM node, we have to remap it.\n if (tNode.type & 3 /* TNodeType.AnyRNode */) {\n propName = mapPropName(propName);\n }\n setDomProperty(tNode, lView, propName, value, renderer, sanitizer);\n}\n/**\n * Sets a DOM property on a specific node.\n * @param tNode TNode on which to set the value.\n * @param lView View in which the node is located.\n * @param propName Name of the property.\n * @param value Value to set on the property.\n * @param renderer Renderer to use when setting the property.\n * @param sanitizer Function used to sanitize the value before setting it.\n */\nfunction setDomProperty(tNode, lView, propName, value, renderer, sanitizer) {\n if (tNode.type & 3 /* TNodeType.AnyRNode */) {\n const element = getNativeByTNode(tNode, lView);\n if (ngDevMode) {\n validateAgainstEventProperties(propName);\n if (!isPropertyValid(element, propName, tNode.value, lView[TVIEW].schemas)) {\n handleUnknownPropertyError(propName, tNode.value, tNode.type, lView);\n }\n }\n // It is assumed that the sanitizer is only added when the compiler determines that the\n // property is risky, so sanitization can be done without further checks.\n value = sanitizer != null ? sanitizer(value, tNode.value || '', propName) : value;\n renderer.setProperty(element, propName, value);\n } else if (tNode.type & 12 /* TNodeType.AnyContainer */) {\n // If the node is a container and the property didn't\n // match any of the inputs or schemas we should throw.\n if (ngDevMode && !matchingSchemas(lView[TVIEW].schemas, tNode.value)) {\n handleUnknownPropertyError(propName, tNode.value, tNode.type, lView);\n }\n }\n}\n/** If node is an OnPush component, marks its LView dirty. */\nfunction markDirtyIfOnPush(lView, viewIndex) {\n ngDevMode && assertLView(lView);\n const childComponentLView = getComponentLViewByIndex(viewIndex, lView);\n if (!(childComponentLView[FLAGS] & 16 /* LViewFlags.CheckAlways */)) {\n childComponentLView[FLAGS] |= 64 /* LViewFlags.Dirty */;\n }\n}\nfunction setNgReflectProperty(lView, tNode, attrName, value) {\n const environment = lView[ENVIRONMENT];\n if (!environment.ngReflect) {\n return;\n }\n const element = getNativeByTNode(tNode, lView);\n const renderer = lView[RENDERER];\n attrName = normalizeDebugBindingName(attrName);\n const debugValue = normalizeDebugBindingValue(value);\n if (tNode.type & 3 /* TNodeType.AnyRNode */) {\n if (value == null) {\n renderer.removeAttribute(element, attrName);\n } else {\n renderer.setAttribute(element, attrName, debugValue);\n }\n } else {\n const textContent = escapeCommentText(`bindings=${JSON.stringify({\n [attrName]: debugValue\n }, null, 2)}`);\n renderer.setValue(element, textContent);\n }\n}\nfunction setNgReflectProperties(lView, tView, tNode, publicName, value) {\n const environment = lView[ENVIRONMENT];\n if (!environment.ngReflect || !(tNode.type & (3 /* TNodeType.AnyRNode */ | 4 /* TNodeType.Container */))) {\n return;\n }\n const inputConfig = tNode.inputs?.[publicName];\n const hostInputConfig = tNode.hostDirectiveInputs?.[publicName];\n if (hostInputConfig) {\n for (let i = 0; i < hostInputConfig.length; i += 2) {\n const index = hostInputConfig[i];\n const publicName = hostInputConfig[i + 1];\n const def = tView.data[index];\n setNgReflectProperty(lView, tNode, def.inputs[publicName][0], value);\n }\n }\n // Note: we set the private name of the input as the reflected property, not the public one.\n if (inputConfig) {\n for (const index of inputConfig) {\n const def = tView.data[index];\n setNgReflectProperty(lView, tNode, def.inputs[publicName][0], value);\n }\n }\n}\n/**\n * Instantiate all the directives that were previously resolved on the current node.\n */\nfunction instantiateAllDirectives(tView, lView, tNode) {\n const start = tNode.directiveStart;\n const end = tNode.directiveEnd;\n // The component view needs to be created before creating the node injector\n // since it is used to inject some special symbols like `ChangeDetectorRef`.\n if (isComponentHost(tNode)) {\n ngDevMode && assertTNodeType(tNode, 3 /* TNodeType.AnyRNode */);\n createComponentLView(lView, tNode, tView.data[start + tNode.componentOffset]);\n }\n if (!tView.firstCreatePass) {\n getOrCreateNodeInjectorForNode(tNode, lView);\n }\n const initialInputs = tNode.initialInputs;\n for (let i = start; i < end; i++) {\n const def = tView.data[i];\n const directive = getNodeInjectable(lView, tView, i, tNode);\n attachPatchData(directive, lView);\n if (initialInputs !== null) {\n setInputsFromAttrs(lView, i - start, directive, def, tNode, initialInputs);\n }\n if (isComponentDef(def)) {\n const componentView = getComponentLViewByIndex(tNode.index, lView);\n componentView[CONTEXT] = getNodeInjectable(lView, tView, i, tNode);\n }\n }\n}\nfunction invokeDirectivesHostBindings(tView, lView, tNode) {\n const start = tNode.directiveStart;\n const end = tNode.directiveEnd;\n const elementIndex = tNode.index;\n const currentDirectiveIndex = getCurrentDirectiveIndex();\n try {\n setSelectedIndex(elementIndex);\n for (let dirIndex = start; dirIndex < end; dirIndex++) {\n const def = tView.data[dirIndex];\n const directive = lView[dirIndex];\n setCurrentDirectiveIndex(dirIndex);\n if (def.hostBindings !== null || def.hostVars !== 0 || def.hostAttrs !== null) {\n invokeHostBindingsInCreationMode(def, directive);\n }\n }\n } finally {\n setSelectedIndex(-1);\n setCurrentDirectiveIndex(currentDirectiveIndex);\n }\n}\n/**\n * Invoke the host bindings in creation mode.\n *\n * @param def `DirectiveDef` which may contain the `hostBindings` function.\n * @param directive Instance of directive.\n */\nfunction invokeHostBindingsInCreationMode(def, directive) {\n if (def.hostBindings !== null) {\n def.hostBindings(1 /* RenderFlags.Create */, directive);\n }\n}\n/**\n * Matches the current node against all available selectors.\n * If a component is matched (at most one), it is returned in first position in the array.\n */\nfunction findDirectiveDefMatches(tView, tNode) {\n ngDevMode && assertFirstCreatePass(tView);\n ngDevMode && assertTNodeType(tNode, 3 /* TNodeType.AnyRNode */ | 12 /* TNodeType.AnyContainer */);\n const registry = tView.directiveRegistry;\n let matches = null;\n if (registry) {\n for (let i = 0; i < registry.length; i++) {\n const def = registry[i];\n if (isNodeMatchingSelectorList(tNode, def.selectors, /* isProjectionMode */false)) {\n matches ??= [];\n if (isComponentDef(def)) {\n if (ngDevMode) {\n assertTNodeType(tNode, 2 /* TNodeType.Element */, `\"${tNode.value}\" tags cannot be used as component hosts. ` + `Please use a different tag to activate the ${stringify(def.type)} component.`);\n if (matches.length && isComponentDef(matches[0])) {\n throwMultipleComponentError(tNode, matches.find(isComponentDef).type, def.type);\n }\n }\n matches.unshift(def);\n } else {\n matches.push(def);\n }\n }\n }\n }\n return matches;\n}\nfunction elementAttributeInternal(tNode, lView, name, value, sanitizer, namespace) {\n if (ngDevMode) {\n assertNotSame(value, NO_CHANGE, 'Incoming value should never be NO_CHANGE.');\n validateAgainstEventAttributes(name);\n assertTNodeType(tNode, 2 /* TNodeType.Element */, `Attempted to set attribute \\`${name}\\` on a container node. ` + `Host bindings are not valid on ng-container or ng-template.`);\n }\n const element = getNativeByTNode(tNode, lView);\n setElementAttribute(lView[RENDERER], element, namespace, tNode.value, name, value, sanitizer);\n}\nfunction setElementAttribute(renderer, element, namespace, tagName, name, value, sanitizer) {\n if (value == null) {\n renderer.removeAttribute(element, name, namespace);\n } else {\n const strValue = sanitizer == null ? renderStringify(value) : sanitizer(value, tagName || '', name);\n renderer.setAttribute(element, name, strValue, namespace);\n }\n}\n/**\n * Sets initial input properties on directive instances from attribute data\n *\n * @param lView Current LView that is being processed.\n * @param directiveIndex Index of the directive in directives array\n * @param instance Instance of the directive on which to set the initial inputs\n * @param def The directive def that contains the list of inputs\n * @param tNode The static data for this node\n */\nfunction setInputsFromAttrs(lView, directiveIndex, instance, def, tNode, initialInputData) {\n const initialInputs = initialInputData[directiveIndex];\n if (initialInputs !== null) {\n for (let i = 0; i < initialInputs.length; i += 2) {\n const lookupName = initialInputs[i];\n const value = initialInputs[i + 1];\n writeToDirectiveInput(def, instance, lookupName, value);\n if (ngDevMode) {\n setNgReflectProperty(lView, tNode, def.inputs[lookupName][0], value);\n }\n }\n }\n}\n/** Shared code between instructions that indicate the start of an element. */\nfunction elementLikeStartShared(tNode, lView, index, name, locateOrCreateNativeNode) {\n const adjustedIndex = HEADER_OFFSET + index;\n const tView = lView[TVIEW];\n const native = locateOrCreateNativeNode(tView, lView, tNode, name, index);\n lView[adjustedIndex] = native;\n setCurrentTNode(tNode, true);\n // It's important that this runs before we've instantiated the directives.\n const isElement = tNode.type === 2 /* TNodeType.Element */;\n if (isElement) {\n setupStaticAttributes(lView[RENDERER], native, tNode);\n // any immediate children of a component or template container must be pre-emptively\n // monkey-patched with the component view data so that the element can be inspected\n // later on using any element discovery utility methods (see `element_discovery.ts`)\n if (getElementDepthCount() === 0 || isDirectiveHost(tNode)) {\n attachPatchData(native, lView);\n }\n increaseElementDepthCount();\n } else {\n attachPatchData(native, lView);\n }\n if (wasLastNodeCreated() && (!isElement || !isDetachedByI18n(tNode))) {\n // In the i18n case, the translation may have removed this element, so only add it if it is not\n // detached. See `TNodeType.Placeholder` and `LFrame.inI18n` for more context.\n appendChild(tView, lView, native, tNode);\n }\n return tNode;\n}\n/** Shared code between instructions that indicate the end of an element. */\nfunction elementLikeEndShared(tNode) {\n let currentTNode = tNode;\n if (isCurrentTNodeParent()) {\n setCurrentTNodeAsNotParent();\n } else {\n ngDevMode && assertHasParent(getCurrentTNode());\n currentTNode = currentTNode.parent;\n setCurrentTNode(currentTNode, false);\n }\n return currentTNode;\n}\n///////////////////////////////\n//// Bindings & interpolations\n///////////////////////////////\n/**\n * Stores meta-data for a property binding to be used by TestBed's `DebugElement.properties`.\n *\n * In order to support TestBed's `DebugElement.properties` we need to save, for each binding:\n * - a bound property name;\n * - a static parts of interpolated strings;\n *\n * A given property metadata is saved at the binding's index in the `TView.data` (in other words, a\n * property binding metadata will be stored in `TView.data` at the same index as a bound value in\n * `LView`). Metadata are represented as `INTERPOLATION_DELIMITER`-delimited string with the\n * following format:\n * - `propertyName` for bound properties;\n * - `propertyName<6D>prefix<69>interpolation_static_part1<74>..interpolation_static_partN<74>suffix` for\n * interpolated properties.\n *\n * @param tData `TData` where meta-data will be saved;\n * @param tNode `TNode` that is a target of the binding;\n * @param propertyName bound property name;\n * @param bindingIndex binding index in `LView`\n * @param interpolationParts static interpolation parts (for property interpolations)\n */\nfunction storePropertyBindingMetadata(tData, tNode, propertyName, bindingIndex, ...interpolationParts) {\n // Binding meta-data are stored only the first time a given property instruction is processed.\n // Since we don't have a concept of the \"first update pass\" we need to check for presence of the\n // binding meta-data to decide if one should be stored (or if was stored already).\n if (tData[bindingIndex] === null) {\n if (!tNode.inputs?.[propertyName] && !tNode.hostDirectiveInputs?.[propertyName]) {\n const propBindingIdxs = tNode.propertyBindings || (tNode.propertyBindings = []);\n propBindingIdxs.push(bindingIndex);\n let bindingMetadata = propertyName;\n if (interpolationParts.length > 0) {\n bindingMetadata += INTERPOLATION_DELIMITER + interpolationParts.join(INTERPOLATION_DELIMITER);\n }\n tData[bindingIndex] = bindingMetadata;\n }\n }\n}\n/**\n * There are cases where the sub component's renderer needs to be included\n * instead of the current renderer (see the componentSyntheticHost* instructions).\n */\nfunction loadComponentRenderer(currentDef, tNode, lView) {\n // TODO(FW-2043): the `currentDef` is null when host bindings are invoked while creating root\n // component (see packages/core/src/render3/component.ts). This is not consistent with the process\n // of creating inner components, when current directive index is available in the state. In order\n // to avoid relying on current def being `null` (thus special-casing root component creation), the\n // process of creating root component should be unified with the process of creating inner\n // components.\n if (currentDef === null || isComponentDef(currentDef)) {\n lView = unwrapLView(lView[tNode.index]);\n }\n return lView[RENDERER];\n}\n/** Handles an error thrown in an LView. */\nfunction handleUncaughtError(lView, error) {\n const injector = lView[INJECTOR];\n if (!injector) {\n return;\n }\n const errorHandler = injector.get(INTERNAL_APPLICATION_ERROR_HANDLER, null);\n errorHandler?.(error);\n}\n/**\n * Set all directive inputs with the specific public name on the node.\n *\n * @param tNode TNode on which the input is being set.\n * @param tView Current TView\n * @param lView `LView` which contains the directives.\n * @param publicName Public name of the input being set.\n * @param value Value to set.\n */\nfunction setAllInputsForProperty(tNode, tView, lView, publicName, value) {\n const inputs = tNode.inputs?.[publicName];\n const hostDirectiveInputs = tNode.hostDirectiveInputs?.[publicName];\n let hasMatch = false;\n if (hostDirectiveInputs) {\n for (let i = 0; i < hostDirectiveInputs.length; i += 2) {\n const index = hostDirectiveInputs[i];\n ngDevMode && assertIndexInRange(lView, index);\n const publicName = hostDirectiveInputs[i + 1];\n const def = tView.data[index];\n writeToDirectiveInput(def, lView[index], publicName, value);\n hasMatch = true;\n }\n }\n if (inputs) {\n for (const index of inputs) {\n ngDevMode && assertIndexInRange(lView, index);\n const instance = lView[index];\n const def = tView.data[index];\n writeToDirectiveInput(def, instance, publicName, value);\n hasMatch = true;\n }\n }\n return hasMatch;\n}\n/**\n * Sets an input value only on a specific directive and its host directives.\n * @param tNode TNode on which the input is being set.\n * @param tView Current TView\n * @param lView `LView` which contains the directives.\n * @param target Directive on which to set the input.\n * @param publicName Public name of the input being set.\n * @param value Value to set.\n */\nfunction setDirectiveInput(tNode, tView, lView, target, publicName, value) {\n let hostIndex = null;\n let hostDirectivesStart = null;\n let hostDirectivesEnd = null;\n let hasSet = false;\n if (ngDevMode && !tNode.directiveToIndex?.has(target.type)) {\n throw new Error(`Node does not have a directive with type ${target.type.name}`);\n }\n const data = tNode.directiveToIndex.get(target.type);\n if (typeof data === 'number') {\n hostIndex = data;\n } else {\n [hostIndex, hostDirectivesStart, hostDirectivesEnd] = data;\n }\n if (hostDirectivesStart !== null && hostDirectivesEnd !== null && tNode.hostDirectiveInputs?.hasOwnProperty(publicName)) {\n const hostDirectiveInputs = tNode.hostDirectiveInputs[publicName];\n for (let i = 0; i < hostDirectiveInputs.length; i += 2) {\n const index = hostDirectiveInputs[i];\n if (index >= hostDirectivesStart && index <= hostDirectivesEnd) {\n ngDevMode && assertIndexInRange(lView, index);\n const def = tView.data[index];\n const hostDirectivePublicName = hostDirectiveInputs[i + 1];\n writeToDirectiveInput(def, lView[index], hostDirectivePublicName, value);\n hasSet = true;\n } else if (index > hostDirectivesEnd) {\n // Directives here are in ascending order so we can stop looking once we're past the range.\n break;\n }\n }\n }\n if (hostIndex !== null && target.inputs.hasOwnProperty(publicName)) {\n ngDevMode && assertIndexInRange(lView, hostIndex);\n writeToDirectiveInput(target, lView[hostIndex], publicName, value);\n hasSet = true;\n }\n return hasSet;\n}\nfunction renderComponent(hostLView, componentHostIdx) {\n ngDevMode && assertEqual(isCreationMode(hostLView), true, 'Should be run in creation mode');\n const componentView = getComponentLViewByIndex(componentHostIdx, hostLView);\n const componentTView = componentView[TVIEW];\n syncViewWithBlueprint(componentTView, componentView);\n const hostRNode = componentView[HOST];\n // Populate an LView with hydration info retrieved from the DOM via TransferState.\n if (hostRNode !== null && componentView[HYDRATION] === null) {\n componentView[HYDRATION] = retrieveHydrationInfo(hostRNode, componentView[INJECTOR]);\n }\n profiler(18 /* ProfilerEvent.ComponentStart */);\n renderView(componentTView, componentView, componentView[CONTEXT]);\n profiler(19 /* ProfilerEvent.ComponentEnd */, componentView[CONTEXT]);\n}\n/**\n * Syncs an LView instance with its blueprint if they have gotten out of sync.\n *\n * Typically, blueprints and their view instances should always be in sync, so the loop here\n * will be skipped. However, consider this case of two components side-by-side:\n *\n * App template:\n * ```html\n * <comp></comp>\n * <comp></comp>\n * ```\n *\n * The following will happen:\n * 1. App template begins processing.\n * 2. First <comp> is matched as a component and its LView is created.\n * 3. Second <comp> is matched as a component and its LView is created.\n * 4. App template completes processing, so it's time to check child templates.\n * 5. First <comp> template is checked. It has a directive, so its def is pushed to blueprint.\n * 6. Second <comp> template is checked. Its blueprint has been updated by the first\n * <comp> template, but its LView was created before this update, so it is out of sync.\n *\n * Note that embedded views inside ngFor loops will never be out of sync because these views\n * are processed as soon as they are created.\n *\n * @param tView The `TView` that contains the blueprint for syncing\n * @param lView The view to sync\n */\nfunction syncViewWithBlueprint(tView, lView) {\n for (let i = lView.length; i < tView.blueprint.length; i++) {\n lView.push(tView.blueprint[i]);\n }\n}\n/**\n * Processes a view in the creation mode. This includes a number of steps in a specific order:\n * - creating view query functions (if any);\n * - executing a template function in the creation mode;\n * - updating static queries (if any);\n * - creating child components defined in a given view.\n */\nfunction renderView(tView, lView, context) {\n ngDevMode && assertEqual(isCreationMode(lView), true, 'Should be run in creation mode');\n ngDevMode && assertNotReactive(renderView.name);\n enterView(lView);\n try {\n const viewQuery = tView.viewQuery;\n if (viewQuery !== null) {\n executeViewQueryFn(1 /* RenderFlags.Create */, viewQuery, context);\n }\n // Execute a template associated with this view, if it exists. A template function might not be\n // defined for the root component views.\n const templateFn = tView.template;\n if (templateFn !== null) {\n executeTemplate(tView, lView, templateFn, 1 /* RenderFlags.Create */, context);\n }\n // This needs to be set before children are processed to support recursive components.\n // This must be set to false immediately after the first creation run because in an\n // ngFor loop, all the views will be created together before update mode runs and turns\n // off firstCreatePass. If we don't set it here, instances will perform directive\n // matching, etc again and again.\n if (tView.firstCreatePass) {\n tView.firstCreatePass = false;\n }\n // Mark all queries active in this view as dirty. This is necessary for signal-based queries to\n // have a clear marking point where we can read query results atomically (for a given view).\n lView[QUERIES]?.finishViewCreation(tView);\n // We resolve content queries specifically marked as `static` in creation mode. Dynamic\n // content queries are resolved during change detection (i.e. update mode), after embedded\n // views are refreshed (see block above).\n if (tView.staticContentQueries) {\n refreshContentQueries(tView, lView);\n }\n // We must materialize query results before child components are processed\n // in case a child component has projected a container. The LContainer needs\n // to exist so the embedded views are properly attached by the container.\n if (tView.staticViewQueries) {\n executeViewQueryFn(2 /* RenderFlags.Update */, tView.viewQuery, context);\n }\n // Render child component views.\n const components = tView.components;\n if (components !== null) {\n renderChildComponents(lView, components);\n }\n } catch (error) {\n // If we didn't manage to get past the first template pass due to\n // an error, mark the view as corrupted so we can try to recover.\n if (tView.firstCreatePass) {\n tView.incompleteFirstPass = true;\n tView.firstCreatePass = false;\n }\n throw error;\n } finally {\n lView[FLAGS] &= ~4 /* LViewFlags.CreationMode */;\n leaveView();\n }\n}\n/** Renders child components in the current view (creation mode). */\nfunction renderChildComponents(hostLView, components) {\n for (let i = 0; i < components.length; i++) {\n renderComponent(hostLView, components[i]);\n }\n}\nfunction createAndRenderEmbeddedLView(declarationLView, templateTNode, context, options) {\n const prevConsumer = setActiveConsumer(null);\n try {\n const embeddedTView = templateTNode.tView;\n ngDevMode && assertDefined(embeddedTView, 'TView must be defined for a template node.');\n ngDevMode && assertTNodeForLView(templateTNode, declarationLView);\n // Embedded views follow the change detection strategy of the view they're declared in.\n const isSignalView = declarationLView[FLAGS] & 4096 /* LViewFlags.SignalView */;\n const viewFlags = isSignalView ? 4096 /* LViewFlags.SignalView */ : 16 /* LViewFlags.CheckAlways */;\n const embeddedLView = createLView(declarationLView, embeddedTView, context, viewFlags, null, templateTNode, null, null, options?.injector ?? null, options?.embeddedViewInjector ?? null, options?.dehydratedView ?? null);\n const declarationLContainer = declarationLView[templateTNode.index];\n ngDevMode && assertLContainer(declarationLContainer);\n embeddedLView[DECLARATION_LCONTAINER] = declarationLContainer;\n const declarationViewLQueries = declarationLView[QUERIES];\n if (declarationViewLQueries !== null) {\n embeddedLView[QUERIES] = declarationViewLQueries.createEmbeddedView(embeddedTView);\n }\n // execute creation mode of a view\n renderView(embeddedTView, embeddedLView, context);\n return embeddedLView;\n } finally {\n setActiveConsumer(prevConsumer);\n }\n}\n/**\n * Returns whether an elements that belong to a view should be\n * inserted into the DOM. For client-only cases, DOM elements are\n * always inserted. For hydration cases, we check whether serialized\n * info is available for a view and the view is not in a \"skip hydration\"\n * block (in which case view contents was re-created, thus needing insertion).\n */\nfunction shouldAddViewToDom(tNode, dehydratedView) {\n return !dehydratedView || dehydratedView.firstChild === null || hasInSkipHydrationBlockFlag(tNode);\n}\nconst USE_EXHAUSTIVE_CHECK_NO_CHANGES_DEFAULT = false;\nconst UseExhaustiveCheckNoChanges = new InjectionToken(ngDevMode ? 'exhaustive checkNoChanges' : '');\nfunction collectNativeNodes(tView, lView, tNode, result, isProjection = false) {\n while (tNode !== null) {\n // Let declarations don't have corresponding DOM nodes so we skip over them.\n if (tNode.type === 128 /* TNodeType.LetDeclaration */) {\n tNode = isProjection ? tNode.projectionNext : tNode.next;\n continue;\n }\n ngDevMode && assertTNodeType(tNode, 3 /* TNodeType.AnyRNode */ | 12 /* TNodeType.AnyContainer */ | 16 /* TNodeType.Projection */ | 32 /* TNodeType.Icu */);\n const lNode = lView[tNode.index];\n if (lNode !== null) {\n result.push(unwrapRNode(lNode));\n }\n // A given lNode can represent either a native node or a LContainer (when it is a host of a\n // ViewContainerRef). When we find a LContainer we need to descend into it to collect root nodes\n // from the views in this container.\n if (isLContainer(lNode)) {\n collectNativeNodesInLContainer(lNode, result);\n }\n const tNodeType = tNode.type;\n if (tNodeType & 8 /* TNodeType.ElementContainer */) {\n collectNativeNodes(tView, lView, tNode.child, result);\n } else if (tNodeType & 32 /* TNodeType.Icu */) {\n const nextRNode = icuContainerIterate(tNode, lView);\n let rNode;\n while (rNode = nextRNode()) {\n result.push(rNode);\n }\n } else if (tNodeType & 16 /* TNodeType.Projection */) {\n const nodesInSlot = getProjectionNodes(lView, tNode);\n if (Array.isArray(nodesInSlot)) {\n result.push(...nodesInSlot);\n } else {\n const parentView = getLViewParent(lView[DECLARATION_COMPONENT_VIEW]);\n ngDevMode && assertParentView(parentView);\n collectNativeNodes(parentView[TVIEW], parentView, nodesInSlot, result, true);\n }\n }\n tNode = isProjection ? tNode.projectionNext : tNode.next;\n }\n return result;\n}\n/**\n * Collects all root nodes in all views in a given LContainer.\n */\nfunction collectNativeNodesInLContainer(lContainer, result) {\n for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {\n const lViewInAContainer = lContainer[i];\n const lViewFirstChildTNode = lViewInAContainer[TVIEW].firstChild;\n if (lViewFirstChildTNode !== null) {\n collectNativeNodes(lViewInAContainer[TVIEW], lViewInAContainer, lViewFirstChildTNode, result);\n }\n }\n // When an LContainer is created, the anchor (comment) node is:\n // - (1) either reused in case of an ElementContainer (<ng-container>)\n // - (2) or a new comment node is created\n // In the first case, the anchor comment node would be added to the final\n // list by the code in the `collectNativeNodes` function\n // (see the `result.push(unwrapRNode(lNode))` line), but the second\n // case requires extra handling: the anchor node needs to be added to the\n // final list manually. See additional information in the `createAnchorNode`\n // function in the `view_container_ref.ts`.\n //\n // In the first case, the same reference would be stored in the `NATIVE`\n // and `HOST` slots in an LContainer. Otherwise, this is the second case and\n // we should add an element to the final list.\n if (lContainer[NATIVE] !== lContainer[HOST]) {\n result.push(lContainer[NATIVE]);\n }\n}\nfunction addAfterRenderSequencesForView(lView) {\n if (lView[AFTER_RENDER_SEQUENCES_TO_ADD] !== null) {\n for (const sequence of lView[AFTER_RENDER_SEQUENCES_TO_ADD]) {\n sequence.impl.addSequence(sequence);\n }\n lView[AFTER_RENDER_SEQUENCES_TO_ADD].length = 0;\n }\n}\nlet freeConsumers = [];\n/**\n * Create a new template consumer pointing at the specified LView.\n * Sometimes, a previously created consumer may be reused, in order to save on allocations. In that\n * case, the LView will be updated.\n */\nfunction getOrBorrowReactiveLViewConsumer(lView) {\n return lView[REACTIVE_TEMPLATE_CONSUMER] ?? borrowReactiveLViewConsumer(lView);\n}\nfunction borrowReactiveLViewConsumer(lView) {\n const consumer = freeConsumers.pop() ?? Object.create(REACTIVE_LVIEW_CONSUMER_NODE);\n consumer.lView = lView;\n return consumer;\n}\nfunction maybeReturnReactiveLViewConsumer(consumer) {\n if (consumer.lView[REACTIVE_TEMPLATE_CONSUMER] === consumer) {\n // The consumer got committed.\n return;\n }\n consumer.lView = null;\n freeConsumers.push(consumer);\n}\nconst REACTIVE_LVIEW_CONSUMER_NODE = {\n ...REACTIVE_NODE,\n consumerIsAlwaysLive: true,\n kind: 'template',\n consumerMarkedDirty: node => {\n markAncestorsForTraversal(node.lView);\n },\n consumerOnSignalRead() {\n this.lView[REACTIVE_TEMPLATE_CONSUMER] = this;\n }\n};\n/**\n * Creates a temporary consumer for use with `LView`s that should not have consumers.\n * If the LView already has a consumer, returns the existing one instead.\n *\n * This is necessary because some APIs may cause change detection directly on an LView\n * that we do not want to have a consumer (Embedded views today). As a result, there\n * would be no active consumer from running change detection on its host component\n * and any signals in the LView template would be untracked. Instead, we create\n * this temporary consumer that marks the first parent that _should_ have a consumer\n * for refresh. Once change detection runs as part of that refresh, we throw away\n * this consumer because its signals will then be tracked by the parent's consumer.\n */\nfunction getOrCreateTemporaryConsumer(lView) {\n const consumer = lView[REACTIVE_TEMPLATE_CONSUMER] ?? Object.create(TEMPORARY_CONSUMER_NODE);\n consumer.lView = lView;\n return consumer;\n}\nconst TEMPORARY_CONSUMER_NODE = {\n ...REACTIVE_NODE,\n consumerIsAlwaysLive: true,\n kind: 'template',\n consumerMarkedDirty: node => {\n let parent = getLViewParent(node.lView);\n while (parent && !viewShouldHaveReactiveConsumer(parent[TVIEW])) {\n parent = getLViewParent(parent);\n }\n if (!parent) {\n // If we can't find an appropriate parent that should have a consumer, we\n // don't have a way of appropriately refreshing this LView as part of application synchronization.\n return;\n }\n markViewForRefresh(parent);\n },\n consumerOnSignalRead() {\n this.lView[REACTIVE_TEMPLATE_CONSUMER] = this;\n }\n};\n/**\n * Indicates if the view should get its own reactive consumer node.\n *\n * In the current design, all embedded views share a consumer with the component view. This allows\n * us to refresh at the component level rather than at a per-view level. In addition, root views get\n * their own reactive node because root component will have a host view that executes the\n * component's host bindings. This needs to be tracked in a consumer as well.\n *\n * To get a more granular change detection than per-component, all we would just need to update the\n * condition here so that a given view gets a reactive consumer which can become dirty independently\n * from its parent component. For example embedded views for signal components could be created with\n * a new type \"SignalEmbeddedView\" and the condition here wouldn't even need updating in order to\n * get granular per-view change detection for signal components.\n */\nfunction viewShouldHaveReactiveConsumer(tView) {\n return tView.type !== 2 /* TViewType.Embedded */;\n}\nfunction isReactiveLViewConsumer(node) {\n return node.kind === 'template';\n}\nfunction runEffectsInView(view) {\n if (view[EFFECTS] === null) {\n return;\n }\n // Since effects can make other effects dirty, we flush them in a loop until there are no more to\n // flush.\n let tryFlushEffects = true;\n while (tryFlushEffects) {\n let foundDirtyEffect = false;\n for (const effect of view[EFFECTS]) {\n if (!effect.dirty) {\n continue;\n }\n foundDirtyEffect = true;\n // `runEffectsInView` is called during change detection, and therefore runs\n // in the Angular zone if it's available.\n if (effect.zone === null || Zone.current === effect.zone) {\n effect.run();\n } else {\n effect.zone.run(() => effect.run());\n }\n }\n // Check if we need to continue flushing. If we didn't find any dirty effects, then there's\n // no need to loop back. Otherwise, check the view to see if it was marked for traversal\n // again. If so, there's a chance that one of the effects we ran caused another effect to\n // become dirty.\n tryFlushEffects = foundDirtyEffect && !!(view[FLAGS] & 8192 /* LViewFlags.HasChildViewsToRefresh */);\n }\n}\n\n/**\n * The maximum number of times the change detection traversal will rerun before throwing an error.\n */\nconst MAXIMUM_REFRESH_RERUNS$1 = 100;\nfunction detectChangesInternal(lView, mode = 0 /* ChangeDetectionMode.Global */) {\n const environment = lView[ENVIRONMENT];\n const rendererFactory = environment.rendererFactory;\n // Check no changes mode is a dev only mode used to verify that bindings have not changed\n // since they were assigned. We do not want to invoke renderer factory functions in that mode\n // to avoid any possible side-effects.\n const checkNoChangesMode = !!ngDevMode && isInCheckNoChangesMode();\n if (!checkNoChangesMode) {\n rendererFactory.begin?.();\n }\n try {\n detectChangesInViewWhileDirty(lView, mode);\n } finally {\n if (!checkNoChangesMode) {\n rendererFactory.end?.();\n }\n }\n}\nfunction detectChangesInViewWhileDirty(lView, mode) {\n const lastIsRefreshingViewsValue = isRefreshingViews();\n try {\n setIsRefreshingViews(true);\n detectChangesInView(lView, mode);\n // We don't need or want to do any looping when in exhaustive checkNoChanges because we\n // already traverse all the views and nothing should change so we shouldn't have to do\n // another pass to pick up new changes.\n if (ngDevMode && isExhaustiveCheckNoChanges()) {\n return;\n }\n let retries = 0;\n // If after running change detection, this view still needs to be refreshed or there are\n // descendants views that need to be refreshed due to re-dirtying during the change detection\n // run, detect changes on the view again. We run change detection in `Targeted` mode to only\n // refresh views with the `RefreshView` flag.\n while (requiresRefreshOrTraversal(lView)) {\n if (retries === MAXIMUM_REFRESH_RERUNS$1) {\n throw new RuntimeError(103 /* RuntimeErrorCode.INFINITE_CHANGE_DETECTION */, ngDevMode && 'Infinite change detection while trying to refresh views. ' + 'There may be components which each cause the other to require a refresh, ' + 'causing an infinite loop.');\n }\n retries++;\n // Even if this view is detached, we still detect changes in targeted mode because this was\n // the root of the change detection run.\n detectChangesInView(lView, 1 /* ChangeDetectionMode.Targeted */);\n }\n } finally {\n // restore state to what it was before entering this change detection loop\n setIsRefreshingViews(lastIsRefreshingViewsValue);\n }\n}\nfunction checkNoChangesInternal(lView, exhaustive) {\n setIsInCheckNoChangesMode(exhaustive ? CheckNoChangesMode.Exhaustive : CheckNoChangesMode.OnlyDirtyViews);\n try {\n detectChangesInternal(lView);\n } finally {\n setIsInCheckNoChangesMode(CheckNoChangesMode.Off);\n }\n}\n/**\n * Processes a view in update mode. This includes a number of steps in a specific order:\n * - executing a template function in update mode;\n * - executing hooks;\n * - refreshing queries;\n * - setting host bindings;\n * - refreshing child (embedded and component) views.\n */\nfunction refreshView(tView, lView, templateFn, context) {\n ngDevMode && assertEqual(isCreationMode(lView), false, 'Should be run in update mode');\n if (isDestroyed(lView)) return;\n const flags = lView[FLAGS];\n // Check no changes mode is a dev only mode used to verify that bindings have not changed\n // since they were assigned. We do not want to execute lifecycle hooks in that mode.\n const isInCheckNoChangesPass = ngDevMode && isInCheckNoChangesMode();\n const isInExhaustiveCheckNoChangesPass = ngDevMode && isExhaustiveCheckNoChanges();\n // Start component reactive context\n // - We might already be in a reactive context if this is an embedded view of the host.\n // - We might be descending into a view that needs a consumer.\n enterView(lView);\n let returnConsumerToPool = true;\n let prevConsumer = null;\n let currentConsumer = null;\n if (!isInCheckNoChangesPass) {\n if (viewShouldHaveReactiveConsumer(tView)) {\n currentConsumer = getOrBorrowReactiveLViewConsumer(lView);\n prevConsumer = consumerBeforeComputation(currentConsumer);\n } else if (getActiveConsumer() === null) {\n // If the current view should not have a reactive consumer but we don't have an active consumer,\n // we still need to create a temporary consumer to track any signal reads in this template.\n // This is a rare case that can happen with\n // - `viewContainerRef.createEmbeddedView(...).detectChanges()`.\n // - `viewContainerRef.createEmbeddedView(...)` without any other dirty marking on the parent,\n // flagging the parent component for traversal but not triggering a full `refreshView`.\n // This temporary consumer marks the first parent that _should_ have a consumer for refresh.\n // Once that refresh happens, the signals will be tracked in the parent consumer and we can destroy\n // the temporary one.\n returnConsumerToPool = false;\n currentConsumer = getOrCreateTemporaryConsumer(lView);\n prevConsumer = consumerBeforeComputation(currentConsumer);\n } else if (lView[REACTIVE_TEMPLATE_CONSUMER]) {\n consumerDestroy(lView[REACTIVE_TEMPLATE_CONSUMER]);\n lView[REACTIVE_TEMPLATE_CONSUMER] = null;\n }\n }\n try {\n resetPreOrderHookFlags(lView);\n setBindingIndex(tView.bindingStartIndex);\n if (templateFn !== null) {\n executeTemplate(tView, lView, templateFn, 2 /* RenderFlags.Update */, context);\n }\n const hooksInitPhaseCompleted = (flags & 3 /* LViewFlags.InitPhaseStateMask */) === 3 /* InitPhaseState.InitPhaseCompleted */;\n // execute pre-order hooks (OnInit, OnChanges, DoCheck)\n // PERF WARNING: do NOT extract this to a separate function without running benchmarks\n if (!isInCheckNoChangesPass) {\n if (hooksInitPhaseCompleted) {\n const preOrderCheckHooks = tView.preOrderCheckHooks;\n if (preOrderCheckHooks !== null) {\n executeCheckHooks(lView, preOrderCheckHooks, null);\n }\n } else {\n const preOrderHooks = tView.preOrderHooks;\n if (preOrderHooks !== null) {\n executeInitAndCheckHooks(lView, preOrderHooks, 0 /* InitPhaseState.OnInitHooksToBeRun */, null);\n }\n incrementInitPhaseFlags(lView, 0 /* InitPhaseState.OnInitHooksToBeRun */);\n }\n }\n // We do not need to mark transplanted views for refresh when doing exhaustive checks\n // because all views will be reached anyways during the traversal.\n if (!isInExhaustiveCheckNoChangesPass) {\n // First mark transplanted views that are declared in this lView as needing a refresh at their\n // insertion points. This is needed to avoid the situation where the template is defined in this\n // `LView` but its declaration appears after the insertion component.\n markTransplantedViewsForRefresh(lView);\n }\n runEffectsInView(lView);\n detectChangesInEmbeddedViews(lView, 0 /* ChangeDetectionMode.Global */);\n // Content query results must be refreshed before content hooks are called.\n if (tView.contentQueries !== null) {\n refreshContentQueries(tView, lView);\n }\n // execute content hooks (AfterContentInit, AfterContentChecked)\n // PERF WARNING: do NOT extract this to a separate function without running benchmarks\n if (!isInCheckNoChangesPass) {\n if (hooksInitPhaseCompleted) {\n const contentCheckHooks = tView.contentCheckHooks;\n if (contentCheckHooks !== null) {\n executeCheckHooks(lView, contentCheckHooks);\n }\n } else {\n const contentHooks = tView.contentHooks;\n if (contentHooks !== null) {\n executeInitAndCheckHooks(lView, contentHooks, 1 /* InitPhaseState.AfterContentInitHooksToBeRun */);\n }\n incrementInitPhaseFlags(lView, 1 /* InitPhaseState.AfterContentInitHooksToBeRun */);\n }\n }\n processHostBindingOpCodes(tView, lView);\n // Refresh child component views.\n const components = tView.components;\n if (components !== null) {\n detectChangesInChildComponents(lView, components, 0 /* ChangeDetectionMode.Global */);\n }\n // View queries must execute after refreshing child components because a template in this view\n // could be inserted in a child component. If the view query executes before child component\n // refresh, the template might not yet be inserted.\n const viewQuery = tView.viewQuery;\n if (viewQuery !== null) {\n executeViewQueryFn(2 /* RenderFlags.Update */, viewQuery, context);\n }\n // execute view hooks (AfterViewInit, AfterViewChecked)\n // PERF WARNING: do NOT extract this to a separate function without running benchmarks\n if (!isInCheckNoChangesPass) {\n if (hooksInitPhaseCompleted) {\n const viewCheckHooks = tView.viewCheckHooks;\n if (viewCheckHooks !== null) {\n executeCheckHooks(lView, viewCheckHooks);\n }\n } else {\n const viewHooks = tView.viewHooks;\n if (viewHooks !== null) {\n executeInitAndCheckHooks(lView, viewHooks, 2 /* InitPhaseState.AfterViewInitHooksToBeRun */);\n }\n incrementInitPhaseFlags(lView, 2 /* InitPhaseState.AfterViewInitHooksToBeRun */);\n }\n }\n if (tView.firstUpdatePass === true) {\n // We need to make sure that we only flip the flag on successful `refreshView` only\n // Don't do this in `finally` block.\n // If we did this in `finally` block then an exception could block the execution of styling\n // instructions which in turn would be unable to insert themselves into the styling linked\n // list. The result of this would be that if the exception would not be throw on subsequent CD\n // the styling would be unable to process it data and reflect to the DOM.\n tView.firstUpdatePass = false;\n }\n // Schedule any effects that are waiting on the update pass of this view.\n if (lView[EFFECTS_TO_SCHEDULE]) {\n for (const notifyEffect of lView[EFFECTS_TO_SCHEDULE]) {\n notifyEffect();\n }\n // Once they've been run, we can drop the array.\n lView[EFFECTS_TO_SCHEDULE] = null;\n }\n // Do not reset the dirty state when running in check no changes mode. We don't want components\n // to behave differently depending on whether check no changes is enabled or not. For example:\n // Marking an OnPush component as dirty from within the `ngAfterViewInit` hook in order to\n // refresh a `NgClass` binding should work. If we would reset the dirty state in the check\n // no changes cycle, the component would be not be dirty for the next update pass. This would\n // be different in production mode where the component dirty state is not reset.\n if (!isInCheckNoChangesPass) {\n addAfterRenderSequencesForView(lView);\n lView[FLAGS] &= ~(64 /* LViewFlags.Dirty */ | 8 /* LViewFlags.FirstLViewPass */);\n }\n } catch (e) {\n if (!isInCheckNoChangesPass) {\n // If refreshing a view causes an error, we need to remark the ancestors as needing traversal\n // because the error might have caused a situation where views below the current location are\n // dirty but will be unreachable because the \"has dirty children\" flag in the ancestors has been\n // cleared during change detection and we failed to run to completion.\n markAncestorsForTraversal(lView);\n }\n throw e;\n } finally {\n if (currentConsumer !== null) {\n consumerAfterComputation(currentConsumer, prevConsumer);\n if (returnConsumerToPool) {\n maybeReturnReactiveLViewConsumer(currentConsumer);\n }\n }\n leaveView();\n }\n}\n/**\n * Goes over embedded views (ones created through ViewContainerRef APIs) and refreshes\n * them by executing an associated template function.\n */\nfunction detectChangesInEmbeddedViews(lView, mode) {\n for (let lContainer = getFirstLContainer(lView); lContainer !== null; lContainer = getNextLContainer(lContainer)) {\n for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {\n const embeddedLView = lContainer[i];\n detectChangesInViewIfAttached(embeddedLView, mode);\n }\n }\n}\n/**\n * Mark transplanted views as needing to be refreshed at their attachment points.\n *\n * @param lView The `LView` that may have transplanted views.\n */\nfunction markTransplantedViewsForRefresh(lView) {\n for (let lContainer = getFirstLContainer(lView); lContainer !== null; lContainer = getNextLContainer(lContainer)) {\n if (!(lContainer[FLAGS] & 2 /* LContainerFlags.HasTransplantedViews */)) continue;\n const movedViews = lContainer[MOVED_VIEWS];\n ngDevMode && assertDefined(movedViews, 'Transplanted View flags set but missing MOVED_VIEWS');\n for (let i = 0; i < movedViews.length; i++) {\n const movedLView = movedViews[i];\n markViewForRefresh(movedLView);\n }\n }\n}\n/**\n * Detects changes in a component by entering the component view and processing its bindings,\n * queries, etc. if it is CheckAlways, OnPush and Dirty, etc.\n *\n * @param componentHostIdx Element index in LView[] (adjusted for HEADER_OFFSET)\n */\nfunction detectChangesInComponent(hostLView, componentHostIdx, mode) {\n ngDevMode && assertEqual(isCreationMode(hostLView), false, 'Should be run in update mode');\n profiler(18 /* ProfilerEvent.ComponentStart */);\n const componentView = getComponentLViewByIndex(componentHostIdx, hostLView);\n detectChangesInViewIfAttached(componentView, mode);\n profiler(19 /* ProfilerEvent.ComponentEnd */, componentView[CONTEXT]);\n}\n/**\n * Visits a view as part of change detection traversal.\n *\n * If the view is detached, no additional traversal happens.\n */\nfunction detectChangesInViewIfAttached(lView, mode) {\n if (!viewAttachedToChangeDetector(lView)) {\n return;\n }\n detectChangesInView(lView, mode);\n}\n/**\n * Visits a view as part of change detection traversal.\n *\n * The view is refreshed if:\n * - If the view is CheckAlways or Dirty and ChangeDetectionMode is `Global`\n * - If the view has the `RefreshView` flag\n *\n * The view is not refreshed, but descendants are traversed in `ChangeDetectionMode.Targeted` if the\n * view HasChildViewsToRefresh flag is set.\n */\nfunction detectChangesInView(lView, mode) {\n const isInCheckNoChangesPass = ngDevMode && isInCheckNoChangesMode();\n const tView = lView[TVIEW];\n const flags = lView[FLAGS];\n const consumer = lView[REACTIVE_TEMPLATE_CONSUMER];\n // Refresh CheckAlways views in Global mode.\n let shouldRefreshView = !!(mode === 0 /* ChangeDetectionMode.Global */ && flags & 16 /* LViewFlags.CheckAlways */);\n // Refresh Dirty views in Global mode, as long as we're not in checkNoChanges.\n // CheckNoChanges never worked with `OnPush` components because the `Dirty` flag was\n // cleared before checkNoChanges ran. Because there is now a loop for to check for\n // backwards views, it gives an opportunity for `OnPush` components to be marked `Dirty`\n // before the CheckNoChanges pass. We don't want existing errors that are hidden by the\n // current CheckNoChanges bug to surface when making unrelated changes.\n shouldRefreshView ||= !!(flags & 64 /* LViewFlags.Dirty */ && mode === 0 /* ChangeDetectionMode.Global */ && !isInCheckNoChangesPass);\n // Always refresh views marked for refresh, regardless of mode.\n shouldRefreshView ||= !!(flags & 1024 /* LViewFlags.RefreshView */);\n // Refresh views when they have a dirty reactive consumer, regardless of mode.\n shouldRefreshView ||= !!(consumer?.dirty && consumerPollProducersForChange(consumer));\n shouldRefreshView ||= !!(ngDevMode && isExhaustiveCheckNoChanges());\n // Mark the Flags and `ReactiveNode` as not dirty before refreshing the component, so that they\n // can be re-dirtied during the refresh process.\n if (consumer) {\n consumer.dirty = false;\n }\n lView[FLAGS] &= ~(8192 /* LViewFlags.HasChildViewsToRefresh */ | 1024 /* LViewFlags.RefreshView */);\n if (shouldRefreshView) {\n refreshView(tView, lView, tView.template, lView[CONTEXT]);\n } else if (flags & 8192 /* LViewFlags.HasChildViewsToRefresh */) {\n // Set active consumer to null to avoid inheriting an improper reactive context\n const prevConsumer = setActiveConsumer(null);\n try {\n if (!isInCheckNoChangesPass) {\n runEffectsInView(lView);\n }\n detectChangesInEmbeddedViews(lView, 1 /* ChangeDetectionMode.Targeted */);\n const components = tView.components;\n if (components !== null) {\n detectChangesInChildComponents(lView, components, 1 /* ChangeDetectionMode.Targeted */);\n }\n if (!isInCheckNoChangesPass) {\n addAfterRenderSequencesForView(lView);\n }\n } finally {\n setActiveConsumer(prevConsumer);\n }\n }\n}\n/** Refreshes child components in the current view (update mode). */\nfunction detectChangesInChildComponents(hostLView, components, mode) {\n for (let i = 0; i < components.length; i++) {\n detectChangesInComponent(hostLView, components[i], mode);\n }\n}\n/**\n * Invoke `HostBindingsFunction`s for view.\n *\n * This methods executes `TView.hostBindingOpCodes`. It is used to execute the\n * `HostBindingsFunction`s associated with the current `LView`.\n *\n * @param tView Current `TView`.\n * @param lView Current `LView`.\n */\nfunction processHostBindingOpCodes(tView, lView) {\n const hostBindingOpCodes = tView.hostBindingOpCodes;\n if (hostBindingOpCodes === null) return;\n try {\n for (let i = 0; i < hostBindingOpCodes.length; i++) {\n const opCode = hostBindingOpCodes[i];\n if (opCode < 0) {\n // Negative numbers are element indexes.\n setSelectedIndex(~opCode);\n } else {\n // Positive numbers are NumberTuple which store bindingRootIndex and directiveIndex.\n const directiveIdx = opCode;\n const bindingRootIndx = hostBindingOpCodes[++i];\n const hostBindingFn = hostBindingOpCodes[++i];\n setBindingRootForHostBindings(bindingRootIndx, directiveIdx);\n const context = lView[directiveIdx];\n profiler(24 /* ProfilerEvent.HostBindingsUpdateStart */, context);\n hostBindingFn(2 /* RenderFlags.Update */, context);\n profiler(25 /* ProfilerEvent.HostBindingsUpdateEnd */, context);\n }\n }\n } finally {\n setSelectedIndex(-1);\n }\n}\n\n/**\n * Marks current view and all ancestors dirty.\n *\n * Returns the root view because it is found as a byproduct of marking the view tree\n * dirty, and can be used by methods that consume markViewDirty() to easily schedule\n * change detection. Otherwise, such methods would need to traverse up the view tree\n * an additional time to get the root view and schedule a tick on it.\n *\n * @param lView The starting LView to mark dirty\n * @returns the root LView\n */\nfunction markViewDirty(lView, source) {\n const dirtyBitsToUse = isRefreshingViews() ?\n // When we are actively refreshing views, we only use the `Dirty` bit to mark a view\n 64 /* LViewFlags.Dirty */ :\n // When we are not actively refreshing a view tree, it is absolutely\n // valid to update state and mark views dirty. We use the `RefreshView` flag in this\n // case to allow synchronously rerunning change detection. This applies today to\n // afterRender hooks as well as animation listeners which execute after detecting\n // changes in a view when the render factory flushes.\n 1024 /* LViewFlags.RefreshView */ | 64 /* LViewFlags.Dirty */;\n lView[ENVIRONMENT].changeDetectionScheduler?.notify(source);\n while (lView) {\n lView[FLAGS] |= dirtyBitsToUse;\n const parent = getLViewParent(lView);\n // Stop traversing up as soon as you find a root view that wasn't attached to any container\n if (isRootView(lView) && !parent) {\n return lView;\n }\n // continue otherwise\n lView = parent;\n }\n return null;\n}\n\n/**\n * Creates a LContainer, either from a container instruction, or for a ViewContainerRef.\n *\n * @param hostNative The host element for the LContainer\n * @param hostTNode The host TNode for the LContainer\n * @param currentView The parent view of the LContainer\n * @param native The native comment element\n * @param isForViewContainerRef Optional a flag indicating the ViewContainerRef case\n * @returns LContainer\n */\nfunction createLContainer(hostNative, currentView, native, tNode) {\n ngDevMode && assertLView(currentView);\n const lContainer = [hostNative,\n // host native\n true,\n // Boolean `true` in this position signifies that this is an `LContainer`\n 0,\n // flags\n currentView,\n // parent\n null,\n // next\n tNode,\n // t_host\n null,\n // dehydrated views\n native,\n // native,\n null,\n // view refs\n null // moved views\n ];\n ngDevMode && assertEqual(lContainer.length, CONTAINER_HEADER_OFFSET, 'Should allocate correct number of slots for LContainer header.');\n return lContainer;\n}\nfunction getLViewFromLContainer(lContainer, index) {\n const adjustedIndex = CONTAINER_HEADER_OFFSET + index;\n // avoid reading past the array boundaries\n if (adjustedIndex < lContainer.length) {\n const lView = lContainer[adjustedIndex];\n ngDevMode && assertLView(lView);\n return lView;\n }\n return undefined;\n}\nfunction addLViewToLContainer(lContainer, lView, index, addToDOM = true) {\n const tView = lView[TVIEW];\n // Insert into the view tree so the new view can be change-detected\n insertView(tView, lView, lContainer, index);\n // Insert elements that belong to this view into the DOM tree\n if (addToDOM) {\n const beforeNode = getBeforeNodeForView(index, lContainer);\n const renderer = lView[RENDERER];\n const parentRNode = renderer.parentNode(lContainer[NATIVE]);\n if (parentRNode !== null) {\n addViewToDOM(tView, lContainer[T_HOST], renderer, lView, parentRNode, beforeNode);\n }\n }\n // When in hydration mode, reset the pointer to the first child in\n // the dehydrated view. This indicates that the view was hydrated and\n // further attaching/detaching should work with this view as normal.\n const hydrationInfo = lView[HYDRATION];\n if (hydrationInfo !== null && hydrationInfo.firstChild !== null) {\n hydrationInfo.firstChild = null;\n }\n}\nfunction removeLViewFromLContainer(lContainer, index) {\n const lView = detachView(lContainer, index);\n if (lView !== undefined) {\n destroyLView(lView[TVIEW], lView);\n }\n return lView;\n}\n/**\n * Detaches a view from a container.\n *\n * This method removes the view from the container's array of active views. It also\n * removes the view's elements from the DOM.\n *\n * @param lContainer The container from which to detach a view\n * @param removeIndex The index of the view to detach\n * @returns Detached LView instance.\n */\nfunction detachView(lContainer, removeIndex) {\n if (lContainer.length <= CONTAINER_HEADER_OFFSET) return;\n const indexInContainer = CONTAINER_HEADER_OFFSET + removeIndex;\n const viewToDetach = lContainer[indexInContainer];\n if (viewToDetach) {\n const declarationLContainer = viewToDetach[DECLARATION_LCONTAINER];\n if (declarationLContainer !== null && declarationLContainer !== lContainer) {\n detachMovedView(declarationLContainer, viewToDetach);\n }\n if (removeIndex > 0) {\n lContainer[indexInContainer - 1][NEXT] = viewToDetach[NEXT];\n }\n const removedLView = removeFromArray(lContainer, CONTAINER_HEADER_OFFSET + removeIndex);\n removeViewFromDOM(viewToDetach[TVIEW], viewToDetach);\n // notify query that a view has been removed\n const lQueries = removedLView[QUERIES];\n if (lQueries !== null) {\n lQueries.detachView(removedLView[TVIEW]);\n }\n viewToDetach[PARENT] = null;\n viewToDetach[NEXT] = null;\n // Unsets the attached flag\n viewToDetach[FLAGS] &= ~128 /* LViewFlags.Attached */;\n }\n return viewToDetach;\n}\n/**\n * Inserts a view into a container.\n *\n * This adds the view to the container's array of active views in the correct\n * position. It also adds the view's elements to the DOM if the container isn't a\n * root node of another view (in that case, the view's elements will be added when\n * the container's parent view is added later).\n *\n * @param tView The `TView' of the `LView` to insert\n * @param lView The view to insert\n * @param lContainer The container into which the view should be inserted\n * @param index Which index in the container to insert the child view into\n */\nfunction insertView(tView, lView, lContainer, index) {\n ngDevMode && assertLView(lView);\n ngDevMode && assertLContainer(lContainer);\n const indexInContainer = CONTAINER_HEADER_OFFSET + index;\n const containerLength = lContainer.length;\n if (index > 0) {\n // This is a new view, we need to add it to the children.\n lContainer[indexInContainer - 1][NEXT] = lView;\n }\n if (index < containerLength - CONTAINER_HEADER_OFFSET) {\n lView[NEXT] = lContainer[indexInContainer];\n addToArray(lContainer, CONTAINER_HEADER_OFFSET + index, lView);\n } else {\n lContainer.push(lView);\n lView[NEXT] = null;\n }\n lView[PARENT] = lContainer;\n // track views where declaration and insertion points are different\n const declarationLContainer = lView[DECLARATION_LCONTAINER];\n if (declarationLContainer !== null && lContainer !== declarationLContainer) {\n trackMovedView(declarationLContainer, lView);\n }\n // notify query that a new view has been added\n const lQueries = lView[QUERIES];\n if (lQueries !== null) {\n lQueries.insertView(tView);\n }\n updateAncestorTraversalFlagsOnAttach(lView);\n // Sets the attached flag\n lView[FLAGS] |= 128 /* LViewFlags.Attached */;\n}\n/**\n * Track views created from the declaration container (TemplateRef) and inserted into a\n * different LContainer or attached directly to ApplicationRef.\n */\nfunction trackMovedView(declarationContainer, lView) {\n ngDevMode && assertDefined(lView, 'LView required');\n ngDevMode && assertLContainer(declarationContainer);\n const movedViews = declarationContainer[MOVED_VIEWS];\n const parent = lView[PARENT];\n ngDevMode && assertDefined(parent, 'missing parent');\n if (isLView(parent)) {\n declarationContainer[FLAGS] |= 2 /* LContainerFlags.HasTransplantedViews */;\n } else {\n const insertedComponentLView = parent[PARENT][DECLARATION_COMPONENT_VIEW];\n ngDevMode && assertDefined(insertedComponentLView, 'Missing insertedComponentLView');\n const declaredComponentLView = lView[DECLARATION_COMPONENT_VIEW];\n ngDevMode && assertDefined(declaredComponentLView, 'Missing declaredComponentLView');\n if (declaredComponentLView !== insertedComponentLView) {\n // At this point the declaration-component is not same as insertion-component; this means that\n // this is a transplanted view. Mark the declared lView as having transplanted views so that\n // those views can participate in CD.\n declarationContainer[FLAGS] |= 2 /* LContainerFlags.HasTransplantedViews */;\n }\n }\n if (movedViews === null) {\n declarationContainer[MOVED_VIEWS] = [lView];\n } else {\n movedViews.push(lView);\n }\n}\nclass ViewRef {\n _lView;\n _cdRefInjectingView;\n _appRef = null;\n _attachedToViewContainer = false;\n exhaustive;\n get rootNodes() {\n const lView = this._lView;\n const tView = lView[TVIEW];\n return collectNativeNodes(tView, lView, tView.firstChild, []);\n }\n constructor(\n /**\n * This represents `LView` associated with the component when ViewRef is a ChangeDetectorRef.\n *\n * When ViewRef is created for a dynamic component, this also represents the `LView` for the\n * component.\n *\n * For a \"regular\" ViewRef created for an embedded view, this is the `LView` for the embedded\n * view.\n *\n * @internal\n */\n _lView,\n /**\n * This represents the `LView` associated with the point where `ChangeDetectorRef` was\n * requested.\n *\n * This may be different from `_lView` if the `_cdRefInjectingView` is an embedded view.\n */\n _cdRefInjectingView) {\n this._lView = _lView;\n this._cdRefInjectingView = _cdRefInjectingView;\n }\n get context() {\n return this._lView[CONTEXT];\n }\n /**\n * @deprecated Replacing the full context object is not supported. Modify the context\n * directly, or consider using a `Proxy` if you need to replace the full object.\n * // TODO(devversion): Remove this.\n */\n set context(value) {\n if (ngDevMode) {\n // Note: We have a warning message here because the `@deprecated` JSDoc will not be picked\n // up for assignments on the setter. We want to let users know about the deprecated usage.\n console.warn('Angular: Replacing the `context` object of an `EmbeddedViewRef` is deprecated.');\n }\n this._lView[CONTEXT] = value;\n }\n get destroyed() {\n return isDestroyed(this._lView);\n }\n destroy() {\n if (this._appRef) {\n this._appRef.detachView(this);\n } else if (this._attachedToViewContainer) {\n const parent = this._lView[PARENT];\n if (isLContainer(parent)) {\n const viewRefs = parent[VIEW_REFS];\n const index = viewRefs ? viewRefs.indexOf(this) : -1;\n if (index > -1) {\n ngDevMode && assertEqual(index, parent.indexOf(this._lView) - CONTAINER_HEADER_OFFSET, 'An attached view should be in the same position within its container as its ViewRef in the VIEW_REFS array.');\n detachView(parent, index);\n removeFromArray(viewRefs, index);\n }\n }\n this._attachedToViewContainer = false;\n }\n destroyLView(this._lView[TVIEW], this._lView);\n }\n onDestroy(callback) {\n storeLViewOnDestroy(this._lView, callback);\n }\n /**\n * Marks a view and all of its ancestors dirty.\n *\n * This can be used to ensure an {@link ChangeDetectionStrategy#OnPush} component is\n * checked when it needs to be re-rendered but the two normal triggers haven't marked it\n * dirty (i.e. inputs haven't changed and events haven't fired in the view).\n *\n * <!-- TODO: Add a link to a chapter on OnPush components -->\n *\n * @usageNotes\n * ### Example\n *\n * ```ts\n * @Component({\n * selector: 'app-root',\n * template: `Number of ticks: {{numberOfTicks}}`\n * changeDetection: ChangeDetectionStrategy.OnPush,\n * })\n * class AppComponent {\n * numberOfTicks = 0;\n *\n * constructor(private ref: ChangeDetectorRef) {\n * setInterval(() => {\n * this.numberOfTicks++;\n * // the following is required, otherwise the view will not be updated\n * this.ref.markForCheck();\n * }, 1000);\n * }\n * }\n * ```\n */\n markForCheck() {\n markViewDirty(this._cdRefInjectingView || this._lView, 4 /* NotificationSource.MarkForCheck */);\n }\n /**\n * Detaches the view from the change detection tree.\n *\n * Detached views will not be checked during change detection runs until they are\n * re-attached, even if they are dirty. `detach` can be used in combination with\n * {@link ChangeDetectorRef#detectChanges} to implement local change\n * detection checks.\n *\n * <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->\n * <!-- TODO: Add a live demo once ref.detectChanges is merged into master -->\n *\n * @usageNotes\n * ### Example\n *\n * The following example defines a component with a large list of readonly data.\n * Imagine the data changes constantly, many times per second. For performance reasons,\n * we want to check and update the list every five seconds. We can do that by detaching\n * the component's change detector and doing a local check every five seconds.\n *\n * ```ts\n * class DataProvider {\n * // in a real application the returned data will be different every time\n * get data() {\n * return [1,2,3,4,5];\n * }\n * }\n *\n * @Component({\n * selector: 'giant-list',\n * template: `\n * @for(d of dataProvider.data; track $index) {\n * <li>Data {{d}}</li>\n * }\n * `,\n * })\n * class GiantList {\n * constructor(private ref: ChangeDetectorRef, private dataProvider: DataProvider) {\n * ref.detach();\n * setInterval(() => {\n * this.ref.detectChanges();\n * }, 5000);\n * }\n * }\n *\n * @Component({\n * selector: 'app',\n * providers: [DataProvider],\n * template: `\n * <giant-list><giant-list>\n * `,\n * })\n * class App {\n * }\n * ```\n */\n detach() {\n this._lView[FLAGS] &= ~128 /* LViewFlags.Attached */;\n }\n /**\n * Re-attaches a view to the change detection tree.\n *\n * This can be used to re-attach views that were previously detached from the tree\n * using {@link ChangeDetectorRef#detach}. Views are attached to the tree by default.\n *\n * <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->\n *\n * @usageNotes\n * ### Example\n *\n * The following example creates a component displaying `live` data. The component will detach\n * its change detector from the main change detector tree when the component's live property\n * is set to false.\n *\n * ```ts\n * class DataProvider {\n * data = 1;\n *\n * constructor() {\n * setInterval(() => {\n * this.data = this.data * 2;\n * }, 500);\n * }\n * }\n *\n * @Component({\n * selector: 'live-data',\n * inputs: ['live'],\n * template: 'Data: {{dataProvider.data}}'\n * })\n * class LiveData {\n * constructor(private ref: ChangeDetectorRef, private dataProvider: DataProvider) {}\n *\n * set live(value) {\n * if (value) {\n * this.ref.reattach();\n * } else {\n * this.ref.detach();\n * }\n * }\n * }\n *\n * @Component({\n * selector: 'app-root',\n * providers: [DataProvider],\n * template: `\n * Live Update: <input type=\"checkbox\" [(ngModel)]=\"live\">\n * <live-data [live]=\"live\"><live-data>\n * `,\n * })\n * class AppComponent {\n * live = true;\n * }\n * ```\n */\n reattach() {\n updateAncestorTraversalFlagsOnAttach(this._lView);\n this._lView[FLAGS] |= 128 /* LViewFlags.Attached */;\n }\n /**\n * Checks the view and its children.\n *\n * This can also be used in combination with {@link ChangeDetectorRef#detach} to implement\n * local change detection checks.\n *\n * <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->\n * <!-- TODO: Add a live demo once ref.detectChanges is merged into master -->\n *\n * @usageNotes\n * ### Example\n *\n * The following example defines a component with a large list of readonly data.\n * Imagine, the data changes constantly, many times per second. For performance reasons,\n * we want to check and update the list every five seconds.\n *\n * We can do that by detaching the component's change detector and doing a local change detection\n * check every five seconds.\n *\n * See {@link ChangeDetectorRef#detach} for more information.\n */\n detectChanges() {\n // Add `RefreshView` flag to ensure this view is refreshed if not already dirty.\n // `RefreshView` flag is used intentionally over `Dirty` because it gets cleared before\n // executing any of the actual refresh code while the `Dirty` flag doesn't get cleared\n // until the end of the refresh. Using `RefreshView` prevents creating a potential difference\n // in the state of the LViewFlags during template execution.\n this._lView[FLAGS] |= 1024 /* LViewFlags.RefreshView */;\n detectChangesInternal(this._lView);\n }\n /**\n * Checks the change detector and its children, and throws if any changes are detected.\n *\n * This is used in development mode to verify that running change detection doesn't\n * introduce other changes.\n */\n checkNoChanges() {\n if (!ngDevMode) return;\n try {\n this.exhaustive ??= this._lView[INJECTOR].get(UseExhaustiveCheckNoChanges, USE_EXHAUSTIVE_CHECK_NO_CHANGES_DEFAULT);\n } catch {\n this.exhaustive = USE_EXHAUSTIVE_CHECK_NO_CHANGES_DEFAULT;\n }\n checkNoChangesInternal(this._lView, this.exhaustive);\n }\n attachToViewContainerRef() {\n if (this._appRef) {\n throw new RuntimeError(902 /* RuntimeErrorCode.VIEW_ALREADY_ATTACHED */, ngDevMode && 'This view is already attached directly to the ApplicationRef!');\n }\n this._attachedToViewContainer = true;\n }\n detachFromAppRef() {\n this._appRef = null;\n const isRoot = isRootView(this._lView);\n const declarationContainer = this._lView[DECLARATION_LCONTAINER];\n if (declarationContainer !== null && !isRoot) {\n detachMovedView(declarationContainer, this._lView);\n }\n detachViewFromDOM(this._lView[TVIEW], this._lView);\n }\n attachToAppRef(appRef) {\n if (this._attachedToViewContainer) {\n throw new RuntimeError(902 /* RuntimeErrorCode.VIEW_ALREADY_ATTACHED */, ngDevMode && 'This view is already attached to a ViewContainer!');\n }\n this._appRef = appRef;\n const isRoot = isRootView(this._lView);\n const declarationContainer = this._lView[DECLARATION_LCONTAINER];\n if (declarationContainer !== null && !isRoot) {\n trackMovedView(declarationContainer, this._lView);\n }\n updateAncestorTraversalFlagsOnAttach(this._lView);\n }\n}\n/**\n * Reports whether the given view is considered dirty according to the different marking mechanisms.\n */\nfunction isViewDirty(view) {\n return requiresRefreshOrTraversal(view._lView) || !!(view._lView[FLAGS] & 64 /* LViewFlags.Dirty */);\n}\nfunction markForRefresh(view) {\n // This function is only used by elements where _cdRefInjectingView is the same as _lView\n markViewForRefresh(view._lView);\n}\n\n/**\n * Represents an embedded template that can be used to instantiate embedded views.\n * To instantiate embedded views based on a template, use the `ViewContainerRef`\n * method `createEmbeddedView()`.\n *\n * Access a `TemplateRef` instance by placing a directive on an `<ng-template>`\n * element (or directive prefixed with `*`). The `TemplateRef` for the embedded view\n * is injected into the constructor of the directive,\n * using the `TemplateRef` token.\n *\n * You can also use a `Query` to find a `TemplateRef` associated with\n * a component or a directive.\n *\n * @see {@link ViewContainerRef}\n *\n * @publicApi\n */\nclass TemplateRef {\n _declarationLView;\n _declarationTContainer;\n /**\n * The anchor element in the parent view for this embedded view.\n *\n * The data-binding and [injection contexts](guide/di/dependency-injection-context) of embedded\n * views created from this `TemplateRef` inherit from the contexts of this location.\n *\n * Typically new embedded views are attached to the view container of this location, but in\n * advanced use-cases, the view can be attached to a different container while keeping the\n * data-binding and injection context from the original location.\n *\n */\n elementRef;\n /**\n * @internal\n * @nocollapse\n */\n static __NG_ELEMENT_ID__ = injectTemplateRef;\n /** @internal */\n constructor(_declarationLView, _declarationTContainer, elementRef) {\n this._declarationLView = _declarationLView;\n this._declarationTContainer = _declarationTContainer;\n this.elementRef = elementRef;\n }\n /**\n * Returns an `ssrId` associated with a TView, which was used to\n * create this instance of the `TemplateRef`.\n *\n * @internal\n */\n get ssrId() {\n return this._declarationTContainer.tView?.ssrId || null;\n }\n /**\n * Instantiates an unattached embedded view based on this template.\n * @param context The data-binding context of the embedded view, as declared\n * in the `<ng-template>` usage.\n * @param injector Injector to be used within the embedded view.\n * @returns The new embedded view object.\n */\n createEmbeddedView(context, injector) {\n return this.createEmbeddedViewImpl(context, injector);\n }\n /**\n * Implementation of the `createEmbeddedView` function.\n *\n * This implementation is internal and allows framework code\n * to invoke it with extra parameters (e.g. for hydration) without\n * affecting public API.\n *\n * @internal\n */\n createEmbeddedViewImpl(context, injector, dehydratedView) {\n const embeddedLView = createAndRenderEmbeddedLView(this._declarationLView, this._declarationTContainer, context, {\n embeddedViewInjector: injector,\n dehydratedView\n });\n return new ViewRef(embeddedLView);\n }\n}\n/**\n * Creates a TemplateRef given a node.\n *\n * @returns The TemplateRef instance to use\n */\nfunction injectTemplateRef() {\n return createTemplateRef(getCurrentTNode(), getLView());\n}\n/**\n * Creates a TemplateRef and stores it on the injector.\n *\n * @param hostTNode The node on which a TemplateRef is requested\n * @param hostLView The `LView` to which the node belongs\n * @returns The TemplateRef instance or null if we can't create a TemplateRef on a given node type\n */\nfunction createTemplateRef(hostTNode, hostLView) {\n if (hostTNode.type & 4 /* TNodeType.Container */) {\n ngDevMode && assertDefined(hostTNode.tView, 'TView must be allocated');\n return new TemplateRef(hostLView, hostTNode, createElementRef(hostTNode, hostLView));\n }\n return null;\n}\nconst AT_THIS_LOCATION = '<-- AT THIS LOCATION';\n/**\n * Retrieves a user friendly string for a given TNodeType for use in\n * friendly error messages\n *\n * @param tNodeType\n * @returns\n */\nfunction getFriendlyStringFromTNodeType(tNodeType) {\n switch (tNodeType) {\n case 4 /* TNodeType.Container */:\n return 'view container';\n case 2 /* TNodeType.Element */:\n return 'element';\n case 8 /* TNodeType.ElementContainer */:\n return 'ng-container';\n case 32 /* TNodeType.Icu */:\n return 'icu';\n case 64 /* TNodeType.Placeholder */:\n return 'i18n';\n case 16 /* TNodeType.Projection */:\n return 'projection';\n case 1 /* TNodeType.Text */:\n return 'text';\n case 128 /* TNodeType.LetDeclaration */:\n return '@let';\n default:\n // This should not happen as we cover all possible TNode types above.\n return '<unknown>';\n }\n}\n/**\n * Validates that provided nodes match during the hydration process.\n */\nfunction validateMatchingNode(node, nodeType, tagName, lView, tNode, isViewContainerAnchor = false) {\n if (!node || node.nodeType !== nodeType || node.nodeType === Node.ELEMENT_NODE && node.tagName.toLowerCase() !== tagName?.toLowerCase()) {\n const expectedNode = shortRNodeDescription(nodeType, tagName, null);\n let header = `During hydration Angular expected ${expectedNode} but `;\n const hostComponentDef = getDeclarationComponentDef(lView);\n const componentClassName = hostComponentDef?.type?.name;\n const expectedDom = describeExpectedDom(lView, tNode, isViewContainerAnchor);\n const expected = `Angular expected this DOM:\\n\\n${expectedDom}\\n\\n`;\n let actual = '';\n const componentHostElement = unwrapRNode(lView[HOST]);\n if (!node) {\n // No node found during hydration.\n header += `the node was not found.\\n\\n`;\n // Since the node is missing, we use the closest node to attach the error to\n markRNodeAsHavingHydrationMismatch(componentHostElement, expectedDom);\n } else {\n const actualNode = shortRNodeDescription(node.nodeType, node.tagName ?? null, node.textContent ?? null);\n header += `found ${actualNode}.\\n\\n`;\n const actualDom = describeDomFromNode(node);\n actual = `Actual DOM is:\\n\\n${actualDom}\\n\\n`;\n // DevTools only report hydration issues on the component level, so we attach extra debug\n // info to a component host element to make it available to DevTools.\n markRNodeAsHavingHydrationMismatch(componentHostElement, expectedDom, actualDom);\n }\n const footer = getHydrationErrorFooter(componentClassName);\n const message = header + expected + actual + getHydrationAttributeNote() + footer;\n throw new RuntimeError(-500 /* RuntimeErrorCode.HYDRATION_NODE_MISMATCH */, message);\n }\n}\n/**\n * Validates that a given node has sibling nodes\n */\nfunction validateSiblingNodeExists(node) {\n validateNodeExists(node);\n if (!node.nextSibling) {\n const header = 'During hydration Angular expected more sibling nodes to be present.\\n\\n';\n const actual = `Actual DOM is:\\n\\n${describeDomFromNode(node)}\\n\\n`;\n const footer = getHydrationErrorFooter();\n const message = header + actual + footer;\n markRNodeAsHavingHydrationMismatch(node, '', actual);\n throw new RuntimeError(-501 /* RuntimeErrorCode.HYDRATION_MISSING_SIBLINGS */, message);\n }\n}\n/**\n * Validates that a node exists or throws\n */\nfunction validateNodeExists(node, lView = null, tNode = null) {\n if (!node) {\n const header = 'During hydration, Angular expected an element to be present at this location.\\n\\n';\n let expected = '';\n let footer = '';\n if (lView !== null && tNode !== null) {\n expected = describeExpectedDom(lView, tNode, false);\n footer = getHydrationErrorFooter();\n // Since the node is missing, we use the closest node to attach the error to\n markRNodeAsHavingHydrationMismatch(unwrapRNode(lView[HOST]), expected, '');\n }\n throw new RuntimeError(-502 /* RuntimeErrorCode.HYDRATION_MISSING_NODE */, `${header}${expected}\\n\\n${footer}`);\n }\n}\n/**\n * Builds the hydration error message when a node is not found\n *\n * @param lView the LView where the node exists\n * @param tNode the TNode\n */\nfunction nodeNotFoundError(lView, tNode) {\n const header = 'During serialization, Angular was unable to find an element in the DOM:\\n\\n';\n const expected = `${describeExpectedDom(lView, tNode, false)}\\n\\n`;\n const footer = getHydrationErrorFooter();\n throw new RuntimeError(-502 /* RuntimeErrorCode.HYDRATION_MISSING_NODE */, header + expected + footer);\n}\n/**\n * Builds a hydration error message when a node is not found at a path location\n *\n * @param host the Host Node\n * @param path the path to the node\n */\nfunction nodeNotFoundAtPathError(host, path) {\n const header = `During hydration Angular was unable to locate a node ` + `using the \"${path}\" path, starting from the ${describeRNode(host)} node.\\n\\n`;\n const footer = getHydrationErrorFooter();\n markRNodeAsHavingHydrationMismatch(host);\n throw new RuntimeError(-502 /* RuntimeErrorCode.HYDRATION_MISSING_NODE */, header + footer);\n}\n/**\n * Builds the hydration error message in the case that dom nodes are created outside of\n * the Angular context and are being used as projected nodes\n *\n * @param lView the LView\n * @param tNode the TNode\n * @returns an error\n */\nfunction unsupportedProjectionOfDomNodes(rNode) {\n const header = 'During serialization, Angular detected DOM nodes ' + 'that were created outside of Angular context and provided as projectable nodes ' + '(likely via `ViewContainerRef.createComponent` or `createComponent` APIs). ' + 'Hydration is not supported for such cases, consider refactoring the code to avoid ' + 'this pattern or using `ngSkipHydration` on the host element of the component.\\n\\n';\n const actual = `${describeDomFromNode(rNode)}\\n\\n`;\n const message = header + actual + getHydrationAttributeNote();\n return new RuntimeError(-503 /* RuntimeErrorCode.UNSUPPORTED_PROJECTION_DOM_NODES */, message);\n}\n/**\n * Builds the hydration error message in the case that ngSkipHydration was used on a\n * node that is not a component host element or host binding\n *\n * @param rNode the HTML Element\n * @returns an error\n */\nfunction invalidSkipHydrationHost(rNode) {\n const header = 'The `ngSkipHydration` flag is applied on a node ' + \"that doesn't act as a component host. Hydration can be \" + 'skipped only on per-component basis.\\n\\n';\n const actual = `${describeDomFromNode(rNode)}\\n\\n`;\n const footer = 'Please move the `ngSkipHydration` attribute to the component host element.\\n\\n';\n const message = header + actual + footer;\n return new RuntimeError(-504 /* RuntimeErrorCode.INVALID_SKIP_HYDRATION_HOST */, message);\n}\n// Stringification methods\n/**\n * Stringifies a given TNode's attributes\n *\n * @param tNode a provided TNode\n * @returns string\n */\nfunction stringifyTNodeAttrs(tNode) {\n const results = [];\n if (tNode.attrs) {\n for (let i = 0; i < tNode.attrs.length;) {\n const attrName = tNode.attrs[i++];\n // Once we reach the first flag, we know that the list of\n // attributes is over.\n if (typeof attrName == 'number') {\n break;\n }\n const attrValue = tNode.attrs[i++];\n results.push(`${attrName}=\"${shorten(attrValue)}\"`);\n }\n }\n return results.join(' ');\n}\n/**\n * The list of internal attributes that should be filtered out while\n * producing an error message.\n */\nconst internalAttrs = new Set(['ngh', 'ng-version', 'ng-server-context']);\n/**\n * Stringifies an HTML Element's attributes\n *\n * @param rNode an HTML Element\n * @returns string\n */\nfunction stringifyRNodeAttrs(rNode) {\n const results = [];\n for (let i = 0; i < rNode.attributes.length; i++) {\n const attr = rNode.attributes[i];\n if (internalAttrs.has(attr.name)) continue;\n results.push(`${attr.name}=\"${shorten(attr.value)}\"`);\n }\n return results.join(' ');\n}\n// Methods for Describing the DOM\n/**\n * Converts a tNode to a helpful readable string value for use in error messages\n *\n * @param tNode a given TNode\n * @param innerContent the content of the node\n * @returns string\n */\nfunction describeTNode(tNode, innerContent = '…') {\n switch (tNode.type) {\n case 1 /* TNodeType.Text */:\n const content = tNode.value ? `(${tNode.value})` : '';\n return `#text${content}`;\n case 2 /* TNodeType.Element */:\n const attrs = stringifyTNodeAttrs(tNode);\n const tag = tNode.value.toLowerCase();\n return `<${tag}${attrs ? ' ' + attrs : ''}>${innerContent}</${tag}>`;\n case 8 /* TNodeType.ElementContainer */:\n return '<!-- ng-container -->';\n case 4 /* TNodeType.Container */:\n return '<!-- container -->';\n default:\n const typeAsString = getFriendlyStringFromTNodeType(tNode.type);\n return `#node(${typeAsString})`;\n }\n}\n/**\n * Converts an RNode to a helpful readable string value for use in error messages\n *\n * @param rNode a given RNode\n * @param innerContent the content of the node\n * @returns string\n */\nfunction describeRNode(rNode, innerContent = '…') {\n const node = rNode;\n switch (node.nodeType) {\n case Node.ELEMENT_NODE:\n const tag = node.tagName.toLowerCase();\n const attrs = stringifyRNodeAttrs(node);\n return `<${tag}${attrs ? ' ' + attrs : ''}>${innerContent}</${tag}>`;\n case Node.TEXT_NODE:\n const content = node.textContent ? shorten(node.textContent) : '';\n return `#text${content ? `(${content})` : ''}`;\n case Node.COMMENT_NODE:\n return `<!-- ${shorten(node.textContent ?? '')} -->`;\n default:\n return `#node(${node.nodeType})`;\n }\n}\n/**\n * Builds the string containing the expected DOM present given the LView and TNode\n * values for a readable error message\n *\n * @param lView the lView containing the DOM\n * @param tNode the tNode\n * @param isViewContainerAnchor boolean\n * @returns string\n */\nfunction describeExpectedDom(lView, tNode, isViewContainerAnchor) {\n const spacer = ' ';\n let content = '';\n if (tNode.prev) {\n content += spacer + '…\\n';\n content += spacer + describeTNode(tNode.prev) + '\\n';\n } else if (tNode.type && tNode.type & 12 /* TNodeType.AnyContainer */) {\n content += spacer + '…\\n';\n }\n if (isViewContainerAnchor) {\n content += spacer + describeTNode(tNode) + '\\n';\n content += spacer + `<!-- container --> ${AT_THIS_LOCATION}\\n`;\n } else {\n content += spacer + describeTNode(tNode) + ` ${AT_THIS_LOCATION}\\n`;\n }\n content += spacer + '…\\n';\n const parentRNode = tNode.type ? getParentRElement(lView[TVIEW], tNode, lView) : null;\n if (parentRNode) {\n content = describeRNode(parentRNode, '\\n' + content);\n }\n return content;\n}\n/**\n * Builds the string containing the DOM present around a given RNode for a\n * readable error message\n *\n * @param node the RNode\n * @returns string\n */\nfunction describeDomFromNode(node) {\n const spacer = ' ';\n let content = '';\n const currentNode = node;\n if (currentNode.previousSibling) {\n content += spacer + '…\\n';\n content += spacer + describeRNode(currentNode.previousSibling) + '\\n';\n }\n content += spacer + describeRNode(currentNode) + ` ${AT_THIS_LOCATION}\\n`;\n if (node.nextSibling) {\n content += spacer + '…\\n';\n }\n if (node.parentNode) {\n content = describeRNode(currentNode.parentNode, '\\n' + content);\n }\n return content;\n}\n/**\n * Shortens the description of a given RNode by its type for readability\n *\n * @param nodeType the type of node\n * @param tagName the node tag name\n * @param textContent the text content in the node\n * @returns string\n */\nfunction shortRNodeDescription(nodeType, tagName, textContent) {\n switch (nodeType) {\n case Node.ELEMENT_NODE:\n return `<${tagName.toLowerCase()}>`;\n case Node.TEXT_NODE:\n const content = textContent ? ` (with the \"${shorten(textContent)}\" content)` : '';\n return `a text node${content}`;\n case Node.COMMENT_NODE:\n return 'a comment node';\n default:\n return `#node(nodeType=${nodeType})`;\n }\n}\n/**\n * Builds the footer hydration error message\n *\n * @param componentClassName the name of the component class\n * @returns string\n */\nfunction getHydrationErrorFooter(componentClassName) {\n const componentInfo = componentClassName ? `the \"${componentClassName}\"` : 'corresponding';\n return `To fix this problem:\\n` + ` * check ${componentInfo} component for hydration-related issues\\n` + ` * check to see if your template has valid HTML structure\\n` + ` * or skip hydration by adding the \\`ngSkipHydration\\` attribute ` + `to its host node in a template\\n\\n`;\n}\n/**\n * An attribute related note for hydration errors\n */\nfunction getHydrationAttributeNote() {\n return 'Note: attributes are only displayed to better represent the DOM' + ' but have no effect on hydration mismatches.\\n\\n';\n}\n// Node string utility functions\n/**\n * Strips all newlines out of a given string\n *\n * @param input a string to be cleared of new line characters\n * @returns\n */\nfunction stripNewlines(input) {\n return input.replace(/\\s+/gm, '');\n}\n/**\n * Reduces a string down to a maximum length of characters with ellipsis for readability\n *\n * @param input a string input\n * @param maxLength a maximum length in characters\n * @returns string\n */\nfunction shorten(input, maxLength = 50) {\n if (!input) {\n return '';\n }\n input = stripNewlines(input);\n return input.length > maxLength ? `${input.substring(0, maxLength - 1)}…` : input;\n}\n\n/**\n * Find a node in front of which `currentTNode` should be inserted (takes i18n into account).\n *\n * This method determines the `RNode` in front of which we should insert the `currentRNode`. This\n * takes `TNode.insertBeforeIndex` into account.\n *\n * @param parentTNode parent `TNode`\n * @param currentTNode current `TNode` (The node which we would like to insert into the DOM)\n * @param lView current `LView`\n */\nfunction getInsertInFrontOfRNodeWithI18n(parentTNode, currentTNode, lView) {\n const tNodeInsertBeforeIndex = currentTNode.insertBeforeIndex;\n const insertBeforeIndex = Array.isArray(tNodeInsertBeforeIndex) ? tNodeInsertBeforeIndex[0] : tNodeInsertBeforeIndex;\n if (insertBeforeIndex === null) {\n return getInsertInFrontOfRNodeWithNoI18n(parentTNode, currentTNode, lView);\n } else {\n ngDevMode && assertIndexInRange(lView, insertBeforeIndex);\n return unwrapRNode(lView[insertBeforeIndex]);\n }\n}\n/**\n * Process `TNode.insertBeforeIndex` by adding i18n text nodes.\n *\n * See `TNode.insertBeforeIndex`\n */\nfunction processI18nInsertBefore(renderer, childTNode, lView, childRNode, parentRElement) {\n const tNodeInsertBeforeIndex = childTNode.insertBeforeIndex;\n if (Array.isArray(tNodeInsertBeforeIndex)) {\n // An array indicates that there are i18n nodes that need to be added as children of this\n // `childRNode`. These i18n nodes were created before this `childRNode` was available and so\n // only now can be added. The first element of the array is the normal index where we should\n // insert the `childRNode`. Additional elements are the extra nodes to be added as children of\n // `childRNode`.\n ngDevMode && assertDomNode(childRNode);\n let i18nParent = childRNode;\n let anchorRNode = null;\n if (!(childTNode.type & 3 /* TNodeType.AnyRNode */)) {\n anchorRNode = i18nParent;\n i18nParent = parentRElement;\n }\n if (i18nParent !== null && childTNode.componentOffset === -1) {\n for (let i = 1; i < tNodeInsertBeforeIndex.length; i++) {\n // No need to `unwrapRNode` because all of the indexes point to i18n text nodes.\n // see `assertDomNode` below.\n const i18nChild = lView[tNodeInsertBeforeIndex[i]];\n nativeInsertBefore(renderer, i18nParent, i18nChild, anchorRNode, false);\n }\n }\n }\n}\nfunction getOrCreateTNode(tView, index, type, name, attrs) {\n ngDevMode && index !== 0 &&\n // 0 are bogus nodes and they are OK. See `createContainerRef` in\n // `view_engine_compatibility` for additional context.\n assertGreaterThanOrEqual(index, HEADER_OFFSET, \"TNodes can't be in the LView header.\");\n // Keep this function short, so that the VM will inline it.\n ngDevMode && assertPureTNodeType(type);\n let tNode = tView.data[index];\n if (tNode === null) {\n tNode = createTNodeAtIndex(tView, index, type, name, attrs);\n if (isInI18nBlock()) {\n // If we are in i18n block then all elements should be pre declared through `Placeholder`\n // See `TNodeType.Placeholder` and `LFrame.inI18n` for more context.\n // If the `TNode` was not pre-declared than it means it was not mentioned which means it was\n // removed, so we mark it as detached.\n tNode.flags |= 32 /* TNodeFlags.isDetached */;\n }\n } else if (tNode.type & 64 /* TNodeType.Placeholder */) {\n tNode.type = type;\n tNode.value = name;\n tNode.attrs = attrs;\n const parent = getCurrentParentTNode();\n tNode.injectorIndex = parent === null ? -1 : parent.injectorIndex;\n ngDevMode && assertTNodeForTView(tNode, tView);\n ngDevMode && assertEqual(index, tNode.index, 'Expecting same index');\n }\n setCurrentTNode(tNode, true);\n return tNode;\n}\nfunction createTNodeAtIndex(tView, index, type, name, attrs) {\n const currentTNode = getCurrentTNodePlaceholderOk();\n const isParent = isCurrentTNodeParent();\n const parent = isParent ? currentTNode : currentTNode && currentTNode.parent;\n // Parents cannot cross component boundaries because components will be used in multiple places.\n const tNode = tView.data[index] = createTNode(tView, parent, type, index, name, attrs);\n // Assign a pointer to the first child node of a given view. The first node is not always the one\n // at index 0, in case of i18n, index 0 can be the instruction `i18nStart` and the first node has\n // the index 1 or more, so we can't just check node index.\n linkTNodeInTView(tView, tNode, currentTNode, isParent);\n return tNode;\n}\nfunction linkTNodeInTView(tView, tNode, currentTNode, isParent) {\n if (tView.firstChild === null) {\n tView.firstChild = tNode;\n }\n if (currentTNode !== null) {\n if (isParent) {\n // FIXME(misko): This logic looks unnecessarily complicated. Could we simplify?\n if (currentTNode.child == null && tNode.parent !== null) {\n // We are in the same view, which means we are adding content node to the parent view.\n currentTNode.child = tNode;\n }\n } else {\n if (currentTNode.next === null) {\n // In the case of i18n the `currentTNode` may already be linked, in which case we don't want\n // to break the links which i18n created.\n currentTNode.next = tNode;\n tNode.prev = currentTNode;\n }\n }\n }\n}\nfunction createTNode(tView, tParent, type, index, value, attrs) {\n ngDevMode && index !== 0 &&\n // 0 are bogus nodes and they are OK. See `createContainerRef` in\n // `view_engine_compatibility` for additional context.\n assertGreaterThanOrEqual(index, HEADER_OFFSET, \"TNodes can't be in the LView header.\");\n ngDevMode && assertNotSame(attrs, undefined, \"'undefined' is not valid value for 'attrs'\");\n ngDevMode && tParent && assertTNodeForTView(tParent, tView);\n let injectorIndex = tParent ? tParent.injectorIndex : -1;\n let flags = 0;\n if (isInSkipHydrationBlock$1()) {\n flags |= 128 /* TNodeFlags.inSkipHydrationBlock */;\n }\n // TODO: would it be helpful to use a prototypal inheritance here, similar to the way we do so with signals?\n const tNode = {\n type,\n index,\n insertBeforeIndex: null,\n injectorIndex,\n directiveStart: -1,\n directiveEnd: -1,\n directiveStylingLast: -1,\n componentOffset: -1,\n propertyBindings: null,\n flags,\n providerIndexes: 0,\n value: value,\n attrs: attrs,\n mergedAttrs: null,\n localNames: null,\n initialInputs: null,\n inputs: null,\n hostDirectiveInputs: null,\n outputs: null,\n hostDirectiveOutputs: null,\n directiveToIndex: null,\n tView: null,\n next: null,\n prev: null,\n projectionNext: null,\n child: null,\n parent: tParent,\n projection: null,\n styles: null,\n stylesWithoutHost: null,\n residualStyles: undefined,\n classes: null,\n classesWithoutHost: null,\n residualClasses: undefined,\n classBindings: 0,\n styleBindings: 0\n };\n if (ngDevMode) {\n // For performance reasons it is important that the tNode retains the same shape during runtime.\n // (To make sure that all of the code is monomorphic.) For this reason we seal the object to\n // prevent class transitions.\n Object.seal(tNode);\n }\n return tNode;\n}\n\n/**\n * Add `tNode` to `previousTNodes` list and update relevant `TNode`s in `previousTNodes` list\n * `tNode.insertBeforeIndex`.\n *\n * Things to keep in mind:\n * 1. All i18n text nodes are encoded as `TNodeType.Element` and are created eagerly by the\n * `ɵɵi18nStart` instruction.\n * 2. All `TNodeType.Placeholder` `TNodes` are elements which will be created later by\n * `ɵɵelementStart` instruction.\n * 3. `ɵɵelementStart` instruction will create `TNode`s in the ascending `TNode.index` order. (So a\n * smaller index `TNode` is guaranteed to be created before a larger one)\n *\n * We use the above three invariants to determine `TNode.insertBeforeIndex`.\n *\n * In an ideal world `TNode.insertBeforeIndex` would always be `TNode.next.index`. However,\n * this will not work because `TNode.next.index` may be larger than `TNode.index` which means that\n * the next node is not yet created and therefore we can't insert in front of it.\n *\n * Rule1: `TNode.insertBeforeIndex = null` if `TNode.next === null` (Initial condition, as we don't\n * know if there will be further `TNode`s inserted after.)\n * Rule2: If `previousTNode` is created after the `tNode` being inserted, then\n * `previousTNode.insertBeforeNode = tNode.index` (So when a new `tNode` is added we check\n * previous to see if we can update its `insertBeforeTNode`)\n *\n * See `TNode.insertBeforeIndex` for more context.\n *\n * @param previousTNodes A list of previous TNodes so that we can easily traverse `TNode`s in\n * reverse order. (If `TNode` would have `previous` this would not be necessary.)\n * @param newTNode A TNode to add to the `previousTNodes` list.\n */\nfunction addTNodeAndUpdateInsertBeforeIndex(previousTNodes, newTNode) {\n // Start with Rule1\n ngDevMode && assertEqual(newTNode.insertBeforeIndex, null, 'We expect that insertBeforeIndex is not set');\n previousTNodes.push(newTNode);\n if (previousTNodes.length > 1) {\n for (let i = previousTNodes.length - 2; i >= 0; i--) {\n const existingTNode = previousTNodes[i];\n // Text nodes are created eagerly and so they don't need their `indexBeforeIndex` updated.\n // It is safe to ignore them.\n if (!isI18nText(existingTNode)) {\n if (isNewTNodeCreatedBefore(existingTNode, newTNode) && getInsertBeforeIndex(existingTNode) === null) {\n // If it was created before us in time, (and it does not yet have `insertBeforeIndex`)\n // then add the `insertBeforeIndex`.\n setInsertBeforeIndex(existingTNode, newTNode.index);\n }\n }\n }\n }\n}\nfunction isI18nText(tNode) {\n return !(tNode.type & 64 /* TNodeType.Placeholder */);\n}\nfunction isNewTNodeCreatedBefore(existingTNode, newTNode) {\n return isI18nText(newTNode) || existingTNode.index > newTNode.index;\n}\nfunction getInsertBeforeIndex(tNode) {\n const index = tNode.insertBeforeIndex;\n return Array.isArray(index) ? index[0] : index;\n}\nfunction setInsertBeforeIndex(tNode, value) {\n const index = tNode.insertBeforeIndex;\n if (Array.isArray(index)) {\n // Array is stored if we have to insert child nodes. See `TNode.insertBeforeIndex`\n index[0] = value;\n } else {\n setI18nHandling(getInsertInFrontOfRNodeWithI18n, processI18nInsertBefore);\n tNode.insertBeforeIndex = value;\n }\n}\n\n/**\n * Retrieve `TIcu` at a given `index`.\n *\n * The `TIcu` can be stored either directly (if it is nested ICU) OR\n * it is stored inside tho `TIcuContainer` if it is top level ICU.\n *\n * The reason for this is that the top level ICU need a `TNode` so that they are part of the render\n * tree, but nested ICU's have no TNode, because we don't know ahead of time if the nested ICU is\n * expressed (parent ICU may have selected a case which does not contain it.)\n *\n * @param tView Current `TView`.\n * @param index Index where the value should be read from.\n */\nfunction getTIcu(tView, index) {\n const value = tView.data[index];\n if (value === null || typeof value === 'string') return null;\n if (ngDevMode && !(value.hasOwnProperty('tView') || value.hasOwnProperty('currentCaseLViewIndex'))) {\n throwError(\"We expect to get 'null'|'TIcu'|'TIcuContainer', but got: \" + value);\n }\n // Here the `value.hasOwnProperty('currentCaseLViewIndex')` is a polymorphic read as it can be\n // either TIcu or TIcuContainerNode. This is not ideal, but we still think it is OK because it\n // will be just two cases which fits into the browser inline cache (inline cache can take up to\n // 4)\n const tIcu = value.hasOwnProperty('currentCaseLViewIndex') ? value : value.value;\n ngDevMode && assertTIcu(tIcu);\n return tIcu;\n}\n/**\n * Store `TIcu` at a give `index`.\n *\n * The `TIcu` can be stored either directly (if it is nested ICU) OR\n * it is stored inside tho `TIcuContainer` if it is top level ICU.\n *\n * The reason for this is that the top level ICU need a `TNode` so that they are part of the render\n * tree, but nested ICU's have no TNode, because we don't know ahead of time if the nested ICU is\n * expressed (parent ICU may have selected a case which does not contain it.)\n *\n * @param tView Current `TView`.\n * @param index Index where the value should be stored at in `Tview.data`\n * @param tIcu The TIcu to store.\n */\nfunction setTIcu(tView, index, tIcu) {\n const tNode = tView.data[index];\n ngDevMode && assertEqual(tNode === null || tNode.hasOwnProperty('tView'), true, \"We expect to get 'null'|'TIcuContainer'\");\n if (tNode === null) {\n tView.data[index] = tIcu;\n } else {\n ngDevMode && assertTNodeType(tNode, 32 /* TNodeType.Icu */);\n tNode.value = tIcu;\n }\n}\n/**\n * Set `TNode.insertBeforeIndex` taking the `Array` into account.\n *\n * See `TNode.insertBeforeIndex`\n */\nfunction setTNodeInsertBeforeIndex(tNode, index) {\n ngDevMode && assertTNode(tNode);\n let insertBeforeIndex = tNode.insertBeforeIndex;\n if (insertBeforeIndex === null) {\n setI18nHandling(getInsertInFrontOfRNodeWithI18n, processI18nInsertBefore);\n insertBeforeIndex = tNode.insertBeforeIndex = [null /* may be updated to number later */, index];\n } else {\n assertEqual(Array.isArray(insertBeforeIndex), true, 'Expecting array here');\n insertBeforeIndex.push(index);\n }\n}\n/**\n * Create `TNode.type=TNodeType.Placeholder` node.\n *\n * See `TNodeType.Placeholder` for more information.\n */\nfunction createTNodePlaceholder(tView, previousTNodes, index) {\n const tNode = createTNodeAtIndex(tView, index, 64 /* TNodeType.Placeholder */, null, null);\n addTNodeAndUpdateInsertBeforeIndex(previousTNodes, tNode);\n return tNode;\n}\n/**\n * Returns current ICU case.\n *\n * ICU cases are stored as index into the `TIcu.cases`.\n * At times it is necessary to communicate that the ICU case just switched and that next ICU update\n * should update all bindings regardless of the mask. In such a case the we store negative numbers\n * for cases which have just been switched. This function removes the negative flag.\n */\nfunction getCurrentICUCaseIndex(tIcu, lView) {\n const currentCase = lView[tIcu.currentCaseLViewIndex];\n return currentCase === null ? currentCase : currentCase < 0 ? ~currentCase : currentCase;\n}\nfunction getParentFromIcuCreateOpCode(mergedCode) {\n return mergedCode >>> 17 /* IcuCreateOpCode.SHIFT_PARENT */;\n}\nfunction getRefFromIcuCreateOpCode(mergedCode) {\n return (mergedCode & 131070 /* IcuCreateOpCode.MASK_REF */) >>> 1 /* IcuCreateOpCode.SHIFT_REF */;\n}\nfunction getInstructionFromIcuCreateOpCode(mergedCode) {\n return mergedCode & 1 /* IcuCreateOpCode.MASK_INSTRUCTION */;\n}\nfunction icuCreateOpCode(opCode, parentIdx, refIdx) {\n ngDevMode && assertGreaterThanOrEqual(parentIdx, 0, 'Missing parent index');\n ngDevMode && assertGreaterThan(refIdx, 0, 'Missing ref index');\n return opCode | parentIdx << 17 /* IcuCreateOpCode.SHIFT_PARENT */ | refIdx << 1 /* IcuCreateOpCode.SHIFT_REF */;\n}\n// Returns whether the given value corresponds to a root template message,\n// or a sub-template.\nfunction isRootTemplateMessage(subTemplateIndex) {\n return subTemplateIndex === -1;\n}\nfunction enterIcu(state, tIcu, lView) {\n state.index = 0;\n const currentCase = getCurrentICUCaseIndex(tIcu, lView);\n if (currentCase !== null) {\n ngDevMode && assertNumberInRange(currentCase, 0, tIcu.cases.length - 1);\n state.removes = tIcu.remove[currentCase];\n } else {\n state.removes = EMPTY_ARRAY;\n }\n}\nfunction icuContainerIteratorNext(state) {\n if (state.index < state.removes.length) {\n const removeOpCode = state.removes[state.index++];\n ngDevMode && assertNumber(removeOpCode, 'Expecting OpCode number');\n if (removeOpCode > 0) {\n const rNode = state.lView[removeOpCode];\n ngDevMode && assertDomNode(rNode);\n return rNode;\n } else {\n state.stack.push(state.index, state.removes);\n // ICUs are represented by negative indices\n const tIcuIndex = ~removeOpCode;\n const tIcu = state.lView[TVIEW].data[tIcuIndex];\n ngDevMode && assertTIcu(tIcu);\n enterIcu(state, tIcu, state.lView);\n return icuContainerIteratorNext(state);\n }\n } else {\n if (state.stack.length === 0) {\n return null;\n } else {\n state.removes = state.stack.pop();\n state.index = state.stack.pop();\n return icuContainerIteratorNext(state);\n }\n }\n}\nfunction loadIcuContainerVisitor() {\n const _state = {\n stack: [],\n index: -1\n };\n /**\n * Retrieves a set of root nodes from `TIcu.remove`. Used by `TNodeType.ICUContainer`\n * to determine which root belong to the ICU.\n *\n * Example of usage.\n * ```ts\n * const nextRNode = icuContainerIteratorStart(tIcuContainerNode, lView);\n * let rNode: RNode|null;\n * while(rNode = nextRNode()) {\n * console.log(rNode);\n * }\n * ```\n *\n * @param tIcuContainerNode Current `TIcuContainerNode`\n * @param lView `LView` where the `RNode`s should be looked up.\n */\n function icuContainerIteratorStart(tIcuContainerNode, lView) {\n _state.lView = lView;\n while (_state.stack.length) _state.stack.pop();\n ngDevMode && assertTNodeForLView(tIcuContainerNode, lView);\n enterIcu(_state, tIcuContainerNode.value, lView);\n return icuContainerIteratorNext.bind(null, _state);\n }\n return icuContainerIteratorStart;\n}\nfunction createIcuIterator(tIcu, lView) {\n const state = {\n stack: [],\n index: -1,\n lView\n };\n ngDevMode && assertTIcu(tIcu);\n enterIcu(state, tIcu, lView);\n return icuContainerIteratorNext.bind(null, state);\n}\n\n/**\n * Regexp that extracts a reference node information from the compressed node location.\n * The reference node is represented as either:\n * - a number which points to an LView slot\n * - the `b` char which indicates that the lookup should start from the `document.body`\n * - the `h` char to start lookup from the component host node (`lView[HOST]`)\n */\nconst REF_EXTRACTOR_REGEXP = /* @__PURE__ */new RegExp(`^(\\\\d+)*(${REFERENCE_NODE_BODY}|${REFERENCE_NODE_HOST})*(.*)`);\n/**\n * Helper function that takes a reference node location and a set of navigation steps\n * (from the reference node) to a target node and outputs a string that represents\n * a location.\n *\n * For example, given: referenceNode = 'b' (body) and path = ['firstChild', 'firstChild',\n * 'nextSibling'], the function returns: `bf2n`.\n */\nfunction compressNodeLocation(referenceNode, path) {\n const result = [referenceNode];\n for (const segment of path) {\n const lastIdx = result.length - 1;\n if (lastIdx > 0 && result[lastIdx - 1] === segment) {\n // An empty string in a count slot represents 1 occurrence of an instruction.\n const value = result[lastIdx] || 1;\n result[lastIdx] = value + 1;\n } else {\n // Adding a new segment to the path.\n // Using an empty string in a counter field to avoid encoding `1`s\n // into the path, since they are implicit (e.g. `f1n1` vs `fn`), so\n // it's enough to have a single char in this case.\n result.push(segment, '');\n }\n }\n return result.join('');\n}\n/**\n * Helper function that reverts the `compressNodeLocation` and transforms a given\n * string into an array where at 0th position there is a reference node info and\n * after that it contains information (in pairs) about a navigation step and the\n * number of repetitions.\n *\n * For example, the path like 'bf2n' will be transformed to:\n * ['b', 'firstChild', 2, 'nextSibling', 1].\n *\n * This information is later consumed by the code that navigates the DOM to find\n * a given node by its location.\n */\nfunction decompressNodeLocation(path) {\n const matches = path.match(REF_EXTRACTOR_REGEXP);\n const [_, refNodeId, refNodeName, rest] = matches;\n // If a reference node is represented by an index, transform it to a number.\n const ref = refNodeId ? parseInt(refNodeId, 10) : refNodeName;\n const steps = [];\n // Match all segments in a path.\n for (const [_, step, count] of rest.matchAll(/(f|n)(\\d*)/g)) {\n const repeat = parseInt(count, 10) || 1;\n steps.push(step, repeat);\n }\n return [ref, ...steps];\n}\n\n/** Whether current TNode is a first node in an <ng-container>. */\nfunction isFirstElementInNgContainer(tNode) {\n return !tNode.prev && tNode.parent?.type === 8 /* TNodeType.ElementContainer */;\n}\n/** Returns an instruction index (subtracting HEADER_OFFSET). */\nfunction getNoOffsetIndex(tNode) {\n return tNode.index - HEADER_OFFSET;\n}\n/**\n * Check whether a given node exists, but is disconnected from the DOM.\n */\nfunction isDisconnectedNode(tNode, lView) {\n return !(tNode.type & (16 /* TNodeType.Projection */ | 128 /* TNodeType.LetDeclaration */)) && !!lView[tNode.index] && isDisconnectedRNode(unwrapRNode(lView[tNode.index]));\n}\n/**\n * Check whether the given node exists, but is disconnected from the DOM.\n *\n * Note: we leverage the fact that we have this information available in the DOM emulation\n * layer (in Domino) for now. Longer-term solution should not rely on the DOM emulation and\n * only use internal data structures and state to compute this information.\n */\nfunction isDisconnectedRNode(rNode) {\n return !!rNode && !rNode.isConnected;\n}\n/**\n * Locate a node in an i18n tree that corresponds to a given instruction index.\n *\n * @param hydrationInfo The hydration annotation data\n * @param noOffsetIndex the instruction index\n * @returns an RNode that corresponds to the instruction index\n */\nfunction locateI18nRNodeByIndex(hydrationInfo, noOffsetIndex) {\n const i18nNodes = hydrationInfo.i18nNodes;\n if (i18nNodes) {\n return i18nNodes.get(noOffsetIndex);\n }\n return undefined;\n}\n/**\n * Attempt to locate an RNode by a path, if it exists.\n *\n * @param hydrationInfo The hydration annotation data\n * @param lView the current lView\n * @param noOffsetIndex the instruction index\n * @returns an RNode that corresponds to the instruction index or null if no path exists\n */\nfunction tryLocateRNodeByPath(hydrationInfo, lView, noOffsetIndex) {\n const nodes = hydrationInfo.data[NODES];\n const path = nodes?.[noOffsetIndex];\n return path ? locateRNodeByPath(path, lView) : null;\n}\n/**\n * Locate a node in DOM tree that corresponds to a given TNode.\n *\n * @param hydrationInfo The hydration annotation data\n * @param tView the current tView\n * @param lView the current lView\n * @param tNode the current tNode\n * @returns an RNode that represents a given tNode\n */\nfunction locateNextRNode(hydrationInfo, tView, lView, tNode) {\n const noOffsetIndex = getNoOffsetIndex(tNode);\n let native = locateI18nRNodeByIndex(hydrationInfo, noOffsetIndex);\n if (native === undefined) {\n const nodes = hydrationInfo.data[NODES];\n if (nodes?.[noOffsetIndex]) {\n // We know the exact location of the node.\n native = locateRNodeByPath(nodes[noOffsetIndex], lView);\n } else if (tView.firstChild === tNode) {\n // We create a first node in this view, so we use a reference\n // to the first child in this DOM segment.\n native = hydrationInfo.firstChild;\n } else {\n // Locate a node based on a previous sibling or a parent node.\n const previousTNodeParent = tNode.prev === null;\n const previousTNode = tNode.prev ?? tNode.parent;\n ngDevMode && assertDefined(previousTNode, 'Unexpected state: current TNode does not have a connection ' + 'to the previous node or a parent node.');\n if (isFirstElementInNgContainer(tNode)) {\n const noOffsetParentIndex = getNoOffsetIndex(tNode.parent);\n native = getSegmentHead(hydrationInfo, noOffsetParentIndex);\n } else {\n let previousRElement = getNativeByTNode(previousTNode, lView);\n if (previousTNodeParent) {\n native = previousRElement.firstChild;\n } else {\n // If the previous node is an element, but it also has container info,\n // this means that we are processing a node like `<div #vcrTarget>`, which is\n // represented in the DOM as `<div></div>...<!--container-->`.\n // In this case, there are nodes *after* this element and we need to skip\n // all of them to reach an element that we are looking for.\n const noOffsetPrevSiblingIndex = getNoOffsetIndex(previousTNode);\n const segmentHead = getSegmentHead(hydrationInfo, noOffsetPrevSiblingIndex);\n if (previousTNode.type === 2 /* TNodeType.Element */ && segmentHead) {\n const numRootNodesToSkip = calcSerializedContainerSize(hydrationInfo, noOffsetPrevSiblingIndex);\n // `+1` stands for an anchor comment node after all the views in this container.\n const nodesToSkip = numRootNodesToSkip + 1;\n // First node after this segment.\n native = siblingAfter(nodesToSkip, segmentHead);\n } else {\n native = previousRElement.nextSibling;\n }\n }\n }\n }\n }\n return native;\n}\n/**\n * Skips over a specified number of nodes and returns the next sibling node after that.\n */\nfunction siblingAfter(skip, from) {\n let currentNode = from;\n for (let i = 0; i < skip; i++) {\n ngDevMode && validateSiblingNodeExists(currentNode);\n currentNode = currentNode.nextSibling;\n }\n return currentNode;\n}\n/**\n * Helper function to produce a string representation of the navigation steps\n * (in terms of `nextSibling` and `firstChild` navigations). Used in error\n * messages in dev mode.\n */\nfunction stringifyNavigationInstructions(instructions) {\n const container = [];\n for (let i = 0; i < instructions.length; i += 2) {\n const step = instructions[i];\n const repeat = instructions[i + 1];\n for (let r = 0; r < repeat; r++) {\n container.push(step === NODE_NAVIGATION_STEP_FIRST_CHILD ? 'firstChild' : 'nextSibling');\n }\n }\n return container.join('.');\n}\n/**\n * Helper function that navigates from a starting point node (the `from` node)\n * using provided set of navigation instructions (within `path` argument).\n */\nfunction navigateToNode(from, instructions) {\n let node = from;\n for (let i = 0; i < instructions.length; i += 2) {\n const step = instructions[i];\n const repeat = instructions[i + 1];\n for (let r = 0; r < repeat; r++) {\n if (ngDevMode && !node) {\n throw nodeNotFoundAtPathError(from, stringifyNavigationInstructions(instructions));\n }\n switch (step) {\n case NODE_NAVIGATION_STEP_FIRST_CHILD:\n node = node.firstChild;\n break;\n case NODE_NAVIGATION_STEP_NEXT_SIBLING:\n node = node.nextSibling;\n break;\n }\n }\n }\n if (ngDevMode && !node) {\n throw nodeNotFoundAtPathError(from, stringifyNavigationInstructions(instructions));\n }\n return node;\n}\n/**\n * Locates an RNode given a set of navigation instructions (which also contains\n * a starting point node info).\n */\nfunction locateRNodeByPath(path, lView) {\n const [referenceNode, ...navigationInstructions] = decompressNodeLocation(path);\n let ref;\n if (referenceNode === REFERENCE_NODE_HOST) {\n ref = lView[DECLARATION_COMPONENT_VIEW][HOST];\n } else if (referenceNode === REFERENCE_NODE_BODY) {\n ref = ɵɵresolveBody(lView[DECLARATION_COMPONENT_VIEW][HOST]);\n } else {\n const parentElementId = Number(referenceNode);\n ref = unwrapRNode(lView[parentElementId + HEADER_OFFSET]);\n }\n return navigateToNode(ref, navigationInstructions);\n}\n/**\n * Generate a list of DOM navigation operations to get from node `start` to node `finish`.\n *\n * Note: assumes that node `start` occurs before node `finish` in an in-order traversal of the DOM\n * tree. That is, we should be able to get from `start` to `finish` purely by using `.firstChild`\n * and `.nextSibling` operations.\n */\nfunction navigateBetween(start, finish) {\n if (start === finish) {\n return [];\n } else if (start.parentElement == null || finish.parentElement == null) {\n return null;\n } else if (start.parentElement === finish.parentElement) {\n return navigateBetweenSiblings(start, finish);\n } else {\n // `finish` is a child of its parent, so the parent will always have a child.\n const parent = finish.parentElement;\n const parentPath = navigateBetween(start, parent);\n const childPath = navigateBetween(parent.firstChild, finish);\n if (!parentPath || !childPath) return null;\n return [\n // First navigate to `finish`'s parent\n ...parentPath,\n // Then to its first child.\n NODE_NAVIGATION_STEP_FIRST_CHILD,\n // And finally from that node to `finish` (maybe a no-op if we're already there).\n ...childPath];\n }\n}\n/**\n * Calculates a path between 2 sibling nodes (generates a number of `NextSibling` navigations).\n * Returns `null` if no such path exists between the given nodes.\n */\nfunction navigateBetweenSiblings(start, finish) {\n const nav = [];\n let node = null;\n for (node = start; node != null && node !== finish; node = node.nextSibling) {\n nav.push(NODE_NAVIGATION_STEP_NEXT_SIBLING);\n }\n // If the `node` becomes `null` or `undefined` at the end, that means that we\n // didn't find the `end` node, thus return `null` (which would trigger serialization\n // error to be produced).\n return node == null ? null : nav;\n}\n/**\n * Calculates a path between 2 nodes in terms of `nextSibling` and `firstChild`\n * navigations:\n * - the `from` node is a known node, used as an starting point for the lookup\n * (the `fromNodeName` argument is a string representation of the node).\n * - the `to` node is a node that the runtime logic would be looking up,\n * using the path generated by this function.\n */\nfunction calcPathBetween(from, to, fromNodeName) {\n const path = navigateBetween(from, to);\n return path === null ? null : compressNodeLocation(fromNodeName, path);\n}\n/**\n * Invoked at serialization time (on the server) when a set of navigation\n * instructions needs to be generated for a TNode.\n */\nfunction calcPathForNode(tNode, lView, excludedParentNodes) {\n let parentTNode = tNode.parent;\n let parentIndex;\n let parentRNode;\n let referenceNodeName;\n // Skip over all parent nodes that are disconnected from the DOM, such nodes\n // can not be used as anchors.\n //\n // This might happen in certain content projection-based use-cases, where\n // a content of an element is projected and used, when a parent element\n // itself remains detached from DOM. In this scenario we try to find a parent\n // element that is attached to DOM and can act as an anchor instead.\n //\n // It can also happen that the parent node should be excluded, for example,\n // because it belongs to an i18n block, which requires paths which aren't\n // relative to other views in an i18n block.\n while (parentTNode !== null && (isDisconnectedNode(parentTNode, lView) || excludedParentNodes?.has(parentTNode.index))) {\n parentTNode = parentTNode.parent;\n }\n if (parentTNode === null || !(parentTNode.type & 3 /* TNodeType.AnyRNode */)) {\n // If there is no parent TNode or a parent TNode does not represent an RNode\n // (i.e. not a DOM node), use component host element as a reference node.\n parentIndex = referenceNodeName = REFERENCE_NODE_HOST;\n parentRNode = lView[DECLARATION_COMPONENT_VIEW][HOST];\n } else {\n // Use parent TNode as a reference node.\n parentIndex = parentTNode.index;\n parentRNode = unwrapRNode(lView[parentIndex]);\n referenceNodeName = renderStringify(parentIndex - HEADER_OFFSET);\n }\n let rNode = unwrapRNode(lView[tNode.index]);\n if (tNode.type & (12 /* TNodeType.AnyContainer */ | 32 /* TNodeType.Icu */)) {\n // For <ng-container> nodes, instead of serializing a reference\n // to the anchor comment node, serialize a location of the first\n // DOM element. Paired with the container size (serialized as a part\n // of `ngh.containers`), it should give enough information for runtime\n // to hydrate nodes in this container.\n const firstRNode = getFirstNativeNode(lView, tNode);\n // If container is not empty, use a reference to the first element,\n // otherwise, rNode would point to an anchor comment node.\n if (firstRNode) {\n rNode = firstRNode;\n }\n }\n let path = calcPathBetween(parentRNode, rNode, referenceNodeName);\n if (path === null && parentRNode !== rNode) {\n // Searching for a path between elements within a host node failed.\n // Trying to find a path to an element starting from the `document.body` instead.\n //\n // Important note: this type of reference is relatively unstable, since Angular\n // may not be able to control parts of the page that the runtime logic navigates\n // through. This is mostly needed to cover \"portals\" use-case (like menus, dialog boxes,\n // etc), where nodes are content-projected (including direct DOM manipulations) outside\n // of the host node. The better solution is to provide APIs to work with \"portals\",\n // at which point this code path would not be needed.\n const body = parentRNode.ownerDocument.body;\n path = calcPathBetween(body, rNode, REFERENCE_NODE_BODY);\n if (path === null) {\n // If the path is still empty, it's likely that this node is detached and\n // won't be found during hydration.\n throw nodeNotFoundError(lView, tNode);\n }\n }\n return path;\n}\n/**\n * Retrieves all comments nodes that contain ngh comments referring to a defer block\n */\nfunction gatherDeferBlocksCommentNodes(doc, node) {\n const commentNodesIterator = doc.createNodeIterator(node, NodeFilter.SHOW_COMMENT, {\n acceptNode\n });\n let currentNode;\n const nodesByBlockId = new Map();\n while (currentNode = commentNodesIterator.nextNode()) {\n const nghPattern = 'ngh=';\n const content = currentNode?.textContent;\n const nghIdx = content?.indexOf(nghPattern) ?? -1;\n if (nghIdx > -1) {\n const nghValue = content.substring(nghIdx + nghPattern.length).trim();\n // Make sure the value has an expected format.\n ngDevMode && assertEqual(nghValue.startsWith('d'), true, 'Invalid defer block id found in a comment node.');\n nodesByBlockId.set(nghValue, currentNode);\n }\n }\n return nodesByBlockId;\n}\nfunction acceptNode(node) {\n return node.textContent?.trimStart().startsWith('ngh=') ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_REJECT;\n}\nlet _isI18nHydrationSupportEnabled = false;\nlet _prepareI18nBlockForHydrationImpl = () => {\n // noop unless `enablePrepareI18nBlockForHydrationImpl` is invoked.\n};\nfunction setIsI18nHydrationSupportEnabled(enabled) {\n _isI18nHydrationSupportEnabled = enabled;\n}\nfunction isI18nHydrationSupportEnabled() {\n return _isI18nHydrationSupportEnabled;\n}\n/**\n * Prepares an i18n block and its children, located at the given\n * view and instruction index, for hydration.\n *\n * @param lView lView with the i18n block\n * @param index index of the i18n block in the lView\n * @param parentTNode TNode of the parent of the i18n block\n * @param subTemplateIndex sub-template index, or -1 for the main template\n */\nfunction prepareI18nBlockForHydration(lView, index, parentTNode, subTemplateIndex) {\n _prepareI18nBlockForHydrationImpl(lView, index, parentTNode, subTemplateIndex);\n}\nfunction enablePrepareI18nBlockForHydrationImpl() {\n _prepareI18nBlockForHydrationImpl = prepareI18nBlockForHydrationImpl;\n}\nfunction isI18nHydrationEnabled(injector) {\n injector = injector ?? inject(Injector);\n return injector.get(IS_I18N_HYDRATION_ENABLED, false);\n}\n/**\n * Collects, if not already cached, all of the indices in the\n * given TView which are children of an i18n block.\n *\n * Since i18n blocks don't introduce a parent TNode, this is necessary\n * in order to determine which indices in a LView are translated.\n */\nfunction getOrComputeI18nChildren(tView, context) {\n let i18nChildren = context.i18nChildren.get(tView);\n if (i18nChildren === undefined) {\n i18nChildren = collectI18nChildren(tView);\n context.i18nChildren.set(tView, i18nChildren);\n }\n return i18nChildren;\n}\nfunction collectI18nChildren(tView) {\n const children = new Set();\n function collectI18nViews(node) {\n children.add(node.index);\n switch (node.kind) {\n case 1 /* I18nNodeKind.ELEMENT */:\n case 2 /* I18nNodeKind.PLACEHOLDER */:\n {\n for (const childNode of node.children) {\n collectI18nViews(childNode);\n }\n break;\n }\n case 3 /* I18nNodeKind.ICU */:\n {\n for (const caseNodes of node.cases) {\n for (const caseNode of caseNodes) {\n collectI18nViews(caseNode);\n }\n }\n break;\n }\n }\n }\n // Traverse through the AST of each i18n block in the LView,\n // and collect every instruction index.\n for (let i = HEADER_OFFSET; i < tView.bindingStartIndex; i++) {\n const tI18n = tView.data[i];\n if (!tI18n || !tI18n.ast) {\n continue;\n }\n for (const node of tI18n.ast) {\n collectI18nViews(node);\n }\n }\n return children.size === 0 ? null : children;\n}\n/**\n * Attempts to serialize i18n data for an i18n block, located at\n * the given view and instruction index.\n *\n * @param lView lView with the i18n block\n * @param index index of the i18n block in the lView\n * @param context the hydration context\n * @returns the i18n data, or null if there is no relevant data\n */\nfunction trySerializeI18nBlock(lView, index, context) {\n if (!context.isI18nHydrationEnabled) {\n return null;\n }\n const tView = lView[TVIEW];\n const tI18n = tView.data[index];\n if (!tI18n || !tI18n.ast) {\n return null;\n }\n const parentTNode = tView.data[tI18n.parentTNodeIndex];\n if (parentTNode && isI18nInSkipHydrationBlock(parentTNode)) {\n return null;\n }\n const serializedI18nBlock = {\n caseQueue: [],\n disconnectedNodes: new Set(),\n disjointNodes: new Set()\n };\n serializeI18nBlock(lView, serializedI18nBlock, context, tI18n.ast);\n return serializedI18nBlock.caseQueue.length === 0 && serializedI18nBlock.disconnectedNodes.size === 0 && serializedI18nBlock.disjointNodes.size === 0 ? null : serializedI18nBlock;\n}\nfunction serializeI18nBlock(lView, serializedI18nBlock, context, nodes) {\n let prevRNode = null;\n for (const node of nodes) {\n const nextRNode = serializeI18nNode(lView, serializedI18nBlock, context, node);\n if (nextRNode) {\n if (isDisjointNode(prevRNode, nextRNode)) {\n serializedI18nBlock.disjointNodes.add(node.index - HEADER_OFFSET);\n }\n prevRNode = nextRNode;\n }\n }\n return prevRNode;\n}\n/**\n * Helper to determine whether the given nodes are \"disjoint\".\n *\n * The i18n hydration process walks through the DOM and i18n nodes\n * at the same time. It expects the sibling DOM node of the previous\n * i18n node to be the first node of the next i18n node.\n *\n * In cases of content projection, this won't always be the case. So\n * when we detect that, we mark the node as \"disjoint\", ensuring that\n * we will serialize the path to the node. This way, when we hydrate the\n * i18n node, we will be able to find the correct place to start.\n */\nfunction isDisjointNode(prevNode, nextNode) {\n return prevNode && prevNode.nextSibling !== nextNode;\n}\n/**\n * Process the given i18n node for serialization.\n * Returns the first RNode for the i18n node to begin hydration.\n */\nfunction serializeI18nNode(lView, serializedI18nBlock, context, node) {\n const maybeRNode = unwrapRNode(lView[node.index]);\n if (!maybeRNode || isDisconnectedRNode(maybeRNode)) {\n serializedI18nBlock.disconnectedNodes.add(node.index - HEADER_OFFSET);\n return null;\n }\n const rNode = maybeRNode;\n switch (node.kind) {\n case 0 /* I18nNodeKind.TEXT */:\n {\n processTextNodeBeforeSerialization(context, rNode);\n break;\n }\n case 1 /* I18nNodeKind.ELEMENT */:\n case 2 /* I18nNodeKind.PLACEHOLDER */:\n {\n serializeI18nBlock(lView, serializedI18nBlock, context, node.children);\n break;\n }\n case 3 /* I18nNodeKind.ICU */:\n {\n const currentCase = lView[node.currentCaseLViewIndex];\n if (currentCase != null) {\n // i18n uses a negative value to signal a change to a new case, so we\n // need to invert it to get the proper value.\n const caseIdx = currentCase < 0 ? ~currentCase : currentCase;\n serializedI18nBlock.caseQueue.push(caseIdx);\n serializeI18nBlock(lView, serializedI18nBlock, context, node.cases[caseIdx]);\n }\n break;\n }\n }\n return getFirstNativeNodeForI18nNode(lView, node);\n}\n/**\n * Helper function to get the first native node to begin hydrating\n * the given i18n node.\n */\nfunction getFirstNativeNodeForI18nNode(lView, node) {\n const tView = lView[TVIEW];\n const maybeTNode = tView.data[node.index];\n if (isTNodeShape(maybeTNode)) {\n // If the node is backed by an actual TNode, we can simply delegate.\n return getFirstNativeNode(lView, maybeTNode);\n } else if (node.kind === 3 /* I18nNodeKind.ICU */) {\n // A nested ICU container won't have an actual TNode. In that case, we can use\n // an iterator to find the first child.\n const icuIterator = createIcuIterator(maybeTNode, lView);\n let rNode = icuIterator();\n // If the ICU container has no nodes, then we use the ICU anchor as the node.\n return rNode ?? unwrapRNode(lView[node.index]);\n } else {\n // Otherwise, the node is a text or trivial element in an ICU container,\n // and we can just use the RNode directly.\n return unwrapRNode(lView[node.index]) ?? null;\n }\n}\nfunction setCurrentNode(state, node) {\n state.currentNode = node;\n}\n/**\n * Marks the current RNode as the hydration root for the given\n * AST node.\n */\nfunction appendI18nNodeToCollection(context, state, astNode) {\n const noOffsetIndex = astNode.index - HEADER_OFFSET;\n const {\n disconnectedNodes\n } = context;\n const currentNode = state.currentNode;\n if (state.isConnected) {\n context.i18nNodes.set(noOffsetIndex, currentNode);\n // We expect the node to be connected, so ensure that it\n // is not in the set, regardless of whether we found it,\n // so that the downstream error handling can provide the\n // proper context.\n disconnectedNodes.delete(noOffsetIndex);\n } else {\n disconnectedNodes.add(noOffsetIndex);\n }\n return currentNode;\n}\n/**\n * Skip over some sibling nodes during hydration.\n *\n * Note: we use this instead of `siblingAfter` as it's expected that\n * sometimes we might encounter null nodes. In those cases, we want to\n * defer to downstream error handling to provide proper context.\n */\nfunction skipSiblingNodes(state, skip) {\n let currentNode = state.currentNode;\n for (let i = 0; i < skip; i++) {\n if (!currentNode) {\n break;\n }\n currentNode = currentNode?.nextSibling ?? null;\n }\n return currentNode;\n}\n/**\n * Fork the given state into a new state for hydrating children.\n */\nfunction forkHydrationState(state, nextNode) {\n return {\n currentNode: nextNode,\n isConnected: state.isConnected\n };\n}\nfunction prepareI18nBlockForHydrationImpl(lView, index, parentTNode, subTemplateIndex) {\n const hydrationInfo = lView[HYDRATION];\n if (!hydrationInfo) {\n return;\n }\n if (!isI18nHydrationSupportEnabled() || parentTNode && (isI18nInSkipHydrationBlock(parentTNode) || isDisconnectedNode$1(hydrationInfo, parentTNode.index - HEADER_OFFSET))) {\n return;\n }\n const tView = lView[TVIEW];\n const tI18n = tView.data[index];\n ngDevMode && assertDefined(tI18n, 'Expected i18n data to be present in a given TView slot during hydration');\n function findHydrationRoot() {\n if (isRootTemplateMessage(subTemplateIndex)) {\n // This is the root of an i18n block. In this case, our hydration root will\n // depend on where our parent TNode (i.e. the block with i18n applied) is\n // in the DOM.\n ngDevMode && assertDefined(parentTNode, 'Expected parent TNode while hydrating i18n root');\n const rootNode = locateNextRNode(hydrationInfo, tView, lView, parentTNode);\n // If this i18n block is attached to an <ng-container>, then we want to begin\n // hydrating directly with the RNode. Otherwise, for a TNode with a physical DOM\n // element, we want to recurse into the first child and begin there.\n return parentTNode.type & 8 /* TNodeType.ElementContainer */ ? rootNode : rootNode.firstChild;\n }\n // This is a nested template in an i18n block. In this case, the entire view\n // is translated, and part of a dehydrated view in a container. This means that\n // we can simply begin hydration with the first dehydrated child.\n return hydrationInfo?.firstChild;\n }\n const currentNode = findHydrationRoot();\n ngDevMode && assertDefined(currentNode, 'Expected root i18n node during hydration');\n const disconnectedNodes = initDisconnectedNodes(hydrationInfo) ?? new Set();\n const i18nNodes = hydrationInfo.i18nNodes ??= new Map();\n const caseQueue = hydrationInfo.data[I18N_DATA]?.[index - HEADER_OFFSET] ?? [];\n const dehydratedIcuData = hydrationInfo.dehydratedIcuData ??= new Map();\n collectI18nNodesFromDom({\n hydrationInfo,\n lView,\n i18nNodes,\n disconnectedNodes,\n caseQueue,\n dehydratedIcuData\n }, {\n currentNode,\n isConnected: true\n }, tI18n.ast);\n // Nodes from inactive ICU cases should be considered disconnected. We track them above\n // because they aren't (and shouldn't be) serialized. Since we may mutate or create a\n // new set, we need to be sure to write the expected value back to the DehydratedView.\n hydrationInfo.disconnectedNodes = disconnectedNodes.size === 0 ? null : disconnectedNodes;\n}\nfunction collectI18nNodesFromDom(context, state, nodeOrNodes) {\n if (Array.isArray(nodeOrNodes)) {\n let nextState = state;\n for (const node of nodeOrNodes) {\n // Whenever a node doesn't directly follow the previous RNode, it\n // is given a path. We need to resume collecting nodes from that location\n // until and unless we find another disjoint node.\n const targetNode = tryLocateRNodeByPath(context.hydrationInfo, context.lView, node.index - HEADER_OFFSET);\n if (targetNode) {\n nextState = forkHydrationState(state, targetNode);\n }\n collectI18nNodesFromDom(context, nextState, node);\n }\n } else {\n if (context.disconnectedNodes.has(nodeOrNodes.index - HEADER_OFFSET)) {\n // i18n nodes can be considered disconnected if e.g. they were projected.\n // In that case, we have to make sure to skip over them.\n return;\n }\n switch (nodeOrNodes.kind) {\n case 0 /* I18nNodeKind.TEXT */:\n {\n // Claim a text node for hydration\n const currentNode = appendI18nNodeToCollection(context, state, nodeOrNodes);\n setCurrentNode(state, currentNode?.nextSibling ?? null);\n break;\n }\n case 1 /* I18nNodeKind.ELEMENT */:\n {\n // Recurse into the current element's children...\n collectI18nNodesFromDom(context, forkHydrationState(state, state.currentNode?.firstChild ?? null), nodeOrNodes.children);\n // And claim the parent element itself.\n const currentNode = appendI18nNodeToCollection(context, state, nodeOrNodes);\n setCurrentNode(state, currentNode?.nextSibling ?? null);\n break;\n }\n case 2 /* I18nNodeKind.PLACEHOLDER */:\n {\n const noOffsetIndex = nodeOrNodes.index - HEADER_OFFSET;\n const {\n hydrationInfo\n } = context;\n const containerSize = getNgContainerSize(hydrationInfo, noOffsetIndex);\n switch (nodeOrNodes.type) {\n case 0 /* I18nPlaceholderType.ELEMENT */:\n {\n // Hydration expects to find the head of the element.\n const currentNode = appendI18nNodeToCollection(context, state, nodeOrNodes);\n // A TNode for the node may not yet if we're hydrating during the first pass,\n // so use the serialized data to determine if this is an <ng-container>.\n if (isSerializedElementContainer(hydrationInfo, noOffsetIndex)) {\n // An <ng-container> doesn't have a physical DOM node, so we need to\n // continue hydrating from siblings.\n collectI18nNodesFromDom(context, state, nodeOrNodes.children);\n // Skip over the anchor element. It will be claimed by the\n // downstream container hydration.\n const nextNode = skipSiblingNodes(state, 1);\n setCurrentNode(state, nextNode);\n } else {\n // Non-container elements represent an actual node in the DOM, so we\n // need to continue hydration with the children, and claim the node.\n collectI18nNodesFromDom(context, forkHydrationState(state, state.currentNode?.firstChild ?? null), nodeOrNodes.children);\n setCurrentNode(state, currentNode?.nextSibling ?? null);\n // Elements can also be the anchor of a view container, so there may\n // be elements after this node that we need to skip.\n if (containerSize !== null) {\n // `+1` stands for an anchor node after all of the views in the container.\n const nextNode = skipSiblingNodes(state, containerSize + 1);\n setCurrentNode(state, nextNode);\n }\n }\n break;\n }\n case 1 /* I18nPlaceholderType.SUBTEMPLATE */:\n {\n ngDevMode && assertNotEqual(containerSize, null, 'Expected a container size while hydrating i18n subtemplate');\n // Hydration expects to find the head of the template.\n appendI18nNodeToCollection(context, state, nodeOrNodes);\n // Skip over all of the template children, as well as the anchor\n // node, since the template itself will handle them instead.\n const nextNode = skipSiblingNodes(state, containerSize + 1);\n setCurrentNode(state, nextNode);\n break;\n }\n }\n break;\n }\n case 3 /* I18nNodeKind.ICU */:\n {\n // If the current node is connected, we need to pop the next case from the\n // queue, so that the active case is also considered connected.\n const selectedCase = state.isConnected ? context.caseQueue.shift() : null;\n const childState = {\n currentNode: null,\n isConnected: false\n };\n // We traverse through each case, even if it's not active,\n // so that we correctly populate disconnected nodes.\n for (let i = 0; i < nodeOrNodes.cases.length; i++) {\n collectI18nNodesFromDom(context, i === selectedCase ? state : childState, nodeOrNodes.cases[i]);\n }\n if (selectedCase !== null) {\n // ICUs represent a branching state, and the selected case could be different\n // than what it was on the server. In that case, we need to be able to clean\n // up the nodes from the original case. To do that, we store the selected case.\n context.dehydratedIcuData.set(nodeOrNodes.index, {\n case: selectedCase,\n node: nodeOrNodes\n });\n }\n // Hydration expects to find the ICU anchor element.\n const currentNode = appendI18nNodeToCollection(context, state, nodeOrNodes);\n setCurrentNode(state, currentNode?.nextSibling ?? null);\n break;\n }\n }\n }\n}\nlet _claimDehydratedIcuCaseImpl = () => {\n // noop unless `enableClaimDehydratedIcuCaseImpl` is invoked\n};\n/**\n * Mark the case for the ICU node at the given index in the view as claimed,\n * allowing its nodes to be hydrated and not cleaned up.\n */\nfunction claimDehydratedIcuCase(lView, icuIndex, caseIndex) {\n _claimDehydratedIcuCaseImpl(lView, icuIndex, caseIndex);\n}\nfunction enableClaimDehydratedIcuCaseImpl() {\n _claimDehydratedIcuCaseImpl = claimDehydratedIcuCaseImpl;\n}\nfunction claimDehydratedIcuCaseImpl(lView, icuIndex, caseIndex) {\n const dehydratedIcuDataMap = lView[HYDRATION]?.dehydratedIcuData;\n if (dehydratedIcuDataMap) {\n const dehydratedIcuData = dehydratedIcuDataMap.get(icuIndex);\n if (dehydratedIcuData?.case === caseIndex) {\n // If the case we're attempting to claim matches the dehydrated one,\n // we remove it from the map to mark it as \"claimed.\"\n dehydratedIcuDataMap.delete(icuIndex);\n }\n }\n}\n/**\n * Clean up all i18n hydration data associated with the given view.\n */\nfunction cleanupI18nHydrationData(lView) {\n const hydrationInfo = lView[HYDRATION];\n if (hydrationInfo) {\n const {\n i18nNodes,\n dehydratedIcuData: dehydratedIcuDataMap\n } = hydrationInfo;\n if (i18nNodes && dehydratedIcuDataMap) {\n const renderer = lView[RENDERER];\n for (const dehydratedIcuData of dehydratedIcuDataMap.values()) {\n cleanupDehydratedIcuData(renderer, i18nNodes, dehydratedIcuData);\n }\n }\n hydrationInfo.i18nNodes = undefined;\n hydrationInfo.dehydratedIcuData = undefined;\n }\n}\nfunction cleanupDehydratedIcuData(renderer, i18nNodes, dehydratedIcuData) {\n for (const node of dehydratedIcuData.node.cases[dehydratedIcuData.case]) {\n const rNode = i18nNodes.get(node.index - HEADER_OFFSET);\n if (rNode) {\n nativeRemoveNode(renderer, rNode, false);\n }\n }\n}\n\n/**\n * Removes all dehydrated views from a given LContainer:\n * both in internal data structure, as well as removing\n * corresponding DOM nodes that belong to that dehydrated view.\n */\nfunction removeDehydratedViews(lContainer) {\n const views = lContainer[DEHYDRATED_VIEWS] ?? [];\n const parentLView = lContainer[PARENT];\n const renderer = parentLView[RENDERER];\n const retainedViews = [];\n for (const view of views) {\n // Do not clean up contents of `@defer` blocks.\n // The cleanup for this content would happen once a given block\n // is triggered and hydrated.\n if (view.data[DEFER_BLOCK_ID] !== undefined) {\n retainedViews.push(view);\n } else {\n removeDehydratedView(view, renderer);\n ngDevMode && ngDevMode.dehydratedViewsRemoved++;\n }\n }\n // Reset the value to an array to indicate that no\n // further processing of dehydrated views is needed for\n // this view container (i.e. do not trigger the lookup process\n // once again in case a `ViewContainerRef` is created later).\n lContainer[DEHYDRATED_VIEWS] = retainedViews;\n}\nfunction removeDehydratedViewList(deferBlock) {\n const {\n lContainer\n } = deferBlock;\n const dehydratedViews = lContainer[DEHYDRATED_VIEWS];\n if (dehydratedViews === null) return;\n const parentLView = lContainer[PARENT];\n const renderer = parentLView[RENDERER];\n for (const view of dehydratedViews) {\n removeDehydratedView(view, renderer);\n ngDevMode && ngDevMode.dehydratedViewsRemoved++;\n }\n}\n/**\n * Helper function to remove all nodes from a dehydrated view.\n */\nfunction removeDehydratedView(dehydratedView, renderer) {\n let nodesRemoved = 0;\n let currentRNode = dehydratedView.firstChild;\n if (currentRNode) {\n const numNodes = dehydratedView.data[NUM_ROOT_NODES];\n while (nodesRemoved < numNodes) {\n ngDevMode && validateSiblingNodeExists(currentRNode);\n const nextSibling = currentRNode.nextSibling;\n nativeRemoveNode(renderer, currentRNode, false);\n currentRNode = nextSibling;\n nodesRemoved++;\n }\n }\n}\n/**\n * Walks over all views within this LContainer invokes dehydrated views\n * cleanup function for each one.\n */\nfunction cleanupLContainer(lContainer) {\n removeDehydratedViews(lContainer);\n // The host could be an LView if this container is on a component node.\n // In this case, descend into host LView for further cleanup. See also\n // LContainer[HOST] docs for additional information.\n const hostLView = lContainer[HOST];\n if (isLView(hostLView)) {\n cleanupLView(hostLView);\n }\n for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {\n cleanupLView(lContainer[i]);\n }\n}\n/**\n * Walks over `LContainer`s and components registered within\n * this LView and invokes dehydrated views cleanup function for each one.\n */\nfunction cleanupLView(lView) {\n cleanupI18nHydrationData(lView);\n const tView = lView[TVIEW];\n for (let i = HEADER_OFFSET; i < tView.bindingStartIndex; i++) {\n if (isLContainer(lView[i])) {\n const lContainer = lView[i];\n cleanupLContainer(lContainer);\n } else if (isLView(lView[i])) {\n // This is a component, enter the `cleanupLView` recursively.\n cleanupLView(lView[i]);\n }\n }\n}\n/**\n * Walks over all views registered within the ApplicationRef and removes\n * all dehydrated views from all `LContainer`s along the way.\n */\nfunction cleanupDehydratedViews(appRef) {\n const viewRefs = appRef._views;\n for (const viewRef of viewRefs) {\n const lNode = getLNodeForHydration(viewRef);\n // An `lView` might be `null` if a `ViewRef` represents\n // an embedded view (not a component view).\n if (lNode !== null && lNode[HOST] !== null) {\n if (isLView(lNode)) {\n cleanupLView(lNode);\n } else {\n // Cleanup in all views within this view container\n cleanupLContainer(lNode);\n }\n ngDevMode && ngDevMode.dehydratedViewsCleanupRuns++;\n }\n }\n}\n/**\n * post hydration cleanup handling for defer blocks that were incrementally\n * hydrated. This removes all the jsaction attributes, timers, observers,\n * dehydrated views and containers\n */\nfunction cleanupHydratedDeferBlocks(deferBlock, hydratedBlocks, registry, appRef) {\n if (deferBlock !== null) {\n registry.cleanup(hydratedBlocks);\n cleanupLContainer(deferBlock.lContainer);\n cleanupDehydratedViews(appRef);\n }\n}\n\n/**\n * Given a current DOM node and a serialized information about the views\n * in a container, walks over the DOM structure, collecting the list of\n * dehydrated views.\n */\nfunction locateDehydratedViewsInContainer(currentRNode, serializedViews) {\n const dehydratedViews = [];\n for (const serializedView of serializedViews) {\n // Repeats a view multiple times as needed, based on the serialized information\n // (for example, for *ngFor-produced views).\n for (let i = 0; i < (serializedView[MULTIPLIER] ?? 1); i++) {\n const view = {\n data: serializedView,\n firstChild: null\n };\n if (serializedView[NUM_ROOT_NODES] > 0) {\n // Keep reference to the first node in this view,\n // so it can be accessed while invoking template instructions.\n view.firstChild = currentRNode;\n // Move over to the next node after this view, which can\n // either be a first node of the next view or an anchor comment\n // node after the last view in a container.\n currentRNode = siblingAfter(serializedView[NUM_ROOT_NODES], currentRNode);\n }\n dehydratedViews.push(view);\n }\n }\n return [currentRNode, dehydratedViews];\n}\n/**\n * Reference to a function that searches for a matching dehydrated views\n * stored on a given lContainer.\n * Returns `null` by default, when hydration is not enabled.\n */\nlet _findMatchingDehydratedViewImpl = () => null;\n/**\n * Reference to a function that searches for a matching dehydrated view\n * stored on a control flow lContainer and removes the dehydrated content\n * once found.\n * Returns `null` by default, when hydration is not enabled.\n */\nlet _findAndReconcileMatchingDehydratedViewsImpl = () => null;\nfunction enableFindMatchingDehydratedViewImpl() {\n _findMatchingDehydratedViewImpl = findMatchingDehydratedViewImpl;\n _findAndReconcileMatchingDehydratedViewsImpl = findAndReconcileMatchingDehydratedViewsImpl;\n}\n/**\n * Retrieves the next dehydrated view from the LContainer and verifies that\n * it matches a given template id (from the TView that was used to create this\n * instance of a view). If the id doesn't match, that means that we are in an\n * unexpected state and can not complete the reconciliation process. Thus,\n * all dehydrated views from this LContainer are removed (including corresponding\n * DOM nodes) and the rendering is performed as if there were no dehydrated views\n * in this container.\n */\nfunction findMatchingDehydratedViewImpl(lContainer, template) {\n if (hasMatchingDehydratedView(lContainer, template)) {\n return lContainer[DEHYDRATED_VIEWS].shift();\n } else {\n // Otherwise, we are at the state when reconciliation can not be completed,\n // thus we remove all dehydrated views within this container (remove them\n // from internal data structures as well as delete associated elements from\n // the DOM tree).\n removeDehydratedViews(lContainer);\n return null;\n }\n}\nfunction findMatchingDehydratedView(lContainer, template) {\n return _findMatchingDehydratedViewImpl(lContainer, template);\n}\nfunction findAndReconcileMatchingDehydratedViewsImpl(lContainer, templateTNode, hostLView) {\n if (templateTNode.tView.ssrId === null) return null;\n const dehydratedView = findMatchingDehydratedView(lContainer, templateTNode.tView.ssrId);\n // we know that an ssrId was generated, but we were unable to match it to\n // a dehydrated view, which means that we may have changed branches\n // between server and client. We'll need to find and remove those\n // stale dehydrated views.\n if (hostLView[TVIEW].firstUpdatePass && dehydratedView === null) {\n removeStaleDehydratedBranch(hostLView, templateTNode);\n }\n return dehydratedView;\n}\nfunction findAndReconcileMatchingDehydratedViews(lContainer, templateTNode, hostLView) {\n return _findAndReconcileMatchingDehydratedViewsImpl(lContainer, templateTNode, hostLView);\n}\n/**\n * In the case that we have control flow that changes branches between server and\n * client, we're left with dehydrated content that will not be used. We need to find\n * it and clean it up at the right time so that we don't see duplicate content for\n * a few moments before the application reaches stability. This navigates the\n * control flow containers by looking at the TNodeFlags to find the matching\n * dehydrated content for the branch that is now stale from the server and removes it.\n */\nfunction removeStaleDehydratedBranch(hostLView, tNode) {\n let currentTNode = tNode;\n while (currentTNode) {\n // We can return here if we've found the dehydrated view and cleaned it up.\n // Otherwise we continue on until we either find it or reach the start of\n // the control flow.\n if (cleanupMatchingDehydratedViews(hostLView, currentTNode)) return;\n if ((currentTNode.flags & 256 /* TNodeFlags.isControlFlowStart */) === 256 /* TNodeFlags.isControlFlowStart */) {\n // we've hit the top of the control flow loop\n break;\n }\n currentTNode = currentTNode.prev;\n }\n currentTNode = tNode.next; // jump to place we started so we can navigate down from there\n while (currentTNode) {\n if ((currentTNode.flags & 512 /* TNodeFlags.isInControlFlow */) !== 512 /* TNodeFlags.isInControlFlow */) {\n // we've exited control flow and need to exit the loop.\n break;\n }\n // Similar to above, we can return here if we've found the dehydrated view\n // and cleaned it up. Otherwise we continue on until we either find it or\n // reach the end of the control flow.\n if (cleanupMatchingDehydratedViews(hostLView, currentTNode)) return;\n currentTNode = currentTNode.next;\n }\n}\nfunction hasMatchingDehydratedView(lContainer, template) {\n const views = lContainer[DEHYDRATED_VIEWS];\n if (!template || views === null || views.length === 0) {\n return false;\n }\n // Verify whether the first dehydrated view in the container matches\n // the template id passed to this function (that originated from a TView\n // that was used to create an instance of an embedded or component views.\n return views[0].data[TEMPLATE_ID] === template;\n}\nfunction cleanupMatchingDehydratedViews(hostLView, currentTNode) {\n const ssrId = currentTNode.tView?.ssrId;\n if (ssrId == null /* check both `null` and `undefined` */) return false;\n const container = hostLView[currentTNode.index];\n // if we can find the dehydrated view in this container, we know we've found the stale view\n // and we can remove it.\n if (isLContainer(container) && hasMatchingDehydratedView(container, ssrId)) {\n removeDehydratedViews(container);\n return true;\n }\n return false;\n}\n\n/**\n * Represents a component created by a `ComponentFactory`.\n * Provides access to the component instance and related objects,\n * and provides the means of destroying the instance.\n *\n * @publicApi\n */\nlet ComponentRef$1 = class ComponentRef {};\n/**\n * Base class for a factory that can create a component dynamically.\n * Instantiate a factory for a given type of component with `resolveComponentFactory()`.\n * Use the resulting `ComponentFactory.create()` method to create a component of that type.\n *\n * @publicApi\n *\n * @deprecated Angular no longer requires Component factories. Please use other APIs where\n * Component class can be used directly.\n */\nlet ComponentFactory$1 = class ComponentFactory {};\nclass _NullComponentFactoryResolver {\n resolveComponentFactory(component) {\n throw new RuntimeError(917 /* RuntimeErrorCode.NO_COMPONENT_FACTORY_FOUND */, typeof ngDevMode !== 'undefined' && ngDevMode && `No component factory found for ${stringify(component)}.`);\n }\n}\n/**\n * A simple registry that maps `Components` to generated `ComponentFactory` classes\n * that can be used to create instances of components.\n * Use to obtain the factory for a given component type,\n * then use the factory's `create()` method to create a component of that type.\n *\n * Note: since v13, dynamic component creation via\n * [`ViewContainerRef.createComponent`](api/core/ViewContainerRef#createComponent)\n * does **not** require resolving component factory: component class can be used directly.\n *\n * @publicApi\n *\n * @deprecated Angular no longer requires Component factories. Please use other APIs where\n * Component class can be used directly.\n */\nlet ComponentFactoryResolver$1 = class ComponentFactoryResolver {\n static NULL = new _NullComponentFactoryResolver();\n};\n\n/**\n * Creates and initializes a custom renderer that implements the `Renderer2` base class.\n *\n * @publicApi\n */\nclass RendererFactory2 {}\n/**\n * Extend this base class to implement custom rendering. By default, Angular\n * renders a template into DOM. You can use custom rendering to intercept\n * rendering calls, or to render to something other than DOM.\n *\n * <div class=\"docs-alert docs-alert-important\">\n * <p>\n * Please be aware that usage of `Renderer2`, in context of accessing DOM elements, provides no\n * extra security which makes it equivalent to\n * {@link /best-practices/security#direct-use-of-the-dom-apis-and-explicit-sanitization-calls Security vulnerabilities}.\n * </p>\n * </div>\n *\n * Create your custom renderer using `RendererFactory2`.\n *\n * Use a custom renderer to bypass Angular's templating and\n * make custom UI changes that can't be expressed declaratively.\n * For example if you need to set a property or an attribute whose name is\n * not statically known, use the `setProperty()` or\n * `setAttribute()` method.\n *\n * @publicApi\n */\nclass Renderer2 {\n /**\n * If null or undefined, the view engine won't call it.\n * This is used as a performance optimization for production mode.\n */\n destroyNode = null;\n /**\n * @internal\n * @nocollapse\n */\n static __NG_ELEMENT_ID__ = () => injectRenderer2();\n}\n/** Injects a Renderer2 for the current component. */\nfunction injectRenderer2() {\n // We need the Renderer to be based on the component that it's being injected into, however since\n // DI happens before we've entered its view, `getLView` will return the parent view instead.\n const lView = getLView();\n const tNode = getCurrentTNode();\n const nodeAtIndex = getComponentLViewByIndex(tNode.index, lView);\n return (isLView(nodeAtIndex) ? nodeAtIndex : lView)[RENDERER];\n}\n\n/**\n * Sanitizer is used by the views to sanitize potentially dangerous values.\n *\n * @publicApi\n */\nclass Sanitizer {\n /** @nocollapse */\n static ɵprov = /** @pureOrBreakMyCode */ /* @__PURE__ */__defineInjectable({\n token: Sanitizer,\n providedIn: 'root',\n factory: () => null\n });\n}\nfunction isModuleWithProviders(value) {\n return value.ngModule !== undefined;\n}\nfunction isNgModule(value) {\n return !!getNgModuleDef(value);\n}\nfunction isPipe(value) {\n return !!getPipeDef$1(value);\n}\nfunction isDirective(value) {\n return !!getDirectiveDef(value);\n}\nfunction isComponent(value) {\n return !!getComponentDef(value);\n}\nfunction getDependencyTypeForError(type) {\n if (getComponentDef(type)) return 'component';\n if (getDirectiveDef(type)) return 'directive';\n if (getPipeDef$1(type)) return 'pipe';\n return 'type';\n}\nfunction verifyStandaloneImport(depType, importingType) {\n if (isForwardRef(depType)) {\n depType = resolveForwardRef(depType);\n if (!depType) {\n throw new Error(`Expected forwardRef function, imported from \"${stringifyForError(importingType)}\", to return a standalone entity or NgModule but got \"${stringifyForError(depType) || depType}\".`);\n }\n }\n if (getNgModuleDef(depType) == null) {\n const def = getComponentDef(depType) || getDirectiveDef(depType) || getPipeDef$1(depType);\n if (def != null) {\n // if a component, directive or pipe is imported make sure that it is standalone\n if (!def.standalone) {\n throw new Error(`The \"${stringifyForError(depType)}\" ${getDependencyTypeForError(depType)}, imported from \"${stringifyForError(importingType)}\", is not standalone. Did you forget to add the standalone: true flag?`);\n }\n } else {\n // it can be either a module with provider or an unknown (not annotated) type\n if (isModuleWithProviders(depType)) {\n throw new Error(`A module with providers was imported from \"${stringifyForError(importingType)}\". Modules with providers are not supported in standalone components imports.`);\n } else {\n throw new Error(`The \"${stringifyForError(depType)}\" type, imported from \"${stringifyForError(importingType)}\", must be a standalone component / directive / pipe or an NgModule. Did you forget to add the required @Component / @Directive / @Pipe or @NgModule annotation?`);\n }\n }\n }\n}\n\n/**\n * An implementation of DepsTrackerApi which will be used for JIT and local compilation.\n */\nclass DepsTracker {\n ownerNgModule = new Map();\n ngModulesWithSomeUnresolvedDecls = new Set();\n ngModulesScopeCache = new Map();\n standaloneComponentsScopeCache = new Map();\n /**\n * Attempts to resolve ng module's forward ref declarations as much as possible and add them to\n * the `ownerNgModule` map. This method normally should be called after the initial parsing when\n * all the forward refs are resolved (e.g., when trying to render a component)\n */\n resolveNgModulesDecls() {\n if (this.ngModulesWithSomeUnresolvedDecls.size === 0) {\n return;\n }\n for (const moduleType of this.ngModulesWithSomeUnresolvedDecls) {\n const def = getNgModuleDef(moduleType);\n if (def?.declarations) {\n for (const decl of maybeUnwrapFn(def.declarations)) {\n if (isComponent(decl)) {\n this.ownerNgModule.set(decl, moduleType);\n }\n }\n }\n }\n this.ngModulesWithSomeUnresolvedDecls.clear();\n }\n /** @override */\n getComponentDependencies(type, rawImports) {\n this.resolveNgModulesDecls();\n const def = getComponentDef(type);\n if (def === null) {\n throw new Error(`Attempting to get component dependencies for a type that is not a component: ${type}`);\n }\n if (def.standalone) {\n const scope = this.getStandaloneComponentScope(type, rawImports);\n if (scope.compilation.isPoisoned) {\n return {\n dependencies: []\n };\n }\n return {\n dependencies: [...scope.compilation.directives, ...scope.compilation.pipes, ...scope.compilation.ngModules]\n };\n } else {\n if (!this.ownerNgModule.has(type)) {\n // This component is orphan! No need to handle the error since the component rendering\n // pipeline (e.g., view_container_ref) will check for this error based on configs.\n return {\n dependencies: []\n };\n }\n const scope = this.getNgModuleScope(this.ownerNgModule.get(type));\n if (scope.compilation.isPoisoned) {\n return {\n dependencies: []\n };\n }\n return {\n dependencies: [...scope.compilation.directives, ...scope.compilation.pipes]\n };\n }\n }\n /**\n * @override\n * This implementation does not make use of param scopeInfo since it assumes the scope info is\n * already added to the type itself through methods like {@link ɵɵsetNgModuleScope}\n */\n registerNgModule(type, scopeInfo) {\n if (!isNgModule(type)) {\n throw new Error(`Attempting to register a Type which is not NgModule as NgModule: ${type}`);\n }\n // Lazily process the NgModules later when needed.\n this.ngModulesWithSomeUnresolvedDecls.add(type);\n }\n /** @override */\n clearScopeCacheFor(type) {\n this.ngModulesScopeCache.delete(type);\n this.standaloneComponentsScopeCache.delete(type);\n }\n /** @override */\n getNgModuleScope(type) {\n if (this.ngModulesScopeCache.has(type)) {\n return this.ngModulesScopeCache.get(type);\n }\n const scope = this.computeNgModuleScope(type);\n this.ngModulesScopeCache.set(type, scope);\n return scope;\n }\n /** Compute NgModule scope afresh. */\n computeNgModuleScope(type) {\n const def = getNgModuleDefOrThrow(type);\n const scope = {\n exported: {\n directives: new Set(),\n pipes: new Set()\n },\n compilation: {\n directives: new Set(),\n pipes: new Set()\n }\n };\n // Analyzing imports\n for (const imported of maybeUnwrapFn(def.imports)) {\n if (isNgModule(imported)) {\n const importedScope = this.getNgModuleScope(imported);\n // When this module imports another, the imported module's exported directives and pipes\n // are added to the compilation scope of this module.\n addSet(importedScope.exported.directives, scope.compilation.directives);\n addSet(importedScope.exported.pipes, scope.compilation.pipes);\n } else if (isStandalone(imported)) {\n if (isDirective(imported) || isComponent(imported)) {\n scope.compilation.directives.add(imported);\n } else if (isPipe(imported)) {\n scope.compilation.pipes.add(imported);\n } else {\n // The standalone thing is neither a component nor a directive nor a pipe ... (what?)\n throw new RuntimeError(980 /* RuntimeErrorCode.RUNTIME_DEPS_INVALID_IMPORTED_TYPE */, 'The standalone imported type is neither a component nor a directive nor a pipe');\n }\n } else {\n // The import is neither a module nor a module-with-providers nor a standalone thing. This\n // is going to be an error. So we short circuit.\n scope.compilation.isPoisoned = true;\n break;\n }\n }\n // Analyzing declarations\n if (!scope.compilation.isPoisoned) {\n for (const decl of maybeUnwrapFn(def.declarations)) {\n // Cannot declare another NgModule or a standalone thing\n if (isNgModule(decl) || isStandalone(decl)) {\n scope.compilation.isPoisoned = true;\n break;\n }\n if (isPipe(decl)) {\n scope.compilation.pipes.add(decl);\n } else {\n // decl is either a directive or a component. The component may not yet have the ɵcmp due\n // to async compilation.\n scope.compilation.directives.add(decl);\n }\n }\n }\n // Analyzing exports\n for (const exported of maybeUnwrapFn(def.exports)) {\n if (isNgModule(exported)) {\n // When this module exports another, the exported module's exported directives and pipes\n // are added to both the compilation and exported scopes of this module.\n const exportedScope = this.getNgModuleScope(exported);\n // Based on the current logic there is no way to have poisoned exported scope. So no need to\n // check for it.\n addSet(exportedScope.exported.directives, scope.exported.directives);\n addSet(exportedScope.exported.pipes, scope.exported.pipes);\n // Some test toolings which run in JIT mode depend on this behavior that the exported scope\n // should also be present in the compilation scope, even though AoT does not support this\n // and it is also in odds with NgModule metadata definitions. Without this some tests in\n // Google will fail.\n addSet(exportedScope.exported.directives, scope.compilation.directives);\n addSet(exportedScope.exported.pipes, scope.compilation.pipes);\n } else if (isPipe(exported)) {\n scope.exported.pipes.add(exported);\n } else {\n scope.exported.directives.add(exported);\n }\n }\n return scope;\n }\n /** @override */\n getStandaloneComponentScope(type, rawImports) {\n if (this.standaloneComponentsScopeCache.has(type)) {\n return this.standaloneComponentsScopeCache.get(type);\n }\n const ans = this.computeStandaloneComponentScope(type, rawImports);\n this.standaloneComponentsScopeCache.set(type, ans);\n return ans;\n }\n computeStandaloneComponentScope(type, rawImports) {\n const ans = {\n compilation: {\n // Standalone components are always able to self-reference.\n directives: new Set([type]),\n pipes: new Set(),\n ngModules: new Set()\n }\n };\n for (const rawImport of flatten(rawImports ?? [])) {\n const imported = resolveForwardRef(rawImport);\n try {\n verifyStandaloneImport(imported, type);\n } catch (e) {\n // Short-circuit if an import is not valid\n ans.compilation.isPoisoned = true;\n return ans;\n }\n if (isNgModule(imported)) {\n ans.compilation.ngModules.add(imported);\n const importedScope = this.getNgModuleScope(imported);\n // Short-circuit if an imported NgModule has corrupted exported scope.\n if (importedScope.exported.isPoisoned) {\n ans.compilation.isPoisoned = true;\n return ans;\n }\n addSet(importedScope.exported.directives, ans.compilation.directives);\n addSet(importedScope.exported.pipes, ans.compilation.pipes);\n } else if (isPipe(imported)) {\n ans.compilation.pipes.add(imported);\n } else if (isDirective(imported) || isComponent(imported)) {\n ans.compilation.directives.add(imported);\n } else {\n // The imported thing is not module/pipe/directive/component, so we error and short-circuit\n // here\n ans.compilation.isPoisoned = true;\n return ans;\n }\n }\n return ans;\n }\n /** @override */\n isOrphanComponent(cmp) {\n const def = getComponentDef(cmp);\n if (!def || def.standalone) {\n return false;\n }\n this.resolveNgModulesDecls();\n return !this.ownerNgModule.has(cmp);\n }\n}\nfunction addSet(sourceSet, targetSet) {\n for (const m of sourceSet) {\n targetSet.add(m);\n }\n}\n/** The deps tracker to be used in the current Angular app in dev mode. */\nconst depsTracker = new DepsTracker();\n\n// This default value is when checking the hierarchy for a token.\n//\n// It means both:\n// - the token is not provided by the current injector,\n// - only the element injectors should be checked (ie do not check module injectors\n//\n// mod1\n// /\n// el1 mod2\n// \\ /\n// el2\n//\n// When requesting el2.injector.get(token), we should check in the following order and return the\n// first found value:\n// - el2.injector.get(token, default)\n// - el1.injector.get(token, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR) -> do not check the module\n// - mod2.injector.get(token, default)\nconst NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR = {};\n\n/**\n * Injector that looks up a value using a specific injector, before falling back to the module\n * injector. Used primarily when creating components or embedded views dynamically.\n */\nclass ChainedInjector {\n injector;\n parentInjector;\n constructor(injector, parentInjector) {\n this.injector = injector;\n this.parentInjector = parentInjector;\n }\n get(token, notFoundValue, options) {\n const value = this.injector.get(token, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR, options);\n if (value !== NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR || notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR) {\n // Return the value from the root element injector when\n // - it provides it\n // (value !== NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR)\n // - the module injector should not be checked\n // (notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR)\n return value;\n }\n return this.parentInjector.get(token, notFoundValue, options);\n }\n}\n\n/**\n * Compute the static styling (class/style) from `TAttributes`.\n *\n * This function should be called during `firstCreatePass` only.\n *\n * @param tNode The `TNode` into which the styling information should be loaded.\n * @param attrs `TAttributes` containing the styling information.\n * @param writeToHost Where should the resulting static styles be written?\n * - `false` Write to `TNode.stylesWithoutHost` / `TNode.classesWithoutHost`\n * - `true` Write to `TNode.styles` / `TNode.classes`\n */\nfunction computeStaticStyling(tNode, attrs, writeToHost) {\n ngDevMode && assertFirstCreatePass(getTView(), 'Expecting to be called in first template pass only');\n let styles = writeToHost ? tNode.styles : null;\n let classes = writeToHost ? tNode.classes : null;\n let mode = 0;\n if (attrs !== null) {\n for (let i = 0; i < attrs.length; i++) {\n const value = attrs[i];\n if (typeof value === 'number') {\n mode = value;\n } else if (mode == 1 /* AttributeMarker.Classes */) {\n classes = concatStringsWithSpace(classes, value);\n } else if (mode == 2 /* AttributeMarker.Styles */) {\n const style = value;\n const styleValue = attrs[++i];\n styles = concatStringsWithSpace(styles, style + ': ' + styleValue + ';');\n }\n }\n }\n writeToHost ? tNode.styles = styles : tNode.stylesWithoutHost = styles;\n writeToHost ? tNode.classes = classes : tNode.classesWithoutHost = classes;\n}\nfunction ɵɵdirectiveInject(token, flags = 0 /* InternalInjectFlags.Default */) {\n const lView = getLView();\n // Fall back to inject() if view hasn't been created. This situation can happen in tests\n // if inject utilities are used before bootstrapping.\n if (lView === null) {\n // Verify that we will not get into infinite loop.\n ngDevMode && assertInjectImplementationNotEqual(ɵɵdirectiveInject);\n return __inject(token, flags);\n }\n const tNode = getCurrentTNode();\n const value = getOrCreateInjectable(tNode, lView, resolveForwardRef(token), flags);\n ngDevMode && emitInjectEvent(token, value, flags);\n return value;\n}\n/**\n * Throws an error indicating that a factory function could not be generated by the compiler for a\n * particular class.\n *\n * This instruction allows the actual error message to be optimized away when ngDevMode is turned\n * off, saving bytes of generated code while still providing a good experience in dev mode.\n *\n * The name of the class is not mentioned here, but will be in the generated factory function name\n * and thus in the stack trace.\n *\n * @codeGenApi\n */\nfunction ɵɵinvalidFactory() {\n const msg = ngDevMode ? `This constructor was not compatible with Dependency Injection.` : 'invalid';\n throw new Error(msg);\n}\n\n/**\n * Resolve the matched directives on a node.\n */\nfunction resolveDirectives(tView, lView, tNode, localRefs, directiveMatcher) {\n // Please make sure to have explicit type for `exportsMap`. Inferred type triggers bug in tsickle.\n ngDevMode && assertFirstCreatePass(tView);\n const exportsMap = localRefs === null ? null : {\n '': -1\n };\n const matchedDirectiveDefs = directiveMatcher(tView, tNode);\n if (matchedDirectiveDefs !== null) {\n let directiveDefs = matchedDirectiveDefs;\n let hostDirectiveDefs = null;\n let hostDirectiveRanges = null;\n for (const def of matchedDirectiveDefs) {\n if (def.resolveHostDirectives !== null) {\n [directiveDefs, hostDirectiveDefs, hostDirectiveRanges] = def.resolveHostDirectives(matchedDirectiveDefs);\n break;\n }\n }\n ngDevMode && assertNoDuplicateDirectives(directiveDefs);\n initializeDirectives(tView, lView, tNode, directiveDefs, exportsMap, hostDirectiveDefs, hostDirectiveRanges);\n }\n if (exportsMap !== null && localRefs !== null) {\n cacheMatchingLocalNames(tNode, localRefs, exportsMap);\n }\n}\n/** Caches local names and their matching directive indices for query and template lookups. */\nfunction cacheMatchingLocalNames(tNode, localRefs, exportsMap) {\n const localNames = tNode.localNames = [];\n // Local names must be stored in tNode in the same order that localRefs are defined\n // in the template to ensure the data is loaded in the same slots as their refs\n // in the template (for template queries).\n for (let i = 0; i < localRefs.length; i += 2) {\n const index = exportsMap[localRefs[i + 1]];\n if (index == null) throw new RuntimeError(-301 /* RuntimeErrorCode.EXPORT_NOT_FOUND */, ngDevMode && `Export of name '${localRefs[i + 1]}' not found!`);\n localNames.push(localRefs[i], index);\n }\n}\n/**\n * Marks a given TNode as a component's host. This consists of:\n * - setting the component offset on the TNode.\n * - storing index of component's host element so it will be queued for view refresh during CD.\n */\nfunction markAsComponentHost(tView, hostTNode, componentOffset) {\n ngDevMode && assertFirstCreatePass(tView);\n ngDevMode && assertGreaterThan(componentOffset, -1, 'componentOffset must be great than -1');\n hostTNode.componentOffset = componentOffset;\n (tView.components ??= []).push(hostTNode.index);\n}\n/** Initializes the data structures necessary for a list of directives to be instantiated. */\nfunction initializeDirectives(tView, lView, tNode, directives, exportsMap, hostDirectiveDefs, hostDirectiveRanges) {\n ngDevMode && assertFirstCreatePass(tView);\n const directivesLength = directives.length;\n let hasSeenComponent = false;\n // Publishes the directive types to DI so they can be injected. Needs to\n // happen in a separate pass before the TNode flags have been initialized.\n for (let i = 0; i < directivesLength; i++) {\n const def = directives[i];\n if (!hasSeenComponent && isComponentDef(def)) {\n hasSeenComponent = true;\n markAsComponentHost(tView, tNode, i);\n }\n diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, lView), tView, def.type);\n }\n initTNodeFlags(tNode, tView.data.length, directivesLength);\n // When the same token is provided by several directives on the same node, some rules apply in\n // the viewEngine:\n // - viewProviders have priority over providers\n // - the last directive in NgModule.declarations has priority over the previous one\n // So to match these rules, the order in which providers are added in the arrays is very\n // important.\n for (let i = 0; i < directivesLength; i++) {\n const def = directives[i];\n if (def.providersResolver) def.providersResolver(def);\n }\n let preOrderHooksFound = false;\n let preOrderCheckHooksFound = false;\n let directiveIdx = allocExpando(tView, lView, directivesLength, null);\n ngDevMode && assertSame(directiveIdx, tNode.directiveStart, 'TNode.directiveStart should point to just allocated space');\n // If there's at least one directive, we'll have to track it so initialize the map.\n if (directivesLength > 0) {\n tNode.directiveToIndex = new Map();\n }\n for (let i = 0; i < directivesLength; i++) {\n const def = directives[i];\n // Merge the attrs in the order of matches. This assumes that the first directive is the\n // component itself, so that the component has the least priority.\n tNode.mergedAttrs = mergeHostAttrs(tNode.mergedAttrs, def.hostAttrs);\n configureViewWithDirective(tView, tNode, lView, directiveIdx, def);\n saveNameToExportMap(directiveIdx, def, exportsMap);\n // If a directive has host directives, we need to track both its index and the range within\n // the host directives are declared. Host directives are not tracked, but should be resolved\n // by looking up the host and getting its indexes from there.\n if (hostDirectiveRanges !== null && hostDirectiveRanges.has(def)) {\n const [start, end] = hostDirectiveRanges.get(def);\n tNode.directiveToIndex.set(def.type, [directiveIdx, start + tNode.directiveStart, end + tNode.directiveStart]);\n } else if (hostDirectiveDefs === null || !hostDirectiveDefs.has(def)) {\n tNode.directiveToIndex.set(def.type, directiveIdx);\n }\n if (def.contentQueries !== null) tNode.flags |= 4 /* TNodeFlags.hasContentQuery */;\n if (def.hostBindings !== null || def.hostAttrs !== null || def.hostVars !== 0) tNode.flags |= 64 /* TNodeFlags.hasHostBindings */;\n const lifeCycleHooks = def.type.prototype;\n // Only push a node index into the preOrderHooks array if this is the first\n // pre-order hook found on this node.\n if (!preOrderHooksFound && (lifeCycleHooks.ngOnChanges || lifeCycleHooks.ngOnInit || lifeCycleHooks.ngDoCheck)) {\n // We will push the actual hook function into this array later during dir instantiation.\n // We cannot do it now because we must ensure hooks are registered in the same\n // order that directives are created (i.e. injection order).\n (tView.preOrderHooks ??= []).push(tNode.index);\n preOrderHooksFound = true;\n }\n if (!preOrderCheckHooksFound && (lifeCycleHooks.ngOnChanges || lifeCycleHooks.ngDoCheck)) {\n (tView.preOrderCheckHooks ??= []).push(tNode.index);\n preOrderCheckHooksFound = true;\n }\n directiveIdx++;\n }\n initializeInputAndOutputAliases(tView, tNode, hostDirectiveDefs);\n}\n/**\n * Initializes data structures required to work with directive inputs and outputs.\n * Initialization is done for all directives matched on a given TNode.\n */\nfunction initializeInputAndOutputAliases(tView, tNode, hostDirectiveDefs) {\n ngDevMode && assertFirstCreatePass(tView);\n for (let index = tNode.directiveStart; index < tNode.directiveEnd; index++) {\n const directiveDef = tView.data[index];\n if (hostDirectiveDefs === null || !hostDirectiveDefs.has(directiveDef)) {\n setupSelectorMatchedInputsOrOutputs(0 /* BindingType.Inputs */, tNode, directiveDef, index);\n setupSelectorMatchedInputsOrOutputs(1 /* BindingType.Outputs */, tNode, directiveDef, index);\n setupInitialInputs(tNode, index, false);\n } else {\n const hostDirectiveDef = hostDirectiveDefs.get(directiveDef);\n setupHostDirectiveInputsOrOutputs(0 /* BindingType.Inputs */, tNode, hostDirectiveDef, index);\n setupHostDirectiveInputsOrOutputs(1 /* BindingType.Outputs */, tNode, hostDirectiveDef, index);\n setupInitialInputs(tNode, index, true);\n }\n }\n}\n/**\n * Sets up the input/output bindings for a directive that was matched in the template through its\n * selector. This method is called repeatedly to build up all of the available inputs on a node.\n *\n * @param mode Whether inputs or outputs are being contructed.\n * @param tNode Node on which the bindings are being set up.\n * @param def Directive definition for which the bindings are being set up.\n * @param directiveIndex Index at which the directive instance will be stored in the LView.\n */\nfunction setupSelectorMatchedInputsOrOutputs(mode, tNode, def, directiveIndex) {\n const aliasMap = mode === 0 /* BindingType.Inputs */ ? def.inputs : def.outputs;\n for (const publicName in aliasMap) {\n if (aliasMap.hasOwnProperty(publicName)) {\n let bindings;\n if (mode === 0 /* BindingType.Inputs */) {\n bindings = tNode.inputs ??= {};\n } else {\n bindings = tNode.outputs ??= {};\n }\n bindings[publicName] ??= [];\n bindings[publicName].push(directiveIndex);\n setShadowStylingInputFlags(tNode, publicName);\n }\n }\n}\n/**\n * Sets up input/output bindings that were defined through host directives on a specific node.\n * @param mode Whether inputs or outputs are being contructed.\n * @param tNode Node on which the bindings are being set up.\n * @param config Host directive definition that is being set up.\n * @param directiveIndex Index at which the directive instance will be stored in the LView.\n */\nfunction setupHostDirectiveInputsOrOutputs(mode, tNode, config, directiveIndex) {\n const aliasMap = mode === 0 /* BindingType.Inputs */ ? config.inputs : config.outputs;\n for (const initialName in aliasMap) {\n if (aliasMap.hasOwnProperty(initialName)) {\n const publicName = aliasMap[initialName];\n let bindings;\n if (mode === 0 /* BindingType.Inputs */) {\n bindings = tNode.hostDirectiveInputs ??= {};\n } else {\n bindings = tNode.hostDirectiveOutputs ??= {};\n }\n bindings[publicName] ??= [];\n bindings[publicName].push(directiveIndex, initialName);\n setShadowStylingInputFlags(tNode, publicName);\n }\n }\n}\nfunction setShadowStylingInputFlags(tNode, publicName) {\n if (publicName === 'class') {\n tNode.flags |= 8 /* TNodeFlags.hasClassInput */;\n } else if (publicName === 'style') {\n tNode.flags |= 16 /* TNodeFlags.hasStyleInput */;\n }\n}\n/**\n * Sets up the initialInputData for a node and stores it in the template's static storage\n * so subsequent template invocations don't have to recalculate it.\n *\n * initialInputData is an array containing values that need to be set as input properties\n * for directives on this node, but only once on creation. We need this array to support\n * the case where you set an @Input property of a directive using attribute-like syntax.\n * e.g. if you have a `name` @Input, you can set it once like this:\n *\n * <my-component name=\"Bess\"></my-component>\n *\n * @param tNode TNode on which to set up the initial inputs.\n * @param directiveIndex Index of the directive that is currently being processed.\n */\nfunction setupInitialInputs(tNode, directiveIndex, isHostDirective) {\n const {\n attrs,\n inputs,\n hostDirectiveInputs\n } = tNode;\n if (attrs === null || !isHostDirective && inputs === null || isHostDirective && hostDirectiveInputs === null ||\n // Do not use unbound attributes as inputs to structural directives, since structural\n // directive inputs can only be set using microsyntax (e.g. `<div *dir=\"exp\">`).\n isInlineTemplate(tNode)) {\n tNode.initialInputs ??= [];\n tNode.initialInputs.push(null);\n return;\n }\n let inputsToStore = null;\n let i = 0;\n while (i < attrs.length) {\n const attrName = attrs[i];\n if (attrName === 0 /* AttributeMarker.NamespaceURI */) {\n // We do not allow inputs on namespaced attributes.\n i += 4;\n continue;\n } else if (attrName === 5 /* AttributeMarker.ProjectAs */) {\n // Skip over the `ngProjectAs` value.\n i += 2;\n continue;\n } else if (typeof attrName === 'number') {\n // If we hit any other attribute markers, we're done anyway. None of those are valid inputs.\n break;\n }\n if (!isHostDirective && inputs.hasOwnProperty(attrName)) {\n // Find the input's public name from the input store. Note that we can be found easier\n // through the directive def, but we want to do it using the inputs store so that it can\n // account for host directive aliases.\n const inputConfig = inputs[attrName];\n for (const index of inputConfig) {\n if (index === directiveIndex) {\n inputsToStore ??= [];\n inputsToStore.push(attrName, attrs[i + 1]);\n // A directive can't have multiple inputs with the same name so we can break here.\n break;\n }\n }\n } else if (isHostDirective && hostDirectiveInputs.hasOwnProperty(attrName)) {\n const config = hostDirectiveInputs[attrName];\n for (let j = 0; j < config.length; j += 2) {\n if (config[j] === directiveIndex) {\n inputsToStore ??= [];\n inputsToStore.push(config[j + 1], attrs[i + 1]);\n break;\n }\n }\n }\n i += 2;\n }\n tNode.initialInputs ??= [];\n tNode.initialInputs.push(inputsToStore);\n}\n/**\n * Setup directive for instantiation.\n *\n * We need to create a `NodeInjectorFactory` which is then inserted in both the `Blueprint` as well\n * as `LView`. `TView` gets the `DirectiveDef`.\n *\n * @param tView `TView`\n * @param tNode `TNode`\n * @param lView `LView`\n * @param directiveIndex Index where the directive will be stored in the Expando.\n * @param def `DirectiveDef`\n */\nfunction configureViewWithDirective(tView, tNode, lView, directiveIndex, def) {\n ngDevMode && assertGreaterThanOrEqual(directiveIndex, HEADER_OFFSET, 'Must be in Expando section');\n tView.data[directiveIndex] = def;\n const directiveFactory = def.factory || (def.factory = getFactoryDef(def.type, true));\n // Even though `directiveFactory` will already be using `ɵɵdirectiveInject` in its generated code,\n // we also want to support `inject()` directly from the directive constructor context so we set\n // `ɵɵdirectiveInject` as the inject implementation here too.\n const nodeInjectorFactory = new NodeInjectorFactory(directiveFactory, isComponentDef(def), ɵɵdirectiveInject, ngDevMode ? def.type.name : null);\n tView.blueprint[directiveIndex] = nodeInjectorFactory;\n lView[directiveIndex] = nodeInjectorFactory;\n registerHostBindingOpCodes(tView, tNode, directiveIndex, allocExpando(tView, lView, def.hostVars, NO_CHANGE), def);\n}\n/**\n * Add `hostBindings` to the `TView.hostBindingOpCodes`.\n *\n * @param tView `TView` to which the `hostBindings` should be added.\n * @param tNode `TNode` the element which contains the directive\n * @param directiveIdx Directive index in view.\n * @param directiveVarsIdx Where will the directive's vars be stored\n * @param def `ComponentDef`/`DirectiveDef`, which contains the `hostVars`/`hostBindings` to add.\n */\nfunction registerHostBindingOpCodes(tView, tNode, directiveIdx, directiveVarsIdx, def) {\n ngDevMode && assertFirstCreatePass(tView);\n const hostBindings = def.hostBindings;\n if (hostBindings) {\n let hostBindingOpCodes = tView.hostBindingOpCodes;\n if (hostBindingOpCodes === null) {\n hostBindingOpCodes = tView.hostBindingOpCodes = [];\n }\n const elementIndx = ~tNode.index;\n if (lastSelectedElementIdx(hostBindingOpCodes) != elementIndx) {\n // Conditionally add select element so that we are more efficient in execution.\n // NOTE: this is strictly not necessary and it trades code size for runtime perf.\n // (We could just always add it.)\n hostBindingOpCodes.push(elementIndx);\n }\n hostBindingOpCodes.push(directiveIdx, directiveVarsIdx, hostBindings);\n }\n}\n/**\n * Returns the last selected element index in the `HostBindingOpCodes`\n *\n * For perf reasons we don't need to update the selected element index in `HostBindingOpCodes` only\n * if it changes. This method returns the last index (or '0' if not found.)\n *\n * Selected element index are only the ones which are negative.\n */\nfunction lastSelectedElementIdx(hostBindingOpCodes) {\n let i = hostBindingOpCodes.length;\n while (i > 0) {\n const value = hostBindingOpCodes[--i];\n if (typeof value === 'number' && value < 0) {\n return value;\n }\n }\n return 0;\n}\n/**\n * Builds up an export map as directives are created, so local refs can be quickly mapped\n * to their directive instances.\n */\nfunction saveNameToExportMap(directiveIdx, def, exportsMap) {\n if (exportsMap) {\n if (def.exportAs) {\n for (let i = 0; i < def.exportAs.length; i++) {\n exportsMap[def.exportAs[i]] = directiveIdx;\n }\n }\n if (isComponentDef(def)) exportsMap[''] = directiveIdx;\n }\n}\n/**\n * Initializes the flags on the current node, setting all indices to the initial index,\n * the directive count to 0, and adding the isComponent flag.\n * @param index the initial index\n */\nfunction initTNodeFlags(tNode, index, numberOfDirectives) {\n ngDevMode && assertNotEqual(numberOfDirectives, tNode.directiveEnd - tNode.directiveStart, 'Reached the max number of directives');\n tNode.flags |= 1 /* TNodeFlags.isDirectiveHost */;\n // When the first directive is created on a node, save the index\n tNode.directiveStart = index;\n tNode.directiveEnd = index + numberOfDirectives;\n tNode.providerIndexes = index;\n}\nfunction assertNoDuplicateDirectives(directives) {\n // The array needs at least two elements in order to have duplicates.\n if (directives.length < 2) {\n return;\n }\n const seenDirectives = new Set();\n for (const current of directives) {\n if (seenDirectives.has(current)) {\n throw new RuntimeError(309 /* RuntimeErrorCode.DUPLICATE_DIRECTIVE */, `Directive ${current.type.name} matches multiple times on the same element. ` + `Directives can only match an element once.`);\n }\n seenDirectives.add(current);\n }\n}\nfunction directiveHostFirstCreatePass(index, lView, type, name, directiveMatcher, bindingsEnabled, attrsIndex, localRefsIndex) {\n const tView = lView[TVIEW];\n ngDevMode && assertFirstCreatePass(tView);\n const tViewConsts = tView.consts;\n const attrs = getConstant(tViewConsts, attrsIndex);\n const tNode = getOrCreateTNode(tView, index, type, name, attrs);\n if (bindingsEnabled) {\n resolveDirectives(tView, lView, tNode, getConstant(tViewConsts, localRefsIndex), directiveMatcher);\n }\n // Merge the template attrs last so that they have the highest priority.\n tNode.mergedAttrs = mergeHostAttrs(tNode.mergedAttrs, tNode.attrs);\n if (tNode.attrs !== null) {\n computeStaticStyling(tNode, tNode.attrs, false);\n }\n if (tNode.mergedAttrs !== null) {\n computeStaticStyling(tNode, tNode.mergedAttrs, true);\n }\n if (tView.queries !== null) {\n tView.queries.elementStart(tView, tNode);\n }\n return tNode;\n}\nfunction directiveHostEndFirstCreatePass(tView, tNode) {\n ngDevMode && assertFirstCreatePass(tView);\n registerPostOrderHooks(tView, tNode);\n if (isContentQueryHost(tNode)) {\n tView.queries.elementEnd(tNode);\n }\n}\nfunction domOnlyFirstCreatePass(index, tView, type, name, attrsIndex, localRefsIndex) {\n ngDevMode && assertFirstCreatePass(tView);\n const tViewConsts = tView.consts;\n const attrs = getConstant(tViewConsts, attrsIndex);\n const tNode = getOrCreateTNode(tView, index, type, name, attrs);\n // Merge the template attrs last so that they have the highest priority.\n tNode.mergedAttrs = mergeHostAttrs(tNode.mergedAttrs, tNode.attrs);\n if (localRefsIndex != null) {\n const refs = getConstant(tViewConsts, localRefsIndex);\n tNode.localNames = [];\n for (let i = 0; i < refs.length; i += 2) {\n // Always -1 since DOM-only instructions can only refer to the native node.\n tNode.localNames.push(refs[i], -1);\n }\n }\n if (tNode.attrs !== null) {\n computeStaticStyling(tNode, tNode.attrs, false);\n }\n if (tNode.mergedAttrs !== null) {\n computeStaticStyling(tNode, tNode.mergedAttrs, true);\n }\n if (tView.queries !== null) {\n tView.queries.elementStart(tView, tNode);\n }\n return tNode;\n}\nfunction isListLikeIterable(obj) {\n if (!isJsObject(obj)) return false;\n return Array.isArray(obj) || !(obj instanceof Map) &&\n // JS Map are iterables but return entries as [k, v]\n Symbol.iterator in obj; // JS Iterable have a Symbol.iterator prop\n}\nfunction areIterablesEqual(a, b, comparator) {\n const iterator1 = a[Symbol.iterator]();\n const iterator2 = b[Symbol.iterator]();\n while (true) {\n const item1 = iterator1.next();\n const item2 = iterator2.next();\n if (item1.done && item2.done) return true;\n if (item1.done || item2.done) return false;\n if (!comparator(item1.value, item2.value)) return false;\n }\n}\nfunction iterateListLike(obj, fn) {\n if (Array.isArray(obj)) {\n for (let i = 0; i < obj.length; i++) {\n fn(obj[i]);\n }\n } else {\n const iterator = obj[Symbol.iterator]();\n let item;\n while (!(item = iterator.next()).done) {\n fn(item.value);\n }\n }\n}\nfunction isJsObject(o) {\n return o !== null && (typeof o === 'function' || typeof o === 'object');\n}\nfunction devModeEqual(a, b) {\n const isListLikeIterableA = isListLikeIterable(a);\n const isListLikeIterableB = isListLikeIterable(b);\n if (isListLikeIterableA && isListLikeIterableB) {\n return areIterablesEqual(a, b, devModeEqual);\n } else {\n const isAObject = a && (typeof a === 'object' || typeof a === 'function');\n const isBObject = b && (typeof b === 'object' || typeof b === 'function');\n if (!isListLikeIterableA && isAObject && !isListLikeIterableB && isBObject) {\n return true;\n } else {\n return Object.is(a, b);\n }\n }\n}\n\n// TODO(misko): consider inlining\n/** Updates binding and returns the value. */\nfunction updateBinding(lView, bindingIndex, value) {\n return lView[bindingIndex] = value;\n}\n/** Gets the current binding value. */\nfunction getBinding(lView, bindingIndex) {\n ngDevMode && assertIndexInRange(lView, bindingIndex);\n ngDevMode && assertNotSame(lView[bindingIndex], NO_CHANGE, 'Stored value should never be NO_CHANGE.');\n return lView[bindingIndex];\n}\n/**\n * Updates binding if changed, then returns whether it was updated.\n *\n * This function also checks the `CheckNoChangesMode` and throws if changes are made.\n * Some changes (Objects/iterables) during `CheckNoChangesMode` are exempt to comply with VE\n * behavior.\n *\n * @param lView current `LView`\n * @param bindingIndex The binding in the `LView` to check\n * @param value New value to check against `lView[bindingIndex]`\n * @returns `true` if the bindings has changed. (Throws if binding has changed during\n * `CheckNoChangesMode`)\n */\nfunction bindingUpdated(lView, bindingIndex, value) {\n ngDevMode && assertLessThan(bindingIndex, lView.length, `Slot should have been initialized to NO_CHANGE`);\n if (value === NO_CHANGE) {\n return false;\n }\n const oldValue = lView[bindingIndex];\n if (Object.is(oldValue, value)) {\n return false;\n } else {\n if (ngDevMode && isInCheckNoChangesMode()) {\n // View engine didn't report undefined values as changed on the first checkNoChanges pass\n // (before the change detection was run).\n const oldValueToCompare = oldValue !== NO_CHANGE ? oldValue : undefined;\n if (!devModeEqual(oldValueToCompare, value)) {\n const details = getExpressionChangedErrorDetails(lView, bindingIndex, oldValueToCompare, value);\n throwErrorIfNoChangesMode(oldValue === NO_CHANGE, details.oldValue, details.newValue, details.propName, lView);\n }\n // There was a change, but the `devModeEqual` decided that the change is exempt from an error.\n // For this reason we exit as if no change. The early exit is needed to prevent the changed\n // value to be written into `LView` (If we would write the new value that we would not see it\n // as change on next CD.)\n return false;\n }\n lView[bindingIndex] = value;\n return true;\n }\n}\n/** Updates 2 bindings if changed, then returns whether either was updated. */\nfunction bindingUpdated2(lView, bindingIndex, exp1, exp2) {\n const different = bindingUpdated(lView, bindingIndex, exp1);\n return bindingUpdated(lView, bindingIndex + 1, exp2) || different;\n}\n/** Updates 3 bindings if changed, then returns whether any was updated. */\nfunction bindingUpdated3(lView, bindingIndex, exp1, exp2, exp3) {\n const different = bindingUpdated2(lView, bindingIndex, exp1, exp2);\n return bindingUpdated(lView, bindingIndex + 2, exp3) || different;\n}\n/** Updates 4 bindings if changed, then returns whether any was updated. */\nfunction bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4) {\n const different = bindingUpdated2(lView, bindingIndex, exp1, exp2);\n return bindingUpdated2(lView, bindingIndex + 2, exp3, exp4) || different;\n}\n\n/**\n * Wraps an event listener with a function that marks ancestors dirty and prevents default behavior,\n * if applicable.\n *\n * @param tNode The TNode associated with this listener\n * @param lView The LView that contains this listener\n * @param listenerFn The listener function to call\n * @param wrapWithPreventDefault Whether or not to prevent default behavior\n * (the procedural renderer does this already, so in those cases, we should skip)\n */\nfunction wrapListener(tNode, lView, listenerFn) {\n // Note: we are performing most of the work in the listener function itself\n // to optimize listener registration.\n return function wrapListenerIn_markDirtyAndPreventDefault(event) {\n // In order to be backwards compatible with View Engine, events on component host nodes\n // must also mark the component view itself dirty (i.e. the view that it owns).\n const startView = isComponentHost(tNode) ? getComponentLViewByIndex(tNode.index, lView) : lView;\n markViewDirty(startView, 5 /* NotificationSource.Listener */);\n const context = lView[CONTEXT];\n let result = executeListenerWithErrorHandling(lView, context, listenerFn, event);\n // A just-invoked listener function might have coalesced listeners so we need to check for\n // their presence and invoke as needed.\n let nextListenerFn = wrapListenerIn_markDirtyAndPreventDefault.__ngNextListenerFn__;\n while (nextListenerFn) {\n // We should prevent default if any of the listeners explicitly return false\n result = executeListenerWithErrorHandling(lView, context, nextListenerFn, event) && result;\n nextListenerFn = nextListenerFn.__ngNextListenerFn__;\n }\n return result;\n };\n}\nfunction executeListenerWithErrorHandling(lView, context, listenerFn, e) {\n const prevConsumer = setActiveConsumer$1(null);\n try {\n profiler(6 /* ProfilerEvent.OutputStart */, context, listenerFn);\n // Only explicitly returning false from a listener should preventDefault\n return listenerFn(e) !== false;\n } catch (error) {\n handleUncaughtError(lView, error);\n return false;\n } finally {\n profiler(7 /* ProfilerEvent.OutputEnd */, context, listenerFn);\n setActiveConsumer$1(prevConsumer);\n }\n}\n/**\n * Listen to a DOM event on a specific node.\n * @param tNode TNode on which to listen.\n * @param tView TView in which the node is placed.\n * @param lView LView in which the node instance is placed.\n * @param eventTargetResolver Resolver for global event targets.\n * @param renderer Renderer to use for listening to the event.\n * @param eventName Name of the event.\n * @param originalListener Original listener as it was created by the compiler. Necessary for event\n * coalescing.\n * @param wrappedListener Listener wrapped with additional logic like marking for check and error\n * handling.\n * @returns Boolean indicating whether the event was bound or was coalesced into an existing\n * listener.\n */\nfunction listenToDomEvent(tNode, tView, lView, eventTargetResolver, renderer, eventName, originalListener, wrappedListener) {\n ngDevMode && assertNotSame(wrappedListener, originalListener, 'Expected wrapped and original listeners to be different.');\n const isTNodeDirectiveHost = isDirectiveHost(tNode);\n let hasCoalesced = false;\n // In order to match current behavior, native DOM event listeners must be added for all\n // events (including outputs).\n // There might be cases where multiple directives on the same element try to register an event\n // handler function for the same event. In this situation we want to avoid registration of\n // several native listeners as each registration would be intercepted by NgZone and\n // trigger change detection. This would mean that a single user action would result in several\n // change detections being invoked. To avoid this situation we want to have only one call to\n // native handler registration (for the same element and same type of event).\n //\n // In order to have just one native event handler in presence of multiple handler functions,\n // we just register a first handler function as a native event listener and then chain\n // (coalesce) other handler functions on top of the first native handler function.\n let existingListener = null;\n // Please note that the coalescing described here doesn't happen for events specifying an\n // alternative target (ex. (document:click)) - this is to keep backward compatibility with the\n // view engine.\n // Also, we don't have to search for existing listeners if there are no directives\n // matching on a given node as we can't register multiple event handlers for the same event in\n // a template (this would mean having duplicate attributes).\n if (!eventTargetResolver && isTNodeDirectiveHost) {\n existingListener = findExistingListener(tView, lView, eventName, tNode.index);\n }\n if (existingListener !== null) {\n // Attach a new listener to coalesced listeners list, maintaining the order in which\n // listeners are registered. For performance reasons, we keep a reference to the last\n // listener in that list (in `__ngLastListenerFn__` field), so we can avoid going through\n // the entire set each time we need to add a new listener.\n const lastListenerFn = existingListener.__ngLastListenerFn__ || existingListener;\n lastListenerFn.__ngNextListenerFn__ = originalListener;\n existingListener.__ngLastListenerFn__ = originalListener;\n hasCoalesced = true;\n } else {\n const native = getNativeByTNode(tNode, lView);\n const target = eventTargetResolver ? eventTargetResolver(native) : native;\n stashEventListenerImpl(lView, target, eventName, wrappedListener);\n const cleanupFn = renderer.listen(target, eventName, wrappedListener);\n const idxOrTargetGetter = eventTargetResolver ? _lView => eventTargetResolver(unwrapRNode(_lView[tNode.index])) : tNode.index;\n storeListenerCleanup(idxOrTargetGetter, tView, lView, eventName, wrappedListener, cleanupFn, false);\n }\n return hasCoalesced;\n}\n/**\n * A utility function that checks if a given element has already an event handler registered for an\n * event with a specified name. The TView.cleanup data structure is used to find out which events\n * are registered for a given element.\n */\nfunction findExistingListener(tView, lView, eventName, tNodeIndex) {\n const tCleanup = tView.cleanup;\n if (tCleanup != null) {\n for (let i = 0; i < tCleanup.length - 1; i += 2) {\n const cleanupEventName = tCleanup[i];\n if (cleanupEventName === eventName && tCleanup[i + 1] === tNodeIndex) {\n // We have found a matching event name on the same node but it might not have been\n // registered yet, so we must explicitly verify entries in the LView cleanup data\n // structures.\n const lCleanup = lView[CLEANUP];\n const listenerIdxInLCleanup = tCleanup[i + 2];\n return lCleanup && lCleanup.length > listenerIdxInLCleanup ? lCleanup[listenerIdxInLCleanup] : null;\n }\n // TView.cleanup can have a mix of 4-elements entries (for event handler cleanups) or\n // 2-element entries (for directive and queries destroy hooks). As such we can encounter\n // blocks of 4 or 2 items in the tView.cleanup and this is why we iterate over 2 elements\n // first and jump another 2 elements if we detect listeners cleanup (4 elements). Also check\n // documentation of TView.cleanup for more details of this data structure layout.\n if (typeof cleanupEventName === 'string') {\n i += 2;\n }\n }\n }\n return null;\n}\n/**\n * Stores a cleanup function for an event listener.\n * @param indexOrTargetGetter Either the index of the TNode on which the event is bound or a\n * function that when invoked will return the event target.\n * @param tView TView in which the event is bound.\n * @param lView LView in which the event is bound.\n * @param eventName Name of the event.\n * @param listenerFn Final callback of the event.\n * @param cleanup Function to invoke during cleanup.\n * @param isOutput Whether this is an output listener or a native DOM listener.\n */\nfunction storeListenerCleanup(indexOrTargetGetter, tView, lView, eventName, listenerFn, cleanup, isOutput) {\n const tCleanup = tView.firstCreatePass ? getOrCreateTViewCleanup(tView) : null;\n const lCleanup = getOrCreateLViewCleanup(lView);\n const index = lCleanup.length;\n lCleanup.push(listenerFn, cleanup);\n tCleanup && tCleanup.push(eventName, indexOrTargetGetter, index, (index + 1) * (isOutput ? -1 : 1));\n}\nfunction createOutputListener(tNode, lView, listenerFn, targetDef, eventName) {\n // TODO(pk): decouple checks from the actual binding\n const wrappedListener = wrapListener(tNode, lView, listenerFn);\n const hasBound = listenToDirectiveOutput(tNode, lView, targetDef, eventName, wrappedListener);\n if (!hasBound && ngDevMode) {\n throw new RuntimeError(316 /* RuntimeErrorCode.INVALID_BINDING_TARGET */, `${stringifyForError(targetDef.type)} does not have an output with a public name of \"${eventName}\".`);\n }\n}\n/** Listens to an output on a specific directive. */\nfunction listenToDirectiveOutput(tNode, lView, target, eventName, listenerFn) {\n let hostIndex = null;\n let hostDirectivesStart = null;\n let hostDirectivesEnd = null;\n let hasOutput = false;\n if (ngDevMode && !tNode.directiveToIndex?.has(target.type)) {\n throw new Error(`Node does not have a directive with type ${target.type.name}`);\n }\n const data = tNode.directiveToIndex.get(target.type);\n if (typeof data === 'number') {\n hostIndex = data;\n } else {\n [hostIndex, hostDirectivesStart, hostDirectivesEnd] = data;\n }\n if (hostDirectivesStart !== null && hostDirectivesEnd !== null && tNode.hostDirectiveOutputs?.hasOwnProperty(eventName)) {\n const hostDirectiveOutputs = tNode.hostDirectiveOutputs[eventName];\n for (let i = 0; i < hostDirectiveOutputs.length; i += 2) {\n const index = hostDirectiveOutputs[i];\n if (index >= hostDirectivesStart && index <= hostDirectivesEnd) {\n ngDevMode && assertIndexInRange(lView, index);\n hasOutput = true;\n listenToOutput(tNode, lView, index, hostDirectiveOutputs[i + 1], eventName, listenerFn);\n } else if (index > hostDirectivesEnd) {\n break;\n }\n }\n }\n if (target.outputs.hasOwnProperty(eventName)) {\n ngDevMode && assertIndexInRange(lView, hostIndex);\n hasOutput = true;\n listenToOutput(tNode, lView, hostIndex, eventName, eventName, listenerFn);\n }\n return hasOutput;\n}\nfunction listenToOutput(tNode, lView, directiveIndex, lookupName, eventName, listenerFn) {\n ngDevMode && assertIndexInRange(lView, directiveIndex);\n const instance = lView[directiveIndex];\n const tView = lView[TVIEW];\n const def = tView.data[directiveIndex];\n const propertyName = def.outputs[lookupName];\n const output = instance[propertyName];\n if (ngDevMode && !isOutputSubscribable(output)) {\n throw new Error(`@Output ${propertyName} not initialized in '${instance.constructor.name}'.`);\n }\n const subscription = output.subscribe(listenerFn);\n storeListenerCleanup(tNode.index, tView, lView, eventName, listenerFn, subscription, true);\n}\n/**\n * Whether the given value represents a subscribable output.\n *\n * For example, an `EventEmitter, a `Subject`, an `Observable` or an\n * `OutputEmitter`.\n */\nfunction isOutputSubscribable(value) {\n return value != null && typeof value.subscribe === 'function';\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/** Symbol used to store and retrieve metadata about a binding. */\nconst BINDING = /* @__PURE__ */Symbol('BINDING');\n// These are constant between all the bindings so we can reuse the objects.\nconst INPUT_BINDING_METADATA = {\n kind: 'input',\n requiredVars: 1\n};\nconst OUTPUT_BINDING_METADATA = {\n kind: 'output',\n requiredVars: 0\n};\n// TODO(pk): this is a sketch of an input binding instruction that still needs some cleanups\n// - take an index of a directive on TNode (as matched), review all the index mappings that we need to do\n// - move more logic to the first creation pass\n// - move this function to under the instructions folder\nfunction inputBindingUpdate(targetDirectiveIdx, publicName, value) {\n const lView = getLView();\n const bindingIndex = nextBindingIndex();\n if (bindingUpdated(lView, bindingIndex, value)) {\n const tView = lView[TVIEW];\n const tNode = getSelectedTNode();\n const componentLView = getComponentLViewByIndex(tNode.index, lView);\n markViewDirty(componentLView, 1 /* NotificationSource.SetInput */);\n // TODO(pk): don't check on each and every binding, just assert in dev mode\n const targetDef = tView.directiveRegistry[targetDirectiveIdx];\n if (ngDevMode && !targetDef) {\n throw new RuntimeError(315 /* RuntimeErrorCode.NO_BINDING_TARGET */, `Input binding to property \"${publicName}\" does not have a target.`);\n }\n // TODO(pk): the hasSet check should be replaced by one-off check in the first creation pass\n const hasSet = setDirectiveInput(tNode, tView, lView, targetDef, publicName, value);\n if (ngDevMode) {\n if (!hasSet) {\n throw new RuntimeError(315 /* RuntimeErrorCode.NO_BINDING_TARGET */, `${stringifyForError(targetDef.type)} does not have an input with a public name of \"${publicName}\".`);\n }\n storePropertyBindingMetadata(tView.data, tNode, publicName, bindingIndex);\n }\n }\n}\n/**\n * Creates an input binding.\n * @param publicName Public name of the input to bind to.\n * @param value Callback that returns the current value for the binding. Can be either a signal or\n * a plain getter function.\n *\n * ### Usage Example\n * In this example we create an instance of the `MyButton` component and bind the value of\n * the `isDisabled` signal to its `disabled` input.\n *\n * ```\n * const isDisabled = signal(false);\n *\n * createComponent(MyButton, {\n * bindings: [inputBinding('disabled', isDisabled)]\n * });\n * ```\n */\nfunction inputBinding(publicName, value) {\n // Note: ideally we would use a class here, but it seems like they\n // don't get tree shaken when constructed by a function like this.\n const binding = {\n [BINDING]: INPUT_BINDING_METADATA,\n update: () => inputBindingUpdate(binding.targetIdx, publicName, value())\n };\n return binding;\n}\n/**\n * Creates an output binding.\n * @param eventName Public name of the output to listen to.\n * @param listener Function to be called when the output emits.\n *\n * ### Usage example\n * In this example we create an instance of the `MyCheckbox` component and listen\n * to its `onChange` event.\n *\n * ```\n * interface CheckboxChange {\n * value: string;\n * }\n *\n * createComponent(MyCheckbox, {\n * bindings: [\n * outputBinding<CheckboxChange>('onChange', event => console.log(event.value))\n * ],\n * });\n * ```\n */\nfunction outputBinding(eventName, listener) {\n // Note: ideally we would use a class here, but it seems like they\n // don't get tree shaken when constructed by a function like this.\n const binding = {\n [BINDING]: OUTPUT_BINDING_METADATA,\n create: () => {\n const lView = getLView();\n const tNode = getCurrentTNode();\n const tView = lView[TVIEW];\n const targetDef = tView.directiveRegistry[binding.targetIdx];\n createOutputListener(tNode, lView, listener, targetDef, eventName);\n }\n };\n return binding;\n}\n/**\n * Creates a two-way binding.\n * @param eventName Public name of the two-way compatible input.\n * @param value Writable signal from which to get the current value and to which to write new\n * values.\n *\n * ### Usage example\n * In this example we create an instance of the `MyCheckbox` component and bind to its `value`\n * input using a two-way binding.\n *\n * ```\n * const checkboxValue = signal('');\n *\n * createComponent(MyCheckbox, {\n * bindings: [\n * twoWayBinding('value', checkboxValue),\n * ],\n * });\n * ```\n */\nfunction twoWayBinding(publicName, value) {\n const input = inputBinding(publicName, value);\n const output = outputBinding(publicName + 'Change', eventValue => value.set(eventValue));\n // We take advantage of inputs only having a `create` block and outputs only having an `update`\n // block by passing them through directly instead of creating dedicated functions here. This\n // assumption can break down if one of them starts targeting both blocks. These assertions\n // are here to help us catch it if something changes in the future.\n ngDevMode && assertNotDefined(input.create, 'Unexpected `create` callback in inputBinding');\n ngDevMode && assertNotDefined(output.update, 'Unexpected `update` callback in outputBinding');\n const binding = {\n [BINDING]: {\n kind: 'twoWay',\n requiredVars: input[BINDING].requiredVars + output[BINDING].requiredVars\n },\n set targetIdx(idx) {\n input.targetIdx = idx;\n output.targetIdx = idx;\n },\n create: output.create,\n update: input.update\n };\n return binding;\n}\nclass ComponentFactoryResolver extends ComponentFactoryResolver$1 {\n ngModule;\n /**\n * @param ngModule The NgModuleRef to which all resolved factories are bound.\n */\n constructor(ngModule) {\n super();\n this.ngModule = ngModule;\n }\n resolveComponentFactory(component) {\n ngDevMode && assertComponentType(component);\n const componentDef = getComponentDef(component);\n return new ComponentFactory(componentDef, this.ngModule);\n }\n}\nfunction toInputRefArray(map) {\n return Object.keys(map).map(name => {\n const [propName, flags, transform] = map[name];\n const inputData = {\n propName: propName,\n templateName: name,\n isSignal: (flags & InputFlags.SignalBased) !== 0\n };\n if (transform) {\n inputData.transform = transform;\n }\n return inputData;\n });\n}\nfunction toOutputRefArray(map) {\n return Object.keys(map).map(name => ({\n propName: map[name],\n templateName: name\n }));\n}\nfunction verifyNotAnOrphanComponent(componentDef) {\n // TODO(pk): create assert that verifies ngDevMode\n if ((typeof ngJitMode === 'undefined' || ngJitMode) && componentDef.debugInfo?.forbidOrphanRendering) {\n if (depsTracker.isOrphanComponent(componentDef.type)) {\n throw new RuntimeError(981 /* RuntimeErrorCode.RUNTIME_DEPS_ORPHAN_COMPONENT */, `Orphan component found! Trying to render the component ${debugStringifyTypeForError(componentDef.type)} without first loading the NgModule that declares it. It is recommended to make this component standalone in order to avoid this error. If this is not possible now, import the component's NgModule in the appropriate NgModule, or the standalone component in which you are trying to render this component. If this is a lazy import, load the NgModule lazily as well and use its module injector.`);\n }\n }\n}\nfunction createRootViewInjector(componentDef, environmentInjector, injector) {\n let realEnvironmentInjector = environmentInjector instanceof EnvironmentInjector ? environmentInjector : environmentInjector?.injector;\n if (realEnvironmentInjector && componentDef.getStandaloneInjector !== null) {\n realEnvironmentInjector = componentDef.getStandaloneInjector(realEnvironmentInjector) || realEnvironmentInjector;\n }\n const rootViewInjector = realEnvironmentInjector ? new ChainedInjector(injector, realEnvironmentInjector) : injector;\n return rootViewInjector;\n}\nfunction createRootLViewEnvironment(rootLViewInjector) {\n const rendererFactory = rootLViewInjector.get(RendererFactory2, null);\n if (rendererFactory === null) {\n throw new RuntimeError(407 /* RuntimeErrorCode.RENDERER_NOT_FOUND */, ngDevMode && 'Angular was not able to inject a renderer (RendererFactory2). ' + 'Likely this is due to a broken DI hierarchy. ' + 'Make sure that any injector used to create this component has a correct parent.');\n }\n const sanitizer = rootLViewInjector.get(Sanitizer, null);\n const changeDetectionScheduler = rootLViewInjector.get(ChangeDetectionScheduler, null);\n let ngReflect = false;\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n ngReflect = rootLViewInjector.get(NG_REFLECT_ATTRS_FLAG, NG_REFLECT_ATTRS_FLAG_DEFAULT);\n }\n return {\n rendererFactory,\n sanitizer,\n changeDetectionScheduler,\n ngReflect\n };\n}\nfunction createHostElement(componentDef, render) {\n // Determine a tag name used for creating host elements when this component is created\n // dynamically. Default to 'div' if this component did not specify any tag name in its\n // selector.\n const tagName = (componentDef.selectors[0][0] || 'div').toLowerCase();\n const namespace = tagName === 'svg' ? SVG_NAMESPACE : tagName === 'math' ? MATH_ML_NAMESPACE : null;\n return createElementNode(render, tagName, namespace);\n}\n/**\n * ComponentFactory interface implementation.\n */\nclass ComponentFactory extends ComponentFactory$1 {\n componentDef;\n ngModule;\n selector;\n componentType;\n ngContentSelectors;\n isBoundToModule;\n cachedInputs = null;\n cachedOutputs = null;\n get inputs() {\n this.cachedInputs ??= toInputRefArray(this.componentDef.inputs);\n return this.cachedInputs;\n }\n get outputs() {\n this.cachedOutputs ??= toOutputRefArray(this.componentDef.outputs);\n return this.cachedOutputs;\n }\n /**\n * @param componentDef The component definition.\n * @param ngModule The NgModuleRef to which the factory is bound.\n */\n constructor(componentDef, ngModule) {\n super();\n this.componentDef = componentDef;\n this.ngModule = ngModule;\n this.componentType = componentDef.type;\n this.selector = stringifyCSSSelectorList(componentDef.selectors);\n this.ngContentSelectors = componentDef.ngContentSelectors ?? [];\n this.isBoundToModule = !!ngModule;\n }\n create(injector, projectableNodes, rootSelectorOrNode, environmentInjector, directives, componentBindings) {\n profiler(22 /* ProfilerEvent.DynamicComponentStart */);\n const prevConsumer = setActiveConsumer(null);\n try {\n const cmpDef = this.componentDef;\n ngDevMode && verifyNotAnOrphanComponent(cmpDef);\n const rootTView = createRootTView(rootSelectorOrNode, cmpDef, componentBindings, directives);\n const rootViewInjector = createRootViewInjector(cmpDef, environmentInjector || this.ngModule, injector);\n const environment = createRootLViewEnvironment(rootViewInjector);\n const hostRenderer = environment.rendererFactory.createRenderer(null, cmpDef);\n const hostElement = rootSelectorOrNode ? locateHostElement(hostRenderer, rootSelectorOrNode, cmpDef.encapsulation, rootViewInjector) : createHostElement(cmpDef, hostRenderer);\n const hasInputBindings = componentBindings?.some(isInputBinding) || directives?.some(d => typeof d !== 'function' && d.bindings.some(isInputBinding));\n const rootLView = createLView(null, rootTView, null, 512 /* LViewFlags.IsRoot */ | getInitialLViewFlagsFromDef(cmpDef), null, null, environment, hostRenderer, rootViewInjector, null, retrieveHydrationInfo(hostElement, rootViewInjector, true /* isRootView */));\n rootLView[HEADER_OFFSET] = hostElement;\n // rootView is the parent when bootstrapping\n // TODO(misko): it looks like we are entering view here but we don't really need to as\n // `renderView` does that. However as the code is written it is needed because\n // `createRootComponentView` and `createRootComponent` both read global state. Fixing those\n // issues would allow us to drop this.\n enterView(rootLView);\n let componentView = null;\n try {\n const hostTNode = directiveHostFirstCreatePass(HEADER_OFFSET, rootLView, 2 /* TNodeType.Element */, '#host', () => rootTView.directiveRegistry, true, 0);\n // ---- element instruction\n // TODO(crisbeto): in practice `hostElement` should always be defined, but there are some\n // tests where the renderer is mocked out and `undefined` is returned. We should update the\n // tests so that this check can be removed.\n if (hostElement) {\n setupStaticAttributes(hostRenderer, hostElement, hostTNode);\n attachPatchData(hostElement, rootLView);\n }\n // TODO(pk): this logic is similar to the instruction code where a node can have directives\n createDirectivesInstances(rootTView, rootLView, hostTNode);\n executeContentQueries(rootTView, hostTNode, rootLView);\n directiveHostEndFirstCreatePass(rootTView, hostTNode);\n if (projectableNodes !== undefined) {\n projectNodes(hostTNode, this.ngContentSelectors, projectableNodes);\n }\n componentView = getComponentLViewByIndex(hostTNode.index, rootLView);\n // TODO(pk): why do we need this logic?\n rootLView[CONTEXT] = componentView[CONTEXT];\n renderView(rootTView, rootLView, null);\n } catch (e) {\n // Stop tracking the views if creation failed since\n // the consumer won't have a way to dereference them.\n if (componentView !== null) {\n unregisterLView(componentView);\n }\n unregisterLView(rootLView);\n throw e;\n } finally {\n profiler(23 /* ProfilerEvent.DynamicComponentEnd */);\n leaveView();\n }\n return new ComponentRef(this.componentType, rootLView, !!hasInputBindings);\n } finally {\n setActiveConsumer(prevConsumer);\n }\n }\n}\nfunction createRootTView(rootSelectorOrNode, componentDef, componentBindings, directives) {\n const tAttributes = rootSelectorOrNode ? ['ng-version', '20.1.4'] :\n // Extract attributes and classes from the first selector only to match VE behavior.\n extractAttrsAndClassesFromSelector(componentDef.selectors[0]);\n let creationBindings = null;\n let updateBindings = null;\n let varsToAllocate = 0;\n if (componentBindings) {\n for (const binding of componentBindings) {\n varsToAllocate += binding[BINDING].requiredVars;\n if (binding.create) {\n binding.targetIdx = 0;\n (creationBindings ??= []).push(binding);\n }\n if (binding.update) {\n binding.targetIdx = 0;\n (updateBindings ??= []).push(binding);\n }\n }\n }\n if (directives) {\n for (let i = 0; i < directives.length; i++) {\n const directive = directives[i];\n if (typeof directive !== 'function') {\n for (const binding of directive.bindings) {\n varsToAllocate += binding[BINDING].requiredVars;\n const targetDirectiveIdx = i + 1;\n if (binding.create) {\n binding.targetIdx = targetDirectiveIdx;\n (creationBindings ??= []).push(binding);\n }\n if (binding.update) {\n binding.targetIdx = targetDirectiveIdx;\n (updateBindings ??= []).push(binding);\n }\n }\n }\n }\n }\n const directivesToApply = [componentDef];\n if (directives) {\n for (const directive of directives) {\n const directiveType = typeof directive === 'function' ? directive : directive.type;\n const directiveDef = ngDevMode ? getDirectiveDefOrThrow(directiveType) : getDirectiveDef(directiveType);\n if (ngDevMode && !directiveDef.standalone) {\n throw new RuntimeError(907 /* RuntimeErrorCode.TYPE_IS_NOT_STANDALONE */, `The ${stringifyForError(directiveType)} directive must be standalone in ` + `order to be applied to a dynamically-created component.`);\n }\n directivesToApply.push(directiveDef);\n }\n }\n const rootTView = createTView(0 /* TViewType.Root */, null, getRootTViewTemplate(creationBindings, updateBindings), 1, varsToAllocate, directivesToApply, null, null, null, [tAttributes], null);\n return rootTView;\n}\nfunction getRootTViewTemplate(creationBindings, updateBindings) {\n if (!creationBindings && !updateBindings) {\n return null;\n }\n return flags => {\n if (flags & 1 /* RenderFlags.Create */ && creationBindings) {\n for (const binding of creationBindings) {\n binding.create();\n }\n }\n if (flags & 2 /* RenderFlags.Update */ && updateBindings) {\n for (const binding of updateBindings) {\n binding.update();\n }\n }\n };\n}\nfunction isInputBinding(binding) {\n const kind = binding[BINDING].kind;\n return kind === 'input' || kind === 'twoWay';\n}\n/**\n * Represents an instance of a Component created via a {@link ComponentFactory}.\n *\n * `ComponentRef` provides access to the Component Instance as well other objects related to this\n * Component Instance and allows you to destroy the Component Instance via the {@link #destroy}\n * method.\n *\n */\nclass ComponentRef extends ComponentRef$1 {\n _rootLView;\n _hasInputBindings;\n instance;\n hostView;\n changeDetectorRef;\n componentType;\n location;\n previousInputValues = null;\n _tNode;\n constructor(componentType, _rootLView, _hasInputBindings) {\n super();\n this._rootLView = _rootLView;\n this._hasInputBindings = _hasInputBindings;\n this._tNode = getTNode(_rootLView[TVIEW], HEADER_OFFSET);\n this.location = createElementRef(this._tNode, _rootLView);\n this.instance = getComponentLViewByIndex(this._tNode.index, _rootLView)[CONTEXT];\n this.hostView = this.changeDetectorRef = new ViewRef(_rootLView, undefined /* _cdRefInjectingView */);\n this.componentType = componentType;\n }\n setInput(name, value) {\n if (this._hasInputBindings && ngDevMode) {\n throw new RuntimeError(317 /* RuntimeErrorCode.INVALID_SET_INPUT_CALL */, 'Cannot call `setInput` on a component that is using the `inputBinding` or `twoWayBinding` functions.');\n }\n const tNode = this._tNode;\n this.previousInputValues ??= new Map();\n // Do not set the input if it is the same as the last value\n // This behavior matches `bindingUpdated` when binding inputs in templates.\n if (this.previousInputValues.has(name) && Object.is(this.previousInputValues.get(name), value)) {\n return;\n }\n const lView = this._rootLView;\n const hasSetInput = setAllInputsForProperty(tNode, lView[TVIEW], lView, name, value);\n this.previousInputValues.set(name, value);\n const childComponentLView = getComponentLViewByIndex(tNode.index, lView);\n markViewDirty(childComponentLView, 1 /* NotificationSource.SetInput */);\n if (ngDevMode && !hasSetInput) {\n const cmpNameForError = stringifyForError(this.componentType);\n let message = `Can't set value of the '${name}' input on the '${cmpNameForError}' component. `;\n message += `Make sure that the '${name}' property is declared as an input using the @Input() decorator or the input() function.`;\n reportUnknownPropertyError(message);\n }\n }\n get injector() {\n return new NodeInjector(this._tNode, this._rootLView);\n }\n destroy() {\n this.hostView.destroy();\n }\n onDestroy(callback) {\n this.hostView.onDestroy(callback);\n }\n}\n/** Projects the `projectableNodes` that were specified when creating a root component. */\nfunction projectNodes(tNode, ngContentSelectors, projectableNodes) {\n const projection = tNode.projection = [];\n for (let i = 0; i < ngContentSelectors.length; i++) {\n const nodesforSlot = projectableNodes[i];\n // Projectable nodes can be passed as array of arrays or an array of iterables (ngUpgrade\n // case). Here we do normalize passed data structure to be an array of arrays to avoid\n // complex checks down the line.\n // We also normalize the length of the passed in projectable nodes (to match the number of\n // <ng-container> slots defined by a component).\n projection.push(nodesforSlot != null && nodesforSlot.length ? Array.from(nodesforSlot) : null);\n }\n}\n\n/**\n * Represents a container where one or more views can be attached to a component.\n *\n * Can contain *host views* (created by instantiating a\n * component with the `createComponent()` method), and *embedded views*\n * (created by instantiating a `TemplateRef` with the `createEmbeddedView()` method).\n *\n * A view container instance can contain other view containers,\n * creating a view hierarchy.\n *\n * @usageNotes\n *\n * The example below demonstrates how the `createComponent` function can be used\n * to create an instance of a ComponentRef dynamically and attach it to an ApplicationRef,\n * so that it gets included into change detection cycles.\n *\n * Note: the example uses standalone components, but the function can also be used for\n * non-standalone components (declared in an NgModule) as well.\n *\n * ```angular-ts\n * @Component({\n * standalone: true,\n * selector: 'dynamic',\n * template: `<span>This is a content of a dynamic component.</span>`,\n * })\n * class DynamicComponent {\n * vcr = inject(ViewContainerRef);\n * }\n *\n * @Component({\n * standalone: true,\n * selector: 'app',\n * template: `<main>Hi! This is the main content.</main>`,\n * })\n * class AppComponent {\n * vcr = inject(ViewContainerRef);\n *\n * ngAfterViewInit() {\n * const compRef = this.vcr.createComponent(DynamicComponent);\n * compRef.changeDetectorRef.detectChanges();\n * }\n * }\n * ```\n *\n * @see {@link ComponentRef}\n * @see {@link EmbeddedViewRef}\n *\n * @publicApi\n */\nclass ViewContainerRef {\n /**\n * @internal\n * @nocollapse\n */\n static __NG_ELEMENT_ID__ = injectViewContainerRef;\n}\n/**\n * Creates a ViewContainerRef and stores it on the injector. Or, if the ViewContainerRef\n * already exists, retrieves the existing ViewContainerRef.\n *\n * @returns The ViewContainerRef instance to use\n */\nfunction injectViewContainerRef() {\n const previousTNode = getCurrentTNode();\n return createContainerRef(previousTNode, getLView());\n}\nconst VE_ViewContainerRef = ViewContainerRef;\n// TODO(alxhub): cleaning up this indirection triggers a subtle bug in Closure in g3. Once the fix\n// for that lands, this can be cleaned up.\nconst R3ViewContainerRef = class ViewContainerRef extends VE_ViewContainerRef {\n _lContainer;\n _hostTNode;\n _hostLView;\n constructor(_lContainer, _hostTNode, _hostLView) {\n super();\n this._lContainer = _lContainer;\n this._hostTNode = _hostTNode;\n this._hostLView = _hostLView;\n }\n get element() {\n return createElementRef(this._hostTNode, this._hostLView);\n }\n get injector() {\n return new NodeInjector(this._hostTNode, this._hostLView);\n }\n /** @deprecated No replacement */\n get parentInjector() {\n const parentLocation = getParentInjectorLocation(this._hostTNode, this._hostLView);\n if (hasParentInjector(parentLocation)) {\n const parentView = getParentInjectorView(parentLocation, this._hostLView);\n const injectorIndex = getParentInjectorIndex(parentLocation);\n ngDevMode && assertNodeInjector(parentView, injectorIndex);\n const parentTNode = parentView[TVIEW].data[injectorIndex + 8 /* NodeInjectorOffset.TNODE */];\n return new NodeInjector(parentTNode, parentView);\n } else {\n return new NodeInjector(null, this._hostLView);\n }\n }\n clear() {\n while (this.length > 0) {\n this.remove(this.length - 1);\n }\n }\n get(index) {\n const viewRefs = getViewRefs(this._lContainer);\n return viewRefs !== null && viewRefs[index] || null;\n }\n get length() {\n return this._lContainer.length - CONTAINER_HEADER_OFFSET;\n }\n createEmbeddedView(templateRef, context, indexOrOptions) {\n let index;\n let injector;\n if (typeof indexOrOptions === 'number') {\n index = indexOrOptions;\n } else if (indexOrOptions != null) {\n index = indexOrOptions.index;\n injector = indexOrOptions.injector;\n }\n const dehydratedView = findMatchingDehydratedView(this._lContainer, templateRef.ssrId);\n const viewRef = templateRef.createEmbeddedViewImpl(context || {}, injector, dehydratedView);\n this.insertImpl(viewRef, index, shouldAddViewToDom(this._hostTNode, dehydratedView));\n return viewRef;\n }\n createComponent(componentFactoryOrType, indexOrOptions, injector, projectableNodes, environmentInjector, directives, bindings) {\n const isComponentFactory = componentFactoryOrType && !isType(componentFactoryOrType);\n let index;\n // This function supports 2 signatures and we need to handle options correctly for both:\n // 1. When first argument is a Component type. This signature also requires extra\n // options to be provided as object (more ergonomic option).\n // 2. First argument is a Component factory. In this case extra options are represented as\n // positional arguments. This signature is less ergonomic and will be deprecated.\n if (isComponentFactory) {\n if (ngDevMode) {\n assertEqual(typeof indexOrOptions !== 'object', true, 'It looks like Component factory was provided as the first argument ' + 'and an options object as the second argument. This combination of arguments ' + 'is incompatible. You can either change the first argument to provide Component ' + 'type or change the second argument to be a number (representing an index at ' + \"which to insert the new component's host view into this container)\");\n }\n index = indexOrOptions;\n } else {\n if (ngDevMode) {\n assertDefined(getComponentDef(componentFactoryOrType), `Provided Component class doesn't contain Component definition. ` + `Please check whether provided class has @Component decorator.`);\n assertEqual(typeof indexOrOptions !== 'number', true, 'It looks like Component type was provided as the first argument ' + \"and a number (representing an index at which to insert the new component's \" + 'host view into this container as the second argument. This combination of arguments ' + 'is incompatible. Please use an object as the second argument instead.');\n }\n const options = indexOrOptions || {};\n if (ngDevMode && options.environmentInjector && options.ngModuleRef) {\n throwError(`Cannot pass both environmentInjector and ngModuleRef options to createComponent().`);\n }\n index = options.index;\n injector = options.injector;\n projectableNodes = options.projectableNodes;\n environmentInjector = options.environmentInjector || options.ngModuleRef;\n directives = options.directives;\n bindings = options.bindings;\n }\n const componentFactory = isComponentFactory ? componentFactoryOrType : new ComponentFactory(getComponentDef(componentFactoryOrType));\n const contextInjector = injector || this.parentInjector;\n // If an `NgModuleRef` is not provided explicitly, try retrieving it from the DI tree.\n if (!environmentInjector && componentFactory.ngModule == null) {\n // For the `ComponentFactory` case, entering this logic is very unlikely, since we expect that\n // an instance of a `ComponentFactory`, resolved via `ComponentFactoryResolver` would have an\n // `ngModule` field. This is possible in some test scenarios and potentially in some JIT-based\n // use-cases. For the `ComponentFactory` case we preserve backwards-compatibility and try\n // using a provided injector first, then fall back to the parent injector of this\n // `ViewContainerRef` instance.\n //\n // For the factory-less case, it's critical to establish a connection with the module\n // injector tree (by retrieving an instance of an `NgModuleRef` and accessing its injector),\n // so that a component can use DI tokens provided in MgModules. For this reason, we can not\n // rely on the provided injector, since it might be detached from the DI tree (for example, if\n // it was created via `Injector.create` without specifying a parent injector, or if an\n // injector is retrieved from an `NgModuleRef` created via `createNgModule` using an\n // NgModule outside of a module tree). Instead, we always use `ViewContainerRef`'s parent\n // injector, which is normally connected to the DI tree, which includes module injector\n // subtree.\n const _injector = isComponentFactory ? contextInjector : this.parentInjector;\n // DO NOT REFACTOR. The code here used to have a `injector.get(NgModuleRef, null) ||\n // undefined` expression which seems to cause internal google apps to fail. This is documented\n // in the following internal bug issue: go/b/142967802\n const result = _injector.get(EnvironmentInjector, null);\n if (result) {\n environmentInjector = result;\n }\n }\n const componentDef = getComponentDef(componentFactory.componentType ?? {});\n const dehydratedView = findMatchingDehydratedView(this._lContainer, componentDef?.id ?? null);\n const rNode = dehydratedView?.firstChild ?? null;\n const componentRef = componentFactory.create(contextInjector, projectableNodes, rNode, environmentInjector, directives, bindings);\n this.insertImpl(componentRef.hostView, index, shouldAddViewToDom(this._hostTNode, dehydratedView));\n return componentRef;\n }\n insert(viewRef, index) {\n return this.insertImpl(viewRef, index, true);\n }\n insertImpl(viewRef, index, addToDOM) {\n const lView = viewRef._lView;\n if (ngDevMode && viewRef.destroyed) {\n throw new Error('Cannot insert a destroyed View in a ViewContainer!');\n }\n if (viewAttachedToContainer(lView)) {\n // If view is already attached, detach it first so we clean up references appropriately.\n const prevIdx = this.indexOf(viewRef);\n // A view might be attached either to this or a different container. The `prevIdx` for\n // those cases will be:\n // equal to -1 for views attached to this ViewContainerRef\n // >= 0 for views attached to a different ViewContainerRef\n if (prevIdx !== -1) {\n this.detach(prevIdx);\n } else {\n const prevLContainer = lView[PARENT];\n ngDevMode && assertEqual(isLContainer(prevLContainer), true, 'An attached view should have its PARENT point to a container.');\n // We need to re-create a R3ViewContainerRef instance since those are not stored on\n // LView (nor anywhere else).\n const prevVCRef = new R3ViewContainerRef(prevLContainer, prevLContainer[T_HOST], prevLContainer[PARENT]);\n prevVCRef.detach(prevVCRef.indexOf(viewRef));\n }\n }\n // Logical operation of adding `LView` to `LContainer`\n const adjustedIdx = this._adjustIndex(index);\n const lContainer = this._lContainer;\n addLViewToLContainer(lContainer, lView, adjustedIdx, addToDOM);\n viewRef.attachToViewContainerRef();\n addToArray(getOrCreateViewRefs(lContainer), adjustedIdx, viewRef);\n return viewRef;\n }\n move(viewRef, newIndex) {\n if (ngDevMode && viewRef.destroyed) {\n throw new Error('Cannot move a destroyed View in a ViewContainer!');\n }\n return this.insert(viewRef, newIndex);\n }\n indexOf(viewRef) {\n const viewRefsArr = getViewRefs(this._lContainer);\n return viewRefsArr !== null ? viewRefsArr.indexOf(viewRef) : -1;\n }\n remove(index) {\n const adjustedIdx = this._adjustIndex(index, -1);\n const detachedView = detachView(this._lContainer, adjustedIdx);\n if (detachedView) {\n // Before destroying the view, remove it from the container's array of `ViewRef`s.\n // This ensures the view container length is updated before calling\n // `destroyLView`, which could recursively call view container methods that\n // rely on an accurate container length.\n // (e.g. a method on this view container being called by a child directive's OnDestroy\n // lifecycle hook)\n removeFromArray(getOrCreateViewRefs(this._lContainer), adjustedIdx);\n destroyLView(detachedView[TVIEW], detachedView);\n }\n }\n detach(index) {\n const adjustedIdx = this._adjustIndex(index, -1);\n const view = detachView(this._lContainer, adjustedIdx);\n const wasDetached = view && removeFromArray(getOrCreateViewRefs(this._lContainer), adjustedIdx) != null;\n return wasDetached ? new ViewRef(view) : null;\n }\n _adjustIndex(index, shift = 0) {\n if (index == null) {\n return this.length + shift;\n }\n if (ngDevMode) {\n assertGreaterThan(index, -1, `ViewRef index must be positive, got ${index}`);\n // +1 because it's legal to insert at the end.\n assertLessThan(index, this.length + 1 + shift, 'index');\n }\n return index;\n }\n};\nfunction getViewRefs(lContainer) {\n return lContainer[VIEW_REFS];\n}\nfunction getOrCreateViewRefs(lContainer) {\n return lContainer[VIEW_REFS] || (lContainer[VIEW_REFS] = []);\n}\n/**\n * Creates a ViewContainerRef and stores it on the injector.\n *\n * @param hostTNode The node that is requesting a ViewContainerRef\n * @param hostLView The view to which the node belongs\n * @returns The ViewContainerRef instance to use\n */\nfunction createContainerRef(hostTNode, hostLView) {\n ngDevMode && assertTNodeType(hostTNode, 12 /* TNodeType.AnyContainer */ | 3 /* TNodeType.AnyRNode */);\n let lContainer;\n const slotValue = hostLView[hostTNode.index];\n if (isLContainer(slotValue)) {\n // If the host is a container, we don't need to create a new LContainer\n lContainer = slotValue;\n } else {\n // An LContainer anchor can not be `null`, but we set it here temporarily\n // and update to the actual value later in this function (see\n // `_locateOrCreateAnchorNode`).\n lContainer = createLContainer(slotValue, hostLView, null, hostTNode);\n hostLView[hostTNode.index] = lContainer;\n addToEndOfViewTree(hostLView, lContainer);\n }\n _locateOrCreateAnchorNode(lContainer, hostLView, hostTNode, slotValue);\n return new R3ViewContainerRef(lContainer, hostTNode, hostLView);\n}\n/**\n * Creates and inserts a comment node that acts as an anchor for a view container.\n *\n * If the host is a regular element, we have to insert a comment node manually which will\n * be used as an anchor when inserting elements. In this specific case we use low-level DOM\n * manipulation to insert it.\n */\nfunction insertAnchorNode(hostLView, hostTNode) {\n const renderer = hostLView[RENDERER];\n const commentNode = renderer.createComment(ngDevMode ? 'container' : '');\n const hostNative = getNativeByTNode(hostTNode, hostLView);\n const parentOfHostNative = renderer.parentNode(hostNative);\n nativeInsertBefore(renderer, parentOfHostNative, commentNode, renderer.nextSibling(hostNative), false);\n return commentNode;\n}\nlet _locateOrCreateAnchorNode = createAnchorNode;\nlet _populateDehydratedViewsInLContainer = () => false; // noop by default\n/**\n * Looks up dehydrated views that belong to a given LContainer and populates\n * this information into the `LContainer[DEHYDRATED_VIEWS]` slot. When running\n * in client-only mode, this function is a noop.\n *\n * @param lContainer LContainer that should be populated.\n * @param tNode Corresponding TNode.\n * @param hostLView LView that hosts LContainer.\n * @returns a boolean flag that indicates whether a populating operation\n * was successful. The operation might be unsuccessful in case is has completed\n * previously, we are rendering in client-only mode or this content is located\n * in a skip hydration section.\n */\nfunction populateDehydratedViewsInLContainer(lContainer, tNode, hostLView) {\n return _populateDehydratedViewsInLContainer(lContainer, tNode, hostLView);\n}\n/**\n * Regular creation mode: an anchor is created and\n * assigned to the `lContainer[NATIVE]` slot.\n */\nfunction createAnchorNode(lContainer, hostLView, hostTNode, slotValue) {\n // We already have a native element (anchor) set, return.\n if (lContainer[NATIVE]) return;\n let commentNode;\n // If the host is an element container, the native host element is guaranteed to be a\n // comment and we can reuse that comment as anchor element for the new LContainer.\n // The comment node in question is already part of the DOM structure so we don't need to append\n // it again.\n if (hostTNode.type & 8 /* TNodeType.ElementContainer */) {\n commentNode = unwrapRNode(slotValue);\n } else {\n commentNode = insertAnchorNode(hostLView, hostTNode);\n }\n lContainer[NATIVE] = commentNode;\n}\n/**\n * Hydration logic that looks up all dehydrated views in this container\n * and puts them into `lContainer[DEHYDRATED_VIEWS]` slot.\n *\n * @returns a boolean flag that indicates whether a populating operation\n * was successful. The operation might be unsuccessful in case is has completed\n * previously, we are rendering in client-only mode or this content is located\n * in a skip hydration section.\n */\nfunction populateDehydratedViewsInLContainerImpl(lContainer, tNode, hostLView) {\n // We already have a native element (anchor) set and the process\n // of finding dehydrated views happened (so the `lContainer[DEHYDRATED_VIEWS]`\n // is not null), exit early.\n if (lContainer[NATIVE] && lContainer[DEHYDRATED_VIEWS]) {\n return true;\n }\n const hydrationInfo = hostLView[HYDRATION];\n const noOffsetIndex = tNode.index - HEADER_OFFSET;\n const isNodeCreationMode = !hydrationInfo || isInSkipHydrationBlock(tNode) || isDisconnectedNode$1(hydrationInfo, noOffsetIndex);\n // Regular creation mode.\n if (isNodeCreationMode) {\n return false;\n }\n // Hydration mode, looking up an anchor node and dehydrated views in DOM.\n const currentRNode = getSegmentHead(hydrationInfo, noOffsetIndex);\n const serializedViews = hydrationInfo.data[CONTAINERS]?.[noOffsetIndex];\n ngDevMode && assertDefined(serializedViews, 'Unexpected state: no hydration info available for a given TNode, ' + 'which represents a view container.');\n const [commentNode, dehydratedViews] = locateDehydratedViewsInContainer(currentRNode, serializedViews);\n if (ngDevMode) {\n validateMatchingNode(commentNode, Node.COMMENT_NODE, null, hostLView, tNode, true);\n // Do not throw in case this node is already claimed (thus `false` as a second\n // argument). If this container is created based on an `<ng-template>`, the comment\n // node would be already claimed from the `template` instruction. If an element acts\n // as an anchor (e.g. <div #vcRef>), a separate comment node would be created/located,\n // so we need to claim it here.\n markRNodeAsClaimedByHydration(commentNode, false);\n }\n lContainer[NATIVE] = commentNode;\n lContainer[DEHYDRATED_VIEWS] = dehydratedViews;\n return true;\n}\nfunction locateOrCreateAnchorNode(lContainer, hostLView, hostTNode, slotValue) {\n if (!_populateDehydratedViewsInLContainer(lContainer, hostTNode, hostLView)) {\n // Populating dehydrated views operation returned `false`, which indicates\n // that the logic was running in client-only mode, this an anchor comment\n // node should be created for this container.\n createAnchorNode(lContainer, hostLView, hostTNode, slotValue);\n }\n}\nfunction enableLocateOrCreateContainerRefImpl() {\n _locateOrCreateAnchorNode = locateOrCreateAnchorNode;\n _populateDehydratedViewsInLContainer = populateDehydratedViewsInLContainerImpl;\n}\nclass LQuery_ {\n queryList;\n matches = null;\n constructor(queryList) {\n this.queryList = queryList;\n }\n clone() {\n return new LQuery_(this.queryList);\n }\n setDirty() {\n this.queryList.setDirty();\n }\n}\nclass LQueries_ {\n queries;\n constructor(queries = []) {\n this.queries = queries;\n }\n createEmbeddedView(tView) {\n const tQueries = tView.queries;\n if (tQueries !== null) {\n const noOfInheritedQueries = tView.contentQueries !== null ? tView.contentQueries[0] : tQueries.length;\n const viewLQueries = [];\n // An embedded view has queries propagated from a declaration view at the beginning of the\n // TQueries collection and up until a first content query declared in the embedded view. Only\n // propagated LQueries are created at this point (LQuery corresponding to declared content\n // queries will be instantiated from the content query instructions for each directive).\n for (let i = 0; i < noOfInheritedQueries; i++) {\n const tQuery = tQueries.getByIndex(i);\n const parentLQuery = this.queries[tQuery.indexInDeclarationView];\n viewLQueries.push(parentLQuery.clone());\n }\n return new LQueries_(viewLQueries);\n }\n return null;\n }\n insertView(tView) {\n this.dirtyQueriesWithMatches(tView);\n }\n detachView(tView) {\n this.dirtyQueriesWithMatches(tView);\n }\n finishViewCreation(tView) {\n this.dirtyQueriesWithMatches(tView);\n }\n dirtyQueriesWithMatches(tView) {\n for (let i = 0; i < this.queries.length; i++) {\n if (getTQuery(tView, i).matches !== null) {\n this.queries[i].setDirty();\n }\n }\n }\n}\nclass TQueryMetadata_ {\n flags;\n read;\n predicate;\n constructor(predicate, flags, read = null) {\n this.flags = flags;\n this.read = read;\n // Compiler might not be able to pre-optimize and split multiple selectors.\n if (typeof predicate === 'string') {\n this.predicate = splitQueryMultiSelectors(predicate);\n } else {\n this.predicate = predicate;\n }\n }\n}\nclass TQueries_ {\n queries;\n constructor(queries = []) {\n this.queries = queries;\n }\n elementStart(tView, tNode) {\n ngDevMode && assertFirstCreatePass(tView, 'Queries should collect results on the first template pass only');\n for (let i = 0; i < this.queries.length; i++) {\n this.queries[i].elementStart(tView, tNode);\n }\n }\n elementEnd(tNode) {\n for (let i = 0; i < this.queries.length; i++) {\n this.queries[i].elementEnd(tNode);\n }\n }\n embeddedTView(tNode) {\n let queriesForTemplateRef = null;\n for (let i = 0; i < this.length; i++) {\n const childQueryIndex = queriesForTemplateRef !== null ? queriesForTemplateRef.length : 0;\n const tqueryClone = this.getByIndex(i).embeddedTView(tNode, childQueryIndex);\n if (tqueryClone) {\n tqueryClone.indexInDeclarationView = i;\n if (queriesForTemplateRef !== null) {\n queriesForTemplateRef.push(tqueryClone);\n } else {\n queriesForTemplateRef = [tqueryClone];\n }\n }\n }\n return queriesForTemplateRef !== null ? new TQueries_(queriesForTemplateRef) : null;\n }\n template(tView, tNode) {\n ngDevMode && assertFirstCreatePass(tView, 'Queries should collect results on the first template pass only');\n for (let i = 0; i < this.queries.length; i++) {\n this.queries[i].template(tView, tNode);\n }\n }\n getByIndex(index) {\n ngDevMode && assertIndexInRange(this.queries, index);\n return this.queries[index];\n }\n get length() {\n return this.queries.length;\n }\n track(tquery) {\n this.queries.push(tquery);\n }\n}\nclass TQuery_ {\n metadata;\n matches = null;\n indexInDeclarationView = -1;\n crossesNgTemplate = false;\n /**\n * A node index on which a query was declared (-1 for view queries and ones inherited from the\n * declaration template). We use this index (alongside with _appliesToNextNode flag) to know\n * when to apply content queries to elements in a template.\n */\n _declarationNodeIndex;\n /**\n * A flag indicating if a given query still applies to nodes it is crossing. We use this flag\n * (alongside with _declarationNodeIndex) to know when to stop applying content queries to\n * elements in a template.\n */\n _appliesToNextNode = true;\n constructor(metadata, nodeIndex = -1) {\n this.metadata = metadata;\n this._declarationNodeIndex = nodeIndex;\n }\n elementStart(tView, tNode) {\n if (this.isApplyingToNode(tNode)) {\n this.matchTNode(tView, tNode);\n }\n }\n elementEnd(tNode) {\n if (this._declarationNodeIndex === tNode.index) {\n this._appliesToNextNode = false;\n }\n }\n template(tView, tNode) {\n this.elementStart(tView, tNode);\n }\n embeddedTView(tNode, childQueryIndex) {\n if (this.isApplyingToNode(tNode)) {\n this.crossesNgTemplate = true;\n // A marker indicating a `<ng-template>` element (a placeholder for query results from\n // embedded views created based on this `<ng-template>`).\n this.addMatch(-tNode.index, childQueryIndex);\n return new TQuery_(this.metadata);\n }\n return null;\n }\n isApplyingToNode(tNode) {\n if (this._appliesToNextNode && (this.metadata.flags & 1 /* QueryFlags.descendants */) !== 1 /* QueryFlags.descendants */) {\n const declarationNodeIdx = this._declarationNodeIndex;\n let parent = tNode.parent;\n // Determine if a given TNode is a \"direct\" child of a node on which a content query was\n // declared (only direct children of query's host node can match with the descendants: false\n // option). There are 3 main use-case / conditions to consider here:\n // - <needs-target><i #target></i></needs-target>: here <i #target> parent node is a query\n // host node;\n // - <needs-target><ng-template [ngIf]=\"true\"><i #target></i></ng-template></needs-target>:\n // here <i #target> parent node is null;\n // - <needs-target><ng-container><i #target></i></ng-container></needs-target>: here we need\n // to go past `<ng-container>` to determine <i #target> parent node (but we shouldn't traverse\n // up past the query's host node!).\n while (parent !== null && parent.type & 8 /* TNodeType.ElementContainer */ && parent.index !== declarationNodeIdx) {\n parent = parent.parent;\n }\n return declarationNodeIdx === (parent !== null ? parent.index : -1);\n }\n return this._appliesToNextNode;\n }\n matchTNode(tView, tNode) {\n const predicate = this.metadata.predicate;\n if (Array.isArray(predicate)) {\n for (let i = 0; i < predicate.length; i++) {\n const name = predicate[i];\n this.matchTNodeWithReadOption(tView, tNode, getIdxOfMatchingSelector(tNode, name));\n // Also try matching the name to a provider since strings can be used as DI tokens too.\n this.matchTNodeWithReadOption(tView, tNode, locateDirectiveOrProvider(tNode, tView, name, false, false));\n }\n } else {\n if (predicate === TemplateRef) {\n if (tNode.type & 4 /* TNodeType.Container */) {\n this.matchTNodeWithReadOption(tView, tNode, -1);\n }\n } else {\n this.matchTNodeWithReadOption(tView, tNode, locateDirectiveOrProvider(tNode, tView, predicate, false, false));\n }\n }\n }\n matchTNodeWithReadOption(tView, tNode, nodeMatchIdx) {\n if (nodeMatchIdx !== null) {\n const read = this.metadata.read;\n if (read !== null) {\n if (read === ElementRef || read === ViewContainerRef || read === TemplateRef && tNode.type & 4 /* TNodeType.Container */) {\n this.addMatch(tNode.index, -2);\n } else {\n const directiveOrProviderIdx = locateDirectiveOrProvider(tNode, tView, read, false, false);\n if (directiveOrProviderIdx !== null) {\n this.addMatch(tNode.index, directiveOrProviderIdx);\n }\n }\n } else {\n this.addMatch(tNode.index, nodeMatchIdx);\n }\n }\n }\n addMatch(tNodeIdx, matchIdx) {\n if (this.matches === null) {\n this.matches = [tNodeIdx, matchIdx];\n } else {\n this.matches.push(tNodeIdx, matchIdx);\n }\n }\n}\n/**\n * Iterates over local names for a given node and returns directive index\n * (or -1 if a local name points to an element).\n *\n * @param tNode static data of a node to check\n * @param selector selector to match\n * @returns directive index, -1 or null if a selector didn't match any of the local names\n */\nfunction getIdxOfMatchingSelector(tNode, selector) {\n const localNames = tNode.localNames;\n if (localNames !== null) {\n for (let i = 0; i < localNames.length; i += 2) {\n if (localNames[i] === selector) {\n return localNames[i + 1];\n }\n }\n }\n return null;\n}\nfunction createResultByTNodeType(tNode, currentView) {\n if (tNode.type & (3 /* TNodeType.AnyRNode */ | 8 /* TNodeType.ElementContainer */)) {\n return createElementRef(tNode, currentView);\n } else if (tNode.type & 4 /* TNodeType.Container */) {\n return createTemplateRef(tNode, currentView);\n }\n return null;\n}\nfunction createResultForNode(lView, tNode, matchingIdx, read) {\n if (matchingIdx === -1) {\n // if read token and / or strategy is not specified, detect it using appropriate tNode type\n return createResultByTNodeType(tNode, lView);\n } else if (matchingIdx === -2) {\n // read a special token from a node injector\n return createSpecialToken(lView, tNode, read);\n } else {\n // read a token\n return getNodeInjectable(lView, lView[TVIEW], matchingIdx, tNode);\n }\n}\nfunction createSpecialToken(lView, tNode, read) {\n if (read === ElementRef) {\n return createElementRef(tNode, lView);\n } else if (read === TemplateRef) {\n return createTemplateRef(tNode, lView);\n } else if (read === ViewContainerRef) {\n ngDevMode && assertTNodeType(tNode, 3 /* TNodeType.AnyRNode */ | 12 /* TNodeType.AnyContainer */);\n return createContainerRef(tNode, lView);\n } else {\n ngDevMode && throwError(`Special token to read should be one of ElementRef, TemplateRef or ViewContainerRef but got ${stringify(read)}.`);\n }\n}\n/**\n * A helper function that creates query results for a given view. This function is meant to do the\n * processing once and only once for a given view instance (a set of results for a given view\n * doesn't change).\n */\nfunction materializeViewResults(tView, lView, tQuery, queryIndex) {\n const lQuery = lView[QUERIES].queries[queryIndex];\n if (lQuery.matches === null) {\n const tViewData = tView.data;\n const tQueryMatches = tQuery.matches;\n const result = [];\n for (let i = 0; tQueryMatches !== null && i < tQueryMatches.length; i += 2) {\n const matchedNodeIdx = tQueryMatches[i];\n if (matchedNodeIdx < 0) {\n // we at the <ng-template> marker which might have results in views created based on this\n // <ng-template> - those results will be in separate views though, so here we just leave\n // null as a placeholder\n result.push(null);\n } else {\n ngDevMode && assertIndexInRange(tViewData, matchedNodeIdx);\n const tNode = tViewData[matchedNodeIdx];\n result.push(createResultForNode(lView, tNode, tQueryMatches[i + 1], tQuery.metadata.read));\n }\n }\n lQuery.matches = result;\n }\n return lQuery.matches;\n}\n/**\n * A helper function that collects (already materialized) query results from a tree of views,\n * starting with a provided LView.\n */\nfunction collectQueryResults(tView, lView, queryIndex, result) {\n const tQuery = tView.queries.getByIndex(queryIndex);\n const tQueryMatches = tQuery.matches;\n if (tQueryMatches !== null) {\n const lViewResults = materializeViewResults(tView, lView, tQuery, queryIndex);\n for (let i = 0; i < tQueryMatches.length; i += 2) {\n const tNodeIdx = tQueryMatches[i];\n if (tNodeIdx > 0) {\n result.push(lViewResults[i / 2]);\n } else {\n const childQueryIndex = tQueryMatches[i + 1];\n const declarationLContainer = lView[-tNodeIdx];\n ngDevMode && assertLContainer(declarationLContainer);\n // collect matches for views inserted in this container\n for (let i = CONTAINER_HEADER_OFFSET; i < declarationLContainer.length; i++) {\n const embeddedLView = declarationLContainer[i];\n if (embeddedLView[DECLARATION_LCONTAINER] === embeddedLView[PARENT]) {\n collectQueryResults(embeddedLView[TVIEW], embeddedLView, childQueryIndex, result);\n }\n }\n // collect matches for views created from this declaration container and inserted into\n // different containers\n if (declarationLContainer[MOVED_VIEWS] !== null) {\n const embeddedLViews = declarationLContainer[MOVED_VIEWS];\n for (let i = 0; i < embeddedLViews.length; i++) {\n const embeddedLView = embeddedLViews[i];\n collectQueryResults(embeddedLView[TVIEW], embeddedLView, childQueryIndex, result);\n }\n }\n }\n }\n }\n return result;\n}\nfunction loadQueryInternal(lView, queryIndex) {\n ngDevMode && assertDefined(lView[QUERIES], 'LQueries should be defined when trying to load a query');\n ngDevMode && assertIndexInRange(lView[QUERIES].queries, queryIndex);\n return lView[QUERIES].queries[queryIndex].queryList;\n}\n/**\n * Creates a new instance of LQuery and returns its index in the collection of LQuery objects.\n *\n * @returns index in the collection of LQuery objects\n */\nfunction createLQuery(tView, lView, flags) {\n const queryList = new QueryList((flags & 4 /* QueryFlags.emitDistinctChangesOnly */) === 4 /* QueryFlags.emitDistinctChangesOnly */);\n storeCleanupWithContext(tView, lView, queryList, queryList.destroy);\n const lQueries = (lView[QUERIES] ??= new LQueries_()).queries;\n return lQueries.push(new LQuery_(queryList)) - 1;\n}\nfunction createViewQuery(predicate, flags, read) {\n ngDevMode && assertNumber(flags, 'Expecting flags');\n const tView = getTView();\n if (tView.firstCreatePass) {\n createTQuery(tView, new TQueryMetadata_(predicate, flags, read), -1);\n if ((flags & 2 /* QueryFlags.isStatic */) === 2 /* QueryFlags.isStatic */) {\n tView.staticViewQueries = true;\n }\n }\n return createLQuery(tView, getLView(), flags);\n}\nfunction createContentQuery(directiveIndex, predicate, flags, read) {\n ngDevMode && assertNumber(flags, 'Expecting flags');\n const tView = getTView();\n if (tView.firstCreatePass) {\n const tNode = getCurrentTNode();\n createTQuery(tView, new TQueryMetadata_(predicate, flags, read), tNode.index);\n saveContentQueryAndDirectiveIndex(tView, directiveIndex);\n if ((flags & 2 /* QueryFlags.isStatic */) === 2 /* QueryFlags.isStatic */) {\n tView.staticContentQueries = true;\n }\n }\n return createLQuery(tView, getLView(), flags);\n}\n/** Splits multiple selectors in the locator. */\nfunction splitQueryMultiSelectors(locator) {\n return locator.split(',').map(s => s.trim());\n}\nfunction createTQuery(tView, metadata, nodeIndex) {\n if (tView.queries === null) tView.queries = new TQueries_();\n tView.queries.track(new TQuery_(metadata, nodeIndex));\n}\nfunction saveContentQueryAndDirectiveIndex(tView, directiveIndex) {\n const tViewContentQueries = tView.contentQueries || (tView.contentQueries = []);\n const lastSavedDirectiveIndex = tViewContentQueries.length ? tViewContentQueries[tViewContentQueries.length - 1] : -1;\n if (directiveIndex !== lastSavedDirectiveIndex) {\n tViewContentQueries.push(tView.queries.length - 1, directiveIndex);\n }\n}\nfunction getTQuery(tView, index) {\n ngDevMode && assertDefined(tView.queries, 'TQueries must be defined to retrieve a TQuery');\n return tView.queries.getByIndex(index);\n}\n/**\n * A helper function collecting results from all the views where a given query was active.\n * @param lView\n * @param queryIndex\n */\nfunction getQueryResults(lView, queryIndex) {\n const tView = lView[TVIEW];\n const tQuery = getTQuery(tView, queryIndex);\n return tQuery.crossesNgTemplate ? collectQueryResults(tView, lView, queryIndex, []) : materializeViewResults(tView, lView, tQuery, queryIndex);\n}\n\n/**\n * A signal factory function in charge of creating a new computed signal capturing query\n * results. This centralized creation function is used by all types of queries (child / children,\n * required / optional).\n *\n * @param firstOnly indicates if all or only the first result should be returned\n * @param required indicates if at least one result is required\n * @returns a read-only signal with query results\n */\nfunction createQuerySignalFn(firstOnly, required, opts) {\n let node;\n const signalFn = createComputed(() => {\n // A dedicated signal that increments its value every time a query changes its dirty status. By\n // using this signal we can implement a query as computed and avoid creation of a specialized\n // reactive node type. Please note that a query gets marked dirty under the following\n // circumstances:\n // - a view (where a query is active) finished its first creation pass;\n // - a new view is inserted / deleted and it impacts query results.\n node._dirtyCounter();\n const value = refreshSignalQuery(node, firstOnly);\n if (required && value === undefined) {\n throw new RuntimeError(-951 /* RuntimeErrorCode.REQUIRED_QUERY_NO_VALUE */, ngDevMode && 'Child query result is required but no value is available.');\n }\n return value;\n });\n node = signalFn[SIGNAL];\n node._dirtyCounter = signal(0);\n node._flatValue = undefined;\n if (ngDevMode) {\n signalFn.toString = () => `[Query Signal]`;\n node.debugName = opts?.debugName;\n }\n return signalFn;\n}\nfunction createSingleResultOptionalQuerySignalFn(opts) {\n return createQuerySignalFn(/* firstOnly */true, /* required */false, opts);\n}\nfunction createSingleResultRequiredQuerySignalFn(opts) {\n return createQuerySignalFn(/* firstOnly */true, /* required */true, opts);\n}\nfunction createMultiResultQuerySignalFn(opts) {\n return createQuerySignalFn(/* firstOnly */false, /* required */false, opts);\n}\nfunction bindQueryToSignal(target, queryIndex) {\n const node = target[SIGNAL];\n node._lView = getLView();\n node._queryIndex = queryIndex;\n node._queryList = loadQueryInternal(node._lView, queryIndex);\n node._queryList.onDirty(() => node._dirtyCounter.update(v => v + 1));\n}\nfunction refreshSignalQuery(node, firstOnly) {\n const lView = node._lView;\n const queryIndex = node._queryIndex;\n // There are 2 conditions under which we want to return \"empty\" results instead of the ones\n // collected by a query:\n //\n // 1) a given query wasn't created yet (this is a period of time between the directive creation\n // and execution of the query creation function) - in this case a query doesn't exist yet and we\n // don't have any results to return.\n //\n // 2) we are in the process of constructing a view (the first\n // creation pass didn't finish) and a query might have partial results, but we don't want to\n // return those - instead we do delay results collection until all nodes had a chance of matching\n // and we can present consistent, \"atomic\" (on a view level) results.\n if (lView === undefined || queryIndex === undefined || lView[FLAGS] & 4 /* LViewFlags.CreationMode */) {\n return firstOnly ? undefined : EMPTY_ARRAY;\n }\n const queryList = loadQueryInternal(lView, queryIndex);\n const results = getQueryResults(lView, queryIndex);\n queryList.reset(results, unwrapElementRef);\n if (firstOnly) {\n return queryList.first;\n } else {\n // TODO: remove access to the private _changesDetected field by abstracting / removing usage of\n // QueryList in the signal-based queries (perf follow-up)\n const resultChanged = queryList._changesDetected;\n if (resultChanged || node._flatValue === undefined) {\n return node._flatValue = queryList.toArray();\n }\n return node._flatValue;\n }\n}\n\n/**\n * Used to resolve resource URLs on `@Component` when used with JIT compilation.\n *\n * Example:\n * ```ts\n * @Component({\n * selector: 'my-comp',\n * templateUrl: 'my-comp.html', // This requires asynchronous resolution\n * })\n * class MyComponent{\n * }\n *\n * // Calling `renderComponent` will fail because `renderComponent` is a synchronous process\n * // and `MyComponent`'s `@Component.templateUrl` needs to be resolved asynchronously.\n *\n * // Calling `resolveComponentResources()` will resolve `@Component.templateUrl` into\n * // `@Component.template`, which allows `renderComponent` to proceed in a synchronous manner.\n *\n * // Use browser's `fetch()` function as the default resource resolution strategy.\n * resolveComponentResources(fetch).then(() => {\n * // After resolution all URLs have been converted into `template` strings.\n * renderComponent(MyComponent);\n * });\n *\n * ```\n *\n * NOTE: In AOT the resolution happens during compilation, and so there should be no need\n * to call this method outside JIT mode.\n *\n * @param resourceResolver a function which is responsible for returning a `Promise` to the\n * contents of the resolved URL. Browser's `fetch()` method is a good default implementation.\n */\nfunction resolveComponentResources(resourceResolver) {\n // Store all promises which are fetching the resources.\n const componentResolved = [];\n // Cache so that we don't fetch the same resource more than once.\n const urlMap = new Map();\n function cachedResourceResolve(url) {\n let promise = urlMap.get(url);\n if (!promise) {\n const resp = resourceResolver(url);\n urlMap.set(url, promise = resp.then(unwrapResponse));\n }\n return promise;\n }\n componentResourceResolutionQueue.forEach((component, type) => {\n const promises = [];\n if (component.templateUrl) {\n promises.push(cachedResourceResolve(component.templateUrl).then(template => {\n component.template = template;\n }));\n }\n const styles = typeof component.styles === 'string' ? [component.styles] : component.styles || [];\n component.styles = styles;\n if (component.styleUrl && component.styleUrls?.length) {\n throw new Error('@Component cannot define both `styleUrl` and `styleUrls`. ' + 'Use `styleUrl` if the component has one stylesheet, or `styleUrls` if it has multiple');\n } else if (component.styleUrls?.length) {\n const styleOffset = component.styles.length;\n const styleUrls = component.styleUrls;\n component.styleUrls.forEach((styleUrl, index) => {\n styles.push(''); // pre-allocate array.\n promises.push(cachedResourceResolve(styleUrl).then(style => {\n styles[styleOffset + index] = style;\n styleUrls.splice(styleUrls.indexOf(styleUrl), 1);\n if (styleUrls.length == 0) {\n component.styleUrls = undefined;\n }\n }));\n });\n } else if (component.styleUrl) {\n promises.push(cachedResourceResolve(component.styleUrl).then(style => {\n styles.push(style);\n component.styleUrl = undefined;\n }));\n }\n const fullyResolved = Promise.all(promises).then(() => componentDefResolved(type));\n componentResolved.push(fullyResolved);\n });\n clearResolutionOfComponentResourcesQueue();\n return Promise.all(componentResolved).then(() => undefined);\n}\nlet componentResourceResolutionQueue = new Map();\n// Track when existing ɵcmp for a Type is waiting on resources.\nconst componentDefPendingResolution = new Set();\nfunction maybeQueueResolutionOfComponentResources(type, metadata) {\n if (componentNeedsResolution(metadata)) {\n componentResourceResolutionQueue.set(type, metadata);\n componentDefPendingResolution.add(type);\n }\n}\nfunction isComponentDefPendingResolution(type) {\n return componentDefPendingResolution.has(type);\n}\nfunction componentNeedsResolution(component) {\n return !!(component.templateUrl && !component.hasOwnProperty('template') || component.styleUrls && component.styleUrls.length || component.styleUrl);\n}\nfunction clearResolutionOfComponentResourcesQueue() {\n const old = componentResourceResolutionQueue;\n componentResourceResolutionQueue = new Map();\n return old;\n}\nfunction restoreComponentResolutionQueue(queue) {\n componentDefPendingResolution.clear();\n queue.forEach((_, type) => componentDefPendingResolution.add(type));\n componentResourceResolutionQueue = queue;\n}\nfunction isComponentResourceResolutionQueueEmpty() {\n return componentResourceResolutionQueue.size === 0;\n}\nfunction unwrapResponse(response) {\n return typeof response == 'string' ? response : response.text();\n}\nfunction componentDefResolved(type) {\n componentDefPendingResolution.delete(type);\n}\n\n/**\n * Map of module-id to the corresponding NgModule.\n */\nconst modules = new Map();\n/**\n * Whether to check for duplicate NgModule registrations.\n *\n * This can be disabled for testing.\n */\nlet checkForDuplicateNgModules = true;\nfunction assertSameOrNotExisting(id, type, incoming) {\n if (type && type !== incoming && checkForDuplicateNgModules) {\n throw new Error(`Duplicate module registered for ${id} - ${stringify(type)} vs ${stringify(type.name)}`);\n }\n}\n/**\n * Adds the given NgModule type to Angular's NgModule registry.\n *\n * This is generated as a side-effect of NgModule compilation. Note that the `id` is passed in\n * explicitly and not read from the NgModule definition. This is for two reasons: it avoids a\n * megamorphic read, and in JIT there's a chicken-and-egg problem where the NgModule may not be\n * fully resolved when it's registered.\n *\n * @codeGenApi\n */\nfunction registerNgModuleType(ngModuleType, id) {\n const existing = modules.get(id) || null;\n assertSameOrNotExisting(id, existing, ngModuleType);\n modules.set(id, ngModuleType);\n}\nfunction getRegisteredNgModuleType(id) {\n return modules.get(id);\n}\n/**\n * Control whether the NgModule registration system enforces that each NgModule type registered has\n * a unique id.\n *\n * This is useful for testing as the NgModule registry cannot be properly reset between tests with\n * Angular's current API.\n */\nfunction setAllowDuplicateNgModuleIdsForTest(allowDuplicates) {\n checkForDuplicateNgModules = !allowDuplicates;\n}\n\n/**\n * Validation function invoked at runtime for each binding that might potentially\n * represent a security-sensitive attribute of an <iframe>.\n * See `IFRAME_SECURITY_SENSITIVE_ATTRS` in the\n * `packages/compiler/src/schema/dom_security_schema.ts` script for the full list\n * of such attributes.\n *\n * @codeGenApi\n */\nfunction ɵɵvalidateIframeAttribute(attrValue, tagName, attrName) {\n const lView = getLView();\n const tNode = getSelectedTNode();\n const element = getNativeByTNode(tNode, lView);\n // Restrict any dynamic bindings of security-sensitive attributes/properties\n // on an <iframe> for security reasons.\n if (tNode.type === 2 /* TNodeType.Element */ && tagName.toLowerCase() === 'iframe') {\n const iframe = element;\n // Unset previously applied `src` and `srcdoc` if we come across a situation when\n // a security-sensitive attribute is set later via an attribute/property binding.\n iframe.src = '';\n iframe.srcdoc = trustedHTMLFromString('');\n // Also remove the <iframe> from the document.\n nativeRemoveNode(lView[RENDERER], iframe);\n const errorMessage = ngDevMode && `Angular has detected that the \\`${attrName}\\` was applied ` + `as a binding to an <iframe>${getTemplateLocationDetails(lView)}. ` + `For security reasons, the \\`${attrName}\\` can be set on an <iframe> ` + `as a static attribute only. \\n` + `To fix this, switch the \\`${attrName}\\` binding to a static attribute ` + `in a template or in host bindings section.`;\n throw new RuntimeError(-910 /* RuntimeErrorCode.UNSAFE_IFRAME_ATTRS */, errorMessage);\n }\n return attrValue;\n}\nconst markedFeatures = new Set();\n// tslint:disable:ban\n/**\n * A guarded `performance.mark` for feature marking.\n *\n * This method exists because while all supported browser and node.js version supported by Angular\n * support performance.mark API. This is not the case for other environments such as JSDOM and\n * Cloudflare workers.\n */\nfunction performanceMarkFeature(feature) {\n if (markedFeatures.has(feature)) {\n return;\n }\n markedFeatures.add(feature);\n performance?.mark?.('mark_feature_usage', {\n detail: {\n feature\n }\n });\n}\n\n/**\n * Represents an instance of an `NgModule` created by an `NgModuleFactory`.\n * Provides access to the `NgModule` instance and related objects.\n *\n * @publicApi\n */\nlet NgModuleRef$1 = class NgModuleRef {};\n/**\n * @publicApi\n *\n * @deprecated\n * This class was mostly used as a part of ViewEngine-based JIT API and is no longer needed in Ivy\n * JIT mode. Angular provides APIs that accept NgModule classes directly (such as\n * [PlatformRef.bootstrapModule](api/core/PlatformRef#bootstrapModule) and\n * [createNgModule](api/core/createNgModule)), consider switching to those APIs instead of\n * using factory-based ones.\n */\nlet NgModuleFactory$1 = class NgModuleFactory {};\n\n/**\n * Returns a new NgModuleRef instance based on the NgModule class and parent injector provided.\n *\n * @param ngModule NgModule class.\n * @param parentInjector Optional injector instance to use as a parent for the module injector. If\n * not provided, `NullInjector` will be used instead.\n * @returns NgModuleRef that represents an NgModule instance.\n *\n * @publicApi\n */\nfunction createNgModule(ngModule, parentInjector) {\n return new NgModuleRef(ngModule, parentInjector ?? null, []);\n}\n/**\n * The `createNgModule` function alias for backwards-compatibility.\n * Please avoid using it directly and use `createNgModule` instead.\n *\n * @deprecated Use `createNgModule` instead.\n */\nconst createNgModuleRef = createNgModule;\nclass NgModuleRef extends NgModuleRef$1 {\n ngModuleType;\n _parent;\n // tslint:disable-next-line:require-internal-with-underscore\n _bootstrapComponents = [];\n _r3Injector;\n instance;\n destroyCbs = [];\n // When bootstrapping a module we have a dependency graph that looks like this:\n // ApplicationRef -> ComponentFactoryResolver -> NgModuleRef. The problem is that if the\n // module being resolved tries to inject the ComponentFactoryResolver, it'll create a\n // circular dependency which will result in a runtime error, because the injector doesn't\n // exist yet. We work around the issue by creating the ComponentFactoryResolver ourselves\n // and providing it, rather than letting the injector resolve it.\n componentFactoryResolver = new ComponentFactoryResolver(this);\n constructor(ngModuleType, _parent, additionalProviders, runInjectorInitializers = true) {\n super();\n this.ngModuleType = ngModuleType;\n this._parent = _parent;\n const ngModuleDef = getNgModuleDef(ngModuleType);\n ngDevMode && assertDefined(ngModuleDef, `NgModule '${stringify(ngModuleType)}' is not a subtype of 'NgModuleType'.`);\n this._bootstrapComponents = maybeUnwrapFn(ngModuleDef.bootstrap);\n this._r3Injector = createInjectorWithoutInjectorInstances(ngModuleType, _parent, [{\n provide: NgModuleRef$1,\n useValue: this\n }, {\n provide: ComponentFactoryResolver$1,\n useValue: this.componentFactoryResolver\n }, ...additionalProviders], stringify(ngModuleType), new Set(['environment']));\n // We need to resolve the injector types separately from the injector creation, because\n // the module might be trying to use this ref in its constructor for DI which will cause a\n // circular error that will eventually error out, because the injector isn't created yet.\n if (runInjectorInitializers) {\n this.resolveInjectorInitializers();\n }\n }\n resolveInjectorInitializers() {\n this._r3Injector.resolveInjectorInitializers();\n this.instance = this._r3Injector.get(this.ngModuleType);\n }\n get injector() {\n return this._r3Injector;\n }\n destroy() {\n ngDevMode && assertDefined(this.destroyCbs, 'NgModule already destroyed');\n const injector = this._r3Injector;\n !injector.destroyed && injector.destroy();\n this.destroyCbs.forEach(fn => fn());\n this.destroyCbs = null;\n }\n onDestroy(callback) {\n ngDevMode && assertDefined(this.destroyCbs, 'NgModule already destroyed');\n this.destroyCbs.push(callback);\n }\n}\nclass NgModuleFactory extends NgModuleFactory$1 {\n moduleType;\n constructor(moduleType) {\n super();\n this.moduleType = moduleType;\n }\n create(parentInjector) {\n return new NgModuleRef(this.moduleType, parentInjector, []);\n }\n}\nfunction createNgModuleRefWithProviders(moduleType, parentInjector, additionalProviders) {\n return new NgModuleRef(moduleType, parentInjector, additionalProviders, false);\n}\nclass EnvironmentNgModuleRefAdapter extends NgModuleRef$1 {\n injector;\n componentFactoryResolver = new ComponentFactoryResolver(this);\n instance = null;\n constructor(config) {\n super();\n const injector = new R3Injector([...config.providers, {\n provide: NgModuleRef$1,\n useValue: this\n }, {\n provide: ComponentFactoryResolver$1,\n useValue: this.componentFactoryResolver\n }], config.parent || getNullInjector(), config.debugName, new Set(['environment']));\n this.injector = injector;\n if (config.runEnvironmentInitializers) {\n injector.resolveInjectorInitializers();\n }\n }\n destroy() {\n this.injector.destroy();\n }\n onDestroy(callback) {\n this.injector.onDestroy(callback);\n }\n}\n/**\n * Create a new environment injector.\n *\n * @param providers An array of providers.\n * @param parent A parent environment injector.\n * @param debugName An optional name for this injector instance, which will be used in error\n * messages.\n *\n * @publicApi\n */\nfunction createEnvironmentInjector(providers, parent, debugName = null) {\n const adapter = new EnvironmentNgModuleRefAdapter({\n providers,\n parent,\n debugName,\n runEnvironmentInitializers: true\n });\n return adapter.injector;\n}\n\n/**\n * A service used by the framework to create instances of standalone injectors. Those injectors are\n * created on demand in case of dynamic component instantiation and contain ambient providers\n * collected from the imports graph rooted at a given standalone component.\n */\nclass StandaloneService {\n _injector;\n cachedInjectors = new Map();\n constructor(_injector) {\n this._injector = _injector;\n }\n getOrCreateStandaloneInjector(componentDef) {\n if (!componentDef.standalone) {\n return null;\n }\n if (!this.cachedInjectors.has(componentDef)) {\n const providers = internalImportProvidersFrom(false, componentDef.type);\n const standaloneInjector = providers.length > 0 ? createEnvironmentInjector([providers], this._injector, `Standalone[${componentDef.type.name}]`) : null;\n this.cachedInjectors.set(componentDef, standaloneInjector);\n }\n return this.cachedInjectors.get(componentDef);\n }\n ngOnDestroy() {\n try {\n for (const injector of this.cachedInjectors.values()) {\n if (injector !== null) {\n injector.destroy();\n }\n }\n } finally {\n this.cachedInjectors.clear();\n }\n }\n /** @nocollapse */\n static ɵprov = /** @pureOrBreakMyCode */ /* @__PURE__ */__defineInjectable({\n token: StandaloneService,\n providedIn: 'environment',\n factory: () => new StandaloneService(__inject(EnvironmentInjector))\n });\n}\n\n/**\n * Create a component definition object.\n *\n *\n * # Example\n * ```ts\n * class MyComponent {\n * // Generated by Angular Template Compiler\n * // [Symbol] syntax will not be supported by TypeScript until v2.7\n * static ɵcmp = defineComponent({\n * ...\n * });\n * }\n * ```\n * @codeGenApi\n */\nfunction ɵɵdefineComponent(componentDefinition) {\n return noSideEffects(() => {\n // Initialize ngDevMode. This must be the first statement in ɵɵdefineComponent.\n // See the `initNgDevMode` docstring for more information.\n (typeof ngDevMode === 'undefined' || ngDevMode) && initNgDevMode();\n const baseDef = getNgDirectiveDef(componentDefinition);\n const def = {\n ...baseDef,\n decls: componentDefinition.decls,\n vars: componentDefinition.vars,\n template: componentDefinition.template,\n consts: componentDefinition.consts || null,\n ngContentSelectors: componentDefinition.ngContentSelectors,\n onPush: componentDefinition.changeDetection === ChangeDetectionStrategy.OnPush,\n directiveDefs: null,\n // assigned in noSideEffects\n pipeDefs: null,\n // assigned in noSideEffects\n dependencies: baseDef.standalone && componentDefinition.dependencies || null,\n getStandaloneInjector: baseDef.standalone ? parentInjector => {\n return parentInjector.get(StandaloneService).getOrCreateStandaloneInjector(def);\n } : null,\n getExternalStyles: null,\n signals: componentDefinition.signals ?? false,\n data: componentDefinition.data || {},\n encapsulation: componentDefinition.encapsulation || ViewEncapsulation.Emulated,\n styles: componentDefinition.styles || EMPTY_ARRAY,\n _: null,\n schemas: componentDefinition.schemas || null,\n tView: null,\n id: ''\n };\n // TODO: Do we still need/want this ?\n if (baseDef.standalone) {\n performanceMarkFeature('NgStandalone');\n }\n initFeatures(def);\n const dependencies = componentDefinition.dependencies;\n def.directiveDefs = extractDefListOrFactory(dependencies, extractDirectiveDef);\n def.pipeDefs = extractDefListOrFactory(dependencies, getPipeDef$1);\n def.id = getComponentId(def);\n return def;\n });\n}\nfunction extractDirectiveDef(type) {\n return getComponentDef(type) || getDirectiveDef(type);\n}\n/**\n * @codeGenApi\n */\nfunction ɵɵdefineNgModule(def) {\n return noSideEffects(() => {\n const res = {\n type: def.type,\n bootstrap: def.bootstrap || EMPTY_ARRAY,\n declarations: def.declarations || EMPTY_ARRAY,\n imports: def.imports || EMPTY_ARRAY,\n exports: def.exports || EMPTY_ARRAY,\n transitiveCompileScopes: null,\n schemas: def.schemas || null,\n id: def.id || null\n };\n return res;\n });\n}\n/**\n * Converts binding objects from the `DirectiveDefinition` into more efficient\n * lookup dictionaries that are optimized for the framework runtime.\n *\n * This function converts inputs or output directive information into new objects\n * where the public name conveniently maps to the minified internal field name.\n *\n * For inputs, the input flags are additionally persisted into the new data structure,\n * so that those can be quickly retrieved when needed.\n *\n * e.g. for\n *\n * ```ts\n * class Comp {\n * @Input()\n * propName1: string;\n *\n * @Input('publicName2')\n * declaredPropName2: number;\n *\n * inputSignal = input(3);\n * }\n * ```\n *\n * will be serialized as\n *\n * ```ts\n * {\n * propName1: 'propName1',\n * declaredPropName2: ['publicName2', 'declaredPropName2'],\n * inputSignal: [InputFlags.SignalBased, 'inputSignal'],\n * }\n * ```\n *\n * which is than translated by the minifier as:\n *\n * ```ts\n * {\n * minifiedPropName1: 'propName1',\n * minifiedPropName2: ['publicName2', 'declaredPropName2'],\n * minifiedInputSignal: [InputFlags.SignalBased, 'inputSignal'],\n * }\n * ```\n *\n * becomes: (public name => minifiedName + isSignal if needed)\n *\n * ```ts\n * {\n * 'propName1': 'minifiedPropName1',\n * 'publicName2': 'minifiedPropName2',\n * 'inputSignal': ['minifiedInputSignal', InputFlags.SignalBased],\n * }\n * ```\n *\n * Optionally the function can take `declaredInputs` which will result\n * in: (public name => declared name)\n *\n * ```ts\n * {\n * 'propName1': 'propName1',\n * 'publicName2': 'declaredPropName2',\n * 'inputSignal': 'inputSignal',\n * }\n * ```\n *\n\n */\nfunction parseAndConvertInputsForDefinition(obj, declaredInputs) {\n if (obj == null) return EMPTY_OBJ;\n const newLookup = {};\n for (const minifiedKey in obj) {\n if (obj.hasOwnProperty(minifiedKey)) {\n const value = obj[minifiedKey];\n let publicName;\n let declaredName;\n let inputFlags;\n let transform;\n if (Array.isArray(value)) {\n inputFlags = value[0];\n publicName = value[1];\n declaredName = value[2] ?? publicName; // declared name might not be set to save bytes.\n transform = value[3] || null;\n } else {\n publicName = value;\n declaredName = value;\n inputFlags = InputFlags.None;\n transform = null;\n }\n newLookup[publicName] = [minifiedKey, inputFlags, transform];\n declaredInputs[publicName] = declaredName;\n }\n }\n return newLookup;\n}\nfunction parseAndConvertOutputsForDefinition(obj) {\n if (obj == null) return EMPTY_OBJ;\n const newLookup = {};\n for (const minifiedKey in obj) {\n if (obj.hasOwnProperty(minifiedKey)) {\n newLookup[obj[minifiedKey]] = minifiedKey;\n }\n }\n return newLookup;\n}\n/**\n * Create a directive definition object.\n *\n * # Example\n * ```ts\n * class MyDirective {\n * // Generated by Angular Template Compiler\n * // [Symbol] syntax will not be supported by TypeScript until v2.7\n * static ɵdir = ɵɵdefineDirective({\n * ...\n * });\n * }\n * ```\n *\n * @codeGenApi\n */\nfunction ɵɵdefineDirective(directiveDefinition) {\n return noSideEffects(() => {\n const def = getNgDirectiveDef(directiveDefinition);\n initFeatures(def);\n return def;\n });\n}\n/**\n * Create a pipe definition object.\n *\n * # Example\n * ```ts\n * class MyPipe implements PipeTransform {\n * // Generated by Angular Template Compiler\n * static ɵpipe = definePipe({\n * ...\n * });\n * }\n * ```\n * @param pipeDef Pipe definition generated by the compiler\n *\n * @codeGenApi\n */\nfunction ɵɵdefinePipe(pipeDef) {\n return {\n type: pipeDef.type,\n name: pipeDef.name,\n factory: null,\n pure: pipeDef.pure !== false,\n standalone: pipeDef.standalone ?? true,\n onDestroy: pipeDef.type.prototype.ngOnDestroy || null\n };\n}\nfunction getNgDirectiveDef(directiveDefinition) {\n const declaredInputs = {};\n return {\n type: directiveDefinition.type,\n providersResolver: null,\n factory: null,\n hostBindings: directiveDefinition.hostBindings || null,\n hostVars: directiveDefinition.hostVars || 0,\n hostAttrs: directiveDefinition.hostAttrs || null,\n contentQueries: directiveDefinition.contentQueries || null,\n declaredInputs: declaredInputs,\n inputConfig: directiveDefinition.inputs || EMPTY_OBJ,\n exportAs: directiveDefinition.exportAs || null,\n standalone: directiveDefinition.standalone ?? true,\n signals: directiveDefinition.signals === true,\n selectors: directiveDefinition.selectors || EMPTY_ARRAY,\n viewQuery: directiveDefinition.viewQuery || null,\n features: directiveDefinition.features || null,\n setInput: null,\n resolveHostDirectives: null,\n hostDirectives: null,\n inputs: parseAndConvertInputsForDefinition(directiveDefinition.inputs, declaredInputs),\n outputs: parseAndConvertOutputsForDefinition(directiveDefinition.outputs),\n debugInfo: null\n };\n}\nfunction initFeatures(definition) {\n definition.features?.forEach(fn => fn(definition));\n}\nfunction extractDefListOrFactory(dependencies, defExtractor) {\n if (!dependencies) {\n return null;\n }\n return () => {\n const resolvedDependencies = typeof dependencies === 'function' ? dependencies() : dependencies;\n const result = [];\n for (const dep of resolvedDependencies) {\n const definition = defExtractor(dep);\n if (definition !== null) {\n result.push(definition);\n }\n }\n return result;\n };\n}\n/**\n * A map that contains the generated component IDs and type.\n */\nconst GENERATED_COMP_IDS = new Map();\n/**\n * A method can returns a component ID from the component definition using a variant of DJB2 hash\n * algorithm.\n */\nfunction getComponentId(componentDef) {\n let hash = 0;\n // For components with i18n in templates, the `consts` array is generated by the compiler\n // as a function. If client and server bundles were produced with different minification\n // configurations, the serializable contents of the function body would be different on\n // the client and on the server. This might result in different ids generated. To avoid this\n // issue, we do not take the `consts` contents into account if it's a function.\n // See https://github.com/angular/angular/issues/58713.\n const componentDefConsts = typeof componentDef.consts === 'function' ? '' : componentDef.consts;\n // We cannot rely solely on the component selector as the same selector can be used in different\n // modules.\n //\n // `componentDef.style` is not used, due to it causing inconsistencies. Ex: when server\n // component styles has no sourcemaps and browsers do.\n //\n // Example:\n // https://github.com/angular/components/blob/d9f82c8f95309e77a6d82fd574c65871e91354c2/src/material/core/option/option.ts#L248\n // https://github.com/angular/components/blob/285f46dc2b4c5b127d356cb7c4714b221f03ce50/src/material/legacy-core/option/option.ts#L32\n const hashSelectors = [componentDef.selectors, componentDef.ngContentSelectors, componentDef.hostVars, componentDef.hostAttrs, componentDefConsts, componentDef.vars, componentDef.decls, componentDef.encapsulation, componentDef.standalone, componentDef.signals, componentDef.exportAs, JSON.stringify(componentDef.inputs), JSON.stringify(componentDef.outputs),\n // We cannot use 'componentDef.type.name' as the name of the symbol will change and will not\n // match in the server and browser bundles.\n Object.getOwnPropertyNames(componentDef.type.prototype), !!componentDef.contentQueries, !!componentDef.viewQuery];\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n // If client and server bundles were produced with different minification configurations,\n // the serializable contents of the function body would be different on the client and on\n // the server. Ensure that we do not accidentally use functions in component id computation.\n for (const item of hashSelectors) {\n assertNotEqual(typeof item, 'function', 'Internal error: attempting to use a function in component id computation logic.');\n }\n }\n for (const char of hashSelectors.join('|')) {\n hash = Math.imul(31, hash) + char.charCodeAt(0) << 0;\n }\n // Force positive number hash.\n // 2147483647 = equivalent of Integer.MAX_VALUE.\n hash += 2147483647 + 1;\n const compId = 'c' + hash;\n if ((typeof ngDevMode === 'undefined' || ngDevMode) && (\n // Skip the check on the server since we can't guarantee the same component instance between\n // requests. Note that we can't use DI to check if we're on the server, because the component\n // hasn't been instantiated yet.\n typeof ngServerMode === 'undefined' || !ngServerMode)) {\n if (GENERATED_COMP_IDS.has(compId)) {\n const previousCompDefType = GENERATED_COMP_IDS.get(compId);\n if (previousCompDefType !== componentDef.type) {\n console.warn(formatRuntimeError(-912 /* RuntimeErrorCode.COMPONENT_ID_COLLISION */, `Component ID generation collision detected. Components '${previousCompDefType.name}' and '${componentDef.type.name}' with selector '${stringifyCSSSelectorList(componentDef.selectors)}' generated the same component ID. To fix this, you can change the selector of one of those components or add an extra host attribute to force a different ID.`));\n }\n } else {\n GENERATED_COMP_IDS.set(compId, componentDef.type);\n }\n }\n return compId;\n}\nfunction getSuperType(type) {\n return Object.getPrototypeOf(type.prototype).constructor;\n}\n/**\n * Merges the definition from a super class to a sub class.\n * @param definition The definition that is a SubClass of another directive of component\n *\n * @codeGenApi\n */\nfunction ɵɵInheritDefinitionFeature(definition) {\n let superType = getSuperType(definition.type);\n let shouldInheritFields = true;\n const inheritanceChain = [definition];\n while (superType) {\n let superDef = undefined;\n if (isComponentDef(definition)) {\n // Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.\n superDef = superType.ɵcmp || superType.ɵdir;\n } else {\n if (superType.ɵcmp) {\n throw new RuntimeError(903 /* RuntimeErrorCode.INVALID_INHERITANCE */, ngDevMode && `Directives cannot inherit Components. Directive ${stringifyForError(definition.type)} is attempting to extend component ${stringifyForError(superType)}`);\n }\n // Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.\n superDef = superType.ɵdir;\n }\n if (superDef) {\n if (shouldInheritFields) {\n inheritanceChain.push(superDef);\n // Some fields in the definition may be empty, if there were no values to put in them that\n // would've justified object creation. Unwrap them if necessary.\n const writeableDef = definition;\n writeableDef.inputs = maybeUnwrapEmpty(definition.inputs);\n writeableDef.declaredInputs = maybeUnwrapEmpty(definition.declaredInputs);\n writeableDef.outputs = maybeUnwrapEmpty(definition.outputs);\n // Merge hostBindings\n const superHostBindings = superDef.hostBindings;\n superHostBindings && inheritHostBindings(definition, superHostBindings);\n // Merge queries\n const superViewQuery = superDef.viewQuery;\n const superContentQueries = superDef.contentQueries;\n superViewQuery && inheritViewQuery(definition, superViewQuery);\n superContentQueries && inheritContentQueries(definition, superContentQueries);\n // Merge inputs and outputs\n mergeInputsWithTransforms(definition, superDef);\n fillProperties(definition.outputs, superDef.outputs);\n // Merge animations metadata.\n // If `superDef` is a Component, the `data` field is present (defaults to an empty object).\n if (isComponentDef(superDef) && superDef.data.animation) {\n // If super def is a Component, the `definition` is also a Component, since Directives can\n // not inherit Components (we throw an error above and cannot reach this code).\n const defData = definition.data;\n defData.animation = (defData.animation || []).concat(superDef.data.animation);\n }\n }\n // Run parent features\n const features = superDef.features;\n if (features) {\n for (let i = 0; i < features.length; i++) {\n const feature = features[i];\n if (feature && feature.ngInherit) {\n feature(definition);\n }\n // If `InheritDefinitionFeature` is a part of the current `superDef`, it means that this\n // def already has all the necessary information inherited from its super class(es), so we\n // can stop merging fields from super classes. However we need to iterate through the\n // prototype chain to look for classes that might contain other \"features\" (like\n // NgOnChanges), which we should invoke for the original `definition`. We set the\n // `shouldInheritFields` flag to indicate that, essentially skipping fields inheritance\n // logic and only invoking functions from the \"features\" list.\n if (feature === ɵɵInheritDefinitionFeature) {\n shouldInheritFields = false;\n }\n }\n }\n }\n superType = Object.getPrototypeOf(superType);\n }\n mergeHostAttrsAcrossInheritance(inheritanceChain);\n}\nfunction mergeInputsWithTransforms(target, source) {\n for (const key in source.inputs) {\n if (!source.inputs.hasOwnProperty(key)) {\n continue;\n }\n if (target.inputs.hasOwnProperty(key)) {\n continue;\n }\n const value = source.inputs[key];\n if (value !== undefined) {\n target.inputs[key] = value;\n target.declaredInputs[key] = source.declaredInputs[key];\n }\n }\n}\n/**\n * Merge the `hostAttrs` and `hostVars` from the inherited parent to the base class.\n *\n * @param inheritanceChain A list of `WritableDefs` starting at the top most type and listing\n * sub-types in order. For each type take the `hostAttrs` and `hostVars` and merge it with the child\n * type.\n */\nfunction mergeHostAttrsAcrossInheritance(inheritanceChain) {\n let hostVars = 0;\n let hostAttrs = null;\n // We process the inheritance order from the base to the leaves here.\n for (let i = inheritanceChain.length - 1; i >= 0; i--) {\n const def = inheritanceChain[i];\n // For each `hostVars`, we need to add the superclass amount.\n def.hostVars = hostVars += def.hostVars;\n // for each `hostAttrs` we need to merge it with superclass.\n def.hostAttrs = mergeHostAttrs(def.hostAttrs, hostAttrs = mergeHostAttrs(hostAttrs, def.hostAttrs));\n }\n}\nfunction maybeUnwrapEmpty(value) {\n if (value === EMPTY_OBJ) {\n return {};\n } else if (value === EMPTY_ARRAY) {\n return [];\n } else {\n return value;\n }\n}\nfunction inheritViewQuery(definition, superViewQuery) {\n const prevViewQuery = definition.viewQuery;\n if (prevViewQuery) {\n definition.viewQuery = (rf, ctx) => {\n superViewQuery(rf, ctx);\n prevViewQuery(rf, ctx);\n };\n } else {\n definition.viewQuery = superViewQuery;\n }\n}\nfunction inheritContentQueries(definition, superContentQueries) {\n const prevContentQueries = definition.contentQueries;\n if (prevContentQueries) {\n definition.contentQueries = (rf, ctx, directiveIndex) => {\n superContentQueries(rf, ctx, directiveIndex);\n prevContentQueries(rf, ctx, directiveIndex);\n };\n } else {\n definition.contentQueries = superContentQueries;\n }\n}\nfunction inheritHostBindings(definition, superHostBindings) {\n const prevHostBindings = definition.hostBindings;\n if (prevHostBindings) {\n definition.hostBindings = (rf, ctx) => {\n superHostBindings(rf, ctx);\n prevHostBindings(rf, ctx);\n };\n } else {\n definition.hostBindings = superHostBindings;\n }\n}\n\n/**\n * Fields which exist on either directive or component definitions, and need to be copied from\n * parent to child classes by the `ɵɵCopyDefinitionFeature`.\n */\nconst COPY_DIRECTIVE_FIELDS = [\n// The child class should use the providers of its parent.\n'providersResolver'\n// Not listed here are any fields which are handled by the `ɵɵInheritDefinitionFeature`, such\n// as inputs, outputs, and host binding functions.\n];\n/**\n * Fields which exist only on component definitions, and need to be copied from parent to child\n * classes by the `ɵɵCopyDefinitionFeature`.\n *\n * The type here allows any field of `ComponentDef` which is not also a property of `DirectiveDef`,\n * since those should go in `COPY_DIRECTIVE_FIELDS` above.\n */\nconst COPY_COMPONENT_FIELDS = [\n// The child class should use the template function of its parent, including all template\n// semantics.\n'template', 'decls', 'consts', 'vars', 'onPush', 'ngContentSelectors',\n// The child class should use the CSS styles of its parent, including all styling semantics.\n'styles', 'encapsulation',\n// The child class should be checked by the runtime in the same way as its parent.\n'schemas'];\n/**\n * Copies the fields not handled by the `ɵɵInheritDefinitionFeature` from the supertype of a\n * definition.\n *\n * This exists primarily to support ngcc migration of an existing View Engine pattern, where an\n * entire decorator is inherited from a parent to a child class. When ngcc detects this case, it\n * generates a skeleton definition on the child class, and applies this feature.\n *\n * The `ɵɵCopyDefinitionFeature` then copies any needed fields from the parent class' definition,\n * including things like the component template function.\n *\n * @param definition The definition of a child class which inherits from a parent class with its\n * own definition.\n *\n * @codeGenApi\n */\nfunction ɵɵCopyDefinitionFeature(definition) {\n let superType = getSuperType(definition.type);\n let superDef = undefined;\n if (isComponentDef(definition)) {\n // Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.\n superDef = superType.ɵcmp;\n } else {\n // Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.\n superDef = superType.ɵdir;\n }\n // Needed because `definition` fields are readonly.\n const defAny = definition;\n // Copy over any fields that apply to either directives or components.\n for (const field of COPY_DIRECTIVE_FIELDS) {\n defAny[field] = superDef[field];\n }\n if (isComponentDef(superDef)) {\n // Copy over any component-specific fields.\n for (const field of COPY_COMPONENT_FIELDS) {\n defAny[field] = superDef[field];\n }\n }\n}\n\n/**\n * This feature adds the host directives behavior to a directive definition by patching a\n * function onto it. The expectation is that the runtime will invoke the function during\n * directive matching.\n *\n * For example:\n * ```ts\n * class ComponentWithHostDirective {\n * static ɵcmp = defineComponent({\n * type: ComponentWithHostDirective,\n * features: [ɵɵHostDirectivesFeature([\n * SimpleHostDirective,\n * {directive: AdvancedHostDirective, inputs: ['foo: alias'], outputs: ['bar']},\n * ])]\n * });\n * }\n * ```\n *\n * @codeGenApi\n */\nfunction ɵɵHostDirectivesFeature(rawHostDirectives) {\n const feature = definition => {\n const isEager = Array.isArray(rawHostDirectives);\n if (definition.hostDirectives === null) {\n definition.resolveHostDirectives = resolveHostDirectives;\n definition.hostDirectives = isEager ? rawHostDirectives.map(createHostDirectiveDef) : [rawHostDirectives];\n } else if (isEager) {\n definition.hostDirectives.unshift(...rawHostDirectives.map(createHostDirectiveDef));\n } else {\n definition.hostDirectives.unshift(rawHostDirectives);\n }\n };\n feature.ngInherit = true;\n return feature;\n}\n/**\n * Function that will be patched onto a definition to enable host directives. It is intended to\n * be called once during directive matching and is the same for all definitions.\n * @param matches Directives resolved through selector matching.\n */\nfunction resolveHostDirectives(matches) {\n const allDirectiveDefs = [];\n let hasComponent = false;\n let hostDirectiveDefs = null;\n let hostDirectiveRanges = null;\n // Components are inserted at the front of the matches array so that their lifecycle\n // hooks run before any directive lifecycle hooks. This appears to be for ViewEngine\n // compatibility. This logic doesn't make sense with host directives, because it\n // would allow the host directives to undo any overrides the host may have made.\n // To handle this case, the host directives of components are inserted at the beginning\n // of the array, followed by the component. As such, the insertion order is as follows:\n // 1. Host directives belonging to the selector-matched component.\n // 2. Selector-matched component.\n // 3. Host directives belonging to selector-matched directives.\n // 4. Selector-matched dir\n for (let i = 0; i < matches.length; i++) {\n const def = matches[i];\n if (def.hostDirectives !== null) {\n const start = allDirectiveDefs.length;\n hostDirectiveDefs ??= new Map();\n hostDirectiveRanges ??= new Map();\n // TODO(pk): probably could return matches instead of taking in an array to fill in?\n findHostDirectiveDefs(def, allDirectiveDefs, hostDirectiveDefs);\n // Note that these indexes are within the offset by `directiveStart`. We can't do the\n // offsetting here, because `directiveStart` hasn't been initialized on the TNode yet.\n hostDirectiveRanges.set(def, [start, allDirectiveDefs.length - 1]);\n }\n // Component definition is always first and needs to be\n // pushed early to maintain the correct ordering.\n if (i === 0 && isComponentDef(def)) {\n hasComponent = true;\n allDirectiveDefs.push(def);\n }\n }\n for (let i = hasComponent ? 1 : 0; i < matches.length; i++) {\n allDirectiveDefs.push(matches[i]);\n }\n return [allDirectiveDefs, hostDirectiveDefs, hostDirectiveRanges];\n}\nfunction findHostDirectiveDefs(currentDef, matchedDefs, hostDirectiveDefs) {\n if (currentDef.hostDirectives !== null) {\n for (const configOrFn of currentDef.hostDirectives) {\n if (typeof configOrFn === 'function') {\n const resolved = configOrFn();\n for (const config of resolved) {\n trackHostDirectiveDef(createHostDirectiveDef(config), matchedDefs, hostDirectiveDefs);\n }\n } else {\n trackHostDirectiveDef(configOrFn, matchedDefs, hostDirectiveDefs);\n }\n }\n }\n}\n/** Tracks a single host directive during directive matching. */\nfunction trackHostDirectiveDef(def, matchedDefs, hostDirectiveDefs) {\n const hostDirectiveDef = getDirectiveDef(def.directive);\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n validateHostDirective(def, hostDirectiveDef);\n }\n // We need to patch the `declaredInputs` so that\n // `ngOnChanges` can map the properties correctly.\n patchDeclaredInputs(hostDirectiveDef.declaredInputs, def.inputs);\n // Host directives execute before the host so that its host bindings can be overwritten.\n findHostDirectiveDefs(hostDirectiveDef, matchedDefs, hostDirectiveDefs);\n hostDirectiveDefs.set(hostDirectiveDef, def);\n matchedDefs.push(hostDirectiveDef);\n}\n/** Creates a `HostDirectiveDef` from a used-defined host directive configuration. */\nfunction createHostDirectiveDef(config) {\n return typeof config === 'function' ? {\n directive: resolveForwardRef(config),\n inputs: EMPTY_OBJ,\n outputs: EMPTY_OBJ\n } : {\n directive: resolveForwardRef(config.directive),\n inputs: bindingArrayToMap(config.inputs),\n outputs: bindingArrayToMap(config.outputs)\n };\n}\n/**\n * Converts an array in the form of `['publicName', 'alias', 'otherPublicName', 'otherAlias']` into\n * a map in the form of `{publicName: 'alias', otherPublicName: 'otherAlias'}`.\n */\nfunction bindingArrayToMap(bindings) {\n if (bindings === undefined || bindings.length === 0) {\n return EMPTY_OBJ;\n }\n const result = {};\n for (let i = 0; i < bindings.length; i += 2) {\n result[bindings[i]] = bindings[i + 1];\n }\n return result;\n}\n/**\n * `ngOnChanges` has some leftover legacy ViewEngine behavior where the keys inside the\n * `SimpleChanges` event refer to the *declared* name of the input, not its public name or its\n * minified name. E.g. in `@Input('alias') foo: string`, the name in the `SimpleChanges` object\n * will always be `foo`, and not `alias` or the minified name of `foo` in apps using property\n * minification.\n *\n * This is achieved through the `DirectiveDef.declaredInputs` map that is constructed when the\n * definition is declared. When a property is written to the directive instance, the\n * `NgOnChangesFeature` will try to remap the property name being written to using the\n * `declaredInputs`.\n *\n * Since the host directive input remapping happens during directive matching, `declaredInputs`\n * won't contain the new alias that the input is available under. This function addresses the\n * issue by patching the host directive aliases to the `declaredInputs`. There is *not* a risk of\n * this patching accidentally introducing new inputs to the host directive, because `declaredInputs`\n * is used *only* by the `NgOnChangesFeature` when determining what name is used in the\n * `SimpleChanges` object which won't be reached if an input doesn't exist.\n */\nfunction patchDeclaredInputs(declaredInputs, exposedInputs) {\n for (const publicName in exposedInputs) {\n if (exposedInputs.hasOwnProperty(publicName)) {\n const remappedPublicName = exposedInputs[publicName];\n const privateName = declaredInputs[publicName];\n // We *technically* shouldn't be able to hit this case because we can't have multiple\n // inputs on the same property and we have validations against conflicting aliases in\n // `validateMappings`. If we somehow did, it would lead to `ngOnChanges` being invoked\n // with the wrong name so we have a non-user-friendly assertion here just in case.\n if ((typeof ngDevMode === 'undefined' || ngDevMode) && declaredInputs.hasOwnProperty(remappedPublicName)) {\n assertEqual(declaredInputs[remappedPublicName], declaredInputs[publicName], `Conflicting host directive input alias ${publicName}.`);\n }\n declaredInputs[remappedPublicName] = privateName;\n }\n }\n}\n/**\n * Verifies that the host directive has been configured correctly.\n * @param hostDirectiveConfig Host directive configuration object.\n * @param directiveDef Directive definition of the host directive.\n */\nfunction validateHostDirective(hostDirectiveConfig, directiveDef) {\n const type = hostDirectiveConfig.directive;\n if (directiveDef === null) {\n if (getComponentDef(type) !== null) {\n throw new RuntimeError(310 /* RuntimeErrorCode.HOST_DIRECTIVE_COMPONENT */, `Host directive ${type.name} cannot be a component.`);\n }\n throw new RuntimeError(307 /* RuntimeErrorCode.HOST_DIRECTIVE_UNRESOLVABLE */, `Could not resolve metadata for host directive ${type.name}. ` + `Make sure that the ${type.name} class is annotated with an @Directive decorator.`);\n }\n if (!directiveDef.standalone) {\n throw new RuntimeError(308 /* RuntimeErrorCode.HOST_DIRECTIVE_NOT_STANDALONE */, `Host directive ${directiveDef.type.name} must be standalone.`);\n }\n validateMappings('input', directiveDef, hostDirectiveConfig.inputs);\n validateMappings('output', directiveDef, hostDirectiveConfig.outputs);\n}\n/**\n * Checks that the host directive inputs/outputs configuration is valid.\n * @param bindingType Kind of binding that is being validated. Used in the error message.\n * @param def Definition of the host directive that is being validated against.\n * @param hostDirectiveBindings Host directive mapping object that shold be validated.\n */\nfunction validateMappings(bindingType, def, hostDirectiveBindings) {\n const className = def.type.name;\n const bindings = bindingType === 'input' ? def.inputs : def.outputs;\n for (const publicName in hostDirectiveBindings) {\n if (hostDirectiveBindings.hasOwnProperty(publicName)) {\n if (!bindings.hasOwnProperty(publicName)) {\n throw new RuntimeError(311 /* RuntimeErrorCode.HOST_DIRECTIVE_UNDEFINED_BINDING */, `Directive ${className} does not have an ${bindingType} with a public name of ${publicName}.`);\n }\n const remappedPublicName = hostDirectiveBindings[publicName];\n if (bindings.hasOwnProperty(remappedPublicName) && remappedPublicName !== publicName) {\n throw new RuntimeError(312 /* RuntimeErrorCode.HOST_DIRECTIVE_CONFLICTING_ALIAS */, `Cannot alias ${bindingType} ${publicName} of host directive ${className} to ${remappedPublicName}, because it already has a different ${bindingType} with the same public name.`);\n }\n }\n }\n}\nfunction templateCreate(tNode, declarationLView, declarationTView, index, templateFn, decls, vars, flags) {\n if (declarationTView.firstCreatePass) {\n // Merge the template attrs last so that they have the highest priority.\n tNode.mergedAttrs = mergeHostAttrs(tNode.mergedAttrs, tNode.attrs);\n const embeddedTView = tNode.tView = createTView(2 /* TViewType.Embedded */, tNode, templateFn, decls, vars, declarationTView.directiveRegistry, declarationTView.pipeRegistry, null, declarationTView.schemas, declarationTView.consts, null /* ssrId */);\n if (declarationTView.queries !== null) {\n declarationTView.queries.template(declarationTView, tNode);\n embeddedTView.queries = declarationTView.queries.embeddedTView(tNode);\n }\n }\n if (flags) {\n tNode.flags |= flags;\n }\n setCurrentTNode(tNode, false);\n const comment = _locateOrCreateContainerAnchor(declarationTView, declarationLView, tNode, index);\n if (wasLastNodeCreated()) {\n appendChild(declarationTView, declarationLView, comment, tNode);\n }\n attachPatchData(comment, declarationLView);\n const lContainer = createLContainer(comment, declarationLView, comment, tNode);\n declarationLView[index + HEADER_OFFSET] = lContainer;\n addToEndOfViewTree(declarationLView, lContainer);\n // If hydration is enabled, looks up dehydrated views in the DOM\n // using hydration annotation info and stores those views on LContainer.\n // In client-only mode, this function is a noop.\n populateDehydratedViewsInLContainer(lContainer, tNode, declarationLView);\n}\n/**\n * Declares a new template that can have directives on its host node.\n *\n * @param declarationLView LView in which the template was declared.\n * @param declarationTView TView in which the template wa declared.\n * @param index The index of the container in the data array\n * @param templateFn Inline template\n * @param decls The number of nodes, local refs, and pipes for this template\n * @param vars The number of bindings for this template\n * @param tagName The name of the container element, if applicable\n * @param attrsIndex Index of template attributes in the `consts` array.\n * @param localRefs Index of the local references in the `consts` array.\n * @param localRefExtractor A function which extracts local-refs values from the template.\n * Defaults to the current element associated with the local-ref.\n */\nfunction declareDirectiveHostTemplate(declarationLView, declarationTView, index, templateFn, decls, vars, tagName, attrs, flags, localRefsIndex, localRefExtractor) {\n const adjustedIndex = index + HEADER_OFFSET;\n let tNode;\n if (declarationTView.firstCreatePass) {\n // TODO(pk): refactor getOrCreateTNode to have the \"create\" only version\n tNode = getOrCreateTNode(declarationTView, adjustedIndex, 4 /* TNodeType.Container */, tagName || null, attrs || null);\n if (getBindingsEnabled()) {\n resolveDirectives(declarationTView, declarationLView, tNode, getConstant(declarationTView.consts, localRefsIndex), findDirectiveDefMatches);\n }\n registerPostOrderHooks(declarationTView, tNode);\n } else {\n tNode = declarationTView.data[adjustedIndex];\n }\n templateCreate(tNode, declarationLView, declarationTView, index, templateFn, decls, vars, flags);\n if (isDirectiveHost(tNode)) {\n createDirectivesInstances(declarationTView, declarationLView, tNode);\n }\n if (localRefsIndex != null) {\n saveResolvedLocalsInData(declarationLView, tNode, localRefExtractor);\n }\n return tNode;\n}\n/**\n * Declares a new template that *cannot& have directives on its host node.\n *\n * @param declarationLView LView in which the template was declared.\n * @param declarationTView TView in which the template wa declared.\n * @param index The index of the container in the data array\n * @param templateFn Inline template\n * @param decls The number of nodes, local refs, and pipes for this template\n * @param vars The number of bindings for this template\n * @param tagName The name of the container element, if applicable\n * @param attrsIndex Index of template attributes in the `consts` array.\n * @param localRefs Index of the local references in the `consts` array.\n * @param localRefExtractor A function which extracts local-refs values from the template.\n * Defaults to the current element associated with the local-ref.\n */\nfunction declareNoDirectiveHostTemplate(declarationLView, declarationTView, index, templateFn, decls, vars, tagName, attrs, flags, localRefsIndex, localRefExtractor) {\n const adjustedIndex = index + HEADER_OFFSET;\n let tNode;\n if (declarationTView.firstCreatePass) {\n tNode = getOrCreateTNode(declarationTView, adjustedIndex, 4 /* TNodeType.Container */, tagName || null, attrs || null);\n if (localRefsIndex != null) {\n const refs = getConstant(declarationTView.consts, localRefsIndex);\n tNode.localNames = [];\n for (let i = 0; i < refs.length; i += 2) {\n // Always -1 since DOM-only instructions can only refer to the native node.\n tNode.localNames.push(refs[i], -1);\n }\n }\n } else {\n tNode = declarationTView.data[adjustedIndex];\n }\n templateCreate(tNode, declarationLView, declarationTView, index, templateFn, decls, vars, flags);\n if (localRefsIndex != null) {\n saveResolvedLocalsInData(declarationLView, tNode, localRefExtractor);\n }\n return tNode;\n}\n/**\n * Creates an LContainer for an ng-template (dynamically-inserted view), e.g.\n *\n * <ng-template #foo>\n * <div></div>\n * </ng-template>\n *\n * @param index The index of the container in the data array\n * @param templateFn Inline template\n * @param decls The number of nodes, local refs, and pipes for this template\n * @param vars The number of bindings for this template\n * @param tagName The name of the container element, if applicable\n * @param attrsIndex Index of template attributes in the `consts` array.\n * @param localRefs Index of the local references in the `consts` array.\n * @param localRefExtractor A function which extracts local-refs values from the template.\n * Defaults to the current element associated with the local-ref.\n *\n * @codeGenApi\n */\nfunction ɵɵtemplate(index, templateFn, decls, vars, tagName, attrsIndex, localRefsIndex, localRefExtractor) {\n const lView = getLView();\n const tView = getTView();\n const attrs = getConstant(tView.consts, attrsIndex);\n declareDirectiveHostTemplate(lView, tView, index, templateFn, decls, vars, tagName, attrs, undefined, localRefsIndex, localRefExtractor);\n return ɵɵtemplate;\n}\n/**\n * Creates an LContainer for an ng-template that cannot have directives.\n *\n * @param index The index of the container in the data array\n * @param templateFn Inline template\n * @param decls The number of nodes, local refs, and pipes for this template\n * @param vars The number of bindings for this template\n * @param tagName The name of the container element, if applicable\n * @param attrsIndex Index of template attributes in the `consts` array.\n * @param localRefs Index of the local references in the `consts` array.\n * @param localRefExtractor A function which extracts local-refs values from the template.\n * Defaults to the current element associated with the local-ref.\n *\n * @codeGenApi\n */\nfunction ɵɵdomTemplate(index, templateFn, decls, vars, tagName, attrsIndex, localRefsIndex, localRefExtractor) {\n const lView = getLView();\n const tView = getTView();\n const attrs = getConstant(tView.consts, attrsIndex);\n declareNoDirectiveHostTemplate(lView, tView, index, templateFn, decls, vars, tagName, attrs, undefined, localRefsIndex, localRefExtractor);\n return ɵɵdomTemplate;\n}\nlet _locateOrCreateContainerAnchor = createContainerAnchorImpl;\n/**\n * Regular creation mode for LContainers and their anchor (comment) nodes.\n */\nfunction createContainerAnchorImpl(tView, lView, tNode, index) {\n lastNodeWasCreated(true);\n return lView[RENDERER].createComment(ngDevMode ? 'container' : '');\n}\n/**\n * Enables hydration code path (to lookup existing elements in DOM)\n * in addition to the regular creation mode for LContainers and their\n * anchor (comment) nodes.\n */\nfunction locateOrCreateContainerAnchorImpl(tView, lView, tNode, index) {\n const isNodeCreationMode = !canHydrateNode(lView, tNode);\n lastNodeWasCreated(isNodeCreationMode);\n const ssrId = lView[HYDRATION]?.data[TEMPLATES]?.[index] ?? null;\n // Apply `ssrId` value to the underlying TView if it was not previously set.\n //\n // There might be situations when the same component is present in a template\n // multiple times and some instances are opted-out of using hydration via\n // `ngSkipHydration` attribute. In this scenario, at the time a TView is created,\n // the `ssrId` might be `null` (if the first component is opted-out of hydration).\n // The code below makes sure that the `ssrId` is applied to the TView if it's still\n // `null` and verifies we never try to override it with a different value.\n if (ssrId !== null && tNode.tView !== null) {\n if (tNode.tView.ssrId === null) {\n tNode.tView.ssrId = ssrId;\n } else {\n ngDevMode && assertEqual(tNode.tView.ssrId, ssrId, 'Unexpected value of the `ssrId` for this TView');\n }\n }\n // Regular creation mode.\n if (isNodeCreationMode) {\n return createContainerAnchorImpl(tView, lView);\n }\n const hydrationInfo = lView[HYDRATION];\n // Hydration mode, looking up existing elements in DOM.\n const currentRNode = locateNextRNode(hydrationInfo, tView, lView, tNode);\n ngDevMode && validateNodeExists(currentRNode, lView, tNode);\n setSegmentHead(hydrationInfo, index, currentRNode);\n const viewContainerSize = calcSerializedContainerSize(hydrationInfo, index);\n const comment = siblingAfter(viewContainerSize, currentRNode);\n if (ngDevMode) {\n validateMatchingNode(comment, Node.COMMENT_NODE, null, lView, tNode);\n markRNodeAsClaimedByHydration(comment);\n }\n return comment;\n}\nfunction enableLocateOrCreateContainerAnchorImpl() {\n _locateOrCreateContainerAnchor = locateOrCreateContainerAnchorImpl;\n}\n\n/**\n * Describes the state of defer block dependency loading.\n */\nvar DeferDependenciesLoadingState;\n(function (DeferDependenciesLoadingState) {\n /** Initial state, dependency loading is not yet triggered */\n DeferDependenciesLoadingState[DeferDependenciesLoadingState[\"NOT_STARTED\"] = 0] = \"NOT_STARTED\";\n /** Dependency loading is in progress */\n DeferDependenciesLoadingState[DeferDependenciesLoadingState[\"IN_PROGRESS\"] = 1] = \"IN_PROGRESS\";\n /** Dependency loading has completed successfully */\n DeferDependenciesLoadingState[DeferDependenciesLoadingState[\"COMPLETE\"] = 2] = \"COMPLETE\";\n /** Dependency loading has failed */\n DeferDependenciesLoadingState[DeferDependenciesLoadingState[\"FAILED\"] = 3] = \"FAILED\";\n})(DeferDependenciesLoadingState || (DeferDependenciesLoadingState = {}));\n/** Slot index where `minimum` parameter value is stored. */\nconst MINIMUM_SLOT = 0;\n/** Slot index where `after` parameter value is stored. */\nconst LOADING_AFTER_SLOT = 1;\n/**\n * Describes the current state of this defer block instance.\n *\n * @publicApi\n */\nvar DeferBlockState;\n(function (DeferBlockState) {\n /** The placeholder block content is rendered */\n DeferBlockState[DeferBlockState[\"Placeholder\"] = 0] = \"Placeholder\";\n /** The loading block content is rendered */\n DeferBlockState[DeferBlockState[\"Loading\"] = 1] = \"Loading\";\n /** The main content block content is rendered */\n DeferBlockState[DeferBlockState[\"Complete\"] = 2] = \"Complete\";\n /** The error block content is rendered */\n DeferBlockState[DeferBlockState[\"Error\"] = 3] = \"Error\";\n})(DeferBlockState || (DeferBlockState = {}));\n/**\n * Describes the initial state of this defer block instance.\n *\n * Note: this state is internal only and *must* be represented\n * with a number lower than any value in the `DeferBlockState` enum.\n */\nvar DeferBlockInternalState;\n(function (DeferBlockInternalState) {\n /** Initial state. Nothing is rendered yet. */\n DeferBlockInternalState[DeferBlockInternalState[\"Initial\"] = -1] = \"Initial\";\n})(DeferBlockInternalState || (DeferBlockInternalState = {}));\nconst NEXT_DEFER_BLOCK_STATE = 0;\n// Note: it's *important* to keep the state in this slot, because this slot\n// is used by runtime logic to differentiate between LViews, LContainers and\n// other types (see `isLView` and `isLContainer` functions). In case of defer\n// blocks, this slot would always be a number.\nconst DEFER_BLOCK_STATE = 1;\nconst STATE_IS_FROZEN_UNTIL = 2;\nconst LOADING_AFTER_CLEANUP_FN = 3;\nconst TRIGGER_CLEANUP_FNS = 4;\nconst PREFETCH_TRIGGER_CLEANUP_FNS = 5;\nconst SSR_UNIQUE_ID = 6;\nconst SSR_BLOCK_STATE = 7;\nconst ON_COMPLETE_FNS = 8;\nconst HYDRATE_TRIGGER_CLEANUP_FNS = 9;\n/**\n * Options for configuring defer blocks behavior.\n * @publicApi\n */\nvar DeferBlockBehavior;\n(function (DeferBlockBehavior) {\n /**\n * Manual triggering mode for defer blocks. Provides control over when defer blocks render\n * and which state they render.\n */\n DeferBlockBehavior[DeferBlockBehavior[\"Manual\"] = 0] = \"Manual\";\n /**\n * Playthrough mode for defer blocks. This mode behaves like defer blocks would in a browser.\n * This is the default behavior in test environments.\n */\n DeferBlockBehavior[DeferBlockBehavior[\"Playthrough\"] = 1] = \"Playthrough\";\n})(DeferBlockBehavior || (DeferBlockBehavior = {}));\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 * Registers a cleanup function associated with a prefetching trigger\n * or a regular trigger of a defer block.\n */\nfunction storeTriggerCleanupFn(type, lDetails, cleanupFn) {\n const key = getCleanupFnKeyByType(type);\n if (lDetails[key] === null) {\n lDetails[key] = [];\n }\n lDetails[key].push(cleanupFn);\n}\n/**\n * Invokes registered cleanup functions either for prefetch or for regular triggers.\n */\nfunction invokeTriggerCleanupFns(type, lDetails) {\n const key = getCleanupFnKeyByType(type);\n const cleanupFns = lDetails[key];\n if (cleanupFns !== null) {\n for (const cleanupFn of cleanupFns) {\n cleanupFn();\n }\n lDetails[key] = null;\n }\n}\n/**\n * Invokes registered cleanup functions for prefetch, hydrate, and regular triggers.\n */\nfunction invokeAllTriggerCleanupFns(lDetails) {\n invokeTriggerCleanupFns(1 /* TriggerType.Prefetch */, lDetails);\n invokeTriggerCleanupFns(0 /* TriggerType.Regular */, lDetails);\n invokeTriggerCleanupFns(2 /* TriggerType.Hydrate */, lDetails);\n}\nfunction getCleanupFnKeyByType(type) {\n let key = TRIGGER_CLEANUP_FNS;\n if (type === 1 /* TriggerType.Prefetch */) {\n key = PREFETCH_TRIGGER_CLEANUP_FNS;\n } else if (type === 2 /* TriggerType.Hydrate */) {\n key = HYDRATE_TRIGGER_CLEANUP_FNS;\n }\n return key;\n}\n\n/** Actions that are supported by the tracing framework. */\nvar TracingAction;\n(function (TracingAction) {\n TracingAction[TracingAction[\"CHANGE_DETECTION\"] = 0] = \"CHANGE_DETECTION\";\n TracingAction[TracingAction[\"AFTER_NEXT_RENDER\"] = 1] = \"AFTER_NEXT_RENDER\";\n})(TracingAction || (TracingAction = {}));\n/**\n * Injection token for a `TracingService`, optionally provided.\n */\nconst TracingService = new InjectionToken(ngDevMode ? 'TracingService' : '');\nconst SCHEDULE_IN_ROOT_ZONE_DEFAULT = false;\nclass EventEmitter_ extends Subject {\n // tslint:disable-next-line:require-internal-with-underscore\n __isAsync;\n destroyRef = undefined;\n pendingTasks = undefined;\n constructor(isAsync = false) {\n super();\n this.__isAsync = isAsync;\n // Attempt to retrieve a `DestroyRef` and `PendingTasks` optionally.\n // For backwards compatibility reasons, this cannot be required.\n if (isInInjectionContext()) {\n // `DestroyRef` is optional because it is not available in all contexts.\n // But it is useful to properly complete the `EventEmitter` if used with `outputToObservable`\n // when the component/directive is destroyed. (See `outputToObservable` for more details.)\n this.destroyRef = inject(DestroyRef, {\n optional: true\n }) ?? undefined;\n this.pendingTasks = inject(PendingTasksInternal, {\n optional: true\n }) ?? undefined;\n }\n }\n emit(value) {\n const prevConsumer = setActiveConsumer(null);\n try {\n super.next(value);\n } finally {\n setActiveConsumer(prevConsumer);\n }\n }\n subscribe(observerOrNext, error, complete) {\n let nextFn = observerOrNext;\n let errorFn = error || (() => null);\n let completeFn = complete;\n if (observerOrNext && typeof observerOrNext === 'object') {\n const observer = observerOrNext;\n nextFn = observer.next?.bind(observer);\n errorFn = observer.error?.bind(observer);\n completeFn = observer.complete?.bind(observer);\n }\n if (this.__isAsync) {\n errorFn = this.wrapInTimeout(errorFn);\n if (nextFn) {\n nextFn = this.wrapInTimeout(nextFn);\n }\n if (completeFn) {\n completeFn = this.wrapInTimeout(completeFn);\n }\n }\n const sink = super.subscribe({\n next: nextFn,\n error: errorFn,\n complete: completeFn\n });\n if (observerOrNext instanceof Subscription) {\n observerOrNext.add(sink);\n }\n return sink;\n }\n wrapInTimeout(fn) {\n return value => {\n const taskId = this.pendingTasks?.add();\n setTimeout(() => {\n try {\n fn(value);\n } finally {\n if (taskId !== undefined) {\n this.pendingTasks?.remove(taskId);\n }\n }\n });\n };\n }\n}\n/**\n * @publicApi\n */\nconst EventEmitter = EventEmitter_;\n\n/**\n * Gets a scheduling function that runs the callback after the first of setTimeout and\n * requestAnimationFrame resolves.\n *\n * - `requestAnimationFrame` ensures that change detection runs ahead of a browser repaint.\n * This ensures that the create and update passes of a change detection always happen\n * in the same frame.\n * - When the browser is resource-starved, `rAF` can execute _before_ a `setTimeout` because\n * rendering is a very high priority process. This means that `setTimeout` cannot guarantee\n * same-frame create and update pass, when `setTimeout` is used to schedule the update phase.\n * - While `rAF` gives us the desirable same-frame updates, it has two limitations that\n * prevent it from being used alone. First, it does not run in background tabs, which would\n * prevent Angular from initializing an application when opened in a new tab (for example).\n * Second, repeated calls to requestAnimationFrame will execute at the refresh rate of the\n * hardware (~16ms for a 60Hz display). This would cause significant slowdown of tests that\n * are written with several updates and asserts in the form of \"update; await stable; assert;\".\n * - Both `setTimeout` and `rAF` are able to \"coalesce\" several events from a single user\n * interaction into a single change detection. Importantly, this reduces view tree traversals when\n * compared to an alternative timing mechanism like `queueMicrotask`, where change detection would\n * then be interleaves between each event.\n *\n * By running change detection after the first of `setTimeout` and `rAF` to execute, we get the\n * best of both worlds.\n *\n * @returns a function to cancel the scheduled callback\n */\nfunction scheduleCallbackWithRafRace(callback) {\n let timeoutId;\n let animationFrameId;\n function cleanup() {\n callback = noop;\n try {\n if (animationFrameId !== undefined && typeof cancelAnimationFrame === 'function') {\n cancelAnimationFrame(animationFrameId);\n }\n if (timeoutId !== undefined) {\n clearTimeout(timeoutId);\n }\n } catch {\n // Clearing/canceling can fail in tests due to the timing of functions being patched and unpatched\n // Just ignore the errors - we protect ourselves from this issue by also making the callback a no-op.\n }\n }\n timeoutId = setTimeout(() => {\n callback();\n cleanup();\n });\n if (typeof requestAnimationFrame === 'function') {\n animationFrameId = requestAnimationFrame(() => {\n callback();\n cleanup();\n });\n }\n return () => cleanup();\n}\nfunction scheduleCallbackWithMicrotask(callback) {\n queueMicrotask(() => callback());\n return () => {\n callback = noop;\n };\n}\nclass AsyncStackTaggingZoneSpec {\n createTask;\n constructor(namePrefix, consoleAsyncStackTaggingImpl = console) {\n this.name = 'asyncStackTagging for ' + namePrefix;\n this.createTask = consoleAsyncStackTaggingImpl?.createTask ?? (() => null);\n }\n // ZoneSpec implementation below.\n name;\n onScheduleTask(delegate, _current, target, task) {\n task.consoleTask = this.createTask(`Zone - ${task.source || task.type}`);\n return delegate.scheduleTask(target, task);\n }\n onInvokeTask(delegate, _currentZone, targetZone, task, applyThis, applyArgs) {\n let ret;\n if (task.consoleTask) {\n ret = task.consoleTask.run(() => delegate.invokeTask(targetZone, task, applyThis, applyArgs));\n } else {\n ret = delegate.invokeTask(targetZone, task, applyThis, applyArgs);\n }\n return ret;\n }\n}\nconst isAngularZoneProperty = 'isAngularZone';\nconst angularZoneInstanceIdProperty = isAngularZoneProperty + '_ID';\nlet ngZoneInstanceId = 0;\n/**\n * An injectable service for executing work inside or outside of the Angular zone.\n *\n * The most common use of this service is to optimize performance when starting a work consisting of\n * one or more asynchronous tasks that don't require UI updates or error handling to be handled by\n * Angular. Such tasks can be kicked off via {@link #runOutsideAngular} and if needed, these tasks\n * can reenter the Angular zone via {@link #run}.\n *\n * <!-- TODO: add/fix links to:\n * - docs explaining zones and the use of zones in Angular and change-detection\n * - link to runOutsideAngular/run (throughout this file!)\n * -->\n *\n * @usageNotes\n * ### Example\n *\n * ```ts\n * import {Component, NgZone} from '@angular/core';\n *\n * @Component({\n * selector: 'ng-zone-demo',\n * template: `\n * <h2>Demo: NgZone</h2>\n *\n * <p>Progress: {{progress}}%</p>\n * @if(progress >= 100) {\n * <p>Done processing {{label}} of Angular zone!</p>\n * }\n *\n * <button (click)=\"processWithinAngularZone()\">Process within Angular zone</button>\n * <button (click)=\"processOutsideOfAngularZone()\">Process outside of Angular zone</button>\n * `,\n * })\n * export class NgZoneDemo {\n * progress: number = 0;\n * label: string;\n *\n * constructor(private _ngZone: NgZone) {}\n *\n * // Loop inside the Angular zone\n * // so the UI DOES refresh after each setTimeout cycle\n * processWithinAngularZone() {\n * this.label = 'inside';\n * this.progress = 0;\n * this._increaseProgress(() => console.log('Inside Done!'));\n * }\n *\n * // Loop outside of the Angular zone\n * // so the UI DOES NOT refresh after each setTimeout cycle\n * processOutsideOfAngularZone() {\n * this.label = 'outside';\n * this.progress = 0;\n * this._ngZone.runOutsideAngular(() => {\n * this._increaseProgress(() => {\n * // reenter the Angular zone and display done\n * this._ngZone.run(() => { console.log('Outside Done!'); });\n * });\n * });\n * }\n *\n * _increaseProgress(doneCallback: () => void) {\n * this.progress += 1;\n * console.log(`Current progress: ${this.progress}%`);\n *\n * if (this.progress < 100) {\n * window.setTimeout(() => this._increaseProgress(doneCallback), 10);\n * } else {\n * doneCallback();\n * }\n * }\n * }\n * ```\n *\n * @publicApi\n */\nclass NgZone {\n hasPendingMacrotasks = false;\n hasPendingMicrotasks = false;\n /**\n * Whether there are no outstanding microtasks or macrotasks.\n */\n isStable = true;\n /**\n * Notifies when code enters Angular Zone. This gets fired first on VM Turn.\n */\n onUnstable = new EventEmitter(false);\n /**\n * Notifies when there is no more microtasks enqueued in the current VM Turn.\n * This is a hint for Angular to do change detection, which may enqueue more microtasks.\n * For this reason this event can fire multiple times per VM Turn.\n */\n onMicrotaskEmpty = new EventEmitter(false);\n /**\n * Notifies when the last `onMicrotaskEmpty` has run and there are no more microtasks, which\n * implies we are about to relinquish VM turn.\n * This event gets called just once.\n */\n onStable = new EventEmitter(false);\n /**\n * Notifies that an error has been delivered.\n */\n onError = new EventEmitter(false);\n constructor(options) {\n const {\n enableLongStackTrace = false,\n shouldCoalesceEventChangeDetection = false,\n shouldCoalesceRunChangeDetection = false,\n scheduleInRootZone = SCHEDULE_IN_ROOT_ZONE_DEFAULT\n } = options;\n if (typeof Zone == 'undefined') {\n throw new RuntimeError(908 /* RuntimeErrorCode.MISSING_ZONEJS */, ngDevMode && `In this configuration Angular requires Zone.js`);\n }\n Zone.assertZonePatched();\n const self = this;\n self._nesting = 0;\n self._outer = self._inner = Zone.current;\n // AsyncStackTaggingZoneSpec provides `linked stack traces` to show\n // where the async operation is scheduled. For more details, refer\n // to this article, https://developer.chrome.com/blog/devtools-better-angular-debugging/\n // And we only import this AsyncStackTaggingZoneSpec in development mode,\n // in the production mode, the AsyncStackTaggingZoneSpec will be tree shaken away.\n if (ngDevMode) {\n self._inner = self._inner.fork(new AsyncStackTaggingZoneSpec('Angular'));\n }\n if (Zone['TaskTrackingZoneSpec']) {\n self._inner = self._inner.fork(new Zone['TaskTrackingZoneSpec']());\n }\n if (enableLongStackTrace && Zone['longStackTraceZoneSpec']) {\n self._inner = self._inner.fork(Zone['longStackTraceZoneSpec']);\n }\n // if shouldCoalesceRunChangeDetection is true, all tasks including event tasks will be\n // coalesced, so shouldCoalesceEventChangeDetection option is not necessary and can be skipped.\n self.shouldCoalesceEventChangeDetection = !shouldCoalesceRunChangeDetection && shouldCoalesceEventChangeDetection;\n self.shouldCoalesceRunChangeDetection = shouldCoalesceRunChangeDetection;\n self.callbackScheduled = false;\n self.scheduleInRootZone = scheduleInRootZone;\n forkInnerZoneWithAngularBehavior(self);\n }\n /**\n This method checks whether the method call happens within an Angular Zone instance.\n */\n static isInAngularZone() {\n // Zone needs to be checked, because this method might be called even when NoopNgZone is used.\n return typeof Zone !== 'undefined' && Zone.current.get(isAngularZoneProperty) === true;\n }\n /**\n Assures that the method is called within the Angular Zone, otherwise throws an error.\n */\n static assertInAngularZone() {\n if (!NgZone.isInAngularZone()) {\n throw new RuntimeError(909 /* RuntimeErrorCode.UNEXPECTED_ZONE_STATE */, ngDevMode && 'Expected to be in Angular Zone, but it is not!');\n }\n }\n /**\n Assures that the method is called outside of the Angular Zone, otherwise throws an error.\n */\n static assertNotInAngularZone() {\n if (NgZone.isInAngularZone()) {\n throw new RuntimeError(909 /* RuntimeErrorCode.UNEXPECTED_ZONE_STATE */, ngDevMode && 'Expected to not be in Angular Zone, but it is!');\n }\n }\n /**\n * Executes the `fn` function synchronously within the Angular zone and returns value returned by\n * the function.\n *\n * Running functions via `run` allows you to reenter Angular zone from a task that was executed\n * outside of the Angular zone (typically started via {@link #runOutsideAngular}).\n *\n * Any future tasks or microtasks scheduled from within this function will continue executing from\n * within the Angular zone.\n *\n * If a synchronous error happens it will be rethrown and not reported via `onError`.\n */\n run(fn, applyThis, applyArgs) {\n return this._inner.run(fn, applyThis, applyArgs);\n }\n /**\n * Executes the `fn` function synchronously within the Angular zone as a task and returns value\n * returned by the function.\n *\n * Running functions via `runTask` allows you to reenter Angular zone from a task that was executed\n * outside of the Angular zone (typically started via {@link #runOutsideAngular}).\n *\n * Any future tasks or microtasks scheduled from within this function will continue executing from\n * within the Angular zone.\n *\n * If a synchronous error happens it will be rethrown and not reported via `onError`.\n */\n runTask(fn, applyThis, applyArgs, name) {\n const zone = this._inner;\n const task = zone.scheduleEventTask('NgZoneEvent: ' + name, fn, EMPTY_PAYLOAD, noop, noop);\n try {\n return zone.runTask(task, applyThis, applyArgs);\n } finally {\n zone.cancelTask(task);\n }\n }\n /**\n * Same as `run`, except that synchronous errors are caught and forwarded via `onError` and not\n * rethrown.\n */\n runGuarded(fn, applyThis, applyArgs) {\n return this._inner.runGuarded(fn, applyThis, applyArgs);\n }\n /**\n * Executes the `fn` function synchronously in Angular's parent zone and returns value returned by\n * the function.\n *\n * Running functions via {@link #runOutsideAngular} allows you to escape Angular's zone and do\n * work that\n * doesn't trigger Angular change-detection or is subject to Angular's error handling.\n *\n * Any future tasks or microtasks scheduled from within this function will continue executing from\n * outside of the Angular zone.\n *\n * Use {@link #run} to reenter the Angular zone and do work that updates the application model.\n */\n runOutsideAngular(fn) {\n return this._outer.run(fn);\n }\n}\nconst EMPTY_PAYLOAD = {};\nfunction checkStable(zone) {\n // TODO: @JiaLiPassion, should check zone.isCheckStableRunning to prevent\n // re-entry. The case is:\n //\n // @Component({...})\n // export class AppComponent {\n // constructor(private ngZone: NgZone) {\n // this.ngZone.onStable.subscribe(() => {\n // this.ngZone.run(() => console.log('stable'););\n // });\n // }\n //\n // The onStable subscriber run another function inside ngZone\n // which causes `checkStable()` re-entry.\n // But this fix causes some issues in g3, so this fix will be\n // launched in another PR.\n if (zone._nesting == 0 && !zone.hasPendingMicrotasks && !zone.isStable) {\n try {\n zone._nesting++;\n zone.onMicrotaskEmpty.emit(null);\n } finally {\n zone._nesting--;\n if (!zone.hasPendingMicrotasks) {\n try {\n zone.runOutsideAngular(() => zone.onStable.emit(null));\n } finally {\n zone.isStable = true;\n }\n }\n }\n }\n}\nfunction delayChangeDetectionForEvents(zone) {\n /**\n * We also need to check _nesting here\n * Consider the following case with shouldCoalesceRunChangeDetection = true\n *\n * ngZone.run(() => {});\n * ngZone.run(() => {});\n *\n * We want the two `ngZone.run()` only trigger one change detection\n * when shouldCoalesceRunChangeDetection is true.\n * And because in this case, change detection run in async way(requestAnimationFrame),\n * so we also need to check the _nesting here to prevent multiple\n * change detections.\n */\n if (zone.isCheckStableRunning || zone.callbackScheduled) {\n return;\n }\n zone.callbackScheduled = true;\n function scheduleCheckStable() {\n scheduleCallbackWithRafRace(() => {\n zone.callbackScheduled = false;\n updateMicroTaskStatus(zone);\n zone.isCheckStableRunning = true;\n checkStable(zone);\n zone.isCheckStableRunning = false;\n });\n }\n if (zone.scheduleInRootZone) {\n Zone.root.run(() => {\n scheduleCheckStable();\n });\n } else {\n zone._outer.run(() => {\n scheduleCheckStable();\n });\n }\n updateMicroTaskStatus(zone);\n}\nfunction forkInnerZoneWithAngularBehavior(zone) {\n const delayChangeDetectionForEventsDelegate = () => {\n delayChangeDetectionForEvents(zone);\n };\n const instanceId = ngZoneInstanceId++;\n zone._inner = zone._inner.fork({\n name: 'angular',\n properties: {\n [isAngularZoneProperty]: true,\n [angularZoneInstanceIdProperty]: instanceId,\n [angularZoneInstanceIdProperty + instanceId]: true\n },\n onInvokeTask: (delegate, current, target, task, applyThis, applyArgs) => {\n // Prevent triggering change detection when the flag is detected.\n if (shouldBeIgnoredByZone(applyArgs)) {\n return delegate.invokeTask(target, task, applyThis, applyArgs);\n }\n try {\n onEnter(zone);\n return delegate.invokeTask(target, task, applyThis, applyArgs);\n } finally {\n if (zone.shouldCoalesceEventChangeDetection && task.type === 'eventTask' || zone.shouldCoalesceRunChangeDetection) {\n delayChangeDetectionForEventsDelegate();\n }\n onLeave(zone);\n }\n },\n onInvoke: (delegate, current, target, callback, applyThis, applyArgs, source) => {\n try {\n onEnter(zone);\n return delegate.invoke(target, callback, applyThis, applyArgs, source);\n } finally {\n if (zone.shouldCoalesceRunChangeDetection &&\n // Do not delay change detection when the task is the scheduler's tick.\n // We need to synchronously trigger the stability logic so that the\n // zone-based scheduler can prevent a duplicate ApplicationRef.tick\n // by first checking if the scheduler tick is running. This does seem a bit roundabout,\n // but we _do_ still want to trigger all the correct events when we exit the zone.run\n // (`onMicrotaskEmpty` and `onStable` _should_ emit; developers can have code which\n // relies on these events happening after change detection runs).\n // Note: `zone.callbackScheduled` is already in delayChangeDetectionForEventsDelegate\n // but is added here as well to prevent reads of applyArgs when not necessary\n !zone.callbackScheduled && !isSchedulerTick(applyArgs)) {\n delayChangeDetectionForEventsDelegate();\n }\n onLeave(zone);\n }\n },\n onHasTask: (delegate, current, target, hasTaskState) => {\n delegate.hasTask(target, hasTaskState);\n if (current === target) {\n // We are only interested in hasTask events which originate from our zone\n // (A child hasTask event is not interesting to us)\n if (hasTaskState.change == 'microTask') {\n zone._hasPendingMicrotasks = hasTaskState.microTask;\n updateMicroTaskStatus(zone);\n checkStable(zone);\n } else if (hasTaskState.change == 'macroTask') {\n zone.hasPendingMacrotasks = hasTaskState.macroTask;\n }\n }\n },\n onHandleError: (delegate, current, target, error) => {\n delegate.handleError(target, error);\n zone.runOutsideAngular(() => zone.onError.emit(error));\n return false;\n }\n });\n}\nfunction updateMicroTaskStatus(zone) {\n if (zone._hasPendingMicrotasks || (zone.shouldCoalesceEventChangeDetection || zone.shouldCoalesceRunChangeDetection) && zone.callbackScheduled === true) {\n zone.hasPendingMicrotasks = true;\n } else {\n zone.hasPendingMicrotasks = false;\n }\n}\nfunction onEnter(zone) {\n zone._nesting++;\n if (zone.isStable) {\n zone.isStable = false;\n zone.onUnstable.emit(null);\n }\n}\nfunction onLeave(zone) {\n zone._nesting--;\n checkStable(zone);\n}\n/**\n * Provides a noop implementation of `NgZone` which does nothing. This zone requires explicit calls\n * to framework to perform rendering.\n */\nclass NoopNgZone {\n hasPendingMicrotasks = false;\n hasPendingMacrotasks = false;\n isStable = true;\n onUnstable = new EventEmitter();\n onMicrotaskEmpty = new EventEmitter();\n onStable = new EventEmitter();\n onError = new EventEmitter();\n run(fn, applyThis, applyArgs) {\n return fn.apply(applyThis, applyArgs);\n }\n runGuarded(fn, applyThis, applyArgs) {\n return fn.apply(applyThis, applyArgs);\n }\n runOutsideAngular(fn) {\n return fn();\n }\n runTask(fn, applyThis, applyArgs, name) {\n return fn.apply(applyThis, applyArgs);\n }\n}\nfunction shouldBeIgnoredByZone(applyArgs) {\n return hasApplyArgsData(applyArgs, '__ignore_ng_zone__');\n}\nfunction isSchedulerTick(applyArgs) {\n return hasApplyArgsData(applyArgs, '__scheduler_tick__');\n}\nfunction hasApplyArgsData(applyArgs, key) {\n if (!Array.isArray(applyArgs)) {\n return false;\n }\n // We should only ever get 1 arg passed through to invokeTask.\n // Short circuit here incase that behavior changes.\n if (applyArgs.length !== 1) {\n return false;\n }\n return applyArgs[0]?.data?.[key] === true;\n}\nfunction getNgZone(ngZoneToUse = 'zone.js', options) {\n if (ngZoneToUse === 'noop') {\n return new NoopNgZone();\n }\n if (ngZoneToUse === 'zone.js') {\n return new NgZone(options);\n }\n return ngZoneToUse;\n}\nclass AfterRenderManager {\n impl = null;\n execute() {\n this.impl?.execute();\n }\n /** @nocollapse */\n static ɵprov = /** @pureOrBreakMyCode */ /* @__PURE__ */__defineInjectable({\n token: AfterRenderManager,\n providedIn: 'root',\n factory: () => new AfterRenderManager()\n });\n}\nconst AFTER_RENDER_PHASES = /* @__PURE__ **/(() => [0 /* AfterRenderPhase.EarlyRead */, 1 /* AfterRenderPhase.Write */, 2 /* AfterRenderPhase.MixedReadWrite */, 3 /* AfterRenderPhase.Read */])();\nclass AfterRenderImpl {\n ngZone = inject(NgZone);\n scheduler = inject(ChangeDetectionScheduler);\n errorHandler = inject(ErrorHandler, {\n optional: true\n });\n /** Current set of active sequences. */\n sequences = new Set();\n /** Tracks registrations made during the current set of executions. */\n deferredRegistrations = new Set();\n /** Whether the `AfterRenderManager` is currently executing hooks. */\n executing = false;\n constructor() {\n // Inject the tracing service to make sure it's initialized.\n inject(TracingService, {\n optional: true\n });\n }\n /**\n * Run the sequence of phases of hooks, once through. As a result of executing some hooks, more\n * might be scheduled.\n */\n execute() {\n const hasSequencesToExecute = this.sequences.size > 0;\n if (hasSequencesToExecute) {\n profiler(16 /* ProfilerEvent.AfterRenderHooksStart */);\n }\n this.executing = true;\n for (const phase of AFTER_RENDER_PHASES) {\n for (const sequence of this.sequences) {\n if (sequence.erroredOrDestroyed || !sequence.hooks[phase]) {\n continue;\n }\n try {\n sequence.pipelinedValue = this.ngZone.runOutsideAngular(() => this.maybeTrace(() => {\n const hookFn = sequence.hooks[phase];\n const value = hookFn(sequence.pipelinedValue);\n return value;\n }, sequence.snapshot));\n } catch (err) {\n sequence.erroredOrDestroyed = true;\n this.errorHandler?.handleError(err);\n }\n }\n }\n this.executing = false;\n // Cleanup step to reset sequence state and also collect one-shot sequences for removal.\n for (const sequence of this.sequences) {\n sequence.afterRun();\n if (sequence.once) {\n this.sequences.delete(sequence);\n // Destroy the sequence so its on destroy callbacks can be cleaned up\n // immediately, instead of waiting until the injector is destroyed.\n sequence.destroy();\n }\n }\n for (const sequence of this.deferredRegistrations) {\n this.sequences.add(sequence);\n }\n if (this.deferredRegistrations.size > 0) {\n this.scheduler.notify(7 /* NotificationSource.RenderHook */);\n }\n this.deferredRegistrations.clear();\n if (hasSequencesToExecute) {\n profiler(17 /* ProfilerEvent.AfterRenderHooksEnd */);\n }\n }\n register(sequence) {\n const {\n view\n } = sequence;\n if (view !== undefined) {\n // Delay adding it to the manager, add it to the view instead.\n (view[AFTER_RENDER_SEQUENCES_TO_ADD] ??= []).push(sequence);\n // Mark the view for traversal to ensure we eventually schedule the afterNextRender.\n markAncestorsForTraversal(view);\n view[FLAGS] |= 8192 /* LViewFlags.HasChildViewsToRefresh */;\n } else if (!this.executing) {\n this.addSequence(sequence);\n } else {\n this.deferredRegistrations.add(sequence);\n }\n }\n addSequence(sequence) {\n this.sequences.add(sequence);\n // Trigger an `ApplicationRef.tick()` if one is not already pending/running, because we have a\n // new render hook that needs to run.\n this.scheduler.notify(7 /* NotificationSource.RenderHook */);\n }\n unregister(sequence) {\n if (this.executing && this.sequences.has(sequence)) {\n // We can't remove an `AfterRenderSequence` in the middle of iteration.\n // Instead, mark it as destroyed so it doesn't run any more, and mark it as one-shot so it'll\n // be removed at the end of the current execution.\n sequence.erroredOrDestroyed = true;\n sequence.pipelinedValue = undefined;\n sequence.once = true;\n } else {\n // It's safe to directly remove this sequence.\n this.sequences.delete(sequence);\n this.deferredRegistrations.delete(sequence);\n }\n }\n maybeTrace(fn, snapshot) {\n // Only trace the execution if the snapshot is defined.\n return snapshot ? snapshot.run(TracingAction.AFTER_NEXT_RENDER, fn) : fn();\n }\n /** @nocollapse */\n static ɵprov = /** @pureOrBreakMyCode */ /* @__PURE__ */__defineInjectable({\n token: AfterRenderImpl,\n providedIn: 'root',\n factory: () => new AfterRenderImpl()\n });\n}\nclass AfterRenderSequence {\n impl;\n hooks;\n view;\n once;\n snapshot;\n /**\n * Whether this sequence errored or was destroyed during this execution, and hooks should no\n * longer run for it.\n */\n erroredOrDestroyed = false;\n /**\n * The value returned by the last hook execution (if any), ready to be pipelined into the next\n * one.\n */\n pipelinedValue = undefined;\n unregisterOnDestroy;\n constructor(impl, hooks, view, once, destroyRef, snapshot = null) {\n this.impl = impl;\n this.hooks = hooks;\n this.view = view;\n this.once = once;\n this.snapshot = snapshot;\n this.unregisterOnDestroy = destroyRef?.onDestroy(() => this.destroy());\n }\n afterRun() {\n this.erroredOrDestroyed = false;\n this.pipelinedValue = undefined;\n // Clear the tracing snapshot after the initial run. This snapshot only\n // associates the initial run of the hook with the context that created it.\n // Follow-up runs are independent of that initial context and have different\n // triggers.\n this.snapshot?.dispose();\n this.snapshot = null;\n }\n destroy() {\n this.impl.unregister(this);\n this.unregisterOnDestroy?.();\n const scheduled = this.view?.[AFTER_RENDER_SEQUENCES_TO_ADD];\n if (scheduled) {\n this.view[AFTER_RENDER_SEQUENCES_TO_ADD] = scheduled.filter(s => s !== this);\n }\n }\n}\nfunction afterEveryRender(callbackOrSpec, options) {\n ngDevMode && assertNotInReactiveContext(afterEveryRender, 'Call `afterEveryRender` outside of a reactive context. For example, schedule the render ' + 'callback inside the component constructor`.');\n if (ngDevMode && !options?.injector) {\n assertInInjectionContext(afterEveryRender);\n }\n const injector = options?.injector ?? inject(Injector);\n if (typeof ngServerMode !== 'undefined' && ngServerMode) {\n return NOOP_AFTER_RENDER_REF;\n }\n performanceMarkFeature('NgAfterRender');\n return afterEveryRenderImpl(callbackOrSpec, injector, options, /* once */false);\n}\nfunction afterNextRender(callbackOrSpec, options) {\n if (ngDevMode && !options?.injector) {\n assertInInjectionContext(afterNextRender);\n }\n const injector = options?.injector ?? inject(Injector);\n if (typeof ngServerMode !== 'undefined' && ngServerMode) {\n return NOOP_AFTER_RENDER_REF;\n }\n performanceMarkFeature('NgAfterNextRender');\n return afterEveryRenderImpl(callbackOrSpec, injector, options, /* once */true);\n}\nfunction getHooks(callbackOrSpec) {\n if (callbackOrSpec instanceof Function) {\n return [undefined, undefined, /* MixedReadWrite */callbackOrSpec, undefined];\n } else {\n return [callbackOrSpec.earlyRead, callbackOrSpec.write, callbackOrSpec.mixedReadWrite, callbackOrSpec.read];\n }\n}\n/**\n * Shared implementation for `afterEveryRender` and `afterNextRender`.\n */\nfunction afterEveryRenderImpl(callbackOrSpec, injector, options, once) {\n const manager = injector.get(AfterRenderManager);\n // Lazily initialize the handler implementation, if necessary. This is so that it can be\n // tree-shaken if `afterEveryRender` and `afterNextRender` aren't used.\n manager.impl ??= injector.get(AfterRenderImpl);\n const tracing = injector.get(TracingService, null, {\n optional: true\n });\n const destroyRef = options?.manualCleanup !== true ? injector.get(DestroyRef) : null;\n const viewContext = injector.get(ViewContext, null, {\n optional: true\n });\n const sequence = new AfterRenderSequence(manager.impl, getHooks(callbackOrSpec), viewContext?.view, once, destroyRef, tracing?.snapshot(null));\n manager.impl.register(sequence);\n return sequence;\n}\n/** `AfterRenderRef` that does nothing. */\nconst NOOP_AFTER_RENDER_REF = {\n destroy() {}\n};\n\n/**\n * Calculates a data slot index for defer block info (either static or\n * instance-specific), given an index of a defer instruction.\n */\nfunction getDeferBlockDataIndex(deferBlockIndex) {\n // Instance state is located at the *next* position\n // after the defer block slot in an LView or TView.data.\n return deferBlockIndex + 1;\n}\n/** Retrieves a defer block state from an LView, given a TNode that represents a block. */\nfunction getLDeferBlockDetails(lView, tNode) {\n const tView = lView[TVIEW];\n const slotIndex = getDeferBlockDataIndex(tNode.index);\n ngDevMode && assertIndexInDeclRange(tView, slotIndex);\n return lView[slotIndex];\n}\n/** Stores a defer block instance state in LView. */\nfunction setLDeferBlockDetails(lView, deferBlockIndex, lDetails) {\n const tView = lView[TVIEW];\n const slotIndex = getDeferBlockDataIndex(deferBlockIndex);\n ngDevMode && assertIndexInDeclRange(tView, slotIndex);\n lView[slotIndex] = lDetails;\n}\n/** Retrieves static info about a defer block, given a TView and a TNode that represents a block. */\nfunction getTDeferBlockDetails(tView, tNode) {\n const slotIndex = getDeferBlockDataIndex(tNode.index);\n ngDevMode && assertIndexInDeclRange(tView, slotIndex);\n return tView.data[slotIndex];\n}\n/** Stores a defer block static info in `TView.data`. */\nfunction setTDeferBlockDetails(tView, deferBlockIndex, deferBlockConfig) {\n const slotIndex = getDeferBlockDataIndex(deferBlockIndex);\n ngDevMode && assertIndexInDeclRange(tView, slotIndex);\n tView.data[slotIndex] = deferBlockConfig;\n}\nfunction getTemplateIndexForState(newState, hostLView, tNode) {\n const tView = hostLView[TVIEW];\n const tDetails = getTDeferBlockDetails(tView, tNode);\n switch (newState) {\n case DeferBlockState.Complete:\n return tDetails.primaryTmplIndex;\n case DeferBlockState.Loading:\n return tDetails.loadingTmplIndex;\n case DeferBlockState.Error:\n return tDetails.errorTmplIndex;\n case DeferBlockState.Placeholder:\n return tDetails.placeholderTmplIndex;\n default:\n ngDevMode && throwError(`Unexpected defer block state: ${newState}`);\n return null;\n }\n}\n/**\n * Returns a minimum amount of time that a given state should be rendered for,\n * taking into account `minimum` parameter value. If the `minimum` value is\n * not specified - returns `null`.\n */\nfunction getMinimumDurationForState(tDetails, currentState) {\n if (currentState === DeferBlockState.Placeholder) {\n return tDetails.placeholderBlockConfig?.[MINIMUM_SLOT] ?? null;\n } else if (currentState === DeferBlockState.Loading) {\n return tDetails.loadingBlockConfig?.[MINIMUM_SLOT] ?? null;\n }\n return null;\n}\n/** Retrieves the value of the `after` parameter on the @loading block. */\nfunction getLoadingBlockAfter(tDetails) {\n return tDetails.loadingBlockConfig?.[LOADING_AFTER_SLOT] ?? null;\n}\n/**\n * Adds downloaded dependencies into a directive or a pipe registry,\n * making sure that a dependency doesn't yet exist in the registry.\n */\nfunction addDepsToRegistry(currentDeps, newDeps) {\n if (!currentDeps || currentDeps.length === 0) {\n return newDeps;\n }\n const currentDepSet = new Set(currentDeps);\n for (const dep of newDeps) {\n currentDepSet.add(dep);\n }\n // If `currentDeps` is the same length, there were no new deps and can\n // return the original array.\n return currentDeps.length === currentDepSet.size ? currentDeps : Array.from(currentDepSet);\n}\n/** Retrieves a TNode that represents main content of a defer block. */\nfunction getPrimaryBlockTNode(tView, tDetails) {\n const adjustedIndex = tDetails.primaryTmplIndex + HEADER_OFFSET;\n return getTNode(tView, adjustedIndex);\n}\n/**\n * Asserts whether all dependencies for a defer block are loaded.\n * Always run this function (in dev mode) before rendering a defer\n * block in completed state.\n */\nfunction assertDeferredDependenciesLoaded(tDetails) {\n assertEqual(tDetails.loadingState, DeferDependenciesLoadingState.COMPLETE, 'Expecting all deferred dependencies to be loaded.');\n}\n/**\n * Determines if a given value matches the expected structure of a defer block\n *\n * We can safely rely on the primaryTmplIndex because every defer block requires\n * that a primary template exists. All the other template options are optional.\n */\nfunction isTDeferBlockDetails(value) {\n return value !== null && typeof value === 'object' && typeof value.primaryTmplIndex === 'number';\n}\n/**\n * Whether a given TNode represents a defer block.\n */\nfunction isDeferBlock(tView, tNode) {\n let tDetails = null;\n const slotIndex = getDeferBlockDataIndex(tNode.index);\n // Check if a slot index is in the reasonable range.\n // Note: we do `-1` on the right border, since defer block details are stored\n // in the `n+1` slot, see `getDeferBlockDataIndex` for more info.\n if (HEADER_OFFSET < slotIndex && slotIndex < tView.bindingStartIndex) {\n tDetails = getTDeferBlockDetails(tView, tNode);\n }\n return !!tDetails && isTDeferBlockDetails(tDetails);\n}\n/**\n * Tracks debugging information about a trigger.\n * @param tView TView in which the trigger is declared.\n * @param tNode TNode on which the trigger is declared.\n * @param textRepresentation Text representation of the trigger to be used for debugging purposes.\n */\nfunction trackTriggerForDebugging(tView, tNode, textRepresentation) {\n const tDetails = getTDeferBlockDetails(tView, tNode);\n tDetails.debug ??= {};\n tDetails.debug.triggers ??= new Set();\n tDetails.debug.triggers.add(textRepresentation);\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/**\n * Wrapper for onViewport trigger with angular specific Injector for resolving NgZone instance\n * and creating an IntersectionObserver which can run outside of Angular zone.\n * @param trigger Element that is the trigger.\n * @param callback Callback to be invoked when the trigger comes into the viewport.\n * @param injector Injector that can be used by the trigger to resolve DI tokens.\n */\nfunction onViewportWrapper(trigger, callback, injector) {\n const ngZone = injector.get(NgZone);\n return onViewport(trigger, () => ngZone.run(callback), () => ngZone.runOutsideAngular(() => createIntersectionObserver()));\n}\n/**\n * Helper function to get the LView in which a deferred block's trigger is rendered.\n * @param deferredHostLView LView in which the deferred block is defined.\n * @param deferredTNode TNode defining the deferred block.\n * @param walkUpTimes Number of times to go up in the view hierarchy to find the trigger's view.\n * A negative value means that the trigger is inside the block's placeholder, while an undefined\n * value means that the trigger is in the same LView as the deferred block.\n */\nfunction getTriggerLView(deferredHostLView, deferredTNode, walkUpTimes) {\n // The trigger is in the same view, we don't need to traverse.\n if (walkUpTimes == null) {\n return deferredHostLView;\n }\n // A positive value or zero means that the trigger is in a parent view.\n if (walkUpTimes >= 0) {\n return walkUpViews(walkUpTimes, deferredHostLView);\n }\n // If the value is negative, it means that the trigger is inside the placeholder.\n const deferredContainer = deferredHostLView[deferredTNode.index];\n ngDevMode && assertLContainer(deferredContainer);\n const triggerLView = deferredContainer[CONTAINER_HEADER_OFFSET] ?? null;\n // We need to null check, because the placeholder might not have been rendered yet.\n if (ngDevMode && triggerLView !== null) {\n const lDetails = getLDeferBlockDetails(deferredHostLView, deferredTNode);\n const renderedState = lDetails[DEFER_BLOCK_STATE];\n assertEqual(renderedState, DeferBlockState.Placeholder, 'Expected a placeholder to be rendered in this defer block.');\n assertLView(triggerLView);\n }\n return triggerLView;\n}\n/**\n * Gets the element that a deferred block's trigger is pointing to.\n * @param triggerLView LView in which the trigger is defined.\n * @param triggerIndex Index at which the trigger element should've been rendered.\n */\nfunction getTriggerElement(triggerLView, triggerIndex) {\n const element = getNativeByIndex(HEADER_OFFSET + triggerIndex, triggerLView);\n ngDevMode && assertElement(element);\n return element;\n}\n/**\n * Registers a DOM-node based trigger.\n * @param initialLView LView in which the defer block is rendered.\n * @param tNode TNode representing the defer block.\n * @param triggerIndex Index at which to find the trigger element.\n * @param walkUpTimes Number of times to go up/down in the view hierarchy to find the trigger.\n * @param registerFn Function that will register the DOM events.\n * @param callback Callback to be invoked when the trigger receives the event that should render\n * the deferred block.\n * @param type Trigger type to distinguish between regular and prefetch triggers.\n */\nfunction registerDomTrigger(initialLView, tNode, triggerIndex, walkUpTimes, registerFn, callback, type) {\n const injector = initialLView[INJECTOR];\n const zone = injector.get(NgZone);\n let poll;\n function pollDomTrigger() {\n // If the initial view was destroyed, we don't need to do anything.\n if (isDestroyed(initialLView)) {\n poll.destroy();\n return;\n }\n const lDetails = getLDeferBlockDetails(initialLView, tNode);\n const renderedState = lDetails[DEFER_BLOCK_STATE];\n // If the block was loaded before the trigger was resolved, we don't need to do anything.\n if (renderedState !== DeferBlockInternalState.Initial && renderedState !== DeferBlockState.Placeholder) {\n poll.destroy();\n return;\n }\n const triggerLView = getTriggerLView(initialLView, tNode, walkUpTimes);\n // Keep polling until we resolve the trigger's LView.\n if (!triggerLView) {\n // Keep polling.\n return;\n }\n poll.destroy();\n // It's possible that the trigger's view was destroyed before we resolved the trigger element.\n if (isDestroyed(triggerLView)) {\n return;\n }\n const element = getTriggerElement(triggerLView, triggerIndex);\n const cleanup = registerFn(element, () => {\n // `pollDomTrigger` runs outside the zone (because of `afterNextRender`) and registers its\n // listeners outside the zone, so we jump back into the zone prior to running the callback.\n zone.run(() => {\n if (initialLView !== triggerLView) {\n removeLViewOnDestroy(triggerLView, cleanup);\n }\n callback();\n });\n }, injector);\n // The trigger and deferred block might be in different LViews.\n // For the main LView the cleanup would happen as a part of\n // `storeTriggerCleanupFn` logic. For trigger LView we register\n // a cleanup function there to remove event handlers in case an\n // LView gets destroyed before a trigger is invoked.\n if (initialLView !== triggerLView) {\n storeLViewOnDestroy(triggerLView, cleanup);\n }\n storeTriggerCleanupFn(type, lDetails, cleanup);\n }\n // Begin polling for the trigger.\n poll = afterEveryRender({\n read: pollDomTrigger\n }, {\n injector\n });\n}\n\n/**\n * Helper function to schedule a callback to be invoked when a browser becomes idle.\n *\n * @param callback A function to be invoked when a browser becomes idle.\n * @param injector injector for the app\n */\nfunction onIdle(callback, injector) {\n const scheduler = injector.get(IdleScheduler);\n const cleanupFn = () => scheduler.remove(callback);\n scheduler.add(callback);\n return cleanupFn;\n}\n/**\n * Use shims for the `requestIdleCallback` and `cancelIdleCallback` functions for\n * environments where those functions are not available (e.g. Node.js and Safari).\n *\n * Note: we wrap the `requestIdleCallback` call into a function, so that it can be\n * overridden/mocked in test environment and picked up by the runtime code.\n */\nconst _requestIdleCallback = () => typeof requestIdleCallback !== 'undefined' ? requestIdleCallback : setTimeout;\nconst _cancelIdleCallback = () => typeof requestIdleCallback !== 'undefined' ? cancelIdleCallback : clearTimeout;\n/**\n * Helper service to schedule `requestIdleCallback`s for batches of defer blocks,\n * to avoid calling `requestIdleCallback` for each defer block (e.g. if\n * defer blocks are defined inside a for loop).\n */\nclass IdleScheduler {\n // Indicates whether current callbacks are being invoked.\n executingCallbacks = false;\n // Currently scheduled idle callback id.\n idleId = null;\n // Set of callbacks to be invoked next.\n current = new Set();\n // Set of callbacks collected while invoking current set of callbacks.\n // Those callbacks are scheduled for the next idle period.\n deferred = new Set();\n ngZone = inject(NgZone);\n requestIdleCallbackFn = _requestIdleCallback().bind(globalThis);\n cancelIdleCallbackFn = _cancelIdleCallback().bind(globalThis);\n add(callback) {\n const target = this.executingCallbacks ? this.deferred : this.current;\n target.add(callback);\n if (this.idleId === null) {\n this.scheduleIdleCallback();\n }\n }\n remove(callback) {\n const {\n current,\n deferred\n } = this;\n current.delete(callback);\n deferred.delete(callback);\n // If the last callback was removed and there is a pending\n // idle callback - cancel it.\n if (current.size === 0 && deferred.size === 0) {\n this.cancelIdleCallback();\n }\n }\n scheduleIdleCallback() {\n const callback = () => {\n this.cancelIdleCallback();\n this.executingCallbacks = true;\n for (const callback of this.current) {\n callback();\n }\n this.current.clear();\n this.executingCallbacks = false;\n // If there are any callbacks added during an invocation\n // of the current ones - make them \"current\" and schedule\n // a new idle callback.\n if (this.deferred.size > 0) {\n for (const callback of this.deferred) {\n this.current.add(callback);\n }\n this.deferred.clear();\n this.scheduleIdleCallback();\n }\n };\n // Ensure that the callback runs in the NgZone since\n // the `requestIdleCallback` is not currently patched by Zone.js.\n this.idleId = this.requestIdleCallbackFn(() => this.ngZone.run(callback));\n }\n cancelIdleCallback() {\n if (this.idleId !== null) {\n this.cancelIdleCallbackFn(this.idleId);\n this.idleId = null;\n }\n }\n ngOnDestroy() {\n this.cancelIdleCallback();\n this.current.clear();\n this.deferred.clear();\n }\n /** @nocollapse */\n static ɵprov = /** @pureOrBreakMyCode */ /* @__PURE__ */__defineInjectable({\n token: IdleScheduler,\n providedIn: 'root',\n factory: () => new IdleScheduler()\n });\n}\n\n/**\n * Returns a function that captures a provided delay.\n * Invoking the returned function schedules a trigger.\n */\nfunction onTimer(delay) {\n return (callback, injector) => scheduleTimerTrigger(delay, callback, injector);\n}\n/**\n * Schedules a callback to be invoked after a given timeout.\n *\n * @param delay A number of ms to wait until firing a callback.\n * @param callback A function to be invoked after a timeout.\n * @param injector injector for the app.\n */\nfunction scheduleTimerTrigger(delay, callback, injector) {\n const scheduler = injector.get(TimerScheduler);\n const ngZone = injector.get(NgZone);\n const cleanupFn = () => scheduler.remove(callback);\n scheduler.add(delay, callback, ngZone);\n return cleanupFn;\n}\n/**\n * Helper service to schedule `setTimeout`s for batches of defer blocks,\n * to avoid calling `setTimeout` for each defer block (e.g. if defer blocks\n * are created inside a for loop).\n */\nclass TimerScheduler {\n // Indicates whether current callbacks are being invoked.\n executingCallbacks = false;\n // Currently scheduled `setTimeout` id.\n timeoutId = null;\n // When currently scheduled timer would fire.\n invokeTimerAt = null;\n // List of callbacks to be invoked.\n // For each callback we also store a timestamp on when the callback\n // should be invoked. We store timestamps and callback functions\n // in a flat array to avoid creating new objects for each entry.\n // [timestamp1, callback1, timestamp2, callback2, ...]\n current = [];\n // List of callbacks collected while invoking current set of callbacks.\n // Those callbacks are added to the \"current\" queue at the end of\n // the current callback invocation. The shape of this list is the same\n // as the shape of the `current` list.\n deferred = [];\n add(delay, callback, ngZone) {\n const target = this.executingCallbacks ? this.deferred : this.current;\n this.addToQueue(target, Date.now() + delay, callback);\n this.scheduleTimer(ngZone);\n }\n remove(callback) {\n const {\n current,\n deferred\n } = this;\n const callbackIndex = this.removeFromQueue(current, callback);\n if (callbackIndex === -1) {\n // Try cleaning up deferred queue only in case\n // we didn't find a callback in the \"current\" queue.\n this.removeFromQueue(deferred, callback);\n }\n // If the last callback was removed and there is a pending timeout - cancel it.\n if (current.length === 0 && deferred.length === 0) {\n this.clearTimeout();\n }\n }\n addToQueue(target, invokeAt, callback) {\n let insertAtIndex = target.length;\n for (let i = 0; i < target.length; i += 2) {\n const invokeQueuedCallbackAt = target[i];\n if (invokeQueuedCallbackAt > invokeAt) {\n // We've reached a first timer that is scheduled\n // for a later time than what we are trying to insert.\n // This is the location at which we need to insert,\n // no need to iterate further.\n insertAtIndex = i;\n break;\n }\n }\n arrayInsert2(target, insertAtIndex, invokeAt, callback);\n }\n removeFromQueue(target, callback) {\n let index = -1;\n for (let i = 0; i < target.length; i += 2) {\n const queuedCallback = target[i + 1];\n if (queuedCallback === callback) {\n index = i;\n break;\n }\n }\n if (index > -1) {\n // Remove 2 elements: a timestamp slot and\n // the following slot with a callback function.\n arraySplice(target, index, 2);\n }\n return index;\n }\n scheduleTimer(ngZone) {\n const callback = () => {\n this.clearTimeout();\n this.executingCallbacks = true;\n // Clone the current state of the queue, since it might be altered\n // as we invoke callbacks.\n const current = [...this.current];\n // Invoke callbacks that were scheduled to run before the current time.\n const now = Date.now();\n for (let i = 0; i < current.length; i += 2) {\n const invokeAt = current[i];\n const callback = current[i + 1];\n if (invokeAt <= now) {\n callback();\n } else {\n // We've reached a timer that should not be invoked yet.\n break;\n }\n }\n // The state of the queue might've changed after callbacks invocation,\n // run the cleanup logic based on the *current* state of the queue.\n let lastCallbackIndex = -1;\n for (let i = 0; i < this.current.length; i += 2) {\n const invokeAt = this.current[i];\n if (invokeAt <= now) {\n // Add +1 to account for a callback function that\n // goes after the timestamp in events array.\n lastCallbackIndex = i + 1;\n } else {\n // We've reached a timer that should not be invoked yet.\n break;\n }\n }\n if (lastCallbackIndex >= 0) {\n arraySplice(this.current, 0, lastCallbackIndex + 1);\n }\n this.executingCallbacks = false;\n // If there are any callbacks added during an invocation\n // of the current ones - move them over to the \"current\"\n // queue.\n if (this.deferred.length > 0) {\n for (let i = 0; i < this.deferred.length; i += 2) {\n const invokeAt = this.deferred[i];\n const callback = this.deferred[i + 1];\n this.addToQueue(this.current, invokeAt, callback);\n }\n this.deferred.length = 0;\n }\n this.scheduleTimer(ngZone);\n };\n // Avoid running timer callbacks more than once per\n // average frame duration. This is needed for better\n // batching and to avoid kicking off excessive change\n // detection cycles.\n const FRAME_DURATION_MS = 16; // 1000ms / 60fps\n if (this.current.length > 0) {\n const now = Date.now();\n // First element in the queue points at the timestamp\n // of the first (earliest) event.\n const invokeAt = this.current[0];\n if (this.timeoutId === null ||\n // Reschedule a timer in case a queue contains an item with\n // an earlier timestamp and the delta is more than an average\n // frame duration.\n this.invokeTimerAt && this.invokeTimerAt - invokeAt > FRAME_DURATION_MS) {\n // There was a timeout already, but an earlier event was added\n // into the queue. In this case we drop an old timer and setup\n // a new one with an updated (smaller) timeout.\n this.clearTimeout();\n const timeout = Math.max(invokeAt - now, FRAME_DURATION_MS);\n this.invokeTimerAt = invokeAt;\n this.timeoutId = ngZone.runOutsideAngular(() => {\n return setTimeout(() => ngZone.run(callback), timeout);\n });\n }\n }\n }\n clearTimeout() {\n if (this.timeoutId !== null) {\n clearTimeout(this.timeoutId);\n this.timeoutId = null;\n }\n }\n ngOnDestroy() {\n this.clearTimeout();\n this.current.length = 0;\n this.deferred.length = 0;\n }\n /** @nocollapse */\n static ɵprov = /** @pureOrBreakMyCode */ /* @__PURE__ */__defineInjectable({\n token: TimerScheduler,\n providedIn: 'root',\n factory: () => new TimerScheduler()\n });\n}\n\n/**\n * A service used by the framework to create and cache injector instances.\n *\n * This service is used to create a single injector instance for each defer\n * block definition, to avoid creating an injector for each defer block instance\n * of a certain type.\n */\nclass CachedInjectorService {\n cachedInjectors = new Map();\n getOrCreateInjector(key, parentInjector, providers, debugName) {\n if (!this.cachedInjectors.has(key)) {\n const injector = providers.length > 0 ? createEnvironmentInjector(providers, parentInjector, debugName) : null;\n this.cachedInjectors.set(key, injector);\n }\n return this.cachedInjectors.get(key);\n }\n ngOnDestroy() {\n try {\n for (const injector of this.cachedInjectors.values()) {\n if (injector !== null) {\n injector.destroy();\n }\n }\n } finally {\n this.cachedInjectors.clear();\n }\n }\n /** @nocollapse */\n static ɵprov = /** @pureOrBreakMyCode */ /* @__PURE__ */__defineInjectable({\n token: CachedInjectorService,\n providedIn: 'environment',\n factory: () => new CachedInjectorService()\n });\n}\n\n/**\n * **INTERNAL**, avoid referencing it in application code.\n * *\n * Injector token that allows to provide `DeferBlockDependencyInterceptor` class\n * implementation.\n *\n * This token is only injected in devMode\n */\nconst DEFER_BLOCK_DEPENDENCY_INTERCEPTOR = /* @__PURE__ */new InjectionToken('DEFER_BLOCK_DEPENDENCY_INTERCEPTOR');\n/**\n * **INTERNAL**, token used for configuring defer block behavior.\n */\nconst DEFER_BLOCK_CONFIG = new InjectionToken(ngDevMode ? 'DEFER_BLOCK_CONFIG' : '');\n/**\n * Checks whether there is a cached injector associated with a given defer block\n * declaration and returns if it exists. If there is no cached injector present -\n * creates a new injector and stores in the cache.\n */\nfunction getOrCreateEnvironmentInjector(parentInjector, tDetails, providers) {\n return parentInjector.get(CachedInjectorService).getOrCreateInjector(tDetails, parentInjector, providers, ngDevMode ? 'DeferBlock Injector' : '');\n}\n/** Injector Helpers */\n/**\n * Creates a new injector, which contains providers collected from dependencies (NgModules) of\n * defer-loaded components. This function detects different types of parent injectors and creates\n * a new injector based on that.\n */\nfunction createDeferBlockInjector(parentInjector, tDetails, providers) {\n // Check if the parent injector is an instance of a `ChainedInjector`.\n //\n // In this case, we retain the shape of the injector and use a newly created\n // `EnvironmentInjector` as a parent in the `ChainedInjector`. That is needed to\n // make sure that the primary injector gets consulted first (since it's typically\n // a NodeInjector) and `EnvironmentInjector` tree is consulted after that.\n if (parentInjector instanceof ChainedInjector) {\n const origInjector = parentInjector.injector;\n // Guaranteed to be an environment injector\n const parentEnvInjector = parentInjector.parentInjector;\n const envInjector = getOrCreateEnvironmentInjector(parentEnvInjector, tDetails, providers);\n return new ChainedInjector(origInjector, envInjector);\n }\n const parentEnvInjector = parentInjector.get(EnvironmentInjector);\n // If the `parentInjector` is *not* an `EnvironmentInjector` - we need to create\n // a new `ChainedInjector` with the following setup:\n //\n // - the provided `parentInjector` becomes a primary injector\n // - an existing (real) `EnvironmentInjector` becomes a parent injector for\n // a newly-created one, which contains extra providers\n //\n // So the final order in which injectors would be consulted in this case would look like this:\n //\n // 1. Provided `parentInjector`\n // 2. Newly-created `EnvironmentInjector` with extra providers\n // 3. `EnvironmentInjector` from the `parentInjector`\n if (parentEnvInjector !== parentInjector) {\n const envInjector = getOrCreateEnvironmentInjector(parentEnvInjector, tDetails, providers);\n return new ChainedInjector(parentInjector, envInjector);\n }\n // The `parentInjector` is an instance of an `EnvironmentInjector`.\n // No need for special handling, we can use `parentInjector` as a\n // parent injector directly.\n return getOrCreateEnvironmentInjector(parentInjector, tDetails, providers);\n}\n/** Rendering Helpers */\n/**\n * Transitions a defer block to the new state. Updates the necessary\n * data structures and renders corresponding block.\n *\n * @param newState New state that should be applied to the defer block.\n * @param tNode TNode that represents a defer block.\n * @param lContainer Represents an instance of a defer block.\n * @param skipTimerScheduling Indicates that `@loading` and `@placeholder` block\n * should be rendered immediately, even if they have `after` or `minimum` config\n * options setup. This flag to needed for testing APIs to transition defer block\n * between states via `DeferFixture.render` method.\n */\nfunction renderDeferBlockState(newState, tNode, lContainer, skipTimerScheduling = false) {\n const hostLView = lContainer[PARENT];\n const hostTView = hostLView[TVIEW];\n // Check if this view is not destroyed. Since the loading process was async,\n // the view might end up being destroyed by the time rendering happens.\n if (isDestroyed(hostLView)) return;\n // Make sure this TNode belongs to TView that represents host LView.\n ngDevMode && assertTNodeForLView(tNode, hostLView);\n const lDetails = getLDeferBlockDetails(hostLView, tNode);\n ngDevMode && assertDefined(lDetails, 'Expected a defer block state defined');\n const currentState = lDetails[DEFER_BLOCK_STATE];\n const ssrState = lDetails[SSR_BLOCK_STATE];\n if (ssrState !== null && newState < ssrState) {\n return; // trying to render a previous state, exit\n }\n if (isValidStateChange(currentState, newState) && isValidStateChange(lDetails[NEXT_DEFER_BLOCK_STATE] ?? -1, newState)) {\n const tDetails = getTDeferBlockDetails(hostTView, tNode);\n // Skips scheduling on the server since it can delay the server response.\n const needsScheduling = !skipTimerScheduling && (typeof ngServerMode === 'undefined' || !ngServerMode) && (getLoadingBlockAfter(tDetails) !== null || getMinimumDurationForState(tDetails, DeferBlockState.Loading) !== null || getMinimumDurationForState(tDetails, DeferBlockState.Placeholder));\n if (ngDevMode && needsScheduling) {\n assertDefined(applyDeferBlockStateWithSchedulingImpl, 'Expected scheduling function to be defined');\n }\n const applyStateFn = needsScheduling ? applyDeferBlockStateWithSchedulingImpl : applyDeferBlockState;\n try {\n applyStateFn(newState, lDetails, lContainer, tNode, hostLView);\n } catch (error) {\n handleUncaughtError(hostLView, error);\n }\n }\n}\nfunction findMatchingDehydratedViewForDeferBlock(lContainer, lDetails) {\n const dehydratedViewIx = lContainer[DEHYDRATED_VIEWS]?.findIndex(view => view.data[DEFER_BLOCK_STATE$1] === lDetails[DEFER_BLOCK_STATE]) ?? -1;\n const dehydratedView = dehydratedViewIx > -1 ? lContainer[DEHYDRATED_VIEWS][dehydratedViewIx] : null;\n return {\n dehydratedView,\n dehydratedViewIx\n };\n}\n/**\n * Applies changes to the DOM to reflect a given state.\n */\nfunction applyDeferBlockState(newState, lDetails, lContainer, tNode, hostLView) {\n profiler(20 /* ProfilerEvent.DeferBlockStateStart */);\n const stateTmplIndex = getTemplateIndexForState(newState, hostLView, tNode);\n if (stateTmplIndex !== null) {\n lDetails[DEFER_BLOCK_STATE] = newState;\n const hostTView = hostLView[TVIEW];\n const adjustedIndex = stateTmplIndex + HEADER_OFFSET;\n // The TNode that represents a template that will activated in the defer block\n const activeBlockTNode = getTNode(hostTView, adjustedIndex);\n // There is only 1 view that can be present in an LContainer that\n // represents a defer block, so always refer to the first one.\n const viewIndex = 0;\n removeLViewFromLContainer(lContainer, viewIndex);\n let injector;\n if (newState === DeferBlockState.Complete) {\n // When we render a defer block in completed state, there might be\n // newly loaded standalone components used within the block, which may\n // import NgModules with providers. In order to make those providers\n // available for components declared in that NgModule, we create an instance\n // of an environment injector to host those providers and pass this injector\n // to the logic that creates a view.\n const tDetails = getTDeferBlockDetails(hostTView, tNode);\n const providers = tDetails.providers;\n if (providers && providers.length > 0) {\n injector = createDeferBlockInjector(hostLView[INJECTOR], tDetails, providers);\n }\n }\n const {\n dehydratedView,\n dehydratedViewIx\n } = findMatchingDehydratedViewForDeferBlock(lContainer, lDetails);\n const embeddedLView = createAndRenderEmbeddedLView(hostLView, activeBlockTNode, null, {\n injector,\n dehydratedView\n });\n addLViewToLContainer(lContainer, embeddedLView, viewIndex, shouldAddViewToDom(activeBlockTNode, dehydratedView));\n markViewDirty(embeddedLView, 2 /* NotificationSource.DeferBlockStateUpdate */);\n if (dehydratedViewIx > -1) {\n // Erase dehydrated view info in a given LContainer, so that the view is not\n // removed later by post-hydration cleanup process (which iterates over all\n // dehydrated views in component tree). This clears only the dehydrated view\n // that was found for this render, which in most cases will be the only view.\n // In the case that there was control flow that changed, there may be either\n // more than one or the views would not match up due to the server rendered\n // content being a different branch of the control flow.\n lContainer[DEHYDRATED_VIEWS]?.splice(dehydratedViewIx, 1);\n }\n if ((newState === DeferBlockState.Complete || newState === DeferBlockState.Error) && Array.isArray(lDetails[ON_COMPLETE_FNS])) {\n for (const callback of lDetails[ON_COMPLETE_FNS]) {\n callback();\n }\n lDetails[ON_COMPLETE_FNS] = null;\n }\n }\n profiler(21 /* ProfilerEvent.DeferBlockStateEnd */);\n}\n/**\n * Extends the `applyDeferBlockState` with timer-based scheduling.\n * This function becomes available on a page if there are defer blocks\n * that use `after` or `minimum` parameters in the `@loading` or\n * `@placeholder` blocks.\n */\nfunction applyDeferBlockStateWithScheduling(newState, lDetails, lContainer, tNode, hostLView) {\n const now = Date.now();\n const hostTView = hostLView[TVIEW];\n const tDetails = getTDeferBlockDetails(hostTView, tNode);\n if (lDetails[STATE_IS_FROZEN_UNTIL] === null || lDetails[STATE_IS_FROZEN_UNTIL] <= now) {\n lDetails[STATE_IS_FROZEN_UNTIL] = null;\n const loadingAfter = getLoadingBlockAfter(tDetails);\n const inLoadingAfterPhase = lDetails[LOADING_AFTER_CLEANUP_FN] !== null;\n if (newState === DeferBlockState.Loading && loadingAfter !== null && !inLoadingAfterPhase) {\n // Trying to render loading, but it has an `after` config,\n // so schedule an update action after a timeout.\n lDetails[NEXT_DEFER_BLOCK_STATE] = newState;\n const cleanupFn = scheduleDeferBlockUpdate(loadingAfter, lDetails, tNode, lContainer, hostLView);\n lDetails[LOADING_AFTER_CLEANUP_FN] = cleanupFn;\n } else {\n // If we transition to a complete or an error state and there is a pending\n // operation to render loading after a timeout - invoke a cleanup operation,\n // which stops the timer.\n if (newState > DeferBlockState.Loading && inLoadingAfterPhase) {\n lDetails[LOADING_AFTER_CLEANUP_FN]();\n lDetails[LOADING_AFTER_CLEANUP_FN] = null;\n lDetails[NEXT_DEFER_BLOCK_STATE] = null;\n }\n applyDeferBlockState(newState, lDetails, lContainer, tNode, hostLView);\n const duration = getMinimumDurationForState(tDetails, newState);\n if (duration !== null) {\n lDetails[STATE_IS_FROZEN_UNTIL] = now + duration;\n scheduleDeferBlockUpdate(duration, lDetails, tNode, lContainer, hostLView);\n }\n }\n } else {\n // We are still rendering the previous state.\n // Update the `NEXT_DEFER_BLOCK_STATE`, which would be\n // picked up once it's time to transition to the next state.\n lDetails[NEXT_DEFER_BLOCK_STATE] = newState;\n }\n}\n/**\n * Schedules an update operation after a specified timeout.\n */\nfunction scheduleDeferBlockUpdate(timeout, lDetails, tNode, lContainer, hostLView) {\n const callback = () => {\n const nextState = lDetails[NEXT_DEFER_BLOCK_STATE];\n lDetails[STATE_IS_FROZEN_UNTIL] = null;\n lDetails[NEXT_DEFER_BLOCK_STATE] = null;\n if (nextState !== null) {\n renderDeferBlockState(nextState, tNode, lContainer);\n }\n };\n return scheduleTimerTrigger(timeout, callback, hostLView[INJECTOR]);\n}\n/**\n * Checks whether we can transition to the next state.\n *\n * We transition to the next state if the previous state was represented\n * with a number that is less than the next state. For example, if the current\n * state is \"loading\" (represented as `1`), we should not show a placeholder\n * (represented as `0`), but we can show a completed state (represented as `2`)\n * or an error state (represented as `3`).\n */\nfunction isValidStateChange(currentState, newState) {\n return currentState < newState;\n}\n/** Utility function to render placeholder content (if present) */\nfunction renderPlaceholder(lView, tNode) {\n const lContainer = lView[tNode.index];\n ngDevMode && assertLContainer(lContainer);\n renderDeferBlockState(DeferBlockState.Placeholder, tNode, lContainer);\n}\n/**\n * Subscribes to the \"loading\" Promise and renders corresponding defer sub-block,\n * based on the loading results.\n *\n * @param lContainer Represents an instance of a defer block.\n * @param tNode Represents defer block info shared across all instances.\n */\nfunction renderDeferStateAfterResourceLoading(tDetails, tNode, lContainer) {\n ngDevMode && assertDefined(tDetails.loadingPromise, 'Expected loading Promise to exist on this defer block');\n tDetails.loadingPromise.then(() => {\n if (tDetails.loadingState === DeferDependenciesLoadingState.COMPLETE) {\n ngDevMode && assertDeferredDependenciesLoaded(tDetails);\n // Everything is loaded, show the primary block content\n renderDeferBlockState(DeferBlockState.Complete, tNode, lContainer);\n } else if (tDetails.loadingState === DeferDependenciesLoadingState.FAILED) {\n renderDeferBlockState(DeferBlockState.Error, tNode, lContainer);\n }\n });\n}\n/**\n * Reference to the timer-based scheduler implementation of defer block state\n * rendering method. It's used to make timer-based scheduling tree-shakable.\n * If `minimum` or `after` parameters are used, compiler generates an extra\n * argument for the `ɵɵdefer` instruction, which references a timer-based\n * implementation.\n */\nlet applyDeferBlockStateWithSchedulingImpl = null;\n/**\n * Enables timer-related scheduling if `after` or `minimum` parameters are setup\n * on the `@loading` or `@placeholder` blocks.\n */\nfunction ɵɵdeferEnableTimerScheduling(tView, tDetails, placeholderConfigIndex, loadingConfigIndex) {\n const tViewConsts = tView.consts;\n if (placeholderConfigIndex != null) {\n tDetails.placeholderBlockConfig = getConstant(tViewConsts, placeholderConfigIndex);\n }\n if (loadingConfigIndex != null) {\n tDetails.loadingBlockConfig = getConstant(tViewConsts, loadingConfigIndex);\n }\n // Enable implementation that supports timer-based scheduling.\n if (applyDeferBlockStateWithSchedulingImpl === null) {\n applyDeferBlockStateWithSchedulingImpl = applyDeferBlockStateWithScheduling;\n }\n}\n\n/**\n * The name of a field that Angular monkey-patches onto a component\n * class to store a function that loads defer-loadable dependencies\n * and applies metadata to a class.\n */\nconst ASYNC_COMPONENT_METADATA_FN = '__ngAsyncComponentMetadataFn__';\n/**\n * If a given component has unresolved async metadata - returns a reference\n * to a function that applies component metadata after resolving defer-loadable\n * dependencies. Otherwise - this function returns `null`.\n */\nfunction getAsyncClassMetadataFn(type) {\n const componentClass = type; // cast to `any`, so that we can read a monkey-patched field\n return componentClass[ASYNC_COMPONENT_METADATA_FN] ?? null;\n}\n/**\n * Handles the process of applying metadata info to a component class in case\n * component template has defer blocks (thus some dependencies became deferrable).\n *\n * @param type Component class where metadata should be added\n * @param dependencyLoaderFn Function that loads dependencies\n * @param metadataSetterFn Function that forms a scope in which the `setClassMetadata` is invoked\n */\nfunction setClassMetadataAsync(type, dependencyLoaderFn, metadataSetterFn) {\n const componentClass = type; // cast to `any`, so that we can monkey-patch it\n componentClass[ASYNC_COMPONENT_METADATA_FN] = () => Promise.all(dependencyLoaderFn()).then(dependencies => {\n metadataSetterFn(...dependencies);\n // Metadata is now set, reset field value to indicate that this component\n // can by used/compiled synchronously.\n componentClass[ASYNC_COMPONENT_METADATA_FN] = null;\n return dependencies;\n });\n return componentClass[ASYNC_COMPONENT_METADATA_FN];\n}\n/**\n * Adds decorator, constructor, and property metadata to a given type via static metadata fields\n * on the type.\n *\n * These metadata fields can later be read with Angular's `ReflectionCapabilities` API.\n *\n * Calls to `setClassMetadata` can be guarded by ngDevMode, resulting in the metadata assignments\n * being tree-shaken away during production builds.\n */\nfunction setClassMetadata(type, decorators, ctorParameters, propDecorators) {\n return noSideEffects(() => {\n const clazz = type;\n if (decorators !== null) {\n if (clazz.hasOwnProperty('decorators') && clazz.decorators !== undefined) {\n clazz.decorators.push(...decorators);\n } else {\n clazz.decorators = decorators;\n }\n }\n if (ctorParameters !== null) {\n // Rather than merging, clobber the existing parameters. If other projects exist which\n // use tsickle-style annotations and reflect over them in the same way, this could\n // cause issues, but that is vanishingly unlikely.\n clazz.ctorParameters = ctorParameters;\n }\n if (propDecorators !== null) {\n // The property decorator objects are merged as it is possible different fields have\n // different decorator types. Decorators on individual fields are not merged, as it's\n // also incredibly unlikely that a field will be decorated both with an Angular\n // decorator and a non-Angular decorator that's also been downleveled.\n if (clazz.hasOwnProperty('propDecorators') && clazz.propDecorators !== undefined) {\n clazz.propDecorators = {\n ...clazz.propDecorators,\n ...propDecorators\n };\n } else {\n clazz.propDecorators = propDecorators;\n }\n }\n });\n}\nclass Console {\n log(message) {\n // tslint:disable-next-line:no-console\n console.log(message);\n }\n // Note: for reporting errors use `DOM.logError()` as it is platform specific\n warn(message) {\n console.warn(message);\n }\n static ɵfac = function Console_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || Console)();\n };\n static ɵprov = /*@__PURE__*/__defineInjectable({\n token: Console,\n factory: Console.ɵfac,\n providedIn: 'platform'\n });\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && setClassMetadata(Console, [{\n type: Injectable,\n args: [{\n providedIn: 'platform'\n }]\n }], null, null);\n})();\n\n/**\n * These are the data structures that our framework injector profiler will fill with data in order\n * to support DI debugging APIs.\n *\n * resolverToTokenToDependencies: Maps an injector to a Map of tokens to an Array of\n * dependencies. Injector -> Token -> Dependencies This is used to support the\n * getDependenciesFromInjectable API, which takes in an injector and a token and returns it's\n * dependencies.\n *\n * resolverToProviders: Maps a DI resolver (an Injector or a TNode) to the providers configured\n * within it This is used to support the getInjectorProviders API, which takes in an injector and\n * returns the providers that it was configured with. Note that for the element injector case we\n * use the TNode instead of the LView as the DI resolver. This is because the registration of\n * providers happens only once per type of TNode. If an injector is created with an identical TNode,\n * the providers for that injector will not be reconfigured.\n *\n * standaloneInjectorToComponent: Maps the injector of a standalone component to the standalone\n * component that it is associated with. Used in the getInjectorProviders API, specificially in the\n * discovery of import paths for each provider. This is necessary because the imports array of a\n * standalone component is processed and configured in its standalone injector, but exists within\n * the component's definition. Because getInjectorProviders takes in an injector, if that injector\n * is the injector of a standalone component, we need to be able to discover the place where the\n * imports array is located (the component) in order to flatten the imports array within it to\n * discover all of it's providers.\n *\n *\n * All of these data structures are instantiated with WeakMaps. This will ensure that the presence\n * of any object in the keys of these maps does not prevent the garbage collector from collecting\n * those objects. Because of this property of WeakMaps, these data structures will never be the\n * source of a memory leak.\n *\n * An example of this advantage: When components are destroyed, we don't need to do\n * any additional work to remove that component from our mappings.\n *\n */\nclass DIDebugData {\n resolverToTokenToDependencies = new WeakMap();\n resolverToProviders = new WeakMap();\n resolverToEffects = new WeakMap();\n standaloneInjectorToComponent = new WeakMap();\n reset() {\n this.resolverToTokenToDependencies = new WeakMap();\n this.resolverToProviders = new WeakMap();\n this.standaloneInjectorToComponent = new WeakMap();\n }\n}\nlet frameworkDIDebugData = new DIDebugData();\nfunction getFrameworkDIDebugData() {\n return frameworkDIDebugData;\n}\n/**\n * Initalize default handling of injector events. This handling parses events\n * as they are emitted and constructs the data structures necessary to support\n * some of debug APIs.\n *\n * See handleInjectEvent, handleCreateEvent and handleProviderConfiguredEvent\n * for descriptions of each handler\n *\n * Supported APIs:\n * - getDependenciesFromInjectable\n * - getInjectorProviders\n */\nfunction setupFrameworkInjectorProfiler() {\n frameworkDIDebugData.reset();\n setInjectorProfiler(injectorProfilerEventHandler);\n}\nfunction injectorProfilerEventHandler(injectorProfilerEvent) {\n const {\n context,\n type\n } = injectorProfilerEvent;\n if (type === 0 /* InjectorProfilerEventType.Inject */) {\n handleInjectEvent(context, injectorProfilerEvent.service);\n } else if (type === 1 /* InjectorProfilerEventType.InstanceCreatedByInjector */) {\n handleInstanceCreatedByInjectorEvent(context, injectorProfilerEvent.instance);\n } else if (type === 2 /* InjectorProfilerEventType.ProviderConfigured */) {\n handleProviderConfiguredEvent(context, injectorProfilerEvent.providerRecord);\n } else if (type === 3 /* InjectorProfilerEventType.EffectCreated */) {\n handleEffectCreatedEvent(context, injectorProfilerEvent.effect);\n }\n}\nfunction handleEffectCreatedEvent(context, effect) {\n const diResolver = getDIResolver(context.injector);\n if (diResolver === null) {\n throwError('An EffectCreated event must be run within an injection context.');\n }\n const {\n resolverToEffects\n } = frameworkDIDebugData;\n if (!resolverToEffects.has(diResolver)) {\n resolverToEffects.set(diResolver, []);\n }\n resolverToEffects.get(diResolver).push(effect);\n}\n/**\n *\n * Stores the injected service in frameworkDIDebugData.resolverToTokenToDependencies\n * based on it's injector and token.\n *\n * @param context InjectorProfilerContext the injection context that this event occurred in.\n * @param data InjectedService the service associated with this inject event.\n *\n */\nfunction handleInjectEvent(context, data) {\n const diResolver = getDIResolver(context.injector);\n if (diResolver === null) {\n throwError('An Inject event must be run within an injection context.');\n }\n const diResolverToInstantiatedToken = frameworkDIDebugData.resolverToTokenToDependencies;\n if (!diResolverToInstantiatedToken.has(diResolver)) {\n diResolverToInstantiatedToken.set(diResolver, new WeakMap());\n }\n // if token is a primitive type, ignore this event. We do this because we cannot keep track of\n // non-primitive tokens in WeakMaps since they are not garbage collectable.\n if (!canBeHeldWeakly(context.token)) {\n return;\n }\n const instantiatedTokenToDependencies = diResolverToInstantiatedToken.get(diResolver);\n if (!instantiatedTokenToDependencies.has(context.token)) {\n instantiatedTokenToDependencies.set(context.token, []);\n }\n const {\n token,\n value,\n flags\n } = data;\n assertDefined(context.token, 'Injector profiler context token is undefined.');\n const dependencies = instantiatedTokenToDependencies.get(context.token);\n assertDefined(dependencies, 'Could not resolve dependencies for token.');\n if (context.injector instanceof NodeInjector) {\n dependencies.push({\n token,\n value,\n flags,\n injectedIn: getNodeInjectorContext(context.injector)\n });\n } else {\n dependencies.push({\n token,\n value,\n flags\n });\n }\n}\n/**\n *\n * Returns the LView and TNode associated with a NodeInjector. Returns undefined if the injector\n * is not a NodeInjector.\n *\n * @param injector\n * @returns {lView: LView, tNode: TNode}|undefined\n */\nfunction getNodeInjectorContext(injector) {\n if (!(injector instanceof NodeInjector)) {\n throwError('getNodeInjectorContext must be called with a NodeInjector');\n }\n const lView = getNodeInjectorLView(injector);\n const tNode = getNodeInjectorTNode(injector);\n if (tNode === null) {\n return;\n }\n assertTNodeForLView(tNode, lView);\n return {\n lView,\n tNode\n };\n}\n/**\n *\n * If the created instance is an instance of a standalone component, maps the injector to that\n * standalone component in frameworkDIDebugData.standaloneInjectorToComponent\n *\n * @param context InjectorProfilerContext the injection context that this event occurred in.\n * @param data InjectorCreatedInstance an object containing the instance that was just created\n *\n */\nfunction handleInstanceCreatedByInjectorEvent(context, data) {\n const {\n value\n } = data;\n // It might happen that a DI token is requested but there is no corresponding value.\n // The InstanceCreatedByInjectorEvent will be still emitted in this case (to mirror the InjectorToCreateInstanceEvent) but we don't want to do any particular processing for those situations.\n if (data.value == null) {\n return;\n }\n if (getDIResolver(context.injector) === null) {\n throwError('An InjectorCreatedInstance event must be run within an injection context.');\n }\n // if our value is an instance of a standalone component, map the injector of that standalone\n // component to the component class. Otherwise, this event is a noop.\n let standaloneComponent = undefined;\n if (typeof value === 'object') {\n standaloneComponent = value?.constructor;\n }\n // We want to also cover if `standaloneComponent === null` in addition to `undefined`\n if (standaloneComponent == undefined || !isStandaloneComponent(standaloneComponent)) {\n return;\n }\n const environmentInjector = context.injector.get(EnvironmentInjector, null, {\n optional: true\n });\n // Standalone components should have an environment injector. If one cannot be\n // found we may be in a test case for low level functionality that did not explicitly\n // setup this injector. In those cases, we simply ignore this event.\n if (environmentInjector === null) {\n return;\n }\n const {\n standaloneInjectorToComponent\n } = frameworkDIDebugData;\n // If our injector has already been mapped, as is the case\n // when a standalone component imports another standalone component,\n // we consider the original component (the component doing the importing)\n // as the component connected to our injector.\n if (standaloneInjectorToComponent.has(environmentInjector)) {\n return;\n }\n // If our injector hasn't been mapped, then we map it to the standalone component\n standaloneInjectorToComponent.set(environmentInjector, standaloneComponent);\n}\nfunction isStandaloneComponent(value) {\n const def = getComponentDef(value);\n return !!def?.standalone;\n}\n/**\n *\n * Stores the emitted ProviderRecords from the InjectorProfilerEventType.ProviderConfigured\n * event in frameworkDIDebugData.resolverToProviders\n *\n * @param context InjectorProfilerContext the injection context that this event occurred in.\n * @param data ProviderRecord an object containing the instance that was just created\n *\n */\nfunction handleProviderConfiguredEvent(context, data) {\n const {\n resolverToProviders\n } = frameworkDIDebugData;\n let diResolver;\n if (context?.injector instanceof NodeInjector) {\n diResolver = getNodeInjectorTNode(context.injector);\n } else {\n diResolver = context.injector;\n }\n if (diResolver === null) {\n throwError('A ProviderConfigured event must be run within an injection context.');\n }\n if (!resolverToProviders.has(diResolver)) {\n resolverToProviders.set(diResolver, []);\n }\n resolverToProviders.get(diResolver).push(data);\n}\nfunction getDIResolver(injector) {\n let diResolver = null;\n if (injector === undefined) {\n return diResolver;\n }\n // We use the LView as the diResolver for NodeInjectors because they\n // do not persist anywhere in the framework. They are simply wrappers around an LView and a TNode\n // that do persist. Because of this, we rely on the LView of the NodeInjector in order to use\n // as a concrete key to represent this injector. If we get the same LView back later, we know\n // we're looking at the same injector.\n if (injector instanceof NodeInjector) {\n diResolver = getNodeInjectorLView(injector);\n }\n // Other injectors can be used a keys for a map because their instances\n // persist\n else {\n diResolver = injector;\n }\n return diResolver;\n}\n// inspired by\n// https://tc39.es/ecma262/multipage/executable-code-and-execution-contexts.html#sec-canbeheldweakly\nfunction canBeHeldWeakly(value) {\n // we check for value !== null here because typeof null === 'object\n return value !== null && (typeof value === 'object' || typeof value === 'function' || typeof value === 'symbol');\n}\n\n/**\n * Marks a component for check (in case of OnPush components) and synchronously\n * performs change detection on the application this component belongs to.\n *\n * @param component Component to {@link /api/core/ChangeDetectorRef#markForCheck mark for check}\n *\n * @publicApi\n */\nfunction applyChanges(component) {\n ngDevMode && assertDefined(component, 'component');\n markViewDirty(getComponentViewByInstance(component), 3 /* NotificationSource.DebugApplyChanges */);\n getRootComponents(component).forEach(rootComponent => detectChanges(rootComponent));\n}\n/**\n * Synchronously perform change detection on a component (and possibly its sub-components).\n *\n * This function triggers change detection in a synchronous way on a component.\n *\n * @param component The component which the change detection should be performed on.\n */\nfunction detectChanges(component) {\n const view = getComponentViewByInstance(component);\n view[FLAGS] |= 1024 /* LViewFlags.RefreshView */;\n detectChangesInternal(view);\n}\n\n/**\n * Retrieves all defer blocks in a given LView.\n *\n * @param lView lView with defer blocks\n * @param deferBlocks defer block aggregator array\n */\nfunction getDeferBlocks$1(lView, deferBlocks) {\n const tView = lView[TVIEW];\n for (let i = HEADER_OFFSET; i < tView.bindingStartIndex; i++) {\n if (isLContainer(lView[i])) {\n const lContainer = lView[i];\n // An LContainer may represent an instance of a defer block, in which case\n // we store it as a result. Otherwise, keep iterating over LContainer views and\n // look for defer blocks.\n const isLast = i === tView.bindingStartIndex - 1;\n if (!isLast) {\n const tNode = tView.data[i];\n const tDetails = getTDeferBlockDetails(tView, tNode);\n if (isTDeferBlockDetails(tDetails)) {\n deferBlocks.push({\n lContainer,\n lView,\n tNode,\n tDetails\n });\n // This LContainer represents a defer block, so we exit\n // this iteration and don't inspect views in this LContainer.\n continue;\n }\n }\n // The host can be an `LView` if this is the container\n // for a component that injects `ViewContainerRef`.\n if (isLView(lContainer[HOST])) {\n getDeferBlocks$1(lContainer[HOST], deferBlocks);\n }\n for (let j = CONTAINER_HEADER_OFFSET; j < lContainer.length; j++) {\n getDeferBlocks$1(lContainer[j], deferBlocks);\n }\n } else if (isLView(lView[i])) {\n // This is a component, enter the `getDeferBlocks` recursively.\n getDeferBlocks$1(lView[i], deferBlocks);\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.dev/license\n */\n/**\n * Gets all of the `@defer` blocks that are present inside the specified DOM node.\n * @param node Node in which to look for `@defer` blocks.\n *\n * @publicApi\n */\nfunction getDeferBlocks(node) {\n const results = [];\n const lView = getLContext(node)?.lView;\n if (lView) {\n findDeferBlocks(node, lView, results);\n }\n return results;\n}\n/**\n * Finds all the `@defer` blocks inside a specific node and view.\n * @param node Node in which to search for blocks.\n * @param lView View within the node in which to search for blocks.\n * @param results Array to which to add blocks once they're found.\n */\nfunction findDeferBlocks(node, lView, results) {\n const viewInjector = lView[INJECTOR];\n const registry = viewInjector.get(DEHYDRATED_BLOCK_REGISTRY, null, {\n optional: true\n });\n const blocks = [];\n getDeferBlocks$1(lView, blocks);\n const transferState = viewInjector.get(TransferState);\n const deferBlockParents = transferState.get(NGH_DEFER_BLOCKS_KEY, {});\n for (const details of blocks) {\n const native = getNativeByTNode(details.tNode, details.lView);\n const lDetails = getLDeferBlockDetails(details.lView, details.tNode);\n // The LView from `getLContext` might be the view the element is placed in.\n // Filter out defer blocks that aren't inside the specified root node.\n if (!node.contains(native)) {\n continue;\n }\n const tDetails = details.tDetails;\n const renderedLView = getRendererLView(details);\n const rootNodes = [];\n const hydrationState = inferHydrationState(tDetails, lDetails, registry);\n if (renderedLView !== null) {\n collectNativeNodes(renderedLView[TVIEW], renderedLView, renderedLView[TVIEW].firstChild, rootNodes);\n } else if (hydrationState === 'dehydrated') {\n // We'll find the number of root nodes in the transfer state and\n // collect that number of elements that precede the defer block comment node.\n const deferId = lDetails[SSR_UNIQUE_ID];\n const deferData = deferBlockParents[deferId];\n const numberOfRootNodes = deferData[NUM_ROOT_NODES];\n let collectedNodeCount = 0;\n const deferBlockCommentNode = details.lContainer[NATIVE];\n let currentNode = deferBlockCommentNode.previousSibling;\n while (collectedNodeCount < numberOfRootNodes && currentNode) {\n rootNodes.unshift(currentNode);\n currentNode = currentNode.previousSibling;\n collectedNodeCount++;\n }\n }\n const data = {\n state: stringifyState(lDetails[DEFER_BLOCK_STATE]),\n incrementalHydrationState: hydrationState,\n hasErrorBlock: tDetails.errorTmplIndex !== null,\n loadingBlock: {\n exists: tDetails.loadingTmplIndex !== null,\n minimumTime: tDetails.loadingBlockConfig?.[MINIMUM_SLOT] ?? null,\n afterTime: tDetails.loadingBlockConfig?.[LOADING_AFTER_SLOT] ?? null\n },\n placeholderBlock: {\n exists: tDetails.placeholderTmplIndex !== null,\n minimumTime: tDetails.placeholderBlockConfig?.[MINIMUM_SLOT] ?? null\n },\n triggers: tDetails.debug?.triggers ? Array.from(tDetails.debug.triggers).sort() : [],\n rootNodes\n };\n results.push(data);\n // `getDeferBlocks` does not resolve nested defer blocks so we have to recurse manually.\n if (renderedLView !== null) {\n findDeferBlocks(node, renderedLView, results);\n }\n }\n}\n/**\n * Turns the `DeferBlockState` into a string which is more readable than the enum form.\n *\n * @param lDetails Information about the\n * @returns\n */\nfunction stringifyState(state) {\n switch (state) {\n case DeferBlockState.Complete:\n return 'complete';\n case DeferBlockState.Loading:\n return 'loading';\n case DeferBlockState.Placeholder:\n return 'placeholder';\n case DeferBlockState.Error:\n return 'error';\n case DeferBlockInternalState.Initial:\n return 'initial';\n default:\n throw new Error(`Unrecognized state ${state}`);\n }\n}\n/**\n * Infers the hydration state of a specific defer block.\n * @param tDetails Static defer block information.\n * @param lDetails Instance defer block information.\n * @param registry Registry coordinating the hydration of defer blocks.\n */\nfunction inferHydrationState(tDetails, lDetails, registry) {\n if (registry === null || lDetails[SSR_UNIQUE_ID] === null || tDetails.hydrateTriggers === null || tDetails.hydrateTriggers.has(7 /* DeferBlockTrigger.Never */)) {\n return 'not-configured';\n }\n return registry.has(lDetails[SSR_UNIQUE_ID]) ? 'dehydrated' : 'hydrated';\n}\n/**\n * Gets the current LView that is rendered out in a defer block.\n * @param details Instance information about the block.\n */\nfunction getRendererLView(details) {\n // Defer block containers can only ever contain one view.\n // If they're empty, it means that nothing is rendered.\n if (details.lContainer.length <= CONTAINER_HEADER_OFFSET) {\n return null;\n }\n const lView = details.lContainer[CONTAINER_HEADER_OFFSET];\n ngDevMode && assertLView(lView);\n return lView;\n}\n\n/**\n * Discovers the dependencies of an injectable instance. Provides DI information about each\n * dependency that the injectable was instantiated with, including where they were provided from.\n *\n * @param injector An injector instance\n * @param token a DI token that was constructed by the given injector instance\n * @returns an object that contains the created instance of token as well as all of the dependencies\n * that it was instantiated with OR undefined if the token was not created within the given\n * injector.\n */\nfunction getDependenciesFromInjectable(injector, token) {\n // First we check to see if the token given maps to an actual instance in the injector given.\n // We use `self: true` because we only want to look at the injector we were given.\n // We use `optional: true` because it's possible that the token we were given was never\n // constructed by the injector we were given.\n const instance = injector.get(token, null, {\n self: true,\n optional: true\n });\n if (instance === null) {\n throw new Error(`Unable to determine instance of ${token} in given injector`);\n }\n const unformattedDependencies = getDependenciesForTokenInInjector(token, injector);\n const resolutionPath = getInjectorResolutionPath(injector);\n const dependencies = unformattedDependencies.map(dep => {\n // injectedIn contains private fields, so we omit it from the response\n const formattedDependency = {\n value: dep.value\n };\n // convert injection flags to booleans\n const flags = dep.flags;\n formattedDependency.flags = {\n optional: (8 /* InternalInjectFlags.Optional */ & flags) === 8 /* InternalInjectFlags.Optional */,\n host: (1 /* InternalInjectFlags.Host */ & flags) === 1 /* InternalInjectFlags.Host */,\n self: (2 /* InternalInjectFlags.Self */ & flags) === 2 /* InternalInjectFlags.Self */,\n skipSelf: (4 /* InternalInjectFlags.SkipSelf */ & flags) === 4 /* InternalInjectFlags.SkipSelf */\n };\n // find the injector that provided the dependency\n for (let i = 0; i < resolutionPath.length; i++) {\n const injectorToCheck = resolutionPath[i];\n // if skipSelf is true we skip the first injector\n if (i === 0 && formattedDependency.flags.skipSelf) {\n continue;\n }\n // host only applies to NodeInjectors\n if (formattedDependency.flags.host && injectorToCheck instanceof EnvironmentInjector) {\n break;\n }\n const instance = injectorToCheck.get(dep.token, null, {\n self: true,\n optional: true\n });\n if (instance !== null) {\n // if host flag is true we double check that we can get the service from the first element\n // in the resolution path by using the host flag. This is done to make sure that we've found\n // the correct providing injector, and not a node injector that is connected to our path via\n // a router outlet.\n if (formattedDependency.flags.host) {\n const firstInjector = resolutionPath[0];\n const lookupFromFirstInjector = firstInjector.get(dep.token, null, {\n ...formattedDependency.flags,\n optional: true\n });\n if (lookupFromFirstInjector !== null) {\n formattedDependency.providedIn = injectorToCheck;\n }\n break;\n }\n formattedDependency.providedIn = injectorToCheck;\n break;\n }\n // if self is true we stop after the first injector\n if (i === 0 && formattedDependency.flags.self) {\n break;\n }\n }\n if (dep.token) formattedDependency.token = dep.token;\n return formattedDependency;\n });\n return {\n instance,\n dependencies\n };\n}\nfunction getDependenciesForTokenInInjector(token, injector) {\n const {\n resolverToTokenToDependencies\n } = getFrameworkDIDebugData();\n if (!(injector instanceof NodeInjector)) {\n return resolverToTokenToDependencies.get(injector)?.get?.(token) ?? [];\n }\n const lView = getNodeInjectorLView(injector);\n const tokenDependencyMap = resolverToTokenToDependencies.get(lView);\n const dependencies = tokenDependencyMap?.get(token) ?? [];\n // In the NodeInjector case, all injections for every node are stored in the same lView.\n // We use the injectedIn field of the dependency to filter out the dependencies that\n // do not come from the same node as the instance we're looking at.\n return dependencies.filter(dependency => {\n const dependencyNode = dependency.injectedIn?.tNode;\n if (dependencyNode === undefined) {\n return false;\n }\n const instanceNode = getNodeInjectorTNode(injector);\n assertTNode(dependencyNode);\n assertTNode(instanceNode);\n return dependencyNode === instanceNode;\n });\n}\n/**\n * Gets the class associated with an injector that contains a provider `imports` array in it's\n * definition\n *\n * For Module Injectors this returns the NgModule constructor.\n *\n * For Standalone injectors this returns the standalone component constructor.\n *\n * @param injector Injector an injector instance\n * @returns the constructor where the `imports` array that configures this injector is located\n */\nfunction getProviderImportsContainer(injector) {\n const {\n standaloneInjectorToComponent\n } = getFrameworkDIDebugData();\n // standalone components configure providers through a component def, so we have to\n // use the standalone component associated with this injector if Injector represents\n // a standalone components EnvironmentInjector\n if (standaloneInjectorToComponent.has(injector)) {\n return standaloneInjectorToComponent.get(injector);\n }\n // Module injectors configure providers through their NgModule def, so we use the\n // injector to lookup its NgModuleRef and through that grab its instance\n const defTypeRef = injector.get(NgModuleRef$1, null, {\n self: true,\n optional: true\n });\n // If we can't find an associated imports container, return null.\n // This could be the case if this function is called with an R3Injector that does not represent\n // a standalone component or NgModule.\n if (defTypeRef === null) {\n return null;\n }\n // In standalone applications, the root environment injector created by bootstrapApplication\n // may have no associated \"instance\".\n if (defTypeRef.instance === null) {\n return null;\n }\n return defTypeRef.instance.constructor;\n}\n/**\n * Gets the providers configured on a NodeInjector\n *\n * @param injector A NodeInjector instance\n * @returns ProviderRecord[] an array of objects representing the providers configured on this\n * injector\n */\nfunction getNodeInjectorProviders(injector) {\n const diResolver = getNodeInjectorTNode(injector);\n const {\n resolverToProviders\n } = getFrameworkDIDebugData();\n return resolverToProviders.get(diResolver) ?? [];\n}\n/**\n * Gets a mapping of providers configured on an injector to their import paths\n *\n * ModuleA -> imports ModuleB\n * ModuleB -> imports ModuleC\n * ModuleB -> provides MyServiceA\n * ModuleC -> provides MyServiceB\n *\n * getProviderImportPaths(ModuleA)\n * > Map(2) {\n * MyServiceA => [ModuleA, ModuleB]\n * MyServiceB => [ModuleA, ModuleB, ModuleC]\n * }\n *\n * @param providerImportsContainer constructor of class that contains an `imports` array in it's\n * definition\n * @returns A Map object that maps providers to an array of constructors representing it's import\n * path\n *\n */\nfunction getProviderImportPaths(providerImportsContainer) {\n const providerToPath = new Map();\n const visitedContainers = new Set();\n const visitor = walkProviderTreeToDiscoverImportPaths(providerToPath, visitedContainers);\n walkProviderTree(providerImportsContainer, visitor, [], new Set());\n return providerToPath;\n}\n/**\n *\n * Higher order function that returns a visitor for WalkProviderTree\n *\n * Takes in a Map and Set to keep track of the providers and containers\n * visited, so that we can discover the import paths of these providers\n * during the traversal.\n *\n * This visitor takes advantage of the fact that walkProviderTree performs a\n * postorder traversal of the provider tree for the passed in container. Because postorder\n * traversal recursively processes subtrees from leaf nodes until the traversal reaches the root,\n * we write a visitor that constructs provider import paths in reverse.\n *\n *\n * We use the visitedContainers set defined outside this visitor\n * because we want to run some logic only once for\n * each container in the tree. That logic can be described as:\n *\n *\n * 1. for each discovered_provider and discovered_path in the incomplete provider paths we've\n * already discovered\n * 2. get the first container in discovered_path\n * 3. if that first container is in the imports array of the container we're visiting\n * Then the container we're visiting is also in the import path of discovered_provider, so we\n * unshift discovered_path with the container we're currently visiting\n *\n *\n * Example Run:\n * ```\n * ┌──────────┐\n * │containerA│\n * ┌─imports-─┤ ├──imports─┐\n * │ │ provA │ │\n * │ │ provB │ │\n * │ └──────────┘ │\n * │ │\n * ┌▼─────────┐ ┌────────▼─┐\n * │containerB│ │containerC│\n * │ │ │ │\n * │ provD │ │ provF │\n * │ provE │ │ provG │\n * └──────────┘ └──────────┘\n * ```\n *\n * Each step of the traversal,\n *\n * ```\n * visitor(provD, containerB)\n * providerToPath === Map { provD => [containerB] }\n * visitedContainers === Set { containerB }\n *\n * visitor(provE, containerB)\n * providerToPath === Map { provD => [containerB], provE => [containerB] }\n * visitedContainers === Set { containerB }\n *\n * visitor(provF, containerC)\n * providerToPath === Map { provD => [containerB], provE => [containerB], provF => [containerC] }\n * visitedContainers === Set { containerB, containerC }\n *\n * visitor(provG, containerC)\n * providerToPath === Map {\n * provD => [containerB], provE => [containerB], provF => [containerC], provG => [containerC]\n * }\n * visitedContainers === Set { containerB, containerC }\n *\n * visitor(provA, containerA)\n * providerToPath === Map {\n * provD => [containerA, containerB],\n * provE => [containerA, containerB],\n * provF => [containerA, containerC],\n * provG => [containerA, containerC],\n * provA => [containerA]\n * }\n * visitedContainers === Set { containerB, containerC, containerA }\n *\n * visitor(provB, containerA)\n * providerToPath === Map {\n * provD => [containerA, containerB],\n * provE => [containerA, containerB],\n * provF => [containerA, containerC],\n * provG => [containerA, containerC],\n * provA => [containerA]\n * provB => [containerA]\n * }\n * visitedContainers === Set { containerB, containerC, containerA }\n * ```\n *\n * @param providerToPath Map map of providers to paths that this function fills\n * @param visitedContainers Set a set to keep track of the containers we've already visited\n * @return function(provider SingleProvider, container: Type<unknown> | InjectorType<unknown>) =>\n * void\n */\nfunction walkProviderTreeToDiscoverImportPaths(providerToPath, visitedContainers) {\n return (provider, container) => {\n // If the provider is not already in the providerToPath map,\n // add an entry with the provider as the key and an array containing the current container as\n // the value\n if (!providerToPath.has(provider)) {\n providerToPath.set(provider, [container]);\n }\n // This block will run exactly once for each container in the import tree.\n // This is where we run the logic to check the imports array of the current\n // container to see if it's the next container in the path for our currently\n // discovered providers.\n if (!visitedContainers.has(container)) {\n // Iterate through the providers we've already seen\n for (const prov of providerToPath.keys()) {\n const existingImportPath = providerToPath.get(prov);\n let containerDef = getInjectorDef(container);\n if (!containerDef) {\n const ngModule = container.ngModule;\n containerDef = getInjectorDef(ngModule);\n }\n if (!containerDef) {\n return;\n }\n const lastContainerAddedToPath = existingImportPath[0];\n let isNextStepInPath = false;\n deepForEach(containerDef.imports, moduleImport => {\n if (isNextStepInPath) {\n return;\n }\n isNextStepInPath = moduleImport.ngModule === lastContainerAddedToPath || moduleImport === lastContainerAddedToPath;\n if (isNextStepInPath) {\n providerToPath.get(prov)?.unshift(container);\n }\n });\n }\n }\n visitedContainers.add(container);\n };\n}\n/**\n * Gets the providers configured on an EnvironmentInjector\n *\n * @param injector EnvironmentInjector\n * @returns an array of objects representing the providers of the given injector\n */\nfunction getEnvironmentInjectorProviders(injector) {\n const providerRecordsWithoutImportPaths = getFrameworkDIDebugData().resolverToProviders.get(injector) ?? [];\n // platform injector has no provider imports container so can we skip trying to\n // find import paths\n if (isPlatformInjector(injector)) {\n return providerRecordsWithoutImportPaths;\n }\n const providerImportsContainer = getProviderImportsContainer(injector);\n if (providerImportsContainer === null) {\n // We assume that if an environment injector exists without an associated provider imports\n // container, it was created without such a container. Some examples cases where this could\n // happen:\n // - The root injector of a standalone application\n // - A router injector created by using the providers array in a lazy loaded route\n // - A manually created injector that is attached to the injector tree\n // Since each of these cases has no provider container, there is no concept of import paths,\n // so we can simply return the provider records.\n return providerRecordsWithoutImportPaths;\n }\n const providerToPath = getProviderImportPaths(providerImportsContainer);\n const providerRecords = [];\n for (const providerRecord of providerRecordsWithoutImportPaths) {\n const provider = providerRecord.provider;\n // Ignore these special providers for now until we have a cleaner way of\n // determing when they are provided by the framework vs provided by the user.\n const token = provider.provide;\n if (token === ENVIRONMENT_INITIALIZER || token === INJECTOR_DEF_TYPES) {\n continue;\n }\n let importPath = providerToPath.get(provider) ?? [];\n const def = getComponentDef(providerImportsContainer);\n const isStandaloneComponent = !!def?.standalone;\n // We prepend the component constructor in the standalone case\n // because walkProviderTree does not visit this constructor during it's traversal\n if (isStandaloneComponent) {\n importPath = [providerImportsContainer, ...importPath];\n }\n providerRecords.push({\n ...providerRecord,\n importPath\n });\n }\n return providerRecords;\n}\nfunction isPlatformInjector(injector) {\n return injector instanceof R3Injector && injector.scopes.has('platform');\n}\n/**\n * Gets the providers configured on an injector.\n *\n * @param injector the injector to lookup the providers of\n * @returns ProviderRecord[] an array of objects representing the providers of the given injector\n */\nfunction getInjectorProviders(injector) {\n if (injector instanceof NodeInjector) {\n return getNodeInjectorProviders(injector);\n } else if (injector instanceof EnvironmentInjector) {\n return getEnvironmentInjectorProviders(injector);\n }\n throwError('getInjectorProviders only supports NodeInjector and EnvironmentInjector');\n}\n/**\n *\n * Given an injector, this function will return\n * an object containing the type and source of the injector.\n *\n * | | type | source |\n * |--------------|-------------|-------------------------------------------------------------|\n * | NodeInjector | element | DOM element that created this injector |\n * | R3Injector | environment | `injector.source` |\n * | NullInjector | null | null |\n *\n * @param injector the Injector to get metadata for\n * @returns an object containing the type and source of the given injector. If the injector metadata\n * cannot be determined, returns null.\n */\nfunction getInjectorMetadata(injector) {\n if (injector instanceof NodeInjector) {\n const lView = getNodeInjectorLView(injector);\n const tNode = getNodeInjectorTNode(injector);\n assertTNodeForLView(tNode, lView);\n return {\n type: 'element',\n source: getNativeByTNode(tNode, lView)\n };\n }\n if (injector instanceof R3Injector) {\n return {\n type: 'environment',\n source: injector.source ?? null\n };\n }\n if (injector instanceof NullInjector) {\n return {\n type: 'null',\n source: null\n };\n }\n return null;\n}\nfunction getInjectorResolutionPath(injector) {\n const resolutionPath = [injector];\n getInjectorResolutionPathHelper(injector, resolutionPath);\n return resolutionPath;\n}\nfunction getInjectorResolutionPathHelper(injector, resolutionPath) {\n const parent = getInjectorParent(injector);\n // if getInjectorParent can't find a parent, then we've either reached the end\n // of the path, or we need to move from the Element Injector tree to the\n // module injector tree using the first injector in our path as the connection point.\n if (parent === null) {\n if (injector instanceof NodeInjector) {\n const firstInjector = resolutionPath[0];\n if (firstInjector instanceof NodeInjector) {\n const moduleInjector = getModuleInjectorOfNodeInjector(firstInjector);\n if (moduleInjector === null) {\n throwError('NodeInjector must have some connection to the module injector tree');\n }\n resolutionPath.push(moduleInjector);\n getInjectorResolutionPathHelper(moduleInjector, resolutionPath);\n }\n return resolutionPath;\n }\n } else {\n resolutionPath.push(parent);\n getInjectorResolutionPathHelper(parent, resolutionPath);\n }\n return resolutionPath;\n}\n/**\n * Gets the parent of an injector.\n *\n * This function is not able to make the jump from the Element Injector Tree to the Module\n * injector tree. This is because the \"parent\" (the next step in the reoslution path)\n * of a root NodeInjector is dependent on which NodeInjector ancestor initiated\n * the DI lookup. See getInjectorResolutionPath for a function that can make this jump.\n *\n * In the below diagram:\n * ```ts\n * getInjectorParent(NodeInjectorB)\n * > NodeInjectorA\n * getInjectorParent(NodeInjectorA) // or getInjectorParent(getInjectorParent(NodeInjectorB))\n * > null // cannot jump to ModuleInjector tree\n * ```\n *\n * ```\n * ┌───────┐ ┌───────────────────┐\n * ┌───────────┤ModuleA├───Injector────►│EnvironmentInjector│\n * │ └───┬───┘ └───────────────────┘\n * │ │\n * │ bootstraps\n * │ │\n * │ │\n * │ ┌────▼─────┐ ┌─────────────┐\n * declares │ComponentA├────Injector────►│NodeInjectorA│\n * │ └────┬─────┘ └─────▲───────┘\n * │ │ │\n * │ renders parent\n * │ │ │\n * │ ┌────▼─────┐ ┌─────┴───────┐\n * └─────────►│ComponentB├────Injector────►│NodeInjectorB│\n * └──────────┘ └─────────────┘\n *```\n *\n * @param injector an Injector to get the parent of\n * @returns Injector the parent of the given injector\n */\nfunction getInjectorParent(injector) {\n if (injector instanceof R3Injector) {\n return injector.parent;\n }\n let tNode;\n let lView;\n if (injector instanceof NodeInjector) {\n tNode = getNodeInjectorTNode(injector);\n lView = getNodeInjectorLView(injector);\n } else if (injector instanceof NullInjector) {\n return null;\n } else if (injector instanceof ChainedInjector) {\n return injector.parentInjector;\n } else {\n throwError('getInjectorParent only support injectors of type R3Injector, NodeInjector, NullInjector');\n }\n const parentLocation = getParentInjectorLocation(tNode, lView);\n if (hasParentInjector(parentLocation)) {\n const parentInjectorIndex = getParentInjectorIndex(parentLocation);\n const parentLView = getParentInjectorView(parentLocation, lView);\n const parentTView = parentLView[TVIEW];\n const parentTNode = parentTView.data[parentInjectorIndex + 8 /* NodeInjectorOffset.TNODE */];\n return new NodeInjector(parentTNode, parentLView);\n } else {\n const chainedInjector = lView[INJECTOR];\n // Case where chainedInjector.injector is an OutletInjector and chainedInjector.injector.parent\n // is a NodeInjector.\n // todo(aleksanderbodurri): ideally nothing in packages/core should deal\n // directly with router concerns. Refactor this so that we can make the jump from\n // NodeInjector -> OutletInjector -> NodeInjector\n // without explicitly relying on types contracts from packages/router\n const injectorParent = chainedInjector.injector?.parent;\n if (injectorParent instanceof NodeInjector) {\n return injectorParent;\n }\n }\n return null;\n}\n/**\n * Gets the module injector of a NodeInjector.\n *\n * @param injector NodeInjector to get module injector of\n * @returns Injector representing module injector of the given NodeInjector\n */\nfunction getModuleInjectorOfNodeInjector(injector) {\n let lView;\n if (injector instanceof NodeInjector) {\n lView = getNodeInjectorLView(injector);\n } else {\n throwError('getModuleInjectorOfNodeInjector must be called with a NodeInjector');\n }\n const inj = lView[INJECTOR];\n const moduleInjector = inj instanceof ChainedInjector ? inj.parentInjector : inj.parent;\n if (!moduleInjector) {\n throwError('NodeInjector must have some connection to the module injector tree');\n }\n return moduleInjector;\n}\nfunction isComputedNode(node) {\n return node.kind === 'computed';\n}\nfunction isTemplateEffectNode(node) {\n return node.kind === 'template';\n}\nfunction isSignalNode(node) {\n return node.kind === 'signal';\n}\n/**\n *\n * @param injector\n * @returns Template consumer of given NodeInjector\n */\nfunction getTemplateConsumer(injector) {\n const tNode = getNodeInjectorTNode(injector);\n assertTNode(tNode);\n const lView = getNodeInjectorLView(injector);\n assertLView(lView);\n const templateLView = lView[tNode.index];\n if (isLView(templateLView)) {\n return templateLView[REACTIVE_TEMPLATE_CONSUMER] ?? null;\n }\n return null;\n}\nconst signalDebugMap = new WeakMap();\nlet counter$1 = 0;\nfunction getNodesAndEdgesFromSignalMap(signalMap) {\n const nodes = Array.from(signalMap.keys());\n const debugSignalGraphNodes = [];\n const edges = [];\n for (const [consumer, producers] of signalMap.entries()) {\n const consumerIndex = nodes.indexOf(consumer);\n let id = signalDebugMap.get(consumer);\n if (!id) {\n counter$1++;\n id = counter$1.toString();\n signalDebugMap.set(consumer, id);\n }\n // collect node\n if (isComputedNode(consumer)) {\n debugSignalGraphNodes.push({\n label: consumer.debugName,\n value: consumer.value,\n kind: consumer.kind,\n epoch: consumer.version,\n debuggableFn: consumer.computation,\n id\n });\n } else if (isSignalNode(consumer)) {\n debugSignalGraphNodes.push({\n label: consumer.debugName,\n value: consumer.value,\n kind: consumer.kind,\n epoch: consumer.version,\n id\n });\n } else if (isTemplateEffectNode(consumer)) {\n debugSignalGraphNodes.push({\n label: consumer.debugName ?? consumer.lView?.[HOST]?.tagName?.toLowerCase?.(),\n kind: consumer.kind,\n epoch: consumer.version,\n id\n });\n } else {\n debugSignalGraphNodes.push({\n label: consumer.debugName,\n kind: consumer.kind,\n epoch: consumer.version,\n id\n });\n }\n // collect edges for node\n for (const producer of producers) {\n edges.push({\n consumer: consumerIndex,\n producer: nodes.indexOf(producer)\n });\n }\n }\n return {\n nodes: debugSignalGraphNodes,\n edges\n };\n}\nfunction extractEffectsFromInjector(injector) {\n let diResolver = injector;\n if (injector instanceof NodeInjector) {\n const lView = getNodeInjectorLView(injector);\n diResolver = lView;\n }\n const resolverToEffects = getFrameworkDIDebugData().resolverToEffects;\n const effects = resolverToEffects.get(diResolver) ?? [];\n return effects.map(effect => effect[SIGNAL]);\n}\nfunction extractSignalNodesAndEdgesFromRoots(nodes, signalDependenciesMap = new Map()) {\n for (const node of nodes) {\n if (signalDependenciesMap.has(node)) {\n continue;\n }\n const producerNodes = [];\n for (let link = node.producers; link !== undefined; link = link.nextProducer) {\n const producer = link.producer;\n producerNodes.push(producer);\n }\n signalDependenciesMap.set(node, producerNodes);\n extractSignalNodesAndEdgesFromRoots(producerNodes, signalDependenciesMap);\n }\n return signalDependenciesMap;\n}\n/**\n * Returns a debug representation of the signal graph for the given injector.\n *\n * Currently only supports element injectors. Starts by discovering the consumer nodes\n * and then traverses their producer nodes to build the signal graph.\n *\n * @param injector The injector to get the signal graph for.\n * @returns A debug representation of the signal graph.\n * @throws If the injector is an environment injector.\n */\nfunction getSignalGraph(injector) {\n let templateConsumer = null;\n if (!(injector instanceof NodeInjector) && !(injector instanceof R3Injector)) {\n return throwError('getSignalGraph must be called with a NodeInjector or R3Injector');\n }\n if (injector instanceof NodeInjector) {\n templateConsumer = getTemplateConsumer(injector);\n }\n const nonTemplateEffectNodes = extractEffectsFromInjector(injector);\n const signalNodes = templateConsumer ? [templateConsumer, ...nonTemplateEffectNodes] : nonTemplateEffectNodes;\n const signalDependenciesMap = extractSignalNodesAndEdgesFromRoots(signalNodes);\n return getNodesAndEdgesFromSignalMap(signalDependenciesMap);\n}\nlet changeDetectionRuns = 0;\nlet changeDetectionSyncRuns = 0;\nlet counter = 0;\nconst eventsStack = [];\nfunction measureStart(startEvent) {\n eventsStack.push([startEvent, counter]);\n console.timeStamp('Event_' + startEvent + '_' + counter++);\n}\nfunction measureEnd(startEvent, entryName, color) {\n const top = eventsStack.pop();\n assertDefined(top, 'Profiling error: could not find start event entry ' + startEvent);\n assertEqual(top[0], startEvent, `Profiling error: expected to see ${startEvent} event but got ${top[0]}`);\n console.timeStamp(entryName, 'Event_' + top[0] + '_' + top[1], undefined, '\\u{1F170}\\uFE0F Angular', undefined, color);\n}\nconst chromeDevToolsInjectorProfiler = event => {\n const eventType = event.type;\n if (eventType === 4 /* InjectorProfilerEventType.InjectorToCreateInstanceEvent */) {\n measureStart(100 /* ProfilerDIEvent.InjectorToCreateInstanceEvent */);\n } else if (eventType === 1 /* InjectorProfilerEventType.InstanceCreatedByInjector */) {\n const token = event.context.token;\n measureEnd(100 /* ProfilerDIEvent.InjectorToCreateInstanceEvent */, getProviderTokenMeasureName(token), 'tertiary-dark');\n }\n};\nconst devToolsProfiler = (event, instance, eventFn) => {\n switch (event) {\n case 8 /* ProfilerEvent.BootstrapApplicationStart */:\n case 10 /* ProfilerEvent.BootstrapComponentStart */:\n case 12 /* ProfilerEvent.ChangeDetectionStart */:\n case 14 /* ProfilerEvent.ChangeDetectionSyncStart */:\n case 16 /* ProfilerEvent.AfterRenderHooksStart */:\n case 18 /* ProfilerEvent.ComponentStart */:\n case 20 /* ProfilerEvent.DeferBlockStateStart */:\n case 22 /* ProfilerEvent.DynamicComponentStart */:\n case 0 /* ProfilerEvent.TemplateCreateStart */:\n case 4 /* ProfilerEvent.LifecycleHookStart */:\n case 2 /* ProfilerEvent.TemplateUpdateStart */:\n case 24 /* ProfilerEvent.HostBindingsUpdateStart */:\n case 6 /* ProfilerEvent.OutputStart */:\n {\n measureStart(event);\n break;\n }\n case 9 /* ProfilerEvent.BootstrapApplicationEnd */:\n {\n measureEnd(8 /* ProfilerEvent.BootstrapApplicationStart */, 'Bootstrap application', 'primary-dark');\n break;\n }\n case 11 /* ProfilerEvent.BootstrapComponentEnd */:\n {\n measureEnd(10 /* ProfilerEvent.BootstrapComponentStart */, 'Bootstrap component', 'primary-dark');\n break;\n }\n case 13 /* ProfilerEvent.ChangeDetectionEnd */:\n {\n changeDetectionSyncRuns = 0;\n measureEnd(12 /* ProfilerEvent.ChangeDetectionStart */, 'Change detection ' + changeDetectionRuns++, 'primary-dark');\n break;\n }\n case 15 /* ProfilerEvent.ChangeDetectionSyncEnd */:\n {\n measureEnd(14 /* ProfilerEvent.ChangeDetectionSyncStart */, 'Synchronization ' + changeDetectionSyncRuns++, 'primary');\n break;\n }\n case 17 /* ProfilerEvent.AfterRenderHooksEnd */:\n {\n measureEnd(16 /* ProfilerEvent.AfterRenderHooksStart */, 'After render hooks', 'primary');\n break;\n }\n case 19 /* ProfilerEvent.ComponentEnd */:\n {\n const typeName = getComponentMeasureName(instance);\n measureEnd(18 /* ProfilerEvent.ComponentStart */, typeName, 'primary-light');\n break;\n }\n case 21 /* ProfilerEvent.DeferBlockStateEnd */:\n {\n measureEnd(20 /* ProfilerEvent.DeferBlockStateStart */, 'Defer block', 'primary-dark');\n break;\n }\n case 23 /* ProfilerEvent.DynamicComponentEnd */:\n {\n measureEnd(22 /* ProfilerEvent.DynamicComponentStart */, 'Dynamic component creation', 'primary-dark');\n break;\n }\n case 3 /* ProfilerEvent.TemplateUpdateEnd */:\n {\n measureEnd(2 /* ProfilerEvent.TemplateUpdateStart */, stringifyForError(eventFn) + ' (update)', 'secondary-dark');\n break;\n }\n case 1 /* ProfilerEvent.TemplateCreateEnd */:\n {\n measureEnd(0 /* ProfilerEvent.TemplateCreateStart */, stringifyForError(eventFn) + ' (create)', 'secondary');\n break;\n }\n case 25 /* ProfilerEvent.HostBindingsUpdateEnd */:\n {\n measureEnd(24 /* ProfilerEvent.HostBindingsUpdateStart */, 'HostBindings', 'secondary-dark');\n break;\n }\n case 5 /* ProfilerEvent.LifecycleHookEnd */:\n {\n const typeName = getComponentMeasureName(instance);\n measureEnd(4 /* ProfilerEvent.LifecycleHookStart */, `${typeName}:${stringifyForError(eventFn)}`, 'tertiary');\n break;\n }\n case 7 /* ProfilerEvent.OutputEnd */:\n {\n measureEnd(6 /* ProfilerEvent.OutputStart */, stringifyForError(eventFn), 'tertiary-light');\n break;\n }\n default:\n {\n throw new Error('Unexpected profiling event type: ' + event);\n }\n }\n};\nfunction getComponentMeasureName(instance) {\n return instance.constructor.name;\n}\nfunction getProviderTokenMeasureName(token) {\n if (isTypeProvider(token)) {\n return token.name;\n } else if (token.provide != null) {\n return getProviderTokenMeasureName(token.provide);\n }\n return token.toString();\n}\n/**\n * Start listening to the Angular's internal performance-related events and route those to the Chrome DevTools performance panel.\n * This enables Angular-specific data visualization when recording a performance profile directly in the Chrome DevTools.\n *\n * Note: integration is enabled in the development mode only, this operation is noop in the production mode.\n *\n * @experimental\n *\n * @returns a function that can be invoked to stop sending profiling data.\n */\nfunction enableProfiling() {\n performanceMarkFeature('Chrome DevTools profiling');\n if (typeof ngDevMode !== 'undefined' && ngDevMode) {\n const removeInjectorProfiler = setInjectorProfiler(chromeDevToolsInjectorProfiler);\n const removeProfiler = setProfiler(devToolsProfiler);\n return () => {\n removeInjectorProfiler();\n removeProfiler();\n };\n }\n return () => {};\n}\n\n/// <reference path=\"../../../../goog.d.ts\" />\n/**\n * This file introduces series of globally accessible debug tools\n * to allow for the Angular debugging story to function.\n *\n * To see this in action run the following command:\n *\n * bazel run //packages/core/test/bundling/todo:devserver\n *\n * Then load `localhost:5432` and start using the console tools.\n */\n/**\n * This value reflects the property on the window where the dev\n * tools are patched (window.ng).\n * */\nconst GLOBAL_PUBLISH_EXPANDO_KEY = 'ng';\nconst globalUtilsFunctions = {\n /**\n * Warning: functions that start with `ɵ` are considered *INTERNAL* and should not be relied upon\n * in application's code. The contract of those functions might be changed in any release and/or a\n * function can be removed completely.\n */\n 'ɵgetDependenciesFromInjectable': getDependenciesFromInjectable,\n 'ɵgetInjectorProviders': getInjectorProviders,\n 'ɵgetInjectorResolutionPath': getInjectorResolutionPath,\n 'ɵgetInjectorMetadata': getInjectorMetadata,\n 'ɵsetProfiler': setProfiler,\n 'ɵgetSignalGraph': getSignalGraph,\n 'ɵgetDeferBlocks': getDeferBlocks,\n 'getDirectiveMetadata': getDirectiveMetadata$1,\n 'getComponent': getComponent,\n 'getContext': getContext,\n 'getListeners': getListeners,\n 'getOwningComponent': getOwningComponent,\n 'getHostElement': getHostElement,\n 'getInjector': getInjector,\n 'getRootComponents': getRootComponents,\n 'getDirectives': getDirectives,\n 'applyChanges': applyChanges,\n 'isSignal': isSignal,\n 'enableProfiling': enableProfiling\n};\nlet _published = false;\n/**\n * Publishes a collection of default debug tools onto`window.ng`.\n *\n * These functions are available globally when Angular is in development\n * mode and are automatically stripped away from prod mode is on.\n */\nfunction publishDefaultGlobalUtils$1() {\n if (!_published) {\n _published = true;\n if (typeof window !== 'undefined') {\n // Only configure the injector profiler when running in the browser.\n setupFrameworkInjectorProfiler();\n }\n for (const [methodName, method] of Object.entries(globalUtilsFunctions)) {\n publishGlobalUtil(methodName, method);\n }\n }\n}\n/**\n * Publishes the given function to `window.ng` so that it can be\n * used from the browser console when an application is not in production.\n */\nfunction publishGlobalUtil(name, fn) {\n publishUtil(name, fn);\n}\n/**\n * Publishes the given function to `window.ng` from package other than @angular/core\n * So that it can be used from the browser console when an application is not in production.\n */\nfunction publishExternalGlobalUtil(name, fn) {\n publishUtil(name, fn);\n}\nfunction publishUtil(name, fn) {\n if (typeof COMPILED === 'undefined' || !COMPILED) {\n // Note: we can't export `ng` when using closure enhanced optimization as:\n // - closure declares globals itself for minified names, which sometimes clobber our `ng` global\n // - we can't declare a closure extern as the namespace `ng` is already used within Google\n // for typings for AngularJS (via `goog.provide('ng....')`).\n const w = _global;\n ngDevMode && assertDefined(fn, 'function not defined');\n w[GLOBAL_PUBLISH_EXPANDO_KEY] ??= {};\n w[GLOBAL_PUBLISH_EXPANDO_KEY][name] = fn;\n }\n}\n\n/**\n * Internal injection token that can used to access an instance of a Testability class.\n *\n * This token acts as a bridge between the core bootstrap code and the `Testability` class. This is\n * needed to ensure that there are no direct references to the `Testability` class, so it can be\n * tree-shaken away (if not referenced). For the environments/setups when the `Testability` class\n * should be available, this token is used to add a provider that references the `Testability`\n * class. Otherwise, only this token is retained in a bundle, but the `Testability` class is not.\n */\nconst TESTABILITY = new InjectionToken('');\n/**\n * Internal injection token to retrieve Testability getter class instance.\n */\nconst TESTABILITY_GETTER = new InjectionToken('');\n/**\n * The Testability service provides testing hooks that can be accessed from\n * the browser.\n *\n * Angular applications bootstrapped using an NgModule (via `@NgModule.bootstrap` field) will also\n * instantiate Testability by default (in both development and production modes).\n *\n * For applications bootstrapped using the `bootstrapApplication` function, Testability is not\n * included by default. You can include it into your applications by getting the list of necessary\n * providers using the `provideProtractorTestingSupport()` function and adding them into the\n * `options.providers` array. Example:\n *\n * ```ts\n * import {provideProtractorTestingSupport} from '@angular/platform-browser';\n *\n * await bootstrapApplication(RootComponent, providers: [provideProtractorTestingSupport()]);\n * ```\n *\n * @publicApi\n */\nclass Testability {\n _ngZone;\n registry;\n _isZoneStable = true;\n _callbacks = [];\n _taskTrackingZone = null;\n _destroyRef;\n constructor(_ngZone, registry, testabilityGetter) {\n this._ngZone = _ngZone;\n this.registry = registry;\n // Attempt to retrieve a `DestroyRef` optionally.\n // For backwards compatibility reasons, this cannot be required.\n if (isInInjectionContext()) {\n this._destroyRef = inject(DestroyRef, {\n optional: true\n }) ?? undefined;\n }\n // If there was no Testability logic registered in the global scope\n // before, register the current testability getter as a global one.\n if (!_testabilityGetter) {\n setTestabilityGetter(testabilityGetter);\n testabilityGetter.addToWindow(registry);\n }\n this._watchAngularEvents();\n _ngZone.run(() => {\n this._taskTrackingZone = typeof Zone == 'undefined' ? null : Zone.current.get('TaskTrackingZone');\n });\n }\n _watchAngularEvents() {\n const onUnstableSubscription = this._ngZone.onUnstable.subscribe({\n next: () => {\n this._isZoneStable = false;\n }\n });\n const onStableSubscription = this._ngZone.runOutsideAngular(() => this._ngZone.onStable.subscribe({\n next: () => {\n NgZone.assertNotInAngularZone();\n queueMicrotask(() => {\n this._isZoneStable = true;\n this._runCallbacksIfReady();\n });\n }\n }));\n this._destroyRef?.onDestroy(() => {\n onUnstableSubscription.unsubscribe();\n onStableSubscription.unsubscribe();\n });\n }\n /**\n * Whether an associated application is stable\n */\n isStable() {\n return this._isZoneStable && !this._ngZone.hasPendingMacrotasks;\n }\n _runCallbacksIfReady() {\n if (this.isStable()) {\n // Schedules the call backs in a new frame so that it is always async.\n queueMicrotask(() => {\n while (this._callbacks.length !== 0) {\n let cb = this._callbacks.pop();\n clearTimeout(cb.timeoutId);\n cb.doneCb();\n }\n });\n } else {\n // Still not stable, send updates.\n let pending = this.getPendingTasks();\n this._callbacks = this._callbacks.filter(cb => {\n if (cb.updateCb && cb.updateCb(pending)) {\n clearTimeout(cb.timeoutId);\n return false;\n }\n return true;\n });\n }\n }\n getPendingTasks() {\n if (!this._taskTrackingZone) {\n return [];\n }\n // Copy the tasks data so that we don't leak tasks.\n return this._taskTrackingZone.macroTasks.map(t => {\n return {\n source: t.source,\n // From TaskTrackingZone:\n // https://github.com/angular/zone.js/blob/master/lib/zone-spec/task-tracking.ts#L40\n creationLocation: t.creationLocation,\n data: t.data\n };\n });\n }\n addCallback(cb, timeout, updateCb) {\n let timeoutId = -1;\n if (timeout && timeout > 0) {\n timeoutId = setTimeout(() => {\n this._callbacks = this._callbacks.filter(cb => cb.timeoutId !== timeoutId);\n cb();\n }, timeout);\n }\n this._callbacks.push({\n doneCb: cb,\n timeoutId: timeoutId,\n updateCb: updateCb\n });\n }\n /**\n * Wait for the application to be stable with a timeout. If the timeout is reached before that\n * happens, the callback receives a list of the macro tasks that were pending, otherwise null.\n *\n * @param doneCb The callback to invoke when Angular is stable or the timeout expires\n * whichever comes first.\n * @param timeout Optional. The maximum time to wait for Angular to become stable. If not\n * specified, whenStable() will wait forever.\n * @param updateCb Optional. If specified, this callback will be invoked whenever the set of\n * pending macrotasks changes. If this callback returns true doneCb will not be invoked\n * and no further updates will be issued.\n */\n whenStable(doneCb, timeout, updateCb) {\n if (updateCb && !this._taskTrackingZone) {\n throw new Error('Task tracking zone is required when passing an update callback to ' + 'whenStable(). Is \"zone.js/plugins/task-tracking\" loaded?');\n }\n this.addCallback(doneCb, timeout, updateCb);\n this._runCallbacksIfReady();\n }\n /**\n * Registers an application with a testability hook so that it can be tracked.\n * @param token token of application, root element\n *\n * @internal\n */\n registerApplication(token) {\n this.registry.registerApplication(token, this);\n }\n /**\n * Unregisters an application.\n * @param token token of application, root element\n *\n * @internal\n */\n unregisterApplication(token) {\n this.registry.unregisterApplication(token);\n }\n /**\n * Find providers by name\n * @param using The root element to search from\n * @param provider The name of binding variable\n * @param exactMatch Whether using exactMatch\n */\n findProviders(using, provider, exactMatch) {\n // TODO(juliemr): implement.\n return [];\n }\n static ɵfac = function Testability_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || Testability)(__inject(NgZone), __inject(TestabilityRegistry), __inject(TESTABILITY_GETTER));\n };\n static ɵprov = /*@__PURE__*/__defineInjectable({\n token: Testability,\n factory: Testability.ɵfac\n });\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && setClassMetadata(Testability, [{\n type: Injectable\n }], () => [{\n type: NgZone\n }, {\n type: TestabilityRegistry\n }, {\n type: undefined,\n decorators: [{\n type: Inject,\n args: [TESTABILITY_GETTER]\n }]\n }], null);\n})();\n/**\n * A global registry of {@link Testability} instances for specific elements.\n * @publicApi\n */\nclass TestabilityRegistry {\n /** @internal */\n _applications = new Map();\n /**\n * Registers an application with a testability hook so that it can be tracked\n * @param token token of application, root element\n * @param testability Testability hook\n */\n registerApplication(token, testability) {\n this._applications.set(token, testability);\n }\n /**\n * Unregisters an application.\n * @param token token of application, root element\n */\n unregisterApplication(token) {\n this._applications.delete(token);\n }\n /**\n * Unregisters all applications\n */\n unregisterAllApplications() {\n this._applications.clear();\n }\n /**\n * Get a testability hook associated with the application\n * @param elem root element\n */\n getTestability(elem) {\n return this._applications.get(elem) || null;\n }\n /**\n * Get all registered testabilities\n */\n getAllTestabilities() {\n return Array.from(this._applications.values());\n }\n /**\n * Get all registered applications(root elements)\n */\n getAllRootElements() {\n return Array.from(this._applications.keys());\n }\n /**\n * Find testability of a node in the Tree\n * @param elem node\n * @param findInAncestors whether finding testability in ancestors if testability was not found in\n * current node\n */\n findTestabilityInTree(elem, findInAncestors = true) {\n return _testabilityGetter?.findTestabilityInTree(this, elem, findInAncestors) ?? null;\n }\n static ɵfac = function TestabilityRegistry_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || TestabilityRegistry)();\n };\n static ɵprov = /*@__PURE__*/__defineInjectable({\n token: TestabilityRegistry,\n factory: TestabilityRegistry.ɵfac,\n providedIn: 'platform'\n });\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && setClassMetadata(TestabilityRegistry, [{\n type: Injectable,\n args: [{\n providedIn: 'platform'\n }]\n }], null, null);\n})();\n/**\n * Set the {@link GetTestability} implementation used by the Angular testing framework.\n * @publicApi\n */\nfunction setTestabilityGetter(getter) {\n _testabilityGetter = getter;\n}\nlet _testabilityGetter;\n\n/**\n * Determine if the argument is shaped like a Promise\n */\nfunction isPromise(obj) {\n // allow any Promise/A+ compliant thenable.\n // It's up to the caller to ensure that obj.then conforms to the spec\n return !!obj && typeof obj.then === 'function';\n}\n/**\n * Determine if the argument is a Subscribable\n */\nfunction isSubscribable(obj) {\n return !!obj && typeof obj.subscribe === 'function';\n}\n\n/**\n * A DI token that you can use to provide\n * one or more initialization functions.\n *\n * The provided functions are injected at application startup and executed during\n * app initialization. If any of these functions returns a Promise or an Observable, initialization\n * does not complete until the Promise is resolved or the Observable is completed.\n *\n * You can, for example, create a factory function that loads language data\n * or an external configuration, and provide that function to the `APP_INITIALIZER` token.\n * The function is executed during the application bootstrap process,\n * and the needed data is available on startup.\n *\n * Note that the provided initializer is run in the injection context.\n *\n * @deprecated from v19.0.0, use provideAppInitializer instead\n *\n * @see {@link ApplicationInitStatus}\n * @see {@link provideAppInitializer}\n *\n * @usageNotes\n *\n * The following example illustrates how to configure a multi-provider using `APP_INITIALIZER` token\n * and a function returning a promise.\n * ### Example with NgModule-based application\n * ```ts\n * function initializeApp(): Promise<any> {\n * const http = inject(HttpClient);\n * return firstValueFrom(\n * http\n * .get(\"https://someUrl.com/api/user\")\n * .pipe(tap(user => { ... }))\n * );\n * }\n *\n * @NgModule({\n * imports: [BrowserModule],\n * declarations: [AppComponent],\n * bootstrap: [AppComponent],\n * providers: [{\n * provide: APP_INITIALIZER,\n * useValue: initializeApp,\n * multi: true,\n * }]\n * })\n * export class AppModule {}\n * ```\n *\n * ### Example with standalone application\n * ```ts\n * function initializeApp() {\n * const http = inject(HttpClient);\n * return firstValueFrom(\n * http\n * .get(\"https://someUrl.com/api/user\")\n * .pipe(tap(user => { ... }))\n * );\n * }\n *\n * bootstrapApplication(App, {\n * providers: [\n * provideHttpClient(),\n * {\n * provide: APP_INITIALIZER,\n * useValue: initializeApp,\n * multi: true,\n * },\n * ],\n * });\n\n * ```\n *\n *\n * It's also possible to configure a multi-provider using `APP_INITIALIZER` token and a function\n * returning an observable, see an example below. Note: the `HttpClient` in this example is used for\n * demo purposes to illustrate how the factory function can work with other providers available\n * through DI.\n *\n * ### Example with NgModule-based application\n * ```ts\n * function initializeApp() {\n * const http = inject(HttpClient);\n * return firstValueFrom(\n * http\n * .get(\"https://someUrl.com/api/user\")\n * .pipe(tap(user => { ... }))\n * );\n * }\n *\n * @NgModule({\n * imports: [BrowserModule, HttpClientModule],\n * declarations: [AppComponent],\n * bootstrap: [AppComponent],\n * providers: [{\n * provide: APP_INITIALIZER,\n * useValue: initializeApp,\n * multi: true,\n * }]\n * })\n * export class AppModule {}\n * ```\n *\n * ### Example with standalone application\n * ```ts\n * function initializeApp() {\n * const http = inject(HttpClient);\n * return firstValueFrom(\n * http\n * .get(\"https://someUrl.com/api/user\")\n * .pipe(tap(user => { ... }))\n * );\n * }\n *\n * bootstrapApplication(App, {\n * providers: [\n * provideHttpClient(),\n * {\n * provide: APP_INITIALIZER,\n * useValue: initializeApp,\n * multi: true,\n * },\n * ],\n * });\n * ```\n *\n * @publicApi\n */\nconst APP_INITIALIZER = new InjectionToken(ngDevMode ? 'Application Initializer' : '');\n/**\n * @description\n * The provided function is injected at application startup and executed during\n * app initialization. If the function returns a Promise or an Observable, initialization\n * does not complete until the Promise is resolved or the Observable is completed.\n *\n * You can, for example, create a function that loads language data\n * or an external configuration, and provide that function using `provideAppInitializer()`.\n * The function is executed during the application bootstrap process,\n * and the needed data is available on startup.\n *\n * Note that the provided initializer is run in the injection context.\n *\n * Previously, this was achieved using the `APP_INITIALIZER` token which is now deprecated.\n *\n * @see {@link APP_INITIALIZER}\n *\n * @usageNotes\n * The following example illustrates how to configure an initialization function using\n * `provideAppInitializer()`\n * ```ts\n * bootstrapApplication(App, {\n * providers: [\n * provideAppInitializer(() => {\n * const http = inject(HttpClient);\n * return firstValueFrom(\n * http\n * .get(\"https://someUrl.com/api/user\")\n * .pipe(tap(user => { ... }))\n * );\n * }),\n * provideHttpClient(),\n * ],\n * });\n * ```\n *\n * @publicApi\n */\nfunction provideAppInitializer(initializerFn) {\n return makeEnvironmentProviders([{\n provide: APP_INITIALIZER,\n multi: true,\n useValue: initializerFn\n }]);\n}\n/**\n * A class that reflects the state of running {@link APP_INITIALIZER} functions.\n *\n * @publicApi\n */\nclass ApplicationInitStatus {\n // Using non null assertion, these fields are defined below\n // within the `new Promise` callback (synchronously).\n resolve;\n reject;\n initialized = false;\n done = false;\n donePromise = new Promise((res, rej) => {\n this.resolve = res;\n this.reject = rej;\n });\n appInits = inject(APP_INITIALIZER, {\n optional: true\n }) ?? [];\n injector = inject(Injector);\n constructor() {\n if ((typeof ngDevMode === 'undefined' || ngDevMode) && !Array.isArray(this.appInits)) {\n throw new RuntimeError(-209 /* RuntimeErrorCode.INVALID_MULTI_PROVIDER */, 'Unexpected type of the `APP_INITIALIZER` token value ' + `(expected an array, but got ${typeof this.appInits}). ` + 'Please check that the `APP_INITIALIZER` token is configured as a ' + '`multi: true` provider.');\n }\n }\n /** @internal */\n runInitializers() {\n if (this.initialized) {\n return;\n }\n const asyncInitPromises = [];\n for (const appInits of this.appInits) {\n const initResult = runInInjectionContext(this.injector, appInits);\n if (isPromise(initResult)) {\n asyncInitPromises.push(initResult);\n } else if (isSubscribable(initResult)) {\n const observableAsPromise = new Promise((resolve, reject) => {\n initResult.subscribe({\n complete: resolve,\n error: reject\n });\n });\n asyncInitPromises.push(observableAsPromise);\n }\n }\n const complete = () => {\n // @ts-expect-error overwriting a readonly\n this.done = true;\n this.resolve();\n };\n Promise.all(asyncInitPromises).then(() => {\n complete();\n }).catch(e => {\n this.reject(e);\n });\n if (asyncInitPromises.length === 0) {\n complete();\n }\n this.initialized = true;\n }\n static ɵfac = function ApplicationInitStatus_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || ApplicationInitStatus)();\n };\n static ɵprov = /*@__PURE__*/__defineInjectable({\n token: ApplicationInitStatus,\n factory: ApplicationInitStatus.ɵfac,\n providedIn: 'root'\n });\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && setClassMetadata(ApplicationInitStatus, [{\n type: Injectable,\n args: [{\n providedIn: 'root'\n }]\n }], () => [], null);\n})();\n\n/**\n * A DI token that provides a set of callbacks to\n * be called for every component that is bootstrapped.\n *\n * Each callback must take a `ComponentRef` instance and return nothing.\n *\n * `(componentRef: ComponentRef) => void`\n *\n * @publicApi\n */\nconst APP_BOOTSTRAP_LISTENER = new InjectionToken(ngDevMode ? 'appBootstrapListener' : '');\nfunction publishDefaultGlobalUtils() {\n ngDevMode && publishDefaultGlobalUtils$1();\n}\n/**\n * Sets the error for an invalid write to a signal to be an Angular `RuntimeError`.\n */\nfunction publishSignalConfiguration() {\n setThrowInvalidWriteToSignalError(() => {\n let errorMessage = '';\n if (ngDevMode) {\n const activeConsumer = getActiveConsumer();\n errorMessage = activeConsumer && isReactiveLViewConsumer(activeConsumer) ? 'Writing to signals is not allowed while Angular renders the template (eg. interpolations)' : 'Writing to signals is not allowed in a `computed`';\n }\n throw new RuntimeError(600 /* RuntimeErrorCode.SIGNAL_WRITE_FROM_ILLEGAL_CONTEXT */, errorMessage);\n });\n}\nfunction isBoundToModule(cf) {\n return cf.isBoundToModule;\n}\n/**\n * A token for third-party components that can register themselves with NgProbe.\n *\n * @deprecated\n * @publicApi\n */\nclass NgProbeToken {\n name;\n token;\n constructor(name, token) {\n this.name = name;\n this.token = token;\n }\n}\n/** Maximum number of times ApplicationRef will refresh all attached views in a single tick. */\nconst MAXIMUM_REFRESH_RERUNS = 10;\nfunction optionsReducer(dst, objs) {\n if (Array.isArray(objs)) {\n return objs.reduce(optionsReducer, dst);\n }\n return {\n ...dst,\n ...objs\n };\n}\n/**\n * A reference to an Angular application running on a page.\n *\n * @usageNotes\n * ### isStable examples and caveats\n *\n * Note two important points about `isStable`, demonstrated in the examples below:\n * - the application will never be stable if you start any kind\n * of recurrent asynchronous task when the application starts\n * (for example for a polling process, started with a `setInterval`, a `setTimeout`\n * or using RxJS operators like `interval`);\n * - the `isStable` Observable runs outside of the Angular zone.\n *\n * Let's imagine that you start a recurrent task\n * (here incrementing a counter, using RxJS `interval`),\n * and at the same time subscribe to `isStable`.\n *\n * ```ts\n * constructor(appRef: ApplicationRef) {\n * appRef.isStable.pipe(\n * filter(stable => stable)\n * ).subscribe(() => console.log('App is stable now');\n * interval(1000).subscribe(counter => console.log(counter));\n * }\n * ```\n * In this example, `isStable` will never emit `true`,\n * and the trace \"App is stable now\" will never get logged.\n *\n * If you want to execute something when the app is stable,\n * you have to wait for the application to be stable\n * before starting your polling process.\n *\n * ```ts\n * constructor(appRef: ApplicationRef) {\n * appRef.isStable.pipe(\n * first(stable => stable),\n * tap(stable => console.log('App is stable now')),\n * switchMap(() => interval(1000))\n * ).subscribe(counter => console.log(counter));\n * }\n * ```\n * In this example, the trace \"App is stable now\" will be logged\n * and then the counter starts incrementing every second.\n *\n * Note also that this Observable runs outside of the Angular zone,\n * which means that the code in the subscription\n * to this Observable will not trigger the change detection.\n *\n * Let's imagine that instead of logging the counter value,\n * you update a field of your component\n * and display it in its template.\n *\n * ```ts\n * constructor(appRef: ApplicationRef) {\n * appRef.isStable.pipe(\n * first(stable => stable),\n * switchMap(() => interval(1000))\n * ).subscribe(counter => this.value = counter);\n * }\n * ```\n * As the `isStable` Observable runs outside the zone,\n * the `value` field will be updated properly,\n * but the template will not be refreshed!\n *\n * You'll have to manually trigger the change detection to update the template.\n *\n * ```ts\n * constructor(appRef: ApplicationRef, cd: ChangeDetectorRef) {\n * appRef.isStable.pipe(\n * first(stable => stable),\n * switchMap(() => interval(1000))\n * ).subscribe(counter => {\n * this.value = counter;\n * cd.detectChanges();\n * });\n * }\n * ```\n *\n * Or make the subscription callback run inside the zone.\n *\n * ```ts\n * constructor(appRef: ApplicationRef, zone: NgZone) {\n * appRef.isStable.pipe(\n * first(stable => stable),\n * switchMap(() => interval(1000))\n * ).subscribe(counter => zone.run(() => this.value = counter));\n * }\n * ```\n *\n * @publicApi\n */\nclass ApplicationRef {\n /** @internal */\n _runningTick = false;\n _destroyed = false;\n _destroyListeners = [];\n /** @internal */\n _views = [];\n internalErrorHandler = inject(INTERNAL_APPLICATION_ERROR_HANDLER);\n afterRenderManager = inject(AfterRenderManager);\n zonelessEnabled = inject(ZONELESS_ENABLED);\n rootEffectScheduler = inject(EffectScheduler);\n /**\n * Current dirty state of the application across a number of dimensions (views, afterRender hooks,\n * etc).\n *\n * A flag set here means that `tick()` will attempt to resolve the dirtiness when executed.\n *\n * @internal\n */\n dirtyFlags = 0 /* ApplicationRefDirtyFlags.None */;\n /**\n * Most recent snapshot from the `TracingService`, if any.\n *\n * This snapshot attempts to capture the context when `tick()` was first\n * scheduled. It then runs wrapped in this context.\n *\n * @internal\n */\n tracingSnapshot = null;\n // Needed for ComponentFixture temporarily during migration of autoDetect behavior\n // Eventually the hostView of the fixture should just attach to ApplicationRef.\n allTestViews = new Set();\n autoDetectTestViews = new Set();\n includeAllTestViews = false;\n /** @internal */\n afterTick = new Subject();\n /** @internal */\n get allViews() {\n return [...(this.includeAllTestViews ? this.allTestViews : this.autoDetectTestViews).keys(), ...this._views];\n }\n /**\n * Indicates whether this instance was destroyed.\n */\n get destroyed() {\n return this._destroyed;\n }\n /**\n * Get a list of component types registered to this application.\n * This list is populated even before the component is created.\n */\n componentTypes = [];\n /**\n * Get a list of components registered to this application.\n */\n components = [];\n internalPendingTask = inject(PendingTasksInternal);\n /**\n * Returns an Observable that indicates when the application is stable or unstable.\n */\n get isStable() {\n // This is a getter because it might be invoked after the application has been destroyed.\n return this.internalPendingTask.hasPendingTasksObservable.pipe(map(pending => !pending));\n }\n constructor() {\n // Inject the tracing service to initialize it.\n inject(TracingService, {\n optional: true\n });\n }\n /**\n * @returns A promise that resolves when the application becomes stable\n */\n whenStable() {\n let subscription;\n return new Promise(resolve => {\n subscription = this.isStable.subscribe({\n next: stable => {\n if (stable) {\n resolve();\n }\n }\n });\n }).finally(() => {\n subscription.unsubscribe();\n });\n }\n _injector = inject(EnvironmentInjector);\n _rendererFactory = null;\n /**\n * The `EnvironmentInjector` used to create this application.\n */\n get injector() {\n return this._injector;\n }\n /**\n * Bootstrap a component onto the element identified by its selector or, optionally, to a\n * specified element.\n *\n * @usageNotes\n * ### Bootstrap process\n *\n * When bootstrapping a component, Angular mounts it onto a target DOM element\n * and kicks off automatic change detection. The target DOM element can be\n * provided using the `rootSelectorOrNode` argument.\n *\n * If the target DOM element is not provided, Angular tries to find one on a page\n * using the `selector` of the component that is being bootstrapped\n * (first matched element is used).\n *\n * ### Example\n *\n * Generally, we define the component to bootstrap in the `bootstrap` array of `NgModule`,\n * but it requires us to know the component while writing the application code.\n *\n * Imagine a situation where we have to wait for an API call to decide about the component to\n * bootstrap. We can use the `ngDoBootstrap` hook of the `NgModule` and call this method to\n * dynamically bootstrap a component.\n *\n * {@example core/ts/platform/platform.ts region='componentSelector'}\n *\n * Optionally, a component can be mounted onto a DOM element that does not match the\n * selector of the bootstrapped component.\n *\n * In the following example, we are providing a CSS selector to match the target element.\n *\n * {@example core/ts/platform/platform.ts region='cssSelector'}\n *\n * While in this example, we are providing reference to a DOM node.\n *\n * {@example core/ts/platform/platform.ts region='domNode'}\n */\n bootstrap(componentOrFactory, rootSelectorOrNode) {\n return this.bootstrapImpl(componentOrFactory, rootSelectorOrNode);\n }\n bootstrapImpl(componentOrFactory, rootSelectorOrNode, injector = Injector.NULL) {\n const ngZone = this._injector.get(NgZone);\n return ngZone.run(() => {\n profiler(10 /* ProfilerEvent.BootstrapComponentStart */);\n (typeof ngDevMode === 'undefined' || ngDevMode) && warnIfDestroyed(this._destroyed);\n const isComponentFactory = componentOrFactory instanceof ComponentFactory$1;\n const initStatus = this._injector.get(ApplicationInitStatus);\n if (!initStatus.done) {\n let errorMessage = '';\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n const standalone = !isComponentFactory && isStandalone(componentOrFactory);\n errorMessage = 'Cannot bootstrap as there are still asynchronous initializers running.' + (standalone ? '' : ' Bootstrap components in the `ngDoBootstrap` method of the root module.');\n }\n throw new RuntimeError(405 /* RuntimeErrorCode.ASYNC_INITIALIZERS_STILL_RUNNING */, errorMessage);\n }\n let componentFactory;\n if (isComponentFactory) {\n componentFactory = componentOrFactory;\n } else {\n const resolver = this._injector.get(ComponentFactoryResolver$1);\n componentFactory = resolver.resolveComponentFactory(componentOrFactory);\n }\n this.componentTypes.push(componentFactory.componentType);\n // Create a factory associated with the current module if it's not bound to some other\n const ngModule = isBoundToModule(componentFactory) ? undefined : this._injector.get(NgModuleRef$1);\n const selectorOrNode = rootSelectorOrNode || componentFactory.selector;\n const compRef = componentFactory.create(injector, [], selectorOrNode, ngModule);\n const nativeElement = compRef.location.nativeElement;\n const testability = compRef.injector.get(TESTABILITY, null);\n testability?.registerApplication(nativeElement);\n compRef.onDestroy(() => {\n this.detachView(compRef.hostView);\n remove(this.components, compRef);\n testability?.unregisterApplication(nativeElement);\n });\n this._loadComponent(compRef);\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n const _console = this._injector.get(Console);\n _console.log(`Angular is running in development mode.`);\n }\n profiler(11 /* ProfilerEvent.BootstrapComponentEnd */, compRef);\n return compRef;\n });\n }\n /**\n * Invoke this method to explicitly process change detection and its side-effects.\n *\n * In development mode, `tick()` also performs a second change detection cycle to ensure that no\n * further changes are detected. If additional changes are picked up during this second cycle,\n * bindings in the app have side-effects that cannot be resolved in a single change detection\n * pass.\n * In this case, Angular throws an error, since an Angular application can only have one change\n * detection pass during which all change detection must complete.\n */\n tick() {\n if (!this.zonelessEnabled) {\n this.dirtyFlags |= 1 /* ApplicationRefDirtyFlags.ViewTreeGlobal */;\n }\n this._tick();\n }\n /** @internal */\n _tick() {\n profiler(12 /* ProfilerEvent.ChangeDetectionStart */);\n if (this.tracingSnapshot !== null) {\n // Ensure we always run `tickImpl()` in the context of the most recent snapshot,\n // if one exists. Snapshots may be reference counted by the implementation so\n // we want to ensure that if we request a snapshot that we use it.\n this.tracingSnapshot.run(TracingAction.CHANGE_DETECTION, this.tickImpl);\n } else {\n this.tickImpl();\n }\n }\n tickImpl = () => {\n (typeof ngDevMode === 'undefined' || ngDevMode) && warnIfDestroyed(this._destroyed);\n if (this._runningTick) {\n throw new RuntimeError(101 /* RuntimeErrorCode.RECURSIVE_APPLICATION_REF_TICK */, ngDevMode && 'ApplicationRef.tick is called recursively');\n }\n const prevConsumer = setActiveConsumer(null);\n try {\n this._runningTick = true;\n this.synchronize();\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n for (let view of this.allViews) {\n view.checkNoChanges();\n }\n }\n } finally {\n this._runningTick = false;\n this.tracingSnapshot?.dispose();\n this.tracingSnapshot = null;\n setActiveConsumer(prevConsumer);\n this.afterTick.next();\n profiler(13 /* ProfilerEvent.ChangeDetectionEnd */);\n }\n };\n /**\n * Performs the core work of synchronizing the application state with the UI, resolving any\n * pending dirtiness (potentially in a loop).\n */\n synchronize() {\n if (this._rendererFactory === null && !this._injector.destroyed) {\n this._rendererFactory = this._injector.get(RendererFactory2, null, {\n optional: true\n });\n }\n let runs = 0;\n while (this.dirtyFlags !== 0 /* ApplicationRefDirtyFlags.None */ && runs++ < MAXIMUM_REFRESH_RERUNS) {\n profiler(14 /* ProfilerEvent.ChangeDetectionSyncStart */);\n this.synchronizeOnce();\n profiler(15 /* ProfilerEvent.ChangeDetectionSyncEnd */);\n }\n if ((typeof ngDevMode === 'undefined' || ngDevMode) && runs >= MAXIMUM_REFRESH_RERUNS) {\n throw new RuntimeError(103 /* RuntimeErrorCode.INFINITE_CHANGE_DETECTION */, ngDevMode && 'Infinite change detection while refreshing application views. ' + 'Ensure views are not calling `markForCheck` on every template execution or ' + 'that afterRender hooks always mark views for check.');\n }\n }\n /**\n * Perform a single synchronization pass.\n */\n synchronizeOnce() {\n // First, process any dirty root effects.\n if (this.dirtyFlags & 16 /* ApplicationRefDirtyFlags.RootEffects */) {\n this.dirtyFlags &= ~16 /* ApplicationRefDirtyFlags.RootEffects */;\n this.rootEffectScheduler.flush();\n }\n // First check dirty views, if there are any.\n let ranDetectChanges = false;\n if (this.dirtyFlags & 7 /* ApplicationRefDirtyFlags.ViewTreeAny */) {\n // Change detection on views starts in targeted mode (only check components if they're\n // marked as dirty) unless global checking is specifically requested via APIs like\n // `ApplicationRef.tick()` and the `NgZone` integration.\n const useGlobalCheck = Boolean(this.dirtyFlags & 1 /* ApplicationRefDirtyFlags.ViewTreeGlobal */);\n // Clear the view-related dirty flags.\n this.dirtyFlags &= ~7 /* ApplicationRefDirtyFlags.ViewTreeAny */;\n // Set the AfterRender bit, as we're checking views and will need to run afterRender hooks.\n this.dirtyFlags |= 8 /* ApplicationRefDirtyFlags.AfterRender */;\n // Check all potentially dirty views.\n for (let {\n _lView\n } of this.allViews) {\n // When re-checking, only check views which actually need it.\n if (!useGlobalCheck && !requiresRefreshOrTraversal(_lView)) {\n continue;\n }\n const mode = useGlobalCheck && !this.zonelessEnabled ?\n // Global mode includes `CheckAlways` views.\n 0 /* ChangeDetectionMode.Global */ :\n // Only refresh views with the `RefreshView` flag or views is a changed signal\n 1 /* ChangeDetectionMode.Targeted */;\n detectChangesInternal(_lView, mode);\n ranDetectChanges = true;\n }\n // If `markForCheck()` was called during view checking, it will have set the `ViewTreeCheck`\n // flag. We clear the flag here because, for backwards compatibility, `markForCheck()`\n // during view checking doesn't cause the view to be re-checked.\n this.dirtyFlags &= ~4 /* ApplicationRefDirtyFlags.ViewTreeCheck */;\n // Check if any views are still dirty after checking and we need to loop back.\n this.syncDirtyFlagsWithViews();\n if (this.dirtyFlags & (7 /* ApplicationRefDirtyFlags.ViewTreeAny */ | 16 /* ApplicationRefDirtyFlags.RootEffects */)) {\n // If any views or effects are still dirty after checking, loop back before running render\n // hooks.\n return;\n }\n }\n if (!ranDetectChanges) {\n // If we skipped refreshing views above, there might still be unflushed animations\n // because we never called `detectChangesInternal` on the views.\n this._rendererFactory?.begin?.();\n this._rendererFactory?.end?.();\n }\n // Even if there were no dirty views, afterRender hooks might still be dirty.\n if (this.dirtyFlags & 8 /* ApplicationRefDirtyFlags.AfterRender */) {\n this.dirtyFlags &= ~8 /* ApplicationRefDirtyFlags.AfterRender */;\n this.afterRenderManager.execute();\n // afterRender hooks might influence dirty flags.\n }\n this.syncDirtyFlagsWithViews();\n }\n /**\n * Checks `allViews` for views which require refresh/traversal, and updates `dirtyFlags`\n * accordingly, with two potential behaviors:\n *\n * 1. If any of our views require updating, then this adds the `ViewTreeTraversal` dirty flag.\n * This _should_ be a no-op, since the scheduler should've added the flag at the same time the\n * view was marked as needing updating.\n *\n * TODO(alxhub): figure out if this behavior is still needed for edge cases.\n *\n * 2. If none of our views require updating, then clear the view-related `dirtyFlag`s. This\n * happens when the scheduler is notified of a view becoming dirty, but the view itself isn't\n * reachable through traversal from our roots (e.g. it's detached from the CD tree).\n */\n syncDirtyFlagsWithViews() {\n if (this.allViews.some(({\n _lView\n }) => requiresRefreshOrTraversal(_lView))) {\n // If after running all afterRender callbacks new views are dirty, ensure we loop back.\n this.dirtyFlags |= 2 /* ApplicationRefDirtyFlags.ViewTreeTraversal */;\n return;\n } else {\n // Even though this flag may be set, none of _our_ views require traversal, and so the\n // `ApplicationRef` doesn't require any repeated checking.\n this.dirtyFlags &= ~7 /* ApplicationRefDirtyFlags.ViewTreeAny */;\n }\n }\n /**\n * Attaches a view so that it will be dirty checked.\n * The view will be automatically detached when it is destroyed.\n * This will throw if the view is already attached to a ViewContainer.\n */\n attachView(viewRef) {\n (typeof ngDevMode === 'undefined' || ngDevMode) && warnIfDestroyed(this._destroyed);\n const view = viewRef;\n this._views.push(view);\n view.attachToAppRef(this);\n }\n /**\n * Detaches a view from dirty checking again.\n */\n detachView(viewRef) {\n (typeof ngDevMode === 'undefined' || ngDevMode) && warnIfDestroyed(this._destroyed);\n const view = viewRef;\n remove(this._views, view);\n view.detachFromAppRef();\n }\n _loadComponent(componentRef) {\n this.attachView(componentRef.hostView);\n try {\n this.tick();\n } catch (e) {\n this.internalErrorHandler(e);\n }\n this.components.push(componentRef);\n // Get the listeners lazily to prevent DI cycles.\n const listeners = this._injector.get(APP_BOOTSTRAP_LISTENER, []);\n if (ngDevMode && !Array.isArray(listeners)) {\n throw new RuntimeError(-209 /* RuntimeErrorCode.INVALID_MULTI_PROVIDER */, 'Unexpected type of the `APP_BOOTSTRAP_LISTENER` token value ' + `(expected an array, but got ${typeof listeners}). ` + 'Please check that the `APP_BOOTSTRAP_LISTENER` token is configured as a ' + '`multi: true` provider.');\n }\n listeners.forEach(listener => listener(componentRef));\n }\n /** @internal */\n ngOnDestroy() {\n if (this._destroyed) return;\n try {\n // Call all the lifecycle hooks.\n this._destroyListeners.forEach(listener => listener());\n // Destroy all registered views.\n this._views.slice().forEach(view => view.destroy());\n } finally {\n // Indicate that this instance is destroyed.\n this._destroyed = true;\n // Release all references.\n this._views = [];\n this._destroyListeners = [];\n }\n }\n /**\n * Registers a listener to be called when an instance is destroyed.\n *\n * @param callback A callback function to add as a listener.\n * @returns A function which unregisters a listener.\n */\n onDestroy(callback) {\n (typeof ngDevMode === 'undefined' || ngDevMode) && warnIfDestroyed(this._destroyed);\n this._destroyListeners.push(callback);\n return () => remove(this._destroyListeners, callback);\n }\n /**\n * Destroys an Angular application represented by this `ApplicationRef`. Calling this function\n * will destroy the associated environment injectors as well as all the bootstrapped components\n * with their views.\n */\n destroy() {\n if (this._destroyed) {\n throw new RuntimeError(406 /* RuntimeErrorCode.APPLICATION_REF_ALREADY_DESTROYED */, ngDevMode && 'This instance of the `ApplicationRef` has already been destroyed.');\n }\n const injector = this._injector;\n // Check that this injector instance supports destroy operation.\n if (injector.destroy && !injector.destroyed) {\n // Destroying an underlying injector will trigger the `ngOnDestroy` lifecycle\n // hook, which invokes the remaining cleanup actions.\n injector.destroy();\n }\n }\n /**\n * Returns the number of attached views.\n */\n get viewCount() {\n return this._views.length;\n }\n static ɵfac = function ApplicationRef_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || ApplicationRef)();\n };\n static ɵprov = /*@__PURE__*/__defineInjectable({\n token: ApplicationRef,\n factory: ApplicationRef.ɵfac,\n providedIn: 'root'\n });\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && setClassMetadata(ApplicationRef, [{\n type: Injectable,\n args: [{\n providedIn: 'root'\n }]\n }], () => [], null);\n})();\nfunction warnIfDestroyed(destroyed) {\n if (destroyed) {\n console.warn(formatRuntimeError(406 /* RuntimeErrorCode.APPLICATION_REF_ALREADY_DESTROYED */, 'This instance of the `ApplicationRef` has already been destroyed.'));\n }\n}\nfunction remove(list, el) {\n const index = list.indexOf(el);\n if (index > -1) {\n list.splice(index, 1);\n }\n}\n\n/**\n * Schedules triggering of a defer block for `on idle` and `on timer` conditions.\n */\nfunction scheduleDelayedTrigger(scheduleFn) {\n const lView = getLView();\n const tNode = getCurrentTNode();\n renderPlaceholder(lView, tNode);\n // Exit early to avoid invoking `scheduleFn`, which would\n // add `setTimeout` call and potentially delay serialization\n // on the server unnecessarily.\n if (!shouldTriggerDeferBlock(0 /* TriggerType.Regular */, lView)) return;\n const injector = lView[INJECTOR];\n const lDetails = getLDeferBlockDetails(lView, tNode);\n const cleanupFn = scheduleFn(() => triggerDeferBlock(0 /* TriggerType.Regular */, lView, tNode), injector);\n storeTriggerCleanupFn(0 /* TriggerType.Regular */, lDetails, cleanupFn);\n}\n/**\n * Schedules prefetching for `on idle` and `on timer` triggers.\n *\n * @param scheduleFn A function that does the scheduling.\n */\nfunction scheduleDelayedPrefetching(scheduleFn, trigger) {\n if (typeof ngServerMode !== 'undefined' && ngServerMode) return;\n const lView = getLView();\n const injector = lView[INJECTOR];\n // Only trigger the scheduled trigger on the browser\n // since we don't want to delay the server response.\n const tNode = getCurrentTNode();\n const tView = lView[TVIEW];\n const tDetails = getTDeferBlockDetails(tView, tNode);\n if (tDetails.loadingState === DeferDependenciesLoadingState.NOT_STARTED) {\n const lDetails = getLDeferBlockDetails(lView, tNode);\n const prefetch = () => triggerPrefetching(tDetails, lView, tNode);\n const cleanupFn = scheduleFn(prefetch, injector);\n storeTriggerCleanupFn(1 /* TriggerType.Prefetch */, lDetails, cleanupFn);\n }\n}\n/**\n * Schedules hydration triggering of a defer block for `on idle` and `on timer` conditions.\n */\nfunction scheduleDelayedHydrating(scheduleFn, lView, tNode) {\n if (typeof ngServerMode !== 'undefined' && ngServerMode) return;\n // Only trigger the scheduled trigger on the browser\n // since we don't want to delay the server response.\n const injector = lView[INJECTOR];\n const lDetails = getLDeferBlockDetails(lView, tNode);\n const ssrUniqueId = lDetails[SSR_UNIQUE_ID];\n ngDevMode && assertSsrIdDefined(ssrUniqueId);\n const cleanupFn = scheduleFn(() => triggerHydrationFromBlockName(injector, ssrUniqueId), injector);\n storeTriggerCleanupFn(2 /* TriggerType.Hydrate */, lDetails, cleanupFn);\n}\n/**\n * Trigger prefetching of dependencies for a defer block.\n *\n * @param tDetails Static information about this defer block.\n * @param lView LView of a host view.\n * @param tNode TNode that represents a defer block.\n */\nfunction triggerPrefetching(tDetails, lView, tNode) {\n triggerResourceLoading(tDetails, lView, tNode);\n}\n/**\n * Trigger loading of defer block dependencies if the process hasn't started yet.\n *\n * @param tDetails Static information about this defer block.\n * @param lView LView of a host view.\n */\nfunction triggerResourceLoading(tDetails, lView, tNode) {\n const injector = lView[INJECTOR];\n const tView = lView[TVIEW];\n if (tDetails.loadingState !== DeferDependenciesLoadingState.NOT_STARTED) {\n // If the loading status is different from initial one, it means that\n // the loading of dependencies is in progress and there is nothing to do\n // in this function. All details can be obtained from the `tDetails` object.\n return tDetails.loadingPromise ?? Promise.resolve();\n }\n const lDetails = getLDeferBlockDetails(lView, tNode);\n const primaryBlockTNode = getPrimaryBlockTNode(tView, tDetails);\n // Switch from NOT_STARTED -> IN_PROGRESS state.\n tDetails.loadingState = DeferDependenciesLoadingState.IN_PROGRESS;\n // Prefetching is triggered, cleanup all registered prefetch triggers.\n invokeTriggerCleanupFns(1 /* TriggerType.Prefetch */, lDetails);\n let dependenciesFn = tDetails.dependencyResolverFn;\n if (ngDevMode) {\n // Check if dependency function interceptor is configured.\n const deferDependencyInterceptor = injector.get(DEFER_BLOCK_DEPENDENCY_INTERCEPTOR, null, {\n optional: true\n });\n if (deferDependencyInterceptor) {\n dependenciesFn = deferDependencyInterceptor.intercept(dependenciesFn);\n }\n }\n // Indicate that an application is not stable and has a pending task.\n const removeTask = injector.get(PendingTasks).add();\n // The `dependenciesFn` might be `null` when all dependencies within\n // a given defer block were eagerly referenced elsewhere in a file,\n // thus no dynamic `import()`s were produced.\n if (!dependenciesFn) {\n tDetails.loadingPromise = Promise.resolve().then(() => {\n tDetails.loadingPromise = null;\n tDetails.loadingState = DeferDependenciesLoadingState.COMPLETE;\n removeTask();\n });\n return tDetails.loadingPromise;\n }\n // Start downloading of defer block dependencies.\n tDetails.loadingPromise = Promise.allSettled(dependenciesFn()).then(results => {\n let failed = false;\n const directiveDefs = [];\n const pipeDefs = [];\n for (const result of results) {\n if (result.status === 'fulfilled') {\n const dependency = result.value;\n const directiveDef = getComponentDef(dependency) || getDirectiveDef(dependency);\n if (directiveDef) {\n directiveDefs.push(directiveDef);\n } else {\n const pipeDef = getPipeDef$1(dependency);\n if (pipeDef) {\n pipeDefs.push(pipeDef);\n }\n }\n } else {\n failed = true;\n break;\n }\n }\n if (failed) {\n tDetails.loadingState = DeferDependenciesLoadingState.FAILED;\n if (tDetails.errorTmplIndex === null) {\n const templateLocation = ngDevMode ? getTemplateLocationDetails(lView) : '';\n const error = new RuntimeError(-750 /* RuntimeErrorCode.DEFER_LOADING_FAILED */, ngDevMode && 'Loading dependencies for `@defer` block failed, ' + `but no \\`@error\\` block was configured${templateLocation}. ` + 'Consider using the `@error` block to render an error state.');\n handleUncaughtError(lView, error);\n }\n } else {\n tDetails.loadingState = DeferDependenciesLoadingState.COMPLETE;\n // Update directive and pipe registries to add newly downloaded dependencies.\n const primaryBlockTView = primaryBlockTNode.tView;\n if (directiveDefs.length > 0) {\n primaryBlockTView.directiveRegistry = addDepsToRegistry(primaryBlockTView.directiveRegistry, directiveDefs);\n // Extract providers from all NgModules imported by standalone components\n // used within this defer block.\n const directiveTypes = directiveDefs.map(def => def.type);\n const providers = internalImportProvidersFrom(false, ...directiveTypes);\n tDetails.providers = providers;\n }\n if (pipeDefs.length > 0) {\n primaryBlockTView.pipeRegistry = addDepsToRegistry(primaryBlockTView.pipeRegistry, pipeDefs);\n }\n }\n });\n return tDetails.loadingPromise.finally(() => {\n // Loading is completed, we no longer need the loading Promise\n // and a pending task should also be removed.\n tDetails.loadingPromise = null;\n removeTask();\n });\n}\n/**\n * Defines whether we should proceed with triggering a given defer block.\n */\nfunction shouldTriggerDeferBlock(triggerType, lView) {\n // prevents triggering regular triggers when on the server.\n if (triggerType === 0 /* TriggerType.Regular */ && typeof ngServerMode !== 'undefined' && ngServerMode) {\n return false;\n }\n // prevents triggering in the case of a test run with manual defer block configuration.\n const injector = lView[INJECTOR];\n const config = injector.get(DEFER_BLOCK_CONFIG, null, {\n optional: true\n });\n if (config?.behavior === DeferBlockBehavior.Manual) {\n return false;\n }\n return true;\n}\n/**\n * Attempts to trigger loading of defer block dependencies.\n * If the block is already in a loading, completed or an error state -\n * no additional actions are taken.\n */\nfunction triggerDeferBlock(triggerType, lView, tNode) {\n const tView = lView[TVIEW];\n const lContainer = lView[tNode.index];\n ngDevMode && assertLContainer(lContainer);\n if (!shouldTriggerDeferBlock(triggerType, lView)) return;\n const lDetails = getLDeferBlockDetails(lView, tNode);\n const tDetails = getTDeferBlockDetails(tView, tNode);\n // Defer block is triggered, cleanup all registered trigger functions.\n invokeAllTriggerCleanupFns(lDetails);\n switch (tDetails.loadingState) {\n case DeferDependenciesLoadingState.NOT_STARTED:\n renderDeferBlockState(DeferBlockState.Loading, tNode, lContainer);\n triggerResourceLoading(tDetails, lView, tNode);\n // The `loadingState` might have changed to \"loading\".\n if (tDetails.loadingState === DeferDependenciesLoadingState.IN_PROGRESS) {\n renderDeferStateAfterResourceLoading(tDetails, tNode, lContainer);\n }\n break;\n case DeferDependenciesLoadingState.IN_PROGRESS:\n renderDeferBlockState(DeferBlockState.Loading, tNode, lContainer);\n renderDeferStateAfterResourceLoading(tDetails, tNode, lContainer);\n break;\n case DeferDependenciesLoadingState.COMPLETE:\n ngDevMode && assertDeferredDependenciesLoaded(tDetails);\n renderDeferBlockState(DeferBlockState.Complete, tNode, lContainer);\n break;\n case DeferDependenciesLoadingState.FAILED:\n renderDeferBlockState(DeferBlockState.Error, tNode, lContainer);\n break;\n default:\n if (ngDevMode) {\n throwError('Unknown defer block state');\n }\n }\n}\n/**\n * The core mechanism for incremental hydration. This triggers or\n * queues hydration for all the blocks in the tree that need to be hydrated\n * and keeps track of all those blocks that were hydrated along the way.\n *\n * Note: the `replayQueuedEventsFn` is only provided when hydration is invoked\n * as a result of an event replay (via JsAction). When hydration is invoked from\n * an instruction set (e.g. `deferOnImmediate`) - there is no need to replay any\n * events.\n */\nfunction triggerHydrationFromBlockName(_x, _x2, _x3) {\n return _triggerHydrationFromBlockName.apply(this, arguments);\n}\n/**\n * The core mechanism for incremental hydration. This triggers\n * hydration for all the blocks in the tree that need to be hydrated\n * and keeps track of all those blocks that were hydrated along the way.\n *\n * Note: the `replayQueuedEventsFn` is only provided when hydration is invoked\n * as a result of an event replay (via JsAction). When hydration is invoked from\n * an instruction set (e.g. `deferOnImmediate`) - there is no need to replay any\n * events.\n */\nfunction _triggerHydrationFromBlockName() {\n _triggerHydrationFromBlockName = _asyncToGenerator(function* (injector, blockName, replayQueuedEventsFn) {\n const dehydratedBlockRegistry = injector.get(DEHYDRATED_BLOCK_REGISTRY);\n const blocksBeingHydrated = dehydratedBlockRegistry.hydrating;\n // Make sure we don't hydrate/trigger the same thing multiple times\n if (blocksBeingHydrated.has(blockName)) {\n return;\n }\n // Trigger resource loading and hydration for the blocks in the queue in the order of highest block\n // to lowest block. Once a block has finished resource loading, after next render fires after hydration\n // finishes. The new block will have its defer instruction called and will be in the registry.\n // Due to timing related to potential nested control flow, this has to be scheduled after the next render.\n const {\n parentBlockPromise,\n hydrationQueue\n } = getParentBlockHydrationQueue(blockName, injector);\n if (hydrationQueue.length === 0) return;\n // It's possible that the hydrationQueue topmost item is actually in the process of hydrating and has\n // a promise already. In that case, we don't want to destroy that promise and queue it again.\n if (parentBlockPromise !== null) {\n hydrationQueue.shift();\n }\n // The hydrating map in the registry prevents re-triggering hydration for a block that's already in\n // the hydration queue. Here we generate promises for each of the blocks about to be hydrated\n populateHydratingStateForQueue(dehydratedBlockRegistry, hydrationQueue);\n // We await this after populating the hydration state so we can prevent re-triggering hydration for\n // the same blocks while this promise is being awaited.\n if (parentBlockPromise !== null) {\n yield parentBlockPromise;\n }\n const topmostParentBlock = hydrationQueue[0];\n if (dehydratedBlockRegistry.has(topmostParentBlock)) {\n // the topmost parent block is already in the registry and we can proceed\n // with hydration.\n yield triggerHydrationForBlockQueue(injector, hydrationQueue, replayQueuedEventsFn);\n } else {\n // the topmost parent block is not yet in the registry, which may mean\n // a lazy loaded route, a control flow branch was taken, a route has\n // been navigated, etc. So we need to queue up the hydration process\n // so that it can be finished after the top block has had its defer\n // instruction executed.\n dehydratedBlockRegistry.awaitParentBlock(topmostParentBlock, /*#__PURE__*/_asyncToGenerator(function* () {\n return yield triggerHydrationForBlockQueue(injector, hydrationQueue, replayQueuedEventsFn);\n }));\n }\n });\n return _triggerHydrationFromBlockName.apply(this, arguments);\n}\nfunction triggerHydrationForBlockQueue(_x4, _x5, _x6) {\n return _triggerHydrationForBlockQueue.apply(this, arguments);\n}\nfunction _triggerHydrationForBlockQueue() {\n _triggerHydrationForBlockQueue = _asyncToGenerator(function* (injector, hydrationQueue, replayQueuedEventsFn) {\n const dehydratedBlockRegistry = injector.get(DEHYDRATED_BLOCK_REGISTRY);\n const blocksBeingHydrated = dehydratedBlockRegistry.hydrating;\n // Indicate that we have some pending async work.\n const pendingTasks = injector.get(PendingTasksInternal);\n const taskId = pendingTasks.add();\n // Actually do the triggering and hydration of the queue of blocks\n for (let blockQueueIdx = 0; blockQueueIdx < hydrationQueue.length; blockQueueIdx++) {\n const dehydratedBlockId = hydrationQueue[blockQueueIdx];\n const dehydratedDeferBlock = dehydratedBlockRegistry.get(dehydratedBlockId);\n if (dehydratedDeferBlock != null) {\n // trigger the block resources and await next render for hydration. This should result\n // in the next block ɵɵdefer instruction being called and that block being added to the dehydrated registry.\n yield triggerResourceLoadingForHydration(dehydratedDeferBlock);\n yield nextRender(injector);\n // if the content has changed since server rendering, we need to check for the expected block\n // being in the registry or if errors occurred. In that case, we need to clean up the remaining expected\n // content that won't be rendered or fetched.\n if (deferBlockHasErrored(dehydratedDeferBlock)) {\n // Either the expected block has not yet had its ɵɵdefer instruction called or the block errored out when fetching\n // resources. In the former case, either we're hydrating too soon or the client and server differ. In both cases,\n // we need to clean up child content and promises.\n removeDehydratedViewList(dehydratedDeferBlock);\n cleanupRemainingHydrationQueue(hydrationQueue.slice(blockQueueIdx), dehydratedBlockRegistry);\n break;\n }\n // The defer block has not errored and we've finished fetching resources and rendering.\n // At this point it is safe to resolve the hydration promise.\n blocksBeingHydrated.get(dehydratedBlockId).resolve();\n } else {\n // The expected block has not yet had its ɵɵdefer instruction called. This is likely due to content changing between\n // client and server. We need to clean up the dehydrated DOM in the container since it no longer is valid.\n cleanupParentContainer(blockQueueIdx, hydrationQueue, dehydratedBlockRegistry);\n cleanupRemainingHydrationQueue(hydrationQueue.slice(blockQueueIdx), dehydratedBlockRegistry);\n break;\n }\n }\n const lastBlockName = hydrationQueue[hydrationQueue.length - 1];\n // Await hydration completion for the last block.\n yield blocksBeingHydrated.get(lastBlockName)?.promise;\n // All async work is done, remove the taskId from the registry.\n pendingTasks.remove(taskId);\n // Replay any queued events, if any exist and the replay operation was requested.\n if (replayQueuedEventsFn) {\n replayQueuedEventsFn(hydrationQueue);\n }\n // Cleanup after hydration of all affected defer blocks.\n cleanupHydratedDeferBlocks(dehydratedBlockRegistry.get(lastBlockName), hydrationQueue, dehydratedBlockRegistry, injector.get(ApplicationRef));\n });\n return _triggerHydrationForBlockQueue.apply(this, arguments);\n}\nfunction deferBlockHasErrored(deferBlock) {\n return getLDeferBlockDetails(deferBlock.lView, deferBlock.tNode)[DEFER_BLOCK_STATE] === DeferBlockState.Error;\n}\n/**\n * Clean up the parent container of a block where content changed between server and client.\n * The parent of a block going through `triggerHydrationFromBlockName` will contain the\n * dehydrated content that needs to be cleaned up. So we have to do the clean up from that location\n * in the tree.\n */\nfunction cleanupParentContainer(currentBlockIdx, hydrationQueue, dehydratedBlockRegistry) {\n // If a parent block exists, it's in the hydration queue in front of the current block.\n const parentDeferBlockIdx = currentBlockIdx - 1;\n const parentDeferBlock = parentDeferBlockIdx > -1 ? dehydratedBlockRegistry.get(hydrationQueue[parentDeferBlockIdx]) : null;\n if (parentDeferBlock) {\n cleanupLContainer(parentDeferBlock.lContainer);\n }\n}\nfunction cleanupRemainingHydrationQueue(hydrationQueue, dehydratedBlockRegistry) {\n const blocksBeingHydrated = dehydratedBlockRegistry.hydrating;\n for (const dehydratedBlockId in hydrationQueue) {\n blocksBeingHydrated.get(dehydratedBlockId)?.reject();\n }\n dehydratedBlockRegistry.cleanup(hydrationQueue);\n}\n/**\n * Generates a new promise for every defer block in the hydrating queue\n */\nfunction populateHydratingStateForQueue(registry, queue) {\n for (let blockId of queue) {\n registry.hydrating.set(blockId, Promise.withResolvers());\n }\n}\n// Waits for the next render cycle to complete\nfunction nextRender(injector) {\n return new Promise(resolveFn => afterNextRender(resolveFn, {\n injector\n }));\n}\nfunction triggerResourceLoadingForHydration(_x7) {\n return _triggerResourceLoadingForHydration.apply(this, arguments);\n}\n/**\n * Registers cleanup functions for a defer block when the block has finished\n * fetching and rendering\n */\nfunction _triggerResourceLoadingForHydration() {\n _triggerResourceLoadingForHydration = _asyncToGenerator(function* (dehydratedBlock) {\n const {\n tNode,\n lView\n } = dehydratedBlock;\n const lDetails = getLDeferBlockDetails(lView, tNode);\n return new Promise(resolve => {\n onDeferBlockCompletion(lDetails, resolve);\n triggerDeferBlock(2 /* TriggerType.Hydrate */, lView, tNode);\n });\n });\n return _triggerResourceLoadingForHydration.apply(this, arguments);\n}\nfunction onDeferBlockCompletion(lDetails, callback) {\n if (!Array.isArray(lDetails[ON_COMPLETE_FNS])) {\n lDetails[ON_COMPLETE_FNS] = [];\n }\n lDetails[ON_COMPLETE_FNS].push(callback);\n}\n/**\n * Determines whether specific trigger types should be attached during an instruction firing\n * to ensure the proper triggers for a given type are used.\n */\nfunction shouldAttachTrigger(triggerType, lView, tNode) {\n if (triggerType === 0 /* TriggerType.Regular */) {\n return shouldAttachRegularTrigger(lView, tNode);\n } else if (triggerType === 2 /* TriggerType.Hydrate */) {\n return !shouldAttachRegularTrigger(lView, tNode);\n }\n // TriggerType.Prefetch is active only on the client\n return !(typeof ngServerMode !== 'undefined' && ngServerMode);\n}\n/** Whether a given defer block has `hydrate` triggers. */\nfunction hasHydrateTriggers(flags) {\n return flags != null && (flags & 1 /* TDeferDetailsFlags.HasHydrateTriggers */) === 1 /* TDeferDetailsFlags.HasHydrateTriggers */;\n}\n/**\n * Defines whether a regular trigger logic (e.g. \"on viewport\") should be attached\n * to a defer block. This function defines a condition, which mutually excludes\n * `deferOn*` and `deferHydrateOn*` triggers, to make sure only one of the trigger\n * types is active for a block with the current state.\n */\nfunction shouldAttachRegularTrigger(lView, tNode) {\n const injector = lView[INJECTOR];\n const tDetails = getTDeferBlockDetails(lView[TVIEW], tNode);\n const incrementalHydrationEnabled = isIncrementalHydrationEnabled(injector);\n const _hasHydrateTriggers = hasHydrateTriggers(tDetails.flags);\n // On the server:\n if (typeof ngServerMode !== 'undefined' && ngServerMode) {\n // Regular triggers are activated on the server when:\n // - Either Incremental Hydration is *not* enabled\n // - Or Incremental Hydration is enabled, but a given block doesn't have \"hydrate\" triggers\n return !incrementalHydrationEnabled || !_hasHydrateTriggers;\n }\n // On the client:\n const lDetails = getLDeferBlockDetails(lView, tNode);\n const wasServerSideRendered = lDetails[SSR_UNIQUE_ID] !== null;\n if (_hasHydrateTriggers && wasServerSideRendered && incrementalHydrationEnabled) {\n return false;\n }\n return true;\n}\n/**\n * Retrives a Defer Block's list of hydration triggers\n */\nfunction getHydrateTriggers(tView, tNode) {\n const tDetails = getTDeferBlockDetails(tView, tNode);\n return tDetails.hydrateTriggers ??= new Map();\n}\n/**\n * Loops through all defer block summaries and ensures all the blocks triggers are\n * properly initialized\n */\nfunction processAndInitTriggers(injector, blockData, nodes) {\n const idleElements = [];\n const timerElements = [];\n const viewportElements = [];\n const immediateElements = [];\n for (let [blockId, blockSummary] of blockData) {\n const commentNode = nodes.get(blockId);\n if (commentNode !== undefined) {\n const numRootNodes = blockSummary.data[NUM_ROOT_NODES];\n let currentNode = commentNode;\n for (let i = 0; i < numRootNodes; i++) {\n currentNode = currentNode.previousSibling;\n if (currentNode.nodeType !== Node.ELEMENT_NODE) {\n continue;\n }\n const elementTrigger = {\n el: currentNode,\n blockName: blockId\n };\n // hydrate\n if (blockSummary.hydrate.idle) {\n idleElements.push(elementTrigger);\n }\n if (blockSummary.hydrate.immediate) {\n immediateElements.push(elementTrigger);\n }\n if (blockSummary.hydrate.timer !== null) {\n elementTrigger.delay = blockSummary.hydrate.timer;\n timerElements.push(elementTrigger);\n }\n if (blockSummary.hydrate.viewport) {\n viewportElements.push(elementTrigger);\n }\n }\n }\n }\n setIdleTriggers(injector, idleElements);\n setImmediateTriggers(injector, immediateElements);\n setViewportTriggers(injector, viewportElements);\n setTimerTriggers(injector, timerElements);\n}\nfunction setIdleTriggers(injector, elementTriggers) {\n for (const elementTrigger of elementTriggers) {\n const registry = injector.get(DEHYDRATED_BLOCK_REGISTRY);\n const onInvoke = () => triggerHydrationFromBlockName(injector, elementTrigger.blockName);\n const cleanupFn = onIdle(onInvoke, injector);\n registry.addCleanupFn(elementTrigger.blockName, cleanupFn);\n }\n}\nfunction setViewportTriggers(injector, elementTriggers) {\n if (elementTriggers.length > 0) {\n const registry = injector.get(DEHYDRATED_BLOCK_REGISTRY);\n for (let elementTrigger of elementTriggers) {\n const cleanupFn = onViewportWrapper(elementTrigger.el, () => triggerHydrationFromBlockName(injector, elementTrigger.blockName), injector);\n registry.addCleanupFn(elementTrigger.blockName, cleanupFn);\n }\n }\n}\nfunction setTimerTriggers(injector, elementTriggers) {\n for (const elementTrigger of elementTriggers) {\n const registry = injector.get(DEHYDRATED_BLOCK_REGISTRY);\n const onInvoke = () => triggerHydrationFromBlockName(injector, elementTrigger.blockName);\n const timerFn = onTimer(elementTrigger.delay);\n const cleanupFn = timerFn(onInvoke, injector);\n registry.addCleanupFn(elementTrigger.blockName, cleanupFn);\n }\n}\nfunction setImmediateTriggers(injector, elementTriggers) {\n for (const elementTrigger of elementTriggers) {\n // Note: we intentionally avoid awaiting each call and instead kick off\n // the hydration process simultaneously for all defer blocks with this trigger;\n triggerHydrationFromBlockName(injector, elementTrigger.blockName);\n }\n}\n\n/**\n * Indicates whether we've already produced a warning,\n * prevents the logic from producing it multiple times.\n */\nlet _hmrWarningProduced = false;\n/**\n * Logs a message into the console to indicate that `@defer` block\n * dependencies are loaded eagerly when the HMR mode is enabled.\n */\nfunction logHmrWarning(injector) {\n if (!_hmrWarningProduced) {\n _hmrWarningProduced = true;\n const console = injector.get(Console);\n // tslint:disable-next-line:no-console\n console.log(formatRuntimeError(-751 /* RuntimeErrorCode.DEFER_IN_HMR_MODE */, 'Angular has detected that this application contains `@defer` blocks ' + 'and the hot module replacement (HMR) mode is enabled. All `@defer` ' + 'block dependencies will be loaded eagerly.'));\n }\n}\n/**\n * Creates runtime data structures for defer blocks.\n *\n * @param index Index of the `defer` instruction.\n * @param primaryTmplIndex Index of the template with the primary block content.\n * @param dependencyResolverFn Function that contains dependencies for this defer block.\n * @param loadingTmplIndex Index of the template with the loading block content.\n * @param placeholderTmplIndex Index of the template with the placeholder block content.\n * @param errorTmplIndex Index of the template with the error block content.\n * @param loadingConfigIndex Index in the constants array of the configuration of the loading.\n * block.\n * @param placeholderConfigIndex Index in the constants array of the configuration of the\n * placeholder block.\n * @param enableTimerScheduling Function that enables timer-related scheduling if `after`\n * or `minimum` parameters are setup on the `@loading` or `@placeholder` blocks.\n * @param flags A set of flags to define a particular behavior (e.g. to indicate that\n * hydrate triggers are present and regular triggers should be deactivated\n * in certain scenarios).\n *\n * @codeGenApi\n */\nfunction ɵɵdefer(index, primaryTmplIndex, dependencyResolverFn, loadingTmplIndex, placeholderTmplIndex, errorTmplIndex, loadingConfigIndex, placeholderConfigIndex, enableTimerScheduling, flags) {\n const lView = getLView();\n const tView = getTView();\n const adjustedIndex = index + HEADER_OFFSET;\n const tNode = declareNoDirectiveHostTemplate(lView, tView, index, null, 0, 0);\n const injector = lView[INJECTOR];\n if (tView.firstCreatePass) {\n performanceMarkFeature('NgDefer');\n if (ngDevMode) {\n if (typeof ngHmrMode !== 'undefined' && ngHmrMode) {\n logHmrWarning(injector);\n }\n if (hasHydrateTriggers(flags)) {\n assertIncrementalHydrationIsConfigured(injector);\n }\n }\n const tDetails = {\n primaryTmplIndex,\n loadingTmplIndex: loadingTmplIndex ?? null,\n placeholderTmplIndex: placeholderTmplIndex ?? null,\n errorTmplIndex: errorTmplIndex ?? null,\n placeholderBlockConfig: null,\n loadingBlockConfig: null,\n dependencyResolverFn: dependencyResolverFn ?? null,\n loadingState: DeferDependenciesLoadingState.NOT_STARTED,\n loadingPromise: null,\n providers: null,\n hydrateTriggers: null,\n debug: null,\n flags: flags ?? 0 /* TDeferDetailsFlags.Default */\n };\n enableTimerScheduling?.(tView, tDetails, placeholderConfigIndex, loadingConfigIndex);\n setTDeferBlockDetails(tView, adjustedIndex, tDetails);\n }\n const lContainer = lView[adjustedIndex];\n // If hydration is enabled, looks up dehydrated views in the DOM\n // using hydration annotation info and stores those views on LContainer.\n // In client-only mode, this function is a noop.\n populateDehydratedViewsInLContainer(lContainer, tNode, lView);\n let ssrBlockState = null;\n let ssrUniqueId = null;\n if (lContainer[DEHYDRATED_VIEWS]?.length > 0) {\n const info = lContainer[DEHYDRATED_VIEWS][0].data;\n ssrUniqueId = info[DEFER_BLOCK_ID] ?? null;\n ssrBlockState = info[DEFER_BLOCK_STATE$1];\n }\n // Init instance-specific defer details and store it.\n const lDetails = [null,\n // NEXT_DEFER_BLOCK_STATE\n DeferBlockInternalState.Initial,\n // DEFER_BLOCK_STATE\n null,\n // STATE_IS_FROZEN_UNTIL\n null,\n // LOADING_AFTER_CLEANUP_FN\n null,\n // TRIGGER_CLEANUP_FNS\n null,\n // PREFETCH_TRIGGER_CLEANUP_FNS\n ssrUniqueId,\n // SSR_UNIQUE_ID\n ssrBlockState,\n // SSR_BLOCK_STATE\n null,\n // ON_COMPLETE_FNS\n null // HYDRATE_TRIGGER_CLEANUP_FNS\n ];\n setLDeferBlockDetails(lView, adjustedIndex, lDetails);\n let registry = null;\n if (ssrUniqueId !== null) {\n // Store this defer block in the registry, to have an access to\n // internal data structures from hydration runtime code.\n registry = injector.get(DEHYDRATED_BLOCK_REGISTRY);\n registry.add(ssrUniqueId, {\n lView,\n tNode,\n lContainer\n });\n }\n const onLViewDestroy = () => {\n invokeAllTriggerCleanupFns(lDetails);\n if (ssrUniqueId !== null) {\n registry?.cleanup([ssrUniqueId]);\n }\n };\n // When defer block is triggered - unsubscribe from LView destroy cleanup.\n storeTriggerCleanupFn(0 /* TriggerType.Regular */, lDetails, () => removeLViewOnDestroy(lView, onLViewDestroy));\n storeLViewOnDestroy(lView, onLViewDestroy);\n}\n/**\n * Loads defer block dependencies when a trigger value becomes truthy.\n * @codeGenApi\n */\nfunction ɵɵdeferWhen(rawValue) {\n const lView = getLView();\n const tNode = getSelectedTNode();\n if (ngDevMode) {\n trackTriggerForDebugging(lView[TVIEW], tNode, 'when <expression>');\n }\n if (!shouldAttachTrigger(0 /* TriggerType.Regular */, lView, tNode)) return;\n const bindingIndex = nextBindingIndex();\n if (bindingUpdated(lView, bindingIndex, rawValue)) {\n const prevConsumer = setActiveConsumer(null);\n try {\n const value = Boolean(rawValue); // handle truthy or falsy values\n const lDetails = getLDeferBlockDetails(lView, tNode);\n const renderedState = lDetails[DEFER_BLOCK_STATE];\n if (value === false && renderedState === DeferBlockInternalState.Initial) {\n // If nothing is rendered yet, render a placeholder (if defined).\n renderPlaceholder(lView, tNode);\n } else if (value === true && (renderedState === DeferBlockInternalState.Initial || renderedState === DeferBlockState.Placeholder)) {\n triggerDeferBlock(0 /* TriggerType.Regular */, lView, tNode);\n }\n } finally {\n setActiveConsumer(prevConsumer);\n }\n }\n}\n/**\n * Prefetches the deferred content when a value becomes truthy.\n * @codeGenApi\n */\nfunction ɵɵdeferPrefetchWhen(rawValue) {\n const lView = getLView();\n const tNode = getSelectedTNode();\n if (ngDevMode) {\n trackTriggerForDebugging(lView[TVIEW], tNode, 'prefetch when <expression>');\n }\n if (!shouldAttachTrigger(1 /* TriggerType.Prefetch */, lView, tNode)) return;\n const bindingIndex = nextBindingIndex();\n if (bindingUpdated(lView, bindingIndex, rawValue)) {\n const prevConsumer = setActiveConsumer(null);\n try {\n const value = Boolean(rawValue); // handle truthy or falsy values\n const tView = lView[TVIEW];\n const tNode = getSelectedTNode();\n const tDetails = getTDeferBlockDetails(tView, tNode);\n if (value === true && tDetails.loadingState === DeferDependenciesLoadingState.NOT_STARTED) {\n // If loading has not been started yet, trigger it now.\n triggerPrefetching(tDetails, lView, tNode);\n }\n } finally {\n setActiveConsumer(prevConsumer);\n }\n }\n}\n/**\n * Hydrates the deferred content when a value becomes truthy.\n * @codeGenApi\n */\nfunction ɵɵdeferHydrateWhen(rawValue) {\n const lView = getLView();\n const tNode = getSelectedTNode();\n if (ngDevMode) {\n trackTriggerForDebugging(lView[TVIEW], tNode, 'hydrate when <expression>');\n }\n if (!shouldAttachTrigger(2 /* TriggerType.Hydrate */, lView, tNode)) return;\n // TODO(incremental-hydration): audit all defer instructions to reduce unnecessary work by\n // moving function calls inside their relevant control flow blocks\n const bindingIndex = nextBindingIndex();\n const tView = getTView();\n const hydrateTriggers = getHydrateTriggers(tView, tNode);\n hydrateTriggers.set(6 /* DeferBlockTrigger.When */, null);\n if (bindingUpdated(lView, bindingIndex, rawValue)) {\n if (typeof ngServerMode !== 'undefined' && ngServerMode) {\n // We are on the server and SSR for defer blocks is enabled.\n triggerDeferBlock(2 /* TriggerType.Hydrate */, lView, tNode);\n } else {\n const injector = lView[INJECTOR];\n const prevConsumer = setActiveConsumer(null);\n try {\n const value = Boolean(rawValue); // handle truthy or falsy values\n if (value === true) {\n // The `when` condition has changed to `true`, trigger defer block loading\n // if the block is either in initial (nothing is rendered) or a placeholder\n // state.\n const lDetails = getLDeferBlockDetails(lView, tNode);\n const ssrUniqueId = lDetails[SSR_UNIQUE_ID];\n ngDevMode && assertSsrIdDefined(ssrUniqueId);\n triggerHydrationFromBlockName(injector, ssrUniqueId);\n }\n } finally {\n setActiveConsumer(prevConsumer);\n }\n }\n }\n}\n/**\n * Specifies that hydration never occurs.\n * @codeGenApi\n */\nfunction ɵɵdeferHydrateNever() {\n const lView = getLView();\n const tNode = getCurrentTNode();\n if (ngDevMode) {\n trackTriggerForDebugging(lView[TVIEW], tNode, 'hydrate never');\n }\n if (!shouldAttachTrigger(2 /* TriggerType.Hydrate */, lView, tNode)) return;\n const hydrateTriggers = getHydrateTriggers(getTView(), tNode);\n hydrateTriggers.set(7 /* DeferBlockTrigger.Never */, null);\n if (typeof ngServerMode !== 'undefined' && ngServerMode) {\n // We are on the server and SSR for defer blocks is enabled.\n triggerDeferBlock(2 /* TriggerType.Hydrate */, lView, tNode);\n }\n}\n/**\n * Sets up logic to handle the `on idle` deferred trigger.\n * @codeGenApi\n */\nfunction ɵɵdeferOnIdle() {\n const lView = getLView();\n const tNode = getCurrentTNode();\n if (ngDevMode) {\n trackTriggerForDebugging(lView[TVIEW], tNode, 'on idle');\n }\n if (!shouldAttachTrigger(0 /* TriggerType.Regular */, lView, tNode)) return;\n scheduleDelayedTrigger(onIdle);\n}\n/**\n * Sets up logic to handle the `prefetch on idle` deferred trigger.\n * @codeGenApi\n */\nfunction ɵɵdeferPrefetchOnIdle() {\n const lView = getLView();\n const tNode = getCurrentTNode();\n if (ngDevMode) {\n trackTriggerForDebugging(lView[TVIEW], tNode, 'prefetch on idle');\n }\n if (!shouldAttachTrigger(1 /* TriggerType.Prefetch */, lView, tNode)) return;\n scheduleDelayedPrefetching(onIdle);\n}\n/**\n * Sets up logic to handle the `on idle` deferred trigger.\n * @codeGenApi\n */\nfunction ɵɵdeferHydrateOnIdle() {\n const lView = getLView();\n const tNode = getCurrentTNode();\n if (ngDevMode) {\n trackTriggerForDebugging(lView[TVIEW], tNode, 'hydrate on idle');\n }\n if (!shouldAttachTrigger(2 /* TriggerType.Hydrate */, lView, tNode)) return;\n const hydrateTriggers = getHydrateTriggers(getTView(), tNode);\n hydrateTriggers.set(0 /* DeferBlockTrigger.Idle */, null);\n if (typeof ngServerMode !== 'undefined' && ngServerMode) {\n // We are on the server and SSR for defer blocks is enabled.\n triggerDeferBlock(2 /* TriggerType.Hydrate */, lView, tNode);\n } else {\n scheduleDelayedHydrating(onIdle, lView, tNode);\n }\n}\n/**\n * Sets up logic to handle the `on immediate` deferred trigger.\n * @codeGenApi\n */\nfunction ɵɵdeferOnImmediate() {\n const lView = getLView();\n const tNode = getCurrentTNode();\n if (ngDevMode) {\n trackTriggerForDebugging(lView[TVIEW], tNode, 'on immediate');\n }\n if (!shouldAttachTrigger(0 /* TriggerType.Regular */, lView, tNode)) return;\n // Render placeholder block only if loading template is not present and we're on\n // the client to avoid content flickering, since it would be immediately replaced\n // by the loading block.\n const tDetails = getTDeferBlockDetails(lView[TVIEW], tNode);\n if (tDetails.loadingTmplIndex === null) {\n renderPlaceholder(lView, tNode);\n }\n triggerDeferBlock(0 /* TriggerType.Regular */, lView, tNode);\n}\n/**\n * Sets up logic to handle the `prefetch on immediate` deferred trigger.\n * @codeGenApi\n */\nfunction ɵɵdeferPrefetchOnImmediate() {\n const lView = getLView();\n const tNode = getCurrentTNode();\n if (ngDevMode) {\n trackTriggerForDebugging(lView[TVIEW], tNode, 'prefetch on immediate');\n }\n if (!shouldAttachTrigger(1 /* TriggerType.Prefetch */, lView, tNode)) return;\n const tView = lView[TVIEW];\n const tDetails = getTDeferBlockDetails(tView, tNode);\n if (tDetails.loadingState === DeferDependenciesLoadingState.NOT_STARTED) {\n triggerResourceLoading(tDetails, lView, tNode);\n }\n}\n/**\n * Sets up logic to handle the `on immediate` hydrate trigger.\n * @codeGenApi\n */\nfunction ɵɵdeferHydrateOnImmediate() {\n const lView = getLView();\n const tNode = getCurrentTNode();\n if (ngDevMode) {\n trackTriggerForDebugging(lView[TVIEW], tNode, 'hydrate on immediate');\n }\n if (!shouldAttachTrigger(2 /* TriggerType.Hydrate */, lView, tNode)) return;\n const hydrateTriggers = getHydrateTriggers(getTView(), tNode);\n hydrateTriggers.set(1 /* DeferBlockTrigger.Immediate */, null);\n if (typeof ngServerMode !== 'undefined' && ngServerMode) {\n triggerDeferBlock(2 /* TriggerType.Hydrate */, lView, tNode);\n } else {\n const injector = lView[INJECTOR];\n const lDetails = getLDeferBlockDetails(lView, tNode);\n const ssrUniqueId = lDetails[SSR_UNIQUE_ID];\n ngDevMode && assertSsrIdDefined(ssrUniqueId);\n triggerHydrationFromBlockName(injector, ssrUniqueId);\n }\n}\n/**\n * Creates runtime data structures for the `on timer` deferred trigger.\n * @param delay Amount of time to wait before loading the content.\n * @codeGenApi\n */\nfunction ɵɵdeferOnTimer(delay) {\n const lView = getLView();\n const tNode = getCurrentTNode();\n if (ngDevMode) {\n trackTriggerForDebugging(lView[TVIEW], tNode, `on timer(${delay}ms)`);\n }\n if (!shouldAttachTrigger(0 /* TriggerType.Regular */, lView, tNode)) return;\n scheduleDelayedTrigger(onTimer(delay));\n}\n/**\n * Creates runtime data structures for the `prefetch on timer` deferred trigger.\n * @param delay Amount of time to wait before prefetching the content.\n * @codeGenApi\n */\nfunction ɵɵdeferPrefetchOnTimer(delay) {\n const lView = getLView();\n const tNode = getCurrentTNode();\n if (ngDevMode) {\n trackTriggerForDebugging(lView[TVIEW], tNode, `prefetch on timer(${delay}ms)`);\n }\n if (!shouldAttachTrigger(1 /* TriggerType.Prefetch */, lView, tNode)) return;\n scheduleDelayedPrefetching(onTimer(delay));\n}\n/**\n * Creates runtime data structures for the `on timer` hydrate trigger.\n * @param delay Amount of time to wait before loading the content.\n * @codeGenApi\n */\nfunction ɵɵdeferHydrateOnTimer(delay) {\n const lView = getLView();\n const tNode = getCurrentTNode();\n if (ngDevMode) {\n trackTriggerForDebugging(lView[TVIEW], tNode, `hydrate on timer(${delay}ms)`);\n }\n if (!shouldAttachTrigger(2 /* TriggerType.Hydrate */, lView, tNode)) return;\n const hydrateTriggers = getHydrateTriggers(getTView(), tNode);\n hydrateTriggers.set(5 /* DeferBlockTrigger.Timer */, {\n delay\n });\n if (typeof ngServerMode !== 'undefined' && ngServerMode) {\n // We are on the server and SSR for defer blocks is enabled.\n triggerDeferBlock(2 /* TriggerType.Hydrate */, lView, tNode);\n } else {\n scheduleDelayedHydrating(onTimer(delay), lView, tNode);\n }\n}\n/**\n * Creates runtime data structures for the `on hover` deferred trigger.\n * @param triggerIndex Index at which to find the trigger element.\n * @param walkUpTimes Number of times to walk up/down the tree hierarchy to find the trigger.\n * @codeGenApi\n */\nfunction ɵɵdeferOnHover(triggerIndex, walkUpTimes) {\n const lView = getLView();\n const tNode = getCurrentTNode();\n if (ngDevMode) {\n trackTriggerForDebugging(lView[TVIEW], tNode, `on hover${walkUpTimes === -1 ? '' : '(<target>)'}`);\n }\n if (!shouldAttachTrigger(0 /* TriggerType.Regular */, lView, tNode)) return;\n renderPlaceholder(lView, tNode);\n // Avoid adding event listeners when this instruction is invoked on the server.\n if (!(typeof ngServerMode !== 'undefined' && ngServerMode)) {\n registerDomTrigger(lView, tNode, triggerIndex, walkUpTimes, onHover, () => triggerDeferBlock(0 /* TriggerType.Regular */, lView, tNode), 0 /* TriggerType.Regular */);\n }\n}\n/**\n * Creates runtime data structures for the `prefetch on hover` deferred trigger.\n * @param triggerIndex Index at which to find the trigger element.\n * @param walkUpTimes Number of times to walk up/down the tree hierarchy to find the trigger.\n * @codeGenApi\n */\nfunction ɵɵdeferPrefetchOnHover(triggerIndex, walkUpTimes) {\n const lView = getLView();\n const tNode = getCurrentTNode();\n if (ngDevMode) {\n trackTriggerForDebugging(lView[TVIEW], tNode, `prefetch on hover${walkUpTimes === -1 ? '' : '(<target>)'}`);\n }\n if (!shouldAttachTrigger(1 /* TriggerType.Prefetch */, lView, tNode)) return;\n const tView = lView[TVIEW];\n const tDetails = getTDeferBlockDetails(tView, tNode);\n if (tDetails.loadingState === DeferDependenciesLoadingState.NOT_STARTED) {\n registerDomTrigger(lView, tNode, triggerIndex, walkUpTimes, onHover, () => triggerPrefetching(tDetails, lView, tNode), 1 /* TriggerType.Prefetch */);\n }\n}\n/**\n * Creates runtime data structures for the `on hover` hydrate trigger.\n * @codeGenApi\n */\nfunction ɵɵdeferHydrateOnHover() {\n const lView = getLView();\n const tNode = getCurrentTNode();\n if (ngDevMode) {\n trackTriggerForDebugging(lView[TVIEW], tNode, 'hydrate on hover');\n }\n if (!shouldAttachTrigger(2 /* TriggerType.Hydrate */, lView, tNode)) return;\n const hydrateTriggers = getHydrateTriggers(getTView(), tNode);\n hydrateTriggers.set(4 /* DeferBlockTrigger.Hover */, null);\n if (typeof ngServerMode !== 'undefined' && ngServerMode) {\n // We are on the server and SSR for defer blocks is enabled.\n triggerDeferBlock(2 /* TriggerType.Hydrate */, lView, tNode);\n }\n // The actual triggering of hydration on hover is handled by JSAction in\n // event_replay.ts.\n}\n/**\n * Creates runtime data structures for the `on interaction` deferred trigger.\n * @param triggerIndex Index at which to find the trigger element.\n * @param walkUpTimes Number of times to walk up/down the tree hierarchy to find the trigger.\n * @codeGenApi\n */\nfunction ɵɵdeferOnInteraction(triggerIndex, walkUpTimes) {\n const lView = getLView();\n const tNode = getCurrentTNode();\n if (ngDevMode) {\n trackTriggerForDebugging(lView[TVIEW], tNode, `on interaction${walkUpTimes === -1 ? '' : '(<target>)'}`);\n }\n if (!shouldAttachTrigger(0 /* TriggerType.Regular */, lView, tNode)) return;\n renderPlaceholder(lView, tNode);\n // Avoid adding event listeners when this instruction is invoked on the server.\n if (!(typeof ngServerMode !== 'undefined' && ngServerMode)) {\n registerDomTrigger(lView, tNode, triggerIndex, walkUpTimes, onInteraction, () => triggerDeferBlock(0 /* TriggerType.Regular */, lView, tNode), 0 /* TriggerType.Regular */);\n }\n}\n/**\n * Creates runtime data structures for the `prefetch on interaction` deferred trigger.\n * @param triggerIndex Index at which to find the trigger element.\n * @param walkUpTimes Number of times to walk up/down the tree hierarchy to find the trigger.\n * @codeGenApi\n */\nfunction ɵɵdeferPrefetchOnInteraction(triggerIndex, walkUpTimes) {\n const lView = getLView();\n const tNode = getCurrentTNode();\n if (ngDevMode) {\n trackTriggerForDebugging(lView[TVIEW], tNode, `prefetch on interaction${walkUpTimes === -1 ? '' : '(<target>)'}`);\n }\n if (!shouldAttachTrigger(1 /* TriggerType.Prefetch */, lView, tNode)) return;\n const tView = lView[TVIEW];\n const tDetails = getTDeferBlockDetails(tView, tNode);\n if (tDetails.loadingState === DeferDependenciesLoadingState.NOT_STARTED) {\n registerDomTrigger(lView, tNode, triggerIndex, walkUpTimes, onInteraction, () => triggerPrefetching(tDetails, lView, tNode), 1 /* TriggerType.Prefetch */);\n }\n}\n/**\n * Creates runtime data structures for the `on interaction` hydrate trigger.\n * @codeGenApi\n */\nfunction ɵɵdeferHydrateOnInteraction() {\n const lView = getLView();\n const tNode = getCurrentTNode();\n if (ngDevMode) {\n trackTriggerForDebugging(lView[TVIEW], tNode, 'hydrate on interaction');\n }\n if (!shouldAttachTrigger(2 /* TriggerType.Hydrate */, lView, tNode)) return;\n const hydrateTriggers = getHydrateTriggers(getTView(), tNode);\n hydrateTriggers.set(3 /* DeferBlockTrigger.Interaction */, null);\n if (typeof ngServerMode !== 'undefined' && ngServerMode) {\n // We are on the server and SSR for defer blocks is enabled.\n triggerDeferBlock(2 /* TriggerType.Hydrate */, lView, tNode);\n }\n // The actual triggering of hydration on interaction is handled by JSAction in\n // event_replay.ts.\n}\n/**\n * Creates runtime data structures for the `on viewport` deferred trigger.\n * @param triggerIndex Index at which to find the trigger element.\n * @param walkUpTimes Number of times to walk up/down the tree hierarchy to find the trigger.\n * @codeGenApi\n */\nfunction ɵɵdeferOnViewport(triggerIndex, walkUpTimes) {\n const lView = getLView();\n const tNode = getCurrentTNode();\n if (ngDevMode) {\n trackTriggerForDebugging(lView[TVIEW], tNode, `on viewport${walkUpTimes === -1 ? '' : '(<target>)'}`);\n }\n if (!shouldAttachTrigger(0 /* TriggerType.Regular */, lView, tNode)) return;\n renderPlaceholder(lView, tNode);\n // Avoid adding event listeners when this instruction is invoked on the server.\n if (!(typeof ngServerMode !== 'undefined' && ngServerMode)) {\n registerDomTrigger(lView, tNode, triggerIndex, walkUpTimes, onViewportWrapper, () => triggerDeferBlock(0 /* TriggerType.Regular */, lView, tNode), 0 /* TriggerType.Regular */);\n }\n}\n/**\n * Creates runtime data structures for the `prefetch on viewport` deferred trigger.\n * @param triggerIndex Index at which to find the trigger element.\n * @param walkUpTimes Number of times to walk up/down the tree hierarchy to find the trigger.\n * @codeGenApi\n */\nfunction ɵɵdeferPrefetchOnViewport(triggerIndex, walkUpTimes) {\n const lView = getLView();\n const tNode = getCurrentTNode();\n if (ngDevMode) {\n trackTriggerForDebugging(lView[TVIEW], tNode, `prefetch on viewport${walkUpTimes === -1 ? '' : '(<target>)'}`);\n }\n if (!shouldAttachTrigger(1 /* TriggerType.Prefetch */, lView, tNode)) return;\n const tView = lView[TVIEW];\n const tDetails = getTDeferBlockDetails(tView, tNode);\n if (tDetails.loadingState === DeferDependenciesLoadingState.NOT_STARTED) {\n registerDomTrigger(lView, tNode, triggerIndex, walkUpTimes, onViewportWrapper, () => triggerPrefetching(tDetails, lView, tNode), 1 /* TriggerType.Prefetch */);\n }\n}\n/**\n * Creates runtime data structures for the `on viewport` hydrate trigger.\n * @codeGenApi\n */\nfunction ɵɵdeferHydrateOnViewport() {\n const lView = getLView();\n const tNode = getCurrentTNode();\n if (ngDevMode) {\n trackTriggerForDebugging(lView[TVIEW], tNode, 'hydrate on viewport');\n }\n if (!shouldAttachTrigger(2 /* TriggerType.Hydrate */, lView, tNode)) return;\n const hydrateTriggers = getHydrateTriggers(getTView(), tNode);\n hydrateTriggers.set(2 /* DeferBlockTrigger.Viewport */, null);\n if (typeof ngServerMode !== 'undefined' && ngServerMode) {\n // We are on the server and SSR for defer blocks is enabled.\n triggerDeferBlock(2 /* TriggerType.Hydrate */, lView, tNode);\n }\n // The actual triggering of hydration on viewport happens in triggering.ts,\n // since these instructions won't exist for dehydrated content.\n}\n\n/**\n * Updates the value of or removes a bound attribute on an Element.\n *\n * Used in the case of `[attr.title]=\"value\"`\n *\n * @param name name The name of the attribute.\n * @param value value The attribute is removed when value is `null` or `undefined`.\n * Otherwise the attribute value is set to the stringified value.\n * @param sanitizer An optional function used to sanitize the value.\n * @param namespace Optional namespace to use when setting the attribute.\n *\n * @codeGenApi\n */\nfunction ɵɵattribute(name, value, sanitizer, namespace) {\n const lView = getLView();\n const bindingIndex = nextBindingIndex();\n if (bindingUpdated(lView, bindingIndex, value)) {\n const tView = getTView();\n const tNode = getSelectedTNode();\n elementAttributeInternal(tNode, lView, name, value, sanitizer, namespace);\n ngDevMode && storePropertyBindingMetadata(tView.data, tNode, 'attr.' + name, bindingIndex);\n }\n return ɵɵattribute;\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/**\n * Instruction that returns the component instance in which the current instruction is executing.\n * This is a constant-time version of `nextContent` for the case where we know that we need the\n * component instance specifically, rather than the context of a particular template.\n *\n * @codeGenApi\n */\nfunction ɵɵcomponentInstance() {\n const instance = getLView()[DECLARATION_COMPONENT_VIEW][CONTEXT];\n ngDevMode && assertDefined(instance, 'Expected component instance to be defined');\n return instance;\n}\n\n/**\n * A type representing the live collection to be reconciled with any new (incoming) collection. This\n * is an adapter class that makes it possible to work with different internal data structures,\n * regardless of the actual values of the incoming collection.\n */\nclass LiveCollection {\n destroy(item) {\n // noop by default\n }\n updateValue(index, value) {\n // noop by default\n }\n // operations below could be implemented on top of the operations defined so far, but having\n // them explicitly allow clear expression of intent and potentially more performant\n // implementations\n swap(index1, index2) {\n const startIdx = Math.min(index1, index2);\n const endIdx = Math.max(index1, index2);\n const endItem = this.detach(endIdx);\n if (endIdx - startIdx > 1) {\n const startItem = this.detach(startIdx);\n this.attach(startIdx, endItem);\n this.attach(endIdx, startItem);\n } else {\n this.attach(startIdx, endItem);\n }\n }\n move(prevIndex, newIdx) {\n this.attach(newIdx, this.detach(prevIndex));\n }\n}\nfunction valuesMatching(liveIdx, liveValue, newIdx, newValue, trackBy) {\n if (liveIdx === newIdx && Object.is(liveValue, newValue)) {\n // matching and no value identity to update\n return 1;\n } else if (Object.is(trackBy(liveIdx, liveValue), trackBy(newIdx, newValue))) {\n // matching but requires value identity update\n return -1;\n }\n return 0;\n}\nfunction recordDuplicateKeys(keyToIdx, key, idx) {\n const idxSoFar = keyToIdx.get(key);\n if (idxSoFar !== undefined) {\n idxSoFar.add(idx);\n } else {\n keyToIdx.set(key, new Set([idx]));\n }\n}\n/**\n * The live collection reconciliation algorithm that perform various in-place operations, so it\n * reflects the content of the new (incoming) collection.\n *\n * The reconciliation algorithm has 2 code paths:\n * - \"fast\" path that don't require any memory allocation;\n * - \"slow\" path that requires additional memory allocation for intermediate data structures used to\n * collect additional information about the live collection.\n * It might happen that the algorithm switches between the two modes in question in a single\n * reconciliation path - generally it tries to stay on the \"fast\" path as much as possible.\n *\n * The overall complexity of the algorithm is O(n + m) for speed and O(n) for memory (where n is the\n * length of the live collection and m is the length of the incoming collection). Given the problem\n * at hand the complexity / performance constraints makes it impossible to perform the absolute\n * minimum of operation to reconcile the 2 collections. The algorithm makes different tradeoffs to\n * stay within reasonable performance bounds and may apply sub-optimal number of operations in\n * certain situations.\n *\n * @param liveCollection the current, live collection;\n * @param newCollection the new, incoming collection;\n * @param trackByFn key generation function that determines equality between items in the life and\n * incoming collection;\n */\nfunction reconcile(liveCollection, newCollection, trackByFn) {\n let detachedItems = undefined;\n let liveKeysInTheFuture = undefined;\n let liveStartIdx = 0;\n let liveEndIdx = liveCollection.length - 1;\n const duplicateKeys = ngDevMode ? new Map() : undefined;\n if (Array.isArray(newCollection)) {\n let newEndIdx = newCollection.length - 1;\n while (liveStartIdx <= liveEndIdx && liveStartIdx <= newEndIdx) {\n // compare from the beginning\n const liveStartValue = liveCollection.at(liveStartIdx);\n const newStartValue = newCollection[liveStartIdx];\n if (ngDevMode) {\n recordDuplicateKeys(duplicateKeys, trackByFn(liveStartIdx, newStartValue), liveStartIdx);\n }\n const isStartMatching = valuesMatching(liveStartIdx, liveStartValue, liveStartIdx, newStartValue, trackByFn);\n if (isStartMatching !== 0) {\n if (isStartMatching < 0) {\n liveCollection.updateValue(liveStartIdx, newStartValue);\n }\n liveStartIdx++;\n continue;\n }\n // compare from the end\n // TODO(perf): do _all_ the matching from the end\n const liveEndValue = liveCollection.at(liveEndIdx);\n const newEndValue = newCollection[newEndIdx];\n if (ngDevMode) {\n recordDuplicateKeys(duplicateKeys, trackByFn(newEndIdx, newEndValue), newEndIdx);\n }\n const isEndMatching = valuesMatching(liveEndIdx, liveEndValue, newEndIdx, newEndValue, trackByFn);\n if (isEndMatching !== 0) {\n if (isEndMatching < 0) {\n liveCollection.updateValue(liveEndIdx, newEndValue);\n }\n liveEndIdx--;\n newEndIdx--;\n continue;\n }\n // Detect swap and moves:\n const liveStartKey = trackByFn(liveStartIdx, liveStartValue);\n const liveEndKey = trackByFn(liveEndIdx, liveEndValue);\n const newStartKey = trackByFn(liveStartIdx, newStartValue);\n if (Object.is(newStartKey, liveEndKey)) {\n const newEndKey = trackByFn(newEndIdx, newEndValue);\n // detect swap on both ends;\n if (Object.is(newEndKey, liveStartKey)) {\n liveCollection.swap(liveStartIdx, liveEndIdx);\n liveCollection.updateValue(liveEndIdx, newEndValue);\n newEndIdx--;\n liveEndIdx--;\n } else {\n // the new item is the same as the live item with the end pointer - this is a move forward\n // to an earlier index;\n liveCollection.move(liveEndIdx, liveStartIdx);\n }\n liveCollection.updateValue(liveStartIdx, newStartValue);\n liveStartIdx++;\n continue;\n }\n // Fallback to the slow path: we need to learn more about the content of the live and new\n // collections.\n detachedItems ??= new UniqueValueMultiKeyMap();\n liveKeysInTheFuture ??= initLiveItemsInTheFuture(liveCollection, liveStartIdx, liveEndIdx, trackByFn);\n // Check if I'm inserting a previously detached item: if so, attach it here\n if (attachPreviouslyDetached(liveCollection, detachedItems, liveStartIdx, newStartKey)) {\n liveCollection.updateValue(liveStartIdx, newStartValue);\n liveStartIdx++;\n liveEndIdx++;\n } else if (!liveKeysInTheFuture.has(newStartKey)) {\n // Check if we seen a new item that doesn't exist in the old collection and must be INSERTED\n const newItem = liveCollection.create(liveStartIdx, newCollection[liveStartIdx]);\n liveCollection.attach(liveStartIdx, newItem);\n liveStartIdx++;\n liveEndIdx++;\n } else {\n // We know that the new item exists later on in old collection but we don't know its index\n // and as the consequence can't move it (don't know where to find it). Detach the old item,\n // hoping that it unlocks the fast path again.\n detachedItems.set(liveStartKey, liveCollection.detach(liveStartIdx));\n liveEndIdx--;\n }\n }\n // Final cleanup steps:\n // - more items in the new collection => insert\n while (liveStartIdx <= newEndIdx) {\n createOrAttach(liveCollection, detachedItems, trackByFn, liveStartIdx, newCollection[liveStartIdx]);\n liveStartIdx++;\n }\n } else if (newCollection != null) {\n // iterable - immediately fallback to the slow path\n const newCollectionIterator = newCollection[Symbol.iterator]();\n let newIterationResult = newCollectionIterator.next();\n while (!newIterationResult.done && liveStartIdx <= liveEndIdx) {\n const liveValue = liveCollection.at(liveStartIdx);\n const newValue = newIterationResult.value;\n if (ngDevMode) {\n recordDuplicateKeys(duplicateKeys, trackByFn(liveStartIdx, newValue), liveStartIdx);\n }\n const isStartMatching = valuesMatching(liveStartIdx, liveValue, liveStartIdx, newValue, trackByFn);\n if (isStartMatching !== 0) {\n // found a match - move on, but update value\n if (isStartMatching < 0) {\n liveCollection.updateValue(liveStartIdx, newValue);\n }\n liveStartIdx++;\n newIterationResult = newCollectionIterator.next();\n } else {\n detachedItems ??= new UniqueValueMultiKeyMap();\n liveKeysInTheFuture ??= initLiveItemsInTheFuture(liveCollection, liveStartIdx, liveEndIdx, trackByFn);\n // Check if I'm inserting a previously detached item: if so, attach it here\n const newKey = trackByFn(liveStartIdx, newValue);\n if (attachPreviouslyDetached(liveCollection, detachedItems, liveStartIdx, newKey)) {\n liveCollection.updateValue(liveStartIdx, newValue);\n liveStartIdx++;\n liveEndIdx++;\n newIterationResult = newCollectionIterator.next();\n } else if (!liveKeysInTheFuture.has(newKey)) {\n liveCollection.attach(liveStartIdx, liveCollection.create(liveStartIdx, newValue));\n liveStartIdx++;\n liveEndIdx++;\n newIterationResult = newCollectionIterator.next();\n } else {\n // it is a move forward - detach the current item without advancing in collections\n const liveKey = trackByFn(liveStartIdx, liveValue);\n detachedItems.set(liveKey, liveCollection.detach(liveStartIdx));\n liveEndIdx--;\n }\n }\n }\n // this is a new item as we run out of the items in the old collection - create or attach a\n // previously detached one\n while (!newIterationResult.done) {\n createOrAttach(liveCollection, detachedItems, trackByFn, liveCollection.length, newIterationResult.value);\n newIterationResult = newCollectionIterator.next();\n }\n }\n // Cleanups common to the array and iterable:\n // - more items in the live collection => delete starting from the end;\n while (liveStartIdx <= liveEndIdx) {\n liveCollection.destroy(liveCollection.detach(liveEndIdx--));\n }\n // - destroy items that were detached but never attached again.\n detachedItems?.forEach(item => {\n liveCollection.destroy(item);\n });\n // report duplicate keys (dev mode only)\n if (ngDevMode) {\n let duplicatedKeysMsg = [];\n for (const [key, idxSet] of duplicateKeys) {\n if (idxSet.size > 1) {\n const idx = [...idxSet].sort((a, b) => a - b);\n for (let i = 1; i < idx.length; i++) {\n duplicatedKeysMsg.push(`key \"${stringifyForError(key)}\" at index \"${idx[i - 1]}\" and \"${idx[i]}\"`);\n }\n }\n }\n if (duplicatedKeysMsg.length > 0) {\n const message = formatRuntimeError(-955 /* RuntimeErrorCode.LOOP_TRACK_DUPLICATE_KEYS */, 'The provided track expression resulted in duplicated keys for a given collection. ' + 'Adjust the tracking expression such that it uniquely identifies all the items in the collection. ' + 'Duplicated keys were: \\n' + duplicatedKeysMsg.join(', \\n') + '.');\n console.warn(message);\n }\n }\n}\nfunction attachPreviouslyDetached(prevCollection, detachedItems, index, key) {\n if (detachedItems !== undefined && detachedItems.has(key)) {\n prevCollection.attach(index, detachedItems.get(key));\n detachedItems.delete(key);\n return true;\n }\n return false;\n}\nfunction createOrAttach(liveCollection, detachedItems, trackByFn, index, value) {\n if (!attachPreviouslyDetached(liveCollection, detachedItems, index, trackByFn(index, value))) {\n const newItem = liveCollection.create(index, value);\n liveCollection.attach(index, newItem);\n } else {\n liveCollection.updateValue(index, value);\n }\n}\nfunction initLiveItemsInTheFuture(liveCollection, start, end, trackByFn) {\n const keys = new Set();\n for (let i = start; i <= end; i++) {\n keys.add(trackByFn(i, liveCollection.at(i)));\n }\n return keys;\n}\n/**\n * A specific, partial implementation of the Map interface with the following characteristics:\n * - allows multiple values for a given key;\n * - maintain FIFO order for multiple values corresponding to a given key;\n * - assumes that all values are unique.\n *\n * The implementation aims at having the minimal overhead for cases where keys are _not_ duplicated\n * (the most common case in the list reconciliation algorithm). To achieve this, the first value for\n * a given key is stored in a regular map. Then, when more values are set for a given key, we\n * maintain a form of linked list in a separate map. To maintain this linked list we assume that all\n * values (in the entire collection) are unique.\n */\nclass UniqueValueMultiKeyMap {\n // A map from a key to the first value corresponding to this key.\n kvMap = new Map();\n // A map that acts as a linked list of values - each value maps to the next value in this \"linked\n // list\" (this only works if values are unique). Allocated lazily to avoid memory consumption when\n // there are no duplicated values.\n _vMap = undefined;\n has(key) {\n return this.kvMap.has(key);\n }\n delete(key) {\n if (!this.has(key)) return false;\n const value = this.kvMap.get(key);\n if (this._vMap !== undefined && this._vMap.has(value)) {\n this.kvMap.set(key, this._vMap.get(value));\n this._vMap.delete(value);\n } else {\n this.kvMap.delete(key);\n }\n return true;\n }\n get(key) {\n return this.kvMap.get(key);\n }\n set(key, value) {\n if (this.kvMap.has(key)) {\n let prevValue = this.kvMap.get(key);\n // Note: we don't use `assertNotSame`, because the value needs to be stringified even if\n // there is no error which can freeze the browser for large values (see #58509).\n if (ngDevMode && prevValue === value) {\n throw new Error(`Detected a duplicated value ${value} for the key ${key}`);\n }\n if (this._vMap === undefined) {\n this._vMap = new Map();\n }\n const vMap = this._vMap;\n while (vMap.has(prevValue)) {\n prevValue = vMap.get(prevValue);\n }\n vMap.set(prevValue, value);\n } else {\n this.kvMap.set(key, value);\n }\n }\n forEach(cb) {\n for (let [key, value] of this.kvMap) {\n cb(value, key);\n if (this._vMap !== undefined) {\n const vMap = this._vMap;\n while (vMap.has(value)) {\n value = vMap.get(value);\n cb(value, key);\n }\n }\n }\n }\n}\n\n/**\n * Creates an LContainer for an ng-template representing a root node\n * of control flow (@if, @switch). We use this to explicitly set\n * flags on the TNode created to identify which nodes are in control\n * flow or starting control flow for hydration identification and\n * cleanup timing.\n *\n * @param index The index of the container in the data array\n * @param templateFn Inline template\n * @param decls The number of nodes, local refs, and pipes for this template\n * @param vars The number of bindings for this template\n * @param tagName The name of the container element, if applicable\n * @param attrsIndex Index of template attributes in the `consts` array.\n * @param localRefs Index of the local references in the `consts` array.\n * @param localRefExtractor A function which extracts local-refs values from the template.\n * Defaults to the current element associated with the local-ref.\n * @codeGenApi\n */\nfunction ɵɵconditionalCreate(index, templateFn, decls, vars, tagName, attrsIndex, localRefsIndex, localRefExtractor) {\n performanceMarkFeature('NgControlFlow');\n const lView = getLView();\n const tView = getTView();\n const attrs = getConstant(tView.consts, attrsIndex);\n declareNoDirectiveHostTemplate(lView, tView, index, templateFn, decls, vars, tagName, attrs, 256 /* TNodeFlags.isControlFlowStart */, localRefsIndex, localRefExtractor);\n return ɵɵconditionalBranchCreate;\n}\n/**\n * Creates an LContainer for an ng-template representing a branch\n * of control flow (@else, @case, @default). We use this to explicitly\n * set flags on the TNode created to identify which nodes are in\n * control flow or starting control flow for hydration identification\n * and cleanup timing.\n *\n * @param index The index of the container in the data array\n * @param templateFn Inline template\n * @param decls The number of nodes, local refs, and pipes for this template\n * @param vars The number of bindings for this template\n * @param tagName The name of the container element, if applicable\n * @param attrsIndex Index of template attributes in the `consts` array.\n * @param localRefs Index of the local references in the `consts` array.\n * @param localRefExtractor A function which extracts local-refs values from the template.\n * Defaults to the current element associated with the local-ref.\n * @codeGenApi\n */\nfunction ɵɵconditionalBranchCreate(index, templateFn, decls, vars, tagName, attrsIndex, localRefsIndex, localRefExtractor) {\n performanceMarkFeature('NgControlFlow');\n const lView = getLView();\n const tView = getTView();\n const attrs = getConstant(tView.consts, attrsIndex);\n declareNoDirectiveHostTemplate(lView, tView, index, templateFn, decls, vars, tagName, attrs, 512 /* TNodeFlags.isInControlFlow */, localRefsIndex, localRefExtractor);\n return ɵɵconditionalBranchCreate;\n}\n/**\n * The conditional instruction represents the basic building block on the runtime side to support\n * built-in \"if\" and \"switch\". On the high level this instruction is responsible for adding and\n * removing views selected by a conditional expression.\n *\n * @param matchingTemplateIndex Index of a template TNode representing a conditional view to be\n * inserted; -1 represents a special case when there is no view to insert.\n * @param contextValue Value that should be exposed as the context of the conditional.\n * @codeGenApi\n */\nfunction ɵɵconditional(matchingTemplateIndex, contextValue) {\n performanceMarkFeature('NgControlFlow');\n const hostLView = getLView();\n const bindingIndex = nextBindingIndex();\n const prevMatchingTemplateIndex = hostLView[bindingIndex] !== NO_CHANGE ? hostLView[bindingIndex] : -1;\n const prevContainer = prevMatchingTemplateIndex !== -1 ? getLContainer(hostLView, HEADER_OFFSET + prevMatchingTemplateIndex) : undefined;\n const viewInContainerIdx = 0;\n if (bindingUpdated(hostLView, bindingIndex, matchingTemplateIndex)) {\n const prevConsumer = setActiveConsumer(null);\n try {\n // The index of the view to show changed - remove the previously displayed one\n // (it is a noop if there are no active views in a container).\n if (prevContainer !== undefined) {\n removeLViewFromLContainer(prevContainer, viewInContainerIdx);\n }\n // Index -1 is a special case where none of the conditions evaluates to\n // a truthy value and as the consequence we've got no view to show.\n if (matchingTemplateIndex !== -1) {\n const nextLContainerIndex = HEADER_OFFSET + matchingTemplateIndex;\n const nextContainer = getLContainer(hostLView, nextLContainerIndex);\n const templateTNode = getExistingTNode(hostLView[TVIEW], nextLContainerIndex);\n const dehydratedView = findAndReconcileMatchingDehydratedViews(nextContainer, templateTNode, hostLView);\n const embeddedLView = createAndRenderEmbeddedLView(hostLView, templateTNode, contextValue, {\n dehydratedView\n });\n addLViewToLContainer(nextContainer, embeddedLView, viewInContainerIdx, shouldAddViewToDom(templateTNode, dehydratedView));\n }\n } finally {\n setActiveConsumer(prevConsumer);\n }\n } else if (prevContainer !== undefined) {\n // We might keep displaying the same template but the actual value of the expression could have\n // changed - re-bind in context.\n const lView = getLViewFromLContainer(prevContainer, viewInContainerIdx);\n if (lView !== undefined) {\n lView[CONTEXT] = contextValue;\n }\n }\n}\nclass RepeaterContext {\n lContainer;\n $implicit;\n $index;\n constructor(lContainer, $implicit, $index) {\n this.lContainer = lContainer;\n this.$implicit = $implicit;\n this.$index = $index;\n }\n get $count() {\n return this.lContainer.length - CONTAINER_HEADER_OFFSET;\n }\n}\n/**\n * A built-in trackBy function used for situations where users specified collection index as a\n * tracking expression. Having this function body in the runtime avoids unnecessary code generation.\n *\n * @param index\n * @returns\n */\nfunction ɵɵrepeaterTrackByIndex(index) {\n return index;\n}\n/**\n * A built-in trackBy function used for situations where users specified collection item reference\n * as a tracking expression. Having this function body in the runtime avoids unnecessary code\n * generation.\n *\n * @param index\n * @returns\n */\nfunction ɵɵrepeaterTrackByIdentity(_, value) {\n return value;\n}\nclass RepeaterMetadata {\n hasEmptyBlock;\n trackByFn;\n liveCollection;\n constructor(hasEmptyBlock, trackByFn, liveCollection) {\n this.hasEmptyBlock = hasEmptyBlock;\n this.trackByFn = trackByFn;\n this.liveCollection = liveCollection;\n }\n}\n/**\n * The repeaterCreate instruction runs in the creation part of the template pass and initializes\n * internal data structures required by the update pass of the built-in repeater logic. Repeater\n * metadata are allocated in the data part of LView with the following layout:\n * - LView[HEADER_OFFSET + index] - metadata\n * - LView[HEADER_OFFSET + index + 1] - reference to a template function rendering an item\n * - LView[HEADER_OFFSET + index + 2] - optional reference to a template function rendering an empty\n * block\n *\n * @param index Index at which to store the metadata of the repeater.\n * @param templateFn Reference to the template of the main repeater block.\n * @param decls The number of nodes, local refs, and pipes for the main block.\n * @param vars The number of bindings for the main block.\n * @param tagName The name of the container element, if applicable\n * @param attrsIndex Index of template attributes in the `consts` array.\n * @param trackByFn Reference to the tracking function.\n * @param trackByUsesComponentInstance Whether the tracking function has any references to the\n * component instance. If it doesn't, we can avoid rebinding it.\n * @param emptyTemplateFn Reference to the template function of the empty block.\n * @param emptyDecls The number of nodes, local refs, and pipes for the empty block.\n * @param emptyVars The number of bindings for the empty block.\n * @param emptyTagName The name of the empty block container element, if applicable\n * @param emptyAttrsIndex Index of the empty block template attributes in the `consts` array.\n *\n * @codeGenApi\n */\nfunction ɵɵrepeaterCreate(index, templateFn, decls, vars, tagName, attrsIndex, trackByFn, trackByUsesComponentInstance, emptyTemplateFn, emptyDecls, emptyVars, emptyTagName, emptyAttrsIndex) {\n performanceMarkFeature('NgControlFlow');\n ngDevMode && assertFunction(trackByFn, `A track expression must be a function, was ${typeof trackByFn} instead.`);\n const lView = getLView();\n const tView = getTView();\n const hasEmptyBlock = emptyTemplateFn !== undefined;\n const hostLView = getLView();\n const boundTrackBy = trackByUsesComponentInstance ?\n // We only want to bind when necessary, because it produces a\n // new function. For pure functions it's not necessary.\n trackByFn.bind(hostLView[DECLARATION_COMPONENT_VIEW][CONTEXT]) : trackByFn;\n const metadata = new RepeaterMetadata(hasEmptyBlock, boundTrackBy);\n hostLView[HEADER_OFFSET + index] = metadata;\n declareNoDirectiveHostTemplate(lView, tView, index + 1, templateFn, decls, vars, tagName, getConstant(tView.consts, attrsIndex), 256 /* TNodeFlags.isControlFlowStart */);\n if (hasEmptyBlock) {\n ngDevMode && assertDefined(emptyDecls, 'Missing number of declarations for the empty repeater block.');\n ngDevMode && assertDefined(emptyVars, 'Missing number of bindings for the empty repeater block.');\n declareNoDirectiveHostTemplate(lView, tView, index + 2, emptyTemplateFn, emptyDecls, emptyVars, emptyTagName, getConstant(tView.consts, emptyAttrsIndex), 512 /* TNodeFlags.isInControlFlow */);\n }\n}\nfunction isViewExpensiveToRecreate(lView) {\n // assumption: anything more than a text node with a binding is considered \"expensive\"\n return lView.length - HEADER_OFFSET > 2;\n}\nclass OperationsCounter {\n created = 0;\n destroyed = 0;\n reset() {\n this.created = 0;\n this.destroyed = 0;\n }\n recordCreate() {\n this.created++;\n }\n recordDestroy() {\n this.destroyed++;\n }\n /**\n * A method indicating if the entire collection was re-created as part of the reconciliation pass.\n * Used to warn developers about the usage of a tracking function that might result in excessive\n * amount of view creation / destroy operations.\n *\n * @returns boolean value indicating if a live collection was re-created\n */\n wasReCreated(collectionLen) {\n return collectionLen > 0 && this.created === this.destroyed && this.created === collectionLen;\n }\n}\nclass LiveCollectionLContainerImpl extends LiveCollection {\n lContainer;\n hostLView;\n templateTNode;\n operationsCounter = ngDevMode ? new OperationsCounter() : undefined;\n /**\n Property indicating if indexes in the repeater context need to be updated following the live\n collection changes. Index updates are necessary if and only if views are inserted / removed in\n the middle of LContainer. Adds and removals at the end don't require index updates.\n */\n needsIndexUpdate = false;\n constructor(lContainer, hostLView, templateTNode) {\n super();\n this.lContainer = lContainer;\n this.hostLView = hostLView;\n this.templateTNode = templateTNode;\n }\n get length() {\n return this.lContainer.length - CONTAINER_HEADER_OFFSET;\n }\n at(index) {\n return this.getLView(index)[CONTEXT].$implicit;\n }\n attach(index, lView) {\n const dehydratedView = lView[HYDRATION];\n this.needsIndexUpdate ||= index !== this.length;\n addLViewToLContainer(this.lContainer, lView, index, shouldAddViewToDom(this.templateTNode, dehydratedView));\n }\n detach(index) {\n this.needsIndexUpdate ||= index !== this.length - 1;\n return detachExistingView(this.lContainer, index);\n }\n create(index, value) {\n const dehydratedView = findMatchingDehydratedView(this.lContainer, this.templateTNode.tView.ssrId);\n const embeddedLView = createAndRenderEmbeddedLView(this.hostLView, this.templateTNode, new RepeaterContext(this.lContainer, value, index), {\n dehydratedView\n });\n this.operationsCounter?.recordCreate();\n return embeddedLView;\n }\n destroy(lView) {\n destroyLView(lView[TVIEW], lView);\n this.operationsCounter?.recordDestroy();\n }\n updateValue(index, value) {\n this.getLView(index)[CONTEXT].$implicit = value;\n }\n reset() {\n this.needsIndexUpdate = false;\n this.operationsCounter?.reset();\n }\n updateIndexes() {\n if (this.needsIndexUpdate) {\n for (let i = 0; i < this.length; i++) {\n this.getLView(i)[CONTEXT].$index = i;\n }\n }\n }\n getLView(index) {\n return getExistingLViewFromLContainer(this.lContainer, index);\n }\n}\n/**\n * The repeater instruction does update-time diffing of a provided collection (against the\n * collection seen previously) and maps changes in the collection to views structure (by adding,\n * removing or moving views as needed).\n * @param collection - the collection instance to be checked for changes\n * @codeGenApi\n */\nfunction ɵɵrepeater(collection) {\n const prevConsumer = setActiveConsumer(null);\n const metadataSlotIdx = getSelectedIndex();\n try {\n const hostLView = getLView();\n const hostTView = hostLView[TVIEW];\n const metadata = hostLView[metadataSlotIdx];\n const containerIndex = metadataSlotIdx + 1;\n const lContainer = getLContainer(hostLView, containerIndex);\n if (metadata.liveCollection === undefined) {\n const itemTemplateTNode = getExistingTNode(hostTView, containerIndex);\n metadata.liveCollection = new LiveCollectionLContainerImpl(lContainer, hostLView, itemTemplateTNode);\n } else {\n metadata.liveCollection.reset();\n }\n const liveCollection = metadata.liveCollection;\n reconcile(liveCollection, collection, metadata.trackByFn);\n // Warn developers about situations where the entire collection was re-created as part of the\n // reconciliation pass. Note that this warning might be \"overreacting\" and report cases where\n // the collection re-creation is the intended behavior. Still, the assumption is that most of\n // the time it is undesired.\n if (ngDevMode && metadata.trackByFn === ɵɵrepeaterTrackByIdentity && liveCollection.operationsCounter?.wasReCreated(liveCollection.length) && isViewExpensiveToRecreate(getExistingLViewFromLContainer(lContainer, 0))) {\n const message = formatRuntimeError(-956 /* RuntimeErrorCode.LOOP_TRACK_RECREATE */, `The configured tracking expression (track by identity) caused re-creation of the entire collection of size ${liveCollection.length}. ` + 'This is an expensive operation requiring destruction and subsequent creation of DOM nodes, directives, components etc. ' + 'Please review the \"track expression\" and make sure that it uniquely identifies items in a collection.');\n console.warn(message);\n }\n // moves in the container might caused context's index to get out of order, re-adjust if needed\n liveCollection.updateIndexes();\n // handle empty blocks\n if (metadata.hasEmptyBlock) {\n const bindingIndex = nextBindingIndex();\n const isCollectionEmpty = liveCollection.length === 0;\n if (bindingUpdated(hostLView, bindingIndex, isCollectionEmpty)) {\n const emptyTemplateIndex = metadataSlotIdx + 2;\n const lContainerForEmpty = getLContainer(hostLView, emptyTemplateIndex);\n if (isCollectionEmpty) {\n const emptyTemplateTNode = getExistingTNode(hostTView, emptyTemplateIndex);\n const dehydratedView = findAndReconcileMatchingDehydratedViews(lContainerForEmpty, emptyTemplateTNode, hostLView);\n const embeddedLView = createAndRenderEmbeddedLView(hostLView, emptyTemplateTNode, undefined, {\n dehydratedView\n });\n addLViewToLContainer(lContainerForEmpty, embeddedLView, 0, shouldAddViewToDom(emptyTemplateTNode, dehydratedView));\n } else {\n // we know that an ssrId was generated for the empty template, but\n // we were unable to match it to a dehydrated view earlier, which\n // means that we may have changed branches between server and client.\n // We'll need to find and remove the stale empty template view.\n if (hostTView.firstUpdatePass) {\n removeDehydratedViews(lContainerForEmpty);\n }\n removeLViewFromLContainer(lContainerForEmpty, 0);\n }\n }\n }\n } finally {\n setActiveConsumer(prevConsumer);\n }\n}\nfunction getLContainer(lView, index) {\n const lContainer = lView[index];\n ngDevMode && assertLContainer(lContainer);\n return lContainer;\n}\nfunction detachExistingView(lContainer, index) {\n const existingLView = detachView(lContainer, index);\n ngDevMode && assertLView(existingLView);\n return existingLView;\n}\nfunction getExistingLViewFromLContainer(lContainer, index) {\n const existingLView = getLViewFromLContainer(lContainer, index);\n ngDevMode && assertLView(existingLView);\n return existingLView;\n}\nfunction getExistingTNode(tView, index) {\n const tNode = getTNode(tView, index);\n ngDevMode && assertTNode(tNode);\n return tNode;\n}\n\n/**\n * Update a property on a selected element.\n *\n * Operates on the element selected by index via the {@link select} instruction.\n *\n * If the property name also exists as an input property on one of the element's directives,\n * the component property will be set instead of the element property. This check must\n * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled\n *\n * @param propName Name of property. Because it is going to DOM, this is not subject to\n * renaming as part of minification.\n * @param value New value to write.\n * @param sanitizer An optional function used to sanitize the value.\n * @returns This function returns itself so that it may be chained\n * (e.g. `property('name', ctx.name)('title', ctx.title)`)\n *\n * @codeGenApi\n */\nfunction ɵɵproperty(propName, value, sanitizer) {\n const lView = getLView();\n const bindingIndex = nextBindingIndex();\n if (bindingUpdated(lView, bindingIndex, value)) {\n const tView = getTView();\n const tNode = getSelectedTNode();\n setPropertyAndInputs(tNode, lView, propName, value, lView[RENDERER], sanitizer);\n ngDevMode && storePropertyBindingMetadata(tView.data, tNode, propName, bindingIndex);\n }\n return ɵɵproperty;\n}\n/**\n * Given `<div style=\"...\" my-dir>` and `MyDir` with `@Input('style')` we need to write to\n * directive input.\n */\nfunction setDirectiveInputsWhichShadowsStyling(tView, tNode, lView, value, isClassBased) {\n // We support both 'class' and `className` hence the fallback.\n setAllInputsForProperty(tNode, tView, lView, isClassBased ? 'class' : 'style', value);\n}\n\n/**\n * Create DOM element. The instruction must later be followed by `elementEnd()` call.\n *\n * @param index Index of the element in the LView array\n * @param name Name of the DOM Node\n * @param attrsIndex Index of the element's attributes in the `consts` array.\n * @param localRefsIndex Index of the element's local references in the `consts` array.\n * @returns This function returns itself so that it may be chained.\n *\n * Attributes and localRefs are passed as an array of strings where elements with an even index\n * hold an attribute name and elements with an odd index hold an attribute value, ex.:\n * ['id', 'warning5', 'class', 'alert']\n *\n * @codeGenApi\n */\nfunction ɵɵelementStart(index, name, attrsIndex, localRefsIndex) {\n const lView = getLView();\n ngDevMode && assertTNodeCreationIndex(lView, index);\n const tView = lView[TVIEW];\n const adjustedIndex = index + HEADER_OFFSET;\n const tNode = tView.firstCreatePass ? directiveHostFirstCreatePass(adjustedIndex, lView, 2 /* TNodeType.Element */, name, findDirectiveDefMatches, getBindingsEnabled(), attrsIndex, localRefsIndex) : tView.data[adjustedIndex];\n elementLikeStartShared(tNode, lView, index, name, _locateOrCreateElementNode);\n if (isDirectiveHost(tNode)) {\n const tView = lView[TVIEW];\n createDirectivesInstances(tView, lView, tNode);\n executeContentQueries(tView, tNode, lView);\n }\n if (localRefsIndex != null) {\n saveResolvedLocalsInData(lView, tNode);\n }\n if (ngDevMode && lView[TVIEW].firstCreatePass) {\n validateElementIsKnown(lView, tNode);\n }\n return ɵɵelementStart;\n}\n/**\n * Mark the end of the element.\n * @returns This function returns itself so that it may be chained.\n *\n * @codeGenApi\n */\nfunction ɵɵelementEnd() {\n const tView = getTView();\n const initialTNode = getCurrentTNode();\n ngDevMode && assertDefined(initialTNode, 'No parent node to close.');\n const currentTNode = elementLikeEndShared(initialTNode);\n ngDevMode && assertTNodeType(currentTNode, 3 /* TNodeType.AnyRNode */);\n if (tView.firstCreatePass) {\n directiveHostEndFirstCreatePass(tView, currentTNode);\n }\n if (isSkipHydrationRootTNode(currentTNode)) {\n leaveSkipHydrationBlock();\n }\n decreaseElementDepthCount();\n if (currentTNode.classesWithoutHost != null && hasClassInput(currentTNode)) {\n setDirectiveInputsWhichShadowsStyling(tView, currentTNode, getLView(), currentTNode.classesWithoutHost, true);\n }\n if (currentTNode.stylesWithoutHost != null && hasStyleInput(currentTNode)) {\n setDirectiveInputsWhichShadowsStyling(tView, currentTNode, getLView(), currentTNode.stylesWithoutHost, false);\n }\n return ɵɵelementEnd;\n}\n/**\n * Creates an empty element using {@link elementStart} and {@link elementEnd}\n *\n * @param index Index of the element in the data array\n * @param name Name of the DOM Node\n * @param attrsIndex Index of the element's attributes in the `consts` array.\n * @param localRefsIndex Index of the element's local references in the `consts` array.\n * @returns This function returns itself so that it may be chained.\n *\n * @codeGenApi\n */\nfunction ɵɵelement(index, name, attrsIndex, localRefsIndex) {\n ɵɵelementStart(index, name, attrsIndex, localRefsIndex);\n ɵɵelementEnd();\n return ɵɵelement;\n}\n/**\n * Create DOM element that cannot have any directives.\n *\n * @param index Index of the element in the LView array\n * @param name Name of the DOM Node\n * @param attrsIndex Index of the element's attributes in the `consts` array.\n * @param localRefsIndex Index of the element's local references in the `consts` array.\n * @returns This function returns itself so that it may be chained.\n *\n * @codeGenApi\n */\nfunction ɵɵdomElementStart(index, name, attrsIndex, localRefsIndex) {\n const lView = getLView();\n ngDevMode && assertTNodeCreationIndex(lView, index);\n const tView = lView[TVIEW];\n const adjustedIndex = index + HEADER_OFFSET;\n const tNode = tView.firstCreatePass ? domOnlyFirstCreatePass(adjustedIndex, tView, 2 /* TNodeType.Element */, name, attrsIndex, localRefsIndex) : tView.data[adjustedIndex];\n elementLikeStartShared(tNode, lView, index, name, _locateOrCreateElementNode);\n if (localRefsIndex != null) {\n saveResolvedLocalsInData(lView, tNode);\n }\n if (ngDevMode && lView[TVIEW].firstCreatePass) {\n validateElementIsKnown(lView, tNode);\n }\n return ɵɵdomElementStart;\n}\n/**\n * Mark the end of the directiveless element.\n * @returns This function returns itself so that it may be chained.\n *\n * @codeGenApi\n */\nfunction ɵɵdomElementEnd() {\n const initialTNode = getCurrentTNode();\n ngDevMode && assertDefined(initialTNode, 'No parent node to close.');\n const currentTNode = elementLikeEndShared(initialTNode);\n ngDevMode && assertTNodeType(currentTNode, 3 /* TNodeType.AnyRNode */);\n if (isSkipHydrationRootTNode(currentTNode)) {\n leaveSkipHydrationBlock();\n }\n decreaseElementDepthCount();\n return ɵɵdomElementEnd;\n}\n/**\n * Creates an empty element using {@link domElementStart} and {@link domElementEnd}\n *\n * @param index Index of the element in the data array\n * @param name Name of the DOM Node\n * @param attrsIndex Index of the element's attributes in the `consts` array.\n * @param localRefsIndex Index of the element's local references in the `consts` array.\n * @returns This function returns itself so that it may be chained.\n *\n * @codeGenApi\n */\nfunction ɵɵdomElement(index, name, attrsIndex, localRefsIndex) {\n ɵɵdomElementStart(index, name, attrsIndex, localRefsIndex);\n ɵɵdomElementEnd();\n return ɵɵdomElement;\n}\nlet _locateOrCreateElementNode = (tView, lView, tNode, name, index) => {\n lastNodeWasCreated(true);\n return createElementNode(lView[RENDERER], name, getNamespace());\n};\n/**\n * Enables hydration code path (to lookup existing elements in DOM)\n * in addition to the regular creation mode of element nodes.\n */\nfunction locateOrCreateElementNodeImpl(tView, lView, tNode, name, index) {\n const isNodeCreationMode = !canHydrateNode(lView, tNode);\n lastNodeWasCreated(isNodeCreationMode);\n // Regular creation mode.\n if (isNodeCreationMode) {\n return createElementNode(lView[RENDERER], name, getNamespace());\n }\n // Hydration mode, looking up an existing element in DOM.\n const hydrationInfo = lView[HYDRATION];\n const native = locateNextRNode(hydrationInfo, tView, lView, tNode);\n ngDevMode && validateMatchingNode(native, Node.ELEMENT_NODE, name, lView, tNode);\n ngDevMode && markRNodeAsClaimedByHydration(native);\n // This element might also be an anchor of a view container.\n if (getSerializedContainerViews(hydrationInfo, index)) {\n // Important note: this element acts as an anchor, but it's **not** a part\n // of the embedded view, so we start the segment **after** this element, taking\n // a reference to the next sibling. For example, the following template:\n // `<div #vcrTarget>` is represented in the DOM as `<div></div>...<!--container-->`,\n // so while processing a `<div>` instruction, point to the next sibling as a\n // start of a segment.\n ngDevMode && validateNodeExists(native.nextSibling, lView, tNode);\n setSegmentHead(hydrationInfo, index, native.nextSibling);\n }\n // Checks if the skip hydration attribute is present during hydration so we know to\n // skip attempting to hydrate this block. We check both TNode and RElement for an\n // attribute: the RElement case is needed for i18n cases, when we add it to host\n // elements during the annotation phase (after all internal data structures are setup).\n if (hydrationInfo && (hasSkipHydrationAttrOnTNode(tNode) || hasSkipHydrationAttrOnRElement(native))) {\n if (isComponentHost(tNode)) {\n enterSkipHydrationBlock(tNode);\n // Since this isn't hydratable, we need to empty the node\n // so there's no duplicate content after render\n clearElementContents(native);\n ngDevMode && markRNodeAsSkippedByHydration(native);\n } else if (ngDevMode) {\n // If this is not a component host, throw an error.\n // Hydration can be skipped on per-component basis only.\n throw invalidSkipHydrationHost(native);\n }\n }\n return native;\n}\nfunction enableLocateOrCreateElementNodeImpl() {\n _locateOrCreateElementNode = locateOrCreateElementNodeImpl;\n}\n\n/**\n * Creates a logical container for other nodes (<ng-container>) backed by a comment node in the DOM.\n * The instruction must later be followed by `elementContainerEnd()` call.\n *\n * @param index Index of the element in the LView array\n * @param attrsIndex Index of the container attributes in the `consts` array.\n * @param localRefsIndex Index of the container's local references in the `consts` array.\n * @returns This function returns itself so that it may be chained.\n *\n * Even if this instruction accepts a set of attributes no actual attribute values are propagated to\n * the DOM (as a comment node can't have attributes). Attributes are here only for directive\n * matching purposes and setting initial inputs of directives.\n *\n * @codeGenApi\n */\nfunction ɵɵelementContainerStart(index, attrsIndex, localRefsIndex) {\n const lView = getLView();\n ngDevMode && assertTNodeCreationIndex(lView, index);\n const tView = lView[TVIEW];\n const adjustedIndex = index + HEADER_OFFSET;\n const tNode = tView.firstCreatePass ? directiveHostFirstCreatePass(adjustedIndex, lView, 8 /* TNodeType.ElementContainer */, 'ng-container', findDirectiveDefMatches, getBindingsEnabled(), attrsIndex, localRefsIndex) : tView.data[adjustedIndex];\n elementLikeStartShared(tNode, lView, index, 'ng-container', _locateOrCreateElementContainerNode);\n if (isDirectiveHost(tNode)) {\n const tView = lView[TVIEW];\n createDirectivesInstances(tView, lView, tNode);\n executeContentQueries(tView, tNode, lView);\n }\n if (localRefsIndex != null) {\n saveResolvedLocalsInData(lView, tNode);\n }\n return ɵɵelementContainerStart;\n}\n/**\n * Mark the end of the <ng-container>.\n * @returns This function returns itself so that it may be chained.\n *\n * @codeGenApi\n */\nfunction ɵɵelementContainerEnd() {\n const tView = getTView();\n const initialTNode = getCurrentTNode();\n ngDevMode && assertDefined(initialTNode, 'No parent node to close.');\n const currentTNode = elementLikeEndShared(initialTNode);\n if (tView.firstCreatePass) {\n directiveHostEndFirstCreatePass(tView, currentTNode);\n }\n ngDevMode && assertTNodeType(currentTNode, 8 /* TNodeType.ElementContainer */);\n return ɵɵelementContainerEnd;\n}\n/**\n * Creates an empty logical container using {@link elementContainerStart}\n * and {@link elementContainerEnd}\n *\n * @param index Index of the element in the LView array\n * @param attrsIndex Index of the container attributes in the `consts` array.\n * @param localRefsIndex Index of the container's local references in the `consts` array.\n * @returns This function returns itself so that it may be chained.\n *\n * @codeGenApi\n */\nfunction ɵɵelementContainer(index, attrsIndex, localRefsIndex) {\n ɵɵelementContainerStart(index, attrsIndex, localRefsIndex);\n ɵɵelementContainerEnd();\n return ɵɵelementContainer;\n}\n/**\n * Creates a DOM-only logical container for other nodes (<ng-container>) backed by a comment node\n * in the DOM. The host node will *not* match any directives.\n *\n * @param index Index of the element in the LView array\n * @param attrsIndex Index of the container attributes in the `consts` array.\n * @param localRefsIndex Index of the container's local references in the `consts` array.\n * @returns This function returns itself so that it may be chained.\n *\n * @codeGenApi\n */\nfunction ɵɵdomElementContainerStart(index, attrsIndex, localRefsIndex) {\n const lView = getLView();\n ngDevMode && assertTNodeCreationIndex(lView, index);\n const tView = lView[TVIEW];\n const adjustedIndex = index + HEADER_OFFSET;\n const tNode = tView.firstCreatePass ? domOnlyFirstCreatePass(adjustedIndex, tView, 8 /* TNodeType.ElementContainer */, 'ng-container', attrsIndex, localRefsIndex) : tView.data[adjustedIndex];\n elementLikeStartShared(tNode, lView, index, 'ng-container', _locateOrCreateElementContainerNode);\n if (localRefsIndex != null) {\n saveResolvedLocalsInData(lView, tNode);\n }\n return ɵɵdomElementContainerStart;\n}\n/**\n * Mark the end of a directiveless <ng-container>.\n * @returns This function returns itself so that it may be chained.\n *\n * @codeGenApi\n */\nfunction ɵɵdomElementContainerEnd() {\n const initialTNode = getCurrentTNode();\n ngDevMode && assertDefined(initialTNode, 'No parent node to close.');\n const currentTNode = elementLikeEndShared(initialTNode);\n ngDevMode && assertTNodeType(currentTNode, 8 /* TNodeType.ElementContainer */);\n return ɵɵelementContainerEnd;\n}\n/**\n * Creates an empty logical container using {@link domElementContainerStart}\n * and {@link domElementContainerEnd}\n *\n * @param index Index of the element in the LView array\n * @param attrsIndex Index of the container attributes in the `consts` array.\n * @param localRefsIndex Index of the container's local references in the `consts` array.\n * @returns This function returns itself so that it may be chained.\n *\n * @codeGenApi\n */\nfunction ɵɵdomElementContainer(index, attrsIndex, localRefsIndex) {\n ɵɵdomElementContainerStart(index, attrsIndex, localRefsIndex);\n ɵɵdomElementContainerEnd();\n return ɵɵdomElementContainer;\n}\nlet _locateOrCreateElementContainerNode = (tView, lView, tNode, commentText, index) => {\n lastNodeWasCreated(true);\n return createCommentNode(lView[RENDERER], ngDevMode ? commentText : '');\n};\n/**\n * Enables hydration code path (to lookup existing elements in DOM)\n * in addition to the regular creation mode of comment nodes that\n * represent <ng-container>'s anchor.\n */\nfunction locateOrCreateElementContainerNode(tView, lView, tNode, commentText, index) {\n let comment;\n const isNodeCreationMode = !canHydrateNode(lView, tNode);\n lastNodeWasCreated(isNodeCreationMode);\n // Regular creation mode.\n if (isNodeCreationMode) {\n return createCommentNode(lView[RENDERER], ngDevMode ? commentText : '');\n }\n // Hydration mode, looking up existing elements in DOM.\n const hydrationInfo = lView[HYDRATION];\n const currentRNode = locateNextRNode(hydrationInfo, tView, lView, tNode);\n ngDevMode && validateNodeExists(currentRNode, lView, tNode);\n const ngContainerSize = getNgContainerSize(hydrationInfo, index);\n ngDevMode && assertNumber(ngContainerSize, 'Unexpected state: hydrating an <ng-container>, ' + 'but no hydration info is available.');\n setSegmentHead(hydrationInfo, index, currentRNode);\n comment = siblingAfter(ngContainerSize, currentRNode);\n if (ngDevMode) {\n validateMatchingNode(comment, Node.COMMENT_NODE, null, lView, tNode);\n markRNodeAsClaimedByHydration(comment);\n }\n return comment;\n}\nfunction enableLocateOrCreateElementContainerNodeImpl() {\n _locateOrCreateElementContainerNode = locateOrCreateElementContainerNode;\n}\n\n/**\n * Returns the current OpaqueViewState instance.\n *\n * Used in conjunction with the restoreView() instruction to save a snapshot\n * of the current view and restore it when listeners are invoked. This allows\n * walking the declaration view tree in listeners to get vars from parent views.\n *\n * @codeGenApi\n */\nfunction ɵɵgetCurrentView() {\n return getLView();\n}\n\n/**\n * Update a DOM property on an element.\n *\n * @param propName Name of property..\n * @param value New value to write.\n * @param sanitizer An optional function used to sanitize the value.\n * @returns This function returns itself so that it may be chained\n * (e.g. `domProperty('name', ctx.name)('title', ctx.title)`)\n *\n * @codeGenApi\n */\nfunction ɵɵdomProperty(propName, value, sanitizer) {\n const lView = getLView();\n const bindingIndex = nextBindingIndex();\n if (bindingUpdated(lView, bindingIndex, value)) {\n const tView = getTView();\n const tNode = getSelectedTNode();\n setDomProperty(tNode, lView, propName, value, lView[RENDERER], sanitizer);\n ngDevMode && storePropertyBindingMetadata(tView.data, tNode, propName, bindingIndex);\n }\n return ɵɵdomProperty;\n}\n// TODO(crisbeto): try to fold this into `domProperty`. Main difference is the renderer.\n/**\n * Updates a synthetic host binding (e.g. `[@foo]`) on a component or directive.\n *\n * This instruction is for compatibility purposes and is designed to ensure that a\n * synthetic host binding (e.g. `@HostBinding('@foo')`) properly gets rendered in\n * the component's renderer. Normally all host bindings are evaluated with the parent\n * component's renderer, but, in the case of animation @triggers, they need to be\n * evaluated with the sub component's renderer (because that's where the animation\n * triggers are defined).\n *\n * Do not use this instruction as a replacement for `elementProperty`. This instruction\n * only exists to ensure compatibility with the ViewEngine's host binding behavior.\n *\n * @param index The index of the element to update in the data array\n * @param propName Name of property. Because it is going to DOM, this is not subject to\n * renaming as part of minification.\n * @param value New value to write.\n * @param sanitizer An optional function used to sanitize the value.\n *\n * @codeGenApi\n */\nfunction ɵɵsyntheticHostProperty(propName, value, sanitizer) {\n const lView = getLView();\n const bindingIndex = nextBindingIndex();\n if (bindingUpdated(lView, bindingIndex, value)) {\n const tView = getTView();\n const tNode = getSelectedTNode();\n const currentDef = getCurrentDirectiveDef(tView.data);\n const renderer = loadComponentRenderer(currentDef, tNode, lView);\n setDomProperty(tNode, lView, propName, value, renderer, sanitizer);\n ngDevMode && storePropertyBindingMetadata(tView.data, tNode, propName, bindingIndex);\n }\n return ɵɵsyntheticHostProperty;\n}\n\n// THIS CODE IS GENERATED - DO NOT MODIFY.\nconst u = undefined;\nfunction plural(val) {\n const i = Math.floor(Math.abs(val)),\n v = val.toString().replace(/^[^.]*\\.?/, '').length;\n if (i === 1 && v === 0) return 1;\n return 5;\n}\nvar localeEn = [\"en\", [[\"a\", \"p\"], [\"AM\", \"PM\"], u], [[\"AM\", \"PM\"], u, u], [[\"S\", \"M\", \"T\", \"W\", \"T\", \"F\", \"S\"], [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], [\"Su\", \"Mo\", \"Tu\", \"We\", \"Th\", \"Fr\", \"Sa\"]], u, [[\"J\", \"F\", \"M\", \"A\", \"M\", \"J\", \"J\", \"A\", \"S\", \"O\", \"N\", \"D\"], [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"]], u, [[\"B\", \"A\"], [\"BC\", \"AD\"], [\"Before Christ\", \"Anno Domini\"]], 0, [6, 0], [\"M/d/yy\", \"MMM d, y\", \"MMMM d, y\", \"EEEE, MMMM d, y\"], [\"h:mm a\", \"h:mm:ss a\", \"h:mm:ss a z\", \"h:mm:ss a zzzz\"], [\"{1}, {0}\", u, \"{1} 'at' {0}\", u], [\".\", \",\", \";\", \"%\", \"+\", \"-\", \"E\", \"×\", \"‰\", \"∞\", \"NaN\", \":\"], [\"#,##0.###\", \"#,##0%\", \"¤#,##0.00\", \"#E0\"], \"USD\", \"$\", \"US Dollar\", {}, \"ltr\", plural];\n\n/**\n * This const is used to store the locale data registered with `registerLocaleData`\n */\nlet LOCALE_DATA = {};\n/**\n * Register locale data to be used internally by Angular. See the\n * [\"I18n guide\"](guide/i18n/format-data-locale) to know how to import additional locale\n * data.\n *\n * The signature `registerLocaleData(data: any, extraData?: any)` is deprecated since v5.1\n */\nfunction registerLocaleData(data, localeId, extraData) {\n if (typeof localeId !== 'string') {\n extraData = localeId;\n localeId = data[LocaleDataIndex.LocaleId];\n }\n localeId = localeId.toLowerCase().replace(/_/g, '-');\n LOCALE_DATA[localeId] = data;\n if (extraData) {\n LOCALE_DATA[localeId][LocaleDataIndex.ExtraData] = extraData;\n }\n}\n/**\n * Finds the locale data for a given locale.\n *\n * @param locale The locale code.\n * @returns The locale data.\n * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)\n */\nfunction findLocaleData(locale) {\n const normalizedLocale = normalizeLocale(locale);\n let match = getLocaleData(normalizedLocale);\n if (match) {\n return match;\n }\n // let's try to find a parent locale\n const parentLocale = normalizedLocale.split('-')[0];\n match = getLocaleData(parentLocale);\n if (match) {\n return match;\n }\n if (parentLocale === 'en') {\n return localeEn;\n }\n throw new RuntimeError(701 /* RuntimeErrorCode.MISSING_LOCALE_DATA */, ngDevMode && `Missing locale data for the locale \"${locale}\".`);\n}\n/**\n * Retrieves the default currency code for the given locale.\n *\n * The default is defined as the first currency which is still in use.\n *\n * @param locale The code of the locale whose currency code we want.\n * @returns The code of the default currency for the given locale.\n *\n */\nfunction getLocaleCurrencyCode(locale) {\n const data = findLocaleData(locale);\n return data[LocaleDataIndex.CurrencyCode] || null;\n}\n/**\n * Retrieves the plural function used by ICU expressions to determine the plural case to use\n * for a given locale.\n * @param locale A locale code for the locale format rules to use.\n * @returns The plural function for the locale.\n * @see {@link NgPlural}\n * @see [Internationalization (i18n) Guide](guide/i18n)\n */\nfunction getLocalePluralCase(locale) {\n const data = findLocaleData(locale);\n return data[LocaleDataIndex.PluralCase];\n}\n/**\n * Helper function to get the given `normalizedLocale` from `LOCALE_DATA`\n * or from the global `ng.common.locale`.\n */\nfunction getLocaleData(normalizedLocale) {\n if (!(normalizedLocale in LOCALE_DATA)) {\n LOCALE_DATA[normalizedLocale] = _global.ng && _global.ng.common && _global.ng.common.locales && _global.ng.common.locales[normalizedLocale];\n }\n return LOCALE_DATA[normalizedLocale];\n}\n/**\n * Helper function to remove all the locale data from `LOCALE_DATA`.\n */\nfunction unregisterAllLocaleData() {\n LOCALE_DATA = {};\n}\n/**\n * Index of each type of locale data from the locale data array\n */\nvar LocaleDataIndex;\n(function (LocaleDataIndex) {\n LocaleDataIndex[LocaleDataIndex[\"LocaleId\"] = 0] = \"LocaleId\";\n LocaleDataIndex[LocaleDataIndex[\"DayPeriodsFormat\"] = 1] = \"DayPeriodsFormat\";\n LocaleDataIndex[LocaleDataIndex[\"DayPeriodsStandalone\"] = 2] = \"DayPeriodsStandalone\";\n LocaleDataIndex[LocaleDataIndex[\"DaysFormat\"] = 3] = \"DaysFormat\";\n LocaleDataIndex[LocaleDataIndex[\"DaysStandalone\"] = 4] = \"DaysStandalone\";\n LocaleDataIndex[LocaleDataIndex[\"MonthsFormat\"] = 5] = \"MonthsFormat\";\n LocaleDataIndex[LocaleDataIndex[\"MonthsStandalone\"] = 6] = \"MonthsStandalone\";\n LocaleDataIndex[LocaleDataIndex[\"Eras\"] = 7] = \"Eras\";\n LocaleDataIndex[LocaleDataIndex[\"FirstDayOfWeek\"] = 8] = \"FirstDayOfWeek\";\n LocaleDataIndex[LocaleDataIndex[\"WeekendRange\"] = 9] = \"WeekendRange\";\n LocaleDataIndex[LocaleDataIndex[\"DateFormat\"] = 10] = \"DateFormat\";\n LocaleDataIndex[LocaleDataIndex[\"TimeFormat\"] = 11] = \"TimeFormat\";\n LocaleDataIndex[LocaleDataIndex[\"DateTimeFormat\"] = 12] = \"DateTimeFormat\";\n LocaleDataIndex[LocaleDataIndex[\"NumberSymbols\"] = 13] = \"NumberSymbols\";\n LocaleDataIndex[LocaleDataIndex[\"NumberFormats\"] = 14] = \"NumberFormats\";\n LocaleDataIndex[LocaleDataIndex[\"CurrencyCode\"] = 15] = \"CurrencyCode\";\n LocaleDataIndex[LocaleDataIndex[\"CurrencySymbol\"] = 16] = \"CurrencySymbol\";\n LocaleDataIndex[LocaleDataIndex[\"CurrencyName\"] = 17] = \"CurrencyName\";\n LocaleDataIndex[LocaleDataIndex[\"Currencies\"] = 18] = \"Currencies\";\n LocaleDataIndex[LocaleDataIndex[\"Directionality\"] = 19] = \"Directionality\";\n LocaleDataIndex[LocaleDataIndex[\"PluralCase\"] = 20] = \"PluralCase\";\n LocaleDataIndex[LocaleDataIndex[\"ExtraData\"] = 21] = \"ExtraData\";\n})(LocaleDataIndex || (LocaleDataIndex = {}));\n/**\n * Returns the canonical form of a locale name - lowercase with `_` replaced with `-`.\n */\nfunction normalizeLocale(locale) {\n return locale.toLowerCase().replace(/_/g, '-');\n}\nconst pluralMapping = ['zero', 'one', 'two', 'few', 'many'];\n/**\n * Returns the plural case based on the locale\n */\nfunction getPluralCase(value, locale) {\n const plural = getLocalePluralCase(locale)(parseInt(value, 10));\n const result = pluralMapping[plural];\n return result !== undefined ? result : 'other';\n}\n/**\n * The locale id that the application is using by default (for translations and ICU expressions).\n */\nconst DEFAULT_LOCALE_ID = 'en-US';\n/**\n * USD currency code that the application uses by default for CurrencyPipe when no\n * DEFAULT_CURRENCY_CODE is provided.\n */\nconst USD_CURRENCY_CODE = 'USD';\n\n/**\n * Marks that the next string is an element name.\n *\n * See `I18nMutateOpCodes` documentation.\n */\nconst ELEMENT_MARKER = {\n marker: 'element'\n};\n/**\n * Marks that the next string is comment text need for ICU.\n *\n * See `I18nMutateOpCodes` documentation.\n */\nconst ICU_MARKER = {\n marker: 'ICU'\n};\n/**\n * See `I18nCreateOpCodes`\n */\nvar I18nCreateOpCode;\n(function (I18nCreateOpCode) {\n /**\n * Number of bits to shift index so that it can be combined with the `APPEND_EAGERLY` and\n * `COMMENT`.\n */\n I18nCreateOpCode[I18nCreateOpCode[\"SHIFT\"] = 2] = \"SHIFT\";\n /**\n * Should the node be appended to parent immediately after creation.\n */\n I18nCreateOpCode[I18nCreateOpCode[\"APPEND_EAGERLY\"] = 1] = \"APPEND_EAGERLY\";\n /**\n * If set the node should be comment (rather than a text) node.\n */\n I18nCreateOpCode[I18nCreateOpCode[\"COMMENT\"] = 2] = \"COMMENT\";\n})(I18nCreateOpCode || (I18nCreateOpCode = {}));\n\n/**\n * The locale id that the application is currently using (for translations and ICU expressions).\n * This is the ivy version of `LOCALE_ID` that was defined as an injection token for the view engine\n * but is now defined as a global value.\n */\nlet LOCALE_ID$1 = DEFAULT_LOCALE_ID;\n/**\n * Sets the locale id that will be used for translations and ICU expressions.\n * This is the ivy version of `LOCALE_ID` that was defined as an injection token for the view engine\n * but is now defined as a global value.\n *\n * @param localeId\n */\nfunction setLocaleId(localeId) {\n ngDevMode && assertDefined(localeId, `Expected localeId to be defined`);\n if (typeof localeId === 'string') {\n LOCALE_ID$1 = localeId.toLowerCase().replace(/_/g, '-');\n }\n}\n/**\n * Gets the locale id that will be used for translations and ICU expressions.\n * This is the ivy version of `LOCALE_ID` that was defined as an injection token for the view engine\n * but is now defined as a global value.\n */\nfunction getLocaleId() {\n return LOCALE_ID$1;\n}\n\n/**\n * Keep track of which input bindings in `ɵɵi18nExp` have changed.\n *\n * This is used to efficiently update expressions in i18n only when the corresponding input has\n * changed.\n *\n * 1) Each bit represents which of the `ɵɵi18nExp` has changed.\n * 2) There are 32 bits allowed in JS.\n * 3) Bit 32 is special as it is shared for all changes past 32. (In other words if you have more\n * than 32 `ɵɵi18nExp` then all changes past 32nd `ɵɵi18nExp` will be mapped to same bit. This means\n * that we may end up changing more than we need to. But i18n expressions with 32 bindings is rare\n * so in practice it should not be an issue.)\n */\nlet changeMask = 0b0;\n/**\n * Keeps track of which bit needs to be updated in `changeMask`\n *\n * This value gets incremented on every call to `ɵɵi18nExp`\n */\nlet changeMaskCounter = 0;\n/**\n * Keep track of which input bindings in `ɵɵi18nExp` have changed.\n *\n * `setMaskBit` gets invoked by each call to `ɵɵi18nExp`.\n *\n * @param hasChange did `ɵɵi18nExp` detect a change.\n */\nfunction setMaskBit(hasChange) {\n if (hasChange) {\n changeMask = changeMask | 1 << Math.min(changeMaskCounter, 31);\n }\n changeMaskCounter++;\n}\nfunction applyI18n(tView, lView, index) {\n if (changeMaskCounter > 0) {\n ngDevMode && assertDefined(tView, `tView should be defined`);\n const tI18n = tView.data[index];\n // When `index` points to an `ɵɵi18nAttributes` then we have an array otherwise `TI18n`\n const updateOpCodes = Array.isArray(tI18n) ? tI18n : tI18n.update;\n const bindingsStartIndex = getBindingIndex() - changeMaskCounter - 1;\n applyUpdateOpCodes(tView, lView, updateOpCodes, bindingsStartIndex, changeMask);\n }\n // Reset changeMask & maskBit to default for the next update cycle\n changeMask = 0b0;\n changeMaskCounter = 0;\n}\nfunction createNodeWithoutHydration(lView, textOrName, nodeType) {\n const renderer = lView[RENDERER];\n switch (nodeType) {\n case Node.COMMENT_NODE:\n return createCommentNode(renderer, textOrName);\n case Node.TEXT_NODE:\n return createTextNode(renderer, textOrName);\n case Node.ELEMENT_NODE:\n return createElementNode(renderer, textOrName, null);\n }\n}\nlet _locateOrCreateNode = (lView, index, textOrName, nodeType) => {\n lastNodeWasCreated(true);\n return createNodeWithoutHydration(lView, textOrName, nodeType);\n};\nfunction locateOrCreateNodeImpl(lView, index, textOrName, nodeType) {\n const hydrationInfo = lView[HYDRATION];\n const noOffsetIndex = index - HEADER_OFFSET;\n const isNodeCreationMode = !isI18nHydrationSupportEnabled() || !hydrationInfo || isInSkipHydrationBlock$1() || isDisconnectedNode$1(hydrationInfo, noOffsetIndex);\n lastNodeWasCreated(isNodeCreationMode);\n if (isNodeCreationMode) {\n return createNodeWithoutHydration(lView, textOrName, nodeType);\n }\n const native = locateI18nRNodeByIndex(hydrationInfo, noOffsetIndex);\n // TODO: Improve error handling\n //\n // Other hydration paths use validateMatchingNode() in order to provide\n // detailed information in development mode about the expected DOM.\n // However, not every node in an i18n block has a TNode. Instead, we\n // need to be able to use the AST to generate a similar message.\n ngDevMode && assertDefined(native, 'expected native element');\n ngDevMode && assertEqual(native.nodeType, nodeType, 'expected matching nodeType');\n ngDevMode && nodeType === Node.ELEMENT_NODE && assertEqual(native.tagName.toLowerCase(), textOrName.toLowerCase(), 'expecting matching tagName');\n ngDevMode && markRNodeAsClaimedByHydration(native);\n return native;\n}\nfunction enableLocateOrCreateI18nNodeImpl() {\n _locateOrCreateNode = locateOrCreateNodeImpl;\n}\n/**\n * Apply `I18nCreateOpCodes` op-codes as stored in `TI18n.create`.\n *\n * Creates text (and comment) nodes which are internationalized.\n *\n * @param lView Current lView\n * @param createOpCodes Set of op-codes to apply\n * @param parentRNode Parent node (so that direct children can be added eagerly) or `null` if it is\n * a root node.\n * @param insertInFrontOf DOM node that should be used as an anchor.\n */\nfunction applyCreateOpCodes(lView, createOpCodes, parentRNode, insertInFrontOf) {\n const renderer = lView[RENDERER];\n for (let i = 0; i < createOpCodes.length; i++) {\n const opCode = createOpCodes[i++];\n const text = createOpCodes[i];\n const isComment = (opCode & I18nCreateOpCode.COMMENT) === I18nCreateOpCode.COMMENT;\n const appendNow = (opCode & I18nCreateOpCode.APPEND_EAGERLY) === I18nCreateOpCode.APPEND_EAGERLY;\n const index = opCode >>> I18nCreateOpCode.SHIFT;\n let rNode = lView[index];\n let lastNodeWasCreated = false;\n if (rNode === null) {\n // We only create new DOM nodes if they don't already exist: If ICU switches case back to a\n // case which was already instantiated, no need to create new DOM nodes.\n rNode = lView[index] = _locateOrCreateNode(lView, index, text, isComment ? Node.COMMENT_NODE : Node.TEXT_NODE);\n lastNodeWasCreated = wasLastNodeCreated();\n }\n if (appendNow && parentRNode !== null && lastNodeWasCreated) {\n nativeInsertBefore(renderer, parentRNode, rNode, insertInFrontOf, false);\n }\n }\n}\n/**\n * Apply `I18nMutateOpCodes` OpCodes.\n *\n * @param tView Current `TView`\n * @param mutableOpCodes Mutable OpCodes to process\n * @param lView Current `LView`\n * @param anchorRNode place where the i18n node should be inserted.\n */\nfunction applyMutableOpCodes(tView, mutableOpCodes, lView, anchorRNode) {\n ngDevMode && assertDomNode(anchorRNode);\n const renderer = lView[RENDERER];\n // `rootIdx` represents the node into which all inserts happen.\n let rootIdx = null;\n // `rootRNode` represents the real node into which we insert. This can be different from\n // `lView[rootIdx]` if we have projection.\n // - null we don't have a parent (as can be the case in when we are inserting into a root of\n // LView which has no parent.)\n // - `RElement` The element representing the root after taking projection into account.\n let rootRNode;\n for (let i = 0; i < mutableOpCodes.length; i++) {\n const opCode = mutableOpCodes[i];\n if (typeof opCode == 'string') {\n const textNodeIndex = mutableOpCodes[++i];\n if (lView[textNodeIndex] === null) {\n ngDevMode && assertIndexInRange(lView, textNodeIndex);\n lView[textNodeIndex] = _locateOrCreateNode(lView, textNodeIndex, opCode, Node.TEXT_NODE);\n }\n } else if (typeof opCode == 'number') {\n switch (opCode & 1 /* IcuCreateOpCode.MASK_INSTRUCTION */) {\n case 0 /* IcuCreateOpCode.AppendChild */:\n const parentIdx = getParentFromIcuCreateOpCode(opCode);\n if (rootIdx === null) {\n // The first operation should save the `rootIdx` because the first operation\n // must insert into the root. (Only subsequent operations can insert into a dynamic\n // parent)\n rootIdx = parentIdx;\n rootRNode = renderer.parentNode(anchorRNode);\n }\n let insertInFrontOf;\n let parentRNode;\n if (parentIdx === rootIdx) {\n insertInFrontOf = anchorRNode;\n parentRNode = rootRNode;\n } else {\n insertInFrontOf = null;\n parentRNode = unwrapRNode(lView[parentIdx]);\n }\n // FIXME(misko): Refactor with `processI18nText`\n if (parentRNode !== null) {\n // This can happen if the `LView` we are adding to is not attached to a parent `LView`.\n // In such a case there is no \"root\" we can attach to. This is fine, as we still need to\n // create the elements. When the `LView` gets later added to a parent these \"root\" nodes\n // get picked up and added.\n ngDevMode && assertDomNode(parentRNode);\n const refIdx = getRefFromIcuCreateOpCode(opCode);\n ngDevMode && assertGreaterThan(refIdx, HEADER_OFFSET, 'Missing ref');\n // `unwrapRNode` is not needed here as all of these point to RNodes as part of the i18n\n // which can't have components.\n const child = lView[refIdx];\n ngDevMode && assertDomNode(child);\n nativeInsertBefore(renderer, parentRNode, child, insertInFrontOf, false);\n const tIcu = getTIcu(tView, refIdx);\n if (tIcu !== null && typeof tIcu === 'object') {\n // If we just added a comment node which has ICU then that ICU may have already been\n // rendered and therefore we need to re-add it here.\n ngDevMode && assertTIcu(tIcu);\n const caseIndex = getCurrentICUCaseIndex(tIcu, lView);\n if (caseIndex !== null) {\n applyMutableOpCodes(tView, tIcu.create[caseIndex], lView, lView[tIcu.anchorIdx]);\n }\n }\n }\n break;\n case 1 /* IcuCreateOpCode.Attr */:\n const elementNodeIndex = opCode >>> 1 /* IcuCreateOpCode.SHIFT_REF */;\n const attrName = mutableOpCodes[++i];\n const attrValue = mutableOpCodes[++i];\n // This code is used for ICU expressions only, since we don't support\n // directives/components in ICUs, we don't need to worry about inputs here\n setElementAttribute(renderer, getNativeByIndex(elementNodeIndex, lView), null, null, attrName, attrValue, null);\n break;\n default:\n if (ngDevMode) {\n throw new RuntimeError(700 /* RuntimeErrorCode.INVALID_I18N_STRUCTURE */, `Unable to determine the type of mutate operation for \"${opCode}\"`);\n }\n }\n } else {\n switch (opCode) {\n case ICU_MARKER:\n const commentValue = mutableOpCodes[++i];\n const commentNodeIndex = mutableOpCodes[++i];\n if (lView[commentNodeIndex] === null) {\n ngDevMode && assertEqual(typeof commentValue, 'string', `Expected \"${commentValue}\" to be a comment node value`);\n ngDevMode && assertIndexInExpandoRange(lView, commentNodeIndex);\n const commentRNode = lView[commentNodeIndex] = _locateOrCreateNode(lView, commentNodeIndex, commentValue, Node.COMMENT_NODE);\n // FIXME(misko): Attaching patch data is only needed for the root (Also add tests)\n attachPatchData(commentRNode, lView);\n }\n break;\n case ELEMENT_MARKER:\n const tagName = mutableOpCodes[++i];\n const elementNodeIndex = mutableOpCodes[++i];\n if (lView[elementNodeIndex] === null) {\n ngDevMode && assertEqual(typeof tagName, 'string', `Expected \"${tagName}\" to be an element node tag name`);\n ngDevMode && assertIndexInExpandoRange(lView, elementNodeIndex);\n const elementRNode = lView[elementNodeIndex] = _locateOrCreateNode(lView, elementNodeIndex, tagName, Node.ELEMENT_NODE);\n // FIXME(misko): Attaching patch data is only needed for the root (Also add tests)\n attachPatchData(elementRNode, lView);\n }\n break;\n default:\n ngDevMode && throwError(`Unable to determine the type of mutate operation for \"${opCode}\"`);\n }\n }\n }\n}\n/**\n * Apply `I18nUpdateOpCodes` OpCodes\n *\n * @param tView Current `TView`\n * @param lView Current `LView`\n * @param updateOpCodes OpCodes to process\n * @param bindingsStartIndex Location of the first `ɵɵi18nApply`\n * @param changeMask Each bit corresponds to a `ɵɵi18nExp` (Counting backwards from\n * `bindingsStartIndex`)\n */\nfunction applyUpdateOpCodes(tView, lView, updateOpCodes, bindingsStartIndex, changeMask) {\n for (let i = 0; i < updateOpCodes.length; i++) {\n // bit code to check if we should apply the next update\n const checkBit = updateOpCodes[i];\n // Number of opCodes to skip until next set of update codes\n const skipCodes = updateOpCodes[++i];\n if (checkBit & changeMask) {\n // The value has been updated since last checked\n let value = '';\n for (let j = i + 1; j <= i + skipCodes; j++) {\n const opCode = updateOpCodes[j];\n if (typeof opCode == 'string') {\n value += opCode;\n } else if (typeof opCode == 'number') {\n if (opCode < 0) {\n // Negative opCode represent `i18nExp` values offset.\n value += renderStringify(lView[bindingsStartIndex - opCode]);\n } else {\n const nodeIndex = opCode >>> 2 /* I18nUpdateOpCode.SHIFT_REF */;\n switch (opCode & 3 /* I18nUpdateOpCode.MASK_OPCODE */) {\n case 1 /* I18nUpdateOpCode.Attr */:\n const propName = updateOpCodes[++j];\n const sanitizeFn = updateOpCodes[++j];\n const tNodeOrTagName = tView.data[nodeIndex];\n ngDevMode && assertDefined(tNodeOrTagName, 'Experting TNode or string');\n if (typeof tNodeOrTagName === 'string') {\n // IF we don't have a `TNode`, then we are an element in ICU (as ICU content does\n // not have TNode), in which case we know that there are no directives, and hence\n // we use attribute setting.\n setElementAttribute(lView[RENDERER], lView[nodeIndex], null, tNodeOrTagName, propName, value, sanitizeFn);\n } else {\n setPropertyAndInputs(tNodeOrTagName, lView, propName, value, lView[RENDERER], sanitizeFn);\n }\n break;\n case 0 /* I18nUpdateOpCode.Text */:\n const rText = lView[nodeIndex];\n rText !== null && updateTextNode(lView[RENDERER], rText, value);\n break;\n case 2 /* I18nUpdateOpCode.IcuSwitch */:\n applyIcuSwitchCase(tView, getTIcu(tView, nodeIndex), lView, value);\n break;\n case 3 /* I18nUpdateOpCode.IcuUpdate */:\n applyIcuUpdateCase(tView, getTIcu(tView, nodeIndex), bindingsStartIndex, lView);\n break;\n }\n }\n }\n }\n } else {\n const opCode = updateOpCodes[i + 1];\n if (opCode > 0 && (opCode & 3 /* I18nUpdateOpCode.MASK_OPCODE */) === 3 /* I18nUpdateOpCode.IcuUpdate */) {\n // Special case for the `icuUpdateCase`. It could be that the mask did not match, but\n // we still need to execute `icuUpdateCase` because the case has changed recently due to\n // previous `icuSwitchCase` instruction. (`icuSwitchCase` and `icuUpdateCase` always come in\n // pairs.)\n const nodeIndex = opCode >>> 2 /* I18nUpdateOpCode.SHIFT_REF */;\n const tIcu = getTIcu(tView, nodeIndex);\n const currentIndex = lView[tIcu.currentCaseLViewIndex];\n if (currentIndex < 0) {\n applyIcuUpdateCase(tView, tIcu, bindingsStartIndex, lView);\n }\n }\n }\n i += skipCodes;\n }\n}\n/**\n * Apply OpCodes associated with updating an existing ICU.\n *\n * @param tView Current `TView`\n * @param tIcu Current `TIcu`\n * @param bindingsStartIndex Location of the first `ɵɵi18nApply`\n * @param lView Current `LView`\n */\nfunction applyIcuUpdateCase(tView, tIcu, bindingsStartIndex, lView) {\n ngDevMode && assertIndexInRange(lView, tIcu.currentCaseLViewIndex);\n let activeCaseIndex = lView[tIcu.currentCaseLViewIndex];\n if (activeCaseIndex !== null) {\n let mask = changeMask;\n if (activeCaseIndex < 0) {\n // Clear the flag.\n // Negative number means that the ICU was freshly created and we need to force the update.\n activeCaseIndex = lView[tIcu.currentCaseLViewIndex] = ~activeCaseIndex;\n // -1 is same as all bits on, which simulates creation since it marks all bits dirty\n mask = -1;\n }\n applyUpdateOpCodes(tView, lView, tIcu.update[activeCaseIndex], bindingsStartIndex, mask);\n }\n}\n/**\n * Apply OpCodes associated with switching a case on ICU.\n *\n * This involves tearing down existing case and than building up a new case.\n *\n * @param tView Current `TView`\n * @param tIcu Current `TIcu`\n * @param lView Current `LView`\n * @param value Value of the case to update to.\n */\nfunction applyIcuSwitchCase(tView, tIcu, lView, value) {\n // Rebuild a new case for this ICU\n const caseIndex = getCaseIndex(tIcu, value);\n let activeCaseIndex = getCurrentICUCaseIndex(tIcu, lView);\n if (activeCaseIndex !== caseIndex) {\n applyIcuSwitchCaseRemove(tView, tIcu, lView);\n lView[tIcu.currentCaseLViewIndex] = caseIndex === null ? null : ~caseIndex;\n if (caseIndex !== null) {\n // Add the nodes for the new case\n const anchorRNode = lView[tIcu.anchorIdx];\n if (anchorRNode) {\n ngDevMode && assertDomNode(anchorRNode);\n applyMutableOpCodes(tView, tIcu.create[caseIndex], lView, anchorRNode);\n }\n claimDehydratedIcuCase(lView, tIcu.anchorIdx, caseIndex);\n }\n }\n}\n/**\n * Apply OpCodes associated with tearing ICU case.\n *\n * This involves tearing down existing case and than building up a new case.\n *\n * @param tView Current `TView`\n * @param tIcu Current `TIcu`\n * @param lView Current `LView`\n */\nfunction applyIcuSwitchCaseRemove(tView, tIcu, lView) {\n let activeCaseIndex = getCurrentICUCaseIndex(tIcu, lView);\n if (activeCaseIndex !== null) {\n const removeCodes = tIcu.remove[activeCaseIndex];\n for (let i = 0; i < removeCodes.length; i++) {\n const nodeOrIcuIndex = removeCodes[i];\n if (nodeOrIcuIndex > 0) {\n // Positive numbers are `RNode`s.\n const rNode = getNativeByIndex(nodeOrIcuIndex, lView);\n rNode !== null && nativeRemoveNode(lView[RENDERER], rNode);\n } else {\n // Negative numbers are ICUs\n applyIcuSwitchCaseRemove(tView, getTIcu(tView, ~nodeOrIcuIndex), lView);\n }\n }\n }\n}\n/**\n * Returns the index of the current case of an ICU expression depending on the main binding value\n *\n * @param icuExpression\n * @param bindingValue The value of the main binding used by this ICU expression\n */\nfunction getCaseIndex(icuExpression, bindingValue) {\n let index = icuExpression.cases.indexOf(bindingValue);\n if (index === -1) {\n switch (icuExpression.type) {\n case 1 /* IcuType.plural */:\n {\n const resolvedCase = getPluralCase(bindingValue, getLocaleId());\n index = icuExpression.cases.indexOf(resolvedCase);\n if (index === -1 && resolvedCase !== 'other') {\n index = icuExpression.cases.indexOf('other');\n }\n break;\n }\n case 0 /* IcuType.select */:\n {\n index = icuExpression.cases.indexOf('other');\n break;\n }\n }\n }\n return index === -1 ? null : index;\n}\n\n/**\n * Converts `I18nCreateOpCodes` array into a human readable format.\n *\n * This function is attached to the `I18nCreateOpCodes.debug` property if `ngDevMode` is enabled.\n * This function provides a human readable view of the opcodes. This is useful when debugging the\n * application as well as writing more readable tests.\n *\n * @param this `I18nCreateOpCodes` if attached as a method.\n * @param opcodes `I18nCreateOpCodes` if invoked as a function.\n */\nfunction i18nCreateOpCodesToString(opcodes) {\n const createOpCodes = opcodes || (Array.isArray(this) ? this : []);\n let lines = [];\n for (let i = 0; i < createOpCodes.length; i++) {\n const opCode = createOpCodes[i++];\n const text = createOpCodes[i];\n const isComment = (opCode & I18nCreateOpCode.COMMENT) === I18nCreateOpCode.COMMENT;\n const appendNow = (opCode & I18nCreateOpCode.APPEND_EAGERLY) === I18nCreateOpCode.APPEND_EAGERLY;\n const index = opCode >>> I18nCreateOpCode.SHIFT;\n lines.push(`lView[${index}] = document.${isComment ? 'createComment' : 'createText'}(${JSON.stringify(text)});`);\n if (appendNow) {\n lines.push(`parent.appendChild(lView[${index}]);`);\n }\n }\n return lines;\n}\n/**\n * Converts `I18nUpdateOpCodes` array into a human readable format.\n *\n * This function is attached to the `I18nUpdateOpCodes.debug` property if `ngDevMode` is enabled.\n * This function provides a human readable view of the opcodes. This is useful when debugging the\n * application as well as writing more readable tests.\n *\n * @param this `I18nUpdateOpCodes` if attached as a method.\n * @param opcodes `I18nUpdateOpCodes` if invoked as a function.\n */\nfunction i18nUpdateOpCodesToString(opcodes) {\n const parser = new OpCodeParser(opcodes || (Array.isArray(this) ? this : []));\n let lines = [];\n function consumeOpCode(value) {\n const ref = value >>> 2 /* I18nUpdateOpCode.SHIFT_REF */;\n const opCode = value & 3 /* I18nUpdateOpCode.MASK_OPCODE */;\n switch (opCode) {\n case 0 /* I18nUpdateOpCode.Text */:\n return `(lView[${ref}] as Text).textContent = $$$`;\n case 1 /* I18nUpdateOpCode.Attr */:\n const attrName = parser.consumeString();\n const sanitizationFn = parser.consumeFunction();\n const value = sanitizationFn ? `(${sanitizationFn})($$$)` : '$$$';\n return `(lView[${ref}] as Element).setAttribute('${attrName}', ${value})`;\n case 2 /* I18nUpdateOpCode.IcuSwitch */:\n return `icuSwitchCase(${ref}, $$$)`;\n case 3 /* I18nUpdateOpCode.IcuUpdate */:\n return `icuUpdateCase(${ref})`;\n }\n throw new Error('unexpected OpCode');\n }\n while (parser.hasMore()) {\n let mask = parser.consumeNumber();\n let size = parser.consumeNumber();\n const end = parser.i + size;\n const statements = [];\n let statement = '';\n while (parser.i < end) {\n let value = parser.consumeNumberOrString();\n if (typeof value === 'string') {\n statement += value;\n } else if (value < 0) {\n // Negative numbers are ref indexes\n // Here `i` refers to current binding index. It is to signify that the value is relative,\n // rather than absolute.\n statement += '${lView[i' + value + ']}';\n } else {\n // Positive numbers are operations.\n const opCodeText = consumeOpCode(value);\n statements.push(opCodeText.replace('$$$', '`' + statement + '`') + ';');\n statement = '';\n }\n }\n lines.push(`if (mask & 0b${mask.toString(2)}) { ${statements.join(' ')} }`);\n }\n return lines;\n}\n/**\n * Converts `I18nCreateOpCodes` array into a human readable format.\n *\n * This function is attached to the `I18nCreateOpCodes.debug` if `ngDevMode` is enabled. This\n * function provides a human readable view of the opcodes. This is useful when debugging the\n * application as well as writing more readable tests.\n *\n * @param this `I18nCreateOpCodes` if attached as a method.\n * @param opcodes `I18nCreateOpCodes` if invoked as a function.\n */\nfunction icuCreateOpCodesToString(opcodes) {\n const parser = new OpCodeParser(opcodes || (Array.isArray(this) ? this : []));\n let lines = [];\n function consumeOpCode(opCode) {\n const parent = getParentFromIcuCreateOpCode(opCode);\n const ref = getRefFromIcuCreateOpCode(opCode);\n switch (getInstructionFromIcuCreateOpCode(opCode)) {\n case 0 /* IcuCreateOpCode.AppendChild */:\n return `(lView[${parent}] as Element).appendChild(lView[${lastRef}])`;\n case 1 /* IcuCreateOpCode.Attr */:\n return `(lView[${ref}] as Element).setAttribute(\"${parser.consumeString()}\", \"${parser.consumeString()}\")`;\n }\n throw new Error('Unexpected OpCode: ' + getInstructionFromIcuCreateOpCode(opCode));\n }\n let lastRef = -1;\n while (parser.hasMore()) {\n let value = parser.consumeNumberStringOrMarker();\n if (value === ICU_MARKER) {\n const text = parser.consumeString();\n lastRef = parser.consumeNumber();\n lines.push(`lView[${lastRef}] = document.createComment(\"${text}\")`);\n } else if (value === ELEMENT_MARKER) {\n const text = parser.consumeString();\n lastRef = parser.consumeNumber();\n lines.push(`lView[${lastRef}] = document.createElement(\"${text}\")`);\n } else if (typeof value === 'string') {\n lastRef = parser.consumeNumber();\n lines.push(`lView[${lastRef}] = document.createTextNode(\"${value}\")`);\n } else if (typeof value === 'number') {\n const line = consumeOpCode(value);\n line && lines.push(line);\n } else {\n throw new Error('Unexpected value');\n }\n }\n return lines;\n}\n/**\n * Converts `I18nRemoveOpCodes` array into a human readable format.\n *\n * This function is attached to the `I18nRemoveOpCodes.debug` if `ngDevMode` is enabled. This\n * function provides a human readable view of the opcodes. This is useful when debugging the\n * application as well as writing more readable tests.\n *\n * @param this `I18nRemoveOpCodes` if attached as a method.\n * @param opcodes `I18nRemoveOpCodes` if invoked as a function.\n */\nfunction i18nRemoveOpCodesToString(opcodes) {\n const removeCodes = opcodes || (Array.isArray(this) ? this : []);\n let lines = [];\n for (let i = 0; i < removeCodes.length; i++) {\n const nodeOrIcuIndex = removeCodes[i];\n if (nodeOrIcuIndex > 0) {\n // Positive numbers are `RNode`s.\n lines.push(`remove(lView[${nodeOrIcuIndex}])`);\n } else {\n // Negative numbers are ICUs\n lines.push(`removeNestedICU(${~nodeOrIcuIndex})`);\n }\n }\n return lines;\n}\nclass OpCodeParser {\n i = 0;\n codes;\n constructor(codes) {\n this.codes = codes;\n }\n hasMore() {\n return this.i < this.codes.length;\n }\n consumeNumber() {\n let value = this.codes[this.i++];\n assertNumber(value, 'expecting number in OpCode');\n return value;\n }\n consumeString() {\n let value = this.codes[this.i++];\n assertString(value, 'expecting string in OpCode');\n return value;\n }\n consumeFunction() {\n let value = this.codes[this.i++];\n if (value === null || typeof value === 'function') {\n return value;\n }\n throw new Error('expecting function in OpCode');\n }\n consumeNumberOrString() {\n let value = this.codes[this.i++];\n if (typeof value === 'string') {\n return value;\n }\n assertNumber(value, 'expecting number or string in OpCode');\n return value;\n }\n consumeNumberStringOrMarker() {\n let value = this.codes[this.i++];\n if (typeof value === 'string' || typeof value === 'number' || value == ICU_MARKER || value == ELEMENT_MARKER) {\n return value;\n }\n assertNumber(value, 'expecting number, string, ICU_MARKER or ELEMENT_MARKER in OpCode');\n return value;\n }\n}\nconst BINDING_REGEXP = /<2F>(\\d+):?\\d*<2A>/gi;\nconst ICU_REGEXP = /({\\s*<2A>\\d+:?\\d*<2A>\\s*,\\s*\\S{6}\\s*,[\\s\\S]*})/gi;\nconst NESTED_ICU = /<2F>(\\d+)<29>/;\nconst ICU_BLOCK_REGEXP = /^\\s*(<28>\\d+:?\\d*<2A>)\\s*,\\s*(select|plural)\\s*,/;\nconst MARKER = `<60>`;\nconst SUBTEMPLATE_REGEXP = /<2F>\\/?\\*(\\d+:\\d+)<29>/gi;\nconst PH_REGEXP = /<2F>(\\/?[#*]\\d+):?\\d*<2A>/gi;\n/**\n * Angular uses the special entity &ngsp; as a placeholder for non-removable space.\n * It's replaced by the 0xE500 PUA (Private Use Areas) unicode character and later on replaced by a\n * space.\n * We are re-implementing the same idea since translations might contain this special character.\n */\nconst NGSP_UNICODE_REGEXP = /\\uE500/g;\nfunction replaceNgsp(value) {\n return value.replace(NGSP_UNICODE_REGEXP, ' ');\n}\n/**\n * Patch a `debug` property getter on top of the existing object.\n *\n * NOTE: always call this method with `ngDevMode && attachDebugObject(...)`\n *\n * @param obj Object to patch\n * @param debugGetter Getter returning a value to patch\n */\nfunction attachDebugGetter(obj, debugGetter) {\n if (ngDevMode) {\n Object.defineProperty(obj, 'debug', {\n get: debugGetter,\n enumerable: false\n });\n } else {\n throw new Error('This method should be guarded with `ngDevMode` so that it can be tree shaken in production!');\n }\n}\n/**\n * Create dynamic nodes from i18n translation block.\n *\n * - Text nodes are created synchronously\n * - TNodes are linked into tree lazily\n *\n * @param tView Current `TView`\n * @parentTNodeIndex index to the parent TNode of this i18n block\n * @param lView Current `LView`\n * @param index Index of `ɵɵi18nStart` instruction.\n * @param message Message to translate.\n * @param subTemplateIndex Index into the sub template of message translation. (ie in case of\n * `ngIf`) (-1 otherwise)\n */\nfunction i18nStartFirstCreatePass(tView, parentTNodeIndex, lView, index, message, subTemplateIndex) {\n const rootTNode = getCurrentParentTNode();\n const createOpCodes = [];\n const updateOpCodes = [];\n const existingTNodeStack = [[]];\n const astStack = [[]];\n if (ngDevMode) {\n attachDebugGetter(createOpCodes, i18nCreateOpCodesToString);\n attachDebugGetter(updateOpCodes, i18nUpdateOpCodesToString);\n }\n message = getTranslationForTemplate(message, subTemplateIndex);\n const msgParts = replaceNgsp(message).split(PH_REGEXP);\n for (let i = 0; i < msgParts.length; i++) {\n let value = msgParts[i];\n if ((i & 1) === 0) {\n // Even indexes are text (including bindings & ICU expressions)\n const parts = i18nParseTextIntoPartsAndICU(value);\n for (let j = 0; j < parts.length; j++) {\n let part = parts[j];\n if ((j & 1) === 0) {\n // `j` is odd therefore `part` is string\n const text = part;\n ngDevMode && assertString(text, 'Parsed ICU part should be string');\n if (text !== '') {\n i18nStartFirstCreatePassProcessTextNode(astStack[0], tView, rootTNode, existingTNodeStack[0], createOpCodes, updateOpCodes, lView, text);\n }\n } else {\n // `j` is Even therefor `part` is an `ICUExpression`\n const icuExpression = part;\n // Verify that ICU expression has the right shape. Translations might contain invalid\n // constructions (while original messages were correct), so ICU parsing at runtime may\n // not succeed (thus `icuExpression` remains a string).\n // Note: we intentionally retain the error here by not using `ngDevMode`, because\n // the value can change based on the locale and users aren't guaranteed to hit\n // an invalid string while they're developing.\n if (typeof icuExpression !== 'object') {\n throw new Error(`Unable to parse ICU expression in \"${message}\" message.`);\n }\n const icuContainerTNode = createTNodeAndAddOpCode(tView, rootTNode, existingTNodeStack[0], lView, createOpCodes, ngDevMode ? `ICU ${index}:${icuExpression.mainBinding}` : '', true);\n const icuNodeIndex = icuContainerTNode.index;\n ngDevMode && assertGreaterThanOrEqual(icuNodeIndex, HEADER_OFFSET, 'Index must be in absolute LView offset');\n icuStart(astStack[0], tView, lView, updateOpCodes, parentTNodeIndex, icuExpression, icuNodeIndex);\n }\n }\n } else {\n // Odd indexes are placeholders (elements and sub-templates)\n // At this point value is something like: '/#1:2' (originally coming from '<27>/#1:2<>')\n const isClosing = value.charCodeAt(0) === 47 /* CharCode.SLASH */;\n const type = value.charCodeAt(isClosing ? 1 : 0);\n ngDevMode && assertOneOf(type, 42 /* CharCode.STAR */, 35 /* CharCode.HASH */);\n const index = HEADER_OFFSET + Number.parseInt(value.substring(isClosing ? 2 : 1));\n if (isClosing) {\n existingTNodeStack.shift();\n astStack.shift();\n setCurrentTNode(getCurrentParentTNode(), false);\n } else {\n const tNode = createTNodePlaceholder(tView, existingTNodeStack[0], index);\n existingTNodeStack.unshift([]);\n setCurrentTNode(tNode, true);\n const placeholderNode = {\n kind: 2 /* I18nNodeKind.PLACEHOLDER */,\n index,\n children: [],\n type: type === 35 /* CharCode.HASH */ ? 0 /* I18nPlaceholderType.ELEMENT */ : 1 /* I18nPlaceholderType.SUBTEMPLATE */\n };\n astStack[0].push(placeholderNode);\n astStack.unshift(placeholderNode.children);\n }\n }\n }\n tView.data[index] = {\n create: createOpCodes,\n update: updateOpCodes,\n ast: astStack[0],\n parentTNodeIndex\n };\n}\n/**\n * Allocate space in i18n Range add create OpCode instruction to create a text or comment node.\n *\n * @param tView Current `TView` needed to allocate space in i18n range.\n * @param rootTNode Root `TNode` of the i18n block. This node determines if the new TNode will be\n * added as part of the `i18nStart` instruction or as part of the `TNode.insertBeforeIndex`.\n * @param existingTNodes internal state for `addTNodeAndUpdateInsertBeforeIndex`.\n * @param lView Current `LView` needed to allocate space in i18n range.\n * @param createOpCodes Array storing `I18nCreateOpCodes` where new opCodes will be added.\n * @param text Text to be added when the `Text` or `Comment` node will be created.\n * @param isICU true if a `Comment` node for ICU (instead of `Text`) node should be created.\n */\nfunction createTNodeAndAddOpCode(tView, rootTNode, existingTNodes, lView, createOpCodes, text, isICU) {\n const i18nNodeIdx = allocExpando(tView, lView, 1, null);\n let opCode = i18nNodeIdx << I18nCreateOpCode.SHIFT;\n let parentTNode = getCurrentParentTNode();\n if (rootTNode === parentTNode) {\n // FIXME(misko): A null `parentTNode` should represent when we fall of the `LView` boundary.\n // (there is no parent), but in some circumstances (because we are inconsistent about how we set\n // `previousOrParentTNode`) it could point to `rootTNode` So this is a work around.\n parentTNode = null;\n }\n if (parentTNode === null) {\n // If we don't have a parent that means that we can eagerly add nodes.\n // If we have a parent than these nodes can't be added now (as the parent has not been created\n // yet) and instead the `parentTNode` is responsible for adding it. See\n // `TNode.insertBeforeIndex`\n opCode |= I18nCreateOpCode.APPEND_EAGERLY;\n }\n if (isICU) {\n opCode |= I18nCreateOpCode.COMMENT;\n ensureIcuContainerVisitorLoaded(loadIcuContainerVisitor);\n }\n createOpCodes.push(opCode, text === null ? '' : text);\n // We store `{{?}}` so that when looking at debug `TNodeType.template` we can see where the\n // bindings are.\n const tNode = createTNodeAtIndex(tView, i18nNodeIdx, isICU ? 32 /* TNodeType.Icu */ : 1 /* TNodeType.Text */, text === null ? ngDevMode ? '{{?}}' : '' : text, null);\n addTNodeAndUpdateInsertBeforeIndex(existingTNodes, tNode);\n const tNodeIdx = tNode.index;\n setCurrentTNode(tNode, false /* Text nodes are self closing */);\n if (parentTNode !== null && rootTNode !== parentTNode) {\n // We are a child of deeper node (rather than a direct child of `i18nStart` instruction.)\n // We have to make sure to add ourselves to the parent.\n setTNodeInsertBeforeIndex(parentTNode, tNodeIdx);\n }\n return tNode;\n}\n/**\n * Processes text node in i18n block.\n *\n * Text nodes can have:\n * - Create instruction in `createOpCodes` for creating the text node.\n * - Allocate spec for text node in i18n range of `LView`\n * - If contains binding:\n * - bindings => allocate space in i18n range of `LView` to store the binding value.\n * - populate `updateOpCodes` with update instructions.\n *\n * @param tView Current `TView`\n * @param rootTNode Root `TNode` of the i18n block. This node determines if the new TNode will\n * be added as part of the `i18nStart` instruction or as part of the\n * `TNode.insertBeforeIndex`.\n * @param existingTNodes internal state for `addTNodeAndUpdateInsertBeforeIndex`.\n * @param createOpCodes Location where the creation OpCodes will be stored.\n * @param lView Current `LView`\n * @param text The translated text (which may contain binding)\n */\nfunction i18nStartFirstCreatePassProcessTextNode(ast, tView, rootTNode, existingTNodes, createOpCodes, updateOpCodes, lView, text) {\n const hasBinding = text.match(BINDING_REGEXP);\n const tNode = createTNodeAndAddOpCode(tView, rootTNode, existingTNodes, lView, createOpCodes, hasBinding ? null : text, false);\n const index = tNode.index;\n if (hasBinding) {\n generateBindingUpdateOpCodes(updateOpCodes, text, index, null, 0, null);\n }\n ast.push({\n kind: 0 /* I18nNodeKind.TEXT */,\n index\n });\n}\n/**\n * See `i18nAttributes` above.\n */\nfunction i18nAttributesFirstPass(tView, index, values) {\n const previousElement = getCurrentTNode();\n const previousElementIndex = previousElement.index;\n const updateOpCodes = [];\n if (ngDevMode) {\n attachDebugGetter(updateOpCodes, i18nUpdateOpCodesToString);\n }\n if (tView.firstCreatePass && tView.data[index] === null) {\n for (let i = 0; i < values.length; i += 2) {\n const attrName = values[i];\n const message = values[i + 1];\n if (message !== '') {\n // Check if attribute value contains an ICU and throw an error if that's the case.\n // ICUs in element attributes are not supported.\n // Note: we intentionally retain the error here by not using `ngDevMode`, because\n // the `value` can change based on the locale and users aren't guaranteed to hit\n // an invalid string while they're developing.\n if (ICU_REGEXP.test(message)) {\n throw new Error(`ICU expressions are not supported in attributes. Message: \"${message}\".`);\n }\n // i18n attributes that hit this code path are guaranteed to have bindings, because\n // the compiler treats static i18n attributes as regular attribute bindings.\n // Since this may not be the first i18n attribute on this element we need to pass in how\n // many previous bindings there have already been.\n generateBindingUpdateOpCodes(updateOpCodes, message, previousElementIndex, attrName, countBindings(updateOpCodes), null);\n }\n }\n tView.data[index] = updateOpCodes;\n }\n}\n/**\n * Generate the OpCodes to update the bindings of a string.\n *\n * @param updateOpCodes Place where the update opcodes will be stored.\n * @param str The string containing the bindings.\n * @param destinationNode Index of the destination node which will receive the binding.\n * @param attrName Name of the attribute, if the string belongs to an attribute.\n * @param sanitizeFn Sanitization function used to sanitize the string after update, if necessary.\n * @param bindingStart The lView index of the next expression that can be bound via an opCode.\n * @returns The mask value for these bindings\n */\nfunction generateBindingUpdateOpCodes(updateOpCodes, str, destinationNode, attrName, bindingStart, sanitizeFn) {\n ngDevMode && assertGreaterThanOrEqual(destinationNode, HEADER_OFFSET, 'Index must be in absolute LView offset');\n const maskIndex = updateOpCodes.length; // Location of mask\n const sizeIndex = maskIndex + 1; // location of size for skipping\n updateOpCodes.push(null, null); // Alloc space for mask and size\n const startIndex = maskIndex + 2; // location of first allocation.\n if (ngDevMode) {\n attachDebugGetter(updateOpCodes, i18nUpdateOpCodesToString);\n }\n const textParts = str.split(BINDING_REGEXP);\n let mask = 0;\n for (let j = 0; j < textParts.length; j++) {\n const textValue = textParts[j];\n if (j & 1) {\n // Odd indexes are bindings\n const bindingIndex = bindingStart + parseInt(textValue, 10);\n updateOpCodes.push(-1 - bindingIndex);\n mask = mask | toMaskBit(bindingIndex);\n } else if (textValue !== '') {\n // Even indexes are text\n updateOpCodes.push(textValue);\n }\n }\n updateOpCodes.push(destinationNode << 2 /* I18nUpdateOpCode.SHIFT_REF */ | (attrName ? 1 /* I18nUpdateOpCode.Attr */ : 0 /* I18nUpdateOpCode.Text */));\n if (attrName) {\n updateOpCodes.push(attrName, sanitizeFn);\n }\n updateOpCodes[maskIndex] = mask;\n updateOpCodes[sizeIndex] = updateOpCodes.length - startIndex;\n return mask;\n}\n/**\n * Count the number of bindings in the given `opCodes`.\n *\n * It could be possible to speed this up, by passing the number of bindings found back from\n * `generateBindingUpdateOpCodes()` to `i18nAttributesFirstPass()` but this would then require more\n * complexity in the code and/or transient objects to be created.\n *\n * Since this function is only called once when the template is instantiated, is trivial in the\n * first instance (since `opCodes` will be an empty array), and it is not common for elements to\n * contain multiple i18n bound attributes, it seems like this is a reasonable compromise.\n */\nfunction countBindings(opCodes) {\n let count = 0;\n for (let i = 0; i < opCodes.length; i++) {\n const opCode = opCodes[i];\n // Bindings are negative numbers.\n if (typeof opCode === 'number' && opCode < 0) {\n count++;\n }\n }\n return count;\n}\n/**\n * Convert binding index to mask bit.\n *\n * Each index represents a single bit on the bit-mask. Because bit-mask only has 32 bits, we make\n * the 32nd bit share all masks for all bindings higher than 32. Since it is extremely rare to\n * have more than 32 bindings this will be hit very rarely. The downside of hitting this corner\n * case is that we will execute binding code more often than necessary. (penalty of performance)\n */\nfunction toMaskBit(bindingIndex) {\n return 1 << Math.min(bindingIndex, 31);\n}\n/**\n * Removes everything inside the sub-templates of a message.\n */\nfunction removeInnerTemplateTranslation(message) {\n let match;\n let res = '';\n let index = 0;\n let inTemplate = false;\n let tagMatched;\n while ((match = SUBTEMPLATE_REGEXP.exec(message)) !== null) {\n if (!inTemplate) {\n res += message.substring(index, match.index + match[0].length);\n tagMatched = match[1];\n inTemplate = true;\n } else {\n if (match[0] === `${MARKER}/*${tagMatched}${MARKER}`) {\n index = match.index;\n inTemplate = false;\n }\n }\n }\n ngDevMode && assertEqual(inTemplate, false, `Tag mismatch: unable to find the end of the sub-template in the translation \"${message}\"`);\n res += message.slice(index);\n return res;\n}\n/**\n * Extracts a part of a message and removes the rest.\n *\n * This method is used for extracting a part of the message associated with a template. A\n * translated message can span multiple templates.\n *\n * Example:\n * ```html\n * <div i18n>Translate <span *ngIf>me</span>!</div>\n * ```\n *\n * @param message The message to crop\n * @param subTemplateIndex Index of the sub-template to extract. If undefined it returns the\n * external template and removes all sub-templates.\n */\nfunction getTranslationForTemplate(message, subTemplateIndex) {\n if (isRootTemplateMessage(subTemplateIndex)) {\n // We want the root template message, ignore all sub-templates\n return removeInnerTemplateTranslation(message);\n } else {\n // We want a specific sub-template\n const start = message.indexOf(`:${subTemplateIndex}${MARKER}`) + 2 + subTemplateIndex.toString().length;\n const end = message.search(new RegExp(`${MARKER}\\\\/\\\\*\\\\d+:${subTemplateIndex}${MARKER}`));\n return removeInnerTemplateTranslation(message.substring(start, end));\n }\n}\n/**\n * Generate the OpCodes for ICU expressions.\n *\n * @param icuExpression\n * @param index Index where the anchor is stored and an optional `TIcuContainerNode`\n * - `lView[anchorIdx]` points to a `Comment` node representing the anchor for the ICU.\n * - `tView.data[anchorIdx]` points to the `TIcuContainerNode` if ICU is root (`null` otherwise)\n */\nfunction icuStart(ast, tView, lView, updateOpCodes, parentIdx, icuExpression, anchorIdx) {\n ngDevMode && assertDefined(icuExpression, 'ICU expression must be defined');\n let bindingMask = 0;\n const tIcu = {\n type: icuExpression.type,\n currentCaseLViewIndex: allocExpando(tView, lView, 1, null),\n anchorIdx,\n cases: [],\n create: [],\n remove: [],\n update: []\n };\n addUpdateIcuSwitch(updateOpCodes, icuExpression, anchorIdx);\n setTIcu(tView, anchorIdx, tIcu);\n const values = icuExpression.values;\n const cases = [];\n for (let i = 0; i < values.length; i++) {\n // Each value is an array of strings & other ICU expressions\n const valueArr = values[i];\n const nestedIcus = [];\n for (let j = 0; j < valueArr.length; j++) {\n const value = valueArr[j];\n if (typeof value !== 'string') {\n // It is an nested ICU expression\n const icuIndex = nestedIcus.push(value) - 1;\n // Replace nested ICU expression by a comment node\n valueArr[j] = `<!--<2D>${icuIndex}<7D>-->`;\n }\n }\n const caseAst = [];\n cases.push(caseAst);\n bindingMask = parseIcuCase(caseAst, tView, tIcu, lView, updateOpCodes, parentIdx, icuExpression.cases[i], valueArr.join(''), nestedIcus) | bindingMask;\n }\n if (bindingMask) {\n addUpdateIcuUpdate(updateOpCodes, bindingMask, anchorIdx);\n }\n ast.push({\n kind: 3 /* I18nNodeKind.ICU */,\n index: anchorIdx,\n cases,\n currentCaseLViewIndex: tIcu.currentCaseLViewIndex\n });\n}\n/**\n * Parses text containing an ICU expression and produces a JSON object for it.\n * Original code from closure library, modified for Angular.\n *\n * @param pattern Text containing an ICU expression that needs to be parsed.\n *\n */\nfunction parseICUBlock(pattern) {\n const cases = [];\n const values = [];\n let icuType = 1 /* IcuType.plural */;\n let mainBinding = 0;\n pattern = pattern.replace(ICU_BLOCK_REGEXP, function (str, binding, type) {\n if (type === 'select') {\n icuType = 0 /* IcuType.select */;\n } else {\n icuType = 1 /* IcuType.plural */;\n }\n mainBinding = parseInt(binding.slice(1), 10);\n return '';\n });\n const parts = i18nParseTextIntoPartsAndICU(pattern);\n // Looking for (key block)+ sequence. One of the keys has to be \"other\".\n for (let pos = 0; pos < parts.length;) {\n let key = parts[pos++].trim();\n if (icuType === 1 /* IcuType.plural */) {\n // Key can be \"=x\", we just want \"x\"\n key = key.replace(/\\s*(?:=)?(\\w+)\\s*/, '$1');\n }\n if (key.length) {\n cases.push(key);\n }\n const blocks = i18nParseTextIntoPartsAndICU(parts[pos++]);\n if (cases.length > values.length) {\n values.push(blocks);\n }\n }\n // TODO(ocombe): support ICU expressions in attributes, see #21615\n return {\n type: icuType,\n mainBinding: mainBinding,\n cases,\n values\n };\n}\n/**\n * Breaks pattern into strings and top level {...} blocks.\n * Can be used to break a message into text and ICU expressions, or to break an ICU expression\n * into keys and cases. Original code from closure library, modified for Angular.\n *\n * @param pattern (sub)Pattern to be broken.\n * @returns An `Array<string|IcuExpression>` where:\n * - odd positions: `string` => text between ICU expressions\n * - even positions: `ICUExpression` => ICU expression parsed into `ICUExpression` record.\n */\nfunction i18nParseTextIntoPartsAndICU(pattern) {\n if (!pattern) {\n return [];\n }\n let prevPos = 0;\n const braceStack = [];\n const results = [];\n const braces = /[{}]/g;\n // lastIndex doesn't get set to 0 so we have to.\n braces.lastIndex = 0;\n let match;\n while (match = braces.exec(pattern)) {\n const pos = match.index;\n if (match[0] == '}') {\n braceStack.pop();\n if (braceStack.length == 0) {\n // End of the block.\n const block = pattern.substring(prevPos, pos);\n if (ICU_BLOCK_REGEXP.test(block)) {\n results.push(parseICUBlock(block));\n } else {\n results.push(block);\n }\n prevPos = pos + 1;\n }\n } else {\n if (braceStack.length == 0) {\n const substring = pattern.substring(prevPos, pos);\n results.push(substring);\n prevPos = pos + 1;\n }\n braceStack.push('{');\n }\n }\n const substring = pattern.substring(prevPos);\n results.push(substring);\n return results;\n}\n/**\n * Parses a node, its children and its siblings, and generates the mutate & update OpCodes.\n *\n */\nfunction parseIcuCase(ast, tView, tIcu, lView, updateOpCodes, parentIdx, caseName, unsafeCaseHtml, nestedIcus) {\n const create = [];\n const remove = [];\n const update = [];\n if (ngDevMode) {\n attachDebugGetter(create, icuCreateOpCodesToString);\n attachDebugGetter(remove, i18nRemoveOpCodesToString);\n attachDebugGetter(update, i18nUpdateOpCodesToString);\n }\n tIcu.cases.push(caseName);\n tIcu.create.push(create);\n tIcu.remove.push(remove);\n tIcu.update.push(update);\n const inertBodyHelper = getInertBodyHelper(getDocument());\n const inertBodyElement = inertBodyHelper.getInertBodyElement(unsafeCaseHtml);\n ngDevMode && assertDefined(inertBodyElement, 'Unable to generate inert body element');\n const inertRootNode = getTemplateContent(inertBodyElement) || inertBodyElement;\n if (inertRootNode) {\n return walkIcuTree(ast, tView, tIcu, lView, updateOpCodes, create, remove, update, inertRootNode, parentIdx, nestedIcus, 0);\n } else {\n return 0;\n }\n}\nfunction walkIcuTree(ast, tView, tIcu, lView, sharedUpdateOpCodes, create, remove, update, parentNode, parentIdx, nestedIcus, depth) {\n let bindingMask = 0;\n let currentNode = parentNode.firstChild;\n while (currentNode) {\n const newIndex = allocExpando(tView, lView, 1, null);\n switch (currentNode.nodeType) {\n case Node.ELEMENT_NODE:\n const element = currentNode;\n const tagName = element.tagName.toLowerCase();\n if (VALID_ELEMENTS.hasOwnProperty(tagName)) {\n addCreateNodeAndAppend(create, ELEMENT_MARKER, tagName, parentIdx, newIndex);\n tView.data[newIndex] = tagName;\n const elAttrs = element.attributes;\n for (let i = 0; i < elAttrs.length; i++) {\n const attr = elAttrs.item(i);\n const lowerAttrName = attr.name.toLowerCase();\n const hasBinding = !!attr.value.match(BINDING_REGEXP);\n // we assume the input string is safe, unless it's using a binding\n if (hasBinding) {\n if (VALID_ATTRS.hasOwnProperty(lowerAttrName)) {\n if (URI_ATTRS[lowerAttrName]) {\n generateBindingUpdateOpCodes(update, attr.value, newIndex, attr.name, 0, _sanitizeUrl);\n } else {\n generateBindingUpdateOpCodes(update, attr.value, newIndex, attr.name, 0, null);\n }\n } else {\n ngDevMode && console.warn(`WARNING: ignoring unsafe attribute value ` + `${lowerAttrName} on element ${tagName} ` + `(see ${XSS_SECURITY_URL})`);\n }\n } else {\n addCreateAttribute(create, newIndex, attr);\n }\n }\n const elementNode = {\n kind: 1 /* I18nNodeKind.ELEMENT */,\n index: newIndex,\n children: []\n };\n ast.push(elementNode);\n // Parse the children of this node (if any)\n bindingMask = walkIcuTree(elementNode.children, tView, tIcu, lView, sharedUpdateOpCodes, create, remove, update, currentNode, newIndex, nestedIcus, depth + 1) | bindingMask;\n addRemoveNode(remove, newIndex, depth);\n }\n break;\n case Node.TEXT_NODE:\n const value = currentNode.textContent || '';\n const hasBinding = value.match(BINDING_REGEXP);\n addCreateNodeAndAppend(create, null, hasBinding ? '' : value, parentIdx, newIndex);\n addRemoveNode(remove, newIndex, depth);\n if (hasBinding) {\n bindingMask = generateBindingUpdateOpCodes(update, value, newIndex, null, 0, null) | bindingMask;\n }\n ast.push({\n kind: 0 /* I18nNodeKind.TEXT */,\n index: newIndex\n });\n break;\n case Node.COMMENT_NODE:\n // Check if the comment node is a placeholder for a nested ICU\n const isNestedIcu = NESTED_ICU.exec(currentNode.textContent || '');\n if (isNestedIcu) {\n const nestedIcuIndex = parseInt(isNestedIcu[1], 10);\n const icuExpression = nestedIcus[nestedIcuIndex];\n // Create the comment node that will anchor the ICU expression\n addCreateNodeAndAppend(create, ICU_MARKER, ngDevMode ? `nested ICU ${nestedIcuIndex}` : '', parentIdx, newIndex);\n icuStart(ast, tView, lView, sharedUpdateOpCodes, parentIdx, icuExpression, newIndex);\n addRemoveNestedIcu(remove, newIndex, depth);\n }\n break;\n }\n currentNode = currentNode.nextSibling;\n }\n return bindingMask;\n}\nfunction addRemoveNode(remove, index, depth) {\n if (depth === 0) {\n remove.push(index);\n }\n}\nfunction addRemoveNestedIcu(remove, index, depth) {\n if (depth === 0) {\n remove.push(~index); // remove ICU at `index`\n remove.push(index); // remove ICU comment at `index`\n }\n}\nfunction addUpdateIcuSwitch(update, icuExpression, index) {\n update.push(toMaskBit(icuExpression.mainBinding), 2, -1 - icuExpression.mainBinding, index << 2 /* I18nUpdateOpCode.SHIFT_REF */ | 2 /* I18nUpdateOpCode.IcuSwitch */);\n}\nfunction addUpdateIcuUpdate(update, bindingMask, index) {\n update.push(bindingMask, 1, index << 2 /* I18nUpdateOpCode.SHIFT_REF */ | 3 /* I18nUpdateOpCode.IcuUpdate */);\n}\nfunction addCreateNodeAndAppend(create, marker, text, appendToParentIdx, createAtIdx) {\n if (marker !== null) {\n create.push(marker);\n }\n create.push(text, createAtIdx, icuCreateOpCode(0 /* IcuCreateOpCode.AppendChild */, appendToParentIdx, createAtIdx));\n}\nfunction addCreateAttribute(create, newIndex, attr) {\n create.push(newIndex << 1 /* IcuCreateOpCode.SHIFT_REF */ | 1 /* IcuCreateOpCode.Attr */, attr.name, attr.value);\n}\n\n// i18nPostprocess consts\nconst ROOT_TEMPLATE_ID = 0;\nconst PP_MULTI_VALUE_PLACEHOLDERS_REGEXP = /\\[(<28>.+?<3F>?)\\]/;\nconst PP_PLACEHOLDERS_REGEXP = /\\[(<28>.+?<3F>?)\\]|(<28>\\/?\\*\\d+:\\d+<2B>)/g;\nconst PP_ICU_VARS_REGEXP = /({\\s*)(VAR_(PLURAL|SELECT)(_\\d+)?)(\\s*,)/g;\nconst PP_ICU_PLACEHOLDERS_REGEXP = /{([A-Z0-9_]+)}/g;\nconst PP_ICUS_REGEXP = /<2F>I18N_EXP_(ICU(_\\d+)?)<29>/g;\nconst PP_CLOSE_TEMPLATE_REGEXP = /\\/\\*/;\nconst PP_TEMPLATE_ID_REGEXP = /\\d+\\:(\\d+)/;\n/**\n * Handles message string post-processing for internationalization.\n *\n * Handles message string post-processing by transforming it from intermediate\n * format (that might contain some markers that we need to replace) to the final\n * form, consumable by i18nStart instruction. Post processing steps include:\n *\n * 1. Resolve all multi-value cases (like [<5B>*1:1<><31>#2:1<>|<7C>#4:1<>|<7C>5<EFBFBD>])\n * 2. Replace all ICU vars (like \"VAR_PLURAL\")\n * 3. Replace all placeholders used inside ICUs in a form of {PLACEHOLDER}\n * 4. Replace all ICU references with corresponding values (like <20>ICU_EXP_ICU_1<5F>)\n * in case multiple ICUs have the same placeholder name\n *\n * @param message Raw translation string for post processing\n * @param replacements Set of replacements that should be applied\n *\n * @returns Transformed string that can be consumed by i18nStart instruction\n *\n * @codeGenApi\n */\nfunction i18nPostprocess(message, replacements = {}) {\n /**\n * Step 1: resolve all multi-value placeholders like [<5B>#5<>|<7C>*1:1<><31>#2:1<>|<7C>#4:1<>]\n *\n * Note: due to the way we process nested templates (BFS), multi-value placeholders are typically\n * grouped by templates, for example: [<5B>#5<>|<7C>#6<>|<7C>#1:1<>|<7C>#3:2<>] where <20>#5<> and <20>#6<> belong to root\n * template, <20>#1:1<> belong to nested template with index 1 and <20>#1:2<> - nested template with index\n * 3. However in real templates the order might be different: i.e. <20>#1:1<> and/or <20>#3:2<> may go in\n * front of <20>#6<>. The post processing step restores the right order by keeping track of the\n * template id stack and looks for placeholders that belong to the currently active template.\n */\n let result = message;\n if (PP_MULTI_VALUE_PLACEHOLDERS_REGEXP.test(message)) {\n const matches = {};\n const templateIdsStack = [ROOT_TEMPLATE_ID];\n result = result.replace(PP_PLACEHOLDERS_REGEXP, (m, phs, tmpl) => {\n const content = phs || tmpl;\n const placeholders = matches[content] || [];\n if (!placeholders.length) {\n content.split('|').forEach(placeholder => {\n const match = placeholder.match(PP_TEMPLATE_ID_REGEXP);\n const templateId = match ? parseInt(match[1], 10) : ROOT_TEMPLATE_ID;\n const isCloseTemplateTag = PP_CLOSE_TEMPLATE_REGEXP.test(placeholder);\n placeholders.push([templateId, isCloseTemplateTag, placeholder]);\n });\n matches[content] = placeholders;\n }\n if (!placeholders.length) {\n throw new Error(`i18n postprocess: unmatched placeholder - ${content}`);\n }\n const currentTemplateId = templateIdsStack[templateIdsStack.length - 1];\n let idx = 0;\n // find placeholder index that matches current template id\n for (let i = 0; i < placeholders.length; i++) {\n if (placeholders[i][0] === currentTemplateId) {\n idx = i;\n break;\n }\n }\n // update template id stack based on the current tag extracted\n const [templateId, isCloseTemplateTag, placeholder] = placeholders[idx];\n if (isCloseTemplateTag) {\n templateIdsStack.pop();\n } else if (currentTemplateId !== templateId) {\n templateIdsStack.push(templateId);\n }\n // remove processed tag from the list\n placeholders.splice(idx, 1);\n return placeholder;\n });\n }\n // return current result if no replacements specified\n if (!Object.keys(replacements).length) {\n return result;\n }\n /**\n * Step 2: replace all ICU vars (like \"VAR_PLURAL\")\n */\n result = result.replace(PP_ICU_VARS_REGEXP, (match, start, key, _type, _idx, end) => {\n return replacements.hasOwnProperty(key) ? `${start}${replacements[key]}${end}` : match;\n });\n /**\n * Step 3: replace all placeholders used inside ICUs in a form of {PLACEHOLDER}\n */\n result = result.replace(PP_ICU_PLACEHOLDERS_REGEXP, (match, key) => {\n return replacements.hasOwnProperty(key) ? replacements[key] : match;\n });\n /**\n * Step 4: replace all ICU references with corresponding values (like <20>ICU_EXP_ICU_1<5F>) in case\n * multiple ICUs have the same placeholder name\n */\n result = result.replace(PP_ICUS_REGEXP, (match, key) => {\n if (replacements.hasOwnProperty(key)) {\n const list = replacements[key];\n if (!list.length) {\n throw new Error(`i18n postprocess: unmatched ICU - ${match} with key: ${key}`);\n }\n return list.shift();\n }\n return match;\n });\n return result;\n}\n\n/**\n * Marks a block of text as translatable.\n *\n * The instructions `i18nStart` and `i18nEnd` mark the translation block in the template.\n * The translation `message` is the value which is locale specific. The translation string may\n * contain placeholders which associate inner elements and sub-templates within the translation.\n *\n * The translation `message` placeholders are:\n * - `<60>{index}(:{block})<29>`: *Binding Placeholder*: Marks a location where an expression will be\n * interpolated into. The placeholder `index` points to the expression binding index. An optional\n * `block` that matches the sub-template in which it was declared.\n * - `<60>#{index}(:{block})<29>`/`<60>/#{index}(:{block})<29>`: *Element Placeholder*: Marks the beginning\n * and end of DOM element that were embedded in the original translation block. The placeholder\n * `index` points to the element index in the template instructions set. An optional `block` that\n * matches the sub-template in which it was declared.\n * - `<60>*{index}:{block}<7D>`/`<60>/*{index}:{block}<7D>`: *Sub-template Placeholder*: Sub-templates must be\n * split up and translated separately in each angular template function. The `index` points to the\n * `template` instruction index. A `block` that matches the sub-template in which it was declared.\n *\n * @param index A unique index of the translation in the static block.\n * @param messageIndex An index of the translation message from the `def.consts` array.\n * @param subTemplateIndex Optional sub-template index in the `message`.\n *\n * @codeGenApi\n */\nfunction ɵɵi18nStart(index, messageIndex, subTemplateIndex = -1) {\n const tView = getTView();\n const lView = getLView();\n const adjustedIndex = HEADER_OFFSET + index;\n ngDevMode && assertDefined(tView, `tView should be defined`);\n const message = getConstant(tView.consts, messageIndex);\n const parentTNode = getCurrentParentTNode();\n if (tView.firstCreatePass) {\n i18nStartFirstCreatePass(tView, parentTNode === null ? 0 : parentTNode.index, lView, adjustedIndex, message, subTemplateIndex);\n }\n // Set a flag that this LView has i18n blocks.\n // The flag is later used to determine whether this component should\n // be hydrated (currently hydration is not supported for i18n blocks).\n if (tView.type === 2 /* TViewType.Embedded */) {\n // Annotate host component's LView (not embedded view's LView),\n // since hydration can be skipped on per-component basis only.\n const componentLView = lView[DECLARATION_COMPONENT_VIEW];\n componentLView[FLAGS] |= 32 /* LViewFlags.HasI18n */;\n } else {\n lView[FLAGS] |= 32 /* LViewFlags.HasI18n */;\n }\n const tI18n = tView.data[adjustedIndex];\n const sameViewParentTNode = parentTNode === lView[T_HOST] ? null : parentTNode;\n const parentRNode = getClosestRElement(tView, sameViewParentTNode, lView);\n // If `parentTNode` is an `ElementContainer` than it has `<!--ng-container--->`.\n // When we do inserts we have to make sure to insert in front of `<!--ng-container--->`.\n const insertInFrontOf = parentTNode && parentTNode.type & 8 /* TNodeType.ElementContainer */ ? lView[parentTNode.index] : null;\n prepareI18nBlockForHydration(lView, adjustedIndex, parentTNode, subTemplateIndex);\n applyCreateOpCodes(lView, tI18n.create, parentRNode, insertInFrontOf);\n setInI18nBlock(true);\n}\n/**\n * Translates a translation block marked by `i18nStart` and `i18nEnd`. It inserts the text/ICU nodes\n * into the render tree, moves the placeholder nodes and removes the deleted nodes.\n *\n * @codeGenApi\n */\nfunction ɵɵi18nEnd() {\n setInI18nBlock(false);\n}\n/**\n *\n * Use this instruction to create a translation block that doesn't contain any placeholder.\n * It calls both {@link i18nStart} and {@link i18nEnd} in one instruction.\n *\n * The translation `message` is the value which is locale specific. The translation string may\n * contain placeholders which associate inner elements and sub-templates within the translation.\n *\n * The translation `message` placeholders are:\n * - `<60>{index}(:{block})<29>`: *Binding Placeholder*: Marks a location where an expression will be\n * interpolated into. The placeholder `index` points to the expression binding index. An optional\n * `block` that matches the sub-template in which it was declared.\n * - `<60>#{index}(:{block})<29>`/`<60>/#{index}(:{block})<29>`: *Element Placeholder*: Marks the beginning\n * and end of DOM element that were embedded in the original translation block. The placeholder\n * `index` points to the element index in the template instructions set. An optional `block` that\n * matches the sub-template in which it was declared.\n * - `<60>*{index}:{block}<7D>`/`<60>/*{index}:{block}<7D>`: *Sub-template Placeholder*: Sub-templates must be\n * split up and translated separately in each angular template function. The `index` points to the\n * `template` instruction index. A `block` that matches the sub-template in which it was declared.\n *\n * @param index A unique index of the translation in the static block.\n * @param messageIndex An index of the translation message from the `def.consts` array.\n * @param subTemplateIndex Optional sub-template index in the `message`.\n *\n * @codeGenApi\n */\nfunction ɵɵi18n(index, messageIndex, subTemplateIndex) {\n ɵɵi18nStart(index, messageIndex, subTemplateIndex);\n ɵɵi18nEnd();\n}\n/**\n * Marks a list of attributes as translatable.\n *\n * @param index A unique index in the static block\n * @param values\n *\n * @codeGenApi\n */\nfunction ɵɵi18nAttributes(index, attrsIndex) {\n const tView = getTView();\n ngDevMode && assertDefined(tView, `tView should be defined`);\n const attrs = getConstant(tView.consts, attrsIndex);\n i18nAttributesFirstPass(tView, index + HEADER_OFFSET, attrs);\n}\n/**\n * Stores the values of the bindings during each update cycle in order to determine if we need to\n * update the translated nodes.\n *\n * @param value The binding's value\n * @returns This function returns itself so that it may be chained\n * (e.g. `i18nExp(ctx.name)(ctx.title)`)\n *\n * @codeGenApi\n */\nfunction ɵɵi18nExp(value) {\n const lView = getLView();\n setMaskBit(bindingUpdated(lView, nextBindingIndex(), value));\n return ɵɵi18nExp;\n}\n/**\n * Updates a translation block or an i18n attribute when the bindings have changed.\n *\n * @param index Index of either {@link i18nStart} (translation block) or {@link i18nAttributes}\n * (i18n attribute) on which it should update the content.\n *\n * @codeGenApi\n */\nfunction ɵɵi18nApply(index) {\n applyI18n(getTView(), getLView(), index + HEADER_OFFSET);\n}\n/**\n * Handles message string post-processing for internationalization.\n *\n * Handles message string post-processing by transforming it from intermediate\n * format (that might contain some markers that we need to replace) to the final\n * form, consumable by i18nStart instruction. Post processing steps include:\n *\n * 1. Resolve all multi-value cases (like [<5B>*1:1<><31>#2:1<>|<7C>#4:1<>|<7C>5<EFBFBD>])\n * 2. Replace all ICU vars (like \"VAR_PLURAL\")\n * 3. Replace all placeholders used inside ICUs in a form of {PLACEHOLDER}\n * 4. Replace all ICU references with corresponding values (like <20>ICU_EXP_ICU_1<5F>)\n * in case multiple ICUs have the same placeholder name\n *\n * @param message Raw translation string for post processing\n * @param replacements Set of replacements that should be applied\n *\n * @returns Transformed string that can be consumed by i18nStart instruction\n *\n * @codeGenApi\n */\nfunction ɵɵi18nPostprocess(message, replacements = {}) {\n return i18nPostprocess(message, replacements);\n}\n\n/**\n * Adds an event listener to the current node.\n *\n * If an output exists on one of the node's directives, it also subscribes to the output\n * and saves the subscription for later cleanup.\n *\n * @param eventName Name of the event\n * @param listenerFn The function to be called when event emits\n * @param eventTargetResolver Function that returns global target information in case this listener\n * should be attached to a global object like window, document or body\n *\n * @codeGenApi\n */\nfunction ɵɵlistener(eventName, listenerFn, eventTargetResolver) {\n const lView = getLView();\n const tView = getTView();\n const tNode = getCurrentTNode();\n listenerInternal(tView, lView, lView[RENDERER], tNode, eventName, listenerFn, eventTargetResolver);\n return ɵɵlistener;\n}\n/**\n * Registers a synthetic host listener (e.g. `(@foo.start)`) on a component or directive.\n *\n * This instruction is for compatibility purposes and is designed to ensure that a\n * synthetic host listener (e.g. `@HostListener('@foo.start')`) properly gets rendered\n * in the component's renderer. Normally all host listeners are evaluated with the\n * parent component's renderer, but, in the case of animation @triggers, they need\n * to be evaluated with the sub component's renderer (because that's where the\n * animation triggers are defined).\n *\n * Do not use this instruction as a replacement for `listener`. This instruction\n * only exists to ensure compatibility with the ViewEngine's host binding behavior.\n *\n * @param eventName Name of the event\n * @param listenerFn The function to be called when event emits\n * @param useCapture Whether or not to use capture in event listener\n * @param eventTargetResolver Function that returns global target information in case this listener\n * should be attached to a global object like window, document or body\n *\n * @codeGenApi\n */\nfunction ɵɵsyntheticHostListener(eventName, listenerFn) {\n const tNode = getCurrentTNode();\n const lView = getLView();\n const tView = getTView();\n const currentDef = getCurrentDirectiveDef(tView.data);\n const renderer = loadComponentRenderer(currentDef, tNode, lView);\n listenerInternal(tView, lView, renderer, tNode, eventName, listenerFn);\n return ɵɵsyntheticHostListener;\n}\n/**\n * Adds a listener for a DOM event on the current node.\n *\n * @param eventName Name of the event\n * @param listenerFn The function to be called when event emits\n * @param eventTargetResolver Function that returns global target information in case this listener\n * should be attached to a global object like window, document or body\n *\n * @codeGenApi\n */\nfunction ɵɵdomListener(eventName, listenerFn, eventTargetResolver) {\n const lView = getLView();\n const tView = getTView();\n const tNode = getCurrentTNode();\n if (tNode.type & 3 /* TNodeType.AnyRNode */ || eventTargetResolver) {\n listenToDomEvent(tNode, tView, lView, eventTargetResolver, lView[RENDERER], eventName, listenerFn, wrapListener(tNode, lView, listenerFn));\n }\n return ɵɵdomListener;\n}\nfunction listenerInternal(tView, lView, renderer, tNode, eventName, listenerFn, eventTargetResolver) {\n ngDevMode && assertTNodeType(tNode, 3 /* TNodeType.AnyRNode */ | 12 /* TNodeType.AnyContainer */);\n let processOutputs = true;\n let wrappedListener = null;\n // Adding a native event listener is applicable when:\n // - The corresponding TNode represents a DOM element.\n // - The event target has a resolver (usually resulting in a global object,\n // such as `window` or `document`).\n if (tNode.type & 3 /* TNodeType.AnyRNode */ || eventTargetResolver) {\n wrappedListener ??= wrapListener(tNode, lView, listenerFn);\n const hasCoalescedDomEvent = listenToDomEvent(tNode, tView, lView, eventTargetResolver, renderer, eventName, listenerFn, wrappedListener);\n // Context: https://github.com/angular/angular/pull/30144\n if (hasCoalescedDomEvent) {\n processOutputs = false;\n }\n }\n if (processOutputs) {\n const outputConfig = tNode.outputs?.[eventName];\n const hostDirectiveOutputConfig = tNode.hostDirectiveOutputs?.[eventName];\n if (hostDirectiveOutputConfig && hostDirectiveOutputConfig.length) {\n for (let i = 0; i < hostDirectiveOutputConfig.length; i += 2) {\n const index = hostDirectiveOutputConfig[i];\n const lookupName = hostDirectiveOutputConfig[i + 1];\n wrappedListener ??= wrapListener(tNode, lView, listenerFn);\n listenToOutput(tNode, lView, index, lookupName, eventName, wrappedListener);\n }\n }\n if (outputConfig && outputConfig.length) {\n for (const index of outputConfig) {\n wrappedListener ??= wrapListener(tNode, lView, listenerFn);\n listenToOutput(tNode, lView, index, eventName, eventName, wrappedListener);\n }\n }\n }\n}\n\n/**\n * Retrieves a context at the level specified and saves it as the global, contextViewData.\n * Will get the next level up if level is not specified.\n *\n * This is used to save contexts of parent views so they can be bound in embedded views, or\n * in conjunction with reference() to bind a ref from a parent view.\n *\n * @param level The relative level of the view from which to grab context compared to contextVewData\n * @returns context\n *\n * @codeGenApi\n */\nfunction ɵɵnextContext(level = 1) {\n return nextContextImpl(level);\n}\n\n/**\n * Checks a given node against matching projection slots and returns the\n * determined slot index. Returns \"null\" if no slot matched the given node.\n *\n * This function takes into account the parsed ngProjectAs selector from the\n * node's attributes. If present, it will check whether the ngProjectAs selector\n * matches any of the projection slot selectors.\n */\nfunction matchingProjectionSlotIndex(tNode, projectionSlots) {\n let wildcardNgContentIndex = null;\n const ngProjectAsAttrVal = getProjectAsAttrValue(tNode);\n for (let i = 0; i < projectionSlots.length; i++) {\n const slotValue = projectionSlots[i];\n // The last wildcard projection slot should match all nodes which aren't matching\n // any selector. This is necessary to be backwards compatible with view engine.\n if (slotValue === '*') {\n wildcardNgContentIndex = i;\n continue;\n }\n // If we ran into an `ngProjectAs` attribute, we should match its parsed selector\n // to the list of selectors, otherwise we fall back to matching against the node.\n if (ngProjectAsAttrVal === null ? isNodeMatchingSelectorList(tNode, slotValue, /* isProjectionMode */true) : isSelectorInSelectorList(ngProjectAsAttrVal, slotValue)) {\n return i; // first matching selector \"captures\" a given node\n }\n }\n return wildcardNgContentIndex;\n}\n/**\n * Instruction to distribute projectable nodes among <ng-content> occurrences in a given template.\n * It takes all the selectors from the entire component's template and decides where\n * each projected node belongs (it re-distributes nodes among \"buckets\" where each \"bucket\" is\n * backed by a selector).\n *\n * This function requires CSS selectors to be provided in 2 forms: parsed (by a compiler) and text,\n * un-parsed form.\n *\n * The parsed form is needed for efficient matching of a node against a given CSS selector.\n * The un-parsed, textual form is needed for support of the ngProjectAs attribute.\n *\n * Having a CSS selector in 2 different formats is not ideal, but alternatives have even more\n * drawbacks:\n * - having only a textual form would require runtime parsing of CSS selectors;\n * - we can't have only a parsed as we can't re-construct textual form from it (as entered by a\n * template author).\n *\n * @param projectionSlots? A collection of projection slots. A projection slot can be based\n * on a parsed CSS selectors or set to the wildcard selector (\"*\") in order to match\n * all nodes which do not match any selector. If not specified, a single wildcard\n * selector projection slot will be defined.\n *\n * @codeGenApi\n */\nfunction ɵɵprojectionDef(projectionSlots) {\n const componentNode = getLView()[DECLARATION_COMPONENT_VIEW][T_HOST];\n if (!componentNode.projection) {\n // If no explicit projection slots are defined, fall back to a single\n // projection slot with the wildcard selector.\n const numProjectionSlots = projectionSlots ? projectionSlots.length : 1;\n const projectionHeads = componentNode.projection = newArray(numProjectionSlots, null);\n const tails = projectionHeads.slice();\n let componentChild = componentNode.child;\n while (componentChild !== null) {\n // Do not project let declarations so they don't occupy a slot.\n if (componentChild.type !== 128 /* TNodeType.LetDeclaration */) {\n const slotIndex = projectionSlots ? matchingProjectionSlotIndex(componentChild, projectionSlots) : 0;\n if (slotIndex !== null) {\n if (tails[slotIndex]) {\n tails[slotIndex].projectionNext = componentChild;\n } else {\n projectionHeads[slotIndex] = componentChild;\n }\n tails[slotIndex] = componentChild;\n }\n }\n componentChild = componentChild.next;\n }\n }\n}\n/**\n * Inserts previously re-distributed projected nodes. This instruction must be preceded by a call\n * to the projectionDef instruction.\n *\n * @param nodeIndex Index of the projection node.\n * @param selectorIndex Index of the slot selector.\n * - 0 when the selector is `*` (or unspecified as this is the default value),\n * - 1 based index of the selector from the {@link projectionDef}\n * @param attrs Static attributes set on the `ng-content` node.\n * @param fallbackTemplateFn Template function with fallback content.\n * Will be rendered if the slot is empty at runtime.\n * @param fallbackDecls Number of declarations in the fallback template.\n * @param fallbackVars Number of variables in the fallback template.\n *\n * @codeGenApi\n */\nfunction ɵɵprojection(nodeIndex, selectorIndex = 0, attrs, fallbackTemplateFn, fallbackDecls, fallbackVars) {\n const lView = getLView();\n const tView = getTView();\n const fallbackIndex = fallbackTemplateFn ? nodeIndex + 1 : null;\n // Fallback content needs to be declared no matter whether the slot is empty since different\n // instances of the component may or may not insert it. Also it needs to be declare *before*\n // the projection node in order to work correctly with hydration.\n if (fallbackIndex !== null) {\n declareNoDirectiveHostTemplate(lView, tView, fallbackIndex, fallbackTemplateFn, fallbackDecls, fallbackVars, null, attrs);\n }\n const tProjectionNode = getOrCreateTNode(tView, HEADER_OFFSET + nodeIndex, 16 /* TNodeType.Projection */, null, attrs || null);\n // We can't use viewData[HOST_NODE] because projection nodes can be nested in embedded views.\n if (tProjectionNode.projection === null) {\n tProjectionNode.projection = selectorIndex;\n }\n // `<ng-content>` has no content. Even if there's fallback\n // content, the fallback is shown next to it.\n setCurrentTNodeAsNotParent();\n const hydrationInfo = lView[HYDRATION];\n const isNodeCreationMode = !hydrationInfo || isInSkipHydrationBlock$1();\n const componentHostNode = lView[DECLARATION_COMPONENT_VIEW][T_HOST];\n const isEmpty = componentHostNode.projection[tProjectionNode.projection] === null;\n if (isEmpty && fallbackIndex !== null) {\n insertFallbackContent(lView, tView, fallbackIndex);\n } else if (isNodeCreationMode && !isDetachedByI18n(tProjectionNode)) {\n // re-distribution of projectable nodes is stored on a component's view level\n applyProjection(tView, lView, tProjectionNode);\n }\n}\n/** Inserts the fallback content of a projection slot. Assumes there's no projected content. */\nfunction insertFallbackContent(lView, tView, fallbackIndex) {\n const adjustedIndex = HEADER_OFFSET + fallbackIndex;\n const fallbackTNode = tView.data[adjustedIndex];\n const fallbackLContainer = lView[adjustedIndex];\n ngDevMode && assertTNode(fallbackTNode);\n ngDevMode && assertLContainer(fallbackLContainer);\n const dehydratedView = findMatchingDehydratedView(fallbackLContainer, fallbackTNode.tView.ssrId);\n const fallbackLView = createAndRenderEmbeddedLView(lView, fallbackTNode, undefined, {\n dehydratedView\n });\n addLViewToLContainer(fallbackLContainer, fallbackLView, 0, shouldAddViewToDom(fallbackTNode, dehydratedView));\n}\n\n/**\n * Registers a QueryList, associated with a content query, for later refresh (part of a view\n * refresh).\n *\n * @param directiveIndex Current directive index\n * @param predicate The type for which the query will search\n * @param flags Flags associated with the query\n * @param read What to save in the query\n * @returns QueryList<T>\n *\n * @codeGenApi\n */\nfunction ɵɵcontentQuery(directiveIndex, predicate, flags, read) {\n createContentQuery(directiveIndex, predicate, flags, read);\n}\n/**\n * Creates a new view query by initializing internal data structures.\n *\n * @param predicate The type for which the query will search\n * @param flags Flags associated with the query\n * @param read What to save in the query\n *\n * @codeGenApi\n */\nfunction ɵɵviewQuery(predicate, flags, read) {\n createViewQuery(predicate, flags, read);\n}\n/**\n * Refreshes a query by combining matches from all active views and removing matches from deleted\n * views.\n *\n * @returns `true` if a query got dirty during change detection or if this is a static query\n * resolving in creation mode, `false` otherwise.\n *\n * @codeGenApi\n */\nfunction ɵɵqueryRefresh(queryList) {\n const lView = getLView();\n const tView = getTView();\n const queryIndex = getCurrentQueryIndex();\n setCurrentQueryIndex(queryIndex + 1);\n const tQuery = getTQuery(tView, queryIndex);\n if (queryList.dirty && isCreationMode(lView) === ((tQuery.metadata.flags & 2 /* QueryFlags.isStatic */) === 2 /* QueryFlags.isStatic */)) {\n if (tQuery.matches === null) {\n queryList.reset([]);\n } else {\n const result = getQueryResults(lView, queryIndex);\n queryList.reset(result, unwrapElementRef);\n queryList.notifyOnChanges();\n }\n return true;\n }\n return false;\n}\n/**\n * Loads a QueryList corresponding to the current view or content query.\n *\n * @codeGenApi\n */\nfunction ɵɵloadQuery() {\n return loadQueryInternal(getLView(), getCurrentQueryIndex());\n}\n\n/**\n * Creates a new content query and binds it to a signal created by an authoring function.\n *\n * @param directiveIndex Current directive index\n * @param target The target signal to which the query should be bound\n * @param predicate The type for which the query will search\n * @param flags Flags associated with the query\n * @param read What to save in the query\n *\n * @codeGenApi\n */\nfunction ɵɵcontentQuerySignal(directiveIndex, target, predicate, flags, read) {\n bindQueryToSignal(target, createContentQuery(directiveIndex, predicate, flags, read));\n}\n/**\n * Creates a new view query by initializing internal data structures and binding a new query to the\n * target signal.\n *\n * @param target The target signal to assign the query results to.\n * @param predicate The type or label that should match a given query\n * @param flags Flags associated with the query\n * @param read What to save in the query\n *\n * @codeGenApi\n */\nfunction ɵɵviewQuerySignal(target, predicate, flags, read) {\n bindQueryToSignal(target, createViewQuery(predicate, flags, read));\n}\n/**\n * Advances the current query index by a specified offset.\n *\n * Adjusting the current query index is necessary in cases where a given directive has a mix of\n * zone-based and signal-based queries. The signal-based queries don't require tracking of the\n * current index (those are refreshed on demand and not during change detection) so this instruction\n * is only necessary for backward-compatibility.\n *\n * @param index offset to apply to the current query index (defaults to 1)\n *\n * @codeGenApi\n */\nfunction ɵɵqueryAdvance(indexOffset = 1) {\n setCurrentQueryIndex(getCurrentQueryIndex() + indexOffset);\n}\n\n/**\n * Retrieves a local reference from the current contextViewData.\n *\n * If the reference to retrieve is in a parent view, this instruction is used in conjunction\n * with a nextContext() call, which walks up the tree and updates the contextViewData instance.\n *\n * @param index The index of the local ref in contextViewData.\n *\n * @codeGenApi\n */\nfunction ɵɵreference(index) {\n const contextLView = getContextLView();\n return load(contextLView, HEADER_OFFSET + index);\n}\nfunction toTStylingRange(prev, next) {\n ngDevMode && assertNumberInRange(prev, 0, 32767 /* StylingRange.UNSIGNED_MASK */);\n ngDevMode && assertNumberInRange(next, 0, 32767 /* StylingRange.UNSIGNED_MASK */);\n return prev << 17 /* StylingRange.PREV_SHIFT */ | next << 2 /* StylingRange.NEXT_SHIFT */;\n}\nfunction getTStylingRangePrev(tStylingRange) {\n ngDevMode && assertNumber(tStylingRange, 'expected number');\n return tStylingRange >> 17 /* StylingRange.PREV_SHIFT */ & 32767 /* StylingRange.UNSIGNED_MASK */;\n}\nfunction getTStylingRangePrevDuplicate(tStylingRange) {\n ngDevMode && assertNumber(tStylingRange, 'expected number');\n return (tStylingRange & 2 /* StylingRange.PREV_DUPLICATE */) == 2 /* StylingRange.PREV_DUPLICATE */;\n}\nfunction setTStylingRangePrev(tStylingRange, previous) {\n ngDevMode && assertNumber(tStylingRange, 'expected number');\n ngDevMode && assertNumberInRange(previous, 0, 32767 /* StylingRange.UNSIGNED_MASK */);\n return tStylingRange & ~4294836224 /* StylingRange.PREV_MASK */ | previous << 17 /* StylingRange.PREV_SHIFT */;\n}\nfunction setTStylingRangePrevDuplicate(tStylingRange) {\n ngDevMode && assertNumber(tStylingRange, 'expected number');\n return tStylingRange | 2 /* StylingRange.PREV_DUPLICATE */;\n}\nfunction getTStylingRangeNext(tStylingRange) {\n ngDevMode && assertNumber(tStylingRange, 'expected number');\n return (tStylingRange & 131068 /* StylingRange.NEXT_MASK */) >> 2 /* StylingRange.NEXT_SHIFT */;\n}\nfunction setTStylingRangeNext(tStylingRange, next) {\n ngDevMode && assertNumber(tStylingRange, 'expected number');\n ngDevMode && assertNumberInRange(next, 0, 32767 /* StylingRange.UNSIGNED_MASK */);\n return tStylingRange & ~131068 /* StylingRange.NEXT_MASK */ |\n //\n next << 2 /* StylingRange.NEXT_SHIFT */;\n}\nfunction getTStylingRangeNextDuplicate(tStylingRange) {\n ngDevMode && assertNumber(tStylingRange, 'expected number');\n return (tStylingRange & 1 /* StylingRange.NEXT_DUPLICATE */) === 1 /* StylingRange.NEXT_DUPLICATE */;\n}\nfunction setTStylingRangeNextDuplicate(tStylingRange) {\n ngDevMode && assertNumber(tStylingRange, 'expected number');\n return tStylingRange | 1 /* StylingRange.NEXT_DUPLICATE */;\n}\n\n/**\n * Insert new `tStyleValue` at `TData` and link existing style bindings such that we maintain linked\n * list of styles and compute the duplicate flag.\n *\n * Note: this function is executed during `firstUpdatePass` only to populate the `TView.data`.\n *\n * The function works by keeping track of `tStylingRange` which contains two pointers pointing to\n * the head/tail of the template portion of the styles.\n * - if `isHost === false` (we are template) then insertion is at tail of `TStylingRange`\n * - if `isHost === true` (we are host binding) then insertion is at head of `TStylingRange`\n *\n * @param tData The `TData` to insert into.\n * @param tNode `TNode` associated with the styling element.\n * @param tStylingKey See `TStylingKey`.\n * @param index location of where `tStyleValue` should be stored (and linked into list.)\n * @param isHostBinding `true` if the insertion is for a `hostBinding`. (insertion is in front of\n * template.)\n * @param isClassBinding True if the associated `tStylingKey` as a `class` styling.\n * `tNode.classBindings` should be used (or `tNode.styleBindings` otherwise.)\n */\nfunction insertTStylingBinding(tData, tNode, tStylingKeyWithStatic, index, isHostBinding, isClassBinding) {\n ngDevMode && assertFirstUpdatePass(getTView());\n let tBindings = isClassBinding ? tNode.classBindings : tNode.styleBindings;\n let tmplHead = getTStylingRangePrev(tBindings);\n let tmplTail = getTStylingRangeNext(tBindings);\n tData[index] = tStylingKeyWithStatic;\n let isKeyDuplicateOfStatic = false;\n let tStylingKey;\n if (Array.isArray(tStylingKeyWithStatic)) {\n // We are case when the `TStylingKey` contains static fields as well.\n const staticKeyValueArray = tStylingKeyWithStatic;\n tStylingKey = staticKeyValueArray[1]; // unwrap.\n // We need to check if our key is present in the static so that we can mark it as duplicate.\n if (tStylingKey === null || keyValueArrayIndexOf(staticKeyValueArray, tStylingKey) > 0) {\n // tStylingKey is present in the statics, need to mark it as duplicate.\n isKeyDuplicateOfStatic = true;\n }\n } else {\n tStylingKey = tStylingKeyWithStatic;\n }\n if (isHostBinding) {\n // We are inserting host bindings\n // If we don't have template bindings then `tail` is 0.\n const hasTemplateBindings = tmplTail !== 0;\n // This is important to know because that means that the `head` can't point to the first\n // template bindings (there are none.) Instead the head points to the tail of the template.\n if (hasTemplateBindings) {\n // template head's \"prev\" will point to last host binding or to 0 if no host bindings yet\n const previousNode = getTStylingRangePrev(tData[tmplHead + 1]);\n tData[index + 1] = toTStylingRange(previousNode, tmplHead);\n // if a host binding has already been registered, we need to update the next of that host\n // binding to point to this one\n if (previousNode !== 0) {\n // We need to update the template-tail value to point to us.\n tData[previousNode + 1] = setTStylingRangeNext(tData[previousNode + 1], index);\n }\n // The \"previous\" of the template binding head should point to this host binding\n tData[tmplHead + 1] = setTStylingRangePrev(tData[tmplHead + 1], index);\n } else {\n tData[index + 1] = toTStylingRange(tmplHead, 0);\n // if a host binding has already been registered, we need to update the next of that host\n // binding to point to this one\n if (tmplHead !== 0) {\n // We need to update the template-tail value to point to us.\n tData[tmplHead + 1] = setTStylingRangeNext(tData[tmplHead + 1], index);\n }\n // if we don't have template, the head points to template-tail, and needs to be advanced.\n tmplHead = index;\n }\n } else {\n // We are inserting in template section.\n // We need to set this binding's \"previous\" to the current template tail\n tData[index + 1] = toTStylingRange(tmplTail, 0);\n ngDevMode && assertEqual(tmplHead !== 0 && tmplTail === 0, false, 'Adding template bindings after hostBindings is not allowed.');\n if (tmplHead === 0) {\n tmplHead = index;\n } else {\n // We need to update the previous value \"next\" to point to this binding\n tData[tmplTail + 1] = setTStylingRangeNext(tData[tmplTail + 1], index);\n }\n tmplTail = index;\n }\n // Now we need to update / compute the duplicates.\n // Starting with our location search towards head (least priority)\n if (isKeyDuplicateOfStatic) {\n tData[index + 1] = setTStylingRangePrevDuplicate(tData[index + 1]);\n }\n markDuplicates(tData, tStylingKey, index, true);\n markDuplicates(tData, tStylingKey, index, false);\n markDuplicateOfResidualStyling(tNode, tStylingKey, tData, index, isClassBinding);\n tBindings = toTStylingRange(tmplHead, tmplTail);\n if (isClassBinding) {\n tNode.classBindings = tBindings;\n } else {\n tNode.styleBindings = tBindings;\n }\n}\n/**\n * Look into the residual styling to see if the current `tStylingKey` is duplicate of residual.\n *\n * @param tNode `TNode` where the residual is stored.\n * @param tStylingKey `TStylingKey` to store.\n * @param tData `TData` associated with the current `LView`.\n * @param index location of where `tStyleValue` should be stored (and linked into list.)\n * @param isClassBinding True if the associated `tStylingKey` as a `class` styling.\n * `tNode.classBindings` should be used (or `tNode.styleBindings` otherwise.)\n */\nfunction markDuplicateOfResidualStyling(tNode, tStylingKey, tData, index, isClassBinding) {\n const residual = isClassBinding ? tNode.residualClasses : tNode.residualStyles;\n if (residual != null /* or undefined */ && typeof tStylingKey == 'string' && keyValueArrayIndexOf(residual, tStylingKey) >= 0) {\n // We have duplicate in the residual so mark ourselves as duplicate.\n tData[index + 1] = setTStylingRangeNextDuplicate(tData[index + 1]);\n }\n}\n/**\n * Marks `TStyleValue`s as duplicates if another style binding in the list has the same\n * `TStyleValue`.\n *\n * NOTE: this function is intended to be called twice once with `isPrevDir` set to `true` and once\n * with it set to `false` to search both the previous as well as next items in the list.\n *\n * No duplicate case\n * ```\n * [style.color]\n * [style.width.px] <<- index\n * [style.height.px]\n * ```\n *\n * In the above case adding `[style.width.px]` to the existing `[style.color]` produces no\n * duplicates because `width` is not found in any other part of the linked list.\n *\n * Duplicate case\n * ```\n * [style.color]\n * [style.width.em]\n * [style.width.px] <<- index\n * ```\n * In the above case adding `[style.width.px]` will produce a duplicate with `[style.width.em]`\n * because `width` is found in the chain.\n *\n * Map case 1\n * ```\n * [style.width.px]\n * [style.color]\n * [style] <<- index\n * ```\n * In the above case adding `[style]` will produce a duplicate with any other bindings because\n * `[style]` is a Map and as such is fully dynamic and could produce `color` or `width`.\n *\n * Map case 2\n * ```\n * [style]\n * [style.width.px]\n * [style.color] <<- index\n * ```\n * In the above case adding `[style.color]` will produce a duplicate because there is already a\n * `[style]` binding which is a Map and as such is fully dynamic and could produce `color` or\n * `width`.\n *\n * NOTE: Once `[style]` (Map) is added into the system all things are mapped as duplicates.\n * NOTE: We use `style` as example, but same logic is applied to `class`es as well.\n *\n * @param tData `TData` where the linked list is stored.\n * @param tStylingKey `TStylingKeyPrimitive` which contains the value to compare to other keys in\n * the linked list.\n * @param index Starting location in the linked list to search from\n * @param isPrevDir Direction.\n * - `true` for previous (lower priority);\n * - `false` for next (higher priority).\n */\nfunction markDuplicates(tData, tStylingKey, index, isPrevDir) {\n const tStylingAtIndex = tData[index + 1];\n const isMap = tStylingKey === null;\n let cursor = isPrevDir ? getTStylingRangePrev(tStylingAtIndex) : getTStylingRangeNext(tStylingAtIndex);\n let foundDuplicate = false;\n // We keep iterating as long as we have a cursor\n // AND either:\n // - we found what we are looking for, OR\n // - we are a map in which case we have to continue searching even after we find what we were\n // looking for since we are a wild card and everything needs to be flipped to duplicate.\n while (cursor !== 0 && (foundDuplicate === false || isMap)) {\n ngDevMode && assertIndexInRange(tData, cursor);\n const tStylingValueAtCursor = tData[cursor];\n const tStyleRangeAtCursor = tData[cursor + 1];\n if (isStylingMatch(tStylingValueAtCursor, tStylingKey)) {\n foundDuplicate = true;\n tData[cursor + 1] = isPrevDir ? setTStylingRangeNextDuplicate(tStyleRangeAtCursor) : setTStylingRangePrevDuplicate(tStyleRangeAtCursor);\n }\n cursor = isPrevDir ? getTStylingRangePrev(tStyleRangeAtCursor) : getTStylingRangeNext(tStyleRangeAtCursor);\n }\n if (foundDuplicate) {\n // if we found a duplicate, than mark ourselves.\n tData[index + 1] = isPrevDir ? setTStylingRangePrevDuplicate(tStylingAtIndex) : setTStylingRangeNextDuplicate(tStylingAtIndex);\n }\n}\n/**\n * Determines if two `TStylingKey`s are a match.\n *\n * When computing whether a binding contains a duplicate, we need to compare if the instruction\n * `TStylingKey` has a match.\n *\n * Here are examples of `TStylingKey`s which match given `tStylingKeyCursor` is:\n * - `color`\n * - `color` // Match another color\n * - `null` // That means that `tStylingKey` is a `classMap`/`styleMap` instruction\n * - `['', 'color', 'other', true]` // wrapped `color` so match\n * - `['', null, 'other', true]` // wrapped `null` so match\n * - `['', 'width', 'color', 'value']` // wrapped static value contains a match on `'color'`\n * - `null` // `tStylingKeyCursor` always match as it is `classMap`/`styleMap` instruction\n *\n * @param tStylingKeyCursor\n * @param tStylingKey\n */\nfunction isStylingMatch(tStylingKeyCursor, tStylingKey) {\n ngDevMode && assertNotEqual(Array.isArray(tStylingKey), true, \"Expected that 'tStylingKey' has been unwrapped\");\n if (tStylingKeyCursor === null ||\n // If the cursor is `null` it means that we have map at that\n // location so we must assume that we have a match.\n tStylingKey == null ||\n // If `tStylingKey` is `null` then it is a map therefor assume that it\n // contains a match.\n (Array.isArray(tStylingKeyCursor) ? tStylingKeyCursor[1] : tStylingKeyCursor) === tStylingKey // If the keys match explicitly than we are a match.\n ) {\n return true;\n } else if (Array.isArray(tStylingKeyCursor) && typeof tStylingKey === 'string') {\n // if we did not find a match, but `tStylingKeyCursor` is `KeyValueArray` that means cursor has\n // statics and we need to check those as well.\n return keyValueArrayIndexOf(tStylingKeyCursor, tStylingKey) >= 0; // see if we are matching the key\n }\n return false;\n}\n\n// Global state of the parser. (This makes parser non-reentrant, but that is not an issue)\nconst parserState = {\n textEnd: 0,\n key: 0,\n keyEnd: 0,\n value: 0,\n valueEnd: 0\n};\n/**\n * Retrieves the last parsed `key` of style.\n * @param text the text to substring the key from.\n */\nfunction getLastParsedKey(text) {\n return text.substring(parserState.key, parserState.keyEnd);\n}\n/**\n * Retrieves the last parsed `value` of style.\n * @param text the text to substring the key from.\n */\nfunction getLastParsedValue(text) {\n return text.substring(parserState.value, parserState.valueEnd);\n}\n/**\n * Initializes `className` string for parsing and parses the first token.\n *\n * This function is intended to be used in this format:\n * ```ts\n * for (let i = parseClassName(text); i >= 0; i = parseClassNameNext(text, i)) {\n * const key = getLastParsedKey();\n * ...\n * }\n * ```\n * @param text `className` to parse\n * @returns index where the next invocation of `parseClassNameNext` should resume.\n */\nfunction parseClassName(text) {\n resetParserState(text);\n return parseClassNameNext(text, consumeWhitespace(text, 0, parserState.textEnd));\n}\n/**\n * Parses next `className` token.\n *\n * This function is intended to be used in this format:\n * ```ts\n * for (let i = parseClassName(text); i >= 0; i = parseClassNameNext(text, i)) {\n * const key = getLastParsedKey();\n * ...\n * }\n * ```\n *\n * @param text `className` to parse\n * @param index where the parsing should resume.\n * @returns index where the next invocation of `parseClassNameNext` should resume.\n */\nfunction parseClassNameNext(text, index) {\n const end = parserState.textEnd;\n if (end === index) {\n return -1;\n }\n index = parserState.keyEnd = consumeClassToken(text, parserState.key = index, end);\n return consumeWhitespace(text, index, end);\n}\n/**\n * Initializes `cssText` string for parsing and parses the first key/values.\n *\n * This function is intended to be used in this format:\n * ```ts\n * for (let i = parseStyle(text); i >= 0; i = parseStyleNext(text, i))) {\n * const key = getLastParsedKey();\n * const value = getLastParsedValue();\n * ...\n * }\n * ```\n * @param text `cssText` to parse\n * @returns index where the next invocation of `parseStyleNext` should resume.\n */\nfunction parseStyle(text) {\n resetParserState(text);\n return parseStyleNext(text, consumeWhitespace(text, 0, parserState.textEnd));\n}\n/**\n * Parses the next `cssText` key/values.\n *\n * This function is intended to be used in this format:\n * ```ts\n * for (let i = parseStyle(text); i >= 0; i = parseStyleNext(text, i))) {\n * const key = getLastParsedKey();\n * const value = getLastParsedValue();\n * ...\n * }\n *\n * @param text `cssText` to parse\n * @param index where the parsing should resume.\n * @returns index where the next invocation of `parseStyleNext` should resume.\n */\nfunction parseStyleNext(text, startIndex) {\n const end = parserState.textEnd;\n let index = parserState.key = consumeWhitespace(text, startIndex, end);\n if (end === index) {\n // we reached an end so just quit\n return -1;\n }\n index = parserState.keyEnd = consumeStyleKey(text, index, end);\n index = consumeSeparator(text, index, end, 58 /* CharCode.COLON */);\n index = parserState.value = consumeWhitespace(text, index, end);\n index = parserState.valueEnd = consumeStyleValue(text, index, end);\n return consumeSeparator(text, index, end, 59 /* CharCode.SEMI_COLON */);\n}\n/**\n * Reset the global state of the styling parser.\n * @param text The styling text to parse.\n */\nfunction resetParserState(text) {\n parserState.key = 0;\n parserState.keyEnd = 0;\n parserState.value = 0;\n parserState.valueEnd = 0;\n parserState.textEnd = text.length;\n}\n/**\n * Returns index of next non-whitespace character.\n *\n * @param text Text to scan\n * @param startIndex Starting index of character where the scan should start.\n * @param endIndex Ending index of character where the scan should end.\n * @returns Index of next non-whitespace character (May be the same as `start` if no whitespace at\n * that location.)\n */\nfunction consumeWhitespace(text, startIndex, endIndex) {\n while (startIndex < endIndex && text.charCodeAt(startIndex) <= 32 /* CharCode.SPACE */) {\n startIndex++;\n }\n return startIndex;\n}\n/**\n * Returns index of last char in class token.\n *\n * @param text Text to scan\n * @param startIndex Starting index of character where the scan should start.\n * @param endIndex Ending index of character where the scan should end.\n * @returns Index after last char in class token.\n */\nfunction consumeClassToken(text, startIndex, endIndex) {\n while (startIndex < endIndex && text.charCodeAt(startIndex) > 32 /* CharCode.SPACE */) {\n startIndex++;\n }\n return startIndex;\n}\n/**\n * Consumes all of the characters belonging to style key and token.\n *\n * @param text Text to scan\n * @param startIndex Starting index of character where the scan should start.\n * @param endIndex Ending index of character where the scan should end.\n * @returns Index after last style key character.\n */\nfunction consumeStyleKey(text, startIndex, endIndex) {\n let ch;\n while (startIndex < endIndex && ((ch = text.charCodeAt(startIndex)) === 45 /* CharCode.DASH */ || ch === 95 /* CharCode.UNDERSCORE */ || (ch & -33 /* CharCode.UPPER_CASE */) >= 65 /* CharCode.A */ && (ch & -33 /* CharCode.UPPER_CASE */) <= 90 /* CharCode.Z */ || ch >= 48 /* CharCode.ZERO */ && ch <= 57 /* CharCode.NINE */)) {\n startIndex++;\n }\n return startIndex;\n}\n/**\n * Consumes all whitespace and the separator `:` after the style key.\n *\n * @param text Text to scan\n * @param startIndex Starting index of character where the scan should start.\n * @param endIndex Ending index of character where the scan should end.\n * @returns Index after separator and surrounding whitespace.\n */\nfunction consumeSeparator(text, startIndex, endIndex, separator) {\n startIndex = consumeWhitespace(text, startIndex, endIndex);\n if (startIndex < endIndex) {\n if (ngDevMode && text.charCodeAt(startIndex) !== separator) {\n malformedStyleError(text, String.fromCharCode(separator), startIndex);\n }\n startIndex++;\n }\n return startIndex;\n}\n/**\n * Consumes style value honoring `url()` and `\"\"` text.\n *\n * @param text Text to scan\n * @param startIndex Starting index of character where the scan should start.\n * @param endIndex Ending index of character where the scan should end.\n * @returns Index after last style value character.\n */\nfunction consumeStyleValue(text, startIndex, endIndex) {\n let ch1 = -1; // 1st previous character\n let ch2 = -1; // 2nd previous character\n let ch3 = -1; // 3rd previous character\n let i = startIndex;\n let lastChIndex = i;\n while (i < endIndex) {\n const ch = text.charCodeAt(i++);\n if (ch === 59 /* CharCode.SEMI_COLON */) {\n return lastChIndex;\n } else if (ch === 34 /* CharCode.DOUBLE_QUOTE */ || ch === 39 /* CharCode.SINGLE_QUOTE */) {\n lastChIndex = i = consumeQuotedText(text, ch, i, endIndex);\n } else if (startIndex === i - 4 &&\n // We have seen only 4 characters so far \"URL(\" (Ignore \"foo_URL()\")\n ch3 === 85 /* CharCode.U */ && ch2 === 82 /* CharCode.R */ && ch1 === 76 /* CharCode.L */ && ch === 40 /* CharCode.OPEN_PAREN */) {\n lastChIndex = i = consumeQuotedText(text, 41 /* CharCode.CLOSE_PAREN */, i, endIndex);\n } else if (ch > 32 /* CharCode.SPACE */) {\n // if we have a non-whitespace character then capture its location\n lastChIndex = i;\n }\n ch3 = ch2;\n ch2 = ch1;\n ch1 = ch & -33 /* CharCode.UPPER_CASE */;\n }\n return lastChIndex;\n}\n/**\n * Consumes all of the quoted characters.\n *\n * @param text Text to scan\n * @param quoteCharCode CharCode of either `\"` or `'` quote or `)` for `url(...)`.\n * @param startIndex Starting index of character where the scan should start.\n * @param endIndex Ending index of character where the scan should end.\n * @returns Index after quoted characters.\n */\nfunction consumeQuotedText(text, quoteCharCode, startIndex, endIndex) {\n let ch1 = -1; // 1st previous character\n let index = startIndex;\n while (index < endIndex) {\n const ch = text.charCodeAt(index++);\n if (ch == quoteCharCode && ch1 !== 92 /* CharCode.BACK_SLASH */) {\n return index;\n }\n if (ch == 92 /* CharCode.BACK_SLASH */ && ch1 === 92 /* CharCode.BACK_SLASH */) {\n // two back slashes cancel each other out. For example `\"\\\\\"` should properly end the\n // quotation. (It should not assume that the last `\"` is escaped.)\n ch1 = 0;\n } else {\n ch1 = ch;\n }\n }\n throw ngDevMode ? malformedStyleError(text, String.fromCharCode(quoteCharCode), endIndex) : new Error();\n}\nfunction malformedStyleError(text, expecting, index) {\n ngDevMode && assertEqual(typeof text === 'string', true, 'String expected here');\n throw throwError(`Malformed style at location ${index} in string '` + text.substring(0, index) + '[>>' + text.substring(index, index + 1) + '<<]' + text.slice(index + 1) + `'. Expecting '${expecting}'.`);\n}\n\n/**\n * Update a style binding on an element with the provided value.\n *\n * If the style value is falsy then it will be removed from the element\n * (or assigned a different value depending if there are any styles placed\n * on the element with `styleMap` or any static styles that are\n * present from when the element was created with `styling`).\n *\n * Note that the styling element is updated as part of `stylingApply`.\n *\n * @param prop A valid CSS property.\n * @param value New value to write (`null` or an empty string to remove).\n * @param suffix Optional suffix. Used with scalar values to add unit such as `px`.\n *\n * Note that this will apply the provided style value to the host element if this function is called\n * within a host binding function.\n *\n * @codeGenApi\n */\nfunction ɵɵstyleProp(prop, value, suffix) {\n checkStylingProperty(prop, value, suffix, false);\n return ɵɵstyleProp;\n}\n/**\n * Update a class binding on an element with the provided value.\n *\n * This instruction is meant to handle the `[class.foo]=\"exp\"` case and,\n * therefore, the class binding itself must already be allocated using\n * `styling` within the creation block.\n *\n * @param prop A valid CSS class (only one).\n * @param value A true/false value which will turn the class on or off.\n *\n * Note that this will apply the provided class value to the host element if this function\n * is called within a host binding function.\n *\n * @codeGenApi\n */\nfunction ɵɵclassProp(className, value) {\n checkStylingProperty(className, value, null, true);\n return ɵɵclassProp;\n}\n/**\n * Update style bindings using an object literal on an element.\n *\n * This instruction is meant to apply styling via the `[style]=\"exp\"` template bindings.\n * When styles are applied to the element they will then be updated with respect to\n * any styles/classes set via `styleProp`. If any styles are set to falsy\n * then they will be removed from the element.\n *\n * Note that the styling instruction will not be applied until `stylingApply` is called.\n *\n * @param styles A key/value style map of the styles that will be applied to the given element.\n * Any missing styles (that have already been applied to the element beforehand) will be\n * removed (unset) from the element's styling.\n *\n * Note that this will apply the provided styleMap value to the host element if this function\n * is called within a host binding.\n *\n * @codeGenApi\n */\nfunction ɵɵstyleMap(styles) {\n checkStylingMap(styleKeyValueArraySet, styleStringParser, styles, false);\n}\n/**\n * Parse text as style and add values to KeyValueArray.\n *\n * This code is pulled out to a separate function so that it can be tree shaken away if it is not\n * needed. It is only referenced from `ɵɵstyleMap`.\n *\n * @param keyValueArray KeyValueArray to add parsed values to.\n * @param text text to parse.\n */\nfunction styleStringParser(keyValueArray, text) {\n for (let i = parseStyle(text); i >= 0; i = parseStyleNext(text, i)) {\n styleKeyValueArraySet(keyValueArray, getLastParsedKey(text), getLastParsedValue(text));\n }\n}\n/**\n * Update class bindings using an object literal or class-string on an element.\n *\n * This instruction is meant to apply styling via the `[class]=\"exp\"` template bindings.\n * When classes are applied to the element they will then be updated with\n * respect to any styles/classes set via `classProp`. If any\n * classes are set to falsy then they will be removed from the element.\n *\n * Note that the styling instruction will not be applied until `stylingApply` is called.\n * Note that this will the provided classMap value to the host element if this function is called\n * within a host binding.\n *\n * @param classes A key/value map or string of CSS classes that will be added to the\n * given element. Any missing classes (that have already been applied to the element\n * beforehand) will be removed (unset) from the element's list of CSS classes.\n *\n * @codeGenApi\n */\nfunction ɵɵclassMap(classes) {\n checkStylingMap(classKeyValueArraySet, classStringParser, classes, true);\n}\n/**\n * Parse text as class and add values to KeyValueArray.\n *\n * This code is pulled out to a separate function so that it can be tree shaken away if it is not\n * needed. It is only referenced from `ɵɵclassMap`.\n *\n * @param keyValueArray KeyValueArray to add parsed values to.\n * @param text text to parse.\n */\nfunction classStringParser(keyValueArray, text) {\n for (let i = parseClassName(text); i >= 0; i = parseClassNameNext(text, i)) {\n keyValueArraySet(keyValueArray, getLastParsedKey(text), true);\n }\n}\n/**\n * Common code between `ɵɵclassProp` and `ɵɵstyleProp`.\n *\n * @param prop property name.\n * @param value binding value.\n * @param suffix suffix for the property (e.g. `em` or `px`)\n * @param isClassBased `true` if `class` change (`false` if `style`)\n */\nfunction checkStylingProperty(prop, value, suffix, isClassBased) {\n const lView = getLView();\n const tView = getTView();\n // Styling instructions use 2 slots per binding.\n // 1. one for the value / TStylingKey\n // 2. one for the intermittent-value / TStylingRange\n const bindingIndex = incrementBindingIndex(2);\n if (tView.firstUpdatePass) {\n stylingFirstUpdatePass(tView, prop, bindingIndex, isClassBased);\n }\n if (value !== NO_CHANGE && bindingUpdated(lView, bindingIndex, value)) {\n const tNode = tView.data[getSelectedIndex()];\n updateStyling(tView, tNode, lView, lView[RENDERER], prop, lView[bindingIndex + 1] = normalizeSuffix(value, suffix), isClassBased, bindingIndex);\n }\n}\n/**\n * Common code between `ɵɵclassMap` and `ɵɵstyleMap`.\n *\n * @param keyValueArraySet (See `keyValueArraySet` in \"util/array_utils\") Gets passed in as a\n * function so that `style` can be processed. This is done for tree shaking purposes.\n * @param stringParser Parser used to parse `value` if `string`. (Passed in as `style` and `class`\n * have different parsers.)\n * @param value bound value from application\n * @param isClassBased `true` if `class` change (`false` if `style`)\n */\nfunction checkStylingMap(keyValueArraySet, stringParser, value, isClassBased) {\n const tView = getTView();\n const bindingIndex = incrementBindingIndex(2);\n if (tView.firstUpdatePass) {\n stylingFirstUpdatePass(tView, null, bindingIndex, isClassBased);\n }\n const lView = getLView();\n if (value !== NO_CHANGE && bindingUpdated(lView, bindingIndex, value)) {\n // `getSelectedIndex()` should be here (rather than in instruction) so that it is guarded by the\n // if so as not to read unnecessarily.\n const tNode = tView.data[getSelectedIndex()];\n if (hasStylingInputShadow(tNode, isClassBased) && !isInHostBindings(tView, bindingIndex)) {\n if (ngDevMode) {\n // verify that if we are shadowing then `TData` is appropriately marked so that we skip\n // processing this binding in styling resolution.\n const tStylingKey = tView.data[bindingIndex];\n assertEqual(Array.isArray(tStylingKey) ? tStylingKey[1] : tStylingKey, false, \"Styling linked list shadow input should be marked as 'false'\");\n }\n // VE does not concatenate the static portion like we are doing here.\n // Instead VE just ignores the static completely if dynamic binding is present.\n // Because of locality we have already set the static portion because we don't know if there\n // is a dynamic portion until later. If we would ignore the static portion it would look like\n // the binding has removed it. This would confuse `[ngStyle]`/`[ngClass]` to do the wrong\n // thing as it would think that the static portion was removed. For this reason we\n // concatenate it so that `[ngStyle]`/`[ngClass]` can continue to work on changed.\n let staticPrefix = isClassBased ? tNode.classesWithoutHost : tNode.stylesWithoutHost;\n ngDevMode && isClassBased === false && staticPrefix !== null && assertEqual(staticPrefix.endsWith(';'), true, \"Expecting static portion to end with ';'\");\n if (staticPrefix !== null) {\n // We want to make sure that falsy values of `value` become empty strings.\n value = concatStringsWithSpace(staticPrefix, value ? value : '');\n }\n // Given `<div [style] my-dir>` such that `my-dir` has `@Input('style')`.\n // This takes over the `[style]` binding. (Same for `[class]`)\n setDirectiveInputsWhichShadowsStyling(tView, tNode, lView, value, isClassBased);\n } else {\n updateStylingMap(tView, tNode, lView, lView[RENDERER], lView[bindingIndex + 1], lView[bindingIndex + 1] = toStylingKeyValueArray(keyValueArraySet, stringParser, value), isClassBased, bindingIndex);\n }\n }\n}\n/**\n * Determines when the binding is in `hostBindings` section\n *\n * @param tView Current `TView`\n * @param bindingIndex index of binding which we would like if it is in `hostBindings`\n */\nfunction isInHostBindings(tView, bindingIndex) {\n // All host bindings are placed after the expando section.\n return bindingIndex >= tView.expandoStartIndex;\n}\n/**\n * Collects the necessary information to insert the binding into a linked list of style bindings\n * using `insertTStylingBinding`.\n *\n * @param tView `TView` where the binding linked list will be stored.\n * @param tStylingKey Property/key of the binding.\n * @param bindingIndex Index of binding associated with the `prop`\n * @param isClassBased `true` if `class` change (`false` if `style`)\n */\nfunction stylingFirstUpdatePass(tView, tStylingKey, bindingIndex, isClassBased) {\n ngDevMode && assertFirstUpdatePass(tView);\n const tData = tView.data;\n if (tData[bindingIndex + 1] === null) {\n // The above check is necessary because we don't clear first update pass until first successful\n // (no exception) template execution. This prevents the styling instruction from double adding\n // itself to the list.\n // `getSelectedIndex()` should be here (rather than in instruction) so that it is guarded by the\n // if so as not to read unnecessarily.\n const tNode = tData[getSelectedIndex()];\n ngDevMode && assertDefined(tNode, 'TNode expected');\n const isHostBindings = isInHostBindings(tView, bindingIndex);\n if (hasStylingInputShadow(tNode, isClassBased) && tStylingKey === null && !isHostBindings) {\n // `tStylingKey === null` implies that we are either `[style]` or `[class]` binding.\n // If there is a directive which uses `@Input('style')` or `@Input('class')` than\n // we need to neutralize this binding since that directive is shadowing it.\n // We turn this into a noop by setting the key to `false`\n tStylingKey = false;\n }\n tStylingKey = wrapInStaticStylingKey(tData, tNode, tStylingKey, isClassBased);\n insertTStylingBinding(tData, tNode, tStylingKey, bindingIndex, isHostBindings, isClassBased);\n }\n}\n/**\n * Adds static styling information to the binding if applicable.\n *\n * The linked list of styles not only stores the list and keys, but also stores static styling\n * information on some of the keys. This function determines if the key should contain the styling\n * information and computes it.\n *\n * See `TStylingStatic` for more details.\n *\n * @param tData `TData` where the linked list is stored.\n * @param tNode `TNode` for which the styling is being computed.\n * @param stylingKey `TStylingKeyPrimitive` which may need to be wrapped into `TStylingKey`\n * @param isClassBased `true` if `class` (`false` if `style`)\n */\nfunction wrapInStaticStylingKey(tData, tNode, stylingKey, isClassBased) {\n const hostDirectiveDef = getCurrentDirectiveDef(tData);\n let residual = isClassBased ? tNode.residualClasses : tNode.residualStyles;\n if (hostDirectiveDef === null) {\n // We are in template node.\n // If template node already had styling instruction then it has already collected the static\n // styling and there is no need to collect them again. We know that we are the first styling\n // instruction because the `TNode.*Bindings` points to 0 (nothing has been inserted yet).\n const isFirstStylingInstructionInTemplate = (isClassBased ? tNode.classBindings : tNode.styleBindings) === 0;\n if (isFirstStylingInstructionInTemplate) {\n // It would be nice to be able to get the statics from `mergeAttrs`, however, at this point\n // they are already merged and it would not be possible to figure which property belongs where\n // in the priority.\n stylingKey = collectStylingFromDirectives(null, tData, tNode, stylingKey, isClassBased);\n stylingKey = collectStylingFromTAttrs(stylingKey, tNode.attrs, isClassBased);\n // We know that if we have styling binding in template we can't have residual.\n residual = null;\n }\n } else {\n // We are in host binding node and there was no binding instruction in template node.\n // This means that we need to compute the residual.\n const directiveStylingLast = tNode.directiveStylingLast;\n const isFirstStylingInstructionInHostBinding = directiveStylingLast === -1 || tData[directiveStylingLast] !== hostDirectiveDef;\n if (isFirstStylingInstructionInHostBinding) {\n stylingKey = collectStylingFromDirectives(hostDirectiveDef, tData, tNode, stylingKey, isClassBased);\n if (residual === null) {\n // - If `null` than either:\n // - Template styling instruction already ran and it has consumed the static\n // styling into its `TStylingKey` and so there is no need to update residual. Instead\n // we need to update the `TStylingKey` associated with the first template node\n // instruction. OR\n // - Some other styling instruction ran and determined that there are no residuals\n let templateStylingKey = getTemplateHeadTStylingKey(tData, tNode, isClassBased);\n if (templateStylingKey !== undefined && Array.isArray(templateStylingKey)) {\n // Only recompute if `templateStylingKey` had static values. (If no static value found\n // then there is nothing to do since this operation can only produce less static keys, not\n // more.)\n templateStylingKey = collectStylingFromDirectives(null, tData, tNode, templateStylingKey[1] /* unwrap previous statics */, isClassBased);\n templateStylingKey = collectStylingFromTAttrs(templateStylingKey, tNode.attrs, isClassBased);\n setTemplateHeadTStylingKey(tData, tNode, isClassBased, templateStylingKey);\n }\n } else {\n // We only need to recompute residual if it is not `null`.\n // - If existing residual (implies there was no template styling). This means that some of\n // the statics may have moved from the residual to the `stylingKey` and so we have to\n // recompute.\n // - If `undefined` this is the first time we are running.\n residual = collectResidual(tData, tNode, isClassBased);\n }\n }\n }\n if (residual !== undefined) {\n isClassBased ? tNode.residualClasses = residual : tNode.residualStyles = residual;\n }\n return stylingKey;\n}\n/**\n * Retrieve the `TStylingKey` for the template styling instruction.\n *\n * This is needed since `hostBinding` styling instructions are inserted after the template\n * instruction. While the template instruction needs to update the residual in `TNode` the\n * `hostBinding` instructions need to update the `TStylingKey` of the template instruction because\n * the template instruction is downstream from the `hostBindings` instructions.\n *\n * @param tData `TData` where the linked list is stored.\n * @param tNode `TNode` for which the styling is being computed.\n * @param isClassBased `true` if `class` (`false` if `style`)\n * @return `TStylingKey` if found or `undefined` if not found.\n */\nfunction getTemplateHeadTStylingKey(tData, tNode, isClassBased) {\n const bindings = isClassBased ? tNode.classBindings : tNode.styleBindings;\n if (getTStylingRangeNext(bindings) === 0) {\n // There does not seem to be a styling instruction in the `template`.\n return undefined;\n }\n return tData[getTStylingRangePrev(bindings)];\n}\n/**\n * Update the `TStylingKey` of the first template instruction in `TNode`.\n *\n * Logically `hostBindings` styling instructions are of lower priority than that of the template.\n * However, they execute after the template styling instructions. This means that they get inserted\n * in front of the template styling instructions.\n *\n * If we have a template styling instruction and a new `hostBindings` styling instruction is\n * executed it means that it may need to steal static fields from the template instruction. This\n * method allows us to update the first template instruction `TStylingKey` with a new value.\n *\n * Assume:\n * ```angular-ts\n * <div my-dir style=\"color: red\" [style.color]=\"tmplExp\"></div>\n *\n * @Directive({\n * host: {\n * 'style': 'width: 100px',\n * '[style.color]': 'dirExp',\n * }\n * })\n * class MyDir {}\n * ```\n *\n * when `[style.color]=\"tmplExp\"` executes it creates this data structure.\n * ```ts\n * ['', 'color', 'color', 'red', 'width', '100px'],\n * ```\n *\n * The reason for this is that the template instruction does not know if there are styling\n * instructions and must assume that there are none and must collect all of the static styling.\n * (both\n * `color' and 'width`)\n *\n * When `'[style.color]': 'dirExp',` executes we need to insert a new data into the linked list.\n * ```ts\n * ['', 'color', 'width', '100px'], // newly inserted\n * ['', 'color', 'color', 'red', 'width', '100px'], // this is wrong\n * ```\n *\n * Notice that the template statics is now wrong as it incorrectly contains `width` so we need to\n * update it like so:\n * ```ts\n * ['', 'color', 'width', '100px'],\n * ['', 'color', 'color', 'red'], // UPDATE\n * ```\n *\n * @param tData `TData` where the linked list is stored.\n * @param tNode `TNode` for which the styling is being computed.\n * @param isClassBased `true` if `class` (`false` if `style`)\n * @param tStylingKey New `TStylingKey` which is replacing the old one.\n */\nfunction setTemplateHeadTStylingKey(tData, tNode, isClassBased, tStylingKey) {\n const bindings = isClassBased ? tNode.classBindings : tNode.styleBindings;\n ngDevMode && assertNotEqual(getTStylingRangeNext(bindings), 0, 'Expecting to have at least one template styling binding.');\n tData[getTStylingRangePrev(bindings)] = tStylingKey;\n}\n/**\n * Collect all static values after the current `TNode.directiveStylingLast` index.\n *\n * Collect the remaining styling information which has not yet been collected by an existing\n * styling instruction.\n *\n * @param tData `TData` where the `DirectiveDefs` are stored.\n * @param tNode `TNode` which contains the directive range.\n * @param isClassBased `true` if `class` (`false` if `style`)\n */\nfunction collectResidual(tData, tNode, isClassBased) {\n let residual = undefined;\n const directiveEnd = tNode.directiveEnd;\n ngDevMode && assertNotEqual(tNode.directiveStylingLast, -1, 'By the time this function gets called at least one hostBindings-node styling instruction must have executed.');\n // We add `1 + tNode.directiveStart` because we need to skip the current directive (as we are\n // collecting things after the last `hostBindings` directive which had a styling instruction.)\n for (let i = 1 + tNode.directiveStylingLast; i < directiveEnd; i++) {\n const attrs = tData[i].hostAttrs;\n residual = collectStylingFromTAttrs(residual, attrs, isClassBased);\n }\n return collectStylingFromTAttrs(residual, tNode.attrs, isClassBased);\n}\n/**\n * Collect the static styling information with lower priority than `hostDirectiveDef`.\n *\n * (This is opposite of residual styling.)\n *\n * @param hostDirectiveDef `DirectiveDef` for which we want to collect lower priority static\n * styling. (Or `null` if template styling)\n * @param tData `TData` where the linked list is stored.\n * @param tNode `TNode` for which the styling is being computed.\n * @param stylingKey Existing `TStylingKey` to update or wrap.\n * @param isClassBased `true` if `class` (`false` if `style`)\n */\nfunction collectStylingFromDirectives(hostDirectiveDef, tData, tNode, stylingKey, isClassBased) {\n // We need to loop because there can be directives which have `hostAttrs` but don't have\n // `hostBindings` so this loop catches up to the current directive..\n let currentDirective = null;\n const directiveEnd = tNode.directiveEnd;\n let directiveStylingLast = tNode.directiveStylingLast;\n if (directiveStylingLast === -1) {\n directiveStylingLast = tNode.directiveStart;\n } else {\n directiveStylingLast++;\n }\n while (directiveStylingLast < directiveEnd) {\n currentDirective = tData[directiveStylingLast];\n ngDevMode && assertDefined(currentDirective, 'expected to be defined');\n stylingKey = collectStylingFromTAttrs(stylingKey, currentDirective.hostAttrs, isClassBased);\n if (currentDirective === hostDirectiveDef) break;\n directiveStylingLast++;\n }\n if (hostDirectiveDef !== null) {\n // we only advance the styling cursor if we are collecting data from host bindings.\n // Template executes before host bindings and so if we would update the index,\n // host bindings would not get their statics.\n tNode.directiveStylingLast = directiveStylingLast;\n }\n return stylingKey;\n}\n/**\n * Convert `TAttrs` into `TStylingStatic`.\n *\n * @param stylingKey existing `TStylingKey` to update or wrap.\n * @param attrs `TAttributes` to process.\n * @param isClassBased `true` if `class` (`false` if `style`)\n */\nfunction collectStylingFromTAttrs(stylingKey, attrs, isClassBased) {\n const desiredMarker = isClassBased ? 1 /* AttributeMarker.Classes */ : 2 /* AttributeMarker.Styles */;\n let currentMarker = -1 /* AttributeMarker.ImplicitAttributes */;\n if (attrs !== null) {\n for (let i = 0; i < attrs.length; i++) {\n const item = attrs[i];\n if (typeof item === 'number') {\n currentMarker = item;\n } else {\n if (currentMarker === desiredMarker) {\n if (!Array.isArray(stylingKey)) {\n stylingKey = stylingKey === undefined ? [] : ['', stylingKey];\n }\n keyValueArraySet(stylingKey, item, isClassBased ? true : attrs[++i]);\n }\n }\n }\n }\n return stylingKey === undefined ? null : stylingKey;\n}\n/**\n * Convert user input to `KeyValueArray`.\n *\n * This function takes user input which could be `string`, Object literal, or iterable and converts\n * it into a consistent representation. The output of this is `KeyValueArray` (which is an array\n * where\n * even indexes contain keys and odd indexes contain values for those keys).\n *\n * The advantage of converting to `KeyValueArray` is that we can perform diff in an input\n * independent\n * way.\n * (ie we can compare `foo bar` to `['bar', 'baz'] and determine a set of changes which need to be\n * applied)\n *\n * The fact that `KeyValueArray` is sorted is very important because it allows us to compute the\n * difference in linear fashion without the need to allocate any additional data.\n *\n * For example if we kept this as a `Map` we would have to iterate over previous `Map` to determine\n * which values need to be deleted, over the new `Map` to determine additions, and we would have to\n * keep additional `Map` to keep track of duplicates or items which have not yet been visited.\n *\n * @param keyValueArraySet (See `keyValueArraySet` in \"util/array_utils\") Gets passed in as a\n * function so that `style` can be processed. This is done\n * for tree shaking purposes.\n * @param stringParser The parser is passed in so that it will be tree shakable. See\n * `styleStringParser` and `classStringParser`\n * @param value The value to parse/convert to `KeyValueArray`\n */\nfunction toStylingKeyValueArray(keyValueArraySet, stringParser, value) {\n if (value == null /*|| value === undefined */ || value === '') return EMPTY_ARRAY;\n const styleKeyValueArray = [];\n const unwrappedValue = unwrapSafeValue(value);\n if (Array.isArray(unwrappedValue)) {\n for (let i = 0; i < unwrappedValue.length; i++) {\n keyValueArraySet(styleKeyValueArray, unwrappedValue[i], true);\n }\n } else if (typeof unwrappedValue === 'object') {\n for (const key in unwrappedValue) {\n if (unwrappedValue.hasOwnProperty(key)) {\n keyValueArraySet(styleKeyValueArray, key, unwrappedValue[key]);\n }\n }\n } else if (typeof unwrappedValue === 'string') {\n stringParser(styleKeyValueArray, unwrappedValue);\n } else {\n ngDevMode && throwError('Unsupported styling type: ' + typeof unwrappedValue + ' (' + unwrappedValue + ')');\n }\n return styleKeyValueArray;\n}\n/**\n * Set a `value` for a `key`.\n *\n * See: `keyValueArraySet` for details\n *\n * @param keyValueArray KeyValueArray to add to.\n * @param key Style key to add.\n * @param value The value to set.\n */\nfunction styleKeyValueArraySet(keyValueArray, key, value) {\n keyValueArraySet(keyValueArray, key, unwrapSafeValue(value));\n}\n/**\n * Class-binding-specific function for setting the `value` for a `key`.\n *\n * See: `keyValueArraySet` for details\n *\n * @param keyValueArray KeyValueArray to add to.\n * @param key Style key to add.\n * @param value The value to set.\n */\nfunction classKeyValueArraySet(keyValueArray, key, value) {\n // We use `classList.add` to eventually add the CSS classes to the DOM node. Any value passed into\n // `add` is stringified and added to the `class` attribute, e.g. even null, undefined or numbers\n // will be added. Stringify the key here so that our internal data structure matches the value in\n // the DOM. The only exceptions are empty strings and strings that contain spaces for which\n // the browser throws an error. We ignore such values, because the error is somewhat cryptic.\n const stringKey = String(key);\n if (stringKey !== '' && !stringKey.includes(' ')) {\n keyValueArraySet(keyValueArray, stringKey, value);\n }\n}\n/**\n * Update map based styling.\n *\n * Map based styling could be anything which contains more than one binding. For example `string`,\n * or object literal. Dealing with all of these types would complicate the logic so\n * instead this function expects that the complex input is first converted into normalized\n * `KeyValueArray`. The advantage of normalization is that we get the values sorted, which makes it\n * very cheap to compute deltas between the previous and current value.\n *\n * @param tView Associated `TView.data` contains the linked list of binding priorities.\n * @param tNode `TNode` where the binding is located.\n * @param lView `LView` contains the values associated with other styling binding at this `TNode`.\n * @param renderer Renderer to use if any updates.\n * @param oldKeyValueArray Previous value represented as `KeyValueArray`\n * @param newKeyValueArray Current value represented as `KeyValueArray`\n * @param isClassBased `true` if `class` (`false` if `style`)\n * @param bindingIndex Binding index of the binding.\n */\nfunction updateStylingMap(tView, tNode, lView, renderer, oldKeyValueArray, newKeyValueArray, isClassBased, bindingIndex) {\n if (oldKeyValueArray === NO_CHANGE) {\n // On first execution the oldKeyValueArray is NO_CHANGE => treat it as empty KeyValueArray.\n oldKeyValueArray = EMPTY_ARRAY;\n }\n let oldIndex = 0;\n let newIndex = 0;\n let oldKey = 0 < oldKeyValueArray.length ? oldKeyValueArray[0] : null;\n let newKey = 0 < newKeyValueArray.length ? newKeyValueArray[0] : null;\n while (oldKey !== null || newKey !== null) {\n ngDevMode && assertLessThan(oldIndex, 999, 'Are we stuck in infinite loop?');\n ngDevMode && assertLessThan(newIndex, 999, 'Are we stuck in infinite loop?');\n const oldValue = oldIndex < oldKeyValueArray.length ? oldKeyValueArray[oldIndex + 1] : undefined;\n const newValue = newIndex < newKeyValueArray.length ? newKeyValueArray[newIndex + 1] : undefined;\n let setKey = null;\n let setValue = undefined;\n if (oldKey === newKey) {\n // UPDATE: Keys are equal => new value is overwriting old value.\n oldIndex += 2;\n newIndex += 2;\n if (oldValue !== newValue) {\n setKey = newKey;\n setValue = newValue;\n }\n } else if (newKey === null || oldKey !== null && oldKey < newKey) {\n // DELETE: oldKey key is missing or we did not find the oldKey in the newValue\n // (because the keyValueArray is sorted and `newKey` is found later alphabetically).\n // `\"background\" < \"color\"` so we need to delete `\"background\"` because it is not found in the\n // new array.\n oldIndex += 2;\n setKey = oldKey;\n } else {\n // CREATE: newKey's is earlier alphabetically than oldKey's (or no oldKey) => we have new key.\n // `\"color\" > \"background\"` so we need to add `color` because it is in new array but not in\n // old array.\n ngDevMode && assertDefined(newKey, 'Expecting to have a valid key');\n newIndex += 2;\n setKey = newKey;\n setValue = newValue;\n }\n if (setKey !== null) {\n updateStyling(tView, tNode, lView, renderer, setKey, setValue, isClassBased, bindingIndex);\n }\n oldKey = oldIndex < oldKeyValueArray.length ? oldKeyValueArray[oldIndex] : null;\n newKey = newIndex < newKeyValueArray.length ? newKeyValueArray[newIndex] : null;\n }\n}\n/**\n * Update a simple (property name) styling.\n *\n * This function takes `prop` and updates the DOM to that value. The function takes the binding\n * value as well as binding priority into consideration to determine which value should be written\n * to DOM. (For example it may be determined that there is a higher priority overwrite which blocks\n * the DOM write, or if the value goes to `undefined` a lower priority overwrite may be consulted.)\n *\n * @param tView Associated `TView.data` contains the linked list of binding priorities.\n * @param tNode `TNode` where the binding is located.\n * @param lView `LView` contains the values associated with other styling binding at this `TNode`.\n * @param renderer Renderer to use if any updates.\n * @param prop Either style property name or a class name.\n * @param value Either style value for `prop` or `true`/`false` if `prop` is class.\n * @param isClassBased `true` if `class` (`false` if `style`)\n * @param bindingIndex Binding index of the binding.\n */\nfunction updateStyling(tView, tNode, lView, renderer, prop, value, isClassBased, bindingIndex) {\n if (!(tNode.type & 3 /* TNodeType.AnyRNode */)) {\n // It is possible to have styling on non-elements (such as ng-container).\n // This is rare, but it does happen. In such a case, just ignore the binding.\n return;\n }\n const tData = tView.data;\n const tRange = tData[bindingIndex + 1];\n const higherPriorityValue = getTStylingRangeNextDuplicate(tRange) ? findStylingValue(tData, tNode, lView, prop, getTStylingRangeNext(tRange), isClassBased) : undefined;\n if (!isStylingValuePresent(higherPriorityValue)) {\n // We don't have a next duplicate, or we did not find a duplicate value.\n if (!isStylingValuePresent(value)) {\n // We should delete current value or restore to lower priority value.\n if (getTStylingRangePrevDuplicate(tRange)) {\n // We have a possible prev duplicate, let's retrieve it.\n value = findStylingValue(tData, null, lView, prop, bindingIndex, isClassBased);\n }\n }\n const rNode = getNativeByIndex(getSelectedIndex(), lView);\n applyStyling(renderer, isClassBased, rNode, prop, value);\n }\n}\n/**\n * Search for styling value with higher priority which is overwriting current value, or a\n * value of lower priority to which we should fall back if the value is `undefined`.\n *\n * When value is being applied at a location, related values need to be consulted.\n * - If there is a higher priority binding, we should be using that one instead.\n * For example `<div [style]=\"{color:exp1}\" [style.color]=\"exp2\">` change to `exp1`\n * requires that we check `exp2` to see if it is set to value other than `undefined`.\n * - If there is a lower priority binding and we are changing to `undefined`\n * For example `<div [style]=\"{color:exp1}\" [style.color]=\"exp2\">` change to `exp2` to\n * `undefined` requires that we check `exp1` (and static values) and use that as new value.\n *\n * NOTE: The styling stores two values.\n * 1. The raw value which came from the application is stored at `index + 0` location. (This value\n * is used for dirty checking).\n * 2. The normalized value is stored at `index + 1`.\n *\n * @param tData `TData` used for traversing the priority.\n * @param tNode `TNode` to use for resolving static styling. Also controls search direction.\n * - `TNode` search next and quit as soon as `isStylingValuePresent(value)` is true.\n * If no value found consult `tNode.residualStyle`/`tNode.residualClass` for default value.\n * - `null` search prev and go all the way to end. Return last value where\n * `isStylingValuePresent(value)` is true.\n * @param lView `LView` used for retrieving the actual values.\n * @param prop Property which we are interested in.\n * @param index Starting index in the linked list of styling bindings where the search should start.\n * @param isClassBased `true` if `class` (`false` if `style`)\n */\nfunction findStylingValue(tData, tNode, lView, prop, index, isClassBased) {\n // `TNode` to use for resolving static styling. Also controls search direction.\n // - `TNode` search next and quit as soon as `isStylingValuePresent(value)` is true.\n // If no value found consult `tNode.residualStyle`/`tNode.residualClass` for default value.\n // - `null` search prev and go all the way to end. Return last value where\n // `isStylingValuePresent(value)` is true.\n const isPrevDirection = tNode === null;\n let value = undefined;\n while (index > 0) {\n const rawKey = tData[index];\n const containsStatics = Array.isArray(rawKey);\n // Unwrap the key if we contain static values.\n const key = containsStatics ? rawKey[1] : rawKey;\n const isStylingMap = key === null;\n let valueAtLViewIndex = lView[index + 1];\n if (valueAtLViewIndex === NO_CHANGE) {\n // In firstUpdatePass the styling instructions create a linked list of styling.\n // On subsequent passes it is possible for a styling instruction to try to read a binding\n // which\n // has not yet executed. In that case we will find `NO_CHANGE` and we should assume that\n // we have `undefined` (or empty array in case of styling-map instruction) instead. This\n // allows the resolution to apply the value (which may later be overwritten when the\n // binding actually executes.)\n valueAtLViewIndex = isStylingMap ? EMPTY_ARRAY : undefined;\n }\n let currentValue = isStylingMap ? keyValueArrayGet(valueAtLViewIndex, prop) : key === prop ? valueAtLViewIndex : undefined;\n if (containsStatics && !isStylingValuePresent(currentValue)) {\n currentValue = keyValueArrayGet(rawKey, prop);\n }\n if (isStylingValuePresent(currentValue)) {\n value = currentValue;\n if (isPrevDirection) {\n return value;\n }\n }\n const tRange = tData[index + 1];\n index = isPrevDirection ? getTStylingRangePrev(tRange) : getTStylingRangeNext(tRange);\n }\n if (tNode !== null) {\n // in case where we are going in next direction AND we did not find anything, we need to\n // consult residual styling\n let residual = isClassBased ? tNode.residualClasses : tNode.residualStyles;\n if (residual != null /** OR residual !=== undefined */) {\n value = keyValueArrayGet(residual, prop);\n }\n }\n return value;\n}\n/**\n * Determines if the binding value should be used (or if the value is 'undefined' and hence priority\n * resolution should be used.)\n *\n * @param value Binding style value.\n */\nfunction isStylingValuePresent(value) {\n // Currently only `undefined` value is considered non-binding. That is `undefined` says I don't\n // have an opinion as to what this binding should be and you should consult other bindings by\n // priority to determine the valid value.\n // This is extracted into a single function so that we have a single place to control this.\n return value !== undefined;\n}\n/**\n * Normalizes and/or adds a suffix to the value.\n *\n * If value is `null`/`undefined` no suffix is added\n * @param value\n * @param suffix\n */\nfunction normalizeSuffix(value, suffix) {\n if (value == null || value === '') ;else if (typeof suffix === 'string') {\n value = value + suffix;\n } else if (typeof value === 'object') {\n value = stringify(unwrapSafeValue(value));\n }\n return value;\n}\n/**\n * Tests if the `TNode` has input shadow.\n *\n * An input shadow is when a directive steals (shadows) the input by using `@Input('style')` or\n * `@Input('class')` as input.\n *\n * @param tNode `TNode` which we would like to see if it has shadow.\n * @param isClassBased `true` if `class` (`false` if `style`)\n */\nfunction hasStylingInputShadow(tNode, isClassBased) {\n return (tNode.flags & (isClassBased ? 8 /* TNodeFlags.hasClassInput */ : 16 /* TNodeFlags.hasStyleInput */)) !== 0;\n}\n\n/**\n * Create static text node\n *\n * @param index Index of the node in the data array\n * @param value Static string value to write.\n *\n * @codeGenApi\n */\nfunction ɵɵtext(index, value = '') {\n const lView = getLView();\n const tView = getTView();\n const adjustedIndex = index + HEADER_OFFSET;\n ngDevMode && assertTNodeCreationIndex(lView, index);\n const tNode = tView.firstCreatePass ? getOrCreateTNode(tView, adjustedIndex, 1 /* TNodeType.Text */, value, null) : tView.data[adjustedIndex];\n const textNative = _locateOrCreateTextNode(tView, lView, tNode, value, index);\n lView[adjustedIndex] = textNative;\n if (wasLastNodeCreated()) {\n appendChild(tView, lView, textNative, tNode);\n }\n // Text nodes are self closing.\n setCurrentTNode(tNode, false);\n}\nlet _locateOrCreateTextNode = (tView, lView, tNode, value, index) => {\n lastNodeWasCreated(true);\n return createTextNode(lView[RENDERER], value);\n};\n/**\n * Enables hydration code path (to lookup existing elements in DOM)\n * in addition to the regular creation mode of text nodes.\n */\nfunction locateOrCreateTextNodeImpl(tView, lView, tNode, value, index) {\n const isNodeCreationMode = !canHydrateNode(lView, tNode);\n lastNodeWasCreated(isNodeCreationMode);\n // Regular creation mode.\n if (isNodeCreationMode) {\n return createTextNode(lView[RENDERER], value);\n }\n // Hydration mode, looking up an existing element in DOM.\n const hydrationInfo = lView[HYDRATION];\n const textNative = locateNextRNode(hydrationInfo, tView, lView, tNode);\n ngDevMode && validateMatchingNode(textNative, Node.TEXT_NODE, null, lView, tNode);\n ngDevMode && markRNodeAsClaimedByHydration(textNative);\n return textNative;\n}\nfunction enableLocateOrCreateTextNodeImpl() {\n _locateOrCreateTextNode = locateOrCreateTextNodeImpl;\n}\n\n/**\n * Create interpolation bindings with a variable number of expressions.\n *\n * If there are 1 to 8 expressions `interpolation1()` to `interpolation8()` should be used instead.\n * Those are faster because there is no need to create an array of expressions and iterate over it.\n *\n * `values`:\n * - has static text at even indexes,\n * - has evaluated expressions at odd indexes.\n *\n * Returns the concatenated string when any of the arguments changes, `NO_CHANGE` otherwise.\n */\nfunction interpolationV(lView, values) {\n ngDevMode && assertLessThan(2, values.length, 'should have at least 3 values');\n let isBindingUpdated = false;\n let bindingIndex = getBindingIndex();\n for (let i = 1; i < values.length; i += 2) {\n // Check if bindings (odd indexes) have changed\n isBindingUpdated = bindingUpdated(lView, bindingIndex++, values[i]) || isBindingUpdated;\n }\n setBindingIndex(bindingIndex);\n if (!isBindingUpdated) {\n return NO_CHANGE;\n }\n // Build the updated content\n let content = values[0];\n for (let i = 1; i < values.length; i += 2) {\n // The condition is to prevent an out-of-bound read\n content += renderStringify(values[i]) + (i + 1 !== values.length ? values[i + 1] : '');\n }\n return content;\n}\n/**\n * Creates an interpolation binding with 1 expression.\n *\n * @param prefix static value used for concatenation only.\n * @param v0 value checked for change.\n * @param suffix static value used for concatenation only.\n */\nfunction interpolation1(lView, prefix, v0, suffix = '') {\n const different = bindingUpdated(lView, nextBindingIndex(), v0);\n return different ? prefix + renderStringify(v0) + suffix : NO_CHANGE;\n}\n/**\n * Creates an interpolation binding with 2 expressions.\n */\nfunction interpolation2(lView, prefix, v0, i0, v1, suffix = '') {\n const bindingIndex = getBindingIndex();\n const different = bindingUpdated2(lView, bindingIndex, v0, v1);\n incrementBindingIndex(2);\n return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + suffix : NO_CHANGE;\n}\n/**\n * Creates an interpolation binding with 3 expressions.\n */\nfunction interpolation3(lView, prefix, v0, i0, v1, i1, v2, suffix = '') {\n const bindingIndex = getBindingIndex();\n const different = bindingUpdated3(lView, bindingIndex, v0, v1, v2);\n incrementBindingIndex(3);\n return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 + renderStringify(v2) + suffix : NO_CHANGE;\n}\n/**\n * Create an interpolation binding with 4 expressions.\n */\nfunction interpolation4(lView, prefix, v0, i0, v1, i1, v2, i2, v3, suffix = '') {\n const bindingIndex = getBindingIndex();\n const different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);\n incrementBindingIndex(4);\n return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 + renderStringify(v2) + i2 + renderStringify(v3) + suffix : NO_CHANGE;\n}\n/**\n * Creates an interpolation binding with 5 expressions.\n */\nfunction interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix = '') {\n const bindingIndex = getBindingIndex();\n let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);\n different = bindingUpdated(lView, bindingIndex + 4, v4) || different;\n incrementBindingIndex(5);\n return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 + renderStringify(v2) + i2 + renderStringify(v3) + i3 + renderStringify(v4) + suffix : NO_CHANGE;\n}\n/**\n * Creates an interpolation binding with 6 expressions.\n */\nfunction interpolation6(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix = '') {\n const bindingIndex = getBindingIndex();\n let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);\n different = bindingUpdated2(lView, bindingIndex + 4, v4, v5) || different;\n incrementBindingIndex(6);\n return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 + renderStringify(v2) + i2 + renderStringify(v3) + i3 + renderStringify(v4) + i4 + renderStringify(v5) + suffix : NO_CHANGE;\n}\n/**\n * Creates an interpolation binding with 7 expressions.\n */\nfunction interpolation7(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix = '') {\n const bindingIndex = getBindingIndex();\n let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);\n different = bindingUpdated3(lView, bindingIndex + 4, v4, v5, v6) || different;\n incrementBindingIndex(7);\n return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 + renderStringify(v2) + i2 + renderStringify(v3) + i3 + renderStringify(v4) + i4 + renderStringify(v5) + i5 + renderStringify(v6) + suffix : NO_CHANGE;\n}\n/**\n * Creates an interpolation binding with 8 expressions.\n */\nfunction interpolation8(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix = '') {\n const bindingIndex = getBindingIndex();\n let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);\n different = bindingUpdated4(lView, bindingIndex + 4, v4, v5, v6, v7) || different;\n incrementBindingIndex(8);\n return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 + renderStringify(v2) + i2 + renderStringify(v3) + i3 + renderStringify(v4) + i4 + renderStringify(v5) + i5 + renderStringify(v6) + i6 + renderStringify(v7) + suffix : NO_CHANGE;\n}\n\n/**\n *\n * Update text content with a lone bound value\n *\n * Used when a text node has 1 interpolated value in it, an no additional text\n * surrounds that interpolated value:\n *\n * ```html\n * <div>{{v0}}</div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵtextInterpolate(v0);\n * ```\n * @returns itself, so that it may be chained.\n * @see textInterpolateV\n * @codeGenApi\n */\nfunction ɵɵtextInterpolate(v0) {\n ɵɵtextInterpolate1('', v0);\n return ɵɵtextInterpolate;\n}\n/**\n *\n * Update text content with single bound value surrounded by other text.\n *\n * Used when a text node has 1 interpolated value in it:\n *\n * ```html\n * <div>prefix{{v0}}suffix</div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵtextInterpolate1('prefix', v0, 'suffix');\n * ```\n * @returns itself, so that it may be chained.\n * @see textInterpolateV\n * @codeGenApi\n */\nfunction ɵɵtextInterpolate1(prefix, v0, suffix) {\n const lView = getLView();\n const interpolated = interpolation1(lView, prefix, v0, suffix);\n if (interpolated !== NO_CHANGE) {\n textBindingInternal(lView, getSelectedIndex(), interpolated);\n }\n return ɵɵtextInterpolate1;\n}\n/**\n *\n * Update text content with 2 bound values surrounded by other text.\n *\n * Used when a text node has 2 interpolated values in it:\n *\n * ```html\n * <div>prefix{{v0}}-{{v1}}suffix</div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵtextInterpolate2('prefix', v0, '-', v1, 'suffix');\n * ```\n * @returns itself, so that it may be chained.\n * @see textInterpolateV\n * @codeGenApi\n */\nfunction ɵɵtextInterpolate2(prefix, v0, i0, v1, suffix) {\n const lView = getLView();\n const interpolated = interpolation2(lView, prefix, v0, i0, v1, suffix);\n if (interpolated !== NO_CHANGE) {\n textBindingInternal(lView, getSelectedIndex(), interpolated);\n }\n return ɵɵtextInterpolate2;\n}\n/**\n *\n * Update text content with 3 bound values surrounded by other text.\n *\n * Used when a text node has 3 interpolated values in it:\n *\n * ```html\n * <div>prefix{{v0}}-{{v1}}-{{v2}}suffix</div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵtextInterpolate3(\n * 'prefix', v0, '-', v1, '-', v2, 'suffix');\n * ```\n * @returns itself, so that it may be chained.\n * @see textInterpolateV\n * @codeGenApi\n */\nfunction ɵɵtextInterpolate3(prefix, v0, i0, v1, i1, v2, suffix) {\n const lView = getLView();\n const interpolated = interpolation3(lView, prefix, v0, i0, v1, i1, v2, suffix);\n if (interpolated !== NO_CHANGE) {\n textBindingInternal(lView, getSelectedIndex(), interpolated);\n }\n return ɵɵtextInterpolate3;\n}\n/**\n *\n * Update text content with 4 bound values surrounded by other text.\n *\n * Used when a text node has 4 interpolated values in it:\n *\n * ```html\n * <div>prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}suffix</div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵtextInterpolate4(\n * 'prefix', v0, '-', v1, '-', v2, '-', v3, 'suffix');\n * ```\n * @returns itself, so that it may be chained.\n * @see ɵɵtextInterpolateV\n * @codeGenApi\n */\nfunction ɵɵtextInterpolate4(prefix, v0, i0, v1, i1, v2, i2, v3, suffix) {\n const lView = getLView();\n const interpolated = interpolation4(lView, prefix, v0, i0, v1, i1, v2, i2, v3, suffix);\n if (interpolated !== NO_CHANGE) {\n textBindingInternal(lView, getSelectedIndex(), interpolated);\n }\n return ɵɵtextInterpolate4;\n}\n/**\n *\n * Update text content with 5 bound values surrounded by other text.\n *\n * Used when a text node has 5 interpolated values in it:\n *\n * ```html\n * <div>prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}suffix</div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵtextInterpolate5(\n * 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, 'suffix');\n * ```\n * @returns itself, so that it may be chained.\n * @see textInterpolateV\n * @codeGenApi\n */\nfunction ɵɵtextInterpolate5(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix) {\n const lView = getLView();\n const interpolated = interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix);\n if (interpolated !== NO_CHANGE) {\n textBindingInternal(lView, getSelectedIndex(), interpolated);\n }\n return ɵɵtextInterpolate5;\n}\n/**\n *\n * Update text content with 6 bound values surrounded by other text.\n *\n * Used when a text node has 6 interpolated values in it:\n *\n * ```html\n * <div>prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}suffix</div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵtextInterpolate6(\n * 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, 'suffix');\n * ```\n *\n * @param i4 Static value used for concatenation only.\n * @param v5 Value checked for change. @returns itself, so that it may be chained.\n * @see textInterpolateV\n * @codeGenApi\n */\nfunction ɵɵtextInterpolate6(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix) {\n const lView = getLView();\n const interpolated = interpolation6(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix);\n if (interpolated !== NO_CHANGE) {\n textBindingInternal(lView, getSelectedIndex(), interpolated);\n }\n return ɵɵtextInterpolate6;\n}\n/**\n *\n * Update text content with 7 bound values surrounded by other text.\n *\n * Used when a text node has 7 interpolated values in it:\n *\n * ```html\n * <div>prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}suffix</div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵtextInterpolate7(\n * 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, 'suffix');\n * ```\n * @returns itself, so that it may be chained.\n * @see textInterpolateV\n * @codeGenApi\n */\nfunction ɵɵtextInterpolate7(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix) {\n const lView = getLView();\n const interpolated = interpolation7(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix);\n if (interpolated !== NO_CHANGE) {\n textBindingInternal(lView, getSelectedIndex(), interpolated);\n }\n return ɵɵtextInterpolate7;\n}\n/**\n *\n * Update text content with 8 bound values surrounded by other text.\n *\n * Used when a text node has 8 interpolated values in it:\n *\n * ```html\n * <div>prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}suffix</div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵtextInterpolate8(\n * 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, 'suffix');\n * ```\n * @returns itself, so that it may be chained.\n * @see textInterpolateV\n * @codeGenApi\n */\nfunction ɵɵtextInterpolate8(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix) {\n const lView = getLView();\n const interpolated = interpolation8(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix);\n if (interpolated !== NO_CHANGE) {\n textBindingInternal(lView, getSelectedIndex(), interpolated);\n }\n return ɵɵtextInterpolate8;\n}\n/**\n * Update text content with 9 or more bound values other surrounded by text.\n *\n * Used when the number of interpolated values exceeds 8.\n *\n * ```html\n * <div>prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}-{{v8}}-{{v9}}suffix</div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵtextInterpolateV(\n * ['prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, '-', v9,\n * 'suffix']);\n * ```\n *.\n * @param values The collection of values and the strings in between those values, beginning with\n * a string prefix and ending with a string suffix.\n * (e.g. `['prefix', value0, '-', value1, '-', value2, ..., value99, 'suffix']`)\n *\n * @returns itself, so that it may be chained.\n * @codeGenApi\n */\nfunction ɵɵtextInterpolateV(values) {\n const lView = getLView();\n const interpolated = interpolationV(lView, values);\n if (interpolated !== NO_CHANGE) {\n textBindingInternal(lView, getSelectedIndex(), interpolated);\n }\n return ɵɵtextInterpolateV;\n}\n/**\n * Updates a text binding at a given index in a given LView.\n */\nfunction textBindingInternal(lView, index, value) {\n ngDevMode && assertString(value, 'Value should be a string');\n ngDevMode && assertNotSame(value, NO_CHANGE, 'value should not be NO_CHANGE');\n ngDevMode && assertIndexInRange(lView, index);\n const element = getNativeByIndex(index, lView);\n ngDevMode && assertDefined(element, 'native element should exist');\n updateTextNode(lView[RENDERER], element, value);\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/**\n * Update a two-way bound property on a selected element.\n *\n * Operates on the element selected by index via the {@link select} instruction.\n *\n * @param propName Name of property.\n * @param value New value to write.\n * @param sanitizer An optional function used to sanitize the value.\n * @returns This function returns itself so that it may be chained\n * (e.g. `twoWayProperty('name', ctx.name)('title', ctx.title)`)\n *\n * @codeGenApi\n */\nfunction ɵɵtwoWayProperty(propName, value, sanitizer) {\n // TODO(crisbeto): perf impact of re-evaluating this on each change detection?\n if (isWritableSignal(value)) {\n value = value();\n }\n const lView = getLView();\n const bindingIndex = nextBindingIndex();\n if (bindingUpdated(lView, bindingIndex, value)) {\n const tView = getTView();\n const tNode = getSelectedTNode();\n setPropertyAndInputs(tNode, lView, propName, value, lView[RENDERER], sanitizer);\n ngDevMode && storePropertyBindingMetadata(tView.data, tNode, propName, bindingIndex);\n }\n return ɵɵtwoWayProperty;\n}\n/**\n * Function used inside two-way listeners to conditionally set the value of the bound expression.\n *\n * @param target Field on which to set the value.\n * @param value Value to be set to the field.\n *\n * @codeGenApi\n */\nfunction ɵɵtwoWayBindingSet(target, value) {\n const canWrite = isWritableSignal(target);\n canWrite && target.set(value);\n return canWrite;\n}\n/**\n * Adds an event listener that updates a two-way binding to the current node.\n *\n * @param eventName Name of the event.\n * @param listenerFn The function to be called when event emits.\n *\n * @codeGenApi\n */\nfunction ɵɵtwoWayListener(eventName, listenerFn) {\n const lView = getLView();\n const tView = getTView();\n const tNode = getCurrentTNode();\n listenerInternal(tView, lView, lView[RENDERER], tNode, eventName, listenerFn);\n return ɵɵtwoWayListener;\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/** Object that indicates the value of a `@let` declaration that hasn't been initialized yet. */\nconst UNINITIALIZED_LET = {};\n/**\n * Declares an `@let` at a specific data slot. Returns itself to allow chaining.\n *\n * @param index Index at which to declare the `@let`.\n *\n * @codeGenApi\n */\nfunction ɵɵdeclareLet(index) {\n const tView = getTView();\n const lView = getLView();\n const adjustedIndex = index + HEADER_OFFSET;\n const tNode = getOrCreateTNode(tView, adjustedIndex, 128 /* TNodeType.LetDeclaration */, null, null);\n setCurrentTNode(tNode, false);\n store(tView, lView, adjustedIndex, UNINITIALIZED_LET);\n return ɵɵdeclareLet;\n}\n/**\n * Instruction that stores the value of a `@let` declaration on the current view.\n * Returns the value to allow usage inside variable initializers.\n *\n * @codeGenApi\n */\nfunction ɵɵstoreLet(value) {\n performanceMarkFeature('NgLet');\n const tView = getTView();\n const lView = getLView();\n const index = getSelectedIndex();\n store(tView, lView, index, value);\n return value;\n}\n/**\n * Retrieves the value of a `@let` declaration defined in a parent view.\n *\n * @param index Index of the declaration within the view.\n *\n * @codeGenApi\n */\nfunction ɵɵreadContextLet(index) {\n const contextLView = getContextLView();\n const value = load(contextLView, HEADER_OFFSET + index);\n if (value === UNINITIALIZED_LET) {\n throw new RuntimeError(314 /* RuntimeErrorCode.UNINITIALIZED_LET_ACCESS */, ngDevMode && 'Attempting to access a @let declaration whose value is not available yet');\n }\n return value;\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/**\n * Sets the location within the source template at which\n * each element in the current view was defined.\n *\n * @param index Index at which the DOM node was created.\n * @param templatePath Path to the template at which the node was defined.\n * @param locations Element locations to which to attach the source location.\n *\n * @codeGenApi\n */\nfunction ɵɵattachSourceLocations(templatePath, locations) {\n const tView = getTView();\n const lView = getLView();\n const renderer = lView[RENDERER];\n const attributeName = 'data-ng-source-location';\n for (const [index, offset, line, column] of locations) {\n const tNode = getTNode(tView, index + HEADER_OFFSET);\n // The compiler shouldn't generate the instruction for non-element nodes, but assert just in case.\n ngDevMode && assertTNodeType(tNode, 2 /* TNodeType.Element */);\n const node = getNativeByIndex(index + HEADER_OFFSET, lView);\n // Set the attribute directly in the DOM so it doesn't participate in directive matching.\n if (!node.hasAttribute(attributeName)) {\n const attributeValue = `${templatePath}@o:${offset},l:${line},c:${column}`;\n renderer.setAttribute(node, attributeName, attributeValue);\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.dev/license\n */\n/**\n * Interpolate a value with a single bound value and no prefixes or suffixes.\n *\n * @param v0 Value checked for change.\n * @returns Interpolated string or NO_CHANGE if none of the bound values have changed.\n * @codeGenApi\n */\nfunction ɵɵinterpolate(v0) {\n // Avoid calling into the `interpolate` functions since\n // we know that we don't have a prefix or suffix.\n return bindingUpdated(getLView(), nextBindingIndex(), v0) ? renderStringify(v0) : NO_CHANGE;\n}\n/**\n * Interpolate a value with a single bound value.\n *\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @returns Interpolated string or NO_CHANGE if none of the bound values have changed.\n * @codeGenApi\n */\nfunction ɵɵinterpolate1(prefix, v0, suffix = '') {\n return interpolation1(getLView(), prefix, v0, suffix);\n}\n/**\n * Interpolate a value with two bound values.\n *\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @returns Interpolated string or NO_CHANGE if none of the bound values have changed.\n * @codeGenApi\n */\nfunction ɵɵinterpolate2(prefix, v0, i0, v1, suffix = '') {\n return interpolation2(getLView(), prefix, v0, i0, v1, suffix);\n}\n/**\n * Interpolate a value with three bound values.\n *\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @returns Interpolated string or NO_CHANGE if none of the bound values have changed.\n * @codeGenApi\n */\nfunction ɵɵinterpolate3(prefix, v0, i0, v1, i1, v2, suffix = '') {\n return interpolation3(getLView(), prefix, v0, i0, v1, i1, v2, suffix);\n}\n/**\n * Interpolate a value with four bound values.\n *\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param i2 Static value used for concatenation only.\n * @param v3 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @returns Interpolated string or NO_CHANGE if none of the bound values have changed.\n * @codeGenApi\n */\nfunction ɵɵinterpolate4(prefix, v0, i0, v1, i1, v2, i2, v3, suffix = '') {\n return interpolation4(getLView(), prefix, v0, i0, v1, i1, v2, i2, v3, suffix);\n}\n/**\n * Interpolate a value with five bound values.\n *\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param i2 Static value used for concatenation only.\n * @param v3 Value checked for change.\n * @param i3 Static value used for concatenation only.\n * @param v4 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @returns Interpolated string or NO_CHANGE if none of the bound values have changed.\n * @codeGenApi\n */\nfunction ɵɵinterpolate5(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix = '') {\n return interpolation5(getLView(), prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix);\n}\n/**\n * Interpolate a value with six bound values.\n *\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param i2 Static value used for concatenation only.\n * @param v3 Value checked for change.\n * @param i3 Static value used for concatenation only.\n * @param v4 Value checked for change.\n * @param i4 Static value used for concatenation only.\n * @param v5 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @returns Interpolated string or NO_CHANGE if none of the bound values have changed.\n * @codeGenApi\n */\nfunction ɵɵinterpolate6(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix = '') {\n return interpolation6(getLView(), prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix);\n}\n/**\n * Interpolate a value with seven bound values.\n *\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param i2 Static value used for concatenation only.\n * @param v3 Value checked for change.\n * @param i3 Static value used for concatenation only.\n * @param v4 Value checked for change.\n * @param i4 Static value used for concatenation only.\n * @param v5 Value checked for change.\n * @param i5 Static value used for concatenation only.\n * @param v6 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @returns Interpolated string or NO_CHANGE if none of the bound values have changed.\n * @codeGenApi\n */\nfunction ɵɵinterpolate7(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix = '') {\n return interpolation7(getLView(), prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix);\n}\n/**\n * Interpolate a value with eight bound values.\n *\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param i2 Static value used for concatenation only.\n * @param v3 Value checked for change.\n * @param i3 Static value used for concatenation only.\n * @param v4 Value checked for change.\n * @param i4 Static value used for concatenation only.\n * @param v5 Value checked for change.\n * @param i5 Static value used for concatenation only.\n * @param v6 Value checked for change.\n * @param i6 Static value used for concatenation only.\n * @param v7 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @returns Interpolated string or NO_CHANGE if none of the bound values have changed.\n * @codeGenApi\n */\nfunction ɵɵinterpolate8(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix = '') {\n return interpolation8(getLView(), prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix);\n}\n/**\n * Interpolate a value with nine or more bound values.\n *\n * @param values The collection of values and the strings in-between those values, beginning with\n * a string prefix and ending with a string suffix.\n * (e.g. `['prefix', value0, '-', value1, '-', value2, ..., value99, 'suffix']`)\n * @returns Interpolated string or NO_CHANGE if none of the bound values have changed.\n * @codeGenApi\n */\nfunction ɵɵinterpolateV(values) {\n return interpolationV(getLView(), values);\n}\n\n/**\n * Resolves the providers which are defined in the DirectiveDef.\n *\n * When inserting the tokens and the factories in their respective arrays, we can assume that\n * this method is called first for the component (if any), and then for other directives on the same\n * node.\n * As a consequence,the providers are always processed in that order:\n * 1) The view providers of the component\n * 2) The providers of the component\n * 3) The providers of the other directives\n * This matches the structure of the injectables arrays of a view (for each node).\n * So the tokens and the factories can be pushed at the end of the arrays, except\n * in one case for multi providers.\n *\n * @param def the directive definition\n * @param providers: Array of `providers`.\n * @param viewProviders: Array of `viewProviders`.\n */\nfunction providersResolver(def, providers, viewProviders) {\n const tView = getTView();\n if (tView.firstCreatePass) {\n const isComponent = isComponentDef(def);\n // The list of view providers is processed first, and the flags are updated\n resolveProvider(viewProviders, tView.data, tView.blueprint, isComponent, true);\n // Then, the list of providers is processed, and the flags are updated\n resolveProvider(providers, tView.data, tView.blueprint, isComponent, false);\n }\n}\n/**\n * Resolves a provider and publishes it to the DI system.\n */\nfunction resolveProvider(provider, tInjectables, lInjectablesBlueprint, isComponent, isViewProvider) {\n provider = resolveForwardRef(provider);\n if (Array.isArray(provider)) {\n // Recursively call `resolveProvider`\n // Recursion is OK in this case because this code will not be in hot-path once we implement\n // cloning of the initial state.\n for (let i = 0; i < provider.length; i++) {\n resolveProvider(provider[i], tInjectables, lInjectablesBlueprint, isComponent, isViewProvider);\n }\n } else {\n const tView = getTView();\n const lView = getLView();\n const tNode = getCurrentTNode();\n let token = isTypeProvider(provider) ? provider : resolveForwardRef(provider.provide);\n const providerFactory = providerToFactory(provider);\n if (ngDevMode) {\n const injector = new NodeInjector(tNode, lView);\n runInInjectorProfilerContext(injector, token, () => {\n emitProviderConfiguredEvent(provider, isViewProvider);\n });\n }\n const beginIndex = tNode.providerIndexes & 1048575 /* TNodeProviderIndexes.ProvidersStartIndexMask */;\n const endIndex = tNode.directiveStart;\n const cptViewProvidersCount = tNode.providerIndexes >> 20 /* TNodeProviderIndexes.CptViewProvidersCountShift */;\n if (isTypeProvider(provider) || !provider.multi) {\n const factory = new NodeInjectorFactory(providerFactory, isViewProvider, ɵɵdirectiveInject, ngDevMode ? providerName(provider) : null);\n const existingFactoryIndex = indexOf(token, tInjectables, isViewProvider ? beginIndex : beginIndex + cptViewProvidersCount, endIndex);\n if (existingFactoryIndex === -1) {\n diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, lView), tView, token);\n registerDestroyHooksIfSupported(tView, provider, tInjectables.length);\n tInjectables.push(token);\n tNode.directiveStart++;\n tNode.directiveEnd++;\n if (isViewProvider) {\n tNode.providerIndexes += 1048576 /* TNodeProviderIndexes.CptViewProvidersCountShifter */;\n }\n lInjectablesBlueprint.push(factory);\n lView.push(factory);\n } else {\n lInjectablesBlueprint[existingFactoryIndex] = factory;\n lView[existingFactoryIndex] = factory;\n }\n } else {\n // Multi provider case:\n // We create a multi factory which is going to aggregate all the values.\n // Since the output of such a factory depends on content or view injection,\n // we create two of them, which are linked together.\n //\n // The first one (for view providers) is always in the first block of the injectables array,\n // and the second one (for providers) is always in the second block.\n // This is important because view providers have higher priority. When a multi token\n // is being looked up, the view providers should be found first.\n // Note that it is not possible to have a multi factory in the third block (directive block).\n //\n // The algorithm to process multi providers is as follows:\n // 1) If the multi provider comes from the `viewProviders` of the component:\n // a) If the special view providers factory doesn't exist, it is created and pushed.\n // b) Else, the multi provider is added to the existing multi factory.\n // 2) If the multi provider comes from the `providers` of the component or of another\n // directive:\n // a) If the multi factory doesn't exist, it is created and provider pushed into it.\n // It is also linked to the multi factory for view providers, if it exists.\n // b) Else, the multi provider is added to the existing multi factory.\n const existingProvidersFactoryIndex = indexOf(token, tInjectables, beginIndex + cptViewProvidersCount, endIndex);\n const existingViewProvidersFactoryIndex = indexOf(token, tInjectables, beginIndex, beginIndex + cptViewProvidersCount);\n const doesProvidersFactoryExist = existingProvidersFactoryIndex >= 0 && lInjectablesBlueprint[existingProvidersFactoryIndex];\n const doesViewProvidersFactoryExist = existingViewProvidersFactoryIndex >= 0 && lInjectablesBlueprint[existingViewProvidersFactoryIndex];\n if (isViewProvider && !doesViewProvidersFactoryExist || !isViewProvider && !doesProvidersFactoryExist) {\n // Cases 1.a and 2.a\n diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, lView), tView, token);\n const factory = multiFactory(isViewProvider ? multiViewProvidersFactoryResolver : multiProvidersFactoryResolver, lInjectablesBlueprint.length, isViewProvider, isComponent, providerFactory, provider);\n if (!isViewProvider && doesViewProvidersFactoryExist) {\n lInjectablesBlueprint[existingViewProvidersFactoryIndex].providerFactory = factory;\n }\n registerDestroyHooksIfSupported(tView, provider, tInjectables.length, 0);\n tInjectables.push(token);\n tNode.directiveStart++;\n tNode.directiveEnd++;\n if (isViewProvider) {\n tNode.providerIndexes += 1048576 /* TNodeProviderIndexes.CptViewProvidersCountShifter */;\n }\n lInjectablesBlueprint.push(factory);\n lView.push(factory);\n } else {\n // Cases 1.b and 2.b\n const indexInFactory = multiFactoryAdd(lInjectablesBlueprint[isViewProvider ? existingViewProvidersFactoryIndex : existingProvidersFactoryIndex], providerFactory, !isViewProvider && isComponent);\n registerDestroyHooksIfSupported(tView, provider, existingProvidersFactoryIndex > -1 ? existingProvidersFactoryIndex : existingViewProvidersFactoryIndex, indexInFactory);\n }\n if (!isViewProvider && isComponent && doesViewProvidersFactoryExist) {\n lInjectablesBlueprint[existingViewProvidersFactoryIndex].componentProviders++;\n }\n }\n }\n}\n/**\n * Registers the `ngOnDestroy` hook of a provider, if the provider supports destroy hooks.\n * @param tView `TView` in which to register the hook.\n * @param provider Provider whose hook should be registered.\n * @param contextIndex Index under which to find the context for the hook when it's being invoked.\n * @param indexInFactory Only required for `multi` providers. Index of the provider in the multi\n * provider factory.\n */\nfunction registerDestroyHooksIfSupported(tView, provider, contextIndex, indexInFactory) {\n const providerIsTypeProvider = isTypeProvider(provider);\n const providerIsClassProvider = isClassProvider(provider);\n if (providerIsTypeProvider || providerIsClassProvider) {\n // Resolve forward references as `useClass` can hold a forward reference.\n const classToken = providerIsClassProvider ? resolveForwardRef(provider.useClass) : provider;\n const prototype = classToken.prototype;\n const ngOnDestroy = prototype.ngOnDestroy;\n if (ngOnDestroy) {\n const hooks = tView.destroyHooks || (tView.destroyHooks = []);\n if (!providerIsTypeProvider && provider.multi) {\n ngDevMode && assertDefined(indexInFactory, 'indexInFactory when registering multi factory destroy hook');\n const existingCallbacksIndex = hooks.indexOf(contextIndex);\n if (existingCallbacksIndex === -1) {\n hooks.push(contextIndex, [indexInFactory, ngOnDestroy]);\n } else {\n hooks[existingCallbacksIndex + 1].push(indexInFactory, ngOnDestroy);\n }\n } else {\n hooks.push(contextIndex, ngOnDestroy);\n }\n }\n }\n}\n/**\n * Add a factory in a multi factory.\n * @returns Index at which the factory was inserted.\n */\nfunction multiFactoryAdd(multiFactory, factory, isComponentProvider) {\n if (isComponentProvider) {\n multiFactory.componentProviders++;\n }\n return multiFactory.multi.push(factory) - 1;\n}\n/**\n * Returns the index of item in the array, but only in the begin to end range.\n */\nfunction indexOf(item, arr, begin, end) {\n for (let i = begin; i < end; i++) {\n if (arr[i] === item) return i;\n }\n return -1;\n}\n/**\n * Use this with `multi` `providers`.\n */\nfunction multiProvidersFactoryResolver(_, flags, tData, lData, tNode) {\n return multiResolve(this.multi, []);\n}\n/**\n * Use this with `multi` `viewProviders`.\n *\n * This factory knows how to concatenate itself with the existing `multi` `providers`.\n */\nfunction multiViewProvidersFactoryResolver(_, _flags, _tData, lView, tNode) {\n const factories = this.multi;\n let result;\n if (this.providerFactory) {\n const componentCount = this.providerFactory.componentProviders;\n const multiProviders = getNodeInjectable(lView, lView[TVIEW], this.providerFactory.index, tNode);\n // Copy the section of the array which contains `multi` `providers` from the component\n result = multiProviders.slice(0, componentCount);\n // Insert the `viewProvider` instances.\n multiResolve(factories, result);\n // Copy the section of the array which contains `multi` `providers` from other directives\n for (let i = componentCount; i < multiProviders.length; i++) {\n result.push(multiProviders[i]);\n }\n } else {\n result = [];\n // Insert the `viewProvider` instances.\n multiResolve(factories, result);\n }\n return result;\n}\n/**\n * Maps an array of factories into an array of values.\n */\nfunction multiResolve(factories, result) {\n for (let i = 0; i < factories.length; i++) {\n const factory = factories[i];\n result.push(factory());\n }\n return result;\n}\n/**\n * Creates a multi factory.\n */\nfunction multiFactory(factoryFn, index, isViewProvider, isComponent, f, provider) {\n const factory = new NodeInjectorFactory(factoryFn, isViewProvider, ɵɵdirectiveInject, ngDevMode ? providerName(provider) : null);\n factory.multi = [];\n factory.index = index;\n factory.componentProviders = 0;\n multiFactoryAdd(factory, f, isComponent && !isViewProvider);\n return factory;\n}\nfunction providerName(provider) {\n if (Array.isArray(provider)) {\n return null;\n }\n if (isTypeProvider(provider)) {\n return provider.name;\n } else if (isClassProvider(provider)) {\n if (provider.provide instanceof InjectionToken) {\n return `('${provider.provide.toString()}':${provider.useClass.name})`;\n }\n return provider.useClass.name;\n } else if (provider.provide instanceof InjectionToken) {\n return provider.provide.toString();\n } else if (typeof provider.provide === 'string') {\n return provider.provide;\n } else {\n return null;\n }\n}\n\n/**\n * This feature resolves the providers of a directive (or component),\n * and publish them into the DI system, making it visible to others for injection.\n *\n * For example:\n * ```ts\n * class ComponentWithProviders {\n * constructor(private greeter: GreeterDE) {}\n *\n * static ɵcmp = defineComponent({\n * type: ComponentWithProviders,\n * selectors: [['component-with-providers']],\n * factory: () => new ComponentWithProviders(directiveInject(GreeterDE as any)),\n * decls: 1,\n * vars: 1,\n * template: function(fs: RenderFlags, ctx: ComponentWithProviders) {\n * if (fs & RenderFlags.Create) {\n * ɵɵtext(0);\n * }\n * if (fs & RenderFlags.Update) {\n * ɵɵtextInterpolate(ctx.greeter.greet());\n * }\n * },\n * features: [ɵɵProvidersFeature([GreeterDE])]\n * });\n * }\n * ```\n *\n * @param definition\n *\n * @codeGenApi\n */\nfunction ɵɵProvidersFeature(providers, viewProviders = []) {\n return definition => {\n definition.providersResolver = (def, processProvidersFn) => {\n return providersResolver(def,\n //\n processProvidersFn ? processProvidersFn(providers) : providers,\n //\n viewProviders);\n };\n };\n}\n\n/**\n * A feature that adds support for external runtime styles for a component.\n * An external runtime style is a URL to a CSS stylesheet that contains the styles\n * for a given component. For browsers, this URL will be used in an appended `link` element\n * when the component is rendered. This feature is typically used for Hot Module Replacement\n * (HMR) of component stylesheets by leveraging preexisting global stylesheet HMR available\n * in most development servers.\n *\n * @codeGenApi\n */\nfunction ɵɵExternalStylesFeature(styleUrls) {\n return definition => {\n if (styleUrls.length < 1) {\n return;\n }\n definition.getExternalStyles = encapsulationId => {\n // Add encapsulation ID search parameter `ngcomp` to support external style encapsulation as well as the encapsulation mode\n // for usage tracking.\n const urls = styleUrls.map(value => value + '?ngcomp' + (encapsulationId ? '=' + encodeURIComponent(encapsulationId) : '') + '&e=' + definition.encapsulation);\n return urls;\n };\n };\n}\n\n/**\n * Generated next to NgModules to monkey-patch directive and pipe references onto a component's\n * definition, when generating a direct reference in the component file would otherwise create an\n * import cycle.\n *\n * See [this explanation](https://hackmd.io/Odw80D0pR6yfsOjg_7XCJg?view) for more details.\n *\n * @codeGenApi\n */\nfunction ɵɵsetComponentScope(type, directives, pipes) {\n const def = type.ɵcmp;\n def.directiveDefs = extractDefListOrFactory(directives, extractDirectiveDef);\n def.pipeDefs = extractDefListOrFactory(pipes, getPipeDef$1);\n}\n/**\n * Adds the module metadata that is necessary to compute the module's transitive scope to an\n * existing module definition.\n *\n * Scope metadata of modules is not used in production builds, so calls to this function can be\n * marked pure to tree-shake it from the bundle, allowing for all referenced declarations\n * to become eligible for tree-shaking as well.\n *\n * @codeGenApi\n */\nfunction ɵɵsetNgModuleScope(type, scope) {\n return noSideEffects(() => {\n const ngModuleDef = getNgModuleDefOrThrow(type);\n ngModuleDef.declarations = convertToTypeArray(scope.declarations || EMPTY_ARRAY);\n ngModuleDef.imports = convertToTypeArray(scope.imports || EMPTY_ARRAY);\n ngModuleDef.exports = convertToTypeArray(scope.exports || EMPTY_ARRAY);\n if (scope.bootstrap) {\n // This only happens in local compilation mode.\n ngModuleDef.bootstrap = convertToTypeArray(scope.bootstrap);\n }\n depsTracker.registerNgModule(type, scope);\n });\n}\nfunction convertToTypeArray(values) {\n if (typeof values === 'function') {\n return values;\n }\n const flattenValues = flatten(values);\n if (flattenValues.some(isForwardRef)) {\n return () => flattenValues.map(resolveForwardRef).map(maybeUnwrapModuleWithProviders);\n } else {\n return flattenValues.map(maybeUnwrapModuleWithProviders);\n }\n}\nfunction maybeUnwrapModuleWithProviders(value) {\n return isModuleWithProviders(value) ? value.ngModule : value;\n}\n\n/**\n * Bindings for pure functions are stored after regular bindings.\n *\n * |-------decls------|---------vars---------| |----- hostVars (dir1) ------|\n * ------------------------------------------------------------------------------------------\n * | nodes/refs/pipes | bindings | fn slots | injector | dir1 | host bindings | host slots |\n * ------------------------------------------------------------------------------------------\n * ^ ^\n * TView.bindingStartIndex TView.expandoStartIndex\n *\n * Pure function instructions are given an offset from the binding root. Adding the offset to the\n * binding root gives the first index where the bindings are stored. In component views, the binding\n * root is the bindingStartIndex. In host bindings, the binding root is the expandoStartIndex +\n * any directive instances + any hostVars in directives evaluated before it.\n *\n * See VIEW_DATA.md for more information about host binding resolution.\n */\n/**\n * If the value hasn't been saved, calls the pure function to store and return the\n * value. If it has been saved, returns the saved value.\n *\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn Function that returns a value\n * @param thisArg Optional calling context of pureFn\n * @returns value\n *\n * @codeGenApi\n */\nfunction ɵɵpureFunction0(slotOffset, pureFn, thisArg) {\n const bindingIndex = getBindingRoot() + slotOffset;\n const lView = getLView();\n return lView[bindingIndex] === NO_CHANGE ? updateBinding(lView, bindingIndex, thisArg ? pureFn.call(thisArg) : pureFn()) : getBinding(lView, bindingIndex);\n}\n/**\n * If the value of the provided exp has changed, calls the pure function to return\n * an updated value. Or if the value has not changed, returns cached value.\n *\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn Function that returns an updated value\n * @param exp Updated expression value\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n *\n * @codeGenApi\n */\nfunction ɵɵpureFunction1(slotOffset, pureFn, exp, thisArg) {\n return pureFunction1Internal(getLView(), getBindingRoot(), slotOffset, pureFn, exp, thisArg);\n}\n/**\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn\n * @param exp1\n * @param exp2\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n *\n * @codeGenApi\n */\nfunction ɵɵpureFunction2(slotOffset, pureFn, exp1, exp2, thisArg) {\n return pureFunction2Internal(getLView(), getBindingRoot(), slotOffset, pureFn, exp1, exp2, thisArg);\n}\n/**\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn\n * @param exp1\n * @param exp2\n * @param exp3\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n *\n * @codeGenApi\n */\nfunction ɵɵpureFunction3(slotOffset, pureFn, exp1, exp2, exp3, thisArg) {\n return pureFunction3Internal(getLView(), getBindingRoot(), slotOffset, pureFn, exp1, exp2, exp3, thisArg);\n}\n/**\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn\n * @param exp1\n * @param exp2\n * @param exp3\n * @param exp4\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n *\n * @codeGenApi\n */\nfunction ɵɵpureFunction4(slotOffset, pureFn, exp1, exp2, exp3, exp4, thisArg) {\n return pureFunction4Internal(getLView(), getBindingRoot(), slotOffset, pureFn, exp1, exp2, exp3, exp4, thisArg);\n}\n/**\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn\n * @param exp1\n * @param exp2\n * @param exp3\n * @param exp4\n * @param exp5\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n *\n * @codeGenApi\n */\nfunction ɵɵpureFunction5(slotOffset, pureFn, exp1, exp2, exp3, exp4, exp5, thisArg) {\n const bindingIndex = getBindingRoot() + slotOffset;\n const lView = getLView();\n const different = bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4);\n return bindingUpdated(lView, bindingIndex + 4, exp5) || different ? updateBinding(lView, bindingIndex + 5, thisArg ? pureFn.call(thisArg, exp1, exp2, exp3, exp4, exp5) : pureFn(exp1, exp2, exp3, exp4, exp5)) : getBinding(lView, bindingIndex + 5);\n}\n/**\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn\n * @param exp1\n * @param exp2\n * @param exp3\n * @param exp4\n * @param exp5\n * @param exp6\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n *\n * @codeGenApi\n */\nfunction ɵɵpureFunction6(slotOffset, pureFn, exp1, exp2, exp3, exp4, exp5, exp6, thisArg) {\n const bindingIndex = getBindingRoot() + slotOffset;\n const lView = getLView();\n const different = bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4);\n return bindingUpdated2(lView, bindingIndex + 4, exp5, exp6) || different ? updateBinding(lView, bindingIndex + 6, thisArg ? pureFn.call(thisArg, exp1, exp2, exp3, exp4, exp5, exp6) : pureFn(exp1, exp2, exp3, exp4, exp5, exp6)) : getBinding(lView, bindingIndex + 6);\n}\n/**\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn\n * @param exp1\n * @param exp2\n * @param exp3\n * @param exp4\n * @param exp5\n * @param exp6\n * @param exp7\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n *\n * @codeGenApi\n */\nfunction ɵɵpureFunction7(slotOffset, pureFn, exp1, exp2, exp3, exp4, exp5, exp6, exp7, thisArg) {\n const bindingIndex = getBindingRoot() + slotOffset;\n const lView = getLView();\n let different = bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4);\n return bindingUpdated3(lView, bindingIndex + 4, exp5, exp6, exp7) || different ? updateBinding(lView, bindingIndex + 7, thisArg ? pureFn.call(thisArg, exp1, exp2, exp3, exp4, exp5, exp6, exp7) : pureFn(exp1, exp2, exp3, exp4, exp5, exp6, exp7)) : getBinding(lView, bindingIndex + 7);\n}\n/**\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn\n * @param exp1\n * @param exp2\n * @param exp3\n * @param exp4\n * @param exp5\n * @param exp6\n * @param exp7\n * @param exp8\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n *\n * @codeGenApi\n */\nfunction ɵɵpureFunction8(slotOffset, pureFn, exp1, exp2, exp3, exp4, exp5, exp6, exp7, exp8, thisArg) {\n const bindingIndex = getBindingRoot() + slotOffset;\n const lView = getLView();\n const different = bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4);\n return bindingUpdated4(lView, bindingIndex + 4, exp5, exp6, exp7, exp8) || different ? updateBinding(lView, bindingIndex + 8, thisArg ? pureFn.call(thisArg, exp1, exp2, exp3, exp4, exp5, exp6, exp7, exp8) : pureFn(exp1, exp2, exp3, exp4, exp5, exp6, exp7, exp8)) : getBinding(lView, bindingIndex + 8);\n}\n/**\n * pureFunction instruction that can support any number of bindings.\n *\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn A pure function that takes binding values and builds an object or array\n * containing those values.\n * @param exps An array of binding values\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n *\n * @codeGenApi\n */\nfunction ɵɵpureFunctionV(slotOffset, pureFn, exps, thisArg) {\n return pureFunctionVInternal(getLView(), getBindingRoot(), slotOffset, pureFn, exps, thisArg);\n}\n/**\n * Results of a pure function invocation are stored in LView in a dedicated slot that is initialized\n * to NO_CHANGE. In rare situations a pure pipe might throw an exception on the very first\n * invocation and not produce any valid results. In this case LView would keep holding the NO_CHANGE\n * value. The NO_CHANGE is not something that we can use in expressions / bindings thus we convert\n * it to `undefined`.\n */\nfunction getPureFunctionReturnValue(lView, returnValueIndex) {\n ngDevMode && assertIndexInRange(lView, returnValueIndex);\n const lastReturnValue = lView[returnValueIndex];\n return lastReturnValue === NO_CHANGE ? undefined : lastReturnValue;\n}\n/**\n * If the value of the provided exp has changed, calls the pure function to return\n * an updated value. Or if the value has not changed, returns cached value.\n *\n * @param lView LView in which the function is being executed.\n * @param bindingRoot Binding root index.\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn Function that returns an updated value\n * @param exp Updated expression value\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n */\nfunction pureFunction1Internal(lView, bindingRoot, slotOffset, pureFn, exp, thisArg) {\n const bindingIndex = bindingRoot + slotOffset;\n return bindingUpdated(lView, bindingIndex, exp) ? updateBinding(lView, bindingIndex + 1, thisArg ? pureFn.call(thisArg, exp) : pureFn(exp)) : getPureFunctionReturnValue(lView, bindingIndex + 1);\n}\n/**\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param lView LView in which the function is being executed.\n * @param bindingRoot Binding root index.\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn\n * @param exp1\n * @param exp2\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n */\nfunction pureFunction2Internal(lView, bindingRoot, slotOffset, pureFn, exp1, exp2, thisArg) {\n const bindingIndex = bindingRoot + slotOffset;\n return bindingUpdated2(lView, bindingIndex, exp1, exp2) ? updateBinding(lView, bindingIndex + 2, thisArg ? pureFn.call(thisArg, exp1, exp2) : pureFn(exp1, exp2)) : getPureFunctionReturnValue(lView, bindingIndex + 2);\n}\n/**\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param lView LView in which the function is being executed.\n * @param bindingRoot Binding root index.\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn\n * @param exp1\n * @param exp2\n * @param exp3\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n */\nfunction pureFunction3Internal(lView, bindingRoot, slotOffset, pureFn, exp1, exp2, exp3, thisArg) {\n const bindingIndex = bindingRoot + slotOffset;\n return bindingUpdated3(lView, bindingIndex, exp1, exp2, exp3) ? updateBinding(lView, bindingIndex + 3, thisArg ? pureFn.call(thisArg, exp1, exp2, exp3) : pureFn(exp1, exp2, exp3)) : getPureFunctionReturnValue(lView, bindingIndex + 3);\n}\n/**\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param lView LView in which the function is being executed.\n * @param bindingRoot Binding root index.\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn\n * @param exp1\n * @param exp2\n * @param exp3\n * @param exp4\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n *\n */\nfunction pureFunction4Internal(lView, bindingRoot, slotOffset, pureFn, exp1, exp2, exp3, exp4, thisArg) {\n const bindingIndex = bindingRoot + slotOffset;\n return bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4) ? updateBinding(lView, bindingIndex + 4, thisArg ? pureFn.call(thisArg, exp1, exp2, exp3, exp4) : pureFn(exp1, exp2, exp3, exp4)) : getPureFunctionReturnValue(lView, bindingIndex + 4);\n}\n/**\n * pureFunction instruction that can support any number of bindings.\n *\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param lView LView in which the function is being executed.\n * @param bindingRoot Binding root index.\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn A pure function that takes binding values and builds an object or array\n * containing those values.\n * @param exps An array of binding values\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n */\nfunction pureFunctionVInternal(lView, bindingRoot, slotOffset, pureFn, exps, thisArg) {\n let bindingIndex = bindingRoot + slotOffset;\n let different = false;\n for (let i = 0; i < exps.length; i++) {\n bindingUpdated(lView, bindingIndex++, exps[i]) && (different = true);\n }\n return different ? updateBinding(lView, bindingIndex, pureFn.apply(thisArg, exps)) : getPureFunctionReturnValue(lView, bindingIndex);\n}\n\n/**\n * Create a pipe.\n *\n * @param index Pipe index where the pipe will be stored.\n * @param pipeName The name of the pipe\n * @returns T the instance of the pipe.\n *\n * @codeGenApi\n */\nfunction ɵɵpipe(index, pipeName) {\n const tView = getTView();\n let pipeDef;\n const adjustedIndex = index + HEADER_OFFSET;\n if (tView.firstCreatePass) {\n // The `getPipeDef` throws if a pipe with a given name is not found\n // (so we use non-null assertion below).\n pipeDef = getPipeDef(pipeName, tView.pipeRegistry);\n tView.data[adjustedIndex] = pipeDef;\n if (pipeDef.onDestroy) {\n (tView.destroyHooks ??= []).push(adjustedIndex, pipeDef.onDestroy);\n }\n } else {\n pipeDef = tView.data[adjustedIndex];\n }\n const pipeFactory = pipeDef.factory || (pipeDef.factory = getFactoryDef(pipeDef.type, true));\n let previousInjectorProfilerContext;\n if (ngDevMode) {\n previousInjectorProfilerContext = setInjectorProfilerContext({\n injector: new NodeInjector(getCurrentTNode(), getLView()),\n token: pipeDef.type\n });\n }\n const previousInjectImplementation = setInjectImplementation(ɵɵdirectiveInject);\n try {\n // DI for pipes is supposed to behave like directives when placed on a component\n // host node, which means that we have to disable access to `viewProviders`.\n const previousIncludeViewProviders = setIncludeViewProviders(false);\n const pipeInstance = pipeFactory();\n setIncludeViewProviders(previousIncludeViewProviders);\n store(tView, getLView(), adjustedIndex, pipeInstance);\n return pipeInstance;\n } finally {\n // we have to restore the injector implementation in finally, just in case the creation of the\n // pipe throws an error.\n setInjectImplementation(previousInjectImplementation);\n ngDevMode && setInjectorProfilerContext(previousInjectorProfilerContext);\n }\n}\n/**\n * Searches the pipe registry for a pipe with the given name. If one is found,\n * returns the pipe. Otherwise, an error is thrown because the pipe cannot be resolved.\n *\n * @param name Name of pipe to resolve\n * @param registry Full list of available pipes\n * @returns Matching PipeDef\n */\nfunction getPipeDef(name, registry) {\n if (registry) {\n if (ngDevMode) {\n const pipes = registry.filter(pipe => pipe.name === name);\n // TODO: Throw an error in the next major\n if (pipes.length > 1) {\n console.warn(formatRuntimeError(313 /* RuntimeErrorCode.MULTIPLE_MATCHING_PIPES */, getMultipleMatchingPipesMessage(name)));\n }\n }\n for (let i = registry.length - 1; i >= 0; i--) {\n const pipeDef = registry[i];\n if (name === pipeDef.name) {\n return pipeDef;\n }\n }\n }\n if (ngDevMode) {\n throw new RuntimeError(-302 /* RuntimeErrorCode.PIPE_NOT_FOUND */, getPipeNotFoundErrorMessage(name));\n }\n return;\n}\n/**\n * Generates a helpful error message for the user when multiple pipes match the name.\n *\n * @param name Name of the pipe\n * @returns The error message\n */\nfunction getMultipleMatchingPipesMessage(name) {\n const lView = getLView();\n const declarationLView = lView[DECLARATION_COMPONENT_VIEW];\n const context = declarationLView[CONTEXT];\n const hostIsStandalone = isHostComponentStandalone(lView);\n const componentInfoMessage = context ? ` in the '${context.constructor.name}' component` : '';\n const verifyMessage = `check ${hostIsStandalone ? \"'@Component.imports' of this component\" : 'the imports of this module'}`;\n const errorMessage = `Multiple pipes match the name \\`${name}\\`${componentInfoMessage}. ${verifyMessage}`;\n return errorMessage;\n}\n/**\n * Generates a helpful error message for the user when a pipe is not found.\n *\n * @param name Name of the missing pipe\n * @returns The error message\n */\nfunction getPipeNotFoundErrorMessage(name) {\n const lView = getLView();\n const declarationLView = lView[DECLARATION_COMPONENT_VIEW];\n const context = declarationLView[CONTEXT];\n const hostIsStandalone = isHostComponentStandalone(lView);\n const componentInfoMessage = context ? ` in the '${context.constructor.name}' component` : '';\n const verifyMessage = `Verify that it is ${hostIsStandalone ? \"included in the '@Component.imports' of this component\" : 'declared or imported in this module'}`;\n const errorMessage = `The pipe '${name}' could not be found${componentInfoMessage}. ${verifyMessage}`;\n return errorMessage;\n}\n/**\n * Invokes a pipe with 1 arguments.\n *\n * This instruction acts as a guard to {@link PipeTransform#transform} invoking\n * the pipe only when an input to the pipe changes.\n *\n * @param index Pipe index where the pipe was stored on creation.\n * @param offset the binding offset\n * @param v1 1st argument to {@link PipeTransform#transform}.\n *\n * @codeGenApi\n */\nfunction ɵɵpipeBind1(index, offset, v1) {\n const adjustedIndex = index + HEADER_OFFSET;\n const lView = getLView();\n const pipeInstance = load(lView, adjustedIndex);\n return isPure(lView, adjustedIndex) ? pureFunction1Internal(lView, getBindingRoot(), offset, pipeInstance.transform, v1, pipeInstance) : pipeInstance.transform(v1);\n}\n/**\n * Invokes a pipe with 2 arguments.\n *\n * This instruction acts as a guard to {@link PipeTransform#transform} invoking\n * the pipe only when an input to the pipe changes.\n *\n * @param index Pipe index where the pipe was stored on creation.\n * @param slotOffset the offset in the reserved slot space\n * @param v1 1st argument to {@link PipeTransform#transform}.\n * @param v2 2nd argument to {@link PipeTransform#transform}.\n *\n * @codeGenApi\n */\nfunction ɵɵpipeBind2(index, slotOffset, v1, v2) {\n const adjustedIndex = index + HEADER_OFFSET;\n const lView = getLView();\n const pipeInstance = load(lView, adjustedIndex);\n return isPure(lView, adjustedIndex) ? pureFunction2Internal(lView, getBindingRoot(), slotOffset, pipeInstance.transform, v1, v2, pipeInstance) : pipeInstance.transform(v1, v2);\n}\n/**\n * Invokes a pipe with 3 arguments.\n *\n * This instruction acts as a guard to {@link PipeTransform#transform} invoking\n * the pipe only when an input to the pipe changes.\n *\n * @param index Pipe index where the pipe was stored on creation.\n * @param slotOffset the offset in the reserved slot space\n * @param v1 1st argument to {@link PipeTransform#transform}.\n * @param v2 2nd argument to {@link PipeTransform#transform}.\n * @param v3 4rd argument to {@link PipeTransform#transform}.\n *\n * @codeGenApi\n */\nfunction ɵɵpipeBind3(index, slotOffset, v1, v2, v3) {\n const adjustedIndex = index + HEADER_OFFSET;\n const lView = getLView();\n const pipeInstance = load(lView, adjustedIndex);\n return isPure(lView, adjustedIndex) ? pureFunction3Internal(lView, getBindingRoot(), slotOffset, pipeInstance.transform, v1, v2, v3, pipeInstance) : pipeInstance.transform(v1, v2, v3);\n}\n/**\n * Invokes a pipe with 4 arguments.\n *\n * This instruction acts as a guard to {@link PipeTransform#transform} invoking\n * the pipe only when an input to the pipe changes.\n *\n * @param index Pipe index where the pipe was stored on creation.\n * @param slotOffset the offset in the reserved slot space\n * @param v1 1st argument to {@link PipeTransform#transform}.\n * @param v2 2nd argument to {@link PipeTransform#transform}.\n * @param v3 3rd argument to {@link PipeTransform#transform}.\n * @param v4 4th argument to {@link PipeTransform#transform}.\n *\n * @codeGenApi\n */\nfunction ɵɵpipeBind4(index, slotOffset, v1, v2, v3, v4) {\n const adjustedIndex = index + HEADER_OFFSET;\n const lView = getLView();\n const pipeInstance = load(lView, adjustedIndex);\n return isPure(lView, adjustedIndex) ? pureFunction4Internal(lView, getBindingRoot(), slotOffset, pipeInstance.transform, v1, v2, v3, v4, pipeInstance) : pipeInstance.transform(v1, v2, v3, v4);\n}\n/**\n * Invokes a pipe with variable number of arguments.\n *\n * This instruction acts as a guard to {@link PipeTransform#transform} invoking\n * the pipe only when an input to the pipe changes.\n *\n * @param index Pipe index where the pipe was stored on creation.\n * @param slotOffset the offset in the reserved slot space\n * @param values Array of arguments to pass to {@link PipeTransform#transform} method.\n *\n * @codeGenApi\n */\nfunction ɵɵpipeBindV(index, slotOffset, values) {\n const adjustedIndex = index + HEADER_OFFSET;\n const lView = getLView();\n const pipeInstance = load(lView, adjustedIndex);\n return isPure(lView, adjustedIndex) ? pureFunctionVInternal(lView, getBindingRoot(), slotOffset, pipeInstance.transform, values, pipeInstance) : pipeInstance.transform.apply(pipeInstance, values);\n}\nfunction isPure(lView, index) {\n return lView[TVIEW].data[index].pure;\n}\n\n/**\n * Retrieves `TemplateRef` instance from `Injector` when a local reference is placed on the\n * `<ng-template>` element.\n *\n * @codeGenApi\n */\nfunction ɵɵtemplateRefExtractor(tNode, lView) {\n return createTemplateRef(tNode, lView);\n}\nfunction ɵɵgetComponentDepsFactory(type, rawImports) {\n return () => {\n try {\n return depsTracker.getComponentDependencies(type, rawImports).dependencies;\n } catch (e) {\n console.error(`Computing dependencies in local compilation mode for the component \"${type.name}\" failed with the exception:`, e);\n throw e;\n }\n };\n}\n\n/**\n * Sets the debug info for an Angular class.\n *\n * This runtime is guarded by ngDevMode flag.\n */\nfunction ɵsetClassDebugInfo(type, debugInfo) {\n const def = getComponentDef(type);\n if (def !== null) {\n def.debugInfo = debugInfo;\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/**\n * Gets the URL from which the client will fetch a new version of a component's metadata so it\n * can be replaced during hot module reloading.\n * @param id Unique ID for the component, generated during compile time.\n * @param timestamp Time at which the request happened.\n * @param base Base URL against which to resolve relative paths.\n * @codeGenApi\n */\nfunction ɵɵgetReplaceMetadataURL(id, timestamp, base) {\n const url = `./@ng/component?c=${id}&t=${encodeURIComponent(timestamp)}`;\n return new URL(url, base).href;\n}\n/**\n * Replaces the metadata of a component type and re-renders all live instances of the component.\n * @param type Class whose metadata will be replaced.\n * @param applyMetadata Callback that will apply a new set of metadata on the `type` when invoked.\n * @param environment Syntehtic namespace imports that need to be passed along to the callback.\n * @param locals Local symbols from the source location that have to be exposed to the callback.\n * @param importMeta `import.meta` from the call site of the replacement function. Optional since\n * it isn't used internally.\n * @param id ID to the class being replaced. **Not** the same as the component definition ID.\n * Optional since the ID might not be available internally.\n * @codeGenApi\n */\nfunction ɵɵreplaceMetadata(type, applyMetadata, namespaces, locals, importMeta = null, id = null) {\n ngDevMode && assertComponentDef(type);\n const currentDef = getComponentDef(type);\n // The reason `applyMetadata` is a callback that is invoked (almost) immediately is because\n // the compiler usually produces more code than just the component definition, e.g. there\n // can be functions for embedded views, the variables for the constant pool and `setClassMetadata`\n // calls. The callback allows us to keep them isolate from the rest of the app and to invoke\n // them at the right time.\n applyMetadata.apply(null, [type, namespaces, ...locals]);\n const {\n newDef,\n oldDef\n } = mergeWithExistingDefinition(currentDef, getComponentDef(type));\n // TODO(crisbeto): the `applyMetadata` call above will replace the definition on the type.\n // Ideally we should adjust the compiler output so the metadata is returned, however that'll\n // require some internal changes. We re-add the metadata here manually.\n type[NG_COMP_DEF] = newDef;\n // If a `tView` hasn't been created yet, it means that this component hasn't been instantianted\n // before. In this case there's nothing left for us to do aside from patching it in.\n if (oldDef.tView) {\n const trackedViews = getTrackedLViews().values();\n for (const root of trackedViews) {\n // Note: we have the additional check, because `IsRoot` can also indicate\n // a component created through something like `createComponent`.\n if (isRootView(root) && root[PARENT] === null) {\n recreateMatchingLViews(importMeta, id, newDef, oldDef, root);\n }\n }\n }\n}\n/**\n * Merges two component definitions while preseving the original one in place.\n * @param currentDef Definition that should receive the new metadata.\n * @param newDef Source of the new metadata.\n */\nfunction mergeWithExistingDefinition(currentDef, newDef) {\n // Clone the current definition since we reference its original data further\n // down in the replacement process (e.g. when destroying the renderer).\n const clone = {\n ...currentDef\n };\n // Assign the new metadata in place while preserving the object literal. It's important to\n // Keep the object in place, because there can be references to it, for example in the\n // `directiveDefs` of another definition.\n const replacement = Object.assign(currentDef, newDef, {\n // We need to keep the existing directive and pipe defs, because they can get patched on\n // by a call to `setComponentScope` from a module file. That call won't make it into the\n // HMR replacement function, because it lives in an entirely different file.\n directiveDefs: clone.directiveDefs,\n pipeDefs: clone.pipeDefs,\n // Preserve the old `setInput` function, because it has some state.\n // This is fine, because the component instance is preserved as well.\n setInput: clone.setInput,\n // Externally this is redundant since we redeclare the definition using the original type.\n // Internally we may receive a definition with an alternate, but identical, type so we have\n // to ensure that the original one is preserved.\n type: clone.type\n });\n ngDevMode && assertEqual(replacement, currentDef, 'Expected definition to be merged in place');\n return {\n newDef: replacement,\n oldDef: clone\n };\n}\n/**\n * Finds all LViews matching a specific component definition and recreates them.\n * @param importMeta `import.meta` information.\n * @param id HMR ID of the component.\n * @param oldDef Component definition to search for.\n * @param rootLView View from which to start the search.\n */\nfunction recreateMatchingLViews(importMeta, id, newDef, oldDef, rootLView) {\n ngDevMode && assertDefined(oldDef.tView, 'Expected a component definition that has been instantiated at least once');\n const tView = rootLView[TVIEW];\n // Use `tView` to match the LView since `instanceof` can\n // produce false positives when using inheritance.\n if (tView === oldDef.tView) {\n ngDevMode && assertComponentDef(oldDef.type);\n recreateLView(importMeta, id, newDef, oldDef, rootLView);\n return;\n }\n for (let i = HEADER_OFFSET; i < tView.bindingStartIndex; i++) {\n const current = rootLView[i];\n if (isLContainer(current)) {\n // The host can be an LView if a component is injecting `ViewContainerRef`.\n if (isLView(current[HOST])) {\n recreateMatchingLViews(importMeta, id, newDef, oldDef, current[HOST]);\n }\n for (let j = CONTAINER_HEADER_OFFSET; j < current.length; j++) {\n recreateMatchingLViews(importMeta, id, newDef, oldDef, current[j]);\n }\n } else if (isLView(current)) {\n recreateMatchingLViews(importMeta, id, newDef, oldDef, current);\n }\n }\n}\n/**\n * Removes any cached renderers from the factory for the provided type.\n * This is currently used by the HMR logic to ensure Renderers are kept\n * synchronized with any definition metadata updates.\n * @param factory A RendererFactory2 instance.\n * @param def A ComponentDef instance.\n */\nfunction clearRendererCache(factory, def) {\n // Cast to read a private field.\n // NOTE: This must be kept synchronized with the renderer factory implementation in\n // platform-browser and platform-browser/animations.\n factory.componentReplaced?.(def.id);\n}\n/**\n * Recreates an LView in-place from a new component definition.\n * @param importMeta `import.meta` information.\n * @param id HMR ID for the component.\n * @param newDef Definition from which to recreate the view.\n * @param oldDef Previous component definition being swapped out.\n * @param lView View to be recreated.\n */\nfunction recreateLView(importMeta, id, newDef, oldDef, lView) {\n const instance = lView[CONTEXT];\n let host = lView[HOST];\n // In theory the parent can also be an LContainer, but it appears like that's\n // only the case for embedded views which we won't be replacing here.\n const parentLView = lView[PARENT];\n ngDevMode && assertLView(parentLView);\n const tNode = lView[T_HOST];\n ngDevMode && assertTNodeType(tNode, 2 /* TNodeType.Element */);\n ngDevMode && assertNotEqual(newDef, oldDef, 'Expected different component definition');\n const zone = lView[INJECTOR].get(NgZone, null);\n const recreate = () => {\n // If we're recreating a component with shadow DOM encapsulation, it will have attached a\n // shadow root. The browser will throw if we attempt to attach another one and there's no way\n // to detach it. Our only option is to make a clone only of the root node, replace the node\n // with the clone and use it for the newly-created LView.\n if (oldDef.encapsulation === ViewEncapsulation.ShadowDom) {\n const newHost = host.cloneNode(false);\n host.replaceWith(newHost);\n host = newHost;\n }\n // Recreate the TView since the template might've changed.\n const newTView = getOrCreateComponentTView(newDef);\n // Create a new LView from the new TView, but reusing the existing TNode and DOM node.\n const newLView = createLView(parentLView, newTView, instance, getInitialLViewFlagsFromDef(newDef), host, tNode, null, null,\n // The renderer will be created a bit further down once the old one is destroyed.\n null, null, null);\n // Detach the LView from its current place in the tree so we don't\n // start traversing any siblings and modifying their structure.\n replaceLViewInTree(parentLView, lView, newLView, tNode.index);\n // Destroy the detached LView.\n destroyLView(lView[TVIEW], lView);\n // Always force the creation of a new renderer to ensure state captured during construction\n // stays consistent with the new component definition by clearing any old ached factories.\n const rendererFactory = lView[ENVIRONMENT].rendererFactory;\n clearRendererCache(rendererFactory, oldDef);\n // Patch a brand-new renderer onto the new view only after the old\n // view is destroyed so that the runtime doesn't try to reuse it.\n newLView[RENDERER] = rendererFactory.createRenderer(host, newDef);\n // Remove the nodes associated with the destroyed LView. This removes the\n // descendants, but not the host which we want to stay in place.\n removeViewFromDOM(lView[TVIEW], lView);\n // Reset the content projection state of the TNode before the first render.\n // Note that this has to happen after the LView has been destroyed or we\n // risk some projected nodes not being removed correctly.\n resetProjectionState(tNode);\n // Creation pass for the new view.\n renderView(newTView, newLView, instance);\n // Update pass for the new view.\n refreshView(newTView, newLView, newTView.template, instance);\n };\n // The callback isn't guaranteed to be inside the Zone so we need to bring it in ourselves.\n if (zone === null) {\n executeWithInvalidateFallback(importMeta, id, recreate);\n } else {\n zone.run(() => executeWithInvalidateFallback(importMeta, id, recreate));\n }\n}\n/**\n * Runs an HMR-related function and falls back to\n * invalidating the HMR data if it throws an error.\n */\nfunction executeWithInvalidateFallback(importMeta, id, callback) {\n try {\n callback();\n } catch (e) {\n const error = e;\n // If we have all the necessary information and APIs to send off the invalidation\n // request, send it before rethrowing so the dev server can decide what to do.\n if (id !== null && error.message) {\n const toLog = error.message + (error.stack ? '\\n' + error.stack : '');\n importMeta?.hot?.send?.('angular:invalidate', {\n id,\n message: toLog,\n error: true\n });\n }\n // Throw the error in case the page doesn't get refreshed.\n throw e;\n }\n}\n/**\n * Replaces one LView in the tree with another one.\n * @param parentLView Parent of the LView being replaced.\n * @param oldLView LView being replaced.\n * @param newLView Replacement LView to be inserted.\n * @param index Index at which the LView should be inserted.\n */\nfunction replaceLViewInTree(parentLView, oldLView, newLView, index) {\n // Update the sibling whose `NEXT` pointer refers to the old view.\n for (let i = HEADER_OFFSET; i < parentLView[TVIEW].bindingStartIndex; i++) {\n const current = parentLView[i];\n if ((isLView(current) || isLContainer(current)) && current[NEXT] === oldLView) {\n current[NEXT] = newLView;\n break;\n }\n }\n // Set the new view as the head, if the old view was first.\n if (parentLView[CHILD_HEAD] === oldLView) {\n parentLView[CHILD_HEAD] = newLView;\n }\n // Set the new view as the tail, if the old view was last.\n if (parentLView[CHILD_TAIL] === oldLView) {\n parentLView[CHILD_TAIL] = newLView;\n }\n // Update the `NEXT` pointer to the same as the old view.\n newLView[NEXT] = oldLView[NEXT];\n // Clear out the `NEXT` of the old view.\n oldLView[NEXT] = null;\n // Insert the new LView at the correct index.\n parentLView[index] = newLView;\n}\n/**\n * Child nodes mutate the `projection` state of their parent node as they're being projected.\n * This function resets the `project` back to its initial state.\n * @param tNode\n */\nfunction resetProjectionState(tNode) {\n // The `projection` is mutated by child nodes as they're being projected. We need to\n // reset it to the initial state so projection works after the template is swapped out.\n if (tNode.projection !== null) {\n for (const current of tNode.projection) {\n if (isTNodeShape(current)) {\n // Reset `projectionNext` since it can affect the traversal order during projection.\n current.projectionNext = null;\n current.flags &= ~2 /* TNodeFlags.isProjected */;\n }\n }\n tNode.projection = null;\n }\n}\n\n/**\n * A mapping of the @angular/core API surface used in generated expressions to the actual symbols.\n *\n * This should be kept up to date with the public exports of @angular/core.\n */\nconst angularCoreEnv = (() => ({\n 'ɵɵattribute': ɵɵattribute,\n 'ɵɵdefineComponent': ɵɵdefineComponent,\n 'ɵɵdefineDirective': ɵɵdefineDirective,\n 'ɵɵdefineInjectable': __defineInjectable,\n 'ɵɵdefineInjector': __defineInjector,\n 'ɵɵdefineNgModule': ɵɵdefineNgModule,\n 'ɵɵdefinePipe': ɵɵdefinePipe,\n 'ɵɵdirectiveInject': ɵɵdirectiveInject,\n 'ɵɵgetInheritedFactory': ɵɵgetInheritedFactory,\n 'ɵɵinject': __inject,\n 'ɵɵinjectAttribute': ɵɵinjectAttribute,\n 'ɵɵinvalidFactory': ɵɵinvalidFactory,\n 'ɵɵinvalidFactoryDep': __invalidFactoryDep,\n 'ɵɵtemplateRefExtractor': ɵɵtemplateRefExtractor,\n 'ɵɵresetView': __resetView,\n 'ɵɵHostDirectivesFeature': ɵɵHostDirectivesFeature,\n 'ɵɵNgOnChangesFeature': ɵɵNgOnChangesFeature,\n 'ɵɵProvidersFeature': ɵɵProvidersFeature,\n 'ɵɵCopyDefinitionFeature': ɵɵCopyDefinitionFeature,\n 'ɵɵInheritDefinitionFeature': ɵɵInheritDefinitionFeature,\n 'ɵɵExternalStylesFeature': ɵɵExternalStylesFeature,\n 'ɵɵnextContext': ɵɵnextContext,\n 'ɵɵnamespaceHTML': __namespaceHTML,\n 'ɵɵnamespaceMathML': __namespaceMathML,\n 'ɵɵnamespaceSVG': __namespaceSVG,\n 'ɵɵenableBindings': __enableBindings,\n 'ɵɵdisableBindings': __disableBindings,\n 'ɵɵelementStart': ɵɵelementStart,\n 'ɵɵelementEnd': ɵɵelementEnd,\n 'ɵɵelement': ɵɵelement,\n 'ɵɵelementContainerStart': ɵɵelementContainerStart,\n 'ɵɵelementContainerEnd': ɵɵelementContainerEnd,\n 'ɵɵdomElement': ɵɵdomElement,\n 'ɵɵdomElementStart': ɵɵdomElementStart,\n 'ɵɵdomElementEnd': ɵɵdomElementEnd,\n 'ɵɵdomElementContainer': ɵɵdomElementContainer,\n 'ɵɵdomElementContainerStart': ɵɵdomElementContainerStart,\n 'ɵɵdomElementContainerEnd': ɵɵdomElementContainerEnd,\n 'ɵɵdomTemplate': ɵɵdomTemplate,\n 'ɵɵdomListener': ɵɵdomListener,\n 'ɵɵelementContainer': ɵɵelementContainer,\n 'ɵɵpureFunction0': ɵɵpureFunction0,\n 'ɵɵpureFunction1': ɵɵpureFunction1,\n 'ɵɵpureFunction2': ɵɵpureFunction2,\n 'ɵɵpureFunction3': ɵɵpureFunction3,\n 'ɵɵpureFunction4': ɵɵpureFunction4,\n 'ɵɵpureFunction5': ɵɵpureFunction5,\n 'ɵɵpureFunction6': ɵɵpureFunction6,\n 'ɵɵpureFunction7': ɵɵpureFunction7,\n 'ɵɵpureFunction8': ɵɵpureFunction8,\n 'ɵɵpureFunctionV': ɵɵpureFunctionV,\n 'ɵɵgetCurrentView': ɵɵgetCurrentView,\n 'ɵɵrestoreView': __restoreView,\n 'ɵɵlistener': ɵɵlistener,\n 'ɵɵprojection': ɵɵprojection,\n 'ɵɵsyntheticHostProperty': ɵɵsyntheticHostProperty,\n 'ɵɵsyntheticHostListener': ɵɵsyntheticHostListener,\n 'ɵɵpipeBind1': ɵɵpipeBind1,\n 'ɵɵpipeBind2': ɵɵpipeBind2,\n 'ɵɵpipeBind3': ɵɵpipeBind3,\n 'ɵɵpipeBind4': ɵɵpipeBind4,\n 'ɵɵpipeBindV': ɵɵpipeBindV,\n 'ɵɵprojectionDef': ɵɵprojectionDef,\n 'ɵɵdomProperty': ɵɵdomProperty,\n 'ɵɵproperty': ɵɵproperty,\n 'ɵɵpipe': ɵɵpipe,\n 'ɵɵqueryRefresh': ɵɵqueryRefresh,\n 'ɵɵqueryAdvance': ɵɵqueryAdvance,\n 'ɵɵviewQuery': ɵɵviewQuery,\n 'ɵɵviewQuerySignal': ɵɵviewQuerySignal,\n 'ɵɵloadQuery': ɵɵloadQuery,\n 'ɵɵcontentQuery': ɵɵcontentQuery,\n 'ɵɵcontentQuerySignal': ɵɵcontentQuerySignal,\n 'ɵɵreference': ɵɵreference,\n 'ɵɵclassMap': ɵɵclassMap,\n 'ɵɵstyleMap': ɵɵstyleMap,\n 'ɵɵstyleProp': ɵɵstyleProp,\n 'ɵɵclassProp': ɵɵclassProp,\n 'ɵɵadvance': ɵɵadvance,\n 'ɵɵtemplate': ɵɵtemplate,\n 'ɵɵconditional': ɵɵconditional,\n 'ɵɵconditionalCreate': ɵɵconditionalCreate,\n 'ɵɵconditionalBranchCreate': ɵɵconditionalBranchCreate,\n 'ɵɵdefer': ɵɵdefer,\n 'ɵɵdeferWhen': ɵɵdeferWhen,\n 'ɵɵdeferOnIdle': ɵɵdeferOnIdle,\n 'ɵɵdeferOnImmediate': ɵɵdeferOnImmediate,\n 'ɵɵdeferOnTimer': ɵɵdeferOnTimer,\n 'ɵɵdeferOnHover': ɵɵdeferOnHover,\n 'ɵɵdeferOnInteraction': ɵɵdeferOnInteraction,\n 'ɵɵdeferOnViewport': ɵɵdeferOnViewport,\n 'ɵɵdeferPrefetchWhen': ɵɵdeferPrefetchWhen,\n 'ɵɵdeferPrefetchOnIdle': ɵɵdeferPrefetchOnIdle,\n 'ɵɵdeferPrefetchOnImmediate': ɵɵdeferPrefetchOnImmediate,\n 'ɵɵdeferPrefetchOnTimer': ɵɵdeferPrefetchOnTimer,\n 'ɵɵdeferPrefetchOnHover': ɵɵdeferPrefetchOnHover,\n 'ɵɵdeferPrefetchOnInteraction': ɵɵdeferPrefetchOnInteraction,\n 'ɵɵdeferPrefetchOnViewport': ɵɵdeferPrefetchOnViewport,\n 'ɵɵdeferHydrateWhen': ɵɵdeferHydrateWhen,\n 'ɵɵdeferHydrateNever': ɵɵdeferHydrateNever,\n 'ɵɵdeferHydrateOnIdle': ɵɵdeferHydrateOnIdle,\n 'ɵɵdeferHydrateOnImmediate': ɵɵdeferHydrateOnImmediate,\n 'ɵɵdeferHydrateOnTimer': ɵɵdeferHydrateOnTimer,\n 'ɵɵdeferHydrateOnHover': ɵɵdeferHydrateOnHover,\n 'ɵɵdeferHydrateOnInteraction': ɵɵdeferHydrateOnInteraction,\n 'ɵɵdeferHydrateOnViewport': ɵɵdeferHydrateOnViewport,\n 'ɵɵdeferEnableTimerScheduling': ɵɵdeferEnableTimerScheduling,\n 'ɵɵrepeater': ɵɵrepeater,\n 'ɵɵrepeaterCreate': ɵɵrepeaterCreate,\n 'ɵɵrepeaterTrackByIndex': ɵɵrepeaterTrackByIndex,\n 'ɵɵrepeaterTrackByIdentity': ɵɵrepeaterTrackByIdentity,\n 'ɵɵcomponentInstance': ɵɵcomponentInstance,\n 'ɵɵtext': ɵɵtext,\n 'ɵɵtextInterpolate': ɵɵtextInterpolate,\n 'ɵɵtextInterpolate1': ɵɵtextInterpolate1,\n 'ɵɵtextInterpolate2': ɵɵtextInterpolate2,\n 'ɵɵtextInterpolate3': ɵɵtextInterpolate3,\n 'ɵɵtextInterpolate4': ɵɵtextInterpolate4,\n 'ɵɵtextInterpolate5': ɵɵtextInterpolate5,\n 'ɵɵtextInterpolate6': ɵɵtextInterpolate6,\n 'ɵɵtextInterpolate7': ɵɵtextInterpolate7,\n 'ɵɵtextInterpolate8': ɵɵtextInterpolate8,\n 'ɵɵtextInterpolateV': ɵɵtextInterpolateV,\n 'ɵɵi18n': ɵɵi18n,\n 'ɵɵi18nAttributes': ɵɵi18nAttributes,\n 'ɵɵi18nExp': ɵɵi18nExp,\n 'ɵɵi18nStart': ɵɵi18nStart,\n 'ɵɵi18nEnd': ɵɵi18nEnd,\n 'ɵɵi18nApply': ɵɵi18nApply,\n 'ɵɵi18nPostprocess': ɵɵi18nPostprocess,\n 'ɵɵresolveWindow': ɵɵresolveWindow,\n 'ɵɵresolveDocument': ɵɵresolveDocument,\n 'ɵɵresolveBody': ɵɵresolveBody,\n 'ɵɵsetComponentScope': ɵɵsetComponentScope,\n 'ɵɵsetNgModuleScope': ɵɵsetNgModuleScope,\n 'ɵɵregisterNgModuleType': registerNgModuleType,\n 'ɵɵgetComponentDepsFactory': ɵɵgetComponentDepsFactory,\n 'ɵsetClassDebugInfo': ɵsetClassDebugInfo,\n 'ɵɵdeclareLet': ɵɵdeclareLet,\n 'ɵɵstoreLet': ɵɵstoreLet,\n 'ɵɵreadContextLet': ɵɵreadContextLet,\n 'ɵɵattachSourceLocations': ɵɵattachSourceLocations,\n 'ɵɵinterpolate': ɵɵinterpolate,\n 'ɵɵinterpolate1': ɵɵinterpolate1,\n 'ɵɵinterpolate2': ɵɵinterpolate2,\n 'ɵɵinterpolate3': ɵɵinterpolate3,\n 'ɵɵinterpolate4': ɵɵinterpolate4,\n 'ɵɵinterpolate5': ɵɵinterpolate5,\n 'ɵɵinterpolate6': ɵɵinterpolate6,\n 'ɵɵinterpolate7': ɵɵinterpolate7,\n 'ɵɵinterpolate8': ɵɵinterpolate8,\n 'ɵɵinterpolateV': ɵɵinterpolateV,\n 'ɵɵsanitizeHtml': ɵɵsanitizeHtml,\n 'ɵɵsanitizeStyle': ɵɵsanitizeStyle,\n 'ɵɵsanitizeResourceUrl': ɵɵsanitizeResourceUrl,\n 'ɵɵsanitizeScript': ɵɵsanitizeScript,\n 'ɵɵsanitizeUrl': ɵɵsanitizeUrl,\n 'ɵɵsanitizeUrlOrResourceUrl': ɵɵsanitizeUrlOrResourceUrl,\n 'ɵɵtrustConstantHtml': ɵɵtrustConstantHtml,\n 'ɵɵtrustConstantResourceUrl': ɵɵtrustConstantResourceUrl,\n 'ɵɵvalidateIframeAttribute': ɵɵvalidateIframeAttribute,\n 'forwardRef': forwardRef,\n 'resolveForwardRef': resolveForwardRef,\n 'ɵɵtwoWayProperty': ɵɵtwoWayProperty,\n 'ɵɵtwoWayBindingSet': ɵɵtwoWayBindingSet,\n 'ɵɵtwoWayListener': ɵɵtwoWayListener,\n 'ɵɵreplaceMetadata': ɵɵreplaceMetadata,\n 'ɵɵgetReplaceMetadataURL': ɵɵgetReplaceMetadataURL\n}))();\nlet jitOptions = null;\nfunction setJitOptions(options) {\n if (jitOptions !== null) {\n if (options.defaultEncapsulation !== jitOptions.defaultEncapsulation) {\n ngDevMode && console.error('Provided value for `defaultEncapsulation` can not be changed once it has been set.');\n return;\n }\n if (options.preserveWhitespaces !== jitOptions.preserveWhitespaces) {\n ngDevMode && console.error('Provided value for `preserveWhitespaces` can not be changed once it has been set.');\n return;\n }\n }\n jitOptions = options;\n}\nfunction getJitOptions() {\n return jitOptions;\n}\nfunction resetJitOptions() {\n jitOptions = null;\n}\nconst moduleQueue = [];\n/**\n * Enqueues moduleDef to be checked later to see if scope can be set on its\n * component declarations.\n */\nfunction enqueueModuleForDelayedScoping(moduleType, ngModule) {\n moduleQueue.push({\n moduleType,\n ngModule\n });\n}\nlet flushingModuleQueue = false;\n/**\n * Loops over queued module definitions, if a given module definition has all of its\n * declarations resolved, it dequeues that module definition and sets the scope on\n * its declarations.\n */\nfunction flushModuleScopingQueueAsMuchAsPossible() {\n if (!flushingModuleQueue) {\n flushingModuleQueue = true;\n try {\n for (let i = moduleQueue.length - 1; i >= 0; i--) {\n const {\n moduleType,\n ngModule\n } = moduleQueue[i];\n if (ngModule.declarations && ngModule.declarations.every(isResolvedDeclaration)) {\n // dequeue\n moduleQueue.splice(i, 1);\n setScopeOnDeclaredComponents(moduleType, ngModule);\n }\n }\n } finally {\n flushingModuleQueue = false;\n }\n }\n}\n/**\n * Returns truthy if a declaration has resolved. If the declaration happens to be\n * an array of declarations, it will recurse to check each declaration in that array\n * (which may also be arrays).\n */\nfunction isResolvedDeclaration(declaration) {\n if (Array.isArray(declaration)) {\n return declaration.every(isResolvedDeclaration);\n }\n return !!resolveForwardRef(declaration);\n}\n/**\n * Compiles a module in JIT mode.\n *\n * This function automatically gets called when a class has a `@NgModule` decorator.\n */\nfunction compileNgModule(moduleType, ngModule = {}) {\n compileNgModuleDefs(moduleType, ngModule);\n if (ngModule.id !== undefined) {\n registerNgModuleType(moduleType, ngModule.id);\n }\n // Because we don't know if all declarations have resolved yet at the moment the\n // NgModule decorator is executing, we're enqueueing the setting of module scope\n // on its declarations to be run at a later time when all declarations for the module,\n // including forward refs, have resolved.\n enqueueModuleForDelayedScoping(moduleType, ngModule);\n}\n/**\n * Compiles and adds the `ɵmod`, `ɵfac` and `ɵinj` properties to the module class.\n *\n * It's possible to compile a module via this API which will allow duplicate declarations in its\n * root.\n */\nfunction compileNgModuleDefs(moduleType, ngModule, allowDuplicateDeclarationsInRoot = false) {\n ngDevMode && assertDefined(moduleType, 'Required value moduleType');\n ngDevMode && assertDefined(ngModule, 'Required value ngModule');\n const declarations = flatten(ngModule.declarations || EMPTY_ARRAY);\n let ngModuleDef = null;\n Object.defineProperty(moduleType, NG_MOD_DEF, {\n configurable: true,\n get: () => {\n if (ngModuleDef === null) {\n if (ngDevMode && ngModule.imports && ngModule.imports.indexOf(moduleType) > -1) {\n // We need to assert this immediately, because allowing it to continue will cause it to\n // go into an infinite loop before we've reached the point where we throw all the errors.\n throw new Error(`'${stringifyForError(moduleType)}' module can't import itself`);\n }\n const compiler = getCompilerFacade({\n usage: 0 /* JitCompilerUsage.Decorator */,\n kind: 'NgModule',\n type: moduleType\n });\n ngModuleDef = compiler.compileNgModule(angularCoreEnv, `ng:///${moduleType.name}/ɵmod.js`, {\n type: moduleType,\n bootstrap: flatten(ngModule.bootstrap || EMPTY_ARRAY).map(resolveForwardRef),\n declarations: declarations.map(resolveForwardRef),\n imports: flatten(ngModule.imports || EMPTY_ARRAY).map(resolveForwardRef).map(expandModuleWithProviders),\n exports: flatten(ngModule.exports || EMPTY_ARRAY).map(resolveForwardRef).map(expandModuleWithProviders),\n schemas: ngModule.schemas ? flatten(ngModule.schemas) : null,\n id: ngModule.id || null\n });\n // Set `schemas` on ngModuleDef to an empty array in JIT mode to indicate that runtime\n // should verify that there are no unknown elements in a template. In AOT mode, that check\n // happens at compile time and `schemas` information is not present on Component and Module\n // defs after compilation (so the check doesn't happen the second time at runtime).\n if (!ngModuleDef.schemas) {\n ngModuleDef.schemas = [];\n }\n }\n return ngModuleDef;\n }\n });\n let ngFactoryDef = null;\n Object.defineProperty(moduleType, NG_FACTORY_DEF, {\n get: () => {\n if (ngFactoryDef === null) {\n const compiler = getCompilerFacade({\n usage: 0 /* JitCompilerUsage.Decorator */,\n kind: 'NgModule',\n type: moduleType\n });\n ngFactoryDef = compiler.compileFactory(angularCoreEnv, `ng:///${moduleType.name}/ɵfac.js`, {\n name: moduleType.name,\n type: moduleType,\n deps: reflectDependencies(moduleType),\n target: compiler.FactoryTarget.NgModule,\n typeArgumentCount: 0\n });\n }\n return ngFactoryDef;\n },\n // Make the property configurable in dev mode to allow overriding in tests\n configurable: !!ngDevMode\n });\n let ngInjectorDef = null;\n Object.defineProperty(moduleType, NG_INJ_DEF, {\n get: () => {\n if (ngInjectorDef === null) {\n ngDevMode && verifySemanticsOfNgModuleDef(moduleType, allowDuplicateDeclarationsInRoot);\n const meta = {\n name: moduleType.name,\n type: moduleType,\n providers: ngModule.providers || EMPTY_ARRAY,\n imports: [(ngModule.imports || EMPTY_ARRAY).map(resolveForwardRef), (ngModule.exports || EMPTY_ARRAY).map(resolveForwardRef)]\n };\n const compiler = getCompilerFacade({\n usage: 0 /* JitCompilerUsage.Decorator */,\n kind: 'NgModule',\n type: moduleType\n });\n ngInjectorDef = compiler.compileInjector(angularCoreEnv, `ng:///${moduleType.name}/ɵinj.js`, meta);\n }\n return ngInjectorDef;\n },\n // Make the property configurable in dev mode to allow overriding in tests\n configurable: !!ngDevMode\n });\n}\nfunction generateStandaloneInDeclarationsError(type, location) {\n const prefix = `Unexpected \"${stringifyForError(type)}\" found in the \"declarations\" array of the`;\n const suffix = `\"${stringifyForError(type)}\" is marked as standalone and can't be declared ` + 'in any NgModule - did you intend to import it instead (by adding it to the \"imports\" array)?';\n return `${prefix} ${location}, ${suffix}`;\n}\nfunction verifySemanticsOfNgModuleDef(moduleType, allowDuplicateDeclarationsInRoot, importingModule) {\n if (verifiedNgModule.get(moduleType)) return;\n // skip verifications of standalone components, directives, and pipes\n if (isStandalone(moduleType)) return;\n verifiedNgModule.set(moduleType, true);\n moduleType = resolveForwardRef(moduleType);\n let ngModuleDef;\n if (importingModule) {\n ngModuleDef = getNgModuleDef(moduleType);\n if (!ngModuleDef) {\n throw new Error(`Unexpected value '${moduleType.name}' imported by the module '${importingModule.name}'. Please add an @NgModule annotation.`);\n }\n } else {\n ngModuleDef = getNgModuleDefOrThrow(moduleType);\n }\n const errors = [];\n const declarations = maybeUnwrapFn(ngModuleDef.declarations);\n const imports = maybeUnwrapFn(ngModuleDef.imports);\n flatten(imports).map(unwrapModuleWithProvidersImports).forEach(modOrStandaloneCmpt => {\n verifySemanticsOfNgModuleImport(modOrStandaloneCmpt, moduleType);\n verifySemanticsOfNgModuleDef(modOrStandaloneCmpt, false, moduleType);\n });\n const exports = maybeUnwrapFn(ngModuleDef.exports);\n declarations.forEach(verifyDeclarationsHaveDefinitions);\n declarations.forEach(verifyDirectivesHaveSelector);\n declarations.forEach(declarationType => verifyNotStandalone(declarationType, moduleType));\n const combinedDeclarations = [...declarations.map(resolveForwardRef), ...flatten(imports.map(computeCombinedExports)).map(resolveForwardRef)];\n exports.forEach(verifyExportsAreDeclaredOrReExported);\n declarations.forEach(decl => verifyDeclarationIsUnique(decl, allowDuplicateDeclarationsInRoot));\n const ngModule = getAnnotation(moduleType, 'NgModule');\n if (ngModule) {\n ngModule.imports && flatten(ngModule.imports).map(unwrapModuleWithProvidersImports).forEach(mod => {\n verifySemanticsOfNgModuleImport(mod, moduleType);\n verifySemanticsOfNgModuleDef(mod, false, moduleType);\n });\n ngModule.bootstrap && deepForEach(ngModule.bootstrap, verifyCorrectBootstrapType);\n ngModule.bootstrap && deepForEach(ngModule.bootstrap, verifyComponentIsPartOfNgModule);\n }\n // Throw Error if any errors were detected.\n if (errors.length) {\n throw new Error(errors.join('\\n'));\n }\n ////////////////////////////////////////////////////////////////////////////////////////////////\n function verifyDeclarationsHaveDefinitions(type) {\n type = resolveForwardRef(type);\n const def = getComponentDef(type) || getDirectiveDef(type) || getPipeDef$1(type);\n if (!def) {\n errors.push(`Unexpected value '${stringifyForError(type)}' declared by the module '${stringifyForError(moduleType)}'. Please add a @Pipe/@Directive/@Component annotation.`);\n }\n }\n function verifyDirectivesHaveSelector(type) {\n type = resolveForwardRef(type);\n const def = getDirectiveDef(type);\n if (!getComponentDef(type) && def && def.selectors.length == 0) {\n errors.push(`Directive ${stringifyForError(type)} has no selector, please add it!`);\n }\n }\n function verifyNotStandalone(type, moduleType) {\n type = resolveForwardRef(type);\n const def = getComponentDef(type) || getDirectiveDef(type) || getPipeDef$1(type);\n if (def?.standalone) {\n const location = `\"${stringifyForError(moduleType)}\" NgModule`;\n errors.push(generateStandaloneInDeclarationsError(type, location));\n }\n }\n function verifyExportsAreDeclaredOrReExported(type) {\n type = resolveForwardRef(type);\n const kind = getComponentDef(type) && 'component' || getDirectiveDef(type) && 'directive' || getPipeDef$1(type) && 'pipe';\n if (kind) {\n // only checked if we are declared as Component, Directive, or Pipe\n // Modules don't need to be declared or imported.\n if (combinedDeclarations.lastIndexOf(type) === -1) {\n // We are exporting something which we don't explicitly declare or import.\n errors.push(`Can't export ${kind} ${stringifyForError(type)} from ${stringifyForError(moduleType)} as it was neither declared nor imported!`);\n }\n }\n }\n function verifyDeclarationIsUnique(type, suppressErrors) {\n type = resolveForwardRef(type);\n const existingModule = ownerNgModule.get(type);\n if (existingModule && existingModule !== moduleType) {\n if (!suppressErrors) {\n const modules = [existingModule, moduleType].map(stringifyForError).sort();\n errors.push(`Type ${stringifyForError(type)} is part of the declarations of 2 modules: ${modules[0]} and ${modules[1]}! ` + `Please consider moving ${stringifyForError(type)} to a higher module that imports ${modules[0]} and ${modules[1]}. ` + `You can also create a new NgModule that exports and includes ${stringifyForError(type)} then import that NgModule in ${modules[0]} and ${modules[1]}.`);\n }\n } else {\n // Mark type as having owner.\n ownerNgModule.set(type, moduleType);\n }\n }\n function verifyComponentIsPartOfNgModule(type) {\n type = resolveForwardRef(type);\n const existingModule = ownerNgModule.get(type);\n if (!existingModule && !isStandalone(type)) {\n errors.push(`Component ${stringifyForError(type)} is not part of any NgModule or the module has not been imported into your module.`);\n }\n }\n function verifyCorrectBootstrapType(type) {\n type = resolveForwardRef(type);\n if (!getComponentDef(type)) {\n errors.push(`${stringifyForError(type)} cannot be used as an entry component.`);\n }\n if (isStandalone(type)) {\n // Note: this error should be the same as the\n // `NGMODULE_BOOTSTRAP_IS_STANDALONE` one in AOT compiler.\n errors.push(`The \\`${stringifyForError(type)}\\` class is a standalone component, which can ` + `not be used in the \\`@NgModule.bootstrap\\` array. Use the \\`bootstrapApplication\\` ` + `function for bootstrap instead.`);\n }\n }\n function verifySemanticsOfNgModuleImport(type, importingModule) {\n type = resolveForwardRef(type);\n const directiveDef = getComponentDef(type) || getDirectiveDef(type);\n if (directiveDef !== null && !directiveDef.standalone) {\n throw new Error(`Unexpected directive '${type.name}' imported by the module '${importingModule.name}'. Please add an @NgModule annotation.`);\n }\n const pipeDef = getPipeDef$1(type);\n if (pipeDef !== null && !pipeDef.standalone) {\n throw new Error(`Unexpected pipe '${type.name}' imported by the module '${importingModule.name}'. Please add an @NgModule annotation.`);\n }\n }\n}\nfunction unwrapModuleWithProvidersImports(typeOrWithProviders) {\n typeOrWithProviders = resolveForwardRef(typeOrWithProviders);\n return typeOrWithProviders.ngModule || typeOrWithProviders;\n}\nfunction getAnnotation(type, name) {\n let annotation = null;\n collect(type.__annotations__);\n collect(type.decorators);\n return annotation;\n function collect(annotations) {\n if (annotations) {\n annotations.forEach(readAnnotation);\n }\n }\n function readAnnotation(decorator) {\n if (!annotation) {\n const proto = Object.getPrototypeOf(decorator);\n if (proto.ngMetadataName == name) {\n annotation = decorator;\n } else if (decorator.type) {\n const proto = Object.getPrototypeOf(decorator.type);\n if (proto.ngMetadataName == name) {\n annotation = decorator.args[0];\n }\n }\n }\n }\n}\n/**\n * Keep track of compiled components. This is needed because in tests we often want to compile the\n * same component with more than one NgModule. This would cause an error unless we reset which\n * NgModule the component belongs to. We keep the list of compiled components here so that the\n * TestBed can reset it later.\n */\nlet ownerNgModule = new WeakMap();\nlet verifiedNgModule = new WeakMap();\nfunction resetCompiledComponents() {\n ownerNgModule = new WeakMap();\n verifiedNgModule = new WeakMap();\n moduleQueue.length = 0;\n GENERATED_COMP_IDS.clear();\n}\n/**\n * Computes the combined declarations of explicit declarations, as well as declarations inherited by\n * traversing the exports of imported modules.\n * @param type\n */\nfunction computeCombinedExports(type) {\n type = resolveForwardRef(type);\n const ngModuleDef = getNgModuleDef(type);\n // a standalone component, directive or pipe\n if (ngModuleDef === null) {\n return [type];\n }\n return flatten(maybeUnwrapFn(ngModuleDef.exports).map(type => {\n const ngModuleDef = getNgModuleDef(type);\n if (ngModuleDef) {\n verifySemanticsOfNgModuleDef(type, false);\n return computeCombinedExports(type);\n } else {\n return type;\n }\n }));\n}\n/**\n * Some declared components may be compiled asynchronously, and thus may not have their\n * ɵcmp set yet. If this is the case, then a reference to the module is written into\n * the `ngSelectorScope` property of the declared type.\n */\nfunction setScopeOnDeclaredComponents(moduleType, ngModule) {\n const declarations = flatten(ngModule.declarations || EMPTY_ARRAY);\n const transitiveScopes = transitiveScopesFor(moduleType);\n declarations.forEach(declaration => {\n declaration = resolveForwardRef(declaration);\n if (declaration.hasOwnProperty(NG_COMP_DEF)) {\n // A `ɵcmp` field exists - go ahead and patch the component directly.\n const component = declaration;\n const componentDef = getComponentDef(component);\n patchComponentDefWithScope(componentDef, transitiveScopes);\n } else if (!declaration.hasOwnProperty(NG_DIR_DEF) && !declaration.hasOwnProperty(NG_PIPE_DEF)) {\n // Set `ngSelectorScope` for future reference when the component compilation finishes.\n declaration.ngSelectorScope = moduleType;\n }\n });\n}\n/**\n * Patch the definition of a component with directives and pipes from the compilation scope of\n * a given module.\n */\nfunction patchComponentDefWithScope(componentDef, transitiveScopes) {\n componentDef.directiveDefs = () => Array.from(transitiveScopes.compilation.directives).map(dir => dir.hasOwnProperty(NG_COMP_DEF) ? getComponentDef(dir) : getDirectiveDef(dir)).filter(def => !!def);\n componentDef.pipeDefs = () => Array.from(transitiveScopes.compilation.pipes).map(pipe => getPipeDef$1(pipe));\n componentDef.schemas = transitiveScopes.schemas;\n // Since we avoid Components/Directives/Pipes recompiling in case there are no overrides, we\n // may face a problem where previously compiled defs available to a given Component/Directive\n // are cached in TView and may become stale (in case any of these defs gets recompiled). In\n // order to avoid this problem, we force fresh TView to be created.\n componentDef.tView = null;\n}\n/**\n * Compute the pair of transitive scopes (compilation scope and exported scope) for a given type\n * (either a NgModule or a standalone component / directive / pipe).\n */\nfunction transitiveScopesFor(type) {\n if (isNgModule(type)) {\n const scope = depsTracker.getNgModuleScope(type);\n const def = getNgModuleDefOrThrow(type);\n return {\n schemas: def.schemas || null,\n ...scope\n };\n } else if (isStandalone(type)) {\n const directiveDef = getComponentDef(type) || getDirectiveDef(type);\n if (directiveDef !== null) {\n return {\n schemas: null,\n compilation: {\n directives: new Set(),\n pipes: new Set()\n },\n exported: {\n directives: new Set([type]),\n pipes: new Set()\n }\n };\n }\n const pipeDef = getPipeDef$1(type);\n if (pipeDef !== null) {\n return {\n schemas: null,\n compilation: {\n directives: new Set(),\n pipes: new Set()\n },\n exported: {\n directives: new Set(),\n pipes: new Set([type])\n }\n };\n }\n }\n // TODO: change the error message to be more user-facing and take standalone into account\n throw new Error(`${type.name} does not have a module def (ɵmod property)`);\n}\nfunction expandModuleWithProviders(value) {\n if (isModuleWithProviders(value)) {\n return value.ngModule;\n }\n return value;\n}\n\n/**\n * Keep track of the compilation depth to avoid reentrancy issues during JIT compilation. This\n * matters in the following scenario:\n *\n * Consider a component 'A' that extends component 'B', both declared in module 'M'. During\n * the compilation of 'A' the definition of 'B' is requested to capture the inheritance chain,\n * potentially triggering compilation of 'B'. If this nested compilation were to trigger\n * `flushModuleScopingQueueAsMuchAsPossible` it may happen that module 'M' is still pending in the\n * queue, resulting in 'A' and 'B' to be patched with the NgModule scope. As the compilation of\n * 'A' is still in progress, this would introduce a circular dependency on its compilation. To avoid\n * this issue, the module scope queue is only flushed for compilations at the depth 0, to ensure\n * all compilations have finished.\n */\nlet compilationDepth = 0;\n/**\n * Compile an Angular component according to its decorator metadata, and patch the resulting\n * component def (ɵcmp) onto the component type.\n *\n * Compilation may be asynchronous (due to the need to resolve URLs for the component template or\n * other resources, for example). In the event that compilation is not immediate, `compileComponent`\n * will enqueue resource resolution into a global queue and will fail to return the `ɵcmp`\n * until the global queue has been resolved with a call to `resolveComponentResources`.\n */\nfunction compileComponent(type, metadata) {\n // Initialize ngDevMode. This must be the first statement in compileComponent.\n // See the `initNgDevMode` docstring for more information.\n (typeof ngDevMode === 'undefined' || ngDevMode) && initNgDevMode();\n let ngComponentDef = null;\n // Metadata may have resources which need to be resolved.\n maybeQueueResolutionOfComponentResources(type, metadata);\n // Note that we're using the same function as `Directive`, because that's only subset of metadata\n // that we need to create the ngFactoryDef. We're avoiding using the component metadata\n // because we'd have to resolve the asynchronous templates.\n addDirectiveFactoryDef(type, metadata);\n Object.defineProperty(type, NG_COMP_DEF, {\n get: () => {\n if (ngComponentDef === null) {\n const compiler = getCompilerFacade({\n usage: 0 /* JitCompilerUsage.Decorator */,\n kind: 'component',\n type: type\n });\n if (componentNeedsResolution(metadata)) {\n const error = [`Component '${type.name}' is not resolved:`];\n if (metadata.templateUrl) {\n error.push(` - templateUrl: ${metadata.templateUrl}`);\n }\n if (metadata.styleUrls && metadata.styleUrls.length) {\n error.push(` - styleUrls: ${JSON.stringify(metadata.styleUrls)}`);\n }\n if (metadata.styleUrl) {\n error.push(` - styleUrl: ${metadata.styleUrl}`);\n }\n error.push(`Did you run and wait for 'resolveComponentResources()'?`);\n throw new Error(error.join('\\n'));\n }\n // This const was called `jitOptions` previously but had to be renamed to `options` because\n // of a bug with Terser that caused optimized JIT builds to throw a `ReferenceError`.\n // This bug was investigated in https://github.com/angular/angular-cli/issues/17264.\n // We should not rename it back until https://github.com/terser/terser/issues/615 is fixed.\n const options = getJitOptions();\n let preserveWhitespaces = metadata.preserveWhitespaces;\n if (preserveWhitespaces === undefined) {\n if (options !== null && options.preserveWhitespaces !== undefined) {\n preserveWhitespaces = options.preserveWhitespaces;\n } else {\n preserveWhitespaces = false;\n }\n }\n let encapsulation = metadata.encapsulation;\n if (encapsulation === undefined) {\n if (options !== null && options.defaultEncapsulation !== undefined) {\n encapsulation = options.defaultEncapsulation;\n } else {\n encapsulation = ViewEncapsulation.Emulated;\n }\n }\n const templateUrl = metadata.templateUrl || `ng:///${type.name}/template.html`;\n const baseMeta = directiveMetadata(type, metadata);\n const meta = {\n ...baseMeta,\n typeSourceSpan: compiler.createParseSourceSpan('Component', type.name, templateUrl),\n template: metadata.template || '',\n preserveWhitespaces,\n styles: typeof metadata.styles === 'string' ? [metadata.styles] : metadata.styles || EMPTY_ARRAY,\n animations: metadata.animations,\n // JIT components are always compiled against an empty set of `declarations`. Instead, the\n // `directiveDefs` and `pipeDefs` are updated at a later point:\n // * for NgModule-based components, they're set when the NgModule which declares the\n // component resolves in the module scoping queue\n // * for standalone components, they're set just below, after `compileComponent`.\n declarations: [],\n changeDetection: metadata.changeDetection,\n encapsulation,\n interpolation: metadata.interpolation,\n viewProviders: metadata.viewProviders || null,\n // We can't inspect whether any of the dependencies are actually directives, because they\n // get patched on after compilation. That's why in JIT mode we consider that any\n // dependency might be a directive dependency.\n hasDirectiveDependencies: !baseMeta.isStandalone || metadata.imports != null && metadata.imports.length > 0\n };\n compilationDepth++;\n try {\n if (meta.usesInheritance) {\n addDirectiveDefToUndecoratedParents(type);\n }\n ngComponentDef = compiler.compileComponent(angularCoreEnv, templateUrl, meta);\n if (meta.isStandalone) {\n // Patch the component definition for standalone components with `directiveDefs` and\n // `pipeDefs` functions which lazily compute the directives/pipes available in the\n // standalone component. Also set `dependencies` to the lazily resolved list of imports.\n const imports = flatten(metadata.imports || EMPTY_ARRAY);\n const {\n directiveDefs,\n pipeDefs\n } = getStandaloneDefFunctions(type, imports);\n ngComponentDef.directiveDefs = directiveDefs;\n ngComponentDef.pipeDefs = pipeDefs;\n ngComponentDef.dependencies = () => imports.map(resolveForwardRef);\n }\n } finally {\n // Ensure that the compilation depth is decremented even when the compilation failed.\n compilationDepth--;\n }\n if (compilationDepth === 0) {\n // When NgModule decorator executed, we enqueued the module definition such that\n // it would only dequeue and add itself as module scope to all of its declarations,\n // but only if if all of its declarations had resolved. This call runs the check\n // to see if any modules that are in the queue can be dequeued and add scope to\n // their declarations.\n flushModuleScopingQueueAsMuchAsPossible();\n }\n // If component compilation is async, then the @NgModule annotation which declares the\n // component may execute and set an ngSelectorScope property on the component type. This\n // allows the component to patch itself with directiveDefs from the module after it\n // finishes compiling.\n if (hasSelectorScope(type)) {\n const scopes = transitiveScopesFor(type.ngSelectorScope);\n patchComponentDefWithScope(ngComponentDef, scopes);\n }\n if (metadata.schemas) {\n if (meta.isStandalone) {\n ngComponentDef.schemas = metadata.schemas;\n } else {\n throw new Error(`The 'schemas' was specified for the ${stringifyForError(type)} but is only valid on a component that is standalone.`);\n }\n } else if (meta.isStandalone) {\n ngComponentDef.schemas = [];\n }\n }\n return ngComponentDef;\n },\n set: def => {\n ngComponentDef = def;\n },\n // Make the property configurable in dev mode to allow overriding in tests\n configurable: !!ngDevMode\n });\n}\n/**\n * Build memoized `directiveDefs` and `pipeDefs` functions for the component definition of a\n * standalone component, which process `imports` and filter out directives and pipes. The use of\n * memoized functions here allows for the delayed resolution of any `forwardRef`s present in the\n * component's `imports`.\n */\nfunction getStandaloneDefFunctions(type, imports) {\n const directiveDefs = () => {\n if (ngDevMode) {\n for (const rawDep of imports) {\n verifyStandaloneImport(rawDep, type);\n }\n }\n if (!isComponent(type)) {\n return [];\n }\n const scope = depsTracker.getStandaloneComponentScope(type, imports);\n return [...scope.compilation.directives].map(p => getComponentDef(p) || getDirectiveDef(p)).filter(d => d !== null);\n };\n const pipeDefs = () => {\n if (ngDevMode) {\n for (const rawDep of imports) {\n verifyStandaloneImport(rawDep, type);\n }\n }\n if (!isComponent(type)) {\n return [];\n }\n const scope = depsTracker.getStandaloneComponentScope(type, imports);\n return [...scope.compilation.pipes].map(p => getPipeDef$1(p)).filter(d => d !== null);\n };\n return {\n directiveDefs,\n pipeDefs\n };\n}\nfunction hasSelectorScope(component) {\n return component.ngSelectorScope !== undefined;\n}\n/**\n * Compile an Angular directive according to its decorator metadata, and patch the resulting\n * directive def onto the component type.\n *\n * In the event that compilation is not immediate, `compileDirective` will return a `Promise` which\n * will resolve when compilation completes and the directive becomes usable.\n */\nfunction compileDirective(type, directive) {\n let ngDirectiveDef = null;\n addDirectiveFactoryDef(type, directive || {});\n Object.defineProperty(type, NG_DIR_DEF, {\n get: () => {\n if (ngDirectiveDef === null) {\n // `directive` can be null in the case of abstract directives as a base class\n // that use `@Directive()` with no selector. In that case, pass empty object to the\n // `directiveMetadata` function instead of null.\n const meta = getDirectiveMetadata(type, directive || {});\n const compiler = getCompilerFacade({\n usage: 0 /* JitCompilerUsage.Decorator */,\n kind: 'directive',\n type\n });\n ngDirectiveDef = compiler.compileDirective(angularCoreEnv, meta.sourceMapUrl, meta.metadata);\n }\n return ngDirectiveDef;\n },\n // Make the property configurable in dev mode to allow overriding in tests\n configurable: !!ngDevMode\n });\n}\nfunction getDirectiveMetadata(type, metadata) {\n const name = type && type.name;\n const sourceMapUrl = `ng:///${name}/ɵdir.js`;\n const compiler = getCompilerFacade({\n usage: 0 /* JitCompilerUsage.Decorator */,\n kind: 'directive',\n type\n });\n const facade = directiveMetadata(type, metadata);\n facade.typeSourceSpan = compiler.createParseSourceSpan('Directive', name, sourceMapUrl);\n if (facade.usesInheritance) {\n addDirectiveDefToUndecoratedParents(type);\n }\n return {\n metadata: facade,\n sourceMapUrl\n };\n}\nfunction addDirectiveFactoryDef(type, metadata) {\n let ngFactoryDef = null;\n Object.defineProperty(type, NG_FACTORY_DEF, {\n get: () => {\n if (ngFactoryDef === null) {\n const meta = getDirectiveMetadata(type, metadata);\n const compiler = getCompilerFacade({\n usage: 0 /* JitCompilerUsage.Decorator */,\n kind: 'directive',\n type\n });\n ngFactoryDef = compiler.compileFactory(angularCoreEnv, `ng:///${type.name}/ɵfac.js`, {\n name: meta.metadata.name,\n type: meta.metadata.type,\n typeArgumentCount: 0,\n deps: reflectDependencies(type),\n target: compiler.FactoryTarget.Directive\n });\n }\n return ngFactoryDef;\n },\n // Make the property configurable in dev mode to allow overriding in tests\n configurable: !!ngDevMode\n });\n}\nfunction extendsDirectlyFromObject(type) {\n return Object.getPrototypeOf(type.prototype) === Object.prototype;\n}\n/**\n * Extract the `R3DirectiveMetadata` for a particular directive (either a `Directive` or a\n * `Component`).\n */\nfunction directiveMetadata(type, metadata) {\n // Reflect inputs and outputs.\n const reflect = getReflect();\n const propMetadata = reflect.ownPropMetadata(type);\n return {\n name: type.name,\n type: type,\n selector: metadata.selector !== undefined ? metadata.selector : null,\n host: metadata.host || EMPTY_OBJ,\n propMetadata: propMetadata,\n inputs: metadata.inputs || EMPTY_ARRAY,\n outputs: metadata.outputs || EMPTY_ARRAY,\n queries: extractQueriesMetadata(type, propMetadata, isContentQuery),\n lifecycle: {\n usesOnChanges: reflect.hasLifecycleHook(type, 'ngOnChanges')\n },\n typeSourceSpan: null,\n usesInheritance: !extendsDirectlyFromObject(type),\n exportAs: extractExportAs(metadata.exportAs),\n providers: metadata.providers || null,\n viewQueries: extractQueriesMetadata(type, propMetadata, isViewQuery),\n isStandalone: metadata.standalone === undefined ? true : !!metadata.standalone,\n isSignal: !!metadata.signals,\n hostDirectives: metadata.hostDirectives?.map(directive => typeof directive === 'function' ? {\n directive\n } : directive) || null\n };\n}\n/**\n * Adds a directive definition to all parent classes of a type that don't have an Angular decorator.\n */\nfunction addDirectiveDefToUndecoratedParents(type) {\n const objPrototype = Object.prototype;\n let parent = Object.getPrototypeOf(type.prototype).constructor;\n // Go up the prototype until we hit `Object`.\n while (parent && parent !== objPrototype) {\n // Since inheritance works if the class was annotated already, we only need to add\n // the def if there are no annotations and the def hasn't been created already.\n if (!getDirectiveDef(parent) && !getComponentDef(parent) && shouldAddAbstractDirective(parent)) {\n compileDirective(parent, null);\n }\n parent = Object.getPrototypeOf(parent);\n }\n}\nfunction convertToR3QueryPredicate(selector) {\n return typeof selector === 'string' ? splitByComma(selector) : resolveForwardRef(selector);\n}\nfunction convertToR3QueryMetadata(propertyName, ann) {\n return {\n propertyName: propertyName,\n predicate: convertToR3QueryPredicate(ann.selector),\n descendants: ann.descendants,\n first: ann.first,\n read: ann.read ? ann.read : null,\n static: !!ann.static,\n emitDistinctChangesOnly: !!ann.emitDistinctChangesOnly,\n isSignal: !!ann.isSignal\n };\n}\nfunction extractQueriesMetadata(type, propMetadata, isQueryAnn) {\n const queriesMeta = [];\n for (const field in propMetadata) {\n if (propMetadata.hasOwnProperty(field)) {\n const annotations = propMetadata[field];\n annotations.forEach(ann => {\n if (isQueryAnn(ann)) {\n if (!ann.selector) {\n throw new Error(`Can't construct a query for the property \"${field}\" of ` + `\"${stringifyForError(type)}\" since the query selector wasn't defined.`);\n }\n if (annotations.some(isInputAnnotation)) {\n throw new Error(`Cannot combine @Input decorators with query decorators`);\n }\n queriesMeta.push(convertToR3QueryMetadata(field, ann));\n }\n });\n }\n }\n return queriesMeta;\n}\nfunction extractExportAs(exportAs) {\n return exportAs === undefined ? null : splitByComma(exportAs);\n}\nfunction isContentQuery(value) {\n const name = value.ngMetadataName;\n return name === 'ContentChild' || name === 'ContentChildren';\n}\nfunction isViewQuery(value) {\n const name = value.ngMetadataName;\n return name === 'ViewChild' || name === 'ViewChildren';\n}\nfunction isInputAnnotation(value) {\n return value.ngMetadataName === 'Input';\n}\nfunction splitByComma(value) {\n return value.split(',').map(piece => piece.trim());\n}\nconst LIFECYCLE_HOOKS = ['ngOnChanges', 'ngOnInit', 'ngOnDestroy', 'ngDoCheck', 'ngAfterViewInit', 'ngAfterViewChecked', 'ngAfterContentInit', 'ngAfterContentChecked'];\nfunction shouldAddAbstractDirective(type) {\n const reflect = getReflect();\n if (LIFECYCLE_HOOKS.some(hookName => reflect.hasLifecycleHook(type, hookName))) {\n return true;\n }\n const propMetadata = reflect.propMetadata(type);\n for (const field in propMetadata) {\n const annotations = propMetadata[field];\n for (let i = 0; i < annotations.length; i++) {\n const current = annotations[i];\n const metadataName = current.ngMetadataName;\n if (isInputAnnotation(current) || isContentQuery(current) || isViewQuery(current) || metadataName === 'Output' || metadataName === 'HostBinding' || metadataName === 'HostListener') {\n return true;\n }\n }\n }\n return false;\n}\nfunction compilePipe(type, meta) {\n let ngPipeDef = null;\n let ngFactoryDef = null;\n Object.defineProperty(type, NG_FACTORY_DEF, {\n get: () => {\n if (ngFactoryDef === null) {\n const metadata = getPipeMetadata(type, meta);\n const compiler = getCompilerFacade({\n usage: 0 /* JitCompilerUsage.Decorator */,\n kind: 'pipe',\n type: metadata.type\n });\n ngFactoryDef = compiler.compileFactory(angularCoreEnv, `ng:///${metadata.name}/ɵfac.js`, {\n name: metadata.name,\n type: metadata.type,\n typeArgumentCount: 0,\n deps: reflectDependencies(type),\n target: compiler.FactoryTarget.Pipe\n });\n }\n return ngFactoryDef;\n },\n // Make the property configurable in dev mode to allow overriding in tests\n configurable: !!ngDevMode\n });\n Object.defineProperty(type, NG_PIPE_DEF, {\n get: () => {\n if (ngPipeDef === null) {\n const metadata = getPipeMetadata(type, meta);\n const compiler = getCompilerFacade({\n usage: 0 /* JitCompilerUsage.Decorator */,\n kind: 'pipe',\n type: metadata.type\n });\n ngPipeDef = compiler.compilePipe(angularCoreEnv, `ng:///${metadata.name}/ɵpipe.js`, metadata);\n }\n return ngPipeDef;\n },\n // Make the property configurable in dev mode to allow overriding in tests\n configurable: !!ngDevMode\n });\n}\nfunction getPipeMetadata(type, meta) {\n return {\n type: type,\n name: type.name,\n pipeName: meta.name,\n pure: meta.pure !== undefined ? meta.pure : true,\n isStandalone: meta.standalone === undefined ? true : !!meta.standalone\n };\n}\n\n/**\n * Type of the Directive metadata.\n *\n * @publicApi\n */\nconst Directive = makeDecorator('Directive', (dir = {}) => dir, undefined, undefined, (type, meta) => compileDirective(type, meta));\n/**\n * Component decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nconst Component = makeDecorator('Component', (c = {}) => ({\n changeDetection: ChangeDetectionStrategy.Default,\n ...c\n}), Directive, undefined, (type, meta) => compileComponent(type, meta));\n/**\n * @Annotation\n * @publicApi\n */\nconst Pipe = makeDecorator('Pipe', p => ({\n pure: true,\n ...p\n}), undefined, undefined, (type, meta) => compilePipe(type, meta));\n/**\n * @Annotation\n * @publicApi\n */\nconst Input = makePropDecorator('Input', arg => {\n if (!arg) {\n return {};\n }\n return typeof arg === 'string' ? {\n alias: arg\n } : arg;\n});\n/**\n * @Annotation\n * @publicApi\n */\nconst Output = makePropDecorator('Output', alias => ({\n alias\n}));\n/**\n * @Annotation\n * @publicApi\n */\nconst HostBinding = makePropDecorator('HostBinding', hostPropertyName => ({\n hostPropertyName\n}));\n/**\n * @Annotation\n * @publicApi\n */\nconst HostListener = makePropDecorator('HostListener', (eventName, args) => ({\n eventName,\n args\n}));\n\n/**\n * @Annotation\n */\nconst NgModule = makeDecorator('NgModule', ngModule => ngModule, undefined, undefined,\n/**\n * Decorator that marks the following class as an NgModule, and supplies\n * configuration metadata for it.\n *\n * * The `declarations` option configures the compiler\n * with information about what belongs to the NgModule.\n * * The `providers` options configures the NgModule's injector to provide\n * dependencies the NgModule members.\n * * The `imports` and `exports` options bring in members from other modules, and make\n * this module's members available to others.\n */\n(type, meta) => compileNgModule(type, meta));\n\n/**\n * Combination of NgModuleFactory and ComponentFactories.\n *\n * @publicApi\n *\n * @deprecated\n * Ivy JIT mode doesn't require accessing this symbol.\n */\nclass ModuleWithComponentFactories {\n ngModuleFactory;\n componentFactories;\n constructor(ngModuleFactory, componentFactories) {\n this.ngModuleFactory = ngModuleFactory;\n this.componentFactories = componentFactories;\n }\n}\n/**\n * Low-level service for running the angular compiler during runtime\n * to create {@link ComponentFactory}s, which\n * can later be used to create and render a Component instance.\n *\n * Each `@NgModule` provides an own `Compiler` to its injector,\n * that will use the directives/pipes of the ng module for compilation\n * of components.\n *\n * @publicApi\n *\n * @deprecated\n * Ivy JIT mode doesn't require accessing this symbol.\n */\nclass Compiler {\n /**\n * Compiles the given NgModule and all of its components. All templates of the components\n * have to be inlined.\n */\n compileModuleSync(moduleType) {\n return new NgModuleFactory(moduleType);\n }\n /**\n * Compiles the given NgModule and all of its components\n */\n compileModuleAsync(moduleType) {\n return Promise.resolve(this.compileModuleSync(moduleType));\n }\n /**\n * Same as {@link Compiler#compileModuleSync compileModuleSync} but also creates ComponentFactories for all components.\n */\n compileModuleAndAllComponentsSync(moduleType) {\n const ngModuleFactory = this.compileModuleSync(moduleType);\n const moduleDef = getNgModuleDef(moduleType);\n const componentFactories = maybeUnwrapFn(moduleDef.declarations).reduce((factories, declaration) => {\n const componentDef = getComponentDef(declaration);\n componentDef && factories.push(new ComponentFactory(componentDef));\n return factories;\n }, []);\n return new ModuleWithComponentFactories(ngModuleFactory, componentFactories);\n }\n /**\n * Same as {@link Compiler#compileModuleAsync compileModuleAsync} but also creates ComponentFactories for all components.\n */\n compileModuleAndAllComponentsAsync(moduleType) {\n return Promise.resolve(this.compileModuleAndAllComponentsSync(moduleType));\n }\n /**\n * Clears all caches.\n */\n clearCache() {}\n /**\n * Clears the cache for the given component/ngModule.\n */\n clearCacheFor(type) {}\n /**\n * Returns the id for a given NgModule, if one is defined and known to the compiler.\n */\n getModuleId(moduleType) {\n return undefined;\n }\n static ɵfac = function Compiler_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || Compiler)();\n };\n static ɵprov = /*@__PURE__*/__defineInjectable({\n token: Compiler,\n factory: Compiler.ɵfac,\n providedIn: 'root'\n });\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && setClassMetadata(Compiler, [{\n type: Injectable,\n args: [{\n providedIn: 'root'\n }]\n }], null, null);\n})();\n/**\n * Token to provide CompilerOptions in the platform injector.\n *\n * @publicApi\n */\nconst COMPILER_OPTIONS = new InjectionToken(ngDevMode ? 'compilerOptions' : '');\n/**\n * A factory for creating a Compiler\n *\n * @publicApi\n *\n * @deprecated\n * Ivy JIT mode doesn't require accessing this symbol.\n */\nclass CompilerFactory {}\nclass NgZoneChangeDetectionScheduler {\n zone = inject(NgZone);\n changeDetectionScheduler = inject(ChangeDetectionScheduler);\n applicationRef = inject(ApplicationRef);\n applicationErrorHandler = inject(INTERNAL_APPLICATION_ERROR_HANDLER);\n _onMicrotaskEmptySubscription;\n initialize() {\n if (this._onMicrotaskEmptySubscription) {\n return;\n }\n this._onMicrotaskEmptySubscription = this.zone.onMicrotaskEmpty.subscribe({\n next: () => {\n // `onMicroTaskEmpty` can happen _during_ the zoneless scheduler change detection because\n // zone.run(() => {}) will result in `checkStable` at the end of the `zone.run` closure\n // and emit `onMicrotaskEmpty` synchronously if run coalsecing is false.\n if (this.changeDetectionScheduler.runningTick) {\n return;\n }\n this.zone.run(() => {\n try {\n this.applicationRef.dirtyFlags |= 1 /* ApplicationRefDirtyFlags.ViewTreeGlobal */;\n this.applicationRef._tick();\n } catch (e) {\n this.applicationErrorHandler(e);\n }\n });\n }\n });\n }\n ngOnDestroy() {\n this._onMicrotaskEmptySubscription?.unsubscribe();\n }\n static ɵfac = function NgZoneChangeDetectionScheduler_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || NgZoneChangeDetectionScheduler)();\n };\n static ɵprov = /*@__PURE__*/__defineInjectable({\n token: NgZoneChangeDetectionScheduler,\n factory: NgZoneChangeDetectionScheduler.ɵfac,\n providedIn: 'root'\n });\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && setClassMetadata(NgZoneChangeDetectionScheduler, [{\n type: Injectable,\n args: [{\n providedIn: 'root'\n }]\n }], null, null);\n})();\n/**\n * Internal token used to verify that `provideZoneChangeDetection` is not used\n * with the bootstrapModule API.\n */\nconst PROVIDED_NG_ZONE = new InjectionToken(typeof ngDevMode === 'undefined' || ngDevMode ? 'provideZoneChangeDetection token' : '', {\n factory: () => false\n});\nfunction internalProvideZoneChangeDetection({\n ngZoneFactory,\n ignoreChangesOutsideZone,\n scheduleInRootZone\n}) {\n ngZoneFactory ??= () => new NgZone({\n ...getNgZoneOptions(),\n scheduleInRootZone\n });\n return [{\n provide: NgZone,\n useFactory: ngZoneFactory\n }, {\n provide: ENVIRONMENT_INITIALIZER,\n multi: true,\n useFactory: () => {\n const ngZoneChangeDetectionScheduler = inject(NgZoneChangeDetectionScheduler, {\n optional: true\n });\n if ((typeof ngDevMode === 'undefined' || ngDevMode) && ngZoneChangeDetectionScheduler === null) {\n throw new RuntimeError(402 /* RuntimeErrorCode.MISSING_REQUIRED_INJECTABLE_IN_BOOTSTRAP */, `A required Injectable was not found in the dependency injection tree. ` + 'If you are bootstrapping an NgModule, make sure that the `BrowserModule` is imported.');\n }\n return () => ngZoneChangeDetectionScheduler.initialize();\n }\n }, {\n provide: ENVIRONMENT_INITIALIZER,\n multi: true,\n useFactory: () => {\n const service = inject(ZoneStablePendingTask);\n return () => {\n service.initialize();\n };\n }\n },\n // Always disable scheduler whenever explicitly disabled, even if another place called\n // `provideZoneChangeDetection` without the 'ignore' option.\n ignoreChangesOutsideZone === true ? {\n provide: ZONELESS_SCHEDULER_DISABLED,\n useValue: true\n } : [], {\n provide: SCHEDULE_IN_ROOT_ZONE,\n useValue: scheduleInRootZone ?? SCHEDULE_IN_ROOT_ZONE_DEFAULT\n }, {\n provide: INTERNAL_APPLICATION_ERROR_HANDLER,\n useFactory: () => {\n const zone = inject(NgZone);\n const injector = inject(EnvironmentInjector);\n let userErrorHandler;\n return e => {\n zone.runOutsideAngular(() => {\n if (injector.destroyed && !userErrorHandler) {\n setTimeout(() => {\n throw e;\n });\n } else {\n userErrorHandler ??= injector.get(ErrorHandler);\n userErrorHandler.handleError(e);\n }\n });\n };\n }\n }];\n}\n/**\n * Provides `NgZone`-based change detection for the application bootstrapped using\n * `bootstrapApplication`.\n *\n * `NgZone` is already provided in applications by default. This provider allows you to configure\n * options like `eventCoalescing` in the `NgZone`.\n * This provider is not available for `platformBrowser().bootstrapModule`, which uses\n * `BootstrapOptions` instead.\n *\n * @usageNotes\n * ```ts\n * bootstrapApplication(MyApp, {providers: [\n * provideZoneChangeDetection({eventCoalescing: true}),\n * ]});\n * ```\n *\n * @publicApi\n * @see {@link /api/platform-browser/bootstrapApplication bootstrapApplication}\n * @see {@link NgZoneOptions}\n */\nfunction provideZoneChangeDetection(options) {\n const ignoreChangesOutsideZone = options?.ignoreChangesOutsideZone;\n const scheduleInRootZone = options?.scheduleInRootZone;\n const zoneProviders = internalProvideZoneChangeDetection({\n ngZoneFactory: () => {\n const ngZoneOptions = getNgZoneOptions(options);\n ngZoneOptions.scheduleInRootZone = scheduleInRootZone;\n if (ngZoneOptions.shouldCoalesceEventChangeDetection) {\n performanceMarkFeature('NgZone_CoalesceEvent');\n }\n return new NgZone(ngZoneOptions);\n },\n ignoreChangesOutsideZone,\n scheduleInRootZone\n });\n return makeEnvironmentProviders([{\n provide: PROVIDED_NG_ZONE,\n useValue: true\n }, {\n provide: ZONELESS_ENABLED,\n useValue: false\n }, zoneProviders]);\n}\n// Transforms a set of `BootstrapOptions` (supported by the NgModule-based bootstrap APIs) ->\n// `NgZoneOptions` that are recognized by the NgZone constructor. Passing no options will result in\n// a set of default options returned.\nfunction getNgZoneOptions(options) {\n return {\n enableLongStackTrace: typeof ngDevMode === 'undefined' ? false : !!ngDevMode,\n shouldCoalesceEventChangeDetection: options?.eventCoalescing ?? false,\n shouldCoalesceRunChangeDetection: options?.runCoalescing ?? false\n };\n}\nclass ZoneStablePendingTask {\n subscription = new Subscription();\n initialized = false;\n zone = inject(NgZone);\n pendingTasks = inject(PendingTasksInternal);\n initialize() {\n if (this.initialized) {\n return;\n }\n this.initialized = true;\n let task = null;\n if (!this.zone.isStable && !this.zone.hasPendingMacrotasks && !this.zone.hasPendingMicrotasks) {\n task = this.pendingTasks.add();\n }\n this.zone.runOutsideAngular(() => {\n this.subscription.add(this.zone.onStable.subscribe(() => {\n NgZone.assertNotInAngularZone();\n // Check whether there are no pending macro/micro tasks in the next tick\n // to allow for NgZone to update the state.\n queueMicrotask(() => {\n if (task !== null && !this.zone.hasPendingMacrotasks && !this.zone.hasPendingMicrotasks) {\n this.pendingTasks.remove(task);\n task = null;\n }\n });\n }));\n });\n this.subscription.add(this.zone.onUnstable.subscribe(() => {\n NgZone.assertInAngularZone();\n task ??= this.pendingTasks.add();\n }));\n }\n ngOnDestroy() {\n this.subscription.unsubscribe();\n }\n static ɵfac = function ZoneStablePendingTask_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || ZoneStablePendingTask)();\n };\n static ɵprov = /*@__PURE__*/__defineInjectable({\n token: ZoneStablePendingTask,\n factory: ZoneStablePendingTask.ɵfac,\n providedIn: 'root'\n });\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && setClassMetadata(ZoneStablePendingTask, [{\n type: Injectable,\n args: [{\n providedIn: 'root'\n }]\n }], null, null);\n})();\nconst CONSECUTIVE_MICROTASK_NOTIFICATION_LIMIT = 100;\nlet consecutiveMicrotaskNotifications = 0;\nlet stackFromLastFewNotifications = [];\nfunction trackMicrotaskNotificationForDebugging() {\n consecutiveMicrotaskNotifications++;\n if (CONSECUTIVE_MICROTASK_NOTIFICATION_LIMIT - consecutiveMicrotaskNotifications < 5) {\n const stack = new Error().stack;\n if (stack) {\n stackFromLastFewNotifications.push(stack);\n }\n }\n if (consecutiveMicrotaskNotifications === CONSECUTIVE_MICROTASK_NOTIFICATION_LIMIT) {\n throw new RuntimeError(103 /* RuntimeErrorCode.INFINITE_CHANGE_DETECTION */, 'Angular could not stabilize because there were endless change notifications within the browser event loop. ' + 'The stack from the last several notifications: \\n' + stackFromLastFewNotifications.join('\\n'));\n }\n}\nclass ChangeDetectionSchedulerImpl {\n applicationErrorHandler = inject(INTERNAL_APPLICATION_ERROR_HANDLER);\n appRef = inject(ApplicationRef);\n taskService = inject(PendingTasksInternal);\n ngZone = inject(NgZone);\n zonelessEnabled = inject(ZONELESS_ENABLED);\n tracing = inject(TracingService, {\n optional: true\n });\n disableScheduling = inject(ZONELESS_SCHEDULER_DISABLED, {\n optional: true\n }) ?? false;\n zoneIsDefined = typeof Zone !== 'undefined' && !!Zone.root.run;\n schedulerTickApplyArgs = [{\n data: {\n '__scheduler_tick__': true\n }\n }];\n subscriptions = new Subscription();\n angularZoneId = this.zoneIsDefined ? this.ngZone._inner?.get(angularZoneInstanceIdProperty) : null;\n scheduleInRootZone = !this.zonelessEnabled && this.zoneIsDefined && (inject(SCHEDULE_IN_ROOT_ZONE, {\n optional: true\n }) ?? false);\n cancelScheduledCallback = null;\n useMicrotaskScheduler = false;\n runningTick = false;\n pendingRenderTaskId = null;\n constructor() {\n this.subscriptions.add(this.appRef.afterTick.subscribe(() => {\n // If the scheduler isn't running a tick but the application ticked, that means\n // someone called ApplicationRef.tick manually. In this case, we should cancel\n // any change detections that had been scheduled so we don't run an extra one.\n if (!this.runningTick) {\n this.cleanup();\n }\n }));\n this.subscriptions.add(this.ngZone.onUnstable.subscribe(() => {\n // If the zone becomes unstable when we're not running tick (this happens from the zone.run),\n // we should cancel any scheduled change detection here because at this point we\n // know that the zone will stabilize at some point and run change detection itself.\n if (!this.runningTick) {\n this.cleanup();\n }\n }));\n // TODO(atscott): These conditions will need to change when zoneless is the default\n // Instead, they should flip to checking if ZoneJS scheduling is provided\n this.disableScheduling ||= !this.zonelessEnabled && (\n // NoopNgZone without enabling zoneless means no scheduling whatsoever\n this.ngZone instanceof NoopNgZone ||\n // The same goes for the lack of Zone without enabling zoneless scheduling\n !this.zoneIsDefined);\n }\n notify(source) {\n if (!this.zonelessEnabled && source === 5 /* NotificationSource.Listener */) {\n // When the notification comes from a listener, we skip the notification unless the\n // application has enabled zoneless. Ideally, listeners wouldn't notify the scheduler at all\n // automatically. We do not know that a developer made a change in the listener callback that\n // requires an `ApplicationRef.tick` (synchronize templates / run render hooks). We do this\n // only for an easier migration from OnPush components to zoneless. Because listeners are\n // usually executed inside the Angular zone and listeners automatically call `markViewDirty`,\n // developers never needed to manually use `ChangeDetectorRef.markForCheck` or some other API\n // to make listener callbacks work correctly with `OnPush` components.\n return;\n }\n let force = false;\n switch (source) {\n case 0 /* NotificationSource.MarkAncestorsForTraversal */:\n {\n this.appRef.dirtyFlags |= 2 /* ApplicationRefDirtyFlags.ViewTreeTraversal */;\n break;\n }\n case 3 /* NotificationSource.DebugApplyChanges */:\n case 2 /* NotificationSource.DeferBlockStateUpdate */:\n case 4 /* NotificationSource.MarkForCheck */:\n case 5 /* NotificationSource.Listener */:\n case 1 /* NotificationSource.SetInput */:\n {\n this.appRef.dirtyFlags |= 4 /* ApplicationRefDirtyFlags.ViewTreeCheck */;\n break;\n }\n case 6 /* NotificationSource.CustomElement */:\n {\n // We use `ViewTreeTraversal` to ensure we refresh the element even if this is triggered\n // during CD. In practice this is a no-op since the elements code also calls via a\n // `markForRefresh()` API which sends `NotificationSource.MarkAncestorsForTraversal` anyway.\n this.appRef.dirtyFlags |= 2 /* ApplicationRefDirtyFlags.ViewTreeTraversal */;\n force = true;\n break;\n }\n case 12 /* NotificationSource.RootEffect */:\n {\n this.appRef.dirtyFlags |= 16 /* ApplicationRefDirtyFlags.RootEffects */;\n // Root effects still force a CD, even if the scheduler is disabled. This ensures that\n // effects always run, even when triggered from outside the zone when the scheduler is\n // otherwise disabled.\n force = true;\n break;\n }\n case 13 /* NotificationSource.ViewEffect */:\n {\n // This is technically a no-op, since view effects will also send a\n // `MarkAncestorsForTraversal` notification. Still, we set this for logical consistency.\n this.appRef.dirtyFlags |= 2 /* ApplicationRefDirtyFlags.ViewTreeTraversal */;\n // View effects still force a CD, even if the scheduler is disabled. This ensures that\n // effects always run, even when triggered from outside the zone when the scheduler is\n // otherwise disabled.\n force = true;\n break;\n }\n case 11 /* NotificationSource.PendingTaskRemoved */:\n {\n // Removing a pending task via the public API forces a scheduled tick, ensuring that\n // stability is async and delayed until there was at least an opportunity to run\n // application synchronization. This prevents some footguns when working with the\n // public API for pending tasks where developers attempt to update application state\n // immediately after removing the last task.\n force = true;\n break;\n }\n case 9 /* NotificationSource.ViewDetachedFromDOM */:\n case 8 /* NotificationSource.ViewAttached */:\n case 7 /* NotificationSource.RenderHook */:\n case 10 /* NotificationSource.AsyncAnimationsLoaded */:\n default:\n {\n // These notifications only schedule a tick but do not change whether we should refresh\n // views. Instead, we only need to run render hooks unless another notification from the\n // other set is also received before `tick` happens.\n this.appRef.dirtyFlags |= 8 /* ApplicationRefDirtyFlags.AfterRender */;\n }\n }\n // If not already defined, attempt to capture a tracing snapshot of this\n // notification so that the resulting CD run can be attributed to the\n // context which produced the notification.\n this.appRef.tracingSnapshot = this.tracing?.snapshot(this.appRef.tracingSnapshot) ?? null;\n if (!this.shouldScheduleTick(force)) {\n return;\n }\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n if (this.useMicrotaskScheduler) {\n trackMicrotaskNotificationForDebugging();\n } else {\n consecutiveMicrotaskNotifications = 0;\n stackFromLastFewNotifications.length = 0;\n }\n }\n const scheduleCallback = this.useMicrotaskScheduler ? scheduleCallbackWithMicrotask : scheduleCallbackWithRafRace;\n this.pendingRenderTaskId = this.taskService.add();\n if (this.scheduleInRootZone) {\n this.cancelScheduledCallback = Zone.root.run(() => scheduleCallback(() => this.tick()));\n } else {\n this.cancelScheduledCallback = this.ngZone.runOutsideAngular(() => scheduleCallback(() => this.tick()));\n }\n }\n shouldScheduleTick(force) {\n if (this.disableScheduling && !force || this.appRef.destroyed) {\n return false;\n }\n // already scheduled or running\n if (this.pendingRenderTaskId !== null || this.runningTick || this.appRef._runningTick) {\n return false;\n }\n // If we're inside the zone don't bother with scheduler. Zone will stabilize\n // eventually and run change detection.\n if (!this.zonelessEnabled && this.zoneIsDefined && Zone.current.get(angularZoneInstanceIdProperty + this.angularZoneId)) {\n return false;\n }\n return true;\n }\n /**\n * Calls ApplicationRef._tick inside the `NgZone`.\n *\n * Calling `tick` directly runs change detection and cancels any change detection that had been\n * scheduled previously.\n *\n * @param shouldRefreshViews Passed directly to `ApplicationRef._tick` and skips straight to\n * render hooks when `false`.\n */\n tick() {\n // When ngZone.run below exits, onMicrotaskEmpty may emit if the zone is\n // stable. We want to prevent double ticking so we track whether the tick is\n // already running and skip it if so.\n if (this.runningTick || this.appRef.destroyed) {\n return;\n }\n // If we reach the tick and there is no work to be done in ApplicationRef.tick,\n // skip it altogether and clean up. There may be no work if, for example, the only\n // event that notified the scheduler was the removal of a pending task.\n if (this.appRef.dirtyFlags === 0 /* ApplicationRefDirtyFlags.None */) {\n this.cleanup();\n return;\n }\n // The scheduler used to pass \"whether to check views\" as a boolean flag instead of setting\n // fine-grained dirtiness flags, and global checking was always used on the first pass. This\n // created an interesting edge case: if a notification made a view dirty and then ticked via the\n // scheduler (and not the zone) a global check was still performed.\n //\n // Ideally, this would not be the case, and only zone-based ticks would do global passes.\n // However this is a breaking change and requires fixes in g3. Until this cleanup can be done,\n // we add the `ViewTreeGlobal` flag to request a global check if any views are dirty in a\n // scheduled tick (unless zoneless is enabled, in which case global checks aren't really a\n // thing).\n //\n // TODO(alxhub): clean up and remove this workaround as a breaking change.\n if (!this.zonelessEnabled && this.appRef.dirtyFlags & 7 /* ApplicationRefDirtyFlags.ViewTreeAny */) {\n this.appRef.dirtyFlags |= 1 /* ApplicationRefDirtyFlags.ViewTreeGlobal */;\n }\n const task = this.taskService.add();\n try {\n this.ngZone.run(() => {\n this.runningTick = true;\n this.appRef._tick();\n }, undefined, this.schedulerTickApplyArgs);\n } catch (e) {\n this.taskService.remove(task);\n this.applicationErrorHandler(e);\n } finally {\n this.cleanup();\n }\n // If we're notified of a change within 1 microtask of running change\n // detection, run another round in the same event loop. This allows code\n // which uses Promise.resolve (see NgModel) to avoid\n // ExpressionChanged...Error to still be reflected in a single browser\n // paint, even if that spans multiple rounds of change detection.\n this.useMicrotaskScheduler = true;\n scheduleCallbackWithMicrotask(() => {\n this.useMicrotaskScheduler = false;\n this.taskService.remove(task);\n });\n }\n ngOnDestroy() {\n this.subscriptions.unsubscribe();\n this.cleanup();\n }\n cleanup() {\n this.runningTick = false;\n this.cancelScheduledCallback?.();\n this.cancelScheduledCallback = null;\n // If this is the last task, the service will synchronously emit a stable\n // notification. If there is a subscriber that then acts in a way that\n // tries to notify the scheduler again, we need to be able to respond to\n // schedule a new change detection. Therefore, we should clear the task ID\n // before removing it from the pending tasks (or the tasks service should\n // not synchronously emit stable, similar to how Zone stableness only\n // happens if it's still stable after a microtask).\n if (this.pendingRenderTaskId !== null) {\n const taskId = this.pendingRenderTaskId;\n this.pendingRenderTaskId = null;\n this.taskService.remove(taskId);\n }\n }\n static ɵfac = function ChangeDetectionSchedulerImpl_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || ChangeDetectionSchedulerImpl)();\n };\n static ɵprov = /*@__PURE__*/__defineInjectable({\n token: ChangeDetectionSchedulerImpl,\n factory: ChangeDetectionSchedulerImpl.ɵfac,\n providedIn: 'root'\n });\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && setClassMetadata(ChangeDetectionSchedulerImpl, [{\n type: Injectable,\n args: [{\n providedIn: 'root'\n }]\n }], () => [], null);\n})();\n/**\n * Provides change detection without ZoneJS for the application bootstrapped using\n * `bootstrapApplication`.\n *\n * This function allows you to configure the application to not use the state/state changes of\n * ZoneJS to schedule change detection in the application. This will work when ZoneJS is not present\n * on the page at all or if it exists because something else is using it (either another Angular\n * application which uses ZoneJS for scheduling or some other library that relies on ZoneJS).\n *\n * This can also be added to the `TestBed` providers to configure the test environment to more\n * closely match production behavior. This will help give higher confidence that components are\n * compatible with zoneless change detection.\n *\n * ZoneJS uses browser events to trigger change detection. When using this provider, Angular will\n * instead use Angular APIs to schedule change detection. These APIs include:\n *\n * - `ChangeDetectorRef.markForCheck`\n * - `ComponentRef.setInput`\n * - updating a signal that is read in a template\n * - when bound host or template listeners are triggered\n * - attaching a view that was marked dirty by one of the above\n * - removing a view\n * - registering a render hook (templates are only refreshed if render hooks do one of the above)\n *\n * @usageNotes\n * ```ts\n * bootstrapApplication(MyApp, {providers: [\n * provideZonelessChangeDetection(),\n * ]});\n * ```\n *\n * This API is experimental. Neither the shape, nor the underlying behavior is stable and can change\n * in patch versions. There are known feature gaps and API ergonomic considerations. We will iterate\n * on the exact API based on the feedback and our understanding of the problem and solution space.\n *\n * @developerPreview 20.0\n * @see {@link /api/platform-browser/bootstrapApplication bootstrapApplication}\n */\nfunction provideZonelessChangeDetection() {\n performanceMarkFeature('NgZoneless');\n if ((typeof ngDevMode === 'undefined' || ngDevMode) && typeof Zone !== 'undefined' && Zone) {\n const message = formatRuntimeError(914 /* RuntimeErrorCode.UNEXPECTED_ZONEJS_PRESENT_IN_ZONELESS_MODE */, `The application is using zoneless change detection, but is still loading Zone.js. ` + `Consider removing Zone.js to get the full benefits of zoneless. ` + `In applications using the Angular CLI, Zone.js is typically included in the \"polyfills\" section of the angular.json file.`);\n console.warn(message);\n }\n return makeEnvironmentProviders([{\n provide: ChangeDetectionScheduler,\n useExisting: ChangeDetectionSchedulerImpl\n }, {\n provide: NgZone,\n useClass: NoopNgZone\n }, {\n provide: ZONELESS_ENABLED,\n useValue: true\n }, {\n provide: SCHEDULE_IN_ROOT_ZONE,\n useValue: false\n }, typeof ngDevMode === 'undefined' || ngDevMode ? [{\n provide: PROVIDED_ZONELESS,\n useValue: true\n }] : []]);\n}\n\n/// <reference path=\"../../../goog.d.ts\" />\n/**\n * Work out the locale from the potential global properties.\n *\n * * Closure Compiler: use `goog.LOCALE`.\n * * Ivy enabled: use `$localize.locale`\n */\nfunction getGlobalLocale() {\n if (typeof ngI18nClosureMode !== 'undefined' && ngI18nClosureMode && typeof goog !== 'undefined' && goog.LOCALE !== 'en') {\n // * The default `goog.LOCALE` value is `en`, while Angular used `en-US`.\n // * In order to preserve backwards compatibility, we use Angular default value over\n // Closure Compiler's one.\n return goog.LOCALE;\n } else {\n // KEEP `typeof $localize !== 'undefined' && $localize.locale` IN SYNC WITH THE LOCALIZE\n // COMPILE-TIME INLINER.\n //\n // * During compile time inlining of translations the expression will be replaced\n // with a string literal that is the current locale. Other forms of this expression are not\n // guaranteed to be replaced.\n //\n // * During runtime translation evaluation, the developer is required to set `$localize.locale`\n // if required, or just to provide their own `LOCALE_ID` provider.\n return typeof $localize !== 'undefined' && $localize.locale || DEFAULT_LOCALE_ID;\n }\n}\n/**\n * Provide this token to set the locale of your application.\n * It is used for i18n extraction, by i18n pipes (DatePipe, I18nPluralPipe, CurrencyPipe,\n * DecimalPipe and PercentPipe) and by ICU expressions.\n *\n * See the [i18n guide](guide/i18n/locale-id) for more information.\n *\n * @usageNotes\n * ### Example\n * In standalone apps:\n * ```ts\n * import { LOCALE_ID, ApplicationConfig } from '@angular/core';\n * import { AppModule } from './app/app.module';\n *\n * const appConfig: ApplicationConfig = {\n * providers: [{provide: LOCALE_ID, useValue: 'en-US' }]\n * };\n * ```\n *\n * In module based apps:\n * ```ts\n * import { LOCALE_ID } from '@angular/core';\n * import { platformBrowser } from '@angular/platform-browser';\n * import { AppModule } from './app/app.module';\n *\n * platformBrowser().bootstrapModule(AppModule, {\n * providers: [{provide: LOCALE_ID, useValue: 'en-US' }]\n * });\n * ```\n *\n * @publicApi\n */\nconst LOCALE_ID = new InjectionToken(ngDevMode ? 'LocaleId' : '', {\n providedIn: 'root',\n factory: () => inject(LOCALE_ID, {\n optional: true,\n skipSelf: true\n }) || getGlobalLocale()\n});\n/**\n * Provide this token to set the default currency code your application uses for\n * CurrencyPipe when there is no currency code passed into it. This is only used by\n * CurrencyPipe and has no relation to locale currency. Defaults to USD if not configured.\n *\n * See the [i18n guide](guide/i18n/locale-id) for more information.\n *\n * <div class=\"docs-alert docs-alert-helpful\">\n *\n * The default currency code is currently always `USD`.\n *\n * If you need the previous behavior then set it by creating a `DEFAULT_CURRENCY_CODE` provider in\n * your application `NgModule`:\n *\n * ```ts\n * {provide: DEFAULT_CURRENCY_CODE, useValue: 'USD'}\n * ```\n *\n * </div>\n *\n * @usageNotes\n * ### Example\n * In standalone apps:\n * ```ts\n * import { LOCALE_ID, ApplicationConfig } from '@angular/core';\n *\n * const appConfig: ApplicationConfig = {\n * providers: [{provide: DEFAULT_CURRENCY_CODE, useValue: 'EUR' }]\n * };\n * ```\n *\n * In module based apps:\n * ```ts\n * import { platformBrowser } from '@angular/platform-browser';\n * import { AppModule } from './app/app.module';\n *\n * platformBrowser().bootstrapModule(AppModule, {\n * providers: [{provide: DEFAULT_CURRENCY_CODE, useValue: 'EUR' }]\n * });\n * ```\n *\n * @publicApi\n */\nconst DEFAULT_CURRENCY_CODE = new InjectionToken(ngDevMode ? 'DefaultCurrencyCode' : '', {\n providedIn: 'root',\n factory: () => USD_CURRENCY_CODE\n});\n/**\n * Use this token at bootstrap to provide the content of your translation file (`xtb`,\n * `xlf` or `xlf2`) when you want to translate your application in another language.\n *\n * See the [i18n guide](guide/i18n/merge) for more information.\n *\n * @usageNotes\n * ### Example\n * In standalone apps:\n * ```ts\n * import { LOCALE_ID, ApplicationConfig } from '@angular/core';\n *\n * const appConfig: ApplicationConfig = {\n * providers: [{provide: TRANSLATIONS, useValue: translations }]\n * };\n * ```\n *\n * In module based apps:\n * ```ts\n * import { TRANSLATIONS } from '@angular/core';\n * import { platformBrowser } from '@angular/platform-browser';\n * import { AppModule } from './app/app.module';\n *\n * // content of your translation file\n * const translations = '....';\n *\n * platformBrowser().bootstrapModule(AppModule, {\n * providers: [{provide: TRANSLATIONS, useValue: translations }]\n * });\n * ```\n *\n * @publicApi\n */\nconst TRANSLATIONS = new InjectionToken(ngDevMode ? 'Translations' : '');\n/**\n * Provide this token at bootstrap to set the format of your {@link TRANSLATIONS}: `xtb`,\n * `xlf` or `xlf2`.\n *\n * See the [i18n guide](guide/i18n/merge) for more information.\n *\n * @usageNotes\n * ### Example\n * In standalone apps:\n * ```ts\n * import { LOCALE_ID, ApplicationConfig } from '@angular/core';\n *\n * const appConfig: ApplicationConfig = {\n * providers: [{provide: TRANSLATIONS_FORMAT, useValue: 'xlf' }]\n * };\n * ```\n *\n * In module based apps: *\n * ```ts\n * import { TRANSLATIONS_FORMAT } from '@angular/core';\n * import { platformBrowser } from '@angular/platform-browser';\n * import { AppModule } from './app/app.module';\n *\n * platformBrowser().bootstrapModule(AppModule, {\n * providers: [{provide: TRANSLATIONS_FORMAT, useValue: 'xlf' }]\n * });\n * ```\n *\n * @publicApi\n */\nconst TRANSLATIONS_FORMAT = new InjectionToken(ngDevMode ? 'TranslationsFormat' : '');\n/**\n * Use this enum at bootstrap as an option of `bootstrapModule` to define the strategy\n * that the compiler should use in case of missing translations:\n * - Error: throw if you have missing translations.\n * - Warning (default): show a warning in the console and/or shell.\n * - Ignore: do nothing.\n *\n * See the [i18n guide](guide/i18n/merge#report-missing-translations) for more information.\n *\n * @usageNotes\n * ### Example\n * ```ts\n * import { MissingTranslationStrategy } from '@angular/core';\n * import { platformBrowser } from '@angular/platform-browser';\n * import { AppModule } from './app/app.module';\n *\n * platformBrowser().bootstrapModule(AppModule, {\n * missingTranslation: MissingTranslationStrategy.Error\n * });\n * ```\n *\n * @publicApi\n */\nvar MissingTranslationStrategy;\n(function (MissingTranslationStrategy) {\n MissingTranslationStrategy[MissingTranslationStrategy[\"Error\"] = 0] = \"Error\";\n MissingTranslationStrategy[MissingTranslationStrategy[\"Warning\"] = 1] = \"Warning\";\n MissingTranslationStrategy[MissingTranslationStrategy[\"Ignore\"] = 2] = \"Ignore\";\n})(MissingTranslationStrategy || (MissingTranslationStrategy = {}));\n\n/**\n * @publicApi\n */\nclass DebugEventListener {\n name;\n callback;\n constructor(name, callback) {\n this.name = name;\n this.callback = callback;\n }\n}\n/**\n * @publicApi\n */\nfunction asNativeElements(debugEls) {\n return debugEls.map(el => el.nativeElement);\n}\n/**\n * @publicApi\n */\nclass DebugNode {\n /**\n * The underlying DOM node.\n */\n nativeNode;\n constructor(nativeNode) {\n this.nativeNode = nativeNode;\n }\n /**\n * The `DebugElement` parent. Will be `null` if this is the root element.\n */\n get parent() {\n const parent = this.nativeNode.parentNode;\n return parent ? new DebugElement(parent) : null;\n }\n /**\n * The host dependency injector. For example, the root element's component instance injector.\n */\n get injector() {\n return getInjector(this.nativeNode);\n }\n /**\n * The element's own component instance, if it has one.\n */\n get componentInstance() {\n const nativeElement = this.nativeNode;\n return nativeElement && (getComponent(nativeElement) || getOwningComponent(nativeElement));\n }\n /**\n * An object that provides parent context for this element. Often an ancestor component instance\n * that governs this element.\n *\n * When an element is repeated within *ngFor, the context is an `NgForOf` whose `$implicit`\n * property is the value of the row instance value. For example, the `hero` in `*ngFor=\"let hero\n * of heroes\"`.\n */\n get context() {\n return getComponent(this.nativeNode) || getContext(this.nativeNode);\n }\n /**\n * The callbacks attached to the component's @Output properties and/or the element's event\n * properties.\n */\n get listeners() {\n return getListeners(this.nativeNode).filter(listener => listener.type === 'dom');\n }\n /**\n * Dictionary of objects associated with template local variables (e.g. #foo), keyed by the local\n * variable name.\n */\n get references() {\n return getLocalRefs(this.nativeNode);\n }\n /**\n * This component's injector lookup tokens. Includes the component itself plus the tokens that the\n * component lists in its providers metadata.\n */\n get providerTokens() {\n return getInjectionTokens(this.nativeNode);\n }\n}\n/**\n * @publicApi\n *\n * @see [Component testing scenarios](guide/testing/components-scenarios)\n * @see [Basics of testing components](guide/testing/components-basics)\n * @see [Testing utility APIs](guide/testing/utility-apis)\n */\nclass DebugElement extends DebugNode {\n constructor(nativeNode) {\n ngDevMode && assertDomNode(nativeNode);\n super(nativeNode);\n }\n /**\n * The underlying DOM element at the root of the component.\n */\n get nativeElement() {\n return this.nativeNode.nodeType == Node.ELEMENT_NODE ? this.nativeNode : null;\n }\n /**\n * The element tag name, if it is an element.\n */\n get name() {\n const context = getLContext(this.nativeNode);\n const lView = context ? context.lView : null;\n if (lView !== null) {\n const tData = lView[TVIEW].data;\n const tNode = tData[context.nodeIndex];\n return tNode.value;\n } else {\n return this.nativeNode.nodeName;\n }\n }\n /**\n * Gets a map of property names to property values for an element.\n *\n * This map includes:\n * - Regular property bindings (e.g. `[id]=\"id\"`)\n * - Host property bindings (e.g. `host: { '[id]': \"id\" }`)\n * - Interpolated property bindings (e.g. `id=\"{{ value }}\")\n *\n * It does not include:\n * - input property bindings (e.g. `[myCustomInput]=\"value\"`)\n * - attribute bindings (e.g. `[attr.role]=\"menu\"`)\n */\n get properties() {\n const context = getLContext(this.nativeNode);\n const lView = context ? context.lView : null;\n if (lView === null) {\n return {};\n }\n const tData = lView[TVIEW].data;\n const tNode = tData[context.nodeIndex];\n const properties = {};\n // Collect properties from the DOM.\n copyDomProperties(this.nativeElement, properties);\n // Collect properties from the bindings. This is needed for animation renderer which has\n // synthetic properties which don't get reflected into the DOM.\n collectPropertyBindings(properties, tNode, lView, tData);\n return properties;\n }\n /**\n * A map of attribute names to attribute values for an element.\n */\n // TODO: replace null by undefined in the return type\n get attributes() {\n const attributes = {};\n const element = this.nativeElement;\n if (!element) {\n return attributes;\n }\n const context = getLContext(element);\n const lView = context ? context.lView : null;\n if (lView === null) {\n return {};\n }\n const tNodeAttrs = lView[TVIEW].data[context.nodeIndex].attrs;\n const lowercaseTNodeAttrs = [];\n // For debug nodes we take the element's attribute directly from the DOM since it allows us\n // to account for ones that weren't set via bindings (e.g. ViewEngine keeps track of the ones\n // that are set through `Renderer2`). The problem is that the browser will lowercase all names,\n // however since we have the attributes already on the TNode, we can preserve the case by going\n // through them once, adding them to the `attributes` map and putting their lower-cased name\n // into an array. Afterwards when we're going through the native DOM attributes, we can check\n // whether we haven't run into an attribute already through the TNode.\n if (tNodeAttrs) {\n let i = 0;\n while (i < tNodeAttrs.length) {\n const attrName = tNodeAttrs[i];\n // Stop as soon as we hit a marker. We only care about the regular attributes. Everything\n // else will be handled below when we read the final attributes off the DOM.\n if (typeof attrName !== 'string') break;\n const attrValue = tNodeAttrs[i + 1];\n attributes[attrName] = attrValue;\n lowercaseTNodeAttrs.push(attrName.toLowerCase());\n i += 2;\n }\n }\n for (const attr of element.attributes) {\n // Make sure that we don't assign the same attribute both in its\n // case-sensitive form and the lower-cased one from the browser.\n if (!lowercaseTNodeAttrs.includes(attr.name)) {\n attributes[attr.name] = attr.value;\n }\n }\n return attributes;\n }\n /**\n * The inline styles of the DOM element.\n */\n // TODO: replace null by undefined in the return type\n get styles() {\n const element = this.nativeElement;\n return element?.style ?? {};\n }\n /**\n * A map containing the class names on the element as keys.\n *\n * This map is derived from the `className` property of the DOM element.\n *\n * Note: The values of this object will always be `true`. The class key will not appear in the KV\n * object if it does not exist on the element.\n *\n * @see [Element.className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className)\n */\n get classes() {\n const result = {};\n const element = this.nativeElement;\n // SVG elements return an `SVGAnimatedString` instead of a plain string for the `className`.\n const className = element.className;\n const classes = typeof className !== 'string' ? className.baseVal.split(' ') : className.split(' ');\n classes.forEach(value => result[value] = true);\n return result;\n }\n /**\n * The `childNodes` of the DOM element as a `DebugNode` array.\n *\n * @see [Node.childNodes](https://developer.mozilla.org/en-US/docs/Web/API/Node/childNodes)\n */\n get childNodes() {\n const childNodes = this.nativeNode.childNodes;\n const children = [];\n for (let i = 0; i < childNodes.length; i++) {\n const element = childNodes[i];\n children.push(getDebugNode(element));\n }\n return children;\n }\n /**\n * The immediate `DebugElement` children. Walk the tree by descending through `children`.\n */\n get children() {\n const nativeElement = this.nativeElement;\n if (!nativeElement) return [];\n const childNodes = nativeElement.children;\n const children = [];\n for (let i = 0; i < childNodes.length; i++) {\n const element = childNodes[i];\n children.push(getDebugNode(element));\n }\n return children;\n }\n /**\n * @returns the first `DebugElement` that matches the predicate at any depth in the subtree.\n */\n query(predicate) {\n const results = this.queryAll(predicate);\n return results[0] || null;\n }\n /**\n * @returns All `DebugElement` matches for the predicate at any depth in the subtree.\n */\n queryAll(predicate) {\n const matches = [];\n _queryAll(this, predicate, matches, true);\n return matches;\n }\n /**\n * @returns All `DebugNode` matches for the predicate at any depth in the subtree.\n */\n queryAllNodes(predicate) {\n const matches = [];\n _queryAll(this, predicate, matches, false);\n return matches;\n }\n /**\n * Triggers the event by its name if there is a corresponding listener in the element's\n * `listeners` collection.\n *\n * If the event lacks a listener or there's some other problem, consider\n * calling `nativeElement.dispatchEvent(eventObject)`.\n *\n * @param eventName The name of the event to trigger\n * @param eventObj The _event object_ expected by the handler\n *\n * @see [Testing components scenarios](guide/testing/components-scenarios#trigger-event-handler)\n */\n triggerEventHandler(eventName, eventObj) {\n const node = this.nativeNode;\n const invokedListeners = [];\n this.listeners.forEach(listener => {\n if (listener.name === eventName) {\n const callback = listener.callback;\n callback.call(node, eventObj);\n invokedListeners.push(callback);\n }\n });\n // We need to check whether `eventListeners` exists, because it's something\n // that Zone.js only adds to `EventTarget` in browser environments.\n if (typeof node.eventListeners === 'function') {\n // Note that in Ivy we wrap event listeners with a call to `event.preventDefault` in some\n // cases. We use '__ngUnwrap__' as a special token that gives us access to the actual event\n // listener.\n node.eventListeners(eventName).forEach(listener => {\n // In order to ensure that we can detect the special __ngUnwrap__ token described above, we\n // use `toString` on the listener and see if it contains the token. We use this approach to\n // ensure that it still worked with compiled code since it cannot remove or rename string\n // literals. We also considered using a special function name (i.e. if(listener.name ===\n // special)) but that was more cumbersome and we were also concerned the compiled code could\n // strip the name, turning the condition in to (\"\" === \"\") and always returning true.\n if (listener.toString().indexOf('__ngUnwrap__') !== -1) {\n const unwrappedListener = listener('__ngUnwrap__');\n return invokedListeners.indexOf(unwrappedListener) === -1 && unwrappedListener.call(node, eventObj);\n }\n });\n }\n }\n}\nfunction copyDomProperties(element, properties) {\n if (element) {\n // Skip own properties (as those are patched)\n let obj = Object.getPrototypeOf(element);\n const NodePrototype = Node.prototype;\n while (obj !== null && obj !== NodePrototype) {\n const descriptors = Object.getOwnPropertyDescriptors(obj);\n for (let key in descriptors) {\n if (!key.startsWith('__') && !key.startsWith('on')) {\n // don't include properties starting with `__` and `on`.\n // `__` are patched values which should not be included.\n // `on` are listeners which also should not be included.\n const value = element[key];\n if (isPrimitiveValue(value)) {\n properties[key] = value;\n }\n }\n }\n obj = Object.getPrototypeOf(obj);\n }\n }\n}\nfunction isPrimitiveValue(value) {\n return typeof value === 'string' || typeof value === 'boolean' || typeof value === 'number' || value === null;\n}\nfunction _queryAll(parentElement, predicate, matches, elementsOnly) {\n const context = getLContext(parentElement.nativeNode);\n const lView = context ? context.lView : null;\n if (lView !== null) {\n const parentTNode = lView[TVIEW].data[context.nodeIndex];\n _queryNodeChildren(parentTNode, lView, predicate, matches, elementsOnly, parentElement.nativeNode);\n } else {\n // If the context is null, then `parentElement` was either created with Renderer2 or native DOM\n // APIs.\n _queryNativeNodeDescendants(parentElement.nativeNode, predicate, matches, elementsOnly);\n }\n}\n/**\n * Recursively match the current TNode against the predicate, and goes on with the next ones.\n *\n * @param tNode the current TNode\n * @param lView the LView of this TNode\n * @param predicate the predicate to match\n * @param matches the list of positive matches\n * @param elementsOnly whether only elements should be searched\n * @param rootNativeNode the root native node on which predicate should not be matched\n */\nfunction _queryNodeChildren(tNode, lView, predicate, matches, elementsOnly, rootNativeNode) {\n ngDevMode && assertTNodeForLView(tNode, lView);\n const nativeNode = getNativeByTNodeOrNull(tNode, lView);\n // For each type of TNode, specific logic is executed.\n if (tNode.type & (3 /* TNodeType.AnyRNode */ | 8 /* TNodeType.ElementContainer */)) {\n // Case 1: the TNode is an element\n // The native node has to be checked.\n _addQueryMatch(nativeNode, predicate, matches, elementsOnly, rootNativeNode);\n if (isComponentHost(tNode)) {\n // If the element is the host of a component, then all nodes in its view have to be processed.\n // Note: the component's content (tNode.child) will be processed from the insertion points.\n const componentView = getComponentLViewByIndex(tNode.index, lView);\n if (componentView && componentView[TVIEW].firstChild) {\n _queryNodeChildren(componentView[TVIEW].firstChild, componentView, predicate, matches, elementsOnly, rootNativeNode);\n }\n } else {\n if (tNode.child) {\n // Otherwise, its children have to be processed.\n _queryNodeChildren(tNode.child, lView, predicate, matches, elementsOnly, rootNativeNode);\n }\n // We also have to query the DOM directly in order to catch elements inserted through\n // Renderer2. Note that this is __not__ optimal, because we're walking similar trees multiple\n // times. ViewEngine could do it more efficiently, because all the insertions go through\n // Renderer2, however that's not the case in Ivy. This approach is being used because:\n // 1. Matching the ViewEngine behavior would mean potentially introducing a dependency\n // from `Renderer2` to Ivy which could bring Ivy code into ViewEngine.\n // 2. It allows us to capture nodes that were inserted directly via the DOM.\n nativeNode && _queryNativeNodeDescendants(nativeNode, predicate, matches, elementsOnly);\n }\n // In all cases, if a dynamic container exists for this node, each view inside it has to be\n // processed.\n const nodeOrContainer = lView[tNode.index];\n if (isLContainer(nodeOrContainer)) {\n _queryNodeChildrenInContainer(nodeOrContainer, predicate, matches, elementsOnly, rootNativeNode);\n }\n } else if (tNode.type & 4 /* TNodeType.Container */) {\n // Case 2: the TNode is a container\n // The native node has to be checked.\n const lContainer = lView[tNode.index];\n _addQueryMatch(lContainer[NATIVE], predicate, matches, elementsOnly, rootNativeNode);\n // Each view inside the container has to be processed.\n _queryNodeChildrenInContainer(lContainer, predicate, matches, elementsOnly, rootNativeNode);\n } else if (tNode.type & 16 /* TNodeType.Projection */) {\n // Case 3: the TNode is a projection insertion point (i.e. a <ng-content>).\n // The nodes projected at this location all need to be processed.\n const componentView = lView[DECLARATION_COMPONENT_VIEW];\n const componentHost = componentView[T_HOST];\n const head = componentHost.projection[tNode.projection];\n if (Array.isArray(head)) {\n for (let nativeNode of head) {\n _addQueryMatch(nativeNode, predicate, matches, elementsOnly, rootNativeNode);\n }\n } else if (head) {\n const nextLView = componentView[PARENT];\n const nextTNode = nextLView[TVIEW].data[head.index];\n _queryNodeChildren(nextTNode, nextLView, predicate, matches, elementsOnly, rootNativeNode);\n }\n } else if (tNode.child) {\n // Case 4: the TNode is a view.\n _queryNodeChildren(tNode.child, lView, predicate, matches, elementsOnly, rootNativeNode);\n }\n // We don't want to go to the next sibling of the root node.\n if (rootNativeNode !== nativeNode) {\n // To determine the next node to be processed, we need to use the next or the projectionNext\n // link, depending on whether the current node has been projected.\n const nextTNode = tNode.flags & 2 /* TNodeFlags.isProjected */ ? tNode.projectionNext : tNode.next;\n if (nextTNode) {\n _queryNodeChildren(nextTNode, lView, predicate, matches, elementsOnly, rootNativeNode);\n }\n }\n}\n/**\n * Process all TNodes in a given container.\n *\n * @param lContainer the container to be processed\n * @param predicate the predicate to match\n * @param matches the list of positive matches\n * @param elementsOnly whether only elements should be searched\n * @param rootNativeNode the root native node on which predicate should not be matched\n */\nfunction _queryNodeChildrenInContainer(lContainer, predicate, matches, elementsOnly, rootNativeNode) {\n for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {\n const childView = lContainer[i];\n const firstChild = childView[TVIEW].firstChild;\n if (firstChild) {\n _queryNodeChildren(firstChild, childView, predicate, matches, elementsOnly, rootNativeNode);\n }\n }\n}\n/**\n * Match the current native node against the predicate.\n *\n * @param nativeNode the current native node\n * @param predicate the predicate to match\n * @param matches the list of positive matches\n * @param elementsOnly whether only elements should be searched\n * @param rootNativeNode the root native node on which predicate should not be matched\n */\nfunction _addQueryMatch(nativeNode, predicate, matches, elementsOnly, rootNativeNode) {\n if (rootNativeNode !== nativeNode) {\n const debugNode = getDebugNode(nativeNode);\n if (!debugNode) {\n return;\n }\n // Type of the \"predicate and \"matches\" array are set based on the value of\n // the \"elementsOnly\" parameter. TypeScript is not able to properly infer these\n // types with generics, so we manually cast the parameters accordingly.\n if (elementsOnly && debugNode instanceof DebugElement && predicate(debugNode) && matches.indexOf(debugNode) === -1) {\n matches.push(debugNode);\n } else if (!elementsOnly && predicate(debugNode) && matches.indexOf(debugNode) === -1) {\n matches.push(debugNode);\n }\n }\n}\n/**\n * Match all the descendants of a DOM node against a predicate.\n *\n * @param nativeNode the current native node\n * @param predicate the predicate to match\n * @param matches the list where matches are stored\n * @param elementsOnly whether only elements should be searched\n */\nfunction _queryNativeNodeDescendants(parentNode, predicate, matches, elementsOnly) {\n const nodes = parentNode.childNodes;\n const length = nodes.length;\n for (let i = 0; i < length; i++) {\n const node = nodes[i];\n const debugNode = getDebugNode(node);\n if (debugNode) {\n if (elementsOnly && debugNode instanceof DebugElement && predicate(debugNode) && matches.indexOf(debugNode) === -1) {\n matches.push(debugNode);\n } else if (!elementsOnly && predicate(debugNode) && matches.indexOf(debugNode) === -1) {\n matches.push(debugNode);\n }\n _queryNativeNodeDescendants(node, predicate, matches, elementsOnly);\n }\n }\n}\n/**\n * Iterates through the property bindings for a given node and generates\n * a map of property names to values. This map only contains property bindings\n * defined in templates, not in host bindings.\n */\nfunction collectPropertyBindings(properties, tNode, lView, tData) {\n let bindingIndexes = tNode.propertyBindings;\n if (bindingIndexes !== null) {\n for (let i = 0; i < bindingIndexes.length; i++) {\n const bindingIndex = bindingIndexes[i];\n const propMetadata = tData[bindingIndex];\n const metadataParts = propMetadata.split(INTERPOLATION_DELIMITER);\n const propertyName = metadataParts[0];\n if (metadataParts.length > 1) {\n let value = metadataParts[1];\n for (let j = 1; j < metadataParts.length - 1; j++) {\n value += renderStringify(lView[bindingIndex + j - 1]) + metadataParts[j + 1];\n }\n properties[propertyName] = value;\n } else {\n properties[propertyName] = lView[bindingIndex];\n }\n }\n }\n}\nconst NG_DEBUG_PROPERTY = '__ng_debug__';\n/**\n * @publicApi\n */\nfunction getDebugNode(nativeNode) {\n if (nativeNode instanceof Node) {\n if (!nativeNode.hasOwnProperty(NG_DEBUG_PROPERTY)) {\n nativeNode[NG_DEBUG_PROPERTY] = nativeNode.nodeType == Node.ELEMENT_NODE ? new DebugElement(nativeNode) : new DebugNode(nativeNode);\n }\n return nativeNode[NG_DEBUG_PROPERTY];\n }\n return null;\n}\nexport { AFTER_RENDER_PHASES, ANIMATION_MODULE_TYPE, APP_BOOTSTRAP_LISTENER, APP_ID, APP_INITIALIZER, AcxChangeDetectionStrategy, AcxViewEncapsulation, AfterRenderImpl, AfterRenderManager, AfterRenderSequence, ApplicationInitStatus, ApplicationRef, Attribute, COMPILER_OPTIONS, CONTAINERS, CSP_NONCE, CUSTOM_ELEMENTS_SCHEMA, ChangeDetectionSchedulerImpl, ChangeDetectionStrategy, Compiler, CompilerFactory, Component, ComponentFactory, ComponentFactory$1, ComponentFactoryResolver$1 as ComponentFactoryResolver, ComponentRef$1 as ComponentRef, ComponentRef as ComponentRef$1, Console, DEFAULT_CURRENCY_CODE, DEFAULT_LOCALE_ID, DEFER_BLOCK_CONFIG, DEFER_BLOCK_DEPENDENCY_INTERCEPTOR, DEFER_BLOCK_ID, DEFER_BLOCK_SSR_ID_ATTRIBUTE, DEFER_BLOCK_STATE$1 as DEFER_BLOCK_STATE, DEFER_BLOCK_STATE as DEFER_BLOCK_STATE$1, DEFER_HYDRATE_TRIGGERS, DEFER_PARENT_BLOCK_ID, DEHYDRATED_BLOCK_REGISTRY, DISCONNECTED_NODES, DebugElement, DebugEventListener, DebugNode, DeferBlockBehavior, DeferBlockState, DehydratedBlockRegistry, Directive, ELEMENT_CONTAINERS, EVENT_REPLAY_ENABLED_DEFAULT, ElementRef, EnvironmentNgModuleRefAdapter, EventEmitter, Framework, Host, HostBinding, HostListener, HydrationStatus, I18N_DATA, IMAGE_CONFIG, IMAGE_CONFIG_DEFAULTS, IS_EVENT_REPLAY_ENABLED, IS_HYDRATION_DOM_REUSE_ENABLED, IS_I18N_HYDRATION_ENABLED, IS_INCREMENTAL_HYDRATION_ENABLED, Inject, Injectable, Input, JSACTION_BLOCK_ELEMENT_MAP, JSACTION_EVENT_CONTRACT, LContext, LOCALE_ID, LocaleDataIndex, MULTIPLIER, MissingTranslationStrategy, ModuleWithComponentFactories, NGH_ATTR_NAME, NGH_DATA_KEY, NGH_DEFER_BLOCKS_KEY, NODES, NOOP_AFTER_RENDER_REF, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR, NO_CHANGE, NO_ERRORS_SCHEMA, NUM_ROOT_NODES, NgModule, NgModuleFactory, NgModuleFactory$1, NgModuleRef, NgModuleRef$1, NgProbeToken, NgZone, NoopNgZone, Optional, Output, PACKAGE_ROOT_URL, PLATFORM_ID, PLATFORM_INITIALIZER, PRESERVE_HOST_CONTENT, PROVIDED_NG_ZONE, Pipe, QueryList, ReflectionCapabilities, Renderer2, RendererFactory2, RendererStyleFlags2, SKIP_HYDRATION_ATTR_NAME, SSR_CONTENT_INTEGRITY_MARKER, Sanitizer, SecurityContext, Self, SimpleChange, SkipSelf, TEMPLATES, TEMPLATE_ID, TESTABILITY, TESTABILITY_GETTER, TRANSLATIONS, TRANSLATIONS_FORMAT, TemplateRef, Testability, TestabilityRegistry, TimerScheduler, TracingAction, TracingService, TransferState, Type, UseExhaustiveCheckNoChanges, ViewContainerRef, ViewEncapsulation, ViewRef, _sanitizeHtml, _sanitizeUrl, afterEveryRender, afterNextRender, allowSanitizationBypassAndThrow, angularCoreEnv, appendDeferBlocksToJSActionMap, asNativeElements, assertComponentDef, assertStandaloneComponentType, bypassSanitizationTrustHtml, bypassSanitizationTrustResourceUrl, bypassSanitizationTrustScript, bypassSanitizationTrustStyle, bypassSanitizationTrustUrl, calcPathForNode, checkNoChangesInternal, cleanupDehydratedViews, clearResolutionOfComponentResourcesQueue, collectNativeNodes, collectNativeNodesInLContainer, compileComponent, compileDirective, compileNgModule, compileNgModuleDefs, compilePipe, convertHydrateTriggersToJsAction, countBlocksSkippedByHydration, createEnvironmentInjector, createMultiResultQuerySignalFn, createNgModule, createNgModuleRef, createNgModuleRefWithProviders, createSingleResultOptionalQuerySignalFn, createSingleResultRequiredQuerySignalFn, depsTracker, devModeEqual, enableApplyRootElementTransformImpl, enableClaimDehydratedIcuCaseImpl, enableFindMatchingDehydratedViewImpl, enableLocateOrCreateContainerAnchorImpl, enableLocateOrCreateContainerRefImpl, enableLocateOrCreateElementContainerNodeImpl, enableLocateOrCreateElementNodeImpl, enableLocateOrCreateI18nNodeImpl, enableLocateOrCreateTextNodeImpl, enablePrepareI18nBlockForHydrationImpl, enableProfiling, enableRetrieveDeferBlockDataImpl, enableRetrieveHydrationInfoImpl, enableStashEventListenerImpl, findLocaleData, flushModuleScopingQueueAsMuchAsPossible, gatherDeferBlocksCommentNodes, generateStandaloneInDeclarationsError, getAsyncClassMetadataFn, getCompilerFacade, getDebugNode, getDeferBlocks$1 as getDeferBlocks, getDirectives, getDocument, getHostElement, getLContext, getLDeferBlockDetails, getLNodeForHydration, getLocaleCurrencyCode, getLocalePluralCase, getNgZone, getNgZoneOptions, getOrComputeI18nChildren, getRegisteredNgModuleType, getSanitizationBypassType, getTDeferBlockDetails, inputBinding, internalProvideZoneChangeDetection, invokeListeners, isBoundToModule, isComponentDefPendingResolution, isComponentResourceResolutionQueueEmpty, isDeferBlock, isDetachedByI18n, isDisconnectedNode, isI18nHydrationEnabled, isI18nHydrationSupportEnabled, isInSkipHydrationBlock, isIncrementalHydrationEnabled, isInternalHydrationTransferStateKey, isJsObject, isLetDeclaration, isListLikeIterable, isNgModule, isPromise, isSubscribable, isTNodeShape, isViewDirty, iterateListLike, makePropDecorator, makeStateKey, markForRefresh, noSideEffects, optionsReducer, outputBinding, patchComponentDefWithScope, performanceMarkFeature, processAndInitTriggers, processBlockData, processTextNodeBeforeSerialization, profiler, provideAppInitializer, provideNgReflectAttributes, provideZoneChangeDetection, provideZonelessChangeDetection, publishDefaultGlobalUtils, publishExternalGlobalUtil, publishSignalConfiguration, readHydrationInfo, readPatchedLView, registerLocaleData, registerNgModuleType, remove, removeListeners, renderDeferBlockState, resetCompiledComponents, resetJitOptions, resolveComponentResources, restoreComponentResolutionQueue, retrieveTransferredState, setAllowDuplicateNgModuleIdsForTest, setClassMetadata, setClassMetadataAsync, setDocument, setIsI18nHydrationSupportEnabled, setJSActionAttributes, setJitOptions, setLocaleId, setStashFn, setTestabilityGetter, sharedMapFunction, sharedStashFunction, transitiveScopesFor, triggerHydrationFromBlockName, triggerResourceLoading, trySerializeI18nBlock, twoWayBinding, unregisterAllLocaleData, unsupportedProjectionOfDomNodes, unwrapSafeValue, validateMatchingNode, validateNodeExists, verifySsrContentsIntegrity, ɵgetUnknownElementStrictMode, ɵgetUnknownPropertyStrictMode, ɵsetClassDebugInfo, ɵsetUnknownElementStrictMode, ɵsetUnknownPropertyStrictMode, ɵɵCopyDefinitionFeature, ɵɵExternalStylesFeature, ɵɵHostDirectivesFeature, ɵɵInheritDefinitionFeature, ɵɵNgOnChangesFeature, ɵɵProvidersFeature, ɵɵadvance, ɵɵattachSourceLocations, ɵɵattribute, ɵɵclassMap, ɵɵclassProp, ɵɵcomponentInstance, ɵɵconditional, ɵɵconditionalBranchCreate, ɵɵconditionalCreate, ɵɵcontentQuery, ɵɵcontentQuerySignal, ɵɵdeclareLet, ɵɵdefer, ɵɵdeferEnableTimerScheduling, ɵɵdeferHydrateNever, ɵɵdeferHydrateOnHover, ɵɵdeferHydrateOnIdle, ɵɵdeferHydrateOnImmediate, ɵɵdeferHydrateOnInteraction, ɵɵdeferHydrateOnTimer, ɵɵdeferHydrateOnViewport, ɵɵdeferHydrateWhen, ɵɵdeferOnHover, ɵɵdeferOnIdle, ɵɵdeferOnImmediate, ɵɵdeferOnInteraction, ɵɵdeferOnTimer, ɵɵdeferOnViewport, ɵɵdeferPrefetchOnHover, ɵɵdeferPrefetchOnIdle, ɵɵdeferPrefetchOnImmediate, ɵɵdeferPrefetchOnInteraction, ɵɵdeferPrefetchOnTimer, ɵɵdeferPrefetchOnViewport, ɵɵdeferPrefetchWhen, ɵɵdeferWhen, ɵɵdefineComponent, ɵɵdefineDirective, ɵɵdefineNgModule, ɵɵdefinePipe, ɵɵdirectiveInject, ɵɵdomElement, ɵɵdomElementContainer, ɵɵdomElementContainerEnd, ɵɵdomElementContainerStart, ɵɵdomElementEnd, ɵɵdomElementStart, ɵɵdomListener, ɵɵdomProperty, ɵɵdomTemplate, ɵɵelement, ɵɵelementContainer, ɵɵelementContainerEnd, ɵɵelementContainerStart, ɵɵelementEnd, ɵɵelementStart, ɵɵgetComponentDepsFactory, ɵɵgetCurrentView, ɵɵgetInheritedFactory, ɵɵgetReplaceMetadataURL, ɵɵi18n, ɵɵi18nApply, ɵɵi18nAttributes, ɵɵi18nEnd, ɵɵi18nExp, ɵɵi18nPostprocess, ɵɵi18nStart, ɵɵinjectAttribute, ɵɵinterpolate, ɵɵinterpolate1, ɵɵinterpolate2, ɵɵinterpolate3, ɵɵinterpolate4, ɵɵinterpolate5, ɵɵinterpolate6, ɵɵinterpolate7, ɵɵinterpolate8, ɵɵinterpolateV, ɵɵinvalidFactory, ɵɵlistener, ɵɵloadQuery, ɵɵnextContext, ɵɵpipe, ɵɵpipeBind1, ɵɵpipeBind2, ɵɵpipeBind3, ɵɵpipeBind4, ɵɵpipeBindV, ɵɵprojection, ɵɵprojectionDef, ɵɵproperty, ɵɵpureFunction0, ɵɵpureFunction1, ɵɵpureFunction2, ɵɵpureFunction3, ɵɵpureFunction4, ɵɵpureFunction5, ɵɵpureFunction6, ɵɵpureFunction7, ɵɵpureFunction8, ɵɵpureFunctionV, ɵɵqueryAdvance, ɵɵqueryRefresh, ɵɵreadContextLet, ɵɵreference, ɵɵrepeater, ɵɵrepeaterCreate, ɵɵrepeaterTrackByIdentity, ɵɵrepeaterTrackByIndex, ɵɵreplaceMetadata, ɵɵresolveBody, ɵɵresolveDocument, ɵɵresolveWindow, ɵɵsanitizeHtml, ɵɵsanitizeResourceUrl, ɵɵsanitizeScript, ɵɵsanitizeStyle, ɵɵsanitizeUrl, ɵɵsanitizeUrlOrResourceUrl, ɵɵsetComponentScope, ɵɵsetNgModuleScope, ɵɵstoreLet, ɵɵstyleMap, ɵɵstyleProp, ɵɵsyntheticHostListener, ɵɵsyntheticHostProperty, ɵɵtemplate, ɵɵtemplateRefExtractor, ɵɵtext, ɵɵtextInterpolate, ɵɵtextInterpolate1, ɵɵtextInterpolate2, ɵɵtextInterpolate3, ɵɵtextInterpolate4, ɵɵtextInterpolate5, ɵɵtextInterpolate6, ɵɵtextInterpolate7, ɵɵtextInterpolate8, ɵɵtextInterpolateV, ɵɵtrustConstantHtml, ɵɵtrustConstantResourceUrl, ɵɵtwoWayBindingSet, ɵɵtwoWayListener, ɵɵtwoWayProperty, ɵɵvalidateIframeAttribute, ɵɵviewQuery, ɵɵviewQuerySignal };\n//# sourceMappingURL=debug_node.mjs.map","map":{"version":3,"names":["attachInjectFlag","_global","ɵɵdefineInjectable","__defineInjectable","ɵɵdefineInjector","__defineInjector","ɵɵinject","__inject","ɵɵinvalidFactoryDep","__invalidFactoryDep","resolveForwardRef","newArray","EMPTY_OBJ","assertString","assertNotEqual","FLAGS","assertEqual","isInCheckNoChangesMode","PREORDER_HOOK_FLAGS","assertFirstCreatePass","assertDefined","throwError","assertNumber","assertGreaterThan","HEADER_OFFSET","DECLARATION_VIEW","NG_FACTORY_DEF","isForwardRef","getFactoryDef","assertIndexInRange","assertTNodeForLView","enterDI","runInInjectorProfilerContext","getCurrentTNode","getLView","emitInjectorToCreateInstanceEvent","emitInstanceCreatedByInjectorEvent","throwProviderNotFoundError","leaveDI","assertNodeInjector","stringifyForError","cyclicDependencyErrorWithDetails","cyclicDependencyError","setInjectorProfilerContext","setInjectImplementation","assertDirectiveDef","NG_ELEMENT_ID","convertToBitFlags","isRootView","T_HOST","TVIEW","injectRootLimpMode","isComponentDef","EMBEDDED_VIEW_INJECTOR","INJECTOR$1","INJECTOR","DECLARATION_COMPONENT_VIEW","isComponentHost","RuntimeError","NG_PROV_DEF","getClosureSafeProperty","getNativeByTNode","flatten","arrayEquals","ID","isLView","assertDomNode","unwrapRNode","getComponentLViewByIndex","CONTEXT","EMPTY_ARRAY","assertLView","HOST","CHILD_HEAD","NEXT","isLContainer","getLViewParent","Injector","CLEANUP","getComponentDef","getDirectiveDef","InjectionToken","inject","isInSkipHydrationBlock","isInSkipHydrationBlock$1","HYDRATION","isContentQueryHost","setCurrentQueryIndex","XSS_SECURITY_URL","renderStringify","ENVIRONMENT","makeEnvironmentProviders","isDirectiveHost","formatRuntimeError","resetPreOrderHookFlags","PARENT","RENDERER","CHILD_TAIL","assertSame","assertFirstUpdatePass","getSelectedIndex","getTView","assertIndexInDeclRange","setSelectedIndex","assertLContainer","MOVED_VIEWS","isDestroyed","REACTIVE_TEMPLATE_CONSUMER","DECLARATION_LCONTAINER","QUERIES","assertNotReactive","ON_DESTROY_HOOKS","assertFunction","EFFECTS","assertProjectionSlots","NATIVE","assertParentView","CONTAINER_HEADER_OFFSET","assertNotSame","setCurrentDirectiveIndex","setCurrentTNode","getElementDepthCount","increaseElementDepthCount","wasLastNodeCreated","isCurrentTNodeParent","setCurrentTNodeAsNotParent","assertHasParent","INTERNAL_APPLICATION_ERROR_HANDLER","stringify","getCurrentDirectiveIndex","unwrapLView","isCreationMode","enterView","leaveView","AFTER_RENDER_SEQUENCES_TO_ADD","markAncestorsForTraversal","markViewForRefresh","setIsRefreshingViews","isExhaustiveCheckNoChanges","requiresRefreshOrTraversal","setIsInCheckNoChangesMode","CheckNoChangesMode","setBindingIndex","EFFECTS_TO_SCHEDULE","viewAttachedToChangeDetector","setBindingRootForHostBindings","isRefreshingViews","removeFromArray","addToArray","updateAncestorTraversalFlagsOnAttach","storeLViewOnDestroy","VIEW_REFS","assertGreaterThanOrEqual","isInI18nBlock","assertTNodeForTView","getCurrentParentTNode","getCurrentTNodePlaceholderOk","assertTNode","assertTIcu","assertNumberInRange","DEHYDRATED_VIEWS","getNgModuleDef","getPipeDef","getPipeDef$1","getNgModuleDefOrThrow","isStandalone","concatStringsWithSpace","assertInjectImplementationNotEqual","emitInjectEvent","getConstant","assertLessThan","getOrCreateTViewCleanup","getOrCreateLViewCleanup","assertNotDefined","nextBindingIndex","getSelectedTNode","getDirectiveDefOrThrow","getTNode","assertComponentType","debugStringifyTypeForError","ChangeDetectionScheduler","EnvironmentInjector","SVG_NAMESPACE","MATH_ML_NAMESPACE","viewAttachedToContainer","storeCleanupWithContext","signal","createInjectorWithoutInjectorInstances","R3Injector","getNullInjector","internalImportProvidersFrom","initNgDevMode","fillProperties","getBindingsEnabled","lastNodeWasCreated","isInInjectionContext","DestroyRef","PendingTasksInternal","noop","ErrorHandler","assertNotInReactiveContext","assertInInjectionContext","ViewContext","removeLViewOnDestroy","walkUpViews","getNativeByIndex","assertElement","arrayInsert2","arraySplice","setInjectorProfiler","NullInjector","ENVIRONMENT_INITIALIZER","INJECTOR_DEF_TYPES","walkProviderTree","getInjectorDef","deepForEach","isTypeProvider","isSignal","runInInjectionContext","ZONELESS_ENABLED","EffectScheduler","PendingTasks","assertTNodeCreationIndex","isSkipHydrationRootTNode","leaveSkipHydrationBlock","decreaseElementDepthCount","getNamespace","enterSkipHydrationBlock","getCurrentDirectiveDef","assertIndexInExpandoRange","getBindingIndex","assertOneOf","setInI18nBlock","nextContextImpl","getCurrentQueryIndex","getContextLView","load","keyValueArrayIndexOf","keyValueArraySet","keyValueArrayGet","incrementBindingIndex","isWritableSignal","store","providerToFactory","emitProviderConfiguredEvent","isClassProvider","getBindingRoot","NG_COMP_DEF","ɵɵresetView","__resetView","ɵɵnamespaceHTML","__namespaceHTML","ɵɵnamespaceMathML","__namespaceMathML","ɵɵnamespaceSVG","__namespaceSVG","ɵɵenableBindings","__enableBindings","ɵɵdisableBindings","__disableBindings","ɵɵrestoreView","__restoreView","forwardRef","NG_MOD_DEF","NG_INJ_DEF","NG_DIR_DEF","NG_PIPE_DEF","ZONELESS_SCHEDULER_DISABLED","SCHEDULE_IN_ROOT_ZONE","PROVIDED_ZONELESS","getNativeByTNodeOrNull","setActiveConsumer","SIGNAL","consumerDestroy","REACTIVE_NODE","consumerPollProducersForChange","consumerBeforeComputation","getActiveConsumer","consumerAfterComputation","createComputed","setThrowInvalidWriteToSignalError","Subject","Subscription","setActiveConsumer$1","map","Attribute","Attribute$1","noSideEffects","fn","toString","ANNOTATIONS","PARAMETERS","PROP_METADATA","makeDecorator","name","props","parentClass","additionalProcessing","typeFn","metaCtor","makeMetadataCtor","DecoratorFactory","args","call","annotationInstance","TypeDecorator","cls","annotations","hasOwnProperty","Object","defineProperty","value","push","prototype","create","ngMetadataName","annotationCls","ctor","values","propName","makeParamDecorator","ParamDecoratorFactory","apply","ParamDecorator","annotation","unusedKey","index","parameters","length","makePropDecorator","PropDecoratorFactory","decoratorInstance","PropDecorator","target","undefined","Error","constructor","meta","unshift","Inject","token","Optional","Self","SkipSelf","Host","getCompilerFacade","request","globalNg","ɵcompilerFacade","ngDevMode","console","error","kind","type","message","usage","angularCoreDiEnv","Type","Function","isType","v","ES5_DELEGATE_CTOR","ES2015_INHERITED_CLASS","ES2015_INHERITED_CLASS_WITH_CTOR","ES2015_INHERITED_CLASS_WITH_DELEGATE_CTOR","isDelegateCtor","typeStr","test","ReflectionCapabilities","_reflect","reflect","factory","t","_zipTypesAndAnnotations","paramTypes","paramAnnotations","result","i","concat","_ownParameters","parentCtor","tsickleCtorParams","ctorParameters","ctorParam","convertTsickleDecoratorIntoMetadata","decorators","getOwnMetadata","getParentCtor","_ownAnnotations","typeOrFunc","ownAnnotations","parentAnnotations","_ownPropMetadata","propMetadata","propDecorators","keys","forEach","prop","parentPropMetadata","ownPropMetadata","hasLifecycleHook","lcProperty","decoratorInvocations","decoratorInvocation","decoratorType","annotationArgs","parentProto","getPrototypeOf","SimpleChange","previousValue","currentValue","firstChange","isFirstChange","applyValueToInputField","instance","inputSignalNode","privateName","applyValueToInputSignal","ɵɵNgOnChangesFeature","ɵɵNgOnChangesFeatureImpl","NgOnChangesFeatureImpl","ngInherit","definition","ngOnChanges","setInput","ngOnChangesSetInput","rememberChangeHistoryAndInvokeOnChangesHook","simpleChangesStore","getSimpleChangesStore","current","previous","key","publicName","declaredName","declaredInputs","setSimpleChangesStore","previousChange","SIMPLE_CHANGES_STORE","profilerCallbacks","NOOP_PROFILER_REMOVAL","removeProfiler","profiler","profilerIdx","indexOf","splice","setProfiler","includes","event","eventFn","profilerCallback","registerPreOrderHooks","directiveIndex","directiveDef","tView","ngOnInit","ngDoCheck","wrappedOnChanges","preOrderHooks","preOrderCheckHooks","registerPostOrderHooks","tNode","directiveStart","end","directiveEnd","data","lifecycleHooks","ngAfterContentInit","ngAfterContentChecked","ngAfterViewInit","ngAfterViewChecked","ngOnDestroy","contentHooks","contentCheckHooks","viewHooks","viewCheckHooks","destroyHooks","executeCheckHooks","lView","hooks","nodeIndex","callHooks","executeInitAndCheckHooks","initPhase","incrementInitPhaseFlags","flags","currentView","arr","currentNodeIndex","startIndex","nodeIndexLimit","max","lastNodeIndexFound","hook","isInitHook","callHook","callHookInternal","directive","prevConsumer","indexWithintInitPhase","NO_PARENT_INJECTOR","NodeInjectorFactory","injectImpl","resolving","canSeeViewProviders","multi","componentProviders","providerFactory","isViewProvider","injectImplementation","toTNodeTypeAsString","tNodeType","text","substring","isTNodeShape","insertBeforeIndex","Array","isArray","isLetDeclaration","hasClassInput","hasStyleInput","assertTNodeType","expectedTypes","assertPureTNodeType","setUpAttributes","renderer","native","attrs","namespaceURI","attrName","attrVal","setAttribute","isAnimationProp","setProperty","isNameOnlyAttributeMarker","marker","charCodeAt","mergeHostAttrs","dst","src","slice","srcMarker","item","mergeHostAttribute","key1","key2","markerInsertPosition","dstValue","hasParentInjector","parentLocation","getParentInjectorIndex","parentInjectorIndex","getParentInjectorViewOffset","getParentInjectorView","location","startView","viewOffset","parentView","includeViewProviders","setIncludeViewProviders","oldValue","BLOOM_SIZE","BLOOM_MASK","BLOOM_BUCKET_BITS","nextNgElementId","NOT_FOUND","bloomAdd","injectorIndex","firstCreatePass","id","bloomHash","mask","getOrCreateNodeInjectorForNode","existingInjectorIndex","getInjectorIndex","insertBloom","blueprint","parentLoc","getParentInjectorLocation","parentIndex","parentLView","parentData","footer","parent","declarationViewOffset","parentTNode","lViewCursor","getTNodeFromLView","diPublicInInjector","injectAttributeImpl","attrNameToInject","classes","styles","attrsLength","notFoundValueOrThrow","notFoundValue","lookupTokenUsingModuleInjector","moduleInjector","previousInjectImplementation","get","getOrCreateInjectable","embeddedInjectorValue","lookupTokenUsingEmbeddedInjector","lookupTokenUsingNodeInjector","bloomHashBitOrFactory","NodeInjector","previousTView","hostTElementNode","shouldSearchParent","bloomHasToken","searchTokensOnInjector","currentTView","canAccessViewProviders","isHostSpecialCase","injectableIdx","locateDirectiveOrProvider","getNodeInjectable","nodeProviderIndexes","providerIndexes","tInjectables","injectablesStart","directivesStart","cptViewProvidersCount","startingIndex","endIndex","providerTokenOrDef","dirDef","injectionPath","tData","previousIncludeViewProviders","prevInjectContext","injector","success","tokenId","createNodeInjector","injectorView","isFirstHostTNode","getNodeInjectorLView","nodeInjector","_lView","getNodeInjectorTNode","_tNode","ɵɵgetInheritedFactory","ownConstructor","ownFactory","getFactoryOf","objectPrototype","currentTNode","currentLView","nodeInjectorValue","embeddedViewInjector","embeddedViewInjectorValue","tViewType","declTNode","ɵɵinjectAttribute","attributeName","__NG_ELEMENT_ID__","getReflect","reflectDependencies","convertDependencies","deps","dep","reflectDependency","attribute","host","optional","self","skipSelf","j","param","proto","compileInjectable","ngInjectableDef","ngFactoryDef","compiler","getInjectableMetadata","compileFactory","typeArgumentCount","FactoryTarget","Injectable","configurable","USE_VALUE","provide","String","useValue","isUseClassProvider","useClass","isUseValueProvider","isUseFactoryProvider","useFactory","isUseExistingProvider","useExisting","srcMeta","providedIn","compilerMeta","injectElementRef","createElementRef","ElementRef","nativeElement","unwrapElementRef","symbolIterator","_results","Symbol","iterator","QueryList","_emitDistinctChangesOnly","dirty","_onDirty","_changesDetected","_changes","first","last","changes","filter","find","reduce","init","some","toArray","reset","resultsTree","identityAccessor","newResultFlat","notifyOnChanges","next","onDirty","cb","setDirty","destroy","complete","unsubscribe","SKIP_HYDRATION_ATTR_NAME","SKIP_HYDRATION_ATTR_NAME_LOWER_CASE","hasSkipHydrationAttrOnTNode","mergedAttrs","toLowerCase","hasSkipHydrationAttrOnRElement","rNode","hasAttribute","hasInSkipHydrationBlockFlag","isI18nInSkipHydrationBlock","ChangeDetectionStrategy","TRACKED_LVIEWS","Map","uniqueIdCounter","getUniqueLViewId","registerLView","set","getLViewById","unregisterLView","delete","getTrackedLViews","LContext","lViewId","component","directives","localRefs","getLContext","mpValue","readPatchedData","isComponentInstance","findViaComponent","isDirectiveInstance","findViaDirective","getDirectivesAtNodeIndex","findViaNativeElement","existingCtx","context","createLContext","attachPatchData","rElement","parentNode","parentContext","getComponentViewByInstance","componentInstance","patchedData","contextLView","MONKEY_PATCH_KEY_NAME","readPatchedLView","ɵcmp","ɵdir","bindingStartIndex","traverseNextElement","child","componentIndices","components","elementComponentIndex","componentView","rootComponentView","rootComponent","directiveInstance","firstChild","directiveIndexStart","directiveIndexEnd","results","getComponentAtNodeIndex","componentOffset","discoverLocalRefs","localNames","localIndex","getRootView","componentOrLView","getRootContext","viewOrComponent","rootView","getFirstLContainer","getNearestLContainer","getNextLContainer","container","viewOrContainer","getComponent","element","assertDomElement","getContext","getOwningComponent","elementOrDir","getRootComponents","getInjector","NULL","getInjectionTokens","providerTokens","isDirectiveDefHack","getDirectives","node","Text","Framework","AcxChangeDetectionStrategy","AcxViewEncapsulation","getDirectiveMetadata$1","directiveOrComponentInstance","componentDef","inputs","extractInputDebugMetadata","outputs","encapsulation","changeDetection","onPush","OnPush","Default","getLocalRefs","getHostElement","componentOrDirective","getListeners","lContext","lCleanup","tCleanup","cleanup","listeners","firstParam","secondParam","listenerElement","callback","useCaptureOrIndx","useCapture","sort","sortListeners","a","b","obj","resolveHostDirectives","Element","res","DOCUMENT","setDocument","document","getDocument","APP_ID","DEFAULT_APP_ID","PLATFORM_INITIALIZER","PLATFORM_ID","PACKAGE_ROOT_URL","ANIMATION_MODULE_TYPE","CSP_NONCE","body","querySelector","getAttribute","IMAGE_CONFIG_DEFAULTS","breakpoints","placeholderResolution","disableImageSizeWarning","disableImageLazyLoadWarning","IMAGE_CONFIG","makeStateKey","initTransferState","transferState","TransferState","ngServerMode","retrieveTransferredState","ɵprov","onSerializeCallbacks","defaultValue","remove","hasKey","isEmpty","onSerialize","toJson","e","warn","JSON","replace","doc","appId","script","getElementById","textContent","parse","REFERENCE_NODE_HOST","REFERENCE_NODE_BODY","NODE_NAVIGATION_STEP_FIRST_CHILD","NODE_NAVIGATION_STEP_NEXT_SIBLING","ELEMENT_CONTAINERS","TEMPLATES","CONTAINERS","MULTIPLIER","NUM_ROOT_NODES","TEMPLATE_ID","NODES","DISCONNECTED_NODES","I18N_DATA","DEFER_BLOCK_ID","DEFER_BLOCK_STATE$1","DEFER_PARENT_BLOCK_ID","DEFER_HYDRATE_TRIGGERS","IS_HYDRATION_DOM_REUSE_ENABLED","PRESERVE_HOST_CONTENT_DEFAULT","PRESERVE_HOST_CONTENT","IS_I18N_HYDRATION_ENABLED","IS_EVENT_REPLAY_ENABLED","EVENT_REPLAY_ENABLED_DEFAULT","IS_INCREMENTAL_HYDRATION_ENABLED","JSACTION_BLOCK_ELEMENT_MAP","eventListenerOptions","passive","capture","hoverTriggers","WeakMap","interactionTriggers","viewportTriggers","interactionEventNames","hoverEventNames","intersectionObserver","observedViewportElements","DeferEventEntry","callbacks","Set","listener","onInteraction","trigger","entry","addEventListener","add","size","removeEventListener","onHover","createIntersectionObserver","IntersectionObserver","entries","isIntersecting","has","onViewport","observerFactoryFn","observe","unobserve","disconnect","DEFER_BLOCK_SSR_ID_ATTRIBUTE","setJSActionAttributes","eventTypes","parentDeferBlockId","nodeType","Node","ELEMENT_NODE","existingAttr","JSACTION","parts","prev","curr","blockName","sharedStashFunction","rEl","eventType","listenerFn","el","eventListenerMap","__jsaction_fns","eventListeners","sharedMapFunction","jsActionMap","blockSet","removeListenersFromBlocks","blockNames","blockList","replayList","removeListeners","removeAttribute","JSACTION_EVENT_CONTRACT","invokeListeners","currentTarget","handlerFns","isConnected","handler","stashEventListeners","setStashFn","isStashEventListenerImplEnabled","_stashEventListenerImpl","eventName","wrappedListener","stashEventListenerImpl","enableStashEventListenerImpl","stashEventListener","DEHYDRATED_BLOCK_REGISTRY","DehydratedBlockRegistry","registry","cleanupFns","contract","blockId","info","awaitingCallbacks","hydratedBlocks","invokeTriggerCleanupFns","hydrating","cleanUp","addCleanupFn","cleanupFunctions","fns","awaitParentBlock","topmostParentBlock","parentBlockAwaitCallbacks","isDetachedByI18n","TRANSFER_STATE_TOKEN_ID","NGH_DATA_KEY","TRANSFER_STATE_DEFER_BLOCKS_INFO","NGH_DEFER_BLOCKS_KEY","isInternalHydrationTransferStateKey","NGH_ATTR_NAME","SSR_CONTENT_INTEGRITY_MARKER","_retrieveHydrationInfoImpl","retrieveHydrationInfoImpl","nghAttrValue","componentViewNgh","rootViewNgh","split","rootNgh","remainingNgh","nghData","Number","dehydratedView","setSegmentHead","nextSibling","markRNodeAsClaimedByHydration","hydratedComponents","enableRetrieveHydrationInfoImpl","retrieveHydrationInfo","getLNodeForHydration","viewRef","getTextNodeContent","processTextNodeMarkersBeforeHydration","commentNodesIterator","createNodeIterator","NodeFilter","SHOW_COMMENT","acceptNode","content","isTextNodeMarker","FILTER_ACCEPT","FILTER_REJECT","currentNode","nodes","nextNode","replaceWith","createTextNode","HydrationStatus","HYDRATION_INFO_KEY","patchHydrationInfo","readHydrationInfo","checkIfAlreadyClaimed","isRNodeClaimedForHydration","status","Hydrated","hydratedNodes","markRNodeAsSkippedByHydration","Skipped","componentsSkippedHydration","countBlocksSkippedByHydration","nghDeferData","deferBlocksWithIncrementalHydration","markRNodeAsHavingHydrationMismatch","expectedNodeDetails","actualNodeDetails","Mismatched","hydrationInfo","segmentHeads","getSegmentHead","isIncrementalHydrationEnabled","assertIncrementalHydrationIsConfigured","assertSsrIdDefined","ssrUniqueId","getNgContainerSize","calcSerializedContainerSize","isSerializedElementContainer","getSerializedContainerViews","views","numNodes","view","initDisconnectedNodes","disconnectedNodes","nodeIds","isDisconnectedNode$1","canHydrateNode","processTextNodeBeforeSerialization","corruptedTextNodes","TEXT_NODE","convertHydrateTriggersToJsAction","triggers","actionList","getParentBlockHydrationQueue","deferBlockId","dehydratedBlockRegistry","deferBlockParents","isTopMostDeferBlock","currentBlockId","parentBlockPromise","hydrationQueue","hydratingParentBlock","promise","gatherDeferBlocksByJSActionAttribute","jsactionNodes","querySelectorAll","blockMap","join","attr","match","appendDeferBlocksToJSActionMap","_retrieveDeferBlockDataImpl","retrieveDeferBlockDataImpl","enableRetrieveDeferBlockDataImpl","retrieveDeferBlockData","isTimerTrigger","triggerInfo","getHydrateTimerTrigger","blockData","delay","hasHydrateTrigger","createBlockSummary","blockInfo","hydrate","idle","immediate","timer","viewport","processBlockData","blockDetails","isSsrContentsIntegrity","COMMENT_NODE","trim","skipTextNodes","previousSibling","verifySsrContentsIntegrity","childNodes","beforeBody","endOfHead","head","lastChild","refreshContentQueries","contentQueries","queryStartIdx","directiveDefIdx","executeViewQueryFn","viewQueryFn","executeContentQueries","start","def","ViewEncapsulation","policy$1","getPolicy$1","trustedTypes","createPolicy","createHTML","s","createScript","createScriptURL","trustedHTMLFromString","html","trustedScriptURLFromString","url","policy","getPolicy","trustedHTMLFromStringBypass","trustedScriptFromStringBypass","trustedScriptURLFromStringBypass","SafeValueImpl","changingThisBreaksApplicationSecurity","SafeHtmlImpl","getTypeName","SafeStyleImpl","SafeScriptImpl","SafeUrlImpl","SafeResourceUrlImpl","unwrapSafeValue","allowSanitizationBypassAndThrow","actualType","getSanitizationBypassType","bypassSanitizationTrustHtml","trustedHtml","bypassSanitizationTrustStyle","trustedStyle","bypassSanitizationTrustScript","trustedScript","bypassSanitizationTrustUrl","trustedUrl","bypassSanitizationTrustResourceUrl","trustedResourceUrl","getInertBodyHelper","defaultDoc","inertDocumentHelper","InertDocumentHelper","isDOMParserAvailable","DOMParserHelper","getInertBodyElement","window","DOMParser","parseFromString","inertDocument","implementation","createHTMLDocument","templateEl","createElement","innerHTML","SAFE_URL_PATTERN","_sanitizeUrl","tagSet","tags","merge","sets","VOID_ELEMENTS","OPTIONAL_END_TAG_BLOCK_ELEMENTS","OPTIONAL_END_TAG_INLINE_ELEMENTS","OPTIONAL_END_TAG_ELEMENTS","BLOCK_ELEMENTS","INLINE_ELEMENTS","VALID_ELEMENTS","URI_ATTRS","HTML_ATTRS","ARIA_ATTRS","VALID_ATTRS","SKIP_TRAVERSING_CONTENT_IF_INVALID_ELEMENTS","SanitizingHtmlSerializer","sanitizedSomething","buf","sanitizeChildren","traverseContent","parentNodes","startElement","chars","nodeValue","getFirstChild","endElement","getNextSibling","pop","tagName","getNodeName","elAttrs","attributes","elAttr","lower","encodeEntities","isClobberedElement","childNode","compareDocumentPosition","DOCUMENT_POSITION_CONTAINED_BY","clobberedElementError","nodeName","outerHTML","SURROGATE_PAIR_REGEXP","NON_ALPHANUMERIC_REGEXP","hi","low","inertBodyHelper","_sanitizeHtml","unsafeHtmlInput","inertBodyElement","unsafeHtml","mXSSAttempts","parsedHtml","sanitizer","safeHtml","getTemplateContent","isTemplateElement","SecurityContext","ɵɵsanitizeHtml","getSanitizer","sanitize","HTML","ɵɵsanitizeStyle","unsafeStyle","STYLE","ɵɵsanitizeUrl","unsafeUrl","URL","ɵɵsanitizeResourceUrl","unsafeResourceUrl","RESOURCE_URL","ɵɵsanitizeScript","unsafeScript","SCRIPT","ɵɵtrustConstantHtml","raw","ɵɵtrustConstantResourceUrl","getUrlSanitizer","tag","ɵɵsanitizeUrlOrResourceUrl","validateAgainstEventProperties","startsWith","errorMessage","validateAgainstEventAttributes","COMMENT_DISALLOWED","COMMENT_DELIMITER","COMMENT_DELIMITER_ESCAPED","escapeCommentText","NG_REFLECT_ATTRS_FLAG_DEFAULT","NG_REFLECT_ATTRS_FLAG","provideNgReflectAttributes","providers","normalizeDebugBindingName","camelCaseToDashCase","CAMEL_CASE_REGEXP","input","m","normalizeDebugBindingValue","CUSTOM_ELEMENTS_SCHEMA","NO_ERRORS_SCHEMA","shouldThrowErrorOnUnknownElement","ɵsetUnknownElementStrictMode","shouldThrow","ɵgetUnknownElementStrictMode","shouldThrowErrorOnUnknownProperty","ɵsetUnknownPropertyStrictMode","ɵgetUnknownPropertyStrictMode","validateElementIsKnown","schemas","isUnknown","HTMLUnknownElement","customElements","matchingSchemas","isHostStandalone","isHostComponentStandalone","templateLocation","getTemplateLocationDetails","isPropertyValid","handleUnknownPropertyError","importLocation","KNOWN_CONTROL_FLOW_DIRECTIVES","correspondingImport","reportUnknownPropertyError","getDeclarationComponentDef","declarationLView","standalone","hostComponentDef","componentClassName","schema","ɵɵresolveWindow","ownerDocument","defaultView","ɵɵresolveDocument","ɵɵresolveBody","INTERPOLATION_DELIMITER","maybeUnwrapFn","VALUE_STRING_LENGTH_LIMIT","assertStandaloneComponentType","assertComponentDef","throwMultipleComponentError","second","throwErrorIfNoChangesMode","creationMode","currValue","field","msg","formatValue","strValue","constructDetailsForInterpolation","rootIndex","expressionIndex","changedValue","prefix","chunks","newValue","slotIdx","getExpressionChangedErrorDetails","bindingIndex","metadata","idx","matches","RegExp","classIndexOf","className","classToSearch","foundIndex","NG_TEMPLATE_SELECTOR","isCssClassMatching","cssClassToMatch","isProjectionMode","isInlineTemplate","hasTagAndTypeMatch","currentSelector","tagNameToCompare","isNodeMatchingSelector","selector","mode","nodeAttrs","nameOnlyMarkerIdx","getNameOnlyMarkerIndex","skipToNextSelector","isPositive","selectorAttrValue","attrIndexInNode","findAttrIndexInNode","nodeAttrValue","bindingsMode","maybeAttrName","matchTemplateAttribute","isNodeMatchingSelectorList","getProjectAsAttrValue","ngProjectAsAttrIdx","nodeAttr","isSelectorInSelectorList","list","selectorListLoop","currentSelectorInList","maybeWrapInNotSelector","isNegativeMode","chunk","stringifyCSSSelector","currentChunk","valueOrMarker","attrValue","stringifyCSSSelectorList","selectorList","extractAttrsAndClassesFromSelector","NO_CHANGE","__brand__","createText","updateTextNode","setValue","createCommentNode","createComment","createElementNode","namespace","nativeInsertBefore","beforeNode","isMove","insertBefore","nativeAppendChild","appendChild","nativeAppendOrInsertBefore","nativeRemoveNode","isHostElement","removeChild","clearElementContents","writeDirectStyle","writeDirectClass","setupStaticAttributes","createTView","templateFn","decls","vars","pipes","viewQuery","constsOrFactory","ssrId","initialViewLength","createViewBlueprint","consts","template","queries","fill","expandoStartIndex","hostBindingOpCodes","firstUpdatePass","staticViewQueries","staticContentQueries","directiveRegistry","pipeRegistry","incompleteFirstPass","seal","getOrCreateComponentTView","directiveDefs","pipeDefs","createLView","tHostNode","environment","createComponentLView","hostTNode","rendererFactory","addToEndOfViewTree","getInitialLViewFlagsFromDef","createRenderer","signals","allocExpando","numSlotsToAlloc","initialValue","allocIdx","lViewOrLContainer","ɵɵadvance","delta","selectIndexInternal","checkNoChangesMode","hooksInitPhaseCompleted","InputFlags","writeToDirectiveInput","transform","SignalBased","transformFn","RendererStyleFlags2","_icuContainerIterate","icuContainerIterate","tIcuContainerNode","ensureIcuContainerVisitorLoaded","loader","applyToElementOrContainer","action","lNodeToHandle","lContainer","isComponent","destroyNode","applyContainer","removeViewFromDOM","detachViewFromDOM","addViewToDOM","parentNativeNode","applyView","changeDetectionScheduler","notify","destroyViewTree","cleanUpView","firstView","detachMovedView","declarationContainer","movedViews","declarationViewIndex","destroyLView","executeOnDestroys","processCleanups","lQueries","detachView","targetIdx","destroyHooksFn","effects","effect","toCall","callContext","getParentRElement","getClosestRElement","None","Emulated","getInsertInFrontOfRNode","_getInsertInFrontOfRNodeWithI18n","getInsertInFrontOfRNodeWithNoI18n","_processI18nInsertBefore","setI18nHandling","getInsertInFrontOfRNodeWithI18n","processI18nInsertBefore","childRNode","childTNode","parentRNode","anchorNode","getFirstNativeNode","getBeforeNodeForView","elIcuContainerChild","rNodeOrLContainer","nextRNode","projectionNodes","getProjectionNodes","componentHost","projection","viewIndexInContainer","nextViewIndex","firstTNodeOfView","applyNodes","parentRElement","isProjection","rawSlotValue","applyProjectionRecursive","projectionNext","applyProjection","tProjectionNode","componentLView","componentNode","nodeToProjectOrRNodes","nodeToProject","projectedComponentLView","anchor","applyStyling","isClassBased","removeClass","addClass","DashCase","removeStyle","isImportant","endsWith","Important","setStyle","executeTemplate","rf","prevSelectedIndex","isUpdatePhase","preHookType","postHookType","createDirectivesInstances","instantiateAllDirectives","invokeDirectivesHostBindings","saveResolvedLocalsInData","viewData","localRefExtractor","locateHostElement","elementOrSelector","preserveHostContent","preserveContent","ShadowDom","rootElement","selectRootElement","applyRootElementTransform","_applyRootElementTransformImpl","applyRootElementTransformImpl","enableApplyRootElementTransformImpl","mapPropName","setPropertyAndInputs","hasSetInput","setAllInputsForProperty","markDirtyIfOnPush","setNgReflectProperties","setDomProperty","viewIndex","childComponentLView","setNgReflectProperty","ngReflect","debugValue","inputConfig","hostInputConfig","hostDirectiveInputs","initialInputs","setInputsFromAttrs","elementIndex","currentDirectiveIndex","dirIndex","hostBindings","hostVars","hostAttrs","invokeHostBindingsInCreationMode","findDirectiveDefMatches","selectors","elementAttributeInternal","setElementAttribute","initialInputData","lookupName","elementLikeStartShared","locateOrCreateNativeNode","adjustedIndex","isElement","elementLikeEndShared","storePropertyBindingMetadata","propertyName","interpolationParts","propBindingIdxs","propertyBindings","bindingMetadata","loadComponentRenderer","currentDef","handleUncaughtError","errorHandler","hasMatch","setDirectiveInput","hostIndex","hostDirectivesStart","hostDirectivesEnd","hasSet","directiveToIndex","hostDirectivePublicName","renderComponent","hostLView","componentHostIdx","componentTView","syncViewWithBlueprint","hostRNode","renderView","finishViewCreation","renderChildComponents","createAndRenderEmbeddedLView","templateTNode","options","embeddedTView","isSignalView","viewFlags","embeddedLView","declarationLContainer","declarationViewLQueries","createEmbeddedView","shouldAddViewToDom","USE_EXHAUSTIVE_CHECK_NO_CHANGES_DEFAULT","UseExhaustiveCheckNoChanges","collectNativeNodes","lNode","collectNativeNodesInLContainer","nodesInSlot","lViewInAContainer","lViewFirstChildTNode","addAfterRenderSequencesForView","sequence","impl","addSequence","freeConsumers","getOrBorrowReactiveLViewConsumer","borrowReactiveLViewConsumer","consumer","REACTIVE_LVIEW_CONSUMER_NODE","maybeReturnReactiveLViewConsumer","consumerIsAlwaysLive","consumerMarkedDirty","consumerOnSignalRead","getOrCreateTemporaryConsumer","TEMPORARY_CONSUMER_NODE","viewShouldHaveReactiveConsumer","isReactiveLViewConsumer","runEffectsInView","tryFlushEffects","foundDirtyEffect","zone","Zone","run","MAXIMUM_REFRESH_RERUNS$1","detectChangesInternal","begin","detectChangesInViewWhileDirty","lastIsRefreshingViewsValue","detectChangesInView","retries","checkNoChangesInternal","exhaustive","Exhaustive","OnlyDirtyViews","Off","refreshView","isInCheckNoChangesPass","isInExhaustiveCheckNoChangesPass","returnConsumerToPool","currentConsumer","markTransplantedViewsForRefresh","detectChangesInEmbeddedViews","processHostBindingOpCodes","detectChangesInChildComponents","notifyEffect","detectChangesInViewIfAttached","movedLView","detectChangesInComponent","shouldRefreshView","opCode","directiveIdx","bindingRootIndx","hostBindingFn","markViewDirty","source","dirtyBitsToUse","createLContainer","hostNative","getLViewFromLContainer","addLViewToLContainer","addToDOM","insertView","removeLViewFromLContainer","removeIndex","indexInContainer","viewToDetach","removedLView","containerLength","trackMovedView","insertedComponentLView","declaredComponentLView","ViewRef","_cdRefInjectingView","_appRef","_attachedToViewContainer","rootNodes","destroyed","viewRefs","onDestroy","markForCheck","detach","reattach","detectChanges","checkNoChanges","attachToViewContainerRef","detachFromAppRef","isRoot","attachToAppRef","appRef","isViewDirty","markForRefresh","TemplateRef","_declarationLView","_declarationTContainer","elementRef","injectTemplateRef","createEmbeddedViewImpl","createTemplateRef","AT_THIS_LOCATION","getFriendlyStringFromTNodeType","validateMatchingNode","isViewContainerAnchor","expectedNode","shortRNodeDescription","header","expectedDom","describeExpectedDom","expected","actual","componentHostElement","actualNode","actualDom","describeDomFromNode","getHydrationErrorFooter","getHydrationAttributeNote","validateSiblingNodeExists","validateNodeExists","nodeNotFoundError","nodeNotFoundAtPathError","path","describeRNode","unsupportedProjectionOfDomNodes","invalidSkipHydrationHost","stringifyTNodeAttrs","shorten","internalAttrs","stringifyRNodeAttrs","describeTNode","innerContent","typeAsString","spacer","componentInfo","stripNewlines","maxLength","tNodeInsertBeforeIndex","i18nParent","anchorRNode","i18nChild","getOrCreateTNode","createTNodeAtIndex","isParent","createTNode","linkTNodeInTView","tParent","directiveStylingLast","hostDirectiveOutputs","stylesWithoutHost","residualStyles","classesWithoutHost","residualClasses","classBindings","styleBindings","addTNodeAndUpdateInsertBeforeIndex","previousTNodes","newTNode","existingTNode","isI18nText","isNewTNodeCreatedBefore","getInsertBeforeIndex","setInsertBeforeIndex","getTIcu","tIcu","setTIcu","setTNodeInsertBeforeIndex","createTNodePlaceholder","getCurrentICUCaseIndex","currentCase","currentCaseLViewIndex","getParentFromIcuCreateOpCode","mergedCode","getRefFromIcuCreateOpCode","getInstructionFromIcuCreateOpCode","icuCreateOpCode","parentIdx","refIdx","isRootTemplateMessage","subTemplateIndex","enterIcu","state","cases","removes","icuContainerIteratorNext","removeOpCode","stack","tIcuIndex","loadIcuContainerVisitor","_state","icuContainerIteratorStart","bind","createIcuIterator","REF_EXTRACTOR_REGEXP","compressNodeLocation","referenceNode","segment","lastIdx","decompressNodeLocation","_","refNodeId","refNodeName","rest","ref","parseInt","steps","step","count","matchAll","repeat","isFirstElementInNgContainer","getNoOffsetIndex","isDisconnectedNode","isDisconnectedRNode","locateI18nRNodeByIndex","noOffsetIndex","i18nNodes","tryLocateRNodeByPath","locateRNodeByPath","locateNextRNode","previousTNodeParent","previousTNode","noOffsetParentIndex","previousRElement","noOffsetPrevSiblingIndex","segmentHead","numRootNodesToSkip","nodesToSkip","siblingAfter","skip","from","stringifyNavigationInstructions","instructions","r","navigateToNode","navigationInstructions","parentElementId","navigateBetween","finish","parentElement","navigateBetweenSiblings","parentPath","childPath","nav","calcPathBetween","to","fromNodeName","calcPathForNode","excludedParentNodes","referenceNodeName","firstRNode","gatherDeferBlocksCommentNodes","nodesByBlockId","nghPattern","nghIdx","nghValue","trimStart","_isI18nHydrationSupportEnabled","_prepareI18nBlockForHydrationImpl","setIsI18nHydrationSupportEnabled","enabled","isI18nHydrationSupportEnabled","prepareI18nBlockForHydration","enablePrepareI18nBlockForHydrationImpl","prepareI18nBlockForHydrationImpl","isI18nHydrationEnabled","getOrComputeI18nChildren","i18nChildren","collectI18nChildren","children","collectI18nViews","caseNodes","caseNode","tI18n","ast","trySerializeI18nBlock","parentTNodeIndex","serializedI18nBlock","caseQueue","disjointNodes","serializeI18nBlock","prevRNode","serializeI18nNode","isDisjointNode","prevNode","maybeRNode","caseIdx","getFirstNativeNodeForI18nNode","maybeTNode","icuIterator","setCurrentNode","appendI18nNodeToCollection","astNode","skipSiblingNodes","forkHydrationState","findHydrationRoot","rootNode","dehydratedIcuData","collectI18nNodesFromDom","nodeOrNodes","nextState","targetNode","containerSize","selectedCase","shift","childState","case","_claimDehydratedIcuCaseImpl","claimDehydratedIcuCase","icuIndex","caseIndex","enableClaimDehydratedIcuCaseImpl","claimDehydratedIcuCaseImpl","dehydratedIcuDataMap","cleanupI18nHydrationData","cleanupDehydratedIcuData","removeDehydratedViews","retainedViews","removeDehydratedView","dehydratedViewsRemoved","removeDehydratedViewList","deferBlock","dehydratedViews","nodesRemoved","currentRNode","cleanupLContainer","cleanupLView","cleanupDehydratedViews","_views","dehydratedViewsCleanupRuns","cleanupHydratedDeferBlocks","locateDehydratedViewsInContainer","serializedViews","serializedView","_findMatchingDehydratedViewImpl","_findAndReconcileMatchingDehydratedViewsImpl","enableFindMatchingDehydratedViewImpl","findMatchingDehydratedViewImpl","findAndReconcileMatchingDehydratedViewsImpl","hasMatchingDehydratedView","findMatchingDehydratedView","removeStaleDehydratedBranch","findAndReconcileMatchingDehydratedViews","cleanupMatchingDehydratedViews","ComponentRef$1","ComponentRef","ComponentFactory$1","ComponentFactory","_NullComponentFactoryResolver","resolveComponentFactory","ComponentFactoryResolver$1","ComponentFactoryResolver","RendererFactory2","Renderer2","injectRenderer2","nodeAtIndex","Sanitizer","isModuleWithProviders","ngModule","isNgModule","isPipe","isDirective","getDependencyTypeForError","verifyStandaloneImport","depType","importingType","DepsTracker","ownerNgModule","ngModulesWithSomeUnresolvedDecls","ngModulesScopeCache","standaloneComponentsScopeCache","resolveNgModulesDecls","moduleType","declarations","decl","clear","getComponentDependencies","rawImports","scope","getStandaloneComponentScope","compilation","isPoisoned","dependencies","ngModules","getNgModuleScope","registerNgModule","scopeInfo","clearScopeCacheFor","computeNgModuleScope","exported","imported","imports","importedScope","addSet","exports","exportedScope","ans","computeStandaloneComponentScope","rawImport","isOrphanComponent","cmp","sourceSet","targetSet","depsTracker","NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR","ChainedInjector","parentInjector","computeStaticStyling","writeToHost","style","styleValue","ɵɵdirectiveInject","ɵɵinvalidFactory","resolveDirectives","directiveMatcher","exportsMap","matchedDirectiveDefs","hostDirectiveDefs","hostDirectiveRanges","assertNoDuplicateDirectives","initializeDirectives","cacheMatchingLocalNames","markAsComponentHost","directivesLength","hasSeenComponent","initTNodeFlags","providersResolver","preOrderHooksFound","preOrderCheckHooksFound","configureViewWithDirective","saveNameToExportMap","lifeCycleHooks","initializeInputAndOutputAliases","setupSelectorMatchedInputsOrOutputs","setupInitialInputs","hostDirectiveDef","setupHostDirectiveInputsOrOutputs","aliasMap","bindings","setShadowStylingInputFlags","config","initialName","isHostDirective","inputsToStore","directiveFactory","nodeInjectorFactory","registerHostBindingOpCodes","directiveVarsIdx","elementIndx","lastSelectedElementIdx","exportAs","numberOfDirectives","seenDirectives","directiveHostFirstCreatePass","bindingsEnabled","attrsIndex","localRefsIndex","tViewConsts","elementStart","directiveHostEndFirstCreatePass","elementEnd","domOnlyFirstCreatePass","refs","isListLikeIterable","isJsObject","areIterablesEqual","comparator","iterator1","iterator2","item1","item2","done","iterateListLike","o","devModeEqual","isListLikeIterableA","isListLikeIterableB","isAObject","isBObject","is","updateBinding","getBinding","bindingUpdated","oldValueToCompare","details","bindingUpdated2","exp1","exp2","different","bindingUpdated3","exp3","bindingUpdated4","exp4","wrapListener","wrapListenerIn_markDirtyAndPreventDefault","executeListenerWithErrorHandling","nextListenerFn","__ngNextListenerFn__","listenToDomEvent","eventTargetResolver","originalListener","isTNodeDirectiveHost","hasCoalesced","existingListener","findExistingListener","lastListenerFn","__ngLastListenerFn__","cleanupFn","listen","idxOrTargetGetter","storeListenerCleanup","tNodeIndex","cleanupEventName","listenerIdxInLCleanup","indexOrTargetGetter","isOutput","createOutputListener","targetDef","hasBound","listenToDirectiveOutput","hasOutput","listenToOutput","output","isOutputSubscribable","subscription","subscribe","BINDING","INPUT_BINDING_METADATA","requiredVars","OUTPUT_BINDING_METADATA","inputBindingUpdate","targetDirectiveIdx","inputBinding","binding","update","outputBinding","twoWayBinding","eventValue","toInputRefArray","inputData","templateName","toOutputRefArray","verifyNotAnOrphanComponent","ngJitMode","debugInfo","forbidOrphanRendering","createRootViewInjector","environmentInjector","realEnvironmentInjector","getStandaloneInjector","rootViewInjector","createRootLViewEnvironment","rootLViewInjector","createHostElement","render","componentType","ngContentSelectors","isBoundToModule","cachedInputs","cachedOutputs","projectableNodes","rootSelectorOrNode","componentBindings","cmpDef","rootTView","createRootTView","hostRenderer","hostElement","hasInputBindings","isInputBinding","d","rootLView","projectNodes","tAttributes","creationBindings","updateBindings","varsToAllocate","directivesToApply","directiveType","getRootTViewTemplate","_rootLView","_hasInputBindings","hostView","changeDetectorRef","previousInputValues","cmpNameForError","nodesforSlot","ViewContainerRef","injectViewContainerRef","createContainerRef","VE_ViewContainerRef","R3ViewContainerRef","_lContainer","_hostTNode","_hostLView","getViewRefs","templateRef","indexOrOptions","insertImpl","createComponent","componentFactoryOrType","isComponentFactory","ngModuleRef","componentFactory","contextInjector","_injector","componentRef","insert","prevIdx","prevLContainer","prevVCRef","adjustedIdx","_adjustIndex","getOrCreateViewRefs","move","newIndex","viewRefsArr","detachedView","wasDetached","slotValue","_locateOrCreateAnchorNode","insertAnchorNode","commentNode","parentOfHostNative","createAnchorNode","_populateDehydratedViewsInLContainer","populateDehydratedViewsInLContainer","populateDehydratedViewsInLContainerImpl","isNodeCreationMode","locateOrCreateAnchorNode","enableLocateOrCreateContainerRefImpl","LQuery_","queryList","clone","LQueries_","tQueries","noOfInheritedQueries","viewLQueries","tQuery","getByIndex","parentLQuery","indexInDeclarationView","dirtyQueriesWithMatches","getTQuery","TQueryMetadata_","read","predicate","splitQueryMultiSelectors","TQueries_","queriesForTemplateRef","childQueryIndex","tqueryClone","track","tquery","TQuery_","crossesNgTemplate","_declarationNodeIndex","_appliesToNextNode","isApplyingToNode","matchTNode","addMatch","declarationNodeIdx","matchTNodeWithReadOption","getIdxOfMatchingSelector","nodeMatchIdx","directiveOrProviderIdx","tNodeIdx","matchIdx","createResultByTNodeType","createResultForNode","matchingIdx","createSpecialToken","materializeViewResults","queryIndex","lQuery","tViewData","tQueryMatches","matchedNodeIdx","collectQueryResults","lViewResults","embeddedLViews","loadQueryInternal","createLQuery","createViewQuery","createTQuery","createContentQuery","saveContentQueryAndDirectiveIndex","locator","tViewContentQueries","lastSavedDirectiveIndex","getQueryResults","createQuerySignalFn","firstOnly","required","opts","signalFn","_dirtyCounter","refreshSignalQuery","_flatValue","debugName","createSingleResultOptionalQuerySignalFn","createSingleResultRequiredQuerySignalFn","createMultiResultQuerySignalFn","bindQueryToSignal","_queryIndex","_queryList","resultChanged","resolveComponentResources","resourceResolver","componentResolved","urlMap","cachedResourceResolve","resp","then","unwrapResponse","componentResourceResolutionQueue","promises","templateUrl","styleUrl","styleUrls","styleOffset","fullyResolved","Promise","all","componentDefResolved","clearResolutionOfComponentResourcesQueue","componentDefPendingResolution","maybeQueueResolutionOfComponentResources","componentNeedsResolution","isComponentDefPendingResolution","old","restoreComponentResolutionQueue","queue","isComponentResourceResolutionQueueEmpty","response","modules","checkForDuplicateNgModules","assertSameOrNotExisting","incoming","registerNgModuleType","ngModuleType","existing","getRegisteredNgModuleType","setAllowDuplicateNgModuleIdsForTest","allowDuplicates","ɵɵvalidateIframeAttribute","iframe","srcdoc","markedFeatures","performanceMarkFeature","feature","performance","mark","detail","NgModuleRef$1","NgModuleRef","NgModuleFactory$1","NgModuleFactory","createNgModule","createNgModuleRef","_parent","_bootstrapComponents","_r3Injector","destroyCbs","componentFactoryResolver","additionalProviders","runInjectorInitializers","ngModuleDef","bootstrap","resolveInjectorInitializers","createNgModuleRefWithProviders","EnvironmentNgModuleRefAdapter","runEnvironmentInitializers","createEnvironmentInjector","adapter","StandaloneService","cachedInjectors","getOrCreateStandaloneInjector","standaloneInjector","ɵɵdefineComponent","componentDefinition","baseDef","getNgDirectiveDef","getExternalStyles","initFeatures","extractDefListOrFactory","extractDirectiveDef","getComponentId","ɵɵdefineNgModule","transitiveCompileScopes","parseAndConvertInputsForDefinition","newLookup","minifiedKey","inputFlags","parseAndConvertOutputsForDefinition","ɵɵdefineDirective","directiveDefinition","ɵɵdefinePipe","pipeDef","pure","features","hostDirectives","defExtractor","resolvedDependencies","GENERATED_COMP_IDS","hash","componentDefConsts","hashSelectors","getOwnPropertyNames","char","Math","imul","compId","previousCompDefType","getSuperType","ɵɵInheritDefinitionFeature","superType","shouldInheritFields","inheritanceChain","superDef","writeableDef","maybeUnwrapEmpty","superHostBindings","inheritHostBindings","superViewQuery","superContentQueries","inheritViewQuery","inheritContentQueries","mergeInputsWithTransforms","animation","defData","mergeHostAttrsAcrossInheritance","prevViewQuery","ctx","prevContentQueries","prevHostBindings","COPY_DIRECTIVE_FIELDS","COPY_COMPONENT_FIELDS","ɵɵCopyDefinitionFeature","defAny","ɵɵHostDirectivesFeature","rawHostDirectives","isEager","createHostDirectiveDef","allDirectiveDefs","hasComponent","findHostDirectiveDefs","matchedDefs","configOrFn","resolved","trackHostDirectiveDef","validateHostDirective","patchDeclaredInputs","bindingArrayToMap","exposedInputs","remappedPublicName","hostDirectiveConfig","validateMappings","bindingType","hostDirectiveBindings","templateCreate","declarationTView","comment","_locateOrCreateContainerAnchor","declareDirectiveHostTemplate","declareNoDirectiveHostTemplate","ɵɵtemplate","ɵɵdomTemplate","createContainerAnchorImpl","locateOrCreateContainerAnchorImpl","viewContainerSize","enableLocateOrCreateContainerAnchorImpl","DeferDependenciesLoadingState","MINIMUM_SLOT","LOADING_AFTER_SLOT","DeferBlockState","DeferBlockInternalState","NEXT_DEFER_BLOCK_STATE","DEFER_BLOCK_STATE","STATE_IS_FROZEN_UNTIL","LOADING_AFTER_CLEANUP_FN","TRIGGER_CLEANUP_FNS","PREFETCH_TRIGGER_CLEANUP_FNS","SSR_UNIQUE_ID","SSR_BLOCK_STATE","ON_COMPLETE_FNS","HYDRATE_TRIGGER_CLEANUP_FNS","DeferBlockBehavior","storeTriggerCleanupFn","lDetails","getCleanupFnKeyByType","invokeAllTriggerCleanupFns","TracingAction","TracingService","SCHEDULE_IN_ROOT_ZONE_DEFAULT","EventEmitter_","__isAsync","destroyRef","pendingTasks","isAsync","emit","observerOrNext","nextFn","errorFn","completeFn","observer","wrapInTimeout","sink","taskId","setTimeout","EventEmitter","scheduleCallbackWithRafRace","timeoutId","animationFrameId","cancelAnimationFrame","clearTimeout","requestAnimationFrame","scheduleCallbackWithMicrotask","queueMicrotask","AsyncStackTaggingZoneSpec","createTask","namePrefix","consoleAsyncStackTaggingImpl","onScheduleTask","delegate","_current","task","consoleTask","scheduleTask","onInvokeTask","_currentZone","targetZone","applyThis","applyArgs","ret","invokeTask","isAngularZoneProperty","angularZoneInstanceIdProperty","ngZoneInstanceId","NgZone","hasPendingMacrotasks","hasPendingMicrotasks","isStable","onUnstable","onMicrotaskEmpty","onStable","onError","enableLongStackTrace","shouldCoalesceEventChangeDetection","shouldCoalesceRunChangeDetection","scheduleInRootZone","assertZonePatched","_nesting","_outer","_inner","fork","callbackScheduled","forkInnerZoneWithAngularBehavior","isInAngularZone","assertInAngularZone","assertNotInAngularZone","runTask","scheduleEventTask","EMPTY_PAYLOAD","cancelTask","runGuarded","runOutsideAngular","checkStable","delayChangeDetectionForEvents","isCheckStableRunning","scheduleCheckStable","updateMicroTaskStatus","root","delayChangeDetectionForEventsDelegate","instanceId","properties","shouldBeIgnoredByZone","onEnter","onLeave","onInvoke","invoke","isSchedulerTick","onHasTask","hasTaskState","hasTask","change","_hasPendingMicrotasks","microTask","macroTask","onHandleError","handleError","NoopNgZone","hasApplyArgsData","getNgZone","ngZoneToUse","AfterRenderManager","execute","AFTER_RENDER_PHASES","AfterRenderImpl","ngZone","scheduler","sequences","deferredRegistrations","executing","hasSequencesToExecute","phase","erroredOrDestroyed","pipelinedValue","maybeTrace","hookFn","snapshot","err","afterRun","once","register","unregister","AFTER_NEXT_RENDER","AfterRenderSequence","unregisterOnDestroy","dispose","scheduled","afterEveryRender","callbackOrSpec","NOOP_AFTER_RENDER_REF","afterEveryRenderImpl","afterNextRender","getHooks","earlyRead","write","mixedReadWrite","manager","tracing","manualCleanup","viewContext","getDeferBlockDataIndex","deferBlockIndex","getLDeferBlockDetails","slotIndex","setLDeferBlockDetails","getTDeferBlockDetails","setTDeferBlockDetails","deferBlockConfig","getTemplateIndexForState","newState","tDetails","Complete","primaryTmplIndex","Loading","loadingTmplIndex","errorTmplIndex","Placeholder","placeholderTmplIndex","getMinimumDurationForState","currentState","placeholderBlockConfig","loadingBlockConfig","getLoadingBlockAfter","addDepsToRegistry","currentDeps","newDeps","currentDepSet","getPrimaryBlockTNode","assertDeferredDependenciesLoaded","loadingState","COMPLETE","isTDeferBlockDetails","isDeferBlock","trackTriggerForDebugging","textRepresentation","debug","onViewportWrapper","getTriggerLView","deferredHostLView","deferredTNode","walkUpTimes","deferredContainer","triggerLView","renderedState","getTriggerElement","triggerIndex","registerDomTrigger","initialLView","registerFn","poll","pollDomTrigger","Initial","onIdle","IdleScheduler","_requestIdleCallback","requestIdleCallback","_cancelIdleCallback","cancelIdleCallback","executingCallbacks","idleId","deferred","requestIdleCallbackFn","globalThis","cancelIdleCallbackFn","scheduleIdleCallback","onTimer","scheduleTimerTrigger","TimerScheduler","invokeTimerAt","addToQueue","Date","now","scheduleTimer","callbackIndex","removeFromQueue","invokeAt","insertAtIndex","invokeQueuedCallbackAt","queuedCallback","lastCallbackIndex","FRAME_DURATION_MS","timeout","CachedInjectorService","getOrCreateInjector","DEFER_BLOCK_DEPENDENCY_INTERCEPTOR","DEFER_BLOCK_CONFIG","getOrCreateEnvironmentInjector","createDeferBlockInjector","origInjector","parentEnvInjector","envInjector","renderDeferBlockState","skipTimerScheduling","hostTView","ssrState","isValidStateChange","needsScheduling","applyDeferBlockStateWithSchedulingImpl","applyStateFn","applyDeferBlockState","findMatchingDehydratedViewForDeferBlock","dehydratedViewIx","findIndex","stateTmplIndex","activeBlockTNode","applyDeferBlockStateWithScheduling","loadingAfter","inLoadingAfterPhase","scheduleDeferBlockUpdate","duration","renderPlaceholder","renderDeferStateAfterResourceLoading","loadingPromise","FAILED","ɵɵdeferEnableTimerScheduling","placeholderConfigIndex","loadingConfigIndex","ASYNC_COMPONENT_METADATA_FN","getAsyncClassMetadataFn","componentClass","setClassMetadataAsync","dependencyLoaderFn","metadataSetterFn","setClassMetadata","clazz","Console","log","ɵfac","Console_Factory","__ngFactoryType__","DIDebugData","resolverToTokenToDependencies","resolverToProviders","resolverToEffects","standaloneInjectorToComponent","frameworkDIDebugData","getFrameworkDIDebugData","setupFrameworkInjectorProfiler","injectorProfilerEventHandler","injectorProfilerEvent","handleInjectEvent","service","handleInstanceCreatedByInjectorEvent","handleProviderConfiguredEvent","providerRecord","handleEffectCreatedEvent","diResolver","getDIResolver","diResolverToInstantiatedToken","canBeHeldWeakly","instantiatedTokenToDependencies","injectedIn","getNodeInjectorContext","standaloneComponent","isStandaloneComponent","applyChanges","getDeferBlocks$1","deferBlocks","isLast","getDeferBlocks","findDeferBlocks","viewInjector","blocks","contains","renderedLView","getRendererLView","hydrationState","inferHydrationState","deferId","deferData","numberOfRootNodes","collectedNodeCount","deferBlockCommentNode","stringifyState","incrementalHydrationState","hasErrorBlock","loadingBlock","exists","minimumTime","afterTime","placeholderBlock","hydrateTriggers","getDependenciesFromInjectable","unformattedDependencies","getDependenciesForTokenInInjector","resolutionPath","getInjectorResolutionPath","formattedDependency","injectorToCheck","firstInjector","lookupFromFirstInjector","tokenDependencyMap","dependency","dependencyNode","instanceNode","getProviderImportsContainer","defTypeRef","getNodeInjectorProviders","getProviderImportPaths","providerImportsContainer","providerToPath","visitedContainers","visitor","walkProviderTreeToDiscoverImportPaths","provider","prov","existingImportPath","containerDef","lastContainerAddedToPath","isNextStepInPath","moduleImport","getEnvironmentInjectorProviders","providerRecordsWithoutImportPaths","isPlatformInjector","providerRecords","importPath","scopes","getInjectorProviders","getInjectorMetadata","getInjectorResolutionPathHelper","getInjectorParent","getModuleInjectorOfNodeInjector","parentTView","chainedInjector","injectorParent","inj","isComputedNode","isTemplateEffectNode","isSignalNode","getTemplateConsumer","templateLView","signalDebugMap","counter$1","getNodesAndEdgesFromSignalMap","signalMap","debugSignalGraphNodes","edges","producers","consumerIndex","label","epoch","version","debuggableFn","computation","producer","extractEffectsFromInjector","extractSignalNodesAndEdgesFromRoots","signalDependenciesMap","producerNodes","link","nextProducer","getSignalGraph","templateConsumer","nonTemplateEffectNodes","signalNodes","changeDetectionRuns","changeDetectionSyncRuns","counter","eventsStack","measureStart","startEvent","timeStamp","measureEnd","entryName","color","top","chromeDevToolsInjectorProfiler","getProviderTokenMeasureName","devToolsProfiler","typeName","getComponentMeasureName","enableProfiling","removeInjectorProfiler","GLOBAL_PUBLISH_EXPANDO_KEY","globalUtilsFunctions","_published","publishDefaultGlobalUtils$1","methodName","method","publishGlobalUtil","publishUtil","publishExternalGlobalUtil","COMPILED","w","TESTABILITY","TESTABILITY_GETTER","Testability","_ngZone","_isZoneStable","_callbacks","_taskTrackingZone","_destroyRef","testabilityGetter","_testabilityGetter","setTestabilityGetter","addToWindow","_watchAngularEvents","onUnstableSubscription","onStableSubscription","_runCallbacksIfReady","doneCb","pending","getPendingTasks","updateCb","macroTasks","creationLocation","addCallback","whenStable","registerApplication","unregisterApplication","findProviders","using","exactMatch","Testability_Factory","TestabilityRegistry","_applications","testability","unregisterAllApplications","getTestability","elem","getAllTestabilities","getAllRootElements","findTestabilityInTree","findInAncestors","TestabilityRegistry_Factory","getter","isPromise","isSubscribable","APP_INITIALIZER","provideAppInitializer","initializerFn","ApplicationInitStatus","resolve","reject","initialized","donePromise","rej","appInits","runInitializers","asyncInitPromises","initResult","observableAsPromise","catch","ApplicationInitStatus_Factory","APP_BOOTSTRAP_LISTENER","publishDefaultGlobalUtils","publishSignalConfiguration","activeConsumer","cf","NgProbeToken","MAXIMUM_REFRESH_RERUNS","optionsReducer","objs","ApplicationRef","_runningTick","_destroyed","_destroyListeners","internalErrorHandler","afterRenderManager","zonelessEnabled","rootEffectScheduler","dirtyFlags","tracingSnapshot","allTestViews","autoDetectTestViews","includeAllTestViews","afterTick","allViews","componentTypes","internalPendingTask","hasPendingTasksObservable","pipe","stable","finally","_rendererFactory","componentOrFactory","bootstrapImpl","warnIfDestroyed","initStatus","resolver","selectorOrNode","compRef","_loadComponent","_console","tick","_tick","CHANGE_DETECTION","tickImpl","synchronize","runs","synchronizeOnce","flush","ranDetectChanges","useGlobalCheck","Boolean","syncDirtyFlagsWithViews","attachView","viewCount","ApplicationRef_Factory","scheduleDelayedTrigger","scheduleFn","shouldTriggerDeferBlock","triggerDeferBlock","scheduleDelayedPrefetching","NOT_STARTED","prefetch","triggerPrefetching","scheduleDelayedHydrating","triggerHydrationFromBlockName","triggerResourceLoading","primaryBlockTNode","IN_PROGRESS","dependenciesFn","dependencyResolverFn","deferDependencyInterceptor","intercept","removeTask","allSettled","failed","primaryBlockTView","directiveTypes","triggerType","behavior","Manual","_x","_x2","_x3","_triggerHydrationFromBlockName","arguments","_asyncToGenerator","replayQueuedEventsFn","blocksBeingHydrated","populateHydratingStateForQueue","triggerHydrationForBlockQueue","_x4","_x5","_x6","_triggerHydrationForBlockQueue","blockQueueIdx","dehydratedBlockId","dehydratedDeferBlock","triggerResourceLoadingForHydration","nextRender","deferBlockHasErrored","cleanupRemainingHydrationQueue","cleanupParentContainer","lastBlockName","currentBlockIdx","parentDeferBlockIdx","parentDeferBlock","withResolvers","resolveFn","_x7","_triggerResourceLoadingForHydration","dehydratedBlock","onDeferBlockCompletion","shouldAttachTrigger","shouldAttachRegularTrigger","hasHydrateTriggers","incrementalHydrationEnabled","_hasHydrateTriggers","wasServerSideRendered","getHydrateTriggers","processAndInitTriggers","idleElements","timerElements","viewportElements","immediateElements","blockSummary","numRootNodes","elementTrigger","setIdleTriggers","setImmediateTriggers","setViewportTriggers","setTimerTriggers","elementTriggers","timerFn","_hmrWarningProduced","logHmrWarning","ɵɵdefer","enableTimerScheduling","ngHmrMode","ssrBlockState","onLViewDestroy","ɵɵdeferWhen","rawValue","ɵɵdeferPrefetchWhen","ɵɵdeferHydrateWhen","ɵɵdeferHydrateNever","ɵɵdeferOnIdle","ɵɵdeferPrefetchOnIdle","ɵɵdeferHydrateOnIdle","ɵɵdeferOnImmediate","ɵɵdeferPrefetchOnImmediate","ɵɵdeferHydrateOnImmediate","ɵɵdeferOnTimer","ɵɵdeferPrefetchOnTimer","ɵɵdeferHydrateOnTimer","ɵɵdeferOnHover","ɵɵdeferPrefetchOnHover","ɵɵdeferHydrateOnHover","ɵɵdeferOnInteraction","ɵɵdeferPrefetchOnInteraction","ɵɵdeferHydrateOnInteraction","ɵɵdeferOnViewport","ɵɵdeferPrefetchOnViewport","ɵɵdeferHydrateOnViewport","ɵɵattribute","ɵɵcomponentInstance","LiveCollection","updateValue","swap","index1","index2","startIdx","min","endIdx","endItem","startItem","attach","prevIndex","newIdx","valuesMatching","liveIdx","liveValue","trackBy","recordDuplicateKeys","keyToIdx","idxSoFar","reconcile","liveCollection","newCollection","trackByFn","detachedItems","liveKeysInTheFuture","liveStartIdx","liveEndIdx","duplicateKeys","newEndIdx","liveStartValue","at","newStartValue","isStartMatching","liveEndValue","newEndValue","isEndMatching","liveStartKey","liveEndKey","newStartKey","newEndKey","UniqueValueMultiKeyMap","initLiveItemsInTheFuture","attachPreviouslyDetached","newItem","createOrAttach","newCollectionIterator","newIterationResult","newKey","liveKey","duplicatedKeysMsg","idxSet","prevCollection","kvMap","_vMap","prevValue","vMap","ɵɵconditionalCreate","ɵɵconditionalBranchCreate","ɵɵconditional","matchingTemplateIndex","contextValue","prevMatchingTemplateIndex","prevContainer","getLContainer","viewInContainerIdx","nextLContainerIndex","nextContainer","getExistingTNode","RepeaterContext","$implicit","$index","$count","ɵɵrepeaterTrackByIndex","ɵɵrepeaterTrackByIdentity","RepeaterMetadata","hasEmptyBlock","ɵɵrepeaterCreate","trackByUsesComponentInstance","emptyTemplateFn","emptyDecls","emptyVars","emptyTagName","emptyAttrsIndex","boundTrackBy","isViewExpensiveToRecreate","OperationsCounter","created","recordCreate","recordDestroy","wasReCreated","collectionLen","LiveCollectionLContainerImpl","operationsCounter","needsIndexUpdate","detachExistingView","updateIndexes","getExistingLViewFromLContainer","ɵɵrepeater","collection","metadataSlotIdx","containerIndex","itemTemplateTNode","isCollectionEmpty","emptyTemplateIndex","lContainerForEmpty","emptyTemplateTNode","existingLView","ɵɵproperty","setDirectiveInputsWhichShadowsStyling","ɵɵelementStart","_locateOrCreateElementNode","ɵɵelementEnd","initialTNode","ɵɵelement","ɵɵdomElementStart","ɵɵdomElementEnd","ɵɵdomElement","locateOrCreateElementNodeImpl","enableLocateOrCreateElementNodeImpl","ɵɵelementContainerStart","_locateOrCreateElementContainerNode","ɵɵelementContainerEnd","ɵɵelementContainer","ɵɵdomElementContainerStart","ɵɵdomElementContainerEnd","ɵɵdomElementContainer","commentText","locateOrCreateElementContainerNode","ngContainerSize","enableLocateOrCreateElementContainerNodeImpl","ɵɵgetCurrentView","ɵɵdomProperty","ɵɵsyntheticHostProperty","u","plural","val","floor","abs","localeEn","LOCALE_DATA","registerLocaleData","localeId","extraData","LocaleDataIndex","LocaleId","ExtraData","findLocaleData","locale","normalizedLocale","normalizeLocale","getLocaleData","parentLocale","getLocaleCurrencyCode","CurrencyCode","getLocalePluralCase","PluralCase","ng","common","locales","unregisterAllLocaleData","pluralMapping","getPluralCase","DEFAULT_LOCALE_ID","USD_CURRENCY_CODE","ELEMENT_MARKER","ICU_MARKER","I18nCreateOpCode","LOCALE_ID$1","setLocaleId","getLocaleId","changeMask","changeMaskCounter","setMaskBit","hasChange","applyI18n","updateOpCodes","bindingsStartIndex","applyUpdateOpCodes","createNodeWithoutHydration","textOrName","_locateOrCreateNode","locateOrCreateNodeImpl","enableLocateOrCreateI18nNodeImpl","applyCreateOpCodes","createOpCodes","insertInFrontOf","isComment","COMMENT","appendNow","APPEND_EAGERLY","SHIFT","applyMutableOpCodes","mutableOpCodes","rootIdx","rootRNode","textNodeIndex","anchorIdx","elementNodeIndex","commentValue","commentNodeIndex","commentRNode","elementRNode","checkBit","skipCodes","sanitizeFn","tNodeOrTagName","rText","applyIcuSwitchCase","applyIcuUpdateCase","currentIndex","activeCaseIndex","getCaseIndex","applyIcuSwitchCaseRemove","removeCodes","nodeOrIcuIndex","icuExpression","bindingValue","resolvedCase","i18nCreateOpCodesToString","opcodes","lines","i18nUpdateOpCodesToString","parser","OpCodeParser","consumeOpCode","consumeString","sanitizationFn","consumeFunction","hasMore","consumeNumber","statements","statement","consumeNumberOrString","opCodeText","icuCreateOpCodesToString","lastRef","consumeNumberStringOrMarker","line","i18nRemoveOpCodesToString","codes","BINDING_REGEXP","ICU_REGEXP","NESTED_ICU","ICU_BLOCK_REGEXP","MARKER","SUBTEMPLATE_REGEXP","PH_REGEXP","NGSP_UNICODE_REGEXP","replaceNgsp","attachDebugGetter","debugGetter","enumerable","i18nStartFirstCreatePass","rootTNode","existingTNodeStack","astStack","getTranslationForTemplate","msgParts","i18nParseTextIntoPartsAndICU","part","i18nStartFirstCreatePassProcessTextNode","icuContainerTNode","createTNodeAndAddOpCode","mainBinding","icuNodeIndex","icuStart","isClosing","placeholderNode","existingTNodes","isICU","i18nNodeIdx","hasBinding","generateBindingUpdateOpCodes","i18nAttributesFirstPass","previousElement","previousElementIndex","countBindings","str","destinationNode","bindingStart","maskIndex","sizeIndex","textParts","textValue","toMaskBit","opCodes","removeInnerTemplateTranslation","inTemplate","tagMatched","exec","search","bindingMask","addUpdateIcuSwitch","valueArr","nestedIcus","caseAst","parseIcuCase","addUpdateIcuUpdate","parseICUBlock","pattern","icuType","pos","prevPos","braceStack","braces","lastIndex","block","caseName","unsafeCaseHtml","inertRootNode","walkIcuTree","sharedUpdateOpCodes","depth","addCreateNodeAndAppend","lowerAttrName","addCreateAttribute","elementNode","addRemoveNode","isNestedIcu","nestedIcuIndex","addRemoveNestedIcu","appendToParentIdx","createAtIdx","ROOT_TEMPLATE_ID","PP_MULTI_VALUE_PLACEHOLDERS_REGEXP","PP_PLACEHOLDERS_REGEXP","PP_ICU_VARS_REGEXP","PP_ICU_PLACEHOLDERS_REGEXP","PP_ICUS_REGEXP","PP_CLOSE_TEMPLATE_REGEXP","PP_TEMPLATE_ID_REGEXP","i18nPostprocess","replacements","templateIdsStack","phs","tmpl","placeholders","placeholder","templateId","isCloseTemplateTag","currentTemplateId","_type","_idx","ɵɵi18nStart","messageIndex","sameViewParentTNode","ɵɵi18nEnd","ɵɵi18n","ɵɵi18nAttributes","ɵɵi18nExp","ɵɵi18nApply","ɵɵi18nPostprocess","ɵɵlistener","listenerInternal","ɵɵsyntheticHostListener","ɵɵdomListener","processOutputs","hasCoalescedDomEvent","outputConfig","hostDirectiveOutputConfig","ɵɵnextContext","level","matchingProjectionSlotIndex","projectionSlots","wildcardNgContentIndex","ngProjectAsAttrVal","ɵɵprojectionDef","numProjectionSlots","projectionHeads","tails","componentChild","ɵɵprojection","selectorIndex","fallbackTemplateFn","fallbackDecls","fallbackVars","fallbackIndex","componentHostNode","insertFallbackContent","fallbackTNode","fallbackLContainer","fallbackLView","ɵɵcontentQuery","ɵɵviewQuery","ɵɵqueryRefresh","ɵɵloadQuery","ɵɵcontentQuerySignal","ɵɵviewQuerySignal","ɵɵqueryAdvance","indexOffset","ɵɵreference","toTStylingRange","getTStylingRangePrev","tStylingRange","getTStylingRangePrevDuplicate","setTStylingRangePrev","setTStylingRangePrevDuplicate","getTStylingRangeNext","setTStylingRangeNext","getTStylingRangeNextDuplicate","setTStylingRangeNextDuplicate","insertTStylingBinding","tStylingKeyWithStatic","isHostBinding","isClassBinding","tBindings","tmplHead","tmplTail","isKeyDuplicateOfStatic","tStylingKey","staticKeyValueArray","hasTemplateBindings","previousNode","markDuplicates","markDuplicateOfResidualStyling","residual","isPrevDir","tStylingAtIndex","isMap","cursor","foundDuplicate","tStylingValueAtCursor","tStyleRangeAtCursor","isStylingMatch","tStylingKeyCursor","parserState","textEnd","keyEnd","valueEnd","getLastParsedKey","getLastParsedValue","parseClassName","resetParserState","parseClassNameNext","consumeWhitespace","consumeClassToken","parseStyle","parseStyleNext","consumeStyleKey","consumeSeparator","consumeStyleValue","ch","separator","malformedStyleError","fromCharCode","ch1","ch2","ch3","lastChIndex","consumeQuotedText","quoteCharCode","expecting","ɵɵstyleProp","suffix","checkStylingProperty","ɵɵclassProp","ɵɵstyleMap","checkStylingMap","styleKeyValueArraySet","styleStringParser","keyValueArray","ɵɵclassMap","classKeyValueArraySet","classStringParser","stylingFirstUpdatePass","updateStyling","normalizeSuffix","stringParser","hasStylingInputShadow","isInHostBindings","staticPrefix","updateStylingMap","toStylingKeyValueArray","isHostBindings","wrapInStaticStylingKey","stylingKey","isFirstStylingInstructionInTemplate","collectStylingFromDirectives","collectStylingFromTAttrs","isFirstStylingInstructionInHostBinding","templateStylingKey","getTemplateHeadTStylingKey","setTemplateHeadTStylingKey","collectResidual","currentDirective","desiredMarker","currentMarker","styleKeyValueArray","unwrappedValue","stringKey","oldKeyValueArray","newKeyValueArray","oldIndex","oldKey","setKey","tRange","higherPriorityValue","findStylingValue","isStylingValuePresent","isPrevDirection","rawKey","containsStatics","isStylingMap","valueAtLViewIndex","ɵɵtext","textNative","_locateOrCreateTextNode","locateOrCreateTextNodeImpl","enableLocateOrCreateTextNodeImpl","interpolationV","isBindingUpdated","interpolation1","v0","interpolation2","i0","v1","interpolation3","i1","v2","interpolation4","i2","v3","interpolation5","i3","v4","interpolation6","i4","v5","interpolation7","i5","v6","interpolation8","i6","v7","ɵɵtextInterpolate","ɵɵtextInterpolate1","interpolated","textBindingInternal","ɵɵtextInterpolate2","ɵɵtextInterpolate3","ɵɵtextInterpolate4","ɵɵtextInterpolate5","ɵɵtextInterpolate6","ɵɵtextInterpolate7","ɵɵtextInterpolate8","ɵɵtextInterpolateV","ɵɵtwoWayProperty","ɵɵtwoWayBindingSet","canWrite","ɵɵtwoWayListener","UNINITIALIZED_LET","ɵɵdeclareLet","ɵɵstoreLet","ɵɵreadContextLet","ɵɵattachSourceLocations","templatePath","locations","offset","column","attributeValue","ɵɵinterpolate","ɵɵinterpolate1","ɵɵinterpolate2","ɵɵinterpolate3","ɵɵinterpolate4","ɵɵinterpolate5","ɵɵinterpolate6","ɵɵinterpolate7","ɵɵinterpolate8","ɵɵinterpolateV","viewProviders","resolveProvider","lInjectablesBlueprint","beginIndex","providerName","existingFactoryIndex","registerDestroyHooksIfSupported","existingProvidersFactoryIndex","existingViewProvidersFactoryIndex","doesProvidersFactoryExist","doesViewProvidersFactoryExist","multiFactory","multiViewProvidersFactoryResolver","multiProvidersFactoryResolver","indexInFactory","multiFactoryAdd","contextIndex","providerIsTypeProvider","providerIsClassProvider","classToken","existingCallbacksIndex","isComponentProvider","lData","multiResolve","_flags","_tData","factories","componentCount","multiProviders","factoryFn","f","ɵɵProvidersFeature","processProvidersFn","ɵɵExternalStylesFeature","encapsulationId","urls","encodeURIComponent","ɵɵsetComponentScope","ɵɵsetNgModuleScope","convertToTypeArray","flattenValues","maybeUnwrapModuleWithProviders","ɵɵpureFunction0","slotOffset","pureFn","thisArg","ɵɵpureFunction1","exp","pureFunction1Internal","ɵɵpureFunction2","pureFunction2Internal","ɵɵpureFunction3","pureFunction3Internal","ɵɵpureFunction4","pureFunction4Internal","ɵɵpureFunction5","exp5","ɵɵpureFunction6","exp6","ɵɵpureFunction7","exp7","ɵɵpureFunction8","exp8","ɵɵpureFunctionV","exps","pureFunctionVInternal","getPureFunctionReturnValue","returnValueIndex","lastReturnValue","bindingRoot","ɵɵpipe","pipeName","pipeFactory","previousInjectorProfilerContext","pipeInstance","getMultipleMatchingPipesMessage","getPipeNotFoundErrorMessage","hostIsStandalone","componentInfoMessage","verifyMessage","ɵɵpipeBind1","isPure","ɵɵpipeBind2","ɵɵpipeBind3","ɵɵpipeBind4","ɵɵpipeBindV","ɵɵtemplateRefExtractor","ɵɵgetComponentDepsFactory","ɵsetClassDebugInfo","ɵɵgetReplaceMetadataURL","timestamp","base","href","ɵɵreplaceMetadata","applyMetadata","namespaces","locals","importMeta","newDef","oldDef","mergeWithExistingDefinition","trackedViews","recreateMatchingLViews","replacement","assign","recreateLView","clearRendererCache","componentReplaced","recreate","newHost","cloneNode","newTView","newLView","replaceLViewInTree","resetProjectionState","executeWithInvalidateFallback","toLog","hot","send","oldLView","angularCoreEnv","jitOptions","setJitOptions","defaultEncapsulation","preserveWhitespaces","getJitOptions","resetJitOptions","moduleQueue","enqueueModuleForDelayedScoping","flushingModuleQueue","flushModuleScopingQueueAsMuchAsPossible","every","isResolvedDeclaration","setScopeOnDeclaredComponents","declaration","compileNgModule","compileNgModuleDefs","allowDuplicateDeclarationsInRoot","expandModuleWithProviders","NgModule","ngInjectorDef","verifySemanticsOfNgModuleDef","compileInjector","generateStandaloneInDeclarationsError","importingModule","verifiedNgModule","errors","unwrapModuleWithProvidersImports","modOrStandaloneCmpt","verifySemanticsOfNgModuleImport","verifyDeclarationsHaveDefinitions","verifyDirectivesHaveSelector","declarationType","verifyNotStandalone","combinedDeclarations","computeCombinedExports","verifyExportsAreDeclaredOrReExported","verifyDeclarationIsUnique","getAnnotation","mod","verifyCorrectBootstrapType","verifyComponentIsPartOfNgModule","lastIndexOf","suppressErrors","existingModule","typeOrWithProviders","collect","__annotations__","readAnnotation","decorator","resetCompiledComponents","transitiveScopes","transitiveScopesFor","patchComponentDefWithScope","ngSelectorScope","dir","compilationDepth","compileComponent","ngComponentDef","addDirectiveFactoryDef","baseMeta","directiveMetadata","typeSourceSpan","createParseSourceSpan","animations","interpolation","hasDirectiveDependencies","usesInheritance","addDirectiveDefToUndecoratedParents","getStandaloneDefFunctions","hasSelectorScope","rawDep","p","compileDirective","ngDirectiveDef","getDirectiveMetadata","sourceMapUrl","facade","Directive","extendsDirectlyFromObject","extractQueriesMetadata","isContentQuery","lifecycle","usesOnChanges","extractExportAs","viewQueries","isViewQuery","objPrototype","shouldAddAbstractDirective","convertToR3QueryPredicate","splitByComma","convertToR3QueryMetadata","ann","descendants","static","emitDistinctChangesOnly","isQueryAnn","queriesMeta","isInputAnnotation","piece","LIFECYCLE_HOOKS","hookName","metadataName","compilePipe","ngPipeDef","getPipeMetadata","Pipe","Component","c","Input","arg","alias","Output","HostBinding","hostPropertyName","HostListener","ModuleWithComponentFactories","ngModuleFactory","componentFactories","Compiler","compileModuleSync","compileModuleAsync","compileModuleAndAllComponentsSync","moduleDef","compileModuleAndAllComponentsAsync","clearCache","clearCacheFor","getModuleId","Compiler_Factory","COMPILER_OPTIONS","CompilerFactory","NgZoneChangeDetectionScheduler","applicationRef","applicationErrorHandler","_onMicrotaskEmptySubscription","initialize","runningTick","NgZoneChangeDetectionScheduler_Factory","PROVIDED_NG_ZONE","internalProvideZoneChangeDetection","ngZoneFactory","ignoreChangesOutsideZone","getNgZoneOptions","ngZoneChangeDetectionScheduler","ZoneStablePendingTask","userErrorHandler","provideZoneChangeDetection","zoneProviders","ngZoneOptions","eventCoalescing","runCoalescing","ZoneStablePendingTask_Factory","CONSECUTIVE_MICROTASK_NOTIFICATION_LIMIT","consecutiveMicrotaskNotifications","stackFromLastFewNotifications","trackMicrotaskNotificationForDebugging","ChangeDetectionSchedulerImpl","taskService","disableScheduling","zoneIsDefined","schedulerTickApplyArgs","subscriptions","angularZoneId","cancelScheduledCallback","useMicrotaskScheduler","pendingRenderTaskId","force","shouldScheduleTick","scheduleCallback","ChangeDetectionSchedulerImpl_Factory","provideZonelessChangeDetection","getGlobalLocale","ngI18nClosureMode","goog","LOCALE","$localize","LOCALE_ID","DEFAULT_CURRENCY_CODE","TRANSLATIONS","TRANSLATIONS_FORMAT","MissingTranslationStrategy","DebugEventListener","asNativeElements","debugEls","DebugNode","nativeNode","DebugElement","references","copyDomProperties","collectPropertyBindings","tNodeAttrs","lowercaseTNodeAttrs","baseVal","getDebugNode","query","queryAll","_queryAll","queryAllNodes","triggerEventHandler","eventObj","invokedListeners","unwrappedListener","NodePrototype","descriptors","getOwnPropertyDescriptors","isPrimitiveValue","elementsOnly","_queryNodeChildren","_queryNativeNodeDescendants","rootNativeNode","_addQueryMatch","nodeOrContainer","_queryNodeChildrenInContainer","nextLView","nextTNode","childView","debugNode","bindingIndexes","metadataParts","NG_DEBUG_PROPERTY"],"sources":["/home/poule/encrypted/stockage-syncable/www/development/html/ng-implementation/implem/node_modules/@angular/core/fesm2022/debug_node.mjs"],"sourcesContent":["/**\n * @license Angular v20.1.4\n * (c) 2010-2025 Google LLC. https://angular.io/\n * License: MIT\n */\n\nimport { attachInjectFlag, _global, ɵɵdefineInjectable as __defineInjectable, ɵɵdefineInjector as __defineInjector, ɵɵinject as __inject, ɵɵinvalidFactoryDep as __invalidFactoryDep, resolveForwardRef, newArray, EMPTY_OBJ, assertString, assertNotEqual, FLAGS, assertEqual, isInCheckNoChangesMode, PREORDER_HOOK_FLAGS, assertFirstCreatePass, assertDefined, throwError, assertNumber, assertGreaterThan, HEADER_OFFSET, DECLARATION_VIEW, NG_FACTORY_DEF, isForwardRef, getFactoryDef, assertIndexInRange, assertTNodeForLView, enterDI, runInInjectorProfilerContext, getCurrentTNode, getLView, emitInjectorToCreateInstanceEvent, emitInstanceCreatedByInjectorEvent, throwProviderNotFoundError, leaveDI, assertNodeInjector, stringifyForError, cyclicDependencyErrorWithDetails, cyclicDependencyError, setInjectorProfilerContext, setInjectImplementation, assertDirectiveDef, NG_ELEMENT_ID, convertToBitFlags, isRootView, T_HOST, TVIEW, injectRootLimpMode, isComponentDef, EMBEDDED_VIEW_INJECTOR, INJECTOR$1 as INJECTOR, DECLARATION_COMPONENT_VIEW, isComponentHost, RuntimeError, NG_PROV_DEF, getClosureSafeProperty, getNativeByTNode, flatten, arrayEquals, ID, isLView, assertDomNode, unwrapRNode, getComponentLViewByIndex, CONTEXT, EMPTY_ARRAY, assertLView, HOST, CHILD_HEAD, NEXT, isLContainer, getLViewParent, Injector, CLEANUP, getComponentDef, getDirectiveDef, InjectionToken, inject, isInSkipHydrationBlock as isInSkipHydrationBlock$1, HYDRATION, isContentQueryHost, setCurrentQueryIndex, XSS_SECURITY_URL, renderStringify, ENVIRONMENT, makeEnvironmentProviders, isDirectiveHost, formatRuntimeError, resetPreOrderHookFlags, PARENT, RENDERER, CHILD_TAIL, assertSame, assertFirstUpdatePass, getSelectedIndex, getTView, assertIndexInDeclRange, setSelectedIndex, assertLContainer, MOVED_VIEWS, isDestroyed, REACTIVE_TEMPLATE_CONSUMER, DECLARATION_LCONTAINER, QUERIES, assertNotReactive, ON_DESTROY_HOOKS, assertFunction, EFFECTS, assertProjectionSlots, NATIVE, assertParentView, CONTAINER_HEADER_OFFSET, assertNotSame, setCurrentDirectiveIndex, setCurrentTNode, getElementDepthCount, increaseElementDepthCount, wasLastNodeCreated, isCurrentTNodeParent, setCurrentTNodeAsNotParent, assertHasParent, INTERNAL_APPLICATION_ERROR_HANDLER, stringify, getCurrentDirectiveIndex, unwrapLView, isCreationMode, enterView, leaveView, AFTER_RENDER_SEQUENCES_TO_ADD, markAncestorsForTraversal, markViewForRefresh, setIsRefreshingViews, isExhaustiveCheckNoChanges, requiresRefreshOrTraversal, setIsInCheckNoChangesMode, CheckNoChangesMode, setBindingIndex, EFFECTS_TO_SCHEDULE, viewAttachedToChangeDetector, setBindingRootForHostBindings, isRefreshingViews, removeFromArray, addToArray, updateAncestorTraversalFlagsOnAttach, storeLViewOnDestroy, VIEW_REFS, assertGreaterThanOrEqual, isInI18nBlock, assertTNodeForTView, getCurrentParentTNode, getCurrentTNodePlaceholderOk, assertTNode, assertTIcu, assertNumberInRange, DEHYDRATED_VIEWS, getNgModuleDef, getPipeDef as getPipeDef$1, getNgModuleDefOrThrow, isStandalone, concatStringsWithSpace, assertInjectImplementationNotEqual, emitInjectEvent, getConstant, assertLessThan, getOrCreateTViewCleanup, getOrCreateLViewCleanup, assertNotDefined, nextBindingIndex, getSelectedTNode, getDirectiveDefOrThrow, getTNode, assertComponentType, debugStringifyTypeForError, ChangeDetectionScheduler, EnvironmentInjector, SVG_NAMESPACE, MATH_ML_NAMESPACE, viewAttachedToContainer, storeCleanupWithContext, signal, createInjectorWithoutInjectorInstances, R3Injector, getNullInjector, internalImportProvidersFrom, initNgDevMode, fillProperties, getBindingsEnabled, lastNodeWasCreated, isInInjectionContext, DestroyRef, PendingTasksInternal, noop, ErrorHandler, assertNotInReactiveContext, assertInInjectionContext, ViewContext, removeLViewOnDestroy, walkUpViews, getNativeByIndex, assertElement, arrayInsert2, arraySplice, setInjectorProfiler, NullInjector, ENVIRONMENT_INITIALIZER, INJECTOR_DEF_TYPES, walkProviderTree, getInjectorDef, deepForEach, isTypeProvider, isSignal, runInInjectionContext, ZONELESS_ENABLED, EffectScheduler, PendingTasks, assertTNodeCreationIndex, isSkipHydrationRootTNode, leaveSkipHydrationBlock, decreaseElementDepthCount, getNamespace, enterSkipHydrationBlock, getCurrentDirectiveDef, assertIndexInExpandoRange, getBindingIndex, assertOneOf, setInI18nBlock, nextContextImpl, getCurrentQueryIndex, getContextLView, load, keyValueArrayIndexOf, keyValueArraySet, keyValueArrayGet, incrementBindingIndex, isWritableSignal, store, providerToFactory, emitProviderConfiguredEvent, isClassProvider, getBindingRoot, NG_COMP_DEF, ɵɵresetView as __resetView, ɵɵnamespaceHTML as __namespaceHTML, ɵɵnamespaceMathML as __namespaceMathML, ɵɵnamespaceSVG as __namespaceSVG, ɵɵenableBindings as __enableBindings, ɵɵdisableBindings as __disableBindings, ɵɵrestoreView as __restoreView, forwardRef, NG_MOD_DEF, NG_INJ_DEF, NG_DIR_DEF, NG_PIPE_DEF, ZONELESS_SCHEDULER_DISABLED, SCHEDULE_IN_ROOT_ZONE, PROVIDED_ZONELESS, getNativeByTNodeOrNull } from './root_effect_scheduler.mjs';\nimport { setActiveConsumer, SIGNAL, consumerDestroy, REACTIVE_NODE, consumerPollProducersForChange, consumerBeforeComputation, getActiveConsumer, consumerAfterComputation, createComputed, setThrowInvalidWriteToSignalError } from './signal.mjs';\nimport { Subject, Subscription } from 'rxjs';\nimport { setActiveConsumer as setActiveConsumer$1 } from '@angular/core/primitives/signals';\nimport { map } from 'rxjs/operators';\nimport { Attribute as Attribute$1 } from './attribute.mjs';\n\n/**\n * Convince closure compiler that the wrapped function has no side-effects.\n *\n * Closure compiler always assumes that `toString` has no side-effects. We use this quirk to\n * allow us to execute a function but have closure compiler mark the call as no-side-effects.\n * It is important that the return value for the `noSideEffects` function be assigned\n * to something which is retained otherwise the call to `noSideEffects` will be removed by closure\n * compiler.\n */\nfunction noSideEffects(fn) {\n return { toString: fn }.toString();\n}\n\nconst ANNOTATIONS = '__annotations__';\nconst PARAMETERS = '__parameters__';\nconst PROP_METADATA = '__prop__metadata__';\n/**\n * @suppress {globalThis}\n */\nfunction makeDecorator(name, props, parentClass, additionalProcessing, typeFn) {\n return noSideEffects(() => {\n const metaCtor = makeMetadataCtor(props);\n function DecoratorFactory(...args) {\n if (this instanceof DecoratorFactory) {\n metaCtor.call(this, ...args);\n return this;\n }\n const annotationInstance = new DecoratorFactory(...args);\n return function TypeDecorator(cls) {\n if (typeFn)\n typeFn(cls, ...args);\n // Use of Object.defineProperty is important since it creates non-enumerable property which\n // prevents the property is copied during subclassing.\n const annotations = cls.hasOwnProperty(ANNOTATIONS)\n ? cls[ANNOTATIONS]\n : Object.defineProperty(cls, ANNOTATIONS, { value: [] })[ANNOTATIONS];\n annotations.push(annotationInstance);\n return cls;\n };\n }\n if (parentClass) {\n DecoratorFactory.prototype = Object.create(parentClass.prototype);\n }\n DecoratorFactory.prototype.ngMetadataName = name;\n DecoratorFactory.annotationCls = DecoratorFactory;\n return DecoratorFactory;\n });\n}\nfunction makeMetadataCtor(props) {\n return function ctor(...args) {\n if (props) {\n const values = props(...args);\n for (const propName in values) {\n this[propName] = values[propName];\n }\n }\n };\n}\nfunction makeParamDecorator(name, props, parentClass) {\n return noSideEffects(() => {\n const metaCtor = makeMetadataCtor(props);\n function ParamDecoratorFactory(...args) {\n if (this instanceof ParamDecoratorFactory) {\n metaCtor.apply(this, args);\n return this;\n }\n const annotationInstance = new ParamDecoratorFactory(...args);\n ParamDecorator.annotation = annotationInstance;\n return ParamDecorator;\n function ParamDecorator(cls, unusedKey, index) {\n // Use of Object.defineProperty is important since it creates non-enumerable property which\n // prevents the property is copied during subclassing.\n const parameters = cls.hasOwnProperty(PARAMETERS)\n ? cls[PARAMETERS]\n : Object.defineProperty(cls, PARAMETERS, { value: [] })[PARAMETERS];\n // there might be gaps if some in between parameters do not have annotations.\n // we pad with nulls.\n while (parameters.length <= index) {\n parameters.push(null);\n }\n (parameters[index] = parameters[index] || []).push(annotationInstance);\n return cls;\n }\n }\n ParamDecoratorFactory.prototype.ngMetadataName = name;\n ParamDecoratorFactory.annotationCls = ParamDecoratorFactory;\n return ParamDecoratorFactory;\n });\n}\nfunction makePropDecorator(name, props, parentClass, additionalProcessing) {\n return noSideEffects(() => {\n const metaCtor = makeMetadataCtor(props);\n function PropDecoratorFactory(...args) {\n if (this instanceof PropDecoratorFactory) {\n metaCtor.apply(this, args);\n return this;\n }\n const decoratorInstance = new PropDecoratorFactory(...args);\n function PropDecorator(target, name) {\n // target is undefined with standard decorators. This case is not supported and will throw\n // if this decorator is used in JIT mode with standard decorators.\n if (target === undefined) {\n throw new Error('Standard Angular field decorators are not supported in JIT mode.');\n }\n const constructor = target.constructor;\n // Use of Object.defineProperty is important because it creates a non-enumerable property\n // which prevents the property from being copied during subclassing.\n const meta = constructor.hasOwnProperty(PROP_METADATA)\n ? constructor[PROP_METADATA]\n : Object.defineProperty(constructor, PROP_METADATA, { value: {} })[PROP_METADATA];\n meta[name] = (meta.hasOwnProperty(name) && meta[name]) || [];\n meta[name].unshift(decoratorInstance);\n }\n return PropDecorator;\n }\n if (parentClass) {\n PropDecoratorFactory.prototype = Object.create(parentClass.prototype);\n }\n PropDecoratorFactory.prototype.ngMetadataName = name;\n PropDecoratorFactory.annotationCls = PropDecoratorFactory;\n return PropDecoratorFactory;\n });\n}\n\n/**\n * Inject decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nconst Inject = attachInjectFlag(\n// Disable tslint because `DecoratorFlags` is a const enum which gets inlined.\nmakeParamDecorator('Inject', (token) => ({ token })), -1 /* DecoratorFlags.Inject */);\n/**\n * Optional decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nconst Optional = \n// Disable tslint because `InternalInjectFlags` is a const enum which gets inlined.\n// tslint:disable-next-line: no-toplevel-property-access\nattachInjectFlag(makeParamDecorator('Optional'), 8 /* InternalInjectFlags.Optional */);\n/**\n * Self decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nconst Self = \n// Disable tslint because `InternalInjectFlags` is a const enum which gets inlined.\n// tslint:disable-next-line: no-toplevel-property-access\nattachInjectFlag(makeParamDecorator('Self'), 2 /* InternalInjectFlags.Self */);\n/**\n * `SkipSelf` decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nconst SkipSelf = \n// Disable tslint because `InternalInjectFlags` is a const enum which gets inlined.\n// tslint:disable-next-line: no-toplevel-property-access\nattachInjectFlag(makeParamDecorator('SkipSelf'), 4 /* InternalInjectFlags.SkipSelf */);\n/**\n * Host decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nconst Host = \n// Disable tslint because `InternalInjectFlags` is a const enum which gets inlined.\n// tslint:disable-next-line: no-toplevel-property-access\nattachInjectFlag(makeParamDecorator('Host'), 1 /* InternalInjectFlags.Host */);\n\nfunction getCompilerFacade(request) {\n const globalNg = _global['ng'];\n if (globalNg && globalNg.ɵcompilerFacade) {\n return globalNg.ɵcompilerFacade;\n }\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n // Log the type as an error so that a developer can easily navigate to the type from the\n // console.\n console.error(`JIT compilation failed for ${request.kind}`, request.type);\n let message = `The ${request.kind} '${request.type.name}' needs to be compiled using the JIT compiler, but '@angular/compiler' is not available.\\n\\n`;\n if (request.usage === 1 /* JitCompilerUsage.PartialDeclaration */) {\n message += `The ${request.kind} is part of a library that has been partially compiled.\\n`;\n message += `However, the Angular Linker has not processed the library such that JIT compilation is used as fallback.\\n`;\n message += '\\n';\n message += `Ideally, the library is processed using the Angular Linker to become fully AOT compiled.\\n`;\n }\n else {\n message += `JIT compilation is discouraged for production use-cases! Consider using AOT mode instead.\\n`;\n }\n message += `Alternatively, the JIT compiler should be loaded by bootstrapping using '@angular/platform-browser-dynamic' or '@angular/platform-server',\\n`;\n message += `or manually provide the compiler with 'import \"@angular/compiler\";' before bootstrapping.`;\n throw new Error(message);\n }\n else {\n throw new Error('JIT compiler unavailable');\n }\n}\n\n/**\n * A mapping of the @angular/core API surface used in generated expressions to the actual symbols.\n *\n * This should be kept up to date with the public exports of @angular/core.\n */\nconst angularCoreDiEnv = {\n 'ɵɵdefineInjectable': __defineInjectable,\n 'ɵɵdefineInjector': __defineInjector,\n 'ɵɵinject': __inject,\n 'ɵɵinvalidFactoryDep': __invalidFactoryDep,\n 'resolveForwardRef': resolveForwardRef,\n};\n\n/**\n * @description\n *\n * Represents a type that a Component or other object is instances of.\n *\n * An example of a `Type` is `MyCustomComponent` class, which in JavaScript is represented by\n * the `MyCustomComponent` constructor function.\n *\n * @publicApi\n */\nconst Type = Function;\nfunction isType(v) {\n return typeof v === 'function';\n}\n\n/*\n * #########################\n * Attention: These Regular expressions have to hold even if the code is minified!\n * ##########################\n */\n/**\n * Regular expression that detects pass-through constructors for ES5 output. This Regex\n * intends to capture the common delegation pattern emitted by TypeScript and Babel. Also\n * it intends to capture the pattern where existing constructors have been downleveled from\n * ES2015 to ES5 using TypeScript w/ downlevel iteration. e.g.\n *\n * ```ts\n * function MyClass() {\n * var _this = _super.apply(this, arguments) || this;\n * ```\n *\n * downleveled to ES5 with `downlevelIteration` for TypeScript < 4.2:\n * ```ts\n * function MyClass() {\n * var _this = _super.apply(this, __spread(arguments)) || this;\n * ```\n *\n * or downleveled to ES5 with `downlevelIteration` for TypeScript >= 4.2:\n * ```ts\n * function MyClass() {\n * var _this = _super.apply(this, __spreadArray([], __read(arguments), false)) || this;\n * ```\n *\n * More details can be found in: https://github.com/angular/angular/issues/38453.\n */\nconst ES5_DELEGATE_CTOR = /^function\\s+\\S+\\(\\)\\s*{[\\s\\S]+\\.apply\\(this,\\s*(arguments|(?:[^()]+\\(\\[\\],)?[^()]+\\(arguments\\).*)\\)/;\n/** Regular expression that detects ES2015 classes which extend from other classes. */\nconst ES2015_INHERITED_CLASS = /^class\\s+[A-Za-z\\d$_]*\\s*extends\\s+[^{]+{/;\n/**\n * Regular expression that detects ES2015 classes which extend from other classes and\n * have an explicit constructor defined.\n */\nconst ES2015_INHERITED_CLASS_WITH_CTOR = /^class\\s+[A-Za-z\\d$_]*\\s*extends\\s+[^{]+{[\\s\\S]*constructor\\s*\\(/;\n/**\n * Regular expression that detects ES2015 classes which extend from other classes\n * and inherit a constructor.\n */\nconst ES2015_INHERITED_CLASS_WITH_DELEGATE_CTOR = /^class\\s+[A-Za-z\\d$_]*\\s*extends\\s+[^{]+{[\\s\\S]*constructor\\s*\\(\\)\\s*{[^}]*super\\(\\.\\.\\.arguments\\)/;\n/**\n * Determine whether a stringified type is a class which delegates its constructor\n * to its parent.\n *\n * This is not trivial since compiled code can actually contain a constructor function\n * even if the original source code did not. For instance, when the child class contains\n * an initialized instance property.\n */\nfunction isDelegateCtor(typeStr) {\n return (ES5_DELEGATE_CTOR.test(typeStr) ||\n ES2015_INHERITED_CLASS_WITH_DELEGATE_CTOR.test(typeStr) ||\n (ES2015_INHERITED_CLASS.test(typeStr) && !ES2015_INHERITED_CLASS_WITH_CTOR.test(typeStr)));\n}\nclass ReflectionCapabilities {\n _reflect;\n constructor(reflect) {\n this._reflect = reflect || _global['Reflect'];\n }\n factory(t) {\n return (...args) => new t(...args);\n }\n /** @internal */\n _zipTypesAndAnnotations(paramTypes, paramAnnotations) {\n let result;\n if (typeof paramTypes === 'undefined') {\n result = newArray(paramAnnotations.length);\n }\n else {\n result = newArray(paramTypes.length);\n }\n for (let i = 0; i < result.length; i++) {\n // TS outputs Object for parameters without types, while Traceur omits\n // the annotations. For now we preserve the Traceur behavior to aid\n // migration, but this can be revisited.\n if (typeof paramTypes === 'undefined') {\n result[i] = [];\n }\n else if (paramTypes[i] && paramTypes[i] != Object) {\n result[i] = [paramTypes[i]];\n }\n else {\n result[i] = [];\n }\n if (paramAnnotations && paramAnnotations[i] != null) {\n result[i] = result[i].concat(paramAnnotations[i]);\n }\n }\n return result;\n }\n _ownParameters(type, parentCtor) {\n const typeStr = type.toString();\n // If we have no decorators, we only have function.length as metadata.\n // In that case, to detect whether a child class declared an own constructor or not,\n // we need to look inside of that constructor to check whether it is\n // just calling the parent.\n // This also helps to work around for https://github.com/Microsoft/TypeScript/issues/12439\n // that sets 'design:paramtypes' to []\n // if a class inherits from another class but has no ctor declared itself.\n if (isDelegateCtor(typeStr)) {\n return null;\n }\n // Prefer the direct API.\n if (type.parameters && type.parameters !== parentCtor.parameters) {\n return type.parameters;\n }\n // API of tsickle for lowering decorators to properties on the class.\n const tsickleCtorParams = type.ctorParameters;\n if (tsickleCtorParams && tsickleCtorParams !== parentCtor.ctorParameters) {\n // Newer tsickle uses a function closure\n // Retain the non-function case for compatibility with older tsickle\n const ctorParameters = typeof tsickleCtorParams === 'function' ? tsickleCtorParams() : tsickleCtorParams;\n const paramTypes = ctorParameters.map((ctorParam) => ctorParam && ctorParam.type);\n const paramAnnotations = ctorParameters.map((ctorParam) => ctorParam && convertTsickleDecoratorIntoMetadata(ctorParam.decorators));\n return this._zipTypesAndAnnotations(paramTypes, paramAnnotations);\n }\n // API for metadata created by invoking the decorators.\n const paramAnnotations = type.hasOwnProperty(PARAMETERS) && type[PARAMETERS];\n const paramTypes = this._reflect &&\n this._reflect.getOwnMetadata &&\n this._reflect.getOwnMetadata('design:paramtypes', type);\n if (paramTypes || paramAnnotations) {\n return this._zipTypesAndAnnotations(paramTypes, paramAnnotations);\n }\n // If a class has no decorators, at least create metadata\n // based on function.length.\n // Note: We know that this is a real constructor as we checked\n // the content of the constructor above.\n return newArray(type.length);\n }\n parameters(type) {\n // Note: only report metadata if we have at least one class decorator\n // to stay in sync with the static reflector.\n if (!isType(type)) {\n return [];\n }\n const parentCtor = getParentCtor(type);\n let parameters = this._ownParameters(type, parentCtor);\n if (!parameters && parentCtor !== Object) {\n parameters = this.parameters(parentCtor);\n }\n return parameters || [];\n }\n _ownAnnotations(typeOrFunc, parentCtor) {\n // Prefer the direct API.\n if (typeOrFunc.annotations && typeOrFunc.annotations !== parentCtor.annotations) {\n let annotations = typeOrFunc.annotations;\n if (typeof annotations === 'function' && annotations.annotations) {\n annotations = annotations.annotations;\n }\n return annotations;\n }\n // API of tsickle for lowering decorators to properties on the class.\n if (typeOrFunc.decorators && typeOrFunc.decorators !== parentCtor.decorators) {\n return convertTsickleDecoratorIntoMetadata(typeOrFunc.decorators);\n }\n // API for metadata created by invoking the decorators.\n if (typeOrFunc.hasOwnProperty(ANNOTATIONS)) {\n return typeOrFunc[ANNOTATIONS];\n }\n return null;\n }\n annotations(typeOrFunc) {\n if (!isType(typeOrFunc)) {\n return [];\n }\n const parentCtor = getParentCtor(typeOrFunc);\n const ownAnnotations = this._ownAnnotations(typeOrFunc, parentCtor) || [];\n const parentAnnotations = parentCtor !== Object ? this.annotations(parentCtor) : [];\n return parentAnnotations.concat(ownAnnotations);\n }\n _ownPropMetadata(typeOrFunc, parentCtor) {\n // Prefer the direct API.\n if (typeOrFunc.propMetadata &&\n typeOrFunc.propMetadata !== parentCtor.propMetadata) {\n let propMetadata = typeOrFunc.propMetadata;\n if (typeof propMetadata === 'function' && propMetadata.propMetadata) {\n propMetadata = propMetadata.propMetadata;\n }\n return propMetadata;\n }\n // API of tsickle for lowering decorators to properties on the class.\n if (typeOrFunc.propDecorators &&\n typeOrFunc.propDecorators !== parentCtor.propDecorators) {\n const propDecorators = typeOrFunc.propDecorators;\n const propMetadata = {};\n Object.keys(propDecorators).forEach((prop) => {\n propMetadata[prop] = convertTsickleDecoratorIntoMetadata(propDecorators[prop]);\n });\n return propMetadata;\n }\n // API for metadata created by invoking the decorators.\n if (typeOrFunc.hasOwnProperty(PROP_METADATA)) {\n return typeOrFunc[PROP_METADATA];\n }\n return null;\n }\n propMetadata(typeOrFunc) {\n if (!isType(typeOrFunc)) {\n return {};\n }\n const parentCtor = getParentCtor(typeOrFunc);\n const propMetadata = {};\n if (parentCtor !== Object) {\n const parentPropMetadata = this.propMetadata(parentCtor);\n Object.keys(parentPropMetadata).forEach((propName) => {\n propMetadata[propName] = parentPropMetadata[propName];\n });\n }\n const ownPropMetadata = this._ownPropMetadata(typeOrFunc, parentCtor);\n if (ownPropMetadata) {\n Object.keys(ownPropMetadata).forEach((propName) => {\n const decorators = [];\n if (propMetadata.hasOwnProperty(propName)) {\n decorators.push(...propMetadata[propName]);\n }\n decorators.push(...ownPropMetadata[propName]);\n propMetadata[propName] = decorators;\n });\n }\n return propMetadata;\n }\n ownPropMetadata(typeOrFunc) {\n if (!isType(typeOrFunc)) {\n return {};\n }\n return this._ownPropMetadata(typeOrFunc, getParentCtor(typeOrFunc)) || {};\n }\n hasLifecycleHook(type, lcProperty) {\n return type instanceof Type && lcProperty in type.prototype;\n }\n}\nfunction convertTsickleDecoratorIntoMetadata(decoratorInvocations) {\n if (!decoratorInvocations) {\n return [];\n }\n return decoratorInvocations.map((decoratorInvocation) => {\n const decoratorType = decoratorInvocation.type;\n const annotationCls = decoratorType.annotationCls;\n const annotationArgs = decoratorInvocation.args ? decoratorInvocation.args : [];\n return new annotationCls(...annotationArgs);\n });\n}\nfunction getParentCtor(ctor) {\n const parentProto = ctor.prototype ? Object.getPrototypeOf(ctor.prototype) : null;\n const parentCtor = parentProto ? parentProto.constructor : null;\n // Note: We always use `Object` as the null value\n // to simplify checking later on.\n return parentCtor || Object;\n}\n\n/**\n * Represents a basic change from a previous to a new value for a single\n * property on a directive instance. Passed as a value in a\n * {@link SimpleChanges} object to the `ngOnChanges` hook.\n *\n * @see {@link OnChanges}\n *\n * @publicApi\n */\nclass SimpleChange {\n previousValue;\n currentValue;\n firstChange;\n constructor(previousValue, currentValue, firstChange) {\n this.previousValue = previousValue;\n this.currentValue = currentValue;\n this.firstChange = firstChange;\n }\n /**\n * Check whether the new value is the first value assigned.\n */\n isFirstChange() {\n return this.firstChange;\n }\n}\n\nfunction applyValueToInputField(instance, inputSignalNode, privateName, value) {\n if (inputSignalNode !== null) {\n inputSignalNode.applyValueToInputSignal(inputSignalNode, value);\n }\n else {\n instance[privateName] = value;\n }\n}\n\n/**\n * The NgOnChangesFeature decorates a component with support for the ngOnChanges\n * lifecycle hook, so it should be included in any component that implements\n * that hook.\n *\n * If the component or directive uses inheritance, the NgOnChangesFeature MUST\n * be included as a feature AFTER {@link InheritDefinitionFeature}, otherwise\n * inherited properties will not be propagated to the ngOnChanges lifecycle\n * hook.\n *\n * Example usage:\n *\n * ```ts\n * static ɵcmp = defineComponent({\n * ...\n * inputs: {name: 'publicName'},\n * features: [NgOnChangesFeature]\n * });\n * ```\n *\n * @codeGenApi\n */\nconst ɵɵNgOnChangesFeature = /* @__PURE__ */ (() => {\n const ɵɵNgOnChangesFeatureImpl = () => NgOnChangesFeatureImpl;\n // This option ensures that the ngOnChanges lifecycle hook will be inherited\n // from superclasses (in InheritDefinitionFeature).\n /** @nocollapse */\n ɵɵNgOnChangesFeatureImpl.ngInherit = true;\n return ɵɵNgOnChangesFeatureImpl;\n})();\nfunction NgOnChangesFeatureImpl(definition) {\n if (definition.type.prototype.ngOnChanges) {\n definition.setInput = ngOnChangesSetInput;\n }\n return rememberChangeHistoryAndInvokeOnChangesHook;\n}\n/**\n * This is a synthetic lifecycle hook which gets inserted into `TView.preOrderHooks` to simulate\n * `ngOnChanges`.\n *\n * The hook reads the `NgSimpleChangesStore` data from the component instance and if changes are\n * found it invokes `ngOnChanges` on the component instance.\n *\n * @param this Component instance. Because this function gets inserted into `TView.preOrderHooks`,\n * it is guaranteed to be called with component instance.\n */\nfunction rememberChangeHistoryAndInvokeOnChangesHook() {\n const simpleChangesStore = getSimpleChangesStore(this);\n const current = simpleChangesStore?.current;\n if (current) {\n const previous = simpleChangesStore.previous;\n if (previous === EMPTY_OBJ) {\n simpleChangesStore.previous = current;\n }\n else {\n // New changes are copied to the previous store, so that we don't lose history for inputs\n // which were not changed this time\n for (let key in current) {\n previous[key] = current[key];\n }\n }\n simpleChangesStore.current = null;\n this.ngOnChanges(current);\n }\n}\nfunction ngOnChangesSetInput(instance, inputSignalNode, value, publicName, privateName) {\n const declaredName = this.declaredInputs[publicName];\n ngDevMode && assertString(declaredName, 'Name of input in ngOnChanges has to be a string');\n const simpleChangesStore = getSimpleChangesStore(instance) ||\n setSimpleChangesStore(instance, { previous: EMPTY_OBJ, current: null });\n const current = simpleChangesStore.current || (simpleChangesStore.current = {});\n const previous = simpleChangesStore.previous;\n const previousChange = previous[declaredName];\n current[declaredName] = new SimpleChange(previousChange && previousChange.currentValue, value, previous === EMPTY_OBJ);\n applyValueToInputField(instance, inputSignalNode, privateName, value);\n}\nconst SIMPLE_CHANGES_STORE = '__ngSimpleChanges__';\nfunction getSimpleChangesStore(instance) {\n return instance[SIMPLE_CHANGES_STORE] || null;\n}\nfunction setSimpleChangesStore(instance, store) {\n return (instance[SIMPLE_CHANGES_STORE] = store);\n}\n\nconst profilerCallbacks = [];\nconst NOOP_PROFILER_REMOVAL = () => { };\nfunction removeProfiler(profiler) {\n const profilerIdx = profilerCallbacks.indexOf(profiler);\n if (profilerIdx !== -1) {\n profilerCallbacks.splice(profilerIdx, 1);\n }\n}\n/**\n * Adds a callback function which will be invoked before and after performing certain actions at\n * runtime (for example, before and after running change detection). Multiple profiler callbacks can be set:\n * in this case profiling events are reported to every registered callback.\n *\n * Warning: this function is *INTERNAL* and should not be relied upon in application's code.\n * The contract of the function might be changed in any release and/or the function can be removed\n * completely.\n *\n * @param profiler function provided by the caller or null value to disable all profilers.\n * @returns a cleanup function that, when invoked, removes a given profiler callback.\n */\nfunction setProfiler(profiler) {\n if (profiler !== null) {\n if (!profilerCallbacks.includes(profiler)) {\n profilerCallbacks.push(profiler);\n }\n return () => removeProfiler(profiler);\n }\n else {\n profilerCallbacks.length = 0;\n return NOOP_PROFILER_REMOVAL;\n }\n}\n/**\n * Profiler function which wraps user code executed by the runtime.\n *\n * @param event ProfilerEvent corresponding to the execution context\n * @param instance component instance\n * @param eventFn function associated with event.\n * For example a template function, lifecycle hook, or output listener.\n * The value depends on the execution context\n */\nconst profiler = function (event, instance = null, eventFn) {\n for (let i = 0; i < profilerCallbacks.length; i++) {\n const profilerCallback = profilerCallbacks[i];\n profilerCallback(event, instance, eventFn);\n }\n};\n\n/**\n * Adds all directive lifecycle hooks from the given `DirectiveDef` to the given `TView`.\n *\n * Must be run *only* on the first template pass.\n *\n * Sets up the pre-order hooks on the provided `tView`,\n * see {@link HookData} for details about the data structure.\n *\n * @param directiveIndex The index of the directive in LView\n * @param directiveDef The definition containing the hooks to setup in tView\n * @param tView The current TView\n */\nfunction registerPreOrderHooks(directiveIndex, directiveDef, tView) {\n ngDevMode && assertFirstCreatePass(tView);\n const { ngOnChanges, ngOnInit, ngDoCheck } = directiveDef.type.prototype;\n if (ngOnChanges) {\n const wrappedOnChanges = NgOnChangesFeatureImpl(directiveDef);\n (tView.preOrderHooks ??= []).push(directiveIndex, wrappedOnChanges);\n (tView.preOrderCheckHooks ??= []).push(directiveIndex, wrappedOnChanges);\n }\n if (ngOnInit) {\n (tView.preOrderHooks ??= []).push(0 - directiveIndex, ngOnInit);\n }\n if (ngDoCheck) {\n (tView.preOrderHooks ??= []).push(directiveIndex, ngDoCheck);\n (tView.preOrderCheckHooks ??= []).push(directiveIndex, ngDoCheck);\n }\n}\n/**\n *\n * Loops through the directives on the provided `tNode` and queues hooks to be\n * run that are not initialization hooks.\n *\n * Should be executed during `elementEnd()` and similar to\n * preserve hook execution order. Content, view, and destroy hooks for projected\n * components and directives must be called *before* their hosts.\n *\n * Sets up the content, view, and destroy hooks on the provided `tView`,\n * see {@link HookData} for details about the data structure.\n *\n * NOTE: This does not set up `onChanges`, `onInit` or `doCheck`, those are set up\n * separately at `elementStart`.\n *\n * @param tView The current TView\n * @param tNode The TNode whose directives are to be searched for hooks to queue\n */\nfunction registerPostOrderHooks(tView, tNode) {\n ngDevMode && assertFirstCreatePass(tView);\n // It's necessary to loop through the directives at elementEnd() (rather than processing in\n // directiveCreate) so we can preserve the current hook order. Content, view, and destroy\n // hooks for projected components and directives must be called *before* their hosts.\n for (let i = tNode.directiveStart, end = tNode.directiveEnd; i < end; i++) {\n const directiveDef = tView.data[i];\n ngDevMode && assertDefined(directiveDef, 'Expecting DirectiveDef');\n const lifecycleHooks = directiveDef.type.prototype;\n const { ngAfterContentInit, ngAfterContentChecked, ngAfterViewInit, ngAfterViewChecked, ngOnDestroy, } = lifecycleHooks;\n if (ngAfterContentInit) {\n (tView.contentHooks ??= []).push(-i, ngAfterContentInit);\n }\n if (ngAfterContentChecked) {\n (tView.contentHooks ??= []).push(i, ngAfterContentChecked);\n (tView.contentCheckHooks ??= []).push(i, ngAfterContentChecked);\n }\n if (ngAfterViewInit) {\n (tView.viewHooks ??= []).push(-i, ngAfterViewInit);\n }\n if (ngAfterViewChecked) {\n (tView.viewHooks ??= []).push(i, ngAfterViewChecked);\n (tView.viewCheckHooks ??= []).push(i, ngAfterViewChecked);\n }\n if (ngOnDestroy != null) {\n (tView.destroyHooks ??= []).push(i, ngOnDestroy);\n }\n }\n}\n/**\n * Executing hooks requires complex logic as we need to deal with 2 constraints.\n *\n * 1. Init hooks (ngOnInit, ngAfterContentInit, ngAfterViewInit) must all be executed once and only\n * once, across many change detection cycles. This must be true even if some hooks throw, or if\n * some recursively trigger a change detection cycle.\n * To solve that, it is required to track the state of the execution of these init hooks.\n * This is done by storing and maintaining flags in the view: the {@link InitPhaseState},\n * and the index within that phase. They can be seen as a cursor in the following structure:\n * [[onInit1, onInit2], [afterContentInit1], [afterViewInit1, afterViewInit2, afterViewInit3]]\n * They are stored as flags in LView[FLAGS].\n *\n * 2. Pre-order hooks can be executed in batches, because of the select instruction.\n * To be able to pause and resume their execution, we also need some state about the hook's array\n * that is being processed:\n * - the index of the next hook to be executed\n * - the number of init hooks already found in the processed part of the array\n * They are stored as flags in LView[PREORDER_HOOK_FLAGS].\n */\n/**\n * Executes pre-order check hooks ( OnChanges, DoChanges) given a view where all the init hooks were\n * executed once. This is a light version of executeInitAndCheckPreOrderHooks where we can skip read\n * / write of the init-hooks related flags.\n * @param lView The LView where hooks are defined\n * @param hooks Hooks to be run\n * @param nodeIndex 3 cases depending on the value:\n * - undefined: all hooks from the array should be executed (post-order case)\n * - null: execute hooks only from the saved index until the end of the array (pre-order case, when\n * flushing the remaining hooks)\n * - number: execute hooks only from the saved index until that node index exclusive (pre-order\n * case, when executing select(number))\n */\nfunction executeCheckHooks(lView, hooks, nodeIndex) {\n callHooks(lView, hooks, 3 /* InitPhaseState.InitPhaseCompleted */, nodeIndex);\n}\n/**\n * Executes post-order init and check hooks (one of AfterContentInit, AfterContentChecked,\n * AfterViewInit, AfterViewChecked) given a view where there are pending init hooks to be executed.\n * @param lView The LView where hooks are defined\n * @param hooks Hooks to be run\n * @param initPhase A phase for which hooks should be run\n * @param nodeIndex 3 cases depending on the value:\n * - undefined: all hooks from the array should be executed (post-order case)\n * - null: execute hooks only from the saved index until the end of the array (pre-order case, when\n * flushing the remaining hooks)\n * - number: execute hooks only from the saved index until that node index exclusive (pre-order\n * case, when executing select(number))\n */\nfunction executeInitAndCheckHooks(lView, hooks, initPhase, nodeIndex) {\n ngDevMode &&\n assertNotEqual(initPhase, 3 /* InitPhaseState.InitPhaseCompleted */, 'Init pre-order hooks should not be called more than once');\n if ((lView[FLAGS] & 3 /* LViewFlags.InitPhaseStateMask */) === initPhase) {\n callHooks(lView, hooks, initPhase, nodeIndex);\n }\n}\nfunction incrementInitPhaseFlags(lView, initPhase) {\n ngDevMode &&\n assertNotEqual(initPhase, 3 /* InitPhaseState.InitPhaseCompleted */, 'Init hooks phase should not be incremented after all init hooks have been run.');\n let flags = lView[FLAGS];\n if ((flags & 3 /* LViewFlags.InitPhaseStateMask */) === initPhase) {\n flags &= 16383 /* LViewFlags.IndexWithinInitPhaseReset */;\n flags += 1 /* LViewFlags.InitPhaseStateIncrementer */;\n lView[FLAGS] = flags;\n }\n}\n/**\n * Calls lifecycle hooks with their contexts, skipping init hooks if it's not\n * the first LView pass\n *\n * @param currentView The current view\n * @param arr The array in which the hooks are found\n * @param initPhaseState the current state of the init phase\n * @param currentNodeIndex 3 cases depending on the value:\n * - undefined: all hooks from the array should be executed (post-order case)\n * - null: execute hooks only from the saved index until the end of the array (pre-order case, when\n * flushing the remaining hooks)\n * - number: execute hooks only from the saved index until that node index exclusive (pre-order\n * case, when executing select(number))\n */\nfunction callHooks(currentView, arr, initPhase, currentNodeIndex) {\n ngDevMode &&\n assertEqual(isInCheckNoChangesMode(), false, 'Hooks should never be run when in check no changes mode.');\n const startIndex = currentNodeIndex !== undefined\n ? currentView[PREORDER_HOOK_FLAGS] & 65535 /* PreOrderHookFlags.IndexOfTheNextPreOrderHookMaskMask */\n : 0;\n const nodeIndexLimit = currentNodeIndex != null ? currentNodeIndex : -1;\n const max = arr.length - 1; // Stop the loop at length - 1, because we look for the hook at i + 1\n let lastNodeIndexFound = 0;\n for (let i = startIndex; i < max; i++) {\n const hook = arr[i + 1];\n if (typeof hook === 'number') {\n lastNodeIndexFound = arr[i];\n if (currentNodeIndex != null && lastNodeIndexFound >= currentNodeIndex) {\n break;\n }\n }\n else {\n const isInitHook = arr[i] < 0;\n if (isInitHook) {\n currentView[PREORDER_HOOK_FLAGS] += 65536 /* PreOrderHookFlags.NumberOfInitHooksCalledIncrementer */;\n }\n if (lastNodeIndexFound < nodeIndexLimit || nodeIndexLimit == -1) {\n callHook(currentView, initPhase, arr, i);\n currentView[PREORDER_HOOK_FLAGS] =\n (currentView[PREORDER_HOOK_FLAGS] & 4294901760 /* PreOrderHookFlags.NumberOfInitHooksCalledMask */) +\n i +\n 2;\n }\n i++;\n }\n }\n}\n/**\n * Executes a single lifecycle hook, making sure that:\n * - it is called in the non-reactive context;\n * - profiling data are registered.\n */\nfunction callHookInternal(directive, hook) {\n profiler(4 /* ProfilerEvent.LifecycleHookStart */, directive, hook);\n const prevConsumer = setActiveConsumer(null);\n try {\n hook.call(directive);\n }\n finally {\n setActiveConsumer(prevConsumer);\n profiler(5 /* ProfilerEvent.LifecycleHookEnd */, directive, hook);\n }\n}\n/**\n * Execute one hook against the current `LView`.\n *\n * @param currentView The current view\n * @param initPhaseState the current state of the init phase\n * @param arr The array in which the hooks are found\n * @param i The current index within the hook data array\n */\nfunction callHook(currentView, initPhase, arr, i) {\n const isInitHook = arr[i] < 0;\n const hook = arr[i + 1];\n const directiveIndex = isInitHook ? -arr[i] : arr[i];\n const directive = currentView[directiveIndex];\n if (isInitHook) {\n const indexWithintInitPhase = currentView[FLAGS] >> 14 /* LViewFlags.IndexWithinInitPhaseShift */;\n // The init phase state must be always checked here as it may have been recursively updated.\n if (indexWithintInitPhase <\n currentView[PREORDER_HOOK_FLAGS] >> 16 /* PreOrderHookFlags.NumberOfInitHooksCalledShift */ &&\n (currentView[FLAGS] & 3 /* LViewFlags.InitPhaseStateMask */) === initPhase) {\n currentView[FLAGS] += 16384 /* LViewFlags.IndexWithinInitPhaseIncrementer */;\n callHookInternal(directive, hook);\n }\n }\n else {\n callHookInternal(directive, hook);\n }\n}\n\nconst NO_PARENT_INJECTOR = -1;\n/**\n * Each injector is saved in 9 contiguous slots in `LView` and 9 contiguous slots in\n * `TView.data`. This allows us to store information about the current node's tokens (which\n * can be shared in `TView`) as well as the tokens of its ancestor nodes (which cannot be\n * shared, so they live in `LView`).\n *\n * Each of these slots (aside from the last slot) contains a bloom filter. This bloom filter\n * determines whether a directive is available on the associated node or not. This prevents us\n * from searching the directives array at this level unless it's probable the directive is in it.\n *\n * See: https://en.wikipedia.org/wiki/Bloom_filter for more about bloom filters.\n *\n * Because all injectors have been flattened into `LView` and `TViewData`, they cannot typed\n * using interfaces as they were previously. The start index of each `LInjector` and `TInjector`\n * will differ based on where it is flattened into the main array, so it's not possible to know\n * the indices ahead of time and save their types here. The interfaces are still included here\n * for documentation purposes.\n *\n * export interface LInjector extends Array<any> {\n *\n * // Cumulative bloom for directive IDs 0-31 (IDs are % BLOOM_SIZE)\n * [0]: number;\n *\n * // Cumulative bloom for directive IDs 32-63\n * [1]: number;\n *\n * // Cumulative bloom for directive IDs 64-95\n * [2]: number;\n *\n * // Cumulative bloom for directive IDs 96-127\n * [3]: number;\n *\n * // Cumulative bloom for directive IDs 128-159\n * [4]: number;\n *\n * // Cumulative bloom for directive IDs 160 - 191\n * [5]: number;\n *\n * // Cumulative bloom for directive IDs 192 - 223\n * [6]: number;\n *\n * // Cumulative bloom for directive IDs 224 - 255\n * [7]: number;\n *\n * // We need to store a reference to the injector's parent so DI can keep looking up\n * // the injector tree until it finds the dependency it's looking for.\n * [PARENT_INJECTOR]: number;\n * }\n *\n * export interface TInjector extends Array<any> {\n *\n * // Shared node bloom for directive IDs 0-31 (IDs are % BLOOM_SIZE)\n * [0]: number;\n *\n * // Shared node bloom for directive IDs 32-63\n * [1]: number;\n *\n * // Shared node bloom for directive IDs 64-95\n * [2]: number;\n *\n * // Shared node bloom for directive IDs 96-127\n * [3]: number;\n *\n * // Shared node bloom for directive IDs 128-159\n * [4]: number;\n *\n * // Shared node bloom for directive IDs 160 - 191\n * [5]: number;\n *\n * // Shared node bloom for directive IDs 192 - 223\n * [6]: number;\n *\n * // Shared node bloom for directive IDs 224 - 255\n * [7]: number;\n *\n * // Necessary to find directive indices for a particular node.\n * [TNODE]: TElementNode|TElementContainerNode|TContainerNode;\n * }\n */\n/**\n * Factory for creating instances of injectors in the NodeInjector.\n *\n * This factory is complicated by the fact that it can resolve `multi` factories as well.\n *\n * NOTE: Some of the fields are optional which means that this class has two hidden classes.\n * - One without `multi` support (most common)\n * - One with `multi` values, (rare).\n *\n * Since VMs can cache up to 4 inline hidden classes this is OK.\n *\n * - Single factory: Only `resolving` and `factory` is defined.\n * - `providers` factory: `componentProviders` is a number and `index = -1`.\n * - `viewProviders` factory: `componentProviders` is a number and `index` points to `providers`.\n */\nclass NodeInjectorFactory {\n factory;\n name;\n /**\n * The inject implementation to be activated when using the factory.\n */\n injectImpl;\n /**\n * Marker set to true during factory invocation to see if we get into recursive loop.\n * Recursive loop causes an error to be displayed.\n */\n resolving = false;\n /**\n * Marks that the token can see other Tokens declared in `viewProviders` on the same node.\n */\n canSeeViewProviders;\n /**\n * An array of factories to use in case of `multi` provider.\n */\n multi;\n /**\n * Number of `multi`-providers which belong to the component.\n *\n * This is needed because when multiple components and directives declare the `multi` provider\n * they have to be concatenated in the correct order.\n *\n * Example:\n *\n * If we have a component and directive active an a single element as declared here\n * ```ts\n * component:\n * providers: [ {provide: String, useValue: 'component', multi: true} ],\n * viewProviders: [ {provide: String, useValue: 'componentView', multi: true} ],\n *\n * directive:\n * providers: [ {provide: String, useValue: 'directive', multi: true} ],\n * ```\n *\n * Then the expected results are:\n *\n * ```ts\n * providers: ['component', 'directive']\n * viewProviders: ['component', 'componentView', 'directive']\n * ```\n *\n * The way to think about it is that the `viewProviders` have been inserted after the component\n * but before the directives, which is why we need to know how many `multi`s have been declared by\n * the component.\n */\n componentProviders;\n /**\n * Current index of the Factory in the `data`. Needed for `viewProviders` and `providers` merging.\n * See `providerFactory`.\n */\n index;\n /**\n * Because the same `multi` provider can be declared in `providers` and `viewProviders` it is\n * possible for `viewProviders` to shadow the `providers`. For this reason we store the\n * `provideFactory` of the `providers` so that `providers` can be extended with `viewProviders`.\n *\n * Example:\n *\n * Given:\n * ```ts\n * providers: [ {provide: String, useValue: 'all', multi: true} ],\n * viewProviders: [ {provide: String, useValue: 'viewOnly', multi: true} ],\n * ```\n *\n * We have to return `['all']` in case of content injection, but `['all', 'viewOnly']` in case\n * of view injection. We further have to make sure that the shared instances (in our case\n * `all`) are the exact same instance in both the content as well as the view injection. (We\n * have to make sure that we don't double instantiate.) For this reason the `viewProviders`\n * `Factory` has a pointer to the shadowed `providers` factory so that it can instantiate the\n * `providers` (`['all']`) and then extend it with `viewProviders` (`['all'] + ['viewOnly'] =\n * ['all', 'viewOnly']`).\n */\n providerFactory;\n constructor(\n /**\n * Factory to invoke in order to create a new instance.\n */\n factory, \n /**\n * Set to `true` if the token is declared in `viewProviders` (or if it is component).\n */\n isViewProvider, injectImplementation, \n // Expect `null` in devmode\n name) {\n this.factory = factory;\n this.name = name;\n ngDevMode && assertDefined(factory, 'Factory not specified');\n ngDevMode && assertEqual(typeof factory, 'function', 'Expected factory function.');\n this.canSeeViewProviders = isViewProvider;\n this.injectImpl = injectImplementation;\n }\n}\n\n/**\n * Converts `TNodeType` into human readable text.\n * Make sure this matches with `TNodeType`\n */\nfunction toTNodeTypeAsString(tNodeType) {\n let text = '';\n tNodeType & 1 /* TNodeType.Text */ && (text += '|Text');\n tNodeType & 2 /* TNodeType.Element */ && (text += '|Element');\n tNodeType & 4 /* TNodeType.Container */ && (text += '|Container');\n tNodeType & 8 /* TNodeType.ElementContainer */ && (text += '|ElementContainer');\n tNodeType & 16 /* TNodeType.Projection */ && (text += '|Projection');\n tNodeType & 32 /* TNodeType.Icu */ && (text += '|IcuContainer');\n tNodeType & 64 /* TNodeType.Placeholder */ && (text += '|Placeholder');\n tNodeType & 128 /* TNodeType.LetDeclaration */ && (text += '|LetDeclaration');\n return text.length > 0 ? text.substring(1) : text;\n}\n/**\n * Helper function to detect if a given value matches a `TNode` shape.\n *\n * The logic uses the `insertBeforeIndex` and its possible values as\n * a way to differentiate a TNode shape from other types of objects\n * within the `TView.data`. This is not a perfect check, but it can\n * be a reasonable differentiator, since we control the shapes of objects\n * within `TView.data`.\n */\nfunction isTNodeShape(value) {\n return (value != null &&\n typeof value === 'object' &&\n (value.insertBeforeIndex === null ||\n typeof value.insertBeforeIndex === 'number' ||\n Array.isArray(value.insertBeforeIndex)));\n}\nfunction isLetDeclaration(tNode) {\n return !!(tNode.type & 128 /* TNodeType.LetDeclaration */);\n}\n/**\n * Returns `true` if the `TNode` has a directive which has `@Input()` for `class` binding.\n *\n * ```html\n * <div my-dir [class]=\"exp\"></div>\n * ```\n * and\n * ```ts\n * @Directive({\n * })\n * class MyDirective {\n * @Input()\n * class: string;\n * }\n * ```\n *\n * In the above case it is necessary to write the reconciled styling information into the\n * directive's input.\n *\n * @param tNode\n */\nfunction hasClassInput(tNode) {\n return (tNode.flags & 8 /* TNodeFlags.hasClassInput */) !== 0;\n}\n/**\n * Returns `true` if the `TNode` has a directive which has `@Input()` for `style` binding.\n *\n * ```html\n * <div my-dir [style]=\"exp\"></div>\n * ```\n * and\n * ```ts\n * @Directive({\n * })\n * class MyDirective {\n * @Input()\n * class: string;\n * }\n * ```\n *\n * In the above case it is necessary to write the reconciled styling information into the\n * directive's input.\n *\n * @param tNode\n */\nfunction hasStyleInput(tNode) {\n return (tNode.flags & 16 /* TNodeFlags.hasStyleInput */) !== 0;\n}\n\nfunction assertTNodeType(tNode, expectedTypes, message) {\n assertDefined(tNode, 'should be called with a TNode');\n if ((tNode.type & expectedTypes) === 0) {\n throwError(message ||\n `Expected [${toTNodeTypeAsString(expectedTypes)}] but got ${toTNodeTypeAsString(tNode.type)}.`);\n }\n}\nfunction assertPureTNodeType(type) {\n if (!(type === 2 /* TNodeType.Element */ ||\n type === 1 /* TNodeType.Text */ ||\n type === 4 /* TNodeType.Container */ ||\n type === 8 /* TNodeType.ElementContainer */ ||\n type === 32 /* TNodeType.Icu */ ||\n type === 16 /* TNodeType.Projection */ ||\n type === 64 /* TNodeType.Placeholder */ ||\n type === 128 /* TNodeType.LetDeclaration */)) {\n throwError(`Expected TNodeType to have only a single type selected, but got ${toTNodeTypeAsString(type)}.`);\n }\n}\n\n/**\n * Assigns all attribute values to the provided element via the inferred renderer.\n *\n * This function accepts two forms of attribute entries:\n *\n * default: (key, value):\n * attrs = [key1, value1, key2, value2]\n *\n * namespaced: (NAMESPACE_MARKER, uri, name, value)\n * attrs = [NAMESPACE_MARKER, uri, name, value, NAMESPACE_MARKER, uri, name, value]\n *\n * The `attrs` array can contain a mix of both the default and namespaced entries.\n * The \"default\" values are set without a marker, but if the function comes across\n * a marker value then it will attempt to set a namespaced value. If the marker is\n * not of a namespaced value then the function will quit and return the index value\n * where it stopped during the iteration of the attrs array.\n *\n * See [AttributeMarker] to understand what the namespace marker value is.\n *\n * Note that this instruction does not support assigning style and class values to\n * an element. See `elementStart` and `elementHostAttrs` to learn how styling values\n * are applied to an element.\n * @param renderer The renderer to be used\n * @param native The element that the attributes will be assigned to\n * @param attrs The attribute array of values that will be assigned to the element\n * @returns the index value that was last accessed in the attributes array\n */\nfunction setUpAttributes(renderer, native, attrs) {\n let i = 0;\n while (i < attrs.length) {\n const value = attrs[i];\n if (typeof value === 'number') {\n // only namespaces are supported. Other value types (such as style/class\n // entries) are not supported in this function.\n if (value !== 0 /* AttributeMarker.NamespaceURI */) {\n break;\n }\n // we just landed on the marker value ... therefore\n // we should skip to the next entry\n i++;\n const namespaceURI = attrs[i++];\n const attrName = attrs[i++];\n const attrVal = attrs[i++];\n renderer.setAttribute(native, attrName, attrVal, namespaceURI);\n }\n else {\n // attrName is string;\n const attrName = value;\n const attrVal = attrs[++i];\n // Standard attributes\n if (isAnimationProp(attrName)) {\n renderer.setProperty(native, attrName, attrVal);\n }\n else {\n renderer.setAttribute(native, attrName, attrVal);\n }\n i++;\n }\n }\n // another piece of code may iterate over the same attributes array. Therefore\n // it may be helpful to return the exact spot where the attributes array exited\n // whether by running into an unsupported marker or if all the static values were\n // iterated over.\n return i;\n}\n/**\n * Test whether the given value is a marker that indicates that the following\n * attribute values in a `TAttributes` array are only the names of attributes,\n * and not name-value pairs.\n * @param marker The attribute marker to test.\n * @returns true if the marker is a \"name-only\" marker (e.g. `Bindings`, `Template` or `I18n`).\n */\nfunction isNameOnlyAttributeMarker(marker) {\n return (marker === 3 /* AttributeMarker.Bindings */ ||\n marker === 4 /* AttributeMarker.Template */ ||\n marker === 6 /* AttributeMarker.I18n */);\n}\nfunction isAnimationProp(name) {\n // Perf note: accessing charCodeAt to check for the first character of a string is faster as\n // compared to accessing a character at index 0 (ex. name[0]). The main reason for this is that\n // charCodeAt doesn't allocate memory to return a substring.\n return name.charCodeAt(0) === 64 /* CharCode.AT_SIGN */;\n}\n/**\n * Merges `src` `TAttributes` into `dst` `TAttributes` removing any duplicates in the process.\n *\n * This merge function keeps the order of attrs same.\n *\n * @param dst Location of where the merged `TAttributes` should end up.\n * @param src `TAttributes` which should be appended to `dst`\n */\nfunction mergeHostAttrs(dst, src) {\n if (src === null || src.length === 0) ;\n else if (dst === null || dst.length === 0) {\n // We have source, but dst is empty, just make a copy.\n dst = src.slice();\n }\n else {\n let srcMarker = -1 /* AttributeMarker.ImplicitAttributes */;\n for (let i = 0; i < src.length; i++) {\n const item = src[i];\n if (typeof item === 'number') {\n srcMarker = item;\n }\n else {\n if (srcMarker === 0 /* AttributeMarker.NamespaceURI */) ;\n else if (srcMarker === -1 /* AttributeMarker.ImplicitAttributes */ ||\n srcMarker === 2 /* AttributeMarker.Styles */) {\n // Case where we have to consume `key1` and `value` only.\n mergeHostAttribute(dst, srcMarker, item, null, src[++i]);\n }\n else {\n // Case where we have to consume `key1` only.\n mergeHostAttribute(dst, srcMarker, item, null, null);\n }\n }\n }\n }\n return dst;\n}\n/**\n * Append `key`/`value` to existing `TAttributes` taking region marker and duplicates into account.\n *\n * @param dst `TAttributes` to append to.\n * @param marker Region where the `key`/`value` should be added.\n * @param key1 Key to add to `TAttributes`\n * @param key2 Key to add to `TAttributes` (in case of `AttributeMarker.NamespaceURI`)\n * @param value Value to add or to overwrite to `TAttributes` Only used if `marker` is not Class.\n */\nfunction mergeHostAttribute(dst, marker, key1, key2, value) {\n let i = 0;\n // Assume that new markers will be inserted at the end.\n let markerInsertPosition = dst.length;\n // scan until correct type.\n if (marker === -1 /* AttributeMarker.ImplicitAttributes */) {\n markerInsertPosition = -1;\n }\n else {\n while (i < dst.length) {\n const dstValue = dst[i++];\n if (typeof dstValue === 'number') {\n if (dstValue === marker) {\n markerInsertPosition = -1;\n break;\n }\n else if (dstValue > marker) {\n // We need to save this as we want the markers to be inserted in specific order.\n markerInsertPosition = i - 1;\n break;\n }\n }\n }\n }\n // search until you find place of insertion\n while (i < dst.length) {\n const item = dst[i];\n if (typeof item === 'number') {\n // since `i` started as the index after the marker, we did not find it if we are at the next\n // marker\n break;\n }\n else if (item === key1) {\n // We already have same token\n {\n if (value !== null) {\n dst[i + 1] = value;\n }\n return;\n }\n }\n // Increment counter.\n i++;\n if (value !== null)\n i++;\n }\n // insert at location.\n if (markerInsertPosition !== -1) {\n dst.splice(markerInsertPosition, 0, marker);\n i = markerInsertPosition + 1;\n }\n dst.splice(i++, 0, key1);\n if (value !== null) {\n dst.splice(i++, 0, value);\n }\n}\n\n/// Parent Injector Utils ///////////////////////////////////////////////////////////////\nfunction hasParentInjector(parentLocation) {\n return parentLocation !== NO_PARENT_INJECTOR;\n}\nfunction getParentInjectorIndex(parentLocation) {\n if (ngDevMode) {\n assertNumber(parentLocation, 'Number expected');\n assertNotEqual(parentLocation, -1, 'Not a valid state.');\n const parentInjectorIndex = parentLocation & 32767 /* RelativeInjectorLocationFlags.InjectorIndexMask */;\n assertGreaterThan(parentInjectorIndex, HEADER_OFFSET, 'Parent injector must be pointing past HEADER_OFFSET.');\n }\n return parentLocation & 32767 /* RelativeInjectorLocationFlags.InjectorIndexMask */;\n}\nfunction getParentInjectorViewOffset(parentLocation) {\n return parentLocation >> 16 /* RelativeInjectorLocationFlags.ViewOffsetShift */;\n}\n/**\n * Unwraps a parent injector location number to find the view offset from the current injector,\n * then walks up the declaration view tree until the view is found that contains the parent\n * injector.\n *\n * @param location The location of the parent injector, which contains the view offset\n * @param startView The LView instance from which to start walking up the view tree\n * @returns The LView instance that contains the parent injector\n */\nfunction getParentInjectorView(location, startView) {\n let viewOffset = getParentInjectorViewOffset(location);\n let parentView = startView;\n // For most cases, the parent injector can be found on the host node (e.g. for component\n // or container), but we must keep the loop here to support the rarer case of deeply nested\n // <ng-template> tags or inline views, where the parent injector might live many views\n // above the child injector.\n while (viewOffset > 0) {\n parentView = parentView[DECLARATION_VIEW];\n viewOffset--;\n }\n return parentView;\n}\n\n/**\n * Defines if the call to `inject` should include `viewProviders` in its resolution.\n *\n * This is set to true when we try to instantiate a component. This value is reset in\n * `getNodeInjectable` to a value which matches the declaration location of the token about to be\n * instantiated. This is done so that if we are injecting a token which was declared outside of\n * `viewProviders` we don't accidentally pull `viewProviders` in.\n *\n * Example:\n *\n * ```ts\n * @Injectable()\n * class MyService {\n * constructor(public value: String) {}\n * }\n *\n * @Component({\n * providers: [\n * MyService,\n * {provide: String, value: 'providers' }\n * ]\n * viewProviders: [\n * {provide: String, value: 'viewProviders'}\n * ]\n * })\n * class MyComponent {\n * constructor(myService: MyService, value: String) {\n * // We expect that Component can see into `viewProviders`.\n * expect(value).toEqual('viewProviders');\n * // `MyService` was not declared in `viewProviders` hence it can't see it.\n * expect(myService.value).toEqual('providers');\n * }\n * }\n *\n * ```\n */\nlet includeViewProviders = true;\nfunction setIncludeViewProviders(v) {\n const oldValue = includeViewProviders;\n includeViewProviders = v;\n return oldValue;\n}\n/**\n * The number of slots in each bloom filter (used by DI). The larger this number, the fewer\n * directives that will share slots, and thus, the fewer false positives when checking for\n * the existence of a directive.\n */\nconst BLOOM_SIZE = 256;\nconst BLOOM_MASK = BLOOM_SIZE - 1;\n/**\n * The number of bits that is represented by a single bloom bucket. JS bit operations are 32 bits,\n * so each bucket represents 32 distinct tokens which accounts for log2(32) = 5 bits of a bloom hash\n * number.\n */\nconst BLOOM_BUCKET_BITS = 5;\n/** Counter used to generate unique IDs for directives. */\nlet nextNgElementId = 0;\n/** Value used when something wasn't found by an injector. */\nconst NOT_FOUND = {};\n/**\n * Registers this directive as present in its node's injector by flipping the directive's\n * corresponding bit in the injector's bloom filter.\n *\n * @param injectorIndex The index of the node injector where this token should be registered\n * @param tView The TView for the injector's bloom filters\n * @param type The directive token to register\n */\nfunction bloomAdd(injectorIndex, tView, type) {\n ngDevMode && assertEqual(tView.firstCreatePass, true, 'expected firstCreatePass to be true');\n let id;\n if (typeof type === 'string') {\n id = type.charCodeAt(0) || 0;\n }\n else if (type.hasOwnProperty(NG_ELEMENT_ID)) {\n id = type[NG_ELEMENT_ID];\n }\n // Set a unique ID on the directive type, so if something tries to inject the directive,\n // we can easily retrieve the ID and hash it into the bloom bit that should be checked.\n if (id == null) {\n id = type[NG_ELEMENT_ID] = nextNgElementId++;\n }\n // We only have BLOOM_SIZE (256) slots in our bloom filter (8 buckets * 32 bits each),\n // so all unique IDs must be modulo-ed into a number from 0 - 255 to fit into the filter.\n const bloomHash = id & BLOOM_MASK;\n // Create a mask that targets the specific bit associated with the directive.\n // JS bit operations are 32 bits, so this will be a number between 2^0 and 2^31, corresponding\n // to bit positions 0 - 31 in a 32 bit integer.\n const mask = 1 << bloomHash;\n // Each bloom bucket in `tData` represents `BLOOM_BUCKET_BITS` number of bits of `bloomHash`.\n // Any bits in `bloomHash` beyond `BLOOM_BUCKET_BITS` indicate the bucket offset that the mask\n // should be written to.\n tView.data[injectorIndex + (bloomHash >> BLOOM_BUCKET_BITS)] |= mask;\n}\n/**\n * Creates (or gets an existing) injector for a given element or container.\n *\n * @param tNode for which an injector should be retrieved / created.\n * @param lView View where the node is stored\n * @returns Node injector\n */\nfunction getOrCreateNodeInjectorForNode(tNode, lView) {\n const existingInjectorIndex = getInjectorIndex(tNode, lView);\n if (existingInjectorIndex !== -1) {\n return existingInjectorIndex;\n }\n const tView = lView[TVIEW];\n if (tView.firstCreatePass) {\n tNode.injectorIndex = lView.length;\n insertBloom(tView.data, tNode); // foundation for node bloom\n insertBloom(lView, null); // foundation for cumulative bloom\n insertBloom(tView.blueprint, null);\n }\n const parentLoc = getParentInjectorLocation(tNode, lView);\n const injectorIndex = tNode.injectorIndex;\n // If a parent injector can't be found, its location is set to -1.\n // In that case, we don't need to set up a cumulative bloom\n if (hasParentInjector(parentLoc)) {\n const parentIndex = getParentInjectorIndex(parentLoc);\n const parentLView = getParentInjectorView(parentLoc, lView);\n const parentData = parentLView[TVIEW].data;\n // Creates a cumulative bloom filter that merges the parent's bloom filter\n // and its own cumulative bloom (which contains tokens for all ancestors)\n for (let i = 0; i < 8 /* NodeInjectorOffset.BLOOM_SIZE */; i++) {\n lView[injectorIndex + i] = parentLView[parentIndex + i] | parentData[parentIndex + i];\n }\n }\n lView[injectorIndex + 8 /* NodeInjectorOffset.PARENT */] = parentLoc;\n return injectorIndex;\n}\nfunction insertBloom(arr, footer) {\n arr.push(0, 0, 0, 0, 0, 0, 0, 0, footer);\n}\nfunction getInjectorIndex(tNode, lView) {\n if (tNode.injectorIndex === -1 ||\n // If the injector index is the same as its parent's injector index, then the index has been\n // copied down from the parent node. No injector has been created yet on this node.\n (tNode.parent && tNode.parent.injectorIndex === tNode.injectorIndex) ||\n // After the first template pass, the injector index might exist but the parent values\n // might not have been calculated yet for this instance\n lView[tNode.injectorIndex + 8 /* NodeInjectorOffset.PARENT */] === null) {\n return -1;\n }\n else {\n ngDevMode && assertIndexInRange(lView, tNode.injectorIndex);\n return tNode.injectorIndex;\n }\n}\n/**\n * Finds the index of the parent injector, with a view offset if applicable. Used to set the\n * parent injector initially.\n *\n * @returns Returns a number that is the combination of the number of LViews that we have to go up\n * to find the LView containing the parent inject AND the index of the injector within that LView.\n */\nfunction getParentInjectorLocation(tNode, lView) {\n if (tNode.parent && tNode.parent.injectorIndex !== -1) {\n // If we have a parent `TNode` and there is an injector associated with it we are done, because\n // the parent injector is within the current `LView`.\n return tNode.parent.injectorIndex; // ViewOffset is 0\n }\n // When parent injector location is computed it may be outside of the current view. (ie it could\n // be pointing to a declared parent location). This variable stores number of declaration parents\n // we need to walk up in order to find the parent injector location.\n let declarationViewOffset = 0;\n let parentTNode = null;\n let lViewCursor = lView;\n // The parent injector is not in the current `LView`. We will have to walk the declared parent\n // `LView` hierarchy and look for it. If we walk of the top, that means that there is no parent\n // `NodeInjector`.\n while (lViewCursor !== null) {\n parentTNode = getTNodeFromLView(lViewCursor);\n if (parentTNode === null) {\n // If we have no parent, than we are done.\n return NO_PARENT_INJECTOR;\n }\n ngDevMode && parentTNode && assertTNodeForLView(parentTNode, lViewCursor[DECLARATION_VIEW]);\n // Every iteration of the loop requires that we go to the declared parent.\n declarationViewOffset++;\n lViewCursor = lViewCursor[DECLARATION_VIEW];\n if (parentTNode.injectorIndex !== -1) {\n // We found a NodeInjector which points to something.\n return (parentTNode.injectorIndex |\n (declarationViewOffset <<\n 16 /* RelativeInjectorLocationFlags.ViewOffsetShift */));\n }\n }\n return NO_PARENT_INJECTOR;\n}\n/**\n * Makes a type or an injection token public to the DI system by adding it to an\n * injector's bloom filter.\n *\n * @param di The node injector in which a directive will be added\n * @param token The type or the injection token to be made public\n */\nfunction diPublicInInjector(injectorIndex, tView, token) {\n bloomAdd(injectorIndex, tView, token);\n}\n/**\n * Inject static attribute value into directive constructor.\n *\n * This method is used with `factory` functions which are generated as part of\n * `defineDirective` or `defineComponent`. The method retrieves the static value\n * of an attribute. (Dynamic attributes are not supported since they are not resolved\n * at the time of injection and can change over time.)\n *\n * # Example\n * Given:\n * ```ts\n * @Component(...)\n * class MyComponent {\n * constructor(@Attribute('title') title: string) { ... }\n * }\n * ```\n * When instantiated with\n * ```html\n * <my-component title=\"Hello\"></my-component>\n * ```\n *\n * Then factory method generated is:\n * ```ts\n * MyComponent.ɵcmp = defineComponent({\n * factory: () => new MyComponent(injectAttribute('title'))\n * ...\n * })\n * ```\n *\n * @publicApi\n */\nfunction injectAttributeImpl(tNode, attrNameToInject) {\n ngDevMode && assertTNodeType(tNode, 12 /* TNodeType.AnyContainer */ | 3 /* TNodeType.AnyRNode */);\n ngDevMode && assertDefined(tNode, 'expecting tNode');\n if (attrNameToInject === 'class') {\n return tNode.classes;\n }\n if (attrNameToInject === 'style') {\n return tNode.styles;\n }\n const attrs = tNode.attrs;\n if (attrs) {\n const attrsLength = attrs.length;\n let i = 0;\n while (i < attrsLength) {\n const value = attrs[i];\n // If we hit a `Bindings` or `Template` marker then we are done.\n if (isNameOnlyAttributeMarker(value))\n break;\n // Skip namespaced attributes\n if (value === 0 /* AttributeMarker.NamespaceURI */) {\n // we skip the next two values\n // as namespaced attributes looks like\n // [..., AttributeMarker.NamespaceURI, 'http://someuri.com/test', 'test:exist',\n // 'existValue', ...]\n i = i + 2;\n }\n else if (typeof value === 'number') {\n // Skip to the first value of the marked attribute.\n i++;\n while (i < attrsLength && typeof attrs[i] === 'string') {\n i++;\n }\n }\n else if (value === attrNameToInject) {\n return attrs[i + 1];\n }\n else {\n i = i + 2;\n }\n }\n }\n return null;\n}\nfunction notFoundValueOrThrow(notFoundValue, token, flags) {\n if (flags & 8 /* InternalInjectFlags.Optional */ || notFoundValue !== undefined) {\n return notFoundValue;\n }\n else {\n throwProviderNotFoundError(token, 'NodeInjector');\n }\n}\n/**\n * Returns the value associated to the given token from the ModuleInjector or throws exception\n *\n * @param lView The `LView` that contains the `tNode`\n * @param token The token to look for\n * @param flags Injection flags\n * @param notFoundValue The value to return when the injection flags is `InternalInjectFlags.Optional`\n * @returns the value from the injector or throws an exception\n */\nfunction lookupTokenUsingModuleInjector(lView, token, flags, notFoundValue) {\n if (flags & 8 /* InternalInjectFlags.Optional */ && notFoundValue === undefined) {\n // This must be set or the NullInjector will throw for optional deps\n notFoundValue = null;\n }\n if ((flags & (2 /* InternalInjectFlags.Self */ | 1 /* InternalInjectFlags.Host */)) === 0) {\n const moduleInjector = lView[INJECTOR];\n // switch to `injectInjectorOnly` implementation for module injector, since module injector\n // should not have access to Component/Directive DI scope (that may happen through\n // `directiveInject` implementation)\n const previousInjectImplementation = setInjectImplementation(undefined);\n try {\n if (moduleInjector) {\n return moduleInjector.get(token, notFoundValue, flags & 8 /* InternalInjectFlags.Optional */);\n }\n else {\n return injectRootLimpMode(token, notFoundValue, flags & 8 /* InternalInjectFlags.Optional */);\n }\n }\n finally {\n setInjectImplementation(previousInjectImplementation);\n }\n }\n return notFoundValueOrThrow(notFoundValue, token, flags);\n}\n/**\n * Returns the value associated to the given token from the NodeInjectors => ModuleInjector.\n *\n * Look for the injector providing the token by walking up the node injector tree and then\n * the module injector tree.\n *\n * This function patches `token` with `__NG_ELEMENT_ID__` which contains the id for the bloom\n * filter. `-1` is reserved for injecting `Injector` (implemented by `NodeInjector`)\n *\n * @param tNode The Node where the search for the injector should start\n * @param lView The `LView` that contains the `tNode`\n * @param token The token to look for\n * @param flags Injection flags\n * @param notFoundValue The value to return when the injection flags is `InternalInjectFlags.Optional`\n * @returns the value from the injector, `null` when not found, or `notFoundValue` if provided\n */\nfunction getOrCreateInjectable(tNode, lView, token, flags = 0 /* InternalInjectFlags.Default */, notFoundValue) {\n if (tNode !== null) {\n // If the view or any of its ancestors have an embedded\n // view injector, we have to look it up there first.\n if (lView[FLAGS] & 2048 /* LViewFlags.HasEmbeddedViewInjector */ &&\n // The token must be present on the current node injector when the `Self`\n // flag is set, so the lookup on embedded view injector(s) can be skipped.\n !(flags & 2 /* InternalInjectFlags.Self */)) {\n const embeddedInjectorValue = lookupTokenUsingEmbeddedInjector(tNode, lView, token, flags, NOT_FOUND);\n if (embeddedInjectorValue !== NOT_FOUND) {\n return embeddedInjectorValue;\n }\n }\n // Otherwise try the node injector.\n const value = lookupTokenUsingNodeInjector(tNode, lView, token, flags, NOT_FOUND);\n if (value !== NOT_FOUND) {\n return value;\n }\n }\n // Finally, fall back to the module injector.\n return lookupTokenUsingModuleInjector(lView, token, flags, notFoundValue);\n}\n/**\n * Returns the value associated to the given token from the node injector.\n *\n * @param tNode The Node where the search for the injector should start\n * @param lView The `LView` that contains the `tNode`\n * @param token The token to look for\n * @param flags Injection flags\n * @param notFoundValue The value to return when the injection flags is `InternalInjectFlags.Optional`\n * @returns the value from the injector, `null` when not found, or `notFoundValue` if provided\n */\nfunction lookupTokenUsingNodeInjector(tNode, lView, token, flags, notFoundValue) {\n const bloomHash = bloomHashBitOrFactory(token);\n // If the ID stored here is a function, this is a special object like ElementRef or TemplateRef\n // so just call the factory function to create it.\n if (typeof bloomHash === 'function') {\n if (!enterDI(lView, tNode, flags)) {\n // Failed to enter DI, try module injector instead. If a token is injected with the @Host\n // flag, the module injector is not searched for that token in Ivy.\n return flags & 1 /* InternalInjectFlags.Host */\n ? notFoundValueOrThrow(notFoundValue, token, flags)\n : lookupTokenUsingModuleInjector(lView, token, flags, notFoundValue);\n }\n try {\n let value;\n if (ngDevMode) {\n runInInjectorProfilerContext(new NodeInjector(getCurrentTNode(), getLView()), token, () => {\n emitInjectorToCreateInstanceEvent(token);\n value = bloomHash(flags);\n emitInstanceCreatedByInjectorEvent(value);\n });\n }\n else {\n value = bloomHash(flags);\n }\n if (value == null && !(flags & 8 /* InternalInjectFlags.Optional */)) {\n throwProviderNotFoundError(token);\n }\n else {\n return value;\n }\n }\n finally {\n leaveDI();\n }\n }\n else if (typeof bloomHash === 'number') {\n // A reference to the previous injector TView that was found while climbing the element\n // injector tree. This is used to know if viewProviders can be accessed on the current\n // injector.\n let previousTView = null;\n let injectorIndex = getInjectorIndex(tNode, lView);\n let parentLocation = NO_PARENT_INJECTOR;\n let hostTElementNode = flags & 1 /* InternalInjectFlags.Host */ ? lView[DECLARATION_COMPONENT_VIEW][T_HOST] : null;\n // If we should skip this injector, or if there is no injector on this node, start by\n // searching the parent injector.\n if (injectorIndex === -1 || flags & 4 /* InternalInjectFlags.SkipSelf */) {\n parentLocation =\n injectorIndex === -1\n ? getParentInjectorLocation(tNode, lView)\n : lView[injectorIndex + 8 /* NodeInjectorOffset.PARENT */];\n if (parentLocation === NO_PARENT_INJECTOR || !shouldSearchParent(flags, false)) {\n injectorIndex = -1;\n }\n else {\n previousTView = lView[TVIEW];\n injectorIndex = getParentInjectorIndex(parentLocation);\n lView = getParentInjectorView(parentLocation, lView);\n }\n }\n // Traverse up the injector tree until we find a potential match or until we know there\n // *isn't* a match.\n while (injectorIndex !== -1) {\n ngDevMode && assertNodeInjector(lView, injectorIndex);\n // Check the current injector. If it matches, see if it contains token.\n const tView = lView[TVIEW];\n ngDevMode &&\n assertTNodeForLView(tView.data[injectorIndex + 8 /* NodeInjectorOffset.TNODE */], lView);\n if (bloomHasToken(bloomHash, injectorIndex, tView.data)) {\n // At this point, we have an injector which *may* contain the token, so we step through\n // the providers and directives associated with the injector's corresponding node to get\n // the instance.\n const instance = searchTokensOnInjector(injectorIndex, lView, token, previousTView, flags, hostTElementNode);\n if (instance !== NOT_FOUND) {\n return instance;\n }\n }\n parentLocation = lView[injectorIndex + 8 /* NodeInjectorOffset.PARENT */];\n if (parentLocation !== NO_PARENT_INJECTOR &&\n shouldSearchParent(flags, lView[TVIEW].data[injectorIndex + 8 /* NodeInjectorOffset.TNODE */] === hostTElementNode) &&\n bloomHasToken(bloomHash, injectorIndex, lView)) {\n // The def wasn't found anywhere on this node, so it was a false positive.\n // Traverse up the tree and continue searching.\n previousTView = tView;\n injectorIndex = getParentInjectorIndex(parentLocation);\n lView = getParentInjectorView(parentLocation, lView);\n }\n else {\n // If we should not search parent OR If the ancestor bloom filter value does not have the\n // bit corresponding to the directive we can give up on traversing up to find the specific\n // injector.\n injectorIndex = -1;\n }\n }\n }\n return notFoundValue;\n}\nfunction searchTokensOnInjector(injectorIndex, lView, token, previousTView, flags, hostTElementNode) {\n const currentTView = lView[TVIEW];\n const tNode = currentTView.data[injectorIndex + 8 /* NodeInjectorOffset.TNODE */];\n // First, we need to determine if view providers can be accessed by the starting element.\n // There are two possibilities\n const canAccessViewProviders = previousTView == null\n ? // 1) This is the first invocation `previousTView == null` which means that we are at the\n // `TNode` of where injector is starting to look. In such a case the only time we are allowed\n // to look into the ViewProviders is if:\n // - we are on a component\n // - AND the injector set `includeViewProviders` to true (implying that the token can see\n // ViewProviders because it is the Component or a Service which itself was declared in\n // ViewProviders)\n isComponentHost(tNode) && includeViewProviders\n : // 2) `previousTView != null` which means that we are now walking across the parent nodes.\n // In such a case we are only allowed to look into the ViewProviders if:\n // - We just crossed from child View to Parent View `previousTView != currentTView`\n // - AND the parent TNode is an Element.\n // This means that we just came from the Component's View and therefore are allowed to see\n // into the ViewProviders.\n previousTView != currentTView && (tNode.type & 3 /* TNodeType.AnyRNode */) !== 0;\n // This special case happens when there is a @host on the inject and when we are searching\n // on the host element node.\n const isHostSpecialCase = flags & 1 /* InternalInjectFlags.Host */ && hostTElementNode === tNode;\n const injectableIdx = locateDirectiveOrProvider(tNode, currentTView, token, canAccessViewProviders, isHostSpecialCase);\n if (injectableIdx !== null) {\n return getNodeInjectable(lView, currentTView, injectableIdx, tNode, flags);\n }\n else {\n return NOT_FOUND;\n }\n}\n/**\n * Searches for the given token among the node's directives and providers.\n *\n * @param tNode TNode on which directives are present.\n * @param tView The tView we are currently processing\n * @param token Provider token or type of a directive to look for.\n * @param canAccessViewProviders Whether view providers should be considered.\n * @param isHostSpecialCase Whether the host special case applies.\n * @returns Index of a found directive or provider, or null when none found.\n */\nfunction locateDirectiveOrProvider(tNode, tView, token, canAccessViewProviders, isHostSpecialCase) {\n const nodeProviderIndexes = tNode.providerIndexes;\n const tInjectables = tView.data;\n const injectablesStart = nodeProviderIndexes & 1048575 /* TNodeProviderIndexes.ProvidersStartIndexMask */;\n const directivesStart = tNode.directiveStart;\n const directiveEnd = tNode.directiveEnd;\n const cptViewProvidersCount = nodeProviderIndexes >> 20 /* TNodeProviderIndexes.CptViewProvidersCountShift */;\n const startingIndex = canAccessViewProviders\n ? injectablesStart\n : injectablesStart + cptViewProvidersCount;\n // When the host special case applies, only the viewProviders and the component are visible\n const endIndex = isHostSpecialCase ? injectablesStart + cptViewProvidersCount : directiveEnd;\n for (let i = startingIndex; i < endIndex; i++) {\n const providerTokenOrDef = tInjectables[i];\n if ((i < directivesStart && token === providerTokenOrDef) ||\n (i >= directivesStart && providerTokenOrDef.type === token)) {\n return i;\n }\n }\n if (isHostSpecialCase) {\n const dirDef = tInjectables[directivesStart];\n if (dirDef && isComponentDef(dirDef) && dirDef.type === token) {\n return directivesStart;\n }\n }\n return null;\n}\n/**\n * Used in ngDevMode to keep the injection path in case of cycles in DI.\n */\nlet injectionPath = [];\n/**\n * Retrieve or instantiate the injectable from the `LView` at particular `index`.\n *\n * This function checks to see if the value has already been instantiated and if so returns the\n * cached `injectable`. Otherwise if it detects that the value is still a factory it\n * instantiates the `injectable` and caches the value.\n */\nfunction getNodeInjectable(lView, tView, index, tNode, flags) {\n let value = lView[index];\n const tData = tView.data;\n if (value instanceof NodeInjectorFactory) {\n const factory = value;\n ngDevMode && injectionPath.push(factory.name ?? 'unknown');\n if (factory.resolving) {\n const token = stringifyForError(tData[index]);\n if (ngDevMode) {\n throw cyclicDependencyErrorWithDetails(token, injectionPath);\n }\n else {\n throw cyclicDependencyError(token);\n }\n }\n const previousIncludeViewProviders = setIncludeViewProviders(factory.canSeeViewProviders);\n factory.resolving = true;\n // tData indexes mirror the concrete instances in its corresponding LView.\n // lView[index] here is either the injectable instance itself or a factory,\n // therefore tData[index] is the constructor of that injectable or a\n // definition object that contains the constructor in a `.type` field.\n const token = tData[index].type || tData[index];\n let prevInjectContext;\n if (ngDevMode) {\n const injector = new NodeInjector(tNode, lView);\n prevInjectContext = setInjectorProfilerContext({ injector, token });\n }\n const previousInjectImplementation = factory.injectImpl\n ? setInjectImplementation(factory.injectImpl)\n : null;\n const success = enterDI(lView, tNode, 0 /* InternalInjectFlags.Default */);\n ngDevMode &&\n assertEqual(success, true, \"Because flags do not contain `SkipSelf' we expect this to always succeed.\");\n try {\n ngDevMode && emitInjectorToCreateInstanceEvent(token);\n value = lView[index] = factory.factory(undefined, flags, tData, lView, tNode);\n ngDevMode && emitInstanceCreatedByInjectorEvent(value);\n // This code path is hit for both directives and providers.\n // For perf reasons, we want to avoid searching for hooks on providers.\n // It does no harm to try (the hooks just won't exist), but the extra\n // checks are unnecessary and this is a hot path. So we check to see\n // if the index of the dependency is in the directive range for this\n // tNode. If it's not, we know it's a provider and skip hook registration.\n if (tView.firstCreatePass && index >= tNode.directiveStart) {\n ngDevMode && assertDirectiveDef(tData[index]);\n registerPreOrderHooks(index, tData[index], tView);\n }\n }\n finally {\n ngDevMode && setInjectorProfilerContext(prevInjectContext);\n previousInjectImplementation !== null &&\n setInjectImplementation(previousInjectImplementation);\n setIncludeViewProviders(previousIncludeViewProviders);\n factory.resolving = false;\n leaveDI();\n ngDevMode && (injectionPath = []);\n }\n }\n return value;\n}\n/**\n * Returns the bit in an injector's bloom filter that should be used to determine whether or not\n * the directive might be provided by the injector.\n *\n * When a directive is public, it is added to the bloom filter and given a unique ID that can be\n * retrieved on the Type. When the directive isn't public or the token is not a directive `null`\n * is returned as the node injector can not possibly provide that token.\n *\n * @param token the injection token\n * @returns the matching bit to check in the bloom filter or `null` if the token is not known.\n * When the returned value is negative then it represents special values such as `Injector`.\n */\nfunction bloomHashBitOrFactory(token) {\n ngDevMode && assertDefined(token, 'token must be defined');\n if (typeof token === 'string') {\n return token.charCodeAt(0) || 0;\n }\n const tokenId = \n // First check with `hasOwnProperty` so we don't get an inherited ID.\n token.hasOwnProperty(NG_ELEMENT_ID) ? token[NG_ELEMENT_ID] : undefined;\n // Negative token IDs are used for special objects such as `Injector`\n if (typeof tokenId === 'number') {\n if (tokenId >= 0) {\n return tokenId & BLOOM_MASK;\n }\n else {\n ngDevMode &&\n assertEqual(tokenId, -1 /* InjectorMarkers.Injector */, 'Expecting to get Special Injector Id');\n return createNodeInjector;\n }\n }\n else {\n return tokenId;\n }\n}\nfunction bloomHasToken(bloomHash, injectorIndex, injectorView) {\n // Create a mask that targets the specific bit associated with the directive we're looking for.\n // JS bit operations are 32 bits, so this will be a number between 2^0 and 2^31, corresponding\n // to bit positions 0 - 31 in a 32 bit integer.\n const mask = 1 << bloomHash;\n // Each bloom bucket in `injectorView` represents `BLOOM_BUCKET_BITS` number of bits of\n // `bloomHash`. Any bits in `bloomHash` beyond `BLOOM_BUCKET_BITS` indicate the bucket offset\n // that should be used.\n const value = injectorView[injectorIndex + (bloomHash >> BLOOM_BUCKET_BITS)];\n // If the bloom filter value has the bit corresponding to the directive's bloomBit flipped on,\n // this injector is a potential match.\n return !!(value & mask);\n}\n/** Returns true if flags prevent parent injector from being searched for tokens */\nfunction shouldSearchParent(flags, isFirstHostTNode) {\n return (!(flags & 2 /* InternalInjectFlags.Self */) && !(flags & 1 /* InternalInjectFlags.Host */ && isFirstHostTNode));\n}\nfunction getNodeInjectorLView(nodeInjector) {\n return nodeInjector._lView;\n}\nfunction getNodeInjectorTNode(nodeInjector) {\n return nodeInjector._tNode;\n}\nclass NodeInjector {\n _tNode;\n _lView;\n constructor(_tNode, _lView) {\n this._tNode = _tNode;\n this._lView = _lView;\n }\n get(token, notFoundValue, flags) {\n return getOrCreateInjectable(this._tNode, this._lView, token, convertToBitFlags(flags), notFoundValue);\n }\n}\n/** Creates a `NodeInjector` for the current node. */\nfunction createNodeInjector() {\n return new NodeInjector(getCurrentTNode(), getLView());\n}\n/**\n * @codeGenApi\n */\nfunction ɵɵgetInheritedFactory(type) {\n return noSideEffects(() => {\n const ownConstructor = type.prototype.constructor;\n const ownFactory = ownConstructor[NG_FACTORY_DEF] || getFactoryOf(ownConstructor);\n const objectPrototype = Object.prototype;\n let parent = Object.getPrototypeOf(type.prototype).constructor;\n // Go up the prototype until we hit `Object`.\n while (parent && parent !== objectPrototype) {\n const factory = parent[NG_FACTORY_DEF] || getFactoryOf(parent);\n // If we hit something that has a factory and the factory isn't the same as the type,\n // we've found the inherited factory. Note the check that the factory isn't the type's\n // own factory is redundant in most cases, but if the user has custom decorators on the\n // class, this lookup will start one level down in the prototype chain, causing us to\n // find the own factory first and potentially triggering an infinite loop downstream.\n if (factory && factory !== ownFactory) {\n return factory;\n }\n parent = Object.getPrototypeOf(parent);\n }\n // There is no factory defined. Either this was improper usage of inheritance\n // (no Angular decorator on the superclass) or there is no constructor at all\n // in the inheritance chain. Since the two cases cannot be distinguished, the\n // latter has to be assumed.\n return (t) => new t();\n });\n}\nfunction getFactoryOf(type) {\n if (isForwardRef(type)) {\n return () => {\n const factory = getFactoryOf(resolveForwardRef(type));\n return factory && factory();\n };\n }\n return getFactoryDef(type);\n}\n/**\n * Returns a value from the closest embedded or node injector.\n *\n * @param tNode The Node where the search for the injector should start\n * @param lView The `LView` that contains the `tNode`\n * @param token The token to look for\n * @param flags Injection flags\n * @param notFoundValue The value to return when the injection flags is `InternalInjectFlags.Optional`\n * @returns the value from the injector, `null` when not found, or `notFoundValue` if provided\n */\nfunction lookupTokenUsingEmbeddedInjector(tNode, lView, token, flags, notFoundValue) {\n let currentTNode = tNode;\n let currentLView = lView;\n // When an LView with an embedded view injector is inserted, it'll likely be interlaced with\n // nodes who may have injectors (e.g. node injector -> embedded view injector -> node injector).\n // Since the bloom filters for the node injectors have already been constructed and we don't\n // have a way of extracting the records from an injector, the only way to maintain the correct\n // hierarchy when resolving the value is to walk it node-by-node while attempting to resolve\n // the token at each level.\n while (currentTNode !== null &&\n currentLView !== null &&\n currentLView[FLAGS] & 2048 /* LViewFlags.HasEmbeddedViewInjector */ &&\n !isRootView(currentLView)) {\n ngDevMode && assertTNodeForLView(currentTNode, currentLView);\n // Note that this lookup on the node injector is using the `Self` flag, because\n // we don't want the node injector to look at any parent injectors since we\n // may hit the embedded view injector first.\n const nodeInjectorValue = lookupTokenUsingNodeInjector(currentTNode, currentLView, token, flags | 2 /* InternalInjectFlags.Self */, NOT_FOUND);\n if (nodeInjectorValue !== NOT_FOUND) {\n return nodeInjectorValue;\n }\n // Has an explicit type due to a TS bug: https://github.com/microsoft/TypeScript/issues/33191\n let parentTNode = currentTNode.parent;\n // `TNode.parent` includes the parent within the current view only. If it doesn't exist,\n // it means that we've hit the view boundary and we need to go up to the next view.\n if (!parentTNode) {\n // Before we go to the next LView, check if the token exists on the current embedded injector.\n const embeddedViewInjector = currentLView[EMBEDDED_VIEW_INJECTOR];\n if (embeddedViewInjector) {\n const embeddedViewInjectorValue = embeddedViewInjector.get(token, NOT_FOUND, flags);\n if (embeddedViewInjectorValue !== NOT_FOUND) {\n return embeddedViewInjectorValue;\n }\n }\n // Otherwise keep going up the tree.\n parentTNode = getTNodeFromLView(currentLView);\n currentLView = currentLView[DECLARATION_VIEW];\n }\n currentTNode = parentTNode;\n }\n return notFoundValue;\n}\n/** Gets the TNode associated with an LView inside of the declaration view. */\nfunction getTNodeFromLView(lView) {\n const tView = lView[TVIEW];\n const tViewType = tView.type;\n // The parent pointer differs based on `TView.type`.\n if (tViewType === 2 /* TViewType.Embedded */) {\n ngDevMode && assertDefined(tView.declTNode, 'Embedded TNodes should have declaration parents.');\n return tView.declTNode;\n }\n else if (tViewType === 1 /* TViewType.Component */) {\n // Components don't have `TView.declTNode` because each instance of component could be\n // inserted in different location, hence `TView.declTNode` is meaningless.\n return lView[T_HOST];\n }\n return null;\n}\n\n/**\n * Facade for the attribute injection from DI.\n *\n * @codeGenApi\n */\nfunction ɵɵinjectAttribute(attrNameToInject) {\n return injectAttributeImpl(getCurrentTNode(), attrNameToInject);\n}\n\n/**\n * Attribute decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nconst Attribute = makeParamDecorator('Attribute', (attributeName) => ({\n attributeName,\n __NG_ELEMENT_ID__: () => ɵɵinjectAttribute(attributeName),\n}));\n\nlet _reflect = null;\nfunction getReflect() {\n return (_reflect = _reflect || new ReflectionCapabilities());\n}\nfunction reflectDependencies(type) {\n return convertDependencies(getReflect().parameters(type));\n}\nfunction convertDependencies(deps) {\n return deps.map((dep) => reflectDependency(dep));\n}\nfunction reflectDependency(dep) {\n const meta = {\n token: null,\n attribute: null,\n host: false,\n optional: false,\n self: false,\n skipSelf: false,\n };\n if (Array.isArray(dep) && dep.length > 0) {\n for (let j = 0; j < dep.length; j++) {\n const param = dep[j];\n if (param === undefined) {\n // param may be undefined if type of dep is not set by ngtsc\n continue;\n }\n const proto = Object.getPrototypeOf(param);\n if (param instanceof Optional || proto.ngMetadataName === 'Optional') {\n meta.optional = true;\n }\n else if (param instanceof SkipSelf || proto.ngMetadataName === 'SkipSelf') {\n meta.skipSelf = true;\n }\n else if (param instanceof Self || proto.ngMetadataName === 'Self') {\n meta.self = true;\n }\n else if (param instanceof Host || proto.ngMetadataName === 'Host') {\n meta.host = true;\n }\n else if (param instanceof Inject) {\n meta.token = param.token;\n }\n else if (param instanceof Attribute) {\n if (param.attributeName === undefined) {\n throw new RuntimeError(204 /* RuntimeErrorCode.INVALID_INJECTION_TOKEN */, ngDevMode && `Attribute name must be defined.`);\n }\n meta.attribute = param.attributeName;\n }\n else {\n meta.token = param;\n }\n }\n }\n else if (dep === undefined || (Array.isArray(dep) && dep.length === 0)) {\n meta.token = null;\n }\n else {\n meta.token = dep;\n }\n return meta;\n}\n\n/**\n * Compile an Angular injectable according to its `Injectable` metadata, and patch the resulting\n * injectable def (`ɵprov`) onto the injectable type.\n */\nfunction compileInjectable(type, meta) {\n let ngInjectableDef = null;\n let ngFactoryDef = null;\n // if NG_PROV_DEF is already defined on this class then don't overwrite it\n if (!type.hasOwnProperty(NG_PROV_DEF)) {\n Object.defineProperty(type, NG_PROV_DEF, {\n get: () => {\n if (ngInjectableDef === null) {\n const compiler = getCompilerFacade({\n usage: 0 /* JitCompilerUsage.Decorator */,\n kind: 'injectable',\n type,\n });\n ngInjectableDef = compiler.compileInjectable(angularCoreDiEnv, `ng:///${type.name}/ɵprov.js`, getInjectableMetadata(type, meta));\n }\n return ngInjectableDef;\n },\n });\n }\n // if NG_FACTORY_DEF is already defined on this class then don't overwrite it\n if (!type.hasOwnProperty(NG_FACTORY_DEF)) {\n Object.defineProperty(type, NG_FACTORY_DEF, {\n get: () => {\n if (ngFactoryDef === null) {\n const compiler = getCompilerFacade({\n usage: 0 /* JitCompilerUsage.Decorator */,\n kind: 'injectable',\n type,\n });\n ngFactoryDef = compiler.compileFactory(angularCoreDiEnv, `ng:///${type.name}/ɵfac.js`, {\n name: type.name,\n type,\n typeArgumentCount: 0, // In JIT mode types are not available nor used.\n deps: reflectDependencies(type),\n target: compiler.FactoryTarget.Injectable,\n });\n }\n return ngFactoryDef;\n },\n // Leave this configurable so that the factories from directives or pipes can take precedence.\n configurable: true,\n });\n }\n}\nconst USE_VALUE = getClosureSafeProperty({\n provide: String,\n useValue: getClosureSafeProperty,\n});\nfunction isUseClassProvider(meta) {\n return meta.useClass !== undefined;\n}\nfunction isUseValueProvider(meta) {\n return USE_VALUE in meta;\n}\nfunction isUseFactoryProvider(meta) {\n return meta.useFactory !== undefined;\n}\nfunction isUseExistingProvider(meta) {\n return meta.useExisting !== undefined;\n}\nfunction getInjectableMetadata(type, srcMeta) {\n // Allow the compilation of a class with a `@Injectable()` decorator without parameters\n const meta = srcMeta || { providedIn: null };\n const compilerMeta = {\n name: type.name,\n type: type,\n typeArgumentCount: 0,\n providedIn: meta.providedIn,\n };\n if ((isUseClassProvider(meta) || isUseFactoryProvider(meta)) && meta.deps !== undefined) {\n compilerMeta.deps = convertDependencies(meta.deps);\n }\n // Check to see if the user explicitly provided a `useXxxx` property.\n if (isUseClassProvider(meta)) {\n compilerMeta.useClass = meta.useClass;\n }\n else if (isUseValueProvider(meta)) {\n compilerMeta.useValue = meta.useValue;\n }\n else if (isUseFactoryProvider(meta)) {\n compilerMeta.useFactory = meta.useFactory;\n }\n else if (isUseExistingProvider(meta)) {\n compilerMeta.useExisting = meta.useExisting;\n }\n return compilerMeta;\n}\n\n/**\n * Injectable decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nconst Injectable = makeDecorator('Injectable', undefined, undefined, undefined, (type, meta) => compileInjectable(type, meta));\n\n/**\n * Creates an ElementRef from the most recent node.\n *\n * @returns The ElementRef instance to use\n */\nfunction injectElementRef() {\n return createElementRef(getCurrentTNode(), getLView());\n}\n/**\n * Creates an ElementRef given a node.\n *\n * @param tNode The node for which you'd like an ElementRef\n * @param lView The view to which the node belongs\n * @returns The ElementRef instance to use\n */\nfunction createElementRef(tNode, lView) {\n return new ElementRef(getNativeByTNode(tNode, lView));\n}\n/**\n * A wrapper around a native element inside of a View.\n *\n * An `ElementRef` is backed by a render-specific element. In the browser, this is usually a DOM\n * element.\n *\n * @security Permitting direct access to the DOM can make your application more vulnerable to\n * XSS attacks. Carefully review any use of `ElementRef` in your code. For more detail, see the\n * [Security Guide](https://g.co/ng/security).\n *\n * @publicApi\n */\n// Note: We don't expose things like `Injector`, `ViewContainer`, ... here,\n// i.e. users have to ask for what they need. With that, we can build better analysis tools\n// and could do better codegen in the future.\nclass ElementRef {\n /**\n * <div class=\"docs-alert docs-alert-important\">\n * <header>Use with caution</header>\n * <p>\n * Use this API as the last resort when direct access to DOM is needed. Use templating and\n * data-binding provided by Angular instead. If used, it is recommended in combination with\n * {@link /best-practices/security#direct-use-of-the-dom-apis-and-explicit-sanitization-calls DomSanitizer}\n * for maxiumum security;\n * </p>\n * </div>\n */\n nativeElement;\n constructor(nativeElement) {\n this.nativeElement = nativeElement;\n }\n /**\n * @internal\n * @nocollapse\n */\n static __NG_ELEMENT_ID__ = injectElementRef;\n}\n/**\n * Unwraps `ElementRef` and return the `nativeElement`.\n *\n * @param value value to unwrap\n * @returns `nativeElement` if `ElementRef` otherwise returns value as is.\n */\nfunction unwrapElementRef(value) {\n return value instanceof ElementRef ? value.nativeElement : value;\n}\n\nfunction symbolIterator() {\n // @ts-expect-error accessing a private member\n return this._results[Symbol.iterator]();\n}\n/**\n * An unmodifiable list of items that Angular keeps up to date when the state\n * of the application changes.\n *\n * The type of object that {@link ViewChildren}, {@link ContentChildren}, and {@link QueryList}\n * provide.\n *\n * Implements an iterable interface, therefore it can be used in both ES6\n * javascript `for (var i of items)` loops as well as in Angular templates with\n * `@for(i of myList; track $index)`.\n *\n * Changes can be observed by subscribing to the `changes` `Observable`.\n * *\n * @usageNotes\n * ### Example\n * ```ts\n * @Component({...})\n * class Container {\n * @ViewChildren(Item) items:QueryList<Item>;\n * }\n * ```\n *\n * @publicApi\n */\nclass QueryList {\n _emitDistinctChangesOnly;\n dirty = true;\n _onDirty = undefined;\n _results = [];\n _changesDetected = false;\n _changes = undefined;\n length = 0;\n first = undefined;\n last = undefined;\n /**\n * Returns `Observable` of `QueryList` notifying the subscriber of changes.\n */\n get changes() {\n return (this._changes ??= new Subject());\n }\n /**\n * @param emitDistinctChangesOnly Whether `QueryList.changes` should fire only when actual change\n * has occurred. Or if it should fire when query is recomputed. (recomputing could resolve in\n * the same result)\n */\n constructor(_emitDistinctChangesOnly = false) {\n this._emitDistinctChangesOnly = _emitDistinctChangesOnly;\n }\n /**\n * Returns the QueryList entry at `index`.\n */\n get(index) {\n return this._results[index];\n }\n /**\n * See\n * [Array.map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)\n */\n map(fn) {\n return this._results.map(fn);\n }\n filter(fn) {\n return this._results.filter(fn);\n }\n /**\n * See\n * [Array.find](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find)\n */\n find(fn) {\n return this._results.find(fn);\n }\n /**\n * See\n * [Array.reduce](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce)\n */\n reduce(fn, init) {\n return this._results.reduce(fn, init);\n }\n /**\n * See\n * [Array.forEach](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach)\n */\n forEach(fn) {\n this._results.forEach(fn);\n }\n /**\n * See\n * [Array.some](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some)\n */\n some(fn) {\n return this._results.some(fn);\n }\n /**\n * Returns a copy of the internal results list as an Array.\n */\n toArray() {\n return this._results.slice();\n }\n toString() {\n return this._results.toString();\n }\n /**\n * Updates the stored data of the query list, and resets the `dirty` flag to `false`, so that\n * on change detection, it will not notify of changes to the queries, unless a new change\n * occurs.\n *\n * @param resultsTree The query results to store\n * @param identityAccessor Optional function for extracting stable object identity from a value\n * in the array. This function is executed for each element of the query result list while\n * comparing current query list with the new one (provided as a first argument of the `reset`\n * function) to detect if the lists are different. If the function is not provided, elements\n * are compared as is (without any pre-processing).\n */\n reset(resultsTree, identityAccessor) {\n this.dirty = false;\n const newResultFlat = flatten(resultsTree);\n if ((this._changesDetected = !arrayEquals(this._results, newResultFlat, identityAccessor))) {\n this._results = newResultFlat;\n this.length = newResultFlat.length;\n this.last = newResultFlat[this.length - 1];\n this.first = newResultFlat[0];\n }\n }\n /**\n * Triggers a change event by emitting on the `changes` {@link EventEmitter}.\n */\n notifyOnChanges() {\n if (this._changes !== undefined && (this._changesDetected || !this._emitDistinctChangesOnly))\n this._changes.next(this);\n }\n /** @internal */\n onDirty(cb) {\n this._onDirty = cb;\n }\n /** internal */\n setDirty() {\n this.dirty = true;\n this._onDirty?.();\n }\n /** internal */\n destroy() {\n if (this._changes !== undefined) {\n this._changes.complete();\n this._changes.unsubscribe();\n }\n }\n [Symbol.iterator] = (() => symbolIterator)();\n}\n\n/**\n * The name of an attribute that can be added to the hydration boundary node\n * (component host node) to disable hydration for the content within that boundary.\n */\nconst SKIP_HYDRATION_ATTR_NAME = 'ngSkipHydration';\n/** Lowercase name of the `ngSkipHydration` attribute used for case-insensitive comparisons. */\nconst SKIP_HYDRATION_ATTR_NAME_LOWER_CASE = 'ngskiphydration';\n/**\n * Helper function to check if a given TNode has the 'ngSkipHydration' attribute.\n */\nfunction hasSkipHydrationAttrOnTNode(tNode) {\n const attrs = tNode.mergedAttrs;\n if (attrs === null)\n return false;\n // only ever look at the attribute name and skip the values\n for (let i = 0; i < attrs.length; i += 2) {\n const value = attrs[i];\n // This is a marker, which means that the static attributes section is over,\n // so we can exit early.\n if (typeof value === 'number')\n return false;\n if (typeof value === 'string' && value.toLowerCase() === SKIP_HYDRATION_ATTR_NAME_LOWER_CASE) {\n return true;\n }\n }\n return false;\n}\n/**\n * Helper function to check if a given RElement has the 'ngSkipHydration' attribute.\n */\nfunction hasSkipHydrationAttrOnRElement(rNode) {\n return rNode.hasAttribute(SKIP_HYDRATION_ATTR_NAME);\n}\n/**\n * Checks whether a TNode has a flag to indicate that it's a part of\n * a skip hydration block.\n */\nfunction hasInSkipHydrationBlockFlag(tNode) {\n return (tNode.flags & 128 /* TNodeFlags.inSkipHydrationBlock */) === 128 /* TNodeFlags.inSkipHydrationBlock */;\n}\n/**\n * Helper function that determines if a given node is within a skip hydration block\n * by navigating up the TNode tree to see if any parent nodes have skip hydration\n * attribute.\n */\nfunction isInSkipHydrationBlock(tNode) {\n if (hasInSkipHydrationBlockFlag(tNode)) {\n return true;\n }\n let currentTNode = tNode.parent;\n while (currentTNode) {\n if (hasInSkipHydrationBlockFlag(tNode) || hasSkipHydrationAttrOnTNode(currentTNode)) {\n return true;\n }\n currentTNode = currentTNode.parent;\n }\n return false;\n}\n/**\n * Check if an i18n block is in a skip hydration section by looking at a parent TNode\n * to determine if this TNode is in a skip hydration section or the TNode has\n * the `ngSkipHydration` attribute.\n */\nfunction isI18nInSkipHydrationBlock(parentTNode) {\n return (hasInSkipHydrationBlockFlag(parentTNode) ||\n hasSkipHydrationAttrOnTNode(parentTNode) ||\n isInSkipHydrationBlock(parentTNode));\n}\n\n/**\n * The strategy that the default change detector uses to detect changes.\n * When set, takes effect the next time change detection is triggered.\n *\n * @see {@link /api/core/ChangeDetectorRef?tab=usage-notes Change detection usage}\n * @see {@link /best-practices/skipping-subtrees Skipping component subtrees}\n *\n * @publicApi\n */\nvar ChangeDetectionStrategy;\n(function (ChangeDetectionStrategy) {\n /**\n * Use the `CheckOnce` strategy, meaning that automatic change detection is deactivated\n * until reactivated by setting the strategy to `Default` (`CheckAlways`).\n * Change detection can still be explicitly invoked.\n * This strategy applies to all child directives and cannot be overridden.\n */\n ChangeDetectionStrategy[ChangeDetectionStrategy[\"OnPush\"] = 0] = \"OnPush\";\n /**\n * Use the default `CheckAlways` strategy, in which change detection is automatic until\n * explicitly deactivated.\n */\n ChangeDetectionStrategy[ChangeDetectionStrategy[\"Default\"] = 1] = \"Default\";\n})(ChangeDetectionStrategy || (ChangeDetectionStrategy = {}));\n\n// Keeps track of the currently-active LViews.\nconst TRACKED_LVIEWS = new Map();\n// Used for generating unique IDs for LViews.\nlet uniqueIdCounter = 0;\n/** Gets a unique ID that can be assigned to an LView. */\nfunction getUniqueLViewId() {\n return uniqueIdCounter++;\n}\n/** Starts tracking an LView. */\nfunction registerLView(lView) {\n ngDevMode && assertNumber(lView[ID], 'LView must have an ID in order to be registered');\n TRACKED_LVIEWS.set(lView[ID], lView);\n}\n/** Gets an LView by its unique ID. */\nfunction getLViewById(id) {\n ngDevMode && assertNumber(id, 'ID used for LView lookup must be a number');\n return TRACKED_LVIEWS.get(id) || null;\n}\n/** Stops tracking an LView. */\nfunction unregisterLView(lView) {\n ngDevMode && assertNumber(lView[ID], 'Cannot stop tracking an LView that does not have an ID');\n TRACKED_LVIEWS.delete(lView[ID]);\n}\n/** Gets the currently-tracked views. */\nfunction getTrackedLViews() {\n return TRACKED_LVIEWS;\n}\n\n/**\n * The internal view context which is specific to a given DOM element, directive or\n * component instance. Each value in here (besides the LView and element node details)\n * can be present, null or undefined. If undefined then it implies the value has not been\n * looked up yet, otherwise, if null, then a lookup was executed and nothing was found.\n *\n * Each value will get filled when the respective value is examined within the getContext\n * function. The component, element and each directive instance will share the same instance\n * of the context.\n */\nclass LContext {\n lViewId;\n nodeIndex;\n native;\n /**\n * The instance of the Component node.\n */\n component;\n /**\n * The list of active directives that exist on this element.\n */\n directives;\n /**\n * The map of local references (local reference name => element or directive instance) that\n * exist on this element.\n */\n localRefs;\n /** Component's parent view data. */\n get lView() {\n return getLViewById(this.lViewId);\n }\n constructor(\n /**\n * ID of the component's parent view data.\n */\n lViewId, \n /**\n * The index instance of the node.\n */\n nodeIndex, \n /**\n * The instance of the DOM node that is attached to the lNode.\n */\n native) {\n this.lViewId = lViewId;\n this.nodeIndex = nodeIndex;\n this.native = native;\n }\n}\n\n/**\n * Returns the matching `LContext` data for a given DOM node, directive or component instance.\n *\n * This function will examine the provided DOM element, component, or directive instance\\'s\n * monkey-patched property to derive the `LContext` data. Once called then the monkey-patched\n * value will be that of the newly created `LContext`.\n *\n * If the monkey-patched value is the `LView` instance then the context value for that\n * target will be created and the monkey-patch reference will be updated. Therefore when this\n * function is called it may mutate the provided element\\'s, component\\'s or any of the associated\n * directive\\'s monkey-patch values.\n *\n * If the monkey-patch value is not detected then the code will walk up the DOM until an element\n * is found which contains a monkey-patch reference. When that occurs then the provided element\n * will be updated with a new context (which is then returned). If the monkey-patch value is not\n * detected for a component/directive instance then it will throw an error (all components and\n * directives should be automatically monkey-patched by ivy).\n *\n * @param target Component, Directive or DOM Node.\n */\nfunction getLContext(target) {\n let mpValue = readPatchedData(target);\n if (mpValue) {\n // only when it's an array is it considered an LView instance\n // ... otherwise it's an already constructed LContext instance\n if (isLView(mpValue)) {\n const lView = mpValue;\n let nodeIndex;\n let component = undefined;\n let directives = undefined;\n if (isComponentInstance(target)) {\n nodeIndex = findViaComponent(lView, target);\n if (nodeIndex == -1) {\n throw new Error('The provided component was not found in the application');\n }\n component = target;\n }\n else if (isDirectiveInstance(target)) {\n nodeIndex = findViaDirective(lView, target);\n if (nodeIndex == -1) {\n throw new Error('The provided directive was not found in the application');\n }\n directives = getDirectivesAtNodeIndex(nodeIndex, lView);\n }\n else {\n nodeIndex = findViaNativeElement(lView, target);\n if (nodeIndex == -1) {\n return null;\n }\n }\n // the goal is not to fill the entire context full of data because the lookups\n // are expensive. Instead, only the target data (the element, component, container, ICU\n // expression or directive details) are filled into the context. If called multiple times\n // with different target values then the missing target data will be filled in.\n const native = unwrapRNode(lView[nodeIndex]);\n const existingCtx = readPatchedData(native);\n const context = existingCtx && !Array.isArray(existingCtx)\n ? existingCtx\n : createLContext(lView, nodeIndex, native);\n // only when the component has been discovered then update the monkey-patch\n if (component && context.component === undefined) {\n context.component = component;\n attachPatchData(context.component, context);\n }\n // only when the directives have been discovered then update the monkey-patch\n if (directives && context.directives === undefined) {\n context.directives = directives;\n for (let i = 0; i < directives.length; i++) {\n attachPatchData(directives[i], context);\n }\n }\n attachPatchData(context.native, context);\n mpValue = context;\n }\n }\n else {\n const rElement = target;\n ngDevMode && assertDomNode(rElement);\n // if the context is not found then we need to traverse upwards up the DOM\n // to find the nearest element that has already been monkey patched with data\n let parent = rElement;\n while ((parent = parent.parentNode)) {\n const parentContext = readPatchedData(parent);\n if (parentContext) {\n const lView = Array.isArray(parentContext) ? parentContext : parentContext.lView;\n // the edge of the app was also reached here through another means\n // (maybe because the DOM was changed manually).\n if (!lView) {\n return null;\n }\n const index = findViaNativeElement(lView, rElement);\n if (index >= 0) {\n const native = unwrapRNode(lView[index]);\n const context = createLContext(lView, index, native);\n attachPatchData(native, context);\n mpValue = context;\n break;\n }\n }\n }\n }\n return mpValue || null;\n}\n/**\n * Creates an empty instance of a `LContext` context\n */\nfunction createLContext(lView, nodeIndex, native) {\n return new LContext(lView[ID], nodeIndex, native);\n}\n/**\n * Takes a component instance and returns the view for that component.\n *\n * @param componentInstance\n * @returns The component's view\n */\nfunction getComponentViewByInstance(componentInstance) {\n let patchedData = readPatchedData(componentInstance);\n let lView;\n if (isLView(patchedData)) {\n const contextLView = patchedData;\n const nodeIndex = findViaComponent(contextLView, componentInstance);\n lView = getComponentLViewByIndex(nodeIndex, contextLView);\n const context = createLContext(contextLView, nodeIndex, lView[HOST]);\n context.component = componentInstance;\n attachPatchData(componentInstance, context);\n attachPatchData(context.native, context);\n }\n else {\n const context = patchedData;\n const contextLView = context.lView;\n ngDevMode && assertLView(contextLView);\n lView = getComponentLViewByIndex(context.nodeIndex, contextLView);\n }\n return lView;\n}\n/**\n * This property will be monkey-patched on elements, components and directives.\n */\nconst MONKEY_PATCH_KEY_NAME = '__ngContext__';\n/**\n * Assigns the given data to the given target (which could be a component,\n * directive or DOM node instance) using monkey-patching.\n */\nfunction attachPatchData(target, data) {\n ngDevMode && assertDefined(target, 'Target expected');\n // Only attach the ID of the view in order to avoid memory leaks (see #41047). We only do this\n // for `LView`, because we have control over when an `LView` is created and destroyed, whereas\n // we can't know when to remove an `LContext`.\n if (isLView(data)) {\n target[MONKEY_PATCH_KEY_NAME] = data[ID];\n registerLView(data);\n }\n else {\n target[MONKEY_PATCH_KEY_NAME] = data;\n }\n}\n/**\n * Returns the monkey-patch value data present on the target (which could be\n * a component, directive or a DOM node).\n */\nfunction readPatchedData(target) {\n ngDevMode && assertDefined(target, 'Target expected');\n const data = target[MONKEY_PATCH_KEY_NAME];\n return typeof data === 'number' ? getLViewById(data) : data || null;\n}\nfunction readPatchedLView(target) {\n const value = readPatchedData(target);\n if (value) {\n return (isLView(value) ? value : value.lView);\n }\n return null;\n}\nfunction isComponentInstance(instance) {\n return instance && instance.constructor && instance.constructor.ɵcmp;\n}\nfunction isDirectiveInstance(instance) {\n return instance && instance.constructor && instance.constructor.ɵdir;\n}\n/**\n * Locates the element within the given LView and returns the matching index\n */\nfunction findViaNativeElement(lView, target) {\n const tView = lView[TVIEW];\n for (let i = HEADER_OFFSET; i < tView.bindingStartIndex; i++) {\n if (unwrapRNode(lView[i]) === target) {\n return i;\n }\n }\n return -1;\n}\n/**\n * Locates the next tNode (child, sibling or parent).\n */\nfunction traverseNextElement(tNode) {\n if (tNode.child) {\n return tNode.child;\n }\n else if (tNode.next) {\n return tNode.next;\n }\n else {\n // Let's take the following template: <div><span>text</span></div><component/>\n // After checking the text node, we need to find the next parent that has a \"next\" TNode,\n // in this case the parent `div`, so that we can find the component.\n while (tNode.parent && !tNode.parent.next) {\n tNode = tNode.parent;\n }\n return tNode.parent && tNode.parent.next;\n }\n}\n/**\n * Locates the component within the given LView and returns the matching index\n */\nfunction findViaComponent(lView, componentInstance) {\n const componentIndices = lView[TVIEW].components;\n if (componentIndices) {\n for (let i = 0; i < componentIndices.length; i++) {\n const elementComponentIndex = componentIndices[i];\n const componentView = getComponentLViewByIndex(elementComponentIndex, lView);\n if (componentView[CONTEXT] === componentInstance) {\n return elementComponentIndex;\n }\n }\n }\n else {\n const rootComponentView = getComponentLViewByIndex(HEADER_OFFSET, lView);\n const rootComponent = rootComponentView[CONTEXT];\n if (rootComponent === componentInstance) {\n // we are dealing with the root element here therefore we know that the\n // element is the very first element after the HEADER data in the lView\n return HEADER_OFFSET;\n }\n }\n return -1;\n}\n/**\n * Locates the directive within the given LView and returns the matching index\n */\nfunction findViaDirective(lView, directiveInstance) {\n // if a directive is monkey patched then it will (by default)\n // have a reference to the LView of the current view. The\n // element bound to the directive being search lives somewhere\n // in the view data. We loop through the nodes and check their\n // list of directives for the instance.\n let tNode = lView[TVIEW].firstChild;\n while (tNode) {\n const directiveIndexStart = tNode.directiveStart;\n const directiveIndexEnd = tNode.directiveEnd;\n for (let i = directiveIndexStart; i < directiveIndexEnd; i++) {\n if (lView[i] === directiveInstance) {\n return tNode.index;\n }\n }\n tNode = traverseNextElement(tNode);\n }\n return -1;\n}\n/**\n * Returns a list of directives applied to a node at a specific index. The list includes\n * directives matched by selector and any host directives, but it excludes components.\n * Use `getComponentAtNodeIndex` to find the component applied to a node.\n *\n * @param nodeIndex The node index\n * @param lView The target view data\n */\nfunction getDirectivesAtNodeIndex(nodeIndex, lView) {\n const tNode = lView[TVIEW].data[nodeIndex];\n if (tNode.directiveStart === 0)\n return EMPTY_ARRAY;\n const results = [];\n for (let i = tNode.directiveStart; i < tNode.directiveEnd; i++) {\n const directiveInstance = lView[i];\n if (!isComponentInstance(directiveInstance)) {\n results.push(directiveInstance);\n }\n }\n return results;\n}\nfunction getComponentAtNodeIndex(nodeIndex, lView) {\n const tNode = lView[TVIEW].data[nodeIndex];\n return isComponentHost(tNode) ? lView[tNode.directiveStart + tNode.componentOffset] : null;\n}\n/**\n * Returns a map of local references (local reference name => element or directive instance) that\n * exist on a given element.\n */\nfunction discoverLocalRefs(lView, nodeIndex) {\n const tNode = lView[TVIEW].data[nodeIndex];\n if (tNode && tNode.localNames) {\n const result = {};\n let localIndex = tNode.index + 1;\n for (let i = 0; i < tNode.localNames.length; i += 2) {\n result[tNode.localNames[i]] = lView[localIndex];\n localIndex++;\n }\n return result;\n }\n return null;\n}\n\n/**\n * Retrieve the root view from any component or `LView` by walking the parent `LView` until\n * reaching the root `LView`.\n *\n * @param componentOrLView any component or `LView`\n */\nfunction getRootView(componentOrLView) {\n ngDevMode && assertDefined(componentOrLView, 'component');\n let lView = isLView(componentOrLView) ? componentOrLView : readPatchedLView(componentOrLView);\n while (lView && !isRootView(lView)) {\n lView = getLViewParent(lView);\n }\n ngDevMode && assertLView(lView);\n return lView;\n}\n/**\n * Returns the context information associated with the application where the target is situated. It\n * does this by walking the parent views until it gets to the root view, then getting the context\n * off of that.\n *\n * @param viewOrComponent the `LView` or component to get the root context for.\n */\nfunction getRootContext(viewOrComponent) {\n const rootView = getRootView(viewOrComponent);\n ngDevMode &&\n assertDefined(rootView[CONTEXT], 'Root view has no context. Perhaps it is disconnected?');\n return rootView[CONTEXT];\n}\n/**\n * Gets the first `LContainer` in the LView or `null` if none exists.\n */\nfunction getFirstLContainer(lView) {\n return getNearestLContainer(lView[CHILD_HEAD]);\n}\n/**\n * Gets the next `LContainer` that is a sibling of the given container.\n */\nfunction getNextLContainer(container) {\n return getNearestLContainer(container[NEXT]);\n}\nfunction getNearestLContainer(viewOrContainer) {\n while (viewOrContainer !== null && !isLContainer(viewOrContainer)) {\n viewOrContainer = viewOrContainer[NEXT];\n }\n return viewOrContainer;\n}\n\n/**\n * Retrieves the component instance associated with a given DOM element.\n *\n * @usageNotes\n * Given the following DOM structure:\n *\n * ```html\n * <app-root>\n * <div>\n * <child-comp></child-comp>\n * </div>\n * </app-root>\n * ```\n *\n * Calling `getComponent` on `<child-comp>` will return the instance of `ChildComponent`\n * associated with this DOM element.\n *\n * Calling the function on `<app-root>` will return the `MyApp` instance.\n *\n *\n * @param element DOM element from which the component should be retrieved.\n * @returns Component instance associated with the element or `null` if there\n * is no component associated with it.\n *\n * @publicApi\n */\nfunction getComponent(element) {\n ngDevMode && assertDomElement(element);\n const context = getLContext(element);\n if (context === null)\n return null;\n if (context.component === undefined) {\n const lView = context.lView;\n if (lView === null) {\n return null;\n }\n context.component = getComponentAtNodeIndex(context.nodeIndex, lView);\n }\n return context.component;\n}\n/**\n * If inside an embedded view (e.g. `*ngIf` or `*ngFor`), retrieves the context of the embedded\n * view that the element is part of. Otherwise retrieves the instance of the component whose view\n * owns the element (in this case, the result is the same as calling `getOwningComponent`).\n *\n * @param element Element for which to get the surrounding component instance.\n * @returns Instance of the component that is around the element or null if the element isn't\n * inside any component.\n *\n * @publicApi\n */\nfunction getContext(element) {\n assertDomElement(element);\n const context = getLContext(element);\n const lView = context ? context.lView : null;\n return lView === null ? null : lView[CONTEXT];\n}\n/**\n * Retrieves the component instance whose view contains the DOM element.\n *\n * For example, if `<child-comp>` is used in the template of `<app-comp>`\n * (i.e. a `ViewChild` of `<app-comp>`), calling `getOwningComponent` on `<child-comp>`\n * would return `<app-comp>`.\n *\n * @param elementOrDir DOM element, component or directive instance\n * for which to retrieve the root components.\n * @returns Component instance whose view owns the DOM element or null if the element is not\n * part of a component view.\n *\n * @publicApi\n */\nfunction getOwningComponent(elementOrDir) {\n const context = getLContext(elementOrDir);\n let lView = context ? context.lView : null;\n if (lView === null)\n return null;\n let parent;\n while (lView[TVIEW].type === 2 /* TViewType.Embedded */ && (parent = getLViewParent(lView))) {\n lView = parent;\n }\n return isRootView(lView) ? null : lView[CONTEXT];\n}\n/**\n * Retrieves all root components associated with a DOM element, directive or component instance.\n * Root components are those which have been bootstrapped by Angular.\n *\n * @param elementOrDir DOM element, component or directive instance\n * for which to retrieve the root components.\n * @returns Root components associated with the target object.\n *\n * @publicApi\n */\nfunction getRootComponents(elementOrDir) {\n const lView = readPatchedLView(elementOrDir);\n return lView !== null ? [getRootContext(lView)] : [];\n}\n/**\n * Retrieves an `Injector` associated with an element, component or directive instance.\n *\n * @param elementOrDir DOM element, component or directive instance for which to\n * retrieve the injector.\n * @returns Injector associated with the element, component or directive instance.\n *\n * @publicApi\n */\nfunction getInjector(elementOrDir) {\n const context = getLContext(elementOrDir);\n const lView = context ? context.lView : null;\n if (lView === null)\n return Injector.NULL;\n const tNode = lView[TVIEW].data[context.nodeIndex];\n return new NodeInjector(tNode, lView);\n}\n/**\n * Retrieve a set of injection tokens at a given DOM node.\n *\n * @param element Element for which the injection tokens should be retrieved.\n */\nfunction getInjectionTokens(element) {\n const context = getLContext(element);\n const lView = context ? context.lView : null;\n if (lView === null)\n return [];\n const tView = lView[TVIEW];\n const tNode = tView.data[context.nodeIndex];\n const providerTokens = [];\n const startIndex = tNode.providerIndexes & 1048575 /* TNodeProviderIndexes.ProvidersStartIndexMask */;\n const endIndex = tNode.directiveEnd;\n for (let i = startIndex; i < endIndex; i++) {\n let value = tView.data[i];\n if (isDirectiveDefHack(value)) {\n // The fact that we sometimes store Type and sometimes DirectiveDef in this location is a\n // design flaw. We should always store same type so that we can be monomorphic. The issue\n // is that for Components/Directives we store the def instead the type. The correct behavior\n // is that we should always be storing injectable type in this location.\n value = value.type;\n }\n providerTokens.push(value);\n }\n return providerTokens;\n}\n/**\n * Retrieves directive instances associated with a given DOM node. Does not include\n * component instances.\n *\n * @usageNotes\n * Given the following DOM structure:\n *\n * ```html\n * <app-root>\n * <button my-button></button>\n * <my-comp></my-comp>\n * </app-root>\n * ```\n *\n * Calling `getDirectives` on `<button>` will return an array with an instance of the `MyButton`\n * directive that is associated with the DOM node.\n *\n * Calling `getDirectives` on `<my-comp>` will return an empty array.\n *\n * @param node DOM node for which to get the directives.\n * @returns Array of directives associated with the node.\n *\n * @publicApi\n */\nfunction getDirectives(node) {\n // Skip text nodes because we can't have directives associated with them.\n if (node instanceof Text) {\n return [];\n }\n const context = getLContext(node);\n const lView = context ? context.lView : null;\n if (lView === null) {\n return [];\n }\n const tView = lView[TVIEW];\n const nodeIndex = context.nodeIndex;\n if (!tView?.data[nodeIndex]) {\n return [];\n }\n if (context.directives === undefined) {\n context.directives = getDirectivesAtNodeIndex(nodeIndex, lView);\n }\n // The `directives` in this case are a named array called `LComponentView`. Clone the\n // result so we don't expose an internal data structure in the user's console.\n return context.directives === null ? [] : [...context.directives];\n}\n/** The framework used to author a particular application or component. */\nvar Framework;\n(function (Framework) {\n Framework[\"Angular\"] = \"angular\";\n Framework[\"ACX\"] = \"acx\";\n Framework[\"Wiz\"] = \"wiz\";\n})(Framework || (Framework = {}));\n/** ACX change detection strategies. */\nvar AcxChangeDetectionStrategy;\n(function (AcxChangeDetectionStrategy) {\n AcxChangeDetectionStrategy[AcxChangeDetectionStrategy[\"Default\"] = 0] = \"Default\";\n AcxChangeDetectionStrategy[AcxChangeDetectionStrategy[\"OnPush\"] = 1] = \"OnPush\";\n})(AcxChangeDetectionStrategy || (AcxChangeDetectionStrategy = {}));\n/** ACX view encapsulation modes. */\nvar AcxViewEncapsulation;\n(function (AcxViewEncapsulation) {\n AcxViewEncapsulation[AcxViewEncapsulation[\"Emulated\"] = 0] = \"Emulated\";\n AcxViewEncapsulation[AcxViewEncapsulation[\"None\"] = 1] = \"None\";\n})(AcxViewEncapsulation || (AcxViewEncapsulation = {}));\n/**\n * Returns the debug (partial) metadata for a particular directive or component instance.\n * The function accepts an instance of a directive or component and returns the corresponding\n * metadata.\n *\n * @param directiveOrComponentInstance Instance of a directive or component\n * @returns metadata of the passed directive or component\n *\n * @publicApi\n */\nfunction getDirectiveMetadata$1(directiveOrComponentInstance) {\n const { constructor } = directiveOrComponentInstance;\n if (!constructor) {\n throw new Error('Unable to find the instance constructor');\n }\n // In case a component inherits from a directive, we may have component and directive metadata\n // To ensure we don't get the metadata of the directive, we want to call `getComponentDef` first.\n const componentDef = getComponentDef(constructor);\n if (componentDef) {\n const inputs = extractInputDebugMetadata(componentDef.inputs);\n return {\n inputs,\n outputs: componentDef.outputs,\n encapsulation: componentDef.encapsulation,\n changeDetection: componentDef.onPush\n ? ChangeDetectionStrategy.OnPush\n : ChangeDetectionStrategy.Default,\n };\n }\n const directiveDef = getDirectiveDef(constructor);\n if (directiveDef) {\n const inputs = extractInputDebugMetadata(directiveDef.inputs);\n return { inputs, outputs: directiveDef.outputs };\n }\n return null;\n}\n/**\n * Retrieve map of local references.\n *\n * The references are retrieved as a map of local reference name to element or directive instance.\n *\n * @param target DOM element, component or directive instance for which to retrieve\n * the local references.\n */\nfunction getLocalRefs(target) {\n const context = getLContext(target);\n if (context === null)\n return {};\n if (context.localRefs === undefined) {\n const lView = context.lView;\n if (lView === null) {\n return {};\n }\n context.localRefs = discoverLocalRefs(lView, context.nodeIndex);\n }\n return context.localRefs || {};\n}\n/**\n * Retrieves the host element of a component or directive instance.\n * The host element is the DOM element that matched the selector of the directive.\n *\n * @param componentOrDirective Component or directive instance for which the host\n * element should be retrieved.\n * @returns Host element of the target.\n *\n * @publicApi\n */\nfunction getHostElement(componentOrDirective) {\n return getLContext(componentOrDirective).native;\n}\n/**\n * Retrieves a list of event listeners associated with a DOM element. The list does include host\n * listeners, but it does not include event listeners defined outside of the Angular context\n * (e.g. through `addEventListener`).\n *\n * @usageNotes\n * Given the following DOM structure:\n *\n * ```html\n * <app-root>\n * <div (click)=\"doSomething()\"></div>\n * </app-root>\n * ```\n *\n * Calling `getListeners` on `<div>` will return an object that looks as follows:\n *\n * ```ts\n * {\n * name: 'click',\n * element: <div>,\n * callback: () => doSomething(),\n * useCapture: false\n * }\n * ```\n *\n * @param element Element for which the DOM listeners should be retrieved.\n * @returns Array of event listeners on the DOM element.\n *\n * @publicApi\n */\nfunction getListeners(element) {\n ngDevMode && assertDomElement(element);\n const lContext = getLContext(element);\n const lView = lContext === null ? null : lContext.lView;\n if (lView === null)\n return [];\n const tView = lView[TVIEW];\n const lCleanup = lView[CLEANUP];\n const tCleanup = tView.cleanup;\n const listeners = [];\n if (tCleanup && lCleanup) {\n for (let i = 0; i < tCleanup.length;) {\n const firstParam = tCleanup[i++];\n const secondParam = tCleanup[i++];\n if (typeof firstParam === 'string') {\n const name = firstParam;\n const listenerElement = unwrapRNode(lView[secondParam]);\n const callback = lCleanup[tCleanup[i++]];\n const useCaptureOrIndx = tCleanup[i++];\n // if useCaptureOrIndx is boolean then report it as is.\n // if useCaptureOrIndx is positive number then it in unsubscribe method\n // if useCaptureOrIndx is negative number then it is a Subscription\n const type = typeof useCaptureOrIndx === 'boolean' || useCaptureOrIndx >= 0 ? 'dom' : 'output';\n const useCapture = typeof useCaptureOrIndx === 'boolean' ? useCaptureOrIndx : false;\n if (element == listenerElement) {\n listeners.push({ element, name, callback, useCapture, type });\n }\n }\n }\n }\n listeners.sort(sortListeners);\n return listeners;\n}\nfunction sortListeners(a, b) {\n if (a.name == b.name)\n return 0;\n return a.name < b.name ? -1 : 1;\n}\n/**\n * This function should not exist because it is megamorphic and only mostly correct.\n *\n * See call site for more info.\n */\nfunction isDirectiveDefHack(obj) {\n return (obj.type !== undefined &&\n obj.declaredInputs !== undefined &&\n obj.resolveHostDirectives !== undefined);\n}\n/** Asserts that a value is a DOM Element. */\nfunction assertDomElement(value) {\n if (typeof Element !== 'undefined' && !(value instanceof Element)) {\n throw new Error('Expecting instance of DOM Element');\n }\n}\n/**\n * A directive definition holds additional metadata using bitwise flags to indicate\n * for example whether it is signal based.\n *\n * This information needs to be separate from the `publicName -> minifiedName`\n * mappings for backwards compatibility.\n */\nfunction extractInputDebugMetadata(inputs) {\n const res = {};\n for (const key in inputs) {\n if (inputs.hasOwnProperty(key)) {\n const value = inputs[key];\n if (value !== undefined) {\n res[key] = value[0];\n }\n }\n }\n return res;\n}\n\n/**\n * Most of the use of `document` in Angular is from within the DI system so it is possible to simply\n * inject the `DOCUMENT` token and are done.\n *\n * Ivy is special because it does not rely upon the DI and must get hold of the document some other\n * way.\n *\n * The solution is to define `getDocument()` and `setDocument()` top-level functions for ivy.\n * Wherever ivy needs the global document, it calls `getDocument()` instead.\n *\n * When running ivy outside of a browser environment, it is necessary to call `setDocument()` to\n * tell ivy what the global `document` is.\n *\n * Angular does this for us in each of the standard platforms (`Browser` and `Server`)\n * by calling `setDocument()` when providing the `DOCUMENT` token.\n */\nlet DOCUMENT = undefined;\n/**\n * Tell ivy what the `document` is for this platform.\n *\n * It is only necessary to call this if the current platform is not a browser.\n *\n * @param document The object representing the global `document` in this environment.\n */\nfunction setDocument(document) {\n DOCUMENT = document;\n}\n/**\n * Access the object that represents the `document` for this platform.\n *\n * Ivy calls this whenever it needs to access the `document` object.\n * For example to create the renderer or to do sanitization.\n */\nfunction getDocument() {\n if (DOCUMENT !== undefined) {\n return DOCUMENT;\n }\n else if (typeof document !== 'undefined') {\n return document;\n }\n throw new RuntimeError(210 /* RuntimeErrorCode.MISSING_DOCUMENT */, (typeof ngDevMode === 'undefined' || ngDevMode) &&\n `The document object is not available in this context. Make sure the DOCUMENT injection token is provided.`);\n // No \"document\" can be found. This should only happen if we are running ivy outside Angular and\n // the current platform is not a browser. Since this is not a supported scenario at the moment\n // this should not happen in Angular apps.\n // Once we support running ivy outside of Angular we will need to publish `setDocument()` as a\n // public API.\n}\n\n/**\n * A DI token representing a string ID, used\n * primarily for prefixing application attributes and CSS styles when\n * {@link ViewEncapsulation#Emulated} is being used.\n *\n * The token is needed in cases when multiple applications are bootstrapped on a page\n * (for example, using `bootstrapApplication` calls). In this case, ensure that those applications\n * have different `APP_ID` value setup. For example:\n *\n * ```ts\n * bootstrapApplication(ComponentA, {\n * providers: [\n * { provide: APP_ID, useValue: 'app-a' },\n * // ... other providers ...\n * ]\n * });\n *\n * bootstrapApplication(ComponentB, {\n * providers: [\n * { provide: APP_ID, useValue: 'app-b' },\n * // ... other providers ...\n * ]\n * });\n * ```\n *\n * By default, when there is only one application bootstrapped, you don't need to provide the\n * `APP_ID` token (the `ng` will be used as an app ID).\n *\n * @publicApi\n */\nconst APP_ID = new InjectionToken(ngDevMode ? 'AppId' : '', {\n providedIn: 'root',\n factory: () => DEFAULT_APP_ID,\n});\n/** Default value of the `APP_ID` token. */\nconst DEFAULT_APP_ID = 'ng';\n/**\n * A function that is executed when a platform is initialized.\n *\n * @deprecated from v19.0.0, use providePlatformInitializer instead\n *\n * @see {@link providePlatformInitializer}\n *\n * @publicApi\n */\nconst PLATFORM_INITIALIZER = new InjectionToken(ngDevMode ? 'Platform Initializer' : '');\n/**\n * A token that indicates an opaque platform ID.\n * @publicApi\n */\nconst PLATFORM_ID = new InjectionToken(ngDevMode ? 'Platform ID' : '', {\n providedIn: 'platform',\n factory: () => 'unknown', // set a default platform name, when none set explicitly\n});\n/**\n * A DI token that indicates the root directory of\n * the application\n * @publicApi\n * @deprecated\n */\nconst PACKAGE_ROOT_URL = new InjectionToken(ngDevMode ? 'Application Packages Root URL' : '');\n// We keep this token here, rather than the animations package, so that modules that only care\n// about which animations module is loaded (e.g. the CDK) can retrieve it without having to\n// include extra dependencies. See #44970 for more context.\n/**\n * A [DI token](api/core/InjectionToken) that indicates which animations\n * module has been loaded.\n * @publicApi\n */\nconst ANIMATION_MODULE_TYPE = new InjectionToken(ngDevMode ? 'AnimationModuleType' : '');\n// TODO(crisbeto): link to CSP guide here.\n/**\n * Token used to configure the [Content Security Policy](https://web.dev/strict-csp/) nonce that\n * Angular will apply when inserting inline styles. If not provided, Angular will look up its value\n * from the `ngCspNonce` attribute of the application root node.\n *\n * @publicApi\n */\nconst CSP_NONCE = new InjectionToken(ngDevMode ? 'CSP nonce' : '', {\n providedIn: 'root',\n factory: () => {\n // Ideally we wouldn't have to use `querySelector` here since we know that the nonce will be on\n // the root node, but because the token value is used in renderers, it has to be available\n // *very* early in the bootstrapping process. This should be a fairly shallow search, because\n // the app won't have been added to the DOM yet. Some approaches that were considered:\n // 1. Find the root node through `ApplicationRef.components[i].location` - normally this would\n // be enough for our purposes, but the token is injected very early so the `components` array\n // isn't populated yet.\n // 2. Find the root `LView` through the current `LView` - renderers are a prerequisite to\n // creating the `LView`. This means that no `LView` will have been entered when this factory is\n // invoked for the root component.\n // 3. Have the token factory return `() => string` which is invoked when a nonce is requested -\n // the slightly later execution does allow us to get an `LView` reference, but the fact that\n // it is a function means that it could be executed at *any* time (including immediately) which\n // may lead to weird bugs.\n // 4. Have the `ComponentFactory` read the attribute and provide it to the injector under the\n // hood - has the same problem as #1 and #2 in that the renderer is used to query for the root\n // node and the nonce value needs to be available when the renderer is created.\n return getDocument().body?.querySelector('[ngCspNonce]')?.getAttribute('ngCspNonce') || null;\n },\n});\nconst IMAGE_CONFIG_DEFAULTS = {\n breakpoints: [16, 32, 48, 64, 96, 128, 256, 384, 640, 750, 828, 1080, 1200, 1920, 2048, 3840],\n placeholderResolution: 30,\n disableImageSizeWarning: false,\n disableImageLazyLoadWarning: false,\n};\n/**\n * Injection token that configures the image optimized image functionality.\n * See {@link ImageConfig} for additional information about parameters that\n * can be used.\n *\n * @see {@link NgOptimizedImage}\n * @see {@link ImageConfig}\n * @publicApi\n */\nconst IMAGE_CONFIG = new InjectionToken(ngDevMode ? 'ImageConfig' : '', {\n providedIn: 'root',\n factory: () => IMAGE_CONFIG_DEFAULTS,\n});\n\n/**\n * Create a `StateKey<T>` that can be used to store value of type T with `TransferState`.\n *\n * Example:\n *\n * ```ts\n * const COUNTER_KEY = makeStateKey<number>('counter');\n * let value = 10;\n *\n * transferState.set(COUNTER_KEY, value);\n * ```\n *\n * @publicApi\n */\nfunction makeStateKey(key) {\n return key;\n}\nfunction initTransferState() {\n const transferState = new TransferState();\n if (typeof ngServerMode === 'undefined' || !ngServerMode) {\n transferState.store = retrieveTransferredState(getDocument(), inject(APP_ID));\n }\n return transferState;\n}\n/**\n * A key value store that is transferred from the application on the server side to the application\n * on the client side.\n *\n * The `TransferState` is available as an injectable token.\n * On the client, just inject this token using DI and use it, it will be lazily initialized.\n * On the server it's already included if `renderApplication` function is used. Otherwise, import\n * the `ServerTransferStateModule` module to make the `TransferState` available.\n *\n * The values in the store are serialized/deserialized using JSON.stringify/JSON.parse. So only\n * boolean, number, string, null and non-class objects will be serialized and deserialized in a\n * non-lossy manner.\n *\n * @publicApi\n */\nclass TransferState {\n /** @nocollapse */\n static ɵprov = /** @pureOrBreakMyCode */ /* @__PURE__ */ __defineInjectable({\n token: TransferState,\n providedIn: 'root',\n factory: initTransferState,\n });\n /** @internal */\n store = {};\n onSerializeCallbacks = {};\n /**\n * Get the value corresponding to a key. Return `defaultValue` if key is not found.\n */\n get(key, defaultValue) {\n return this.store[key] !== undefined ? this.store[key] : defaultValue;\n }\n /**\n * Set the value corresponding to a key.\n */\n set(key, value) {\n this.store[key] = value;\n }\n /**\n * Remove a key from the store.\n */\n remove(key) {\n delete this.store[key];\n }\n /**\n * Test whether a key exists in the store.\n */\n hasKey(key) {\n return this.store.hasOwnProperty(key);\n }\n /**\n * Indicates whether the state is empty.\n */\n get isEmpty() {\n return Object.keys(this.store).length === 0;\n }\n /**\n * Register a callback to provide the value for a key when `toJson` is called.\n */\n onSerialize(key, callback) {\n this.onSerializeCallbacks[key] = callback;\n }\n /**\n * Serialize the current state of the store to JSON.\n */\n toJson() {\n // Call the onSerialize callbacks and put those values into the store.\n for (const key in this.onSerializeCallbacks) {\n if (this.onSerializeCallbacks.hasOwnProperty(key)) {\n try {\n this.store[key] = this.onSerializeCallbacks[key]();\n }\n catch (e) {\n console.warn('Exception in onSerialize callback: ', e);\n }\n }\n }\n // Escape script tag to avoid break out of <script> tag in serialized output.\n // Encoding of `<` is the same behaviour as G3 script_builders.\n return JSON.stringify(this.store).replace(/</g, '\\\\u003C');\n }\n}\nfunction retrieveTransferredState(doc, appId) {\n // Locate the script tag with the JSON data transferred from the server.\n // The id of the script tag is set to the Angular appId + 'state'.\n const script = doc.getElementById(appId + '-state');\n if (script?.textContent) {\n try {\n // Avoid using any here as it triggers lint errors in google3 (any is not allowed).\n // Decoding of `<` is done of the box by browsers and node.js, same behaviour as G3\n // script_builders.\n return JSON.parse(script.textContent);\n }\n catch (e) {\n console.warn('Exception while restoring TransferState for app ' + appId, e);\n }\n }\n return {};\n}\n\n/** Encodes that the node lookup should start from the host node of this component. */\nconst REFERENCE_NODE_HOST = 'h';\n/** Encodes that the node lookup should start from the document body node. */\nconst REFERENCE_NODE_BODY = 'b';\nconst NODE_NAVIGATION_STEP_FIRST_CHILD = 'f';\nconst NODE_NAVIGATION_STEP_NEXT_SIBLING = 'n';\n/**\n * Keys within serialized view data structure to represent various\n * parts. See the `SerializedView` interface below for additional information.\n */\nconst ELEMENT_CONTAINERS = 'e';\nconst TEMPLATES = 't';\nconst CONTAINERS = 'c';\nconst MULTIPLIER = 'x';\nconst NUM_ROOT_NODES = 'r';\nconst TEMPLATE_ID = 'i'; // as it's also an \"id\"\nconst NODES = 'n';\nconst DISCONNECTED_NODES = 'd';\nconst I18N_DATA = 'l';\nconst DEFER_BLOCK_ID = 'di';\nconst DEFER_BLOCK_STATE$1 = 's';\nconst DEFER_PARENT_BLOCK_ID = 'p';\nconst DEFER_HYDRATE_TRIGGERS = 't';\n\n/**\n * Internal token that specifies whether DOM reuse logic\n * during hydration is enabled.\n */\nconst IS_HYDRATION_DOM_REUSE_ENABLED = new InjectionToken(typeof ngDevMode === 'undefined' || !!ngDevMode ? 'IS_HYDRATION_DOM_REUSE_ENABLED' : '');\n// By default (in client rendering mode), we remove all the contents\n// of the host element and render an application after that.\nconst PRESERVE_HOST_CONTENT_DEFAULT = false;\n/**\n * Internal token that indicates whether host element content should be\n * retained during the bootstrap.\n */\nconst PRESERVE_HOST_CONTENT = new InjectionToken(typeof ngDevMode === 'undefined' || !!ngDevMode ? 'PRESERVE_HOST_CONTENT' : '', {\n providedIn: 'root',\n factory: () => PRESERVE_HOST_CONTENT_DEFAULT,\n});\n/**\n * Internal token that indicates whether hydration support for i18n\n * is enabled.\n */\nconst IS_I18N_HYDRATION_ENABLED = new InjectionToken(typeof ngDevMode === 'undefined' || !!ngDevMode ? 'IS_I18N_HYDRATION_ENABLED' : '');\n/**\n * Internal token that indicates whether event replay support for SSR\n * is enabled.\n */\nconst IS_EVENT_REPLAY_ENABLED = new InjectionToken(typeof ngDevMode === 'undefined' || !!ngDevMode ? 'IS_EVENT_REPLAY_ENABLED' : '');\nconst EVENT_REPLAY_ENABLED_DEFAULT = false;\n/**\n * Internal token that indicates whether incremental hydration support\n * is enabled.\n */\nconst IS_INCREMENTAL_HYDRATION_ENABLED = new InjectionToken(typeof ngDevMode === 'undefined' || !!ngDevMode ? 'IS_INCREMENTAL_HYDRATION_ENABLED' : '');\n/**\n * A map of DOM elements with `jsaction` attributes grouped by action names.\n */\nconst JSACTION_BLOCK_ELEMENT_MAP = new InjectionToken(ngDevMode ? 'JSACTION_BLOCK_ELEMENT_MAP' : '', {\n providedIn: 'root',\n factory: () => new Map(),\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/** Configuration object used to register passive and capturing events. */\nconst eventListenerOptions = {\n passive: true,\n capture: true,\n};\n/** Keeps track of the currently-registered `on hover` triggers. */\nconst hoverTriggers = new WeakMap();\n/** Keeps track of the currently-registered `on interaction` triggers. */\nconst interactionTriggers = new WeakMap();\n/** Currently-registered `viewport` triggers. */\nconst viewportTriggers = new WeakMap();\n/** Names of the events considered as interaction events. */\nconst interactionEventNames = ['click', 'keydown'];\n/** Names of the events considered as hover events. */\nconst hoverEventNames = ['mouseenter', 'mouseover', 'focusin'];\n/** `IntersectionObserver` used to observe `viewport` triggers. */\nlet intersectionObserver = null;\n/** Number of elements currently observed with `viewport` triggers. */\nlet observedViewportElements = 0;\n/** Object keeping track of registered callbacks for a deferred block trigger. */\nclass DeferEventEntry {\n callbacks = new Set();\n listener = () => {\n for (const callback of this.callbacks) {\n callback();\n }\n };\n}\n/**\n * Registers an interaction trigger.\n * @param trigger Element that is the trigger.\n * @param callback Callback to be invoked when the trigger is interacted with.\n * @return cleanup function which removes trigger Element from interactionTriggers map\n * and interaction event listeners from the trigger Element\n */\nfunction onInteraction(trigger, callback) {\n let entry = interactionTriggers.get(trigger);\n // If this is the first entry for this element, add the listeners.\n if (!entry) {\n // Note that managing events centrally like this lends itself well to using global\n // event delegation. It currently does delegation at the element level, rather than the\n // document level, because:\n // 1. Global delegation is the most effective when there are a lot of events being registered\n // at the same time. Deferred blocks are unlikely to be used in such a way.\n // 2. Matching events to their target isn't free. For each `click` and `keydown` event we\n // would have look through all the triggers and check if the target either is the element\n // itself or it's contained within the element. Given that `click` and `keydown` are some\n // of the most common events, this may end up introducing a lot of runtime overhead.\n // 3. We're still registering only two events per element, no matter how many deferred blocks\n // are referencing it.\n entry = new DeferEventEntry();\n interactionTriggers.set(trigger, entry);\n for (const name of interactionEventNames) {\n trigger.addEventListener(name, entry.listener, eventListenerOptions);\n }\n }\n entry.callbacks.add(callback);\n return () => {\n const { callbacks, listener } = entry;\n callbacks.delete(callback);\n if (callbacks.size === 0) {\n interactionTriggers.delete(trigger);\n for (const name of interactionEventNames) {\n trigger.removeEventListener(name, listener, eventListenerOptions);\n }\n }\n };\n}\n/**\n * Registers a hover trigger.\n * @param trigger Element that is the trigger.\n * @param callback Callback to be invoked when the trigger is hovered over.\n * @return cleanup function which removes trigger element from hoverTriggers map\n * and removes hover interaction event listeners from the trigger element\n */\nfunction onHover(trigger, callback) {\n let entry = hoverTriggers.get(trigger);\n // If this is the first entry for this element, add the listener.\n if (!entry) {\n entry = new DeferEventEntry();\n hoverTriggers.set(trigger, entry);\n for (const name of hoverEventNames) {\n trigger.addEventListener(name, entry.listener, eventListenerOptions);\n }\n }\n entry.callbacks.add(callback);\n return () => {\n const { callbacks, listener } = entry;\n callbacks.delete(callback);\n if (callbacks.size === 0) {\n for (const name of hoverEventNames) {\n trigger.removeEventListener(name, listener, eventListenerOptions);\n }\n hoverTriggers.delete(trigger);\n }\n };\n}\n/**\n * Used to create an IntersectionObserver instance.\n * @return IntersectionObserver that is used by onViewport\n */\nfunction createIntersectionObserver() {\n return new IntersectionObserver((entries) => {\n for (const current of entries) {\n if (current.isIntersecting && viewportTriggers.has(current.target)) {\n viewportTriggers.get(current.target).listener();\n }\n }\n });\n}\n/**\n * Registers a viewport trigger.\n * @param trigger Element that is the trigger.\n * @param callback Callback to be invoked when the trigger comes into the viewport.\n * @param observerFactoryFn Factory function which returns an IntersectionObserver\n * @return cleanup function which removes trigger Element from viewportTriggers map\n * and tells the intersection observer to stop observing trigger Element and set\n * intersectionObserver to null if there are no more Elements to observe\n */\nfunction onViewport(trigger, callback, observerFactoryFn) {\n let entry = viewportTriggers.get(trigger);\n intersectionObserver = intersectionObserver || observerFactoryFn();\n if (!entry) {\n entry = new DeferEventEntry();\n intersectionObserver.observe(trigger);\n viewportTriggers.set(trigger, entry);\n observedViewportElements++;\n }\n entry.callbacks.add(callback);\n return () => {\n if (!viewportTriggers.has(trigger)) {\n return;\n }\n entry.callbacks.delete(callback);\n if (entry.callbacks.size === 0) {\n intersectionObserver?.unobserve(trigger);\n viewportTriggers.delete(trigger);\n observedViewportElements--;\n }\n if (observedViewportElements === 0) {\n intersectionObserver?.disconnect();\n intersectionObserver = null;\n }\n };\n}\n\nconst DEFER_BLOCK_SSR_ID_ATTRIBUTE = 'ngb';\nfunction setJSActionAttributes(nativeElement, eventTypes, parentDeferBlockId = null) {\n // jsaction attributes specifically should be applied to elements and not comment nodes.\n // Comment nodes also have no setAttribute function. So this avoids errors.\n if (eventTypes.length === 0 || nativeElement.nodeType !== Node.ELEMENT_NODE) {\n return;\n }\n const existingAttr = nativeElement.getAttribute(Attribute$1.JSACTION);\n // we dedupe cases where hydrate triggers are used as it's possible that\n // someone may have added an event binding to the root node that matches what the\n // hydrate trigger adds.\n const parts = eventTypes.reduce((prev, curr) => {\n // if there is no existing attribute OR it's not in the existing one, we need to add it\n return (existingAttr?.indexOf(curr) ?? -1) === -1 ? prev + curr + ':;' : prev;\n }, '');\n // This is required to be a module accessor to appease security tests on setAttribute.\n nativeElement.setAttribute(Attribute$1.JSACTION, `${existingAttr ?? ''}${parts}`);\n const blockName = parentDeferBlockId ?? '';\n if (blockName !== '' && parts.length > 0) {\n nativeElement.setAttribute(DEFER_BLOCK_SSR_ID_ATTRIBUTE, blockName);\n }\n}\nconst sharedStashFunction = (rEl, eventType, listenerFn) => {\n const el = rEl;\n const eventListenerMap = el.__jsaction_fns ?? new Map();\n const eventListeners = eventListenerMap.get(eventType) ?? [];\n eventListeners.push(listenerFn);\n eventListenerMap.set(eventType, eventListeners);\n el.__jsaction_fns = eventListenerMap;\n};\nconst sharedMapFunction = (rEl, jsActionMap) => {\n const el = rEl;\n let blockName = el.getAttribute(DEFER_BLOCK_SSR_ID_ATTRIBUTE) ?? '';\n const blockSet = jsActionMap.get(blockName) ?? new Set();\n if (!blockSet.has(el)) {\n blockSet.add(el);\n }\n jsActionMap.set(blockName, blockSet);\n};\nfunction removeListenersFromBlocks(blockNames, jsActionMap) {\n if (blockNames.length > 0) {\n let blockList = [];\n for (let blockName of blockNames) {\n if (jsActionMap.has(blockName)) {\n blockList = [...blockList, ...jsActionMap.get(blockName)];\n }\n }\n const replayList = new Set(blockList);\n replayList.forEach(removeListeners);\n }\n}\nconst removeListeners = (el) => {\n el.removeAttribute(Attribute$1.JSACTION);\n el.removeAttribute(DEFER_BLOCK_SSR_ID_ATTRIBUTE);\n el.__jsaction_fns = undefined;\n};\nconst JSACTION_EVENT_CONTRACT = new InjectionToken(ngDevMode ? 'EVENT_CONTRACT_DETAILS' : '', {\n providedIn: 'root',\n factory: () => ({}),\n});\nfunction invokeListeners(event, currentTarget) {\n const handlerFns = currentTarget?.__jsaction_fns?.get(event.type);\n if (!handlerFns || !currentTarget?.isConnected) {\n return;\n }\n for (const handler of handlerFns) {\n handler(event);\n }\n}\nconst stashEventListeners = new Map();\n/**\n * Registers a stashing function for a specific application ID.\n *\n * @param appId The unique identifier for the application instance.\n * @param fn The stashing function to associate with this app ID.\n * @returns A cleanup function that removes the stashing function when called.\n */\nfunction setStashFn(appId, fn) {\n stashEventListeners.set(appId, fn);\n return () => stashEventListeners.delete(appId);\n}\n/**\n * Indicates whether the stashing code was added, prevents adding it multiple times.\n */\nlet isStashEventListenerImplEnabled = false;\nlet _stashEventListenerImpl = (lView, target, eventName, wrappedListener) => { };\n/**\n * Optionally stashes an event listener for later replay during hydration.\n *\n * This function delegates to an internal `_stashEventListenerImpl`, which may\n * be a no-op unless the event replay feature is enabled. When active, this\n * allows capturing event listener metadata before hydration completes, so that\n * user interactions during SSR can be replayed.\n *\n * @param lView The logical view (LView) where the listener is being registered.\n * @param target The DOM element or event target the listener is attached to.\n * @param eventName The name of the event being listened for (e.g., 'click').\n * @param wrappedListener The event handler that was registered.\n */\nfunction stashEventListenerImpl(lView, target, eventName, wrappedListener) {\n _stashEventListenerImpl(lView, target, eventName, wrappedListener);\n}\n/**\n * Enables the event listener stashing logic in a tree-shakable way.\n *\n * This function lazily sets the implementation of `_stashEventListenerImpl`\n * so that it becomes active only when `withEventReplay` is invoked. This ensures\n * that the stashing logic is excluded from production builds unless needed.\n */\nfunction enableStashEventListenerImpl() {\n if (!isStashEventListenerImplEnabled) {\n _stashEventListenerImpl = (lView, target, eventName, wrappedListener) => {\n const appId = lView[INJECTOR].get(APP_ID);\n const stashEventListener = stashEventListeners.get(appId);\n stashEventListener?.(target, eventName, wrappedListener);\n };\n isStashEventListenerImplEnabled = true;\n }\n}\n\n/**\n * An internal injection token to reference `DehydratedBlockRegistry` implementation\n * in a tree-shakable way.\n */\nconst DEHYDRATED_BLOCK_REGISTRY = new InjectionToken(ngDevMode ? 'DEHYDRATED_BLOCK_REGISTRY' : '');\n/**\n * The DehydratedBlockRegistry is used for incremental hydration purposes. It keeps\n * track of the Defer Blocks that need hydration so we can effectively\n * navigate up to the top dehydrated defer block and fire appropriate cleanup\n * functions post hydration.\n */\nclass DehydratedBlockRegistry {\n registry = new Map();\n cleanupFns = new Map();\n jsActionMap = inject(JSACTION_BLOCK_ELEMENT_MAP);\n contract = inject(JSACTION_EVENT_CONTRACT);\n add(blockId, info) {\n this.registry.set(blockId, info);\n // It's possible that hydration is queued that's waiting for the\n // resolution of a lazy loaded route. In this case, we ensure\n // the callback function is called to continue the hydration process\n // for the queued block set.\n if (this.awaitingCallbacks.has(blockId)) {\n const awaitingCallbacks = this.awaitingCallbacks.get(blockId);\n for (const cb of awaitingCallbacks) {\n cb();\n }\n }\n }\n get(blockId) {\n return this.registry.get(blockId) ?? null;\n }\n has(blockId) {\n return this.registry.has(blockId);\n }\n cleanup(hydratedBlocks) {\n removeListenersFromBlocks(hydratedBlocks, this.jsActionMap);\n for (let blockId of hydratedBlocks) {\n this.registry.delete(blockId);\n this.jsActionMap.delete(blockId);\n this.invokeTriggerCleanupFns(blockId);\n this.hydrating.delete(blockId);\n this.awaitingCallbacks.delete(blockId);\n }\n if (this.size === 0) {\n this.contract.instance?.cleanUp();\n }\n }\n get size() {\n return this.registry.size;\n }\n // we have to leave the lowest block Id in the registry\n // unless that block has no children\n addCleanupFn(blockId, fn) {\n let cleanupFunctions = [];\n if (this.cleanupFns.has(blockId)) {\n cleanupFunctions = this.cleanupFns.get(blockId);\n }\n cleanupFunctions.push(fn);\n this.cleanupFns.set(blockId, cleanupFunctions);\n }\n invokeTriggerCleanupFns(blockId) {\n const fns = this.cleanupFns.get(blockId) ?? [];\n for (let fn of fns) {\n fn();\n }\n this.cleanupFns.delete(blockId);\n }\n // Blocks that are being hydrated.\n hydrating = new Map();\n // Blocks that are awaiting a defer instruction finish.\n awaitingCallbacks = new Map();\n awaitParentBlock(topmostParentBlock, callback) {\n const parentBlockAwaitCallbacks = this.awaitingCallbacks.get(topmostParentBlock) ?? [];\n parentBlockAwaitCallbacks.push(callback);\n this.awaitingCallbacks.set(topmostParentBlock, parentBlockAwaitCallbacks);\n }\n /** @nocollapse */\n static ɵprov = /** @pureOrBreakMyCode */ /* @__PURE__ */ __defineInjectable({\n token: DehydratedBlockRegistry,\n providedIn: null,\n factory: () => new DehydratedBlockRegistry(),\n });\n}\n\n/**\n * Checks whether a TNode is considered detached, i.e. not present in the\n * translated i18n template. We should not attempt hydration for such nodes\n * and instead, use a regular \"creation mode\".\n */\nfunction isDetachedByI18n(tNode) {\n return (tNode.flags & 32 /* TNodeFlags.isDetached */) === 32 /* TNodeFlags.isDetached */;\n}\n\n/**\n * The name of the key used in the TransferState collection,\n * where hydration information is located.\n */\nconst TRANSFER_STATE_TOKEN_ID = '__nghData__';\n/**\n * Lookup key used to reference DOM hydration data (ngh) in `TransferState`.\n */\nconst NGH_DATA_KEY = makeStateKey(TRANSFER_STATE_TOKEN_ID);\n/**\n * The name of the key used in the TransferState collection,\n * where serialized defer block information is located.\n */\nconst TRANSFER_STATE_DEFER_BLOCKS_INFO = '__nghDeferData__';\n/**\n * Lookup key used to retrieve defer block datain `TransferState`.\n */\nconst NGH_DEFER_BLOCKS_KEY = makeStateKey(TRANSFER_STATE_DEFER_BLOCKS_INFO);\n/**\n * Checks whether a given key is used by the framework for transferring hydration data.\n */\nfunction isInternalHydrationTransferStateKey(key) {\n return key === TRANSFER_STATE_TOKEN_ID || key === TRANSFER_STATE_DEFER_BLOCKS_INFO;\n}\n/**\n * The name of the attribute that would be added to host component\n * nodes and contain a reference to a particular slot in transferred\n * state that contains the necessary hydration info for this component.\n */\nconst NGH_ATTR_NAME = 'ngh';\n/**\n * Marker used in a comment node to ensure hydration content integrity\n */\nconst SSR_CONTENT_INTEGRITY_MARKER = 'nghm';\n/**\n * Reference to a function that reads `ngh` attribute value from a given RNode\n * and retrieves hydration information from the TransferState using that value\n * as an index. Returns `null` by default, when hydration is not enabled.\n *\n * @param rNode Component's host element.\n * @param injector Injector that this component has access to.\n * @param isRootView Specifies whether we trying to read hydration info for the root view.\n */\nlet _retrieveHydrationInfoImpl = () => null;\nfunction retrieveHydrationInfoImpl(rNode, injector, isRootView = false) {\n let nghAttrValue = rNode.getAttribute(NGH_ATTR_NAME);\n if (nghAttrValue == null)\n return null;\n // For cases when a root component also acts as an anchor node for a ViewContainerRef\n // (for example, when ViewContainerRef is injected in a root component), there is a need\n // to serialize information about the component itself, as well as an LContainer that\n // represents this ViewContainerRef. Effectively, we need to serialize 2 pieces of info:\n // (1) hydration info for the root component itself and (2) hydration info for the\n // ViewContainerRef instance (an LContainer). Each piece of information is included into\n // the hydration data (in the TransferState object) separately, thus we end up with 2 ids.\n // Since we only have 1 root element, we encode both bits of info into a single string:\n // ids are separated by the `|` char (e.g. `10|25`, where `10` is the ngh for a component view\n // and 25 is the `ngh` for a root view which holds LContainer).\n const [componentViewNgh, rootViewNgh] = nghAttrValue.split('|');\n nghAttrValue = isRootView ? rootViewNgh : componentViewNgh;\n if (!nghAttrValue)\n return null;\n // We've read one of the ngh ids, keep the remaining one, so that\n // we can set it back on the DOM element.\n const rootNgh = rootViewNgh ? `|${rootViewNgh}` : '';\n const remainingNgh = isRootView ? componentViewNgh : rootNgh;\n let data = {};\n // An element might have an empty `ngh` attribute value (e.g. `<comp ngh=\"\" />`),\n // which means that no special annotations are required. Do not attempt to read\n // from the TransferState in this case.\n if (nghAttrValue !== '') {\n const transferState = injector.get(TransferState, null, { optional: true });\n if (transferState !== null) {\n const nghData = transferState.get(NGH_DATA_KEY, []);\n // The nghAttrValue is always a number referencing an index\n // in the hydration TransferState data.\n data = nghData[Number(nghAttrValue)];\n // If the `ngh` attribute exists and has a non-empty value,\n // the hydration info *must* be present in the TransferState.\n // If there is no data for some reasons, this is an error.\n ngDevMode && assertDefined(data, 'Unable to retrieve hydration info from the TransferState.');\n }\n }\n const dehydratedView = {\n data,\n firstChild: rNode.firstChild ?? null,\n };\n if (isRootView) {\n // If there is hydration info present for the root view, it means that there was\n // a ViewContainerRef injected in the root component. The root component host element\n // acted as an anchor node in this scenario. As a result, the DOM nodes that represent\n // embedded views in this ViewContainerRef are located as siblings to the host node,\n // i.e. `<app-root /><#VIEW1><#VIEW2>...<!--container-->`. In this case, the current\n // node becomes the first child of this root view and the next sibling is the first\n // element in the DOM segment.\n dehydratedView.firstChild = rNode;\n // We use `0` here, since this is the slot (right after the HEADER_OFFSET)\n // where a component LView or an LContainer is located in a root LView.\n setSegmentHead(dehydratedView, 0, rNode.nextSibling);\n }\n if (remainingNgh) {\n // If we have only used one of the ngh ids, store the remaining one\n // back on this RNode.\n rNode.setAttribute(NGH_ATTR_NAME, remainingNgh);\n }\n else {\n // The `ngh` attribute is cleared from the DOM node now\n // that the data has been retrieved for all indices.\n rNode.removeAttribute(NGH_ATTR_NAME);\n }\n // Note: don't check whether this node was claimed for hydration,\n // because this node might've been previously claimed while processing\n // template instructions.\n ngDevMode && markRNodeAsClaimedByHydration(rNode, /* checkIfAlreadyClaimed */ false);\n ngDevMode && ngDevMode.hydratedComponents++;\n return dehydratedView;\n}\n/**\n * Sets the implementation for the `retrieveHydrationInfo` function.\n */\nfunction enableRetrieveHydrationInfoImpl() {\n _retrieveHydrationInfoImpl = retrieveHydrationInfoImpl;\n}\n/**\n * Retrieves hydration info by reading the value from the `ngh` attribute\n * and accessing a corresponding slot in TransferState storage.\n */\nfunction retrieveHydrationInfo(rNode, injector, isRootView = false) {\n return _retrieveHydrationInfoImpl(rNode, injector, isRootView);\n}\n/**\n * Retrieves the necessary object from a given ViewRef to serialize:\n * - an LView for component views\n * - an LContainer for cases when component acts as a ViewContainerRef anchor\n * - `null` in case of an embedded view\n */\nfunction getLNodeForHydration(viewRef) {\n // Reading an internal field from `ViewRef` instance.\n let lView = viewRef._lView;\n const tView = lView[TVIEW];\n // A registered ViewRef might represent an instance of an\n // embedded view, in which case we do not need to annotate it.\n if (tView.type === 2 /* TViewType.Embedded */) {\n return null;\n }\n // Check if it's a root view and if so, retrieve component's\n // LView from the first slot after the header.\n if (isRootView(lView)) {\n lView = lView[HEADER_OFFSET];\n }\n return lView;\n}\nfunction getTextNodeContent(node) {\n return node.textContent?.replace(/\\s/gm, '');\n}\n/**\n * Restores text nodes and separators into the DOM that were lost during SSR\n * serialization. The hydration process replaces empty text nodes and text\n * nodes that are immediately adjacent to other text nodes with comment nodes\n * that this method filters on to restore those missing nodes that the\n * hydration process is expecting to be present.\n *\n * @param node The app's root HTML Element\n */\nfunction processTextNodeMarkersBeforeHydration(node) {\n const doc = getDocument();\n const commentNodesIterator = doc.createNodeIterator(node, NodeFilter.SHOW_COMMENT, {\n acceptNode(node) {\n const content = getTextNodeContent(node);\n const isTextNodeMarker = content === \"ngetn\" /* TextNodeMarker.EmptyNode */ || content === \"ngtns\" /* TextNodeMarker.Separator */;\n return isTextNodeMarker ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_REJECT;\n },\n });\n let currentNode;\n // We cannot modify the DOM while using the commentIterator,\n // because it throws off the iterator state.\n // So we collect all marker nodes first and then follow up with\n // applying the changes to the DOM: either inserting an empty node\n // or just removing the marker if it was used as a separator.\n const nodes = [];\n while ((currentNode = commentNodesIterator.nextNode())) {\n nodes.push(currentNode);\n }\n for (const node of nodes) {\n if (node.textContent === \"ngetn\" /* TextNodeMarker.EmptyNode */) {\n node.replaceWith(doc.createTextNode(''));\n }\n else {\n node.remove();\n }\n }\n}\n/**\n * Internal type that represents a claimed node.\n * Only used in dev mode.\n */\nvar HydrationStatus;\n(function (HydrationStatus) {\n HydrationStatus[\"Hydrated\"] = \"hydrated\";\n HydrationStatus[\"Skipped\"] = \"skipped\";\n HydrationStatus[\"Mismatched\"] = \"mismatched\";\n})(HydrationStatus || (HydrationStatus = {}));\nconst HYDRATION_INFO_KEY = '__ngDebugHydrationInfo__';\nfunction patchHydrationInfo(node, info) {\n node[HYDRATION_INFO_KEY] = info;\n}\nfunction readHydrationInfo(node) {\n return node[HYDRATION_INFO_KEY] ?? null;\n}\n/**\n * Marks a node as \"claimed\" by hydration process.\n * This is needed to make assessments in tests whether\n * the hydration process handled all nodes.\n */\nfunction markRNodeAsClaimedByHydration(node, checkIfAlreadyClaimed = true) {\n if (!ngDevMode) {\n throw new Error('Calling `markRNodeAsClaimedByHydration` in prod mode ' +\n 'is not supported and likely a mistake.');\n }\n if (checkIfAlreadyClaimed && isRNodeClaimedForHydration(node)) {\n throw new Error('Trying to claim a node, which was claimed already.');\n }\n patchHydrationInfo(node, { status: HydrationStatus.Hydrated });\n ngDevMode.hydratedNodes++;\n}\nfunction markRNodeAsSkippedByHydration(node) {\n if (!ngDevMode) {\n throw new Error('Calling `markRNodeAsSkippedByHydration` in prod mode ' +\n 'is not supported and likely a mistake.');\n }\n patchHydrationInfo(node, { status: HydrationStatus.Skipped });\n ngDevMode.componentsSkippedHydration++;\n}\nfunction countBlocksSkippedByHydration(injector) {\n const transferState = injector.get(TransferState);\n const nghDeferData = transferState.get(NGH_DEFER_BLOCKS_KEY, {});\n if (ngDevMode) {\n ngDevMode.deferBlocksWithIncrementalHydration = Object.keys(nghDeferData).length;\n }\n}\nfunction markRNodeAsHavingHydrationMismatch(node, expectedNodeDetails = null, actualNodeDetails = null) {\n if (!ngDevMode) {\n throw new Error('Calling `markRNodeAsMismatchedByHydration` in prod mode ' +\n 'is not supported and likely a mistake.');\n }\n // The RNode can be a standard HTMLElement (not an Angular component or directive)\n // The devtools component tree only displays Angular components & directives\n // Therefore we attach the debug info to the closest component/directive\n while (node && !getComponent(node)) {\n node = node?.parentNode;\n }\n if (node) {\n patchHydrationInfo(node, {\n status: HydrationStatus.Mismatched,\n expectedNodeDetails,\n actualNodeDetails,\n });\n }\n}\nfunction isRNodeClaimedForHydration(node) {\n return readHydrationInfo(node)?.status === HydrationStatus.Hydrated;\n}\nfunction setSegmentHead(hydrationInfo, index, node) {\n hydrationInfo.segmentHeads ??= {};\n hydrationInfo.segmentHeads[index] = node;\n}\nfunction getSegmentHead(hydrationInfo, index) {\n return hydrationInfo.segmentHeads?.[index] ?? null;\n}\nfunction isIncrementalHydrationEnabled(injector) {\n return injector.get(IS_INCREMENTAL_HYDRATION_ENABLED, false, {\n optional: true,\n });\n}\n/** Throws an error if the incremental hydration is not enabled */\nfunction assertIncrementalHydrationIsConfigured(injector) {\n if (!isIncrementalHydrationEnabled(injector)) {\n throw new RuntimeError(508 /* RuntimeErrorCode.MISCONFIGURED_INCREMENTAL_HYDRATION */, 'Angular has detected that some `@defer` blocks use `hydrate` triggers, ' +\n 'but incremental hydration was not enabled. Please ensure that the `withIncrementalHydration()` ' +\n 'call is added as an argument for the `provideClientHydration()` function call ' +\n 'in your application config.');\n }\n}\n/** Throws an error if the ssrUniqueId on the LDeferBlockDetails is not present */\nfunction assertSsrIdDefined(ssrUniqueId) {\n assertDefined(ssrUniqueId, 'Internal error: expecting an SSR id for a defer block that should be hydrated, but the id is not present');\n}\n/**\n * Returns the size of an <ng-container>, using either the information\n * serialized in `ELEMENT_CONTAINERS` (element container size) or by\n * computing the sum of root nodes in all dehydrated views in a given\n * container (in case this `<ng-container>` was also used as a view\n * container host node, e.g. <ng-container *ngIf>).\n */\nfunction getNgContainerSize(hydrationInfo, index) {\n const data = hydrationInfo.data;\n let size = data[ELEMENT_CONTAINERS]?.[index] ?? null;\n // If there is no serialized information available in the `ELEMENT_CONTAINERS` slot,\n // check if we have info about view containers at this location (e.g.\n // `<ng-container *ngIf>`) and use container size as a number of root nodes in this\n // element container.\n if (size === null && data[CONTAINERS]?.[index]) {\n size = calcSerializedContainerSize(hydrationInfo, index);\n }\n return size;\n}\nfunction isSerializedElementContainer(hydrationInfo, index) {\n return hydrationInfo.data[ELEMENT_CONTAINERS]?.[index] !== undefined;\n}\nfunction getSerializedContainerViews(hydrationInfo, index) {\n return hydrationInfo.data[CONTAINERS]?.[index] ?? null;\n}\n/**\n * Computes the size of a serialized container (the number of root nodes)\n * by calculating the sum of root nodes in all dehydrated views in this container.\n */\nfunction calcSerializedContainerSize(hydrationInfo, index) {\n const views = getSerializedContainerViews(hydrationInfo, index) ?? [];\n let numNodes = 0;\n for (let view of views) {\n numNodes += view[NUM_ROOT_NODES] * (view[MULTIPLIER] ?? 1);\n }\n return numNodes;\n}\n/**\n * Attempt to initialize the `disconnectedNodes` field of the given\n * `DehydratedView`. Returns the initialized value.\n */\nfunction initDisconnectedNodes(hydrationInfo) {\n // Check if we are processing disconnected info for the first time.\n if (typeof hydrationInfo.disconnectedNodes === 'undefined') {\n const nodeIds = hydrationInfo.data[DISCONNECTED_NODES];\n hydrationInfo.disconnectedNodes = nodeIds ? new Set(nodeIds) : null;\n }\n return hydrationInfo.disconnectedNodes;\n}\n/**\n * Checks whether a node is annotated as \"disconnected\", i.e. not present\n * in the DOM at serialization time. We should not attempt hydration for\n * such nodes and instead, use a regular \"creation mode\".\n */\nfunction isDisconnectedNode$1(hydrationInfo, index) {\n // Check if we are processing disconnected info for the first time.\n if (typeof hydrationInfo.disconnectedNodes === 'undefined') {\n const nodeIds = hydrationInfo.data[DISCONNECTED_NODES];\n hydrationInfo.disconnectedNodes = nodeIds ? new Set(nodeIds) : null;\n }\n return !!initDisconnectedNodes(hydrationInfo)?.has(index);\n}\n/**\n * Checks whether a node can be hydrated.\n * @param lView View in which the node instance is placed.\n * @param tNode Node to be checked.\n */\nfunction canHydrateNode(lView, tNode) {\n const hydrationInfo = lView[HYDRATION];\n return (hydrationInfo !== null &&\n !isInSkipHydrationBlock$1() &&\n !isDetachedByI18n(tNode) &&\n !isDisconnectedNode$1(hydrationInfo, tNode.index - HEADER_OFFSET));\n}\n/**\n * Helper function to prepare text nodes for serialization by ensuring\n * that seperate logical text blocks in the DOM remain separate after\n * serialization.\n */\nfunction processTextNodeBeforeSerialization(context, node) {\n // Handle cases where text nodes can be lost after DOM serialization:\n // 1. When there is an *empty text node* in DOM: in this case, this\n // node would not make it into the serialized string and as a result,\n // this node wouldn't be created in a browser. This would result in\n // a mismatch during the hydration, where the runtime logic would expect\n // a text node to be present in live DOM, but no text node would exist.\n // Example: `<span>{{ name }}</span>` when the `name` is an empty string.\n // This would result in `<span></span>` string after serialization and\n // in a browser only the `span` element would be created. To resolve that,\n // an extra comment node is appended in place of an empty text node and\n // that special comment node is replaced with an empty text node *before*\n // hydration.\n // 2. When there are 2 consecutive text nodes present in the DOM.\n // Example: `<div>Hello <ng-container *ngIf=\"true\">world</ng-container></div>`.\n // In this scenario, the live DOM would look like this:\n // <div>#text('Hello ') #text('world') #comment('container')</div>\n // Serialized string would look like this: `<div>Hello world<!--container--></div>`.\n // The live DOM in a browser after that would be:\n // <div>#text('Hello world') #comment('container')</div>\n // Notice how 2 text nodes are now \"merged\" into one. This would cause hydration\n // logic to fail, since it'd expect 2 text nodes being present, not one.\n // To fix this, we insert a special comment node in between those text nodes, so\n // serialized representation is: `<div>Hello <!--ngtns-->world<!--container--></div>`.\n // This forces browser to create 2 text nodes separated by a comment node.\n // Before running a hydration process, this special comment node is removed, so the\n // live DOM has exactly the same state as it was before serialization.\n // Collect this node as required special annotation only when its\n // contents is empty. Otherwise, such text node would be present on\n // the client after server-side rendering and no special handling needed.\n const el = node;\n const corruptedTextNodes = context.corruptedTextNodes;\n if (el.textContent === '') {\n corruptedTextNodes.set(el, \"ngetn\" /* TextNodeMarker.EmptyNode */);\n }\n else if (el.nextSibling?.nodeType === Node.TEXT_NODE) {\n corruptedTextNodes.set(el, \"ngtns\" /* TextNodeMarker.Separator */);\n }\n}\nfunction convertHydrateTriggersToJsAction(triggers) {\n let actionList = [];\n if (triggers !== null) {\n if (triggers.has(4 /* DeferBlockTrigger.Hover */)) {\n actionList.push(...hoverEventNames);\n }\n if (triggers.has(3 /* DeferBlockTrigger.Interaction */)) {\n actionList.push(...interactionEventNames);\n }\n }\n return actionList;\n}\n/**\n * Builds a queue of blocks that need to be hydrated, looking up the\n * tree to the topmost defer block that exists in the tree that hasn't\n * been hydrated, but exists in the registry. This queue is in top down\n * hierarchical order as a list of defer block ids.\n * Note: This is utilizing serialized information to navigate up the tree\n */\nfunction getParentBlockHydrationQueue(deferBlockId, injector) {\n const dehydratedBlockRegistry = injector.get(DEHYDRATED_BLOCK_REGISTRY);\n const transferState = injector.get(TransferState);\n const deferBlockParents = transferState.get(NGH_DEFER_BLOCKS_KEY, {});\n let isTopMostDeferBlock = false;\n let currentBlockId = deferBlockId;\n let parentBlockPromise = null;\n const hydrationQueue = [];\n while (!isTopMostDeferBlock && currentBlockId) {\n ngDevMode &&\n assertEqual(hydrationQueue.indexOf(currentBlockId), -1, 'Internal error: defer block hierarchy has a cycle.');\n isTopMostDeferBlock = dehydratedBlockRegistry.has(currentBlockId);\n const hydratingParentBlock = dehydratedBlockRegistry.hydrating.get(currentBlockId);\n if (parentBlockPromise === null && hydratingParentBlock != null) {\n parentBlockPromise = hydratingParentBlock.promise;\n break;\n }\n hydrationQueue.unshift(currentBlockId);\n currentBlockId = deferBlockParents[currentBlockId][DEFER_PARENT_BLOCK_ID];\n }\n return { parentBlockPromise, hydrationQueue };\n}\nfunction gatherDeferBlocksByJSActionAttribute(doc) {\n const jsactionNodes = doc.body.querySelectorAll('[jsaction]');\n const blockMap = new Set();\n const eventTypes = [hoverEventNames.join(':;'), interactionEventNames.join(':;')].join('|');\n for (let node of jsactionNodes) {\n const attr = node.getAttribute('jsaction');\n const blockId = node.getAttribute('ngb');\n if (attr?.match(eventTypes) && blockId !== null) {\n blockMap.add(node);\n }\n }\n return blockMap;\n}\nfunction appendDeferBlocksToJSActionMap(doc, injector) {\n const blockMap = gatherDeferBlocksByJSActionAttribute(doc);\n const jsActionMap = injector.get(JSACTION_BLOCK_ELEMENT_MAP);\n for (let rNode of blockMap) {\n sharedMapFunction(rNode, jsActionMap);\n }\n}\n/**\n * Retrieves defer block hydration information from the TransferState.\n *\n * @param injector Injector that this component has access to.\n */\nlet _retrieveDeferBlockDataImpl = () => {\n return {};\n};\nfunction retrieveDeferBlockDataImpl(injector) {\n const transferState = injector.get(TransferState, null, { optional: true });\n if (transferState !== null) {\n const nghDeferData = transferState.get(NGH_DEFER_BLOCKS_KEY, {});\n ngDevMode &&\n assertDefined(nghDeferData, 'Unable to retrieve defer block info from the TransferState.');\n return nghDeferData;\n }\n return {};\n}\n/**\n * Sets the implementation for the `retrieveDeferBlockData` function.\n */\nfunction enableRetrieveDeferBlockDataImpl() {\n _retrieveDeferBlockDataImpl = retrieveDeferBlockDataImpl;\n}\n/**\n * Retrieves defer block data from TransferState storage\n */\nfunction retrieveDeferBlockData(injector) {\n return _retrieveDeferBlockDataImpl(injector);\n}\nfunction isTimerTrigger(triggerInfo) {\n return typeof triggerInfo === 'object' && triggerInfo.trigger === 5 /* DeferBlockTrigger.Timer */;\n}\nfunction getHydrateTimerTrigger(blockData) {\n const trigger = blockData[DEFER_HYDRATE_TRIGGERS]?.find((t) => isTimerTrigger(t));\n return trigger?.delay ?? null;\n}\nfunction hasHydrateTrigger(blockData, trigger) {\n return blockData[DEFER_HYDRATE_TRIGGERS]?.includes(trigger) ?? false;\n}\n/**\n * Creates a summary of the given serialized defer block, which is used later to properly initialize\n * specific triggers.\n */\nfunction createBlockSummary(blockInfo) {\n return {\n data: blockInfo,\n hydrate: {\n idle: hasHydrateTrigger(blockInfo, 0 /* DeferBlockTrigger.Idle */),\n immediate: hasHydrateTrigger(blockInfo, 1 /* DeferBlockTrigger.Immediate */),\n timer: getHydrateTimerTrigger(blockInfo),\n viewport: hasHydrateTrigger(blockInfo, 2 /* DeferBlockTrigger.Viewport */),\n },\n };\n}\n/**\n * Processes all of the defer block data in the transfer state and creates a map of the summaries\n */\nfunction processBlockData(injector) {\n const blockData = retrieveDeferBlockData(injector);\n let blockDetails = new Map();\n for (let blockId in blockData) {\n blockDetails.set(blockId, createBlockSummary(blockData[blockId]));\n }\n return blockDetails;\n}\nfunction isSsrContentsIntegrity(node) {\n return (!!node &&\n node.nodeType === Node.COMMENT_NODE &&\n node.textContent?.trim() === SSR_CONTENT_INTEGRITY_MARKER);\n}\nfunction skipTextNodes(node) {\n // Ignore whitespace. Before the <body>, we shouldn't find text nodes that aren't whitespace.\n while (node && node.nodeType === Node.TEXT_NODE) {\n node = node.previousSibling;\n }\n return node;\n}\n/**\n * Verifies whether the DOM contains a special marker added during SSR time to make sure\n * there is no SSR'ed contents transformations happen after SSR is completed. Typically that\n * happens either by CDN or during the build process as an optimization to remove comment nodes.\n * Hydration process requires comment nodes produced by Angular to locate correct DOM segments.\n * When this special marker is *not* present - throw an error and do not proceed with hydration,\n * since it will not be able to function correctly.\n *\n * Note: this function is invoked only on the client, so it's safe to use DOM APIs.\n */\nfunction verifySsrContentsIntegrity(doc) {\n for (const node of doc.body.childNodes) {\n if (isSsrContentsIntegrity(node)) {\n return;\n }\n }\n // Check if the HTML parser may have moved the marker to just before the <body> tag,\n // e.g. because the body tag was implicit and not present in the markup. An implicit body\n // tag is unlikely to interfer with whitespace/comments inside of the app's root element.\n // Case 1: Implicit body. Example:\n // <!doctype html><head><title>Hi</title></head><!--nghm--><app-root></app-root>\n const beforeBody = skipTextNodes(doc.body.previousSibling);\n if (isSsrContentsIntegrity(beforeBody)) {\n return;\n }\n // Case 2: Implicit body & head. Example:\n // <!doctype html><head><title>Hi</title><!--nghm--><app-root></app-root>\n let endOfHead = skipTextNodes(doc.head.lastChild);\n if (isSsrContentsIntegrity(endOfHead)) {\n return;\n }\n throw new RuntimeError(-507 /* RuntimeErrorCode.MISSING_SSR_CONTENT_INTEGRITY_MARKER */, typeof ngDevMode !== 'undefined' &&\n ngDevMode &&\n 'Angular hydration logic detected that HTML content of this page was modified after it ' +\n 'was produced during server side rendering. Make sure that there are no optimizations ' +\n 'that remove comment nodes from HTML enabled on your CDN. Angular hydration ' +\n 'relies on HTML produced by the server, including whitespaces and comment nodes.');\n}\n\n/** Refreshes all content queries declared by directives in a given view */\nfunction refreshContentQueries(tView, lView) {\n const contentQueries = tView.contentQueries;\n if (contentQueries !== null) {\n const prevConsumer = setActiveConsumer(null);\n try {\n for (let i = 0; i < contentQueries.length; i += 2) {\n const queryStartIdx = contentQueries[i];\n const directiveDefIdx = contentQueries[i + 1];\n if (directiveDefIdx !== -1) {\n const directiveDef = tView.data[directiveDefIdx];\n ngDevMode && assertDefined(directiveDef, 'DirectiveDef not found.');\n ngDevMode &&\n assertDefined(directiveDef.contentQueries, 'contentQueries function should be defined');\n setCurrentQueryIndex(queryStartIdx);\n directiveDef.contentQueries(2 /* RenderFlags.Update */, lView[directiveDefIdx], directiveDefIdx);\n }\n }\n }\n finally {\n setActiveConsumer(prevConsumer);\n }\n }\n}\nfunction executeViewQueryFn(flags, viewQueryFn, component) {\n ngDevMode && assertDefined(viewQueryFn, 'View queries function to execute must be defined.');\n setCurrentQueryIndex(0);\n const prevConsumer = setActiveConsumer(null);\n try {\n viewQueryFn(flags, component);\n }\n finally {\n setActiveConsumer(prevConsumer);\n }\n}\nfunction executeContentQueries(tView, tNode, lView) {\n if (isContentQueryHost(tNode)) {\n const prevConsumer = setActiveConsumer(null);\n try {\n const start = tNode.directiveStart;\n const end = tNode.directiveEnd;\n for (let directiveIndex = start; directiveIndex < end; directiveIndex++) {\n const def = tView.data[directiveIndex];\n if (def.contentQueries) {\n const directiveInstance = lView[directiveIndex];\n ngDevMode &&\n assertDefined(directiveIndex, 'Incorrect reference to a directive defining a content query');\n def.contentQueries(1 /* RenderFlags.Create */, directiveInstance, directiveIndex);\n }\n }\n }\n finally {\n setActiveConsumer(prevConsumer);\n }\n }\n}\n\n/**\n * Defines the CSS styles encapsulation policies for the {@link /api/core/Component Component} decorator's\n * `encapsulation` option.\n *\n * See {@link Component#encapsulation encapsulation}.\n *\n * @usageNotes\n * ### Example\n *\n * {@example core/ts/metadata/encapsulation.ts region='longform'}\n *\n * @publicApi\n */\nvar ViewEncapsulation;\n(function (ViewEncapsulation) {\n // TODO: consider making `ViewEncapsulation` a `const enum` instead. See\n // https://github.com/angular/angular/issues/44119 for additional information.\n /**\n * Emulates a native Shadow DOM encapsulation behavior by adding a specific attribute to the\n * component's host element and applying the same attribute to all the CSS selectors provided\n * via {@link Component#styles styles} or {@link Component#styleUrls styleUrls}.\n *\n * This is the default option.\n */\n ViewEncapsulation[ViewEncapsulation[\"Emulated\"] = 0] = \"Emulated\";\n // Historically the 1 value was for `Native` encapsulation which has been removed as of v11.\n /**\n * Doesn't provide any sort of CSS style encapsulation, meaning that all the styles provided\n * via {@link Component#styles styles} or {@link Component#styleUrls styleUrls} are applicable\n * to any HTML element of the application regardless of their host Component.\n */\n ViewEncapsulation[ViewEncapsulation[\"None\"] = 2] = \"None\";\n /**\n * Uses the browser's native Shadow DOM API to encapsulate CSS styles, meaning that it creates\n * a ShadowRoot for the component's host element which is then used to encapsulate\n * all the Component's styling.\n */\n ViewEncapsulation[ViewEncapsulation[\"ShadowDom\"] = 3] = \"ShadowDom\";\n})(ViewEncapsulation || (ViewEncapsulation = {}));\n\n/**\n * @fileoverview\n * A module to facilitate use of a Trusted Types policy internally within\n * Angular. It lazily constructs the Trusted Types policy, providing helper\n * utilities for promoting strings to Trusted Types. When Trusted Types are not\n * 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/**\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$1;\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$1() {\n if (policy$1 === undefined) {\n policy$1 = null;\n if (_global.trustedTypes) {\n try {\n policy$1 = _global.trustedTypes.createPolicy('angular', {\n createHTML: (s) => s,\n createScript: (s) => s,\n createScriptURL: (s) => s,\n });\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$1;\n}\n/**\n * Unsafely promote a string to a TrustedHTML, falling back to strings when\n * 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, it must be assured that the\n * provided string will never cause an XSS vulnerability if used in a context\n * that will be interpreted as HTML by a browser, e.g. when assigning to\n * element.innerHTML.\n */\nfunction trustedHTMLFromString(html) {\n return getPolicy$1()?.createHTML(html) || html;\n}\n/**\n * Unsafely promote a string to a TrustedScriptURL, falling back to strings\n * 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, it must be assured that the\n * provided string will never cause an XSS vulnerability if used in a context\n * that will cause a browser to load and execute a resource, e.g. when\n * assigning to script.src.\n */\nfunction trustedScriptURLFromString(url) {\n return getPolicy$1()?.createScriptURL(url) || url;\n}\n\n/**\n * @fileoverview\n * A module to facilitate use of a Trusted Types policy internally within\n * Angular specifically for bypassSecurityTrust* and custom sanitizers. It\n * lazily constructs the Trusted Types policy, providing helper utilities for\n * promoting strings to Trusted Types. When Trusted Types are not available,\n * 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/**\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;\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() {\n if (policy === undefined) {\n policy = null;\n if (_global.trustedTypes) {\n try {\n policy = _global.trustedTypes.createPolicy('angular#unsafe-bypass', {\n createHTML: (s) => s,\n createScript: (s) => s,\n createScriptURL: (s) => s,\n });\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 * Unsafely promote a string to a TrustedHTML, falling back to strings when\n * 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, it must be assured that it\n * is only passed strings that come directly from custom sanitizers or the\n * bypassSecurityTrust* functions.\n */\nfunction trustedHTMLFromStringBypass(html) {\n return getPolicy()?.createHTML(html) || html;\n}\n/**\n * Unsafely promote a string to a TrustedScript, falling back to strings when\n * 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, it must be assured that it\n * is only passed strings that come directly from custom sanitizers or the\n * bypassSecurityTrust* functions.\n */\nfunction trustedScriptFromStringBypass(script) {\n return getPolicy()?.createScript(script) || script;\n}\n/**\n * Unsafely promote a string to a TrustedScriptURL, falling back to strings\n * 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, it must be assured that it\n * is only passed strings that come directly from custom sanitizers or the\n * bypassSecurityTrust* functions.\n */\nfunction trustedScriptURLFromStringBypass(url) {\n return getPolicy()?.createScriptURL(url) || url;\n}\n\nclass SafeValueImpl {\n changingThisBreaksApplicationSecurity;\n constructor(changingThisBreaksApplicationSecurity) {\n this.changingThisBreaksApplicationSecurity = changingThisBreaksApplicationSecurity;\n }\n toString() {\n return (`SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity}` +\n ` (see ${XSS_SECURITY_URL})`);\n }\n}\nclass SafeHtmlImpl extends SafeValueImpl {\n getTypeName() {\n return \"HTML\" /* BypassType.Html */;\n }\n}\nclass SafeStyleImpl extends SafeValueImpl {\n getTypeName() {\n return \"Style\" /* BypassType.Style */;\n }\n}\nclass SafeScriptImpl extends SafeValueImpl {\n getTypeName() {\n return \"Script\" /* BypassType.Script */;\n }\n}\nclass SafeUrlImpl extends SafeValueImpl {\n getTypeName() {\n return \"URL\" /* BypassType.Url */;\n }\n}\nclass SafeResourceUrlImpl extends SafeValueImpl {\n getTypeName() {\n return \"ResourceURL\" /* BypassType.ResourceUrl */;\n }\n}\nfunction unwrapSafeValue(value) {\n return value instanceof SafeValueImpl\n ? value.changingThisBreaksApplicationSecurity\n : value;\n}\nfunction allowSanitizationBypassAndThrow(value, type) {\n const actualType = getSanitizationBypassType(value);\n if (actualType != null && actualType !== type) {\n // Allow ResourceURLs in URL contexts, they are strictly more trusted.\n if (actualType === \"ResourceURL\" /* BypassType.ResourceUrl */ && type === \"URL\" /* BypassType.Url */)\n return true;\n throw new Error(`Required a safe ${type}, got a ${actualType} (see ${XSS_SECURITY_URL})`);\n }\n return actualType === type;\n}\nfunction getSanitizationBypassType(value) {\n return (value instanceof SafeValueImpl && value.getTypeName()) || null;\n}\n/**\n * Mark `html` string as trusted.\n *\n * This function wraps the trusted string in `String` and brands it in a way which makes it\n * recognizable to {@link htmlSanitizer} to be trusted implicitly.\n *\n * @param trustedHtml `html` string which needs to be implicitly trusted.\n * @returns a `html` which has been branded to be implicitly trusted.\n */\nfunction bypassSanitizationTrustHtml(trustedHtml) {\n return new SafeHtmlImpl(trustedHtml);\n}\n/**\n * Mark `style` string as trusted.\n *\n * This function wraps the trusted string in `String` and brands it in a way which makes it\n * recognizable to {@link styleSanitizer} to be trusted implicitly.\n *\n * @param trustedStyle `style` string which needs to be implicitly trusted.\n * @returns a `style` hich has been branded to be implicitly trusted.\n */\nfunction bypassSanitizationTrustStyle(trustedStyle) {\n return new SafeStyleImpl(trustedStyle);\n}\n/**\n * Mark `script` string as trusted.\n *\n * This function wraps the trusted string in `String` and brands it in a way which makes it\n * recognizable to {@link scriptSanitizer} to be trusted implicitly.\n *\n * @param trustedScript `script` string which needs to be implicitly trusted.\n * @returns a `script` which has been branded to be implicitly trusted.\n */\nfunction bypassSanitizationTrustScript(trustedScript) {\n return new SafeScriptImpl(trustedScript);\n}\n/**\n * Mark `url` string as trusted.\n *\n * This function wraps the trusted string in `String` and brands it in a way which makes it\n * recognizable to {@link urlSanitizer} to be trusted implicitly.\n *\n * @param trustedUrl `url` string which needs to be implicitly trusted.\n * @returns a `url` which has been branded to be implicitly trusted.\n */\nfunction bypassSanitizationTrustUrl(trustedUrl) {\n return new SafeUrlImpl(trustedUrl);\n}\n/**\n * Mark `url` string as trusted.\n *\n * This function wraps the trusted string in `String` and brands it in a way which makes it\n * recognizable to {@link resourceUrlSanitizer} to be trusted implicitly.\n *\n * @param trustedResourceUrl `url` string which needs to be implicitly trusted.\n * @returns a `url` which has been branded to be implicitly trusted.\n */\nfunction bypassSanitizationTrustResourceUrl(trustedResourceUrl) {\n return new SafeResourceUrlImpl(trustedResourceUrl);\n}\n\n/**\n * This helper is used to get hold of an inert tree of DOM elements containing dirty HTML\n * that needs sanitizing.\n * Depending upon browser support we use one of two strategies for doing this.\n * Default: DOMParser strategy\n * Fallback: InertDocument strategy\n */\nfunction getInertBodyHelper(defaultDoc) {\n const inertDocumentHelper = new InertDocumentHelper(defaultDoc);\n return isDOMParserAvailable() ? new DOMParserHelper(inertDocumentHelper) : inertDocumentHelper;\n}\n/**\n * Uses DOMParser to create and fill an inert body element.\n * This is the default strategy used in browsers that support it.\n */\nclass DOMParserHelper {\n inertDocumentHelper;\n constructor(inertDocumentHelper) {\n this.inertDocumentHelper = inertDocumentHelper;\n }\n getInertBodyElement(html) {\n // We add these extra elements to ensure that the rest of the content is parsed as expected\n // e.g. leading whitespace is maintained and tags like `<meta>` do not get hoisted to the\n // `<head>` tag. Note that the `<body>` tag is closed implicitly to prevent unclosed tags\n // in `html` from consuming the otherwise explicit `</body>` tag.\n html = '<body><remove></remove>' + html;\n try {\n const body = new window.DOMParser().parseFromString(trustedHTMLFromString(html), 'text/html').body;\n if (body === null) {\n // In some browsers (e.g. Mozilla/5.0 iPad AppleWebKit Mobile) the `body` property only\n // becomes available in the following tick of the JS engine. In that case we fall back to\n // the `inertDocumentHelper` instead.\n return this.inertDocumentHelper.getInertBodyElement(html);\n }\n body.firstChild?.remove();\n return body;\n }\n catch {\n return null;\n }\n }\n}\n/**\n * Use an HTML5 `template` element to create and fill an inert DOM element.\n * This is the fallback strategy if the browser does not support DOMParser.\n */\nclass InertDocumentHelper {\n defaultDoc;\n inertDocument;\n constructor(defaultDoc) {\n this.defaultDoc = defaultDoc;\n this.inertDocument = this.defaultDoc.implementation.createHTMLDocument('sanitization-inert');\n }\n getInertBodyElement(html) {\n const templateEl = this.inertDocument.createElement('template');\n templateEl.innerHTML = trustedHTMLFromString(html);\n return templateEl;\n }\n}\n/**\n * We need to determine whether the DOMParser exists in the global context and\n * supports parsing HTML; HTML parsing support is not as wide as other formats, see\n * https://developer.mozilla.org/en-US/docs/Web/API/DOMParser#Browser_compatibility.\n *\n * @suppress {uselessCode}\n */\nfunction isDOMParserAvailable() {\n try {\n return !!new window.DOMParser().parseFromString(trustedHTMLFromString(''), 'text/html');\n }\n catch {\n return false;\n }\n}\n\n/**\n * A pattern that recognizes URLs that are safe wrt. XSS in URL navigation\n * contexts.\n *\n * This regular expression matches a subset of URLs that will not cause script\n * execution if used in URL context within a HTML document. Specifically, this\n * regular expression matches if:\n * (1) Either a protocol that is not javascript:, and that has valid characters\n * (alphanumeric or [+-.]).\n * (2) or no protocol. A protocol must be followed by a colon. The below\n * allows that by allowing colons only after one of the characters [/?#].\n * A colon after a hash (#) must be in the fragment.\n * Otherwise, a colon after a (?) must be in a query.\n * Otherwise, a colon after a single solidus (/) must be in a path.\n * Otherwise, a colon after a double solidus (//) must be in the authority\n * (before port).\n *\n * The pattern disallows &, used in HTML entity declarations before\n * one of the characters in [/?#]. This disallows HTML entities used in the\n * protocol name, which should never happen, e.g. \"h&#116;tp\" for \"http\".\n * It also disallows HTML entities in the first path part of a relative path,\n * e.g. \"foo&lt;bar/baz\". Our existing escaping functions should not produce\n * that. More importantly, it disallows masking of a colon,\n * e.g. \"javascript&#58;...\".\n *\n * This regular expression was taken from the Closure sanitization library.\n */\nconst SAFE_URL_PATTERN = /^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:\\/?#]*(?:[\\/?#]|$))/i;\nfunction _sanitizeUrl(url) {\n url = String(url);\n if (url.match(SAFE_URL_PATTERN))\n return url;\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n console.warn(`WARNING: sanitizing unsafe URL value ${url} (see ${XSS_SECURITY_URL})`);\n }\n return 'unsafe:' + url;\n}\n\nfunction tagSet(tags) {\n const res = {};\n for (const t of tags.split(','))\n res[t] = true;\n return res;\n}\nfunction merge(...sets) {\n const res = {};\n for (const s of sets) {\n for (const v in s) {\n if (s.hasOwnProperty(v))\n res[v] = true;\n }\n }\n return res;\n}\n// Good source of info about elements and attributes\n// https://html.spec.whatwg.org/#semantics\n// https://simon.html5.org/html-elements\n// Safe Void Elements - HTML5\n// https://html.spec.whatwg.org/#void-elements\nconst VOID_ELEMENTS = tagSet('area,br,col,hr,img,wbr');\n// Elements that you can, intentionally, leave open (and which close themselves)\n// https://html.spec.whatwg.org/#optional-tags\nconst OPTIONAL_END_TAG_BLOCK_ELEMENTS = tagSet('colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr');\nconst OPTIONAL_END_TAG_INLINE_ELEMENTS = tagSet('rp,rt');\nconst OPTIONAL_END_TAG_ELEMENTS = merge(OPTIONAL_END_TAG_INLINE_ELEMENTS, OPTIONAL_END_TAG_BLOCK_ELEMENTS);\n// Safe Block Elements - HTML5\nconst BLOCK_ELEMENTS = merge(OPTIONAL_END_TAG_BLOCK_ELEMENTS, tagSet('address,article,' +\n 'aside,blockquote,caption,center,del,details,dialog,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,' +\n 'h6,header,hgroup,hr,ins,main,map,menu,nav,ol,pre,section,summary,table,ul'));\n// Inline Elements - HTML5\nconst INLINE_ELEMENTS = merge(OPTIONAL_END_TAG_INLINE_ELEMENTS, tagSet('a,abbr,acronym,audio,b,' +\n 'bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,picture,q,ruby,rp,rt,s,' +\n 'samp,small,source,span,strike,strong,sub,sup,time,track,tt,u,var,video'));\nconst VALID_ELEMENTS = merge(VOID_ELEMENTS, BLOCK_ELEMENTS, INLINE_ELEMENTS, OPTIONAL_END_TAG_ELEMENTS);\n// Attributes that have href and hence need to be sanitized\nconst URI_ATTRS = tagSet('background,cite,href,itemtype,longdesc,poster,src,xlink:href');\nconst HTML_ATTRS = tagSet('abbr,accesskey,align,alt,autoplay,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,' +\n 'compact,controls,coords,datetime,default,dir,download,face,headers,height,hidden,hreflang,hspace,' +\n 'ismap,itemscope,itemprop,kind,label,lang,language,loop,media,muted,nohref,nowrap,open,preload,rel,rev,role,rows,rowspan,rules,' +\n 'scope,scrolling,shape,size,sizes,span,srclang,srcset,start,summary,tabindex,target,title,translate,type,usemap,' +\n 'valign,value,vspace,width');\n// Accessibility attributes as per WAI-ARIA 1.1 (W3C Working Draft 14 December 2018)\nconst ARIA_ATTRS = tagSet('aria-activedescendant,aria-atomic,aria-autocomplete,aria-busy,aria-checked,aria-colcount,aria-colindex,' +\n 'aria-colspan,aria-controls,aria-current,aria-describedby,aria-details,aria-disabled,aria-dropeffect,' +\n 'aria-errormessage,aria-expanded,aria-flowto,aria-grabbed,aria-haspopup,aria-hidden,aria-invalid,' +\n 'aria-keyshortcuts,aria-label,aria-labelledby,aria-level,aria-live,aria-modal,aria-multiline,' +\n 'aria-multiselectable,aria-orientation,aria-owns,aria-placeholder,aria-posinset,aria-pressed,aria-readonly,' +\n 'aria-relevant,aria-required,aria-roledescription,aria-rowcount,aria-rowindex,aria-rowspan,aria-selected,' +\n 'aria-setsize,aria-sort,aria-valuemax,aria-valuemin,aria-valuenow,aria-valuetext');\n// NB: This currently consciously doesn't support SVG. SVG sanitization has had several security\n// issues in the past, so it seems safer to leave it out if possible. If support for binding SVG via\n// innerHTML is required, SVG attributes should be added here.\n// NB: Sanitization does not allow <form> elements or other active elements (<button> etc). Those\n// can be sanitized, but they increase security surface area without a legitimate use case, so they\n// are left out here.\nconst VALID_ATTRS = merge(URI_ATTRS, HTML_ATTRS, ARIA_ATTRS);\n// Elements whose content should not be traversed/preserved, if the elements themselves are invalid.\n//\n// Typically, `<invalid>Some content</invalid>` would traverse (and in this case preserve)\n// `Some content`, but strip `invalid-element` opening/closing tags. For some elements, though, we\n// don't want to preserve the content, if the elements themselves are going to be removed.\nconst SKIP_TRAVERSING_CONTENT_IF_INVALID_ELEMENTS = tagSet('script,style,template');\n/**\n * SanitizingHtmlSerializer serializes a DOM fragment, stripping out any unsafe elements and unsafe\n * attributes.\n */\nclass SanitizingHtmlSerializer {\n // Explicitly track if something was stripped, to avoid accidentally warning of sanitization just\n // because characters were re-encoded.\n sanitizedSomething = false;\n buf = [];\n sanitizeChildren(el) {\n // This cannot use a TreeWalker, as it has to run on Angular's various DOM adapters.\n // However this code never accesses properties off of `document` before deleting its contents\n // again, so it shouldn't be vulnerable to DOM clobbering.\n let current = el.firstChild;\n let traverseContent = true;\n let parentNodes = [];\n while (current) {\n if (current.nodeType === Node.ELEMENT_NODE) {\n traverseContent = this.startElement(current);\n }\n else if (current.nodeType === Node.TEXT_NODE) {\n this.chars(current.nodeValue);\n }\n else {\n // Strip non-element, non-text nodes.\n this.sanitizedSomething = true;\n }\n if (traverseContent && current.firstChild) {\n // Push current node to the parent stack before entering its content.\n parentNodes.push(current);\n current = getFirstChild(current);\n continue;\n }\n while (current) {\n // Leaving the element.\n // Walk up and to the right, closing tags as we go.\n if (current.nodeType === Node.ELEMENT_NODE) {\n this.endElement(current);\n }\n let next = getNextSibling(current);\n if (next) {\n current = next;\n break;\n }\n // There was no next sibling, walk up to the parent node (extract it from the stack).\n current = parentNodes.pop();\n }\n }\n return this.buf.join('');\n }\n /**\n * Sanitizes an opening element tag (if valid) and returns whether the element's contents should\n * be traversed. Element content must always be traversed (even if the element itself is not\n * valid/safe), unless the element is one of `SKIP_TRAVERSING_CONTENT_IF_INVALID_ELEMENTS`.\n *\n * @param element The element to sanitize.\n * @return True if the element's contents should be traversed.\n */\n startElement(element) {\n const tagName = getNodeName(element).toLowerCase();\n if (!VALID_ELEMENTS.hasOwnProperty(tagName)) {\n this.sanitizedSomething = true;\n return !SKIP_TRAVERSING_CONTENT_IF_INVALID_ELEMENTS.hasOwnProperty(tagName);\n }\n this.buf.push('<');\n this.buf.push(tagName);\n const elAttrs = element.attributes;\n for (let i = 0; i < elAttrs.length; i++) {\n const elAttr = elAttrs.item(i);\n const attrName = elAttr.name;\n const lower = attrName.toLowerCase();\n if (!VALID_ATTRS.hasOwnProperty(lower)) {\n this.sanitizedSomething = true;\n continue;\n }\n let value = elAttr.value;\n // TODO(martinprobst): Special case image URIs for data:image/...\n if (URI_ATTRS[lower])\n value = _sanitizeUrl(value);\n this.buf.push(' ', attrName, '=\"', encodeEntities(value), '\"');\n }\n this.buf.push('>');\n return true;\n }\n endElement(current) {\n const tagName = getNodeName(current).toLowerCase();\n if (VALID_ELEMENTS.hasOwnProperty(tagName) && !VOID_ELEMENTS.hasOwnProperty(tagName)) {\n this.buf.push('</');\n this.buf.push(tagName);\n this.buf.push('>');\n }\n }\n chars(chars) {\n this.buf.push(encodeEntities(chars));\n }\n}\n/**\n * Verifies whether a given child node is a descendant of a given parent node.\n * It may not be the case when properties like `.firstChild` are clobbered and\n * accessing `.firstChild` results in an unexpected node returned.\n */\nfunction isClobberedElement(parentNode, childNode) {\n return ((parentNode.compareDocumentPosition(childNode) & Node.DOCUMENT_POSITION_CONTAINED_BY) !==\n Node.DOCUMENT_POSITION_CONTAINED_BY);\n}\n/**\n * Retrieves next sibling node and makes sure that there is no\n * clobbering of the `nextSibling` property happening.\n */\nfunction getNextSibling(node) {\n const nextSibling = node.nextSibling;\n // Make sure there is no `nextSibling` clobbering: navigating to\n // the next sibling and going back to the previous one should result\n // in the original node.\n if (nextSibling && node !== nextSibling.previousSibling) {\n throw clobberedElementError(nextSibling);\n }\n return nextSibling;\n}\n/**\n * Retrieves first child node and makes sure that there is no\n * clobbering of the `firstChild` property happening.\n */\nfunction getFirstChild(node) {\n const firstChild = node.firstChild;\n if (firstChild && isClobberedElement(node, firstChild)) {\n throw clobberedElementError(firstChild);\n }\n return firstChild;\n}\n/** Gets a reasonable nodeName, even for clobbered nodes. */\nfunction getNodeName(node) {\n const nodeName = node.nodeName;\n // If the property is clobbered, assume it is an `HTMLFormElement`.\n return typeof nodeName === 'string' ? nodeName : 'FORM';\n}\nfunction clobberedElementError(node) {\n return new Error(`Failed to sanitize html because the element is clobbered: ${node.outerHTML}`);\n}\n// Regular Expressions for parsing tags and attributes\nconst SURROGATE_PAIR_REGEXP = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g;\n// ! to ~ is the ASCII range.\nconst NON_ALPHANUMERIC_REGEXP = /([^\\#-~ |!])/g;\n/**\n * Escapes all potentially dangerous characters, so that the\n * resulting string can be safely inserted into attribute or\n * element text.\n * @param value\n */\nfunction encodeEntities(value) {\n return value\n .replace(/&/g, '&amp;')\n .replace(SURROGATE_PAIR_REGEXP, function (match) {\n const hi = match.charCodeAt(0);\n const low = match.charCodeAt(1);\n return '&#' + ((hi - 0xd800) * 0x400 + (low - 0xdc00) + 0x10000) + ';';\n })\n .replace(NON_ALPHANUMERIC_REGEXP, function (match) {\n return '&#' + match.charCodeAt(0) + ';';\n })\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;');\n}\nlet inertBodyHelper;\n/**\n * Sanitizes the given unsafe, untrusted HTML fragment, and returns HTML text that is safe to add to\n * the DOM in a browser environment.\n */\nfunction _sanitizeHtml(defaultDoc, unsafeHtmlInput) {\n let inertBodyElement = null;\n try {\n inertBodyHelper = inertBodyHelper || getInertBodyHelper(defaultDoc);\n // Make sure unsafeHtml is actually a string (TypeScript types are not enforced at runtime).\n let unsafeHtml = unsafeHtmlInput ? String(unsafeHtmlInput) : '';\n inertBodyElement = inertBodyHelper.getInertBodyElement(unsafeHtml);\n // mXSS protection. Repeatedly parse the document to make sure it stabilizes, so that a browser\n // trying to auto-correct incorrect HTML cannot cause formerly inert HTML to become dangerous.\n let mXSSAttempts = 5;\n let parsedHtml = unsafeHtml;\n do {\n if (mXSSAttempts === 0) {\n throw new Error('Failed to sanitize html because the input is unstable');\n }\n mXSSAttempts--;\n unsafeHtml = parsedHtml;\n parsedHtml = inertBodyElement.innerHTML;\n inertBodyElement = inertBodyHelper.getInertBodyElement(unsafeHtml);\n } while (unsafeHtml !== parsedHtml);\n const sanitizer = new SanitizingHtmlSerializer();\n const safeHtml = sanitizer.sanitizeChildren(getTemplateContent(inertBodyElement) || inertBodyElement);\n if ((typeof ngDevMode === 'undefined' || ngDevMode) && sanitizer.sanitizedSomething) {\n console.warn(`WARNING: sanitizing HTML stripped some content, see ${XSS_SECURITY_URL}`);\n }\n return trustedHTMLFromString(safeHtml);\n }\n finally {\n // In case anything goes wrong, clear out inertElement to reset the entire DOM structure.\n if (inertBodyElement) {\n const parent = getTemplateContent(inertBodyElement) || inertBodyElement;\n while (parent.firstChild) {\n parent.firstChild.remove();\n }\n }\n }\n}\nfunction getTemplateContent(el) {\n return 'content' in el /** Microsoft/TypeScript#21517 */ && isTemplateElement(el)\n ? el.content\n : null;\n}\nfunction isTemplateElement(el) {\n return el.nodeType === Node.ELEMENT_NODE && el.nodeName === 'TEMPLATE';\n}\n\n/**\n * A SecurityContext marks a location that has dangerous security implications, e.g. a DOM property\n * like `innerHTML` that could cause Cross Site Scripting (XSS) security bugs when improperly\n * handled.\n *\n * See DomSanitizer for more details on security in Angular applications.\n *\n * @publicApi\n */\nvar SecurityContext;\n(function (SecurityContext) {\n SecurityContext[SecurityContext[\"NONE\"] = 0] = \"NONE\";\n SecurityContext[SecurityContext[\"HTML\"] = 1] = \"HTML\";\n SecurityContext[SecurityContext[\"STYLE\"] = 2] = \"STYLE\";\n SecurityContext[SecurityContext[\"SCRIPT\"] = 3] = \"SCRIPT\";\n SecurityContext[SecurityContext[\"URL\"] = 4] = \"URL\";\n SecurityContext[SecurityContext[\"RESOURCE_URL\"] = 5] = \"RESOURCE_URL\";\n})(SecurityContext || (SecurityContext = {}));\n\n/**\n * An `html` sanitizer which converts untrusted `html` **string** into trusted string by removing\n * dangerous content.\n *\n * This method parses the `html` and locates potentially dangerous content (such as urls and\n * javascript) and removes it.\n *\n * It is possible to mark a string as trusted by calling {@link bypassSanitizationTrustHtml}.\n *\n * @param unsafeHtml untrusted `html`, typically from the user.\n * @returns `html` string which is safe to display to user, because all of the dangerous javascript\n * and urls have been removed.\n *\n * @codeGenApi\n */\nfunction ɵɵsanitizeHtml(unsafeHtml) {\n const sanitizer = getSanitizer();\n if (sanitizer) {\n return trustedHTMLFromStringBypass(sanitizer.sanitize(SecurityContext.HTML, unsafeHtml) || '');\n }\n if (allowSanitizationBypassAndThrow(unsafeHtml, \"HTML\" /* BypassType.Html */)) {\n return trustedHTMLFromStringBypass(unwrapSafeValue(unsafeHtml));\n }\n return _sanitizeHtml(getDocument(), renderStringify(unsafeHtml));\n}\n/**\n * A `style` sanitizer which converts untrusted `style` **string** into trusted string by removing\n * dangerous content.\n *\n * It is possible to mark a string as trusted by calling {@link bypassSanitizationTrustStyle}.\n *\n * @param unsafeStyle untrusted `style`, typically from the user.\n * @returns `style` string which is safe to bind to the `style` properties.\n *\n * @codeGenApi\n */\nfunction ɵɵsanitizeStyle(unsafeStyle) {\n const sanitizer = getSanitizer();\n if (sanitizer) {\n return sanitizer.sanitize(SecurityContext.STYLE, unsafeStyle) || '';\n }\n if (allowSanitizationBypassAndThrow(unsafeStyle, \"Style\" /* BypassType.Style */)) {\n return unwrapSafeValue(unsafeStyle);\n }\n return renderStringify(unsafeStyle);\n}\n/**\n * A `url` sanitizer which converts untrusted `url` **string** into trusted string by removing\n * dangerous\n * content.\n *\n * This method parses the `url` and locates potentially dangerous content (such as javascript) and\n * removes it.\n *\n * It is possible to mark a string as trusted by calling {@link bypassSanitizationTrustUrl}.\n *\n * @param unsafeUrl untrusted `url`, typically from the user.\n * @returns `url` string which is safe to bind to the `src` properties such as `<img src>`, because\n * all of the dangerous javascript has been removed.\n *\n * @codeGenApi\n */\nfunction ɵɵsanitizeUrl(unsafeUrl) {\n const sanitizer = getSanitizer();\n if (sanitizer) {\n return sanitizer.sanitize(SecurityContext.URL, unsafeUrl) || '';\n }\n if (allowSanitizationBypassAndThrow(unsafeUrl, \"URL\" /* BypassType.Url */)) {\n return unwrapSafeValue(unsafeUrl);\n }\n return _sanitizeUrl(renderStringify(unsafeUrl));\n}\n/**\n * A `url` sanitizer which only lets trusted `url`s through.\n *\n * This passes only `url`s marked trusted by calling {@link bypassSanitizationTrustResourceUrl}.\n *\n * @param unsafeResourceUrl untrusted `url`, typically from the user.\n * @returns `url` string which is safe to bind to the `src` properties such as `<img src>`, because\n * only trusted `url`s have been allowed to pass.\n *\n * @codeGenApi\n */\nfunction ɵɵsanitizeResourceUrl(unsafeResourceUrl) {\n const sanitizer = getSanitizer();\n if (sanitizer) {\n return trustedScriptURLFromStringBypass(sanitizer.sanitize(SecurityContext.RESOURCE_URL, unsafeResourceUrl) || '');\n }\n if (allowSanitizationBypassAndThrow(unsafeResourceUrl, \"ResourceURL\" /* BypassType.ResourceUrl */)) {\n return trustedScriptURLFromStringBypass(unwrapSafeValue(unsafeResourceUrl));\n }\n throw new RuntimeError(904 /* RuntimeErrorCode.UNSAFE_VALUE_IN_RESOURCE_URL */, ngDevMode && `unsafe value used in a resource URL context (see ${XSS_SECURITY_URL})`);\n}\n/**\n * A `script` sanitizer which only lets trusted javascript through.\n *\n * This passes only `script`s marked trusted by calling {@link\n * bypassSanitizationTrustScript}.\n *\n * @param unsafeScript untrusted `script`, typically from the user.\n * @returns `url` string which is safe to bind to the `<script>` element such as `<img src>`,\n * because only trusted `scripts` have been allowed to pass.\n *\n * @codeGenApi\n */\nfunction ɵɵsanitizeScript(unsafeScript) {\n const sanitizer = getSanitizer();\n if (sanitizer) {\n return trustedScriptFromStringBypass(sanitizer.sanitize(SecurityContext.SCRIPT, unsafeScript) || '');\n }\n if (allowSanitizationBypassAndThrow(unsafeScript, \"Script\" /* BypassType.Script */)) {\n return trustedScriptFromStringBypass(unwrapSafeValue(unsafeScript));\n }\n throw new RuntimeError(905 /* RuntimeErrorCode.UNSAFE_VALUE_IN_SCRIPT */, ngDevMode && 'unsafe value used in a script context');\n}\n/**\n * A template tag function for promoting the associated constant literal to a\n * TrustedHTML. Interpolation is explicitly not allowed.\n *\n * @param html constant template literal containing trusted HTML.\n * @returns TrustedHTML wrapping `html`.\n *\n * @security This is a security-sensitive function and should only be used to\n * convert constant values of attributes and properties found in\n * application-provided Angular templates to TrustedHTML.\n *\n * @codeGenApi\n */\nfunction ɵɵtrustConstantHtml(html) {\n // The following runtime check ensures that the function was called as a\n // template tag (e.g. ɵɵtrustConstantHtml`content`), without any interpolation\n // (e.g. not ɵɵtrustConstantHtml`content ${variable}`). A TemplateStringsArray\n // is an array with a `raw` property that is also an array. The associated\n // template literal has no interpolation if and only if the length of the\n // TemplateStringsArray is 1.\n if (ngDevMode && (!Array.isArray(html) || !Array.isArray(html.raw) || html.length !== 1)) {\n throw new Error(`Unexpected interpolation in trusted HTML constant: ${html.join('?')}`);\n }\n return trustedHTMLFromString(html[0]);\n}\n/**\n * A template tag function for promoting the associated constant literal to a\n * TrustedScriptURL. Interpolation is explicitly not allowed.\n *\n * @param url constant template literal containing a trusted script URL.\n * @returns TrustedScriptURL wrapping `url`.\n *\n * @security This is a security-sensitive function and should only be used to\n * convert constant values of attributes and properties found in\n * application-provided Angular templates to TrustedScriptURL.\n *\n * @codeGenApi\n */\nfunction ɵɵtrustConstantResourceUrl(url) {\n // The following runtime check ensures that the function was called as a\n // template tag (e.g. ɵɵtrustConstantResourceUrl`content`), without any\n // interpolation (e.g. not ɵɵtrustConstantResourceUrl`content ${variable}`). A\n // TemplateStringsArray is an array with a `raw` property that is also an\n // array. The associated template literal has no interpolation if and only if\n // the length of the TemplateStringsArray is 1.\n if (ngDevMode && (!Array.isArray(url) || !Array.isArray(url.raw) || url.length !== 1)) {\n throw new Error(`Unexpected interpolation in trusted URL constant: ${url.join('?')}`);\n }\n return trustedScriptURLFromString(url[0]);\n}\n/**\n * Detects which sanitizer to use for URL property, based on tag name and prop name.\n *\n * The rules are based on the RESOURCE_URL context config from\n * `packages/compiler/src/schema/dom_security_schema.ts`.\n * If tag and prop names don't match Resource URL schema, use URL sanitizer.\n */\nfunction getUrlSanitizer(tag, prop) {\n if ((prop === 'src' &&\n (tag === 'embed' ||\n tag === 'frame' ||\n tag === 'iframe' ||\n tag === 'media' ||\n tag === 'script')) ||\n (prop === 'href' && (tag === 'base' || tag === 'link'))) {\n return ɵɵsanitizeResourceUrl;\n }\n return ɵɵsanitizeUrl;\n}\n/**\n * Sanitizes URL, selecting sanitizer function based on tag and property names.\n *\n * This function is used in case we can't define security context at compile time, when only prop\n * name is available. This happens when we generate host bindings for Directives/Components. The\n * host element is unknown at compile time, so we defer calculation of specific sanitizer to\n * runtime.\n *\n * @param unsafeUrl untrusted `url`, typically from the user.\n * @param tag target element tag name.\n * @param prop name of the property that contains the value.\n * @returns `url` string which is safe to bind.\n *\n * @codeGenApi\n */\nfunction ɵɵsanitizeUrlOrResourceUrl(unsafeUrl, tag, prop) {\n return getUrlSanitizer(tag, prop)(unsafeUrl);\n}\nfunction validateAgainstEventProperties(name) {\n if (name.toLowerCase().startsWith('on')) {\n const errorMessage = `Binding to event property '${name}' is disallowed for security reasons, ` +\n `please use (${name.slice(2)})=...` +\n `\\nIf '${name}' is a directive input, make sure the directive is imported by the` +\n ` current module.`;\n throw new RuntimeError(306 /* RuntimeErrorCode.INVALID_EVENT_BINDING */, errorMessage);\n }\n}\nfunction validateAgainstEventAttributes(name) {\n if (name.toLowerCase().startsWith('on')) {\n const errorMessage = `Binding to event attribute '${name}' is disallowed for security reasons, ` +\n `please use (${name.slice(2)})=...`;\n throw new RuntimeError(306 /* RuntimeErrorCode.INVALID_EVENT_BINDING */, errorMessage);\n }\n}\nfunction getSanitizer() {\n const lView = getLView();\n return lView && lView[ENVIRONMENT].sanitizer;\n}\n\n/**\n * Disallowed strings in the comment.\n *\n * see: https://html.spec.whatwg.org/multipage/syntax.html#comments\n */\nconst COMMENT_DISALLOWED = /^>|^->|<!--|-->|--!>|<!-$/g;\n/**\n * Delimiter in the disallowed strings which needs to be wrapped with zero with character.\n */\nconst COMMENT_DELIMITER = /(<|>)/g;\nconst COMMENT_DELIMITER_ESCAPED = '\\u200B$1\\u200B';\n/**\n * Escape the content of comment strings so that it can be safely inserted into a comment node.\n *\n * The issue is that HTML does not specify any way to escape comment end text inside the comment.\n * Consider: `<!-- The way you close a comment is with \">\", and \"->\" at the beginning or by \"-->\" or\n * \"--!>\" at the end. -->`. Above the `\"-->\"` is meant to be text not an end to the comment. This\n * can be created programmatically through DOM APIs. (`<!--` are also disallowed.)\n *\n * see: https://html.spec.whatwg.org/multipage/syntax.html#comments\n *\n * ```ts\n * div.innerHTML = div.innerHTML\n * ```\n *\n * One would expect that the above code would be safe to do, but it turns out that because comment\n * text is not escaped, the comment may contain text which will prematurely close the comment\n * opening up the application for XSS attack. (In SSR we programmatically create comment nodes which\n * may contain such text and expect them to be safe.)\n *\n * This function escapes the comment text by looking for comment delimiters (`<` and `>`) and\n * surrounding them with `_>_` where the `_` is a zero width space `\\u200B`. The result is that if a\n * comment contains any of the comment start/end delimiters (such as `<!--`, `-->` or `--!>`) the\n * text it will render normally but it will not cause the HTML parser to close/open the comment.\n *\n * @param value text to make safe for comment node by escaping the comment open/close character\n * sequence.\n */\nfunction escapeCommentText(value) {\n return value.replace(COMMENT_DISALLOWED, (text) => text.replace(COMMENT_DELIMITER, COMMENT_DELIMITER_ESCAPED));\n}\n\n/** Defines the default value of the `NG_REFLECT_ATTRS_FLAG` flag. */\nconst NG_REFLECT_ATTRS_FLAG_DEFAULT = false;\n/**\n * Defines an internal flag that indicates whether the runtime code should be\n * producing `ng-reflect-*` attributes.\n */\nconst NG_REFLECT_ATTRS_FLAG = new InjectionToken(typeof ngDevMode === 'undefined' || ngDevMode ? 'NG_REFLECT_FLAG' : '', {\n providedIn: 'root',\n factory: () => NG_REFLECT_ATTRS_FLAG_DEFAULT,\n});\n/**\n * Enables the logic to produce `ng-reflect-*` attributes on elements with bindings.\n *\n * Note: this is a dev-mode only setting and it will have no effect in production mode.\n * In production mode, the `ng-reflect-*` attributes are *never* produced by Angular.\n *\n * Important: using and relying on the `ng-reflect-*` attributes is not recommended,\n * they are deprecated and only present for backwards compatibility. Angular will stop\n * producing them in one of the future versions.\n *\n * @publicApi\n */\nfunction provideNgReflectAttributes() {\n const providers = typeof ngDevMode === 'undefined' || ngDevMode\n ? [\n {\n provide: NG_REFLECT_ATTRS_FLAG,\n useValue: true,\n },\n ]\n : [];\n return makeEnvironmentProviders(providers);\n}\nfunction normalizeDebugBindingName(name) {\n // Attribute names with `$` (eg `x-y$`) are valid per spec, but unsupported by some browsers\n name = camelCaseToDashCase(name.replace(/[$@]/g, '_'));\n return `ng-reflect-${name}`;\n}\nconst CAMEL_CASE_REGEXP = /([A-Z])/g;\nfunction camelCaseToDashCase(input) {\n return input.replace(CAMEL_CASE_REGEXP, (...m) => '-' + m[1].toLowerCase());\n}\nfunction normalizeDebugBindingValue(value) {\n try {\n // Limit the size of the value as otherwise the DOM just gets polluted.\n return value != null ? value.toString().slice(0, 30) : value;\n }\n catch (e) {\n return '[ERROR] Exception while trying to serialize the value';\n }\n}\n\n/**\n * Defines a schema that allows an NgModule to contain the following:\n * - Non-Angular elements named with dash case (`-`).\n * - Element properties named with dash case (`-`).\n * Dash case is the naming convention for custom elements.\n *\n * @publicApi\n */\nconst CUSTOM_ELEMENTS_SCHEMA = {\n name: 'custom-elements',\n};\n/**\n * Defines a schema that allows any property on any element.\n *\n * This schema allows you to ignore the errors related to any unknown elements or properties in a\n * template. The usage of this schema is generally discouraged because it prevents useful validation\n * and may hide real errors in your template. Consider using the `CUSTOM_ELEMENTS_SCHEMA` instead.\n *\n * @publicApi\n */\nconst NO_ERRORS_SCHEMA = {\n name: 'no-errors-schema',\n};\n\nlet shouldThrowErrorOnUnknownElement = false;\n/**\n * Sets a strict mode for JIT-compiled components to throw an error on unknown elements,\n * instead of just logging the error.\n * (for AOT-compiled ones this check happens at build time).\n */\nfunction ɵsetUnknownElementStrictMode(shouldThrow) {\n shouldThrowErrorOnUnknownElement = shouldThrow;\n}\n/**\n * Gets the current value of the strict mode.\n */\nfunction ɵgetUnknownElementStrictMode() {\n return shouldThrowErrorOnUnknownElement;\n}\nlet shouldThrowErrorOnUnknownProperty = false;\n/**\n * Sets a strict mode for JIT-compiled components to throw an error on unknown properties,\n * instead of just logging the error.\n * (for AOT-compiled ones this check happens at build time).\n */\nfunction ɵsetUnknownPropertyStrictMode(shouldThrow) {\n shouldThrowErrorOnUnknownProperty = shouldThrow;\n}\n/**\n * Gets the current value of the strict mode.\n */\nfunction ɵgetUnknownPropertyStrictMode() {\n return shouldThrowErrorOnUnknownProperty;\n}\n/**\n * Validates that the element is known at runtime and produces\n * an error if it's not the case.\n * This check is relevant for JIT-compiled components (for AOT-compiled\n * ones this check happens at build time).\n *\n * The element is considered known if either:\n * - it's a known HTML element\n * - it's a known custom element\n * - the element matches any directive\n * - the element is allowed by one of the schemas\n *\n * @param lView An `LView` associated with a template is being rendered\n * @param tNode TNode representing an element to be validated\n */\nfunction validateElementIsKnown(lView, tNode) {\n const tView = lView[TVIEW];\n // If `schemas` is set to `null`, that's an indication that this Component was compiled in AOT\n // mode where this check happens at compile time. In JIT mode, `schemas` is always present and\n // defined as an array (as an empty array in case `schemas` field is not defined) and we should\n // execute the check below.\n if (tView.schemas === null)\n return;\n const tagName = tNode.value;\n // If the element matches any directive, it's considered as valid.\n if (!isDirectiveHost(tNode) && tagName !== null) {\n // The element is unknown if it's an instance of HTMLUnknownElement, or it isn't registered\n // as a custom element. Note that unknown elements with a dash in their name won't be instances\n // of HTMLUnknownElement in browsers that support web components.\n const isUnknown = \n // Note that we can't check for `typeof HTMLUnknownElement === 'function'` because\n // Domino doesn't expose HTMLUnknownElement globally.\n (typeof HTMLUnknownElement !== 'undefined' &&\n HTMLUnknownElement &&\n getNativeByTNode(tNode, lView) instanceof HTMLUnknownElement) ||\n (typeof customElements !== 'undefined' &&\n tagName.indexOf('-') > -1 &&\n !customElements.get(tagName));\n if (isUnknown && !matchingSchemas(tView.schemas, tagName)) {\n const isHostStandalone = isHostComponentStandalone(lView);\n const templateLocation = getTemplateLocationDetails(lView);\n const schemas = `'${isHostStandalone ? '@Component' : '@NgModule'}.schemas'`;\n let message = `'${tagName}' is not a known element${templateLocation}:\\n`;\n message += `1. If '${tagName}' is an Angular component, then verify that it is ${isHostStandalone\n ? \"included in the '@Component.imports' of this component\"\n : 'a part of an @NgModule where this component is declared'}.\\n`;\n if (tagName && tagName.indexOf('-') > -1) {\n message += `2. If '${tagName}' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the ${schemas} of this component to suppress this message.`;\n }\n else {\n message += `2. To allow any element add 'NO_ERRORS_SCHEMA' to the ${schemas} of this component.`;\n }\n if (shouldThrowErrorOnUnknownElement) {\n throw new RuntimeError(304 /* RuntimeErrorCode.UNKNOWN_ELEMENT */, message);\n }\n else {\n console.error(formatRuntimeError(304 /* RuntimeErrorCode.UNKNOWN_ELEMENT */, message));\n }\n }\n }\n}\n/**\n * Validates that the property of the element is known at runtime and returns\n * false if it's not the case.\n * This check is relevant for JIT-compiled components (for AOT-compiled\n * ones this check happens at build time).\n *\n * The property is considered known if either:\n * - it's a known property of the element\n * - the element is allowed by one of the schemas\n * - the property is used for animations\n *\n * @param element Element to validate\n * @param propName Name of the property to check\n * @param tagName Name of the tag hosting the property\n * @param schemas Array of schemas\n */\nfunction isPropertyValid(element, propName, tagName, schemas) {\n // If `schemas` is set to `null`, that's an indication that this Component was compiled in AOT\n // mode where this check happens at compile time. In JIT mode, `schemas` is always present and\n // defined as an array (as an empty array in case `schemas` field is not defined) and we should\n // execute the check below.\n if (schemas === null)\n return true;\n // The property is considered valid if the element matches the schema, it exists on the element,\n // or it is synthetic.\n if (matchingSchemas(schemas, tagName) || propName in element || isAnimationProp(propName)) {\n return true;\n }\n // Note: `typeof Node` returns 'function' in most browsers, but is undefined with domino.\n return typeof Node === 'undefined' || Node === null || !(element instanceof Node);\n}\n/**\n * Logs or throws an error that a property is not supported on an element.\n *\n * @param propName Name of the invalid property\n * @param tagName Name of the tag hosting the property\n * @param nodeType Type of the node hosting the property\n * @param lView An `LView` that represents a current component\n */\nfunction handleUnknownPropertyError(propName, tagName, nodeType, lView) {\n // Special-case a situation when a structural directive is applied to\n // an `<ng-template>` element, for example: `<ng-template *ngIf=\"true\">`.\n // In this case the compiler generates the `ɵɵtemplate` instruction with\n // the `null` as the tagName. The directive matching logic at runtime relies\n // on this effect (see `isInlineTemplate`), thus using the 'ng-template' as\n // a default value of the `tNode.value` is not feasible at this moment.\n if (!tagName && nodeType === 4 /* TNodeType.Container */) {\n tagName = 'ng-template';\n }\n const isHostStandalone = isHostComponentStandalone(lView);\n const templateLocation = getTemplateLocationDetails(lView);\n let message = `Can't bind to '${propName}' since it isn't a known property of '${tagName}'${templateLocation}.`;\n const schemas = `'${isHostStandalone ? '@Component' : '@NgModule'}.schemas'`;\n const importLocation = isHostStandalone\n ? \"included in the '@Component.imports' of this component\"\n : 'a part of an @NgModule where this component is declared';\n if (KNOWN_CONTROL_FLOW_DIRECTIVES.has(propName)) {\n // Most likely this is a control flow directive (such as `*ngIf`) used in\n // a template, but the directive or the `CommonModule` is not imported.\n const correspondingImport = KNOWN_CONTROL_FLOW_DIRECTIVES.get(propName);\n message +=\n `\\nIf the '${propName}' is an Angular control flow directive, ` +\n `please make sure that either the '${correspondingImport}' directive or the 'CommonModule' is ${importLocation}.`;\n }\n else {\n // May be an Angular component, which is not imported/declared?\n message +=\n `\\n1. If '${tagName}' is an Angular component and it has the ` +\n `'${propName}' input, then verify that it is ${importLocation}.`;\n // May be a Web Component?\n if (tagName && tagName.indexOf('-') > -1) {\n message +=\n `\\n2. If '${tagName}' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' ` +\n `to the ${schemas} of this component to suppress this message.`;\n message +=\n `\\n3. To allow any property add 'NO_ERRORS_SCHEMA' to ` +\n `the ${schemas} of this component.`;\n }\n else {\n // If it's expected, the error can be suppressed by the `NO_ERRORS_SCHEMA` schema.\n message +=\n `\\n2. To allow any property add 'NO_ERRORS_SCHEMA' to ` +\n `the ${schemas} of this component.`;\n }\n }\n reportUnknownPropertyError(message);\n}\nfunction reportUnknownPropertyError(message) {\n if (shouldThrowErrorOnUnknownProperty) {\n throw new RuntimeError(303 /* RuntimeErrorCode.UNKNOWN_BINDING */, message);\n }\n else {\n console.error(formatRuntimeError(303 /* RuntimeErrorCode.UNKNOWN_BINDING */, message));\n }\n}\n/**\n * WARNING: this is a **dev-mode only** function (thus should always be guarded by the `ngDevMode`)\n * and must **not** be used in production bundles. The function makes megamorphic reads, which might\n * be too slow for production mode and also it relies on the constructor function being available.\n *\n * Gets a reference to the host component def (where a current component is declared).\n *\n * @param lView An `LView` that represents a current component that is being rendered.\n */\nfunction getDeclarationComponentDef(lView) {\n !ngDevMode && throwError('Must never be called in production mode');\n const declarationLView = lView[DECLARATION_COMPONENT_VIEW];\n const context = declarationLView[CONTEXT];\n // Unable to obtain a context.\n if (!context)\n return null;\n return context.constructor ? getComponentDef(context.constructor) : null;\n}\n/**\n * WARNING: this is a **dev-mode only** function (thus should always be guarded by the `ngDevMode`)\n * and must **not** be used in production bundles. The function makes megamorphic reads, which might\n * be too slow for production mode.\n *\n * Checks if the current component is declared inside of a standalone component template.\n *\n * @param lView An `LView` that represents a current component that is being rendered.\n */\nfunction isHostComponentStandalone(lView) {\n !ngDevMode && throwError('Must never be called in production mode');\n const componentDef = getDeclarationComponentDef(lView);\n // Treat host component as non-standalone if we can't obtain the def.\n return !!componentDef?.standalone;\n}\n/**\n * WARNING: this is a **dev-mode only** function (thus should always be guarded by the `ngDevMode`)\n * and must **not** be used in production bundles. The function makes megamorphic reads, which might\n * be too slow for production mode.\n *\n * Constructs a string describing the location of the host component template. The function is used\n * in dev mode to produce error messages.\n *\n * @param lView An `LView` that represents a current component that is being rendered.\n */\nfunction getTemplateLocationDetails(lView) {\n !ngDevMode && throwError('Must never be called in production mode');\n const hostComponentDef = getDeclarationComponentDef(lView);\n const componentClassName = hostComponentDef?.type?.name;\n return componentClassName ? ` (used in the '${componentClassName}' component template)` : '';\n}\n/**\n * The set of known control flow directives and their corresponding imports.\n * We use this set to produce a more precises error message with a note\n * that the `CommonModule` should also be included.\n */\nconst KNOWN_CONTROL_FLOW_DIRECTIVES = new Map([\n ['ngIf', 'NgIf'],\n ['ngFor', 'NgFor'],\n ['ngSwitchCase', 'NgSwitchCase'],\n ['ngSwitchDefault', 'NgSwitchDefault'],\n]);\n/**\n * Returns true if the tag name is allowed by specified schemas.\n * @param schemas Array of schemas\n * @param tagName Name of the tag\n */\nfunction matchingSchemas(schemas, tagName) {\n if (schemas !== null) {\n for (let i = 0; i < schemas.length; i++) {\n const schema = schemas[i];\n if (schema === NO_ERRORS_SCHEMA ||\n (schema === CUSTOM_ELEMENTS_SCHEMA && tagName && tagName.indexOf('-') > -1)) {\n return true;\n }\n }\n }\n return false;\n}\n\n/**\n *\n * @codeGenApi\n */\nfunction ɵɵresolveWindow(element) {\n return element.ownerDocument.defaultView;\n}\n/**\n *\n * @codeGenApi\n */\nfunction ɵɵresolveDocument(element) {\n return element.ownerDocument;\n}\n/**\n *\n * @codeGenApi\n */\nfunction ɵɵresolveBody(element) {\n return element.ownerDocument.body;\n}\n/**\n * The special delimiter we use to separate property names, prefixes, and suffixes\n * in property binding metadata. See storeBindingMetadata().\n *\n * We intentionally use the Unicode \"REPLACEMENT CHARACTER\" (U+FFFD) as a delimiter\n * because it is a very uncommon character that is unlikely to be part of a user's\n * property names or interpolation strings. If it is in fact used in a property\n * binding, DebugElement.properties will not return the correct value for that\n * binding. However, there should be no runtime effect for real applications.\n *\n * This character is typically rendered as a question mark inside of a diamond.\n * See https://en.wikipedia.org/wiki/Specials_(Unicode_block)\n *\n */\nconst INTERPOLATION_DELIMITER = `<60>`;\n/**\n * Unwrap a value which might be behind a closure (for forward declaration reasons).\n */\nfunction maybeUnwrapFn(value) {\n if (value instanceof Function) {\n return value();\n }\n else {\n return value;\n }\n}\n\n/**\n * The max length of the string representation of a value in an error message\n */\nconst VALUE_STRING_LENGTH_LIMIT = 200;\n/** Verifies that a given type is a Standalone Component. */\nfunction assertStandaloneComponentType(type) {\n assertComponentDef(type);\n const componentDef = getComponentDef(type);\n if (!componentDef.standalone) {\n throw new RuntimeError(907 /* RuntimeErrorCode.TYPE_IS_NOT_STANDALONE */, `The ${stringifyForError(type)} component is not marked as standalone, ` +\n `but Angular expects to have a standalone component here. ` +\n `Please make sure the ${stringifyForError(type)} component has ` +\n `the \\`standalone: true\\` flag in the decorator.`);\n }\n}\n/** Verifies whether a given type is a component */\nfunction assertComponentDef(type) {\n if (!getComponentDef(type)) {\n throw new RuntimeError(906 /* RuntimeErrorCode.MISSING_GENERATED_DEF */, `The ${stringifyForError(type)} is not an Angular component, ` +\n `make sure it has the \\`@Component\\` decorator.`);\n }\n}\n/** Called when there are multiple component selectors that match a given node */\nfunction throwMultipleComponentError(tNode, first, second) {\n throw new RuntimeError(-300 /* RuntimeErrorCode.MULTIPLE_COMPONENTS_MATCH */, `Multiple components match node with tagname ${tNode.value}: ` +\n `${stringifyForError(first)} and ` +\n `${stringifyForError(second)}`);\n}\n/** Throws an ExpressionChangedAfterChecked error if checkNoChanges mode is on. */\nfunction throwErrorIfNoChangesMode(creationMode, oldValue, currValue, propName, lView) {\n const hostComponentDef = getDeclarationComponentDef(lView);\n const componentClassName = hostComponentDef?.type?.name;\n const field = propName ? ` for '${propName}'` : '';\n let msg = `ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value${field}: '${formatValue(oldValue)}'. Current value: '${formatValue(currValue)}'.${componentClassName ? ` Expression location: ${componentClassName} component` : ''}`;\n if (creationMode) {\n msg +=\n ` It seems like the view has been created after its parent and its children have been dirty checked.` +\n ` Has it been created in a change detection hook?`;\n }\n throw new RuntimeError(-100 /* RuntimeErrorCode.EXPRESSION_CHANGED_AFTER_CHECKED */, msg);\n}\nfunction formatValue(value) {\n let strValue = String(value);\n // JSON.stringify will throw on circular references\n try {\n if (Array.isArray(value) || strValue === '[object Object]') {\n strValue = JSON.stringify(value);\n }\n }\n catch (error) { }\n return strValue.length > VALUE_STRING_LENGTH_LIMIT\n ? strValue.substring(0, VALUE_STRING_LENGTH_LIMIT) + '…'\n : strValue;\n}\nfunction constructDetailsForInterpolation(lView, rootIndex, expressionIndex, meta, changedValue) {\n const [propName, prefix, ...chunks] = meta.split(INTERPOLATION_DELIMITER);\n let oldValue = prefix, newValue = prefix;\n for (let i = 0; i < chunks.length; i++) {\n const slotIdx = rootIndex + i;\n oldValue += `${lView[slotIdx]}${chunks[i]}`;\n newValue += `${slotIdx === expressionIndex ? changedValue : lView[slotIdx]}${chunks[i]}`;\n }\n return { propName, oldValue, newValue };\n}\n/**\n * Constructs an object that contains details for the ExpressionChangedAfterItHasBeenCheckedError:\n * - property name (for property bindings or interpolations)\n * - old and new values, enriched using information from metadata\n *\n * More information on the metadata storage format can be found in `storePropertyBindingMetadata`\n * function description.\n */\nfunction getExpressionChangedErrorDetails(lView, bindingIndex, oldValue, newValue) {\n const tData = lView[TVIEW].data;\n const metadata = tData[bindingIndex];\n if (typeof metadata === 'string') {\n // metadata for property interpolation\n if (metadata.indexOf(INTERPOLATION_DELIMITER) > -1) {\n return constructDetailsForInterpolation(lView, bindingIndex, bindingIndex, metadata, newValue);\n }\n // metadata for property binding\n return { propName: metadata, oldValue, newValue };\n }\n // metadata is not available for this expression, check if this expression is a part of the\n // property interpolation by going from the current binding index left and look for a string that\n // contains INTERPOLATION_DELIMITER, the layout in tView.data for this case will look like this:\n // [..., 'id<69>Prefix <20> and <20> suffix', null, null, null, ...]\n if (metadata === null) {\n let idx = bindingIndex - 1;\n while (typeof tData[idx] !== 'string' && tData[idx + 1] === null) {\n idx--;\n }\n const meta = tData[idx];\n if (typeof meta === 'string') {\n const matches = meta.match(new RegExp(INTERPOLATION_DELIMITER, 'g'));\n // first interpolation delimiter separates property name from interpolation parts (in case of\n // property interpolations), so we subtract one from total number of found delimiters\n if (matches && matches.length - 1 > bindingIndex - idx) {\n return constructDetailsForInterpolation(lView, idx, bindingIndex, meta, newValue);\n }\n }\n }\n return { propName: undefined, oldValue, newValue };\n}\n\n/**\n * Returns an index of `classToSearch` in `className` taking token boundaries into account.\n *\n * `classIndexOf('AB A', 'A', 0)` will be 3 (not 0 since `AB!==A`)\n *\n * @param className A string containing classes (whitespace separated)\n * @param classToSearch A class name to locate\n * @param startingIndex Starting location of search\n * @returns an index of the located class (or -1 if not found)\n */\nfunction classIndexOf(className, classToSearch, startingIndex) {\n ngDevMode && assertNotEqual(classToSearch, '', 'can not look for \"\" string.');\n let end = className.length;\n while (true) {\n const foundIndex = className.indexOf(classToSearch, startingIndex);\n if (foundIndex === -1)\n return foundIndex;\n if (foundIndex === 0 || className.charCodeAt(foundIndex - 1) <= 32 /* CharCode.SPACE */) {\n // Ensure that it has leading whitespace\n const length = classToSearch.length;\n if (foundIndex + length === end ||\n className.charCodeAt(foundIndex + length) <= 32 /* CharCode.SPACE */) {\n // Ensure that it has trailing whitespace\n return foundIndex;\n }\n }\n // False positive, keep searching from where we left off.\n startingIndex = foundIndex + 1;\n }\n}\n\nconst NG_TEMPLATE_SELECTOR = 'ng-template';\n/**\n * Search the `TAttributes` to see if it contains `cssClassToMatch` (case insensitive)\n *\n * @param tNode static data of the node to match\n * @param attrs `TAttributes` to search through.\n * @param cssClassToMatch class to match (lowercase)\n * @param isProjectionMode Whether or not class matching should look into the attribute `class` in\n * addition to the `AttributeMarker.Classes`.\n */\nfunction isCssClassMatching(tNode, attrs, cssClassToMatch, isProjectionMode) {\n ngDevMode &&\n assertEqual(cssClassToMatch, cssClassToMatch.toLowerCase(), 'Class name expected to be lowercase.');\n let i = 0;\n if (isProjectionMode) {\n for (; i < attrs.length && typeof attrs[i] === 'string'; i += 2) {\n // Search for an implicit `class` attribute and check if its value matches `cssClassToMatch`.\n if (attrs[i] === 'class' &&\n classIndexOf(attrs[i + 1].toLowerCase(), cssClassToMatch, 0) !== -1) {\n return true;\n }\n }\n }\n else if (isInlineTemplate(tNode)) {\n // Matching directives (i.e. when not matching for projection mode) should not consider the\n // class bindings that are present on inline templates, as those class bindings only target\n // the root node of the template, not the template itself.\n return false;\n }\n // Resume the search for classes after the `Classes` marker.\n i = attrs.indexOf(1 /* AttributeMarker.Classes */, i);\n if (i > -1) {\n // We found the classes section. Start searching for the class.\n let item;\n while (++i < attrs.length && typeof (item = attrs[i]) === 'string') {\n if (item.toLowerCase() === cssClassToMatch) {\n return true;\n }\n }\n }\n return false;\n}\n/**\n * Checks whether the `tNode` represents an inline template (e.g. `*ngFor`).\n *\n * @param tNode current TNode\n */\nfunction isInlineTemplate(tNode) {\n return tNode.type === 4 /* TNodeType.Container */ && tNode.value !== NG_TEMPLATE_SELECTOR;\n}\n/**\n * Function that checks whether a given tNode matches tag-based selector and has a valid type.\n *\n * Matching can be performed in 2 modes: projection mode (when we project nodes) and regular\n * directive matching mode:\n * - in the \"directive matching\" mode we do _not_ take TContainer's tagName into account if it is\n * different from NG_TEMPLATE_SELECTOR (value different from NG_TEMPLATE_SELECTOR indicates that a\n * tag name was extracted from * syntax so we would match the same directive twice);\n * - in the \"projection\" mode, we use a tag name potentially extracted from the * syntax processing\n * (applicable to TNodeType.Container only).\n */\nfunction hasTagAndTypeMatch(tNode, currentSelector, isProjectionMode) {\n const tagNameToCompare = tNode.type === 4 /* TNodeType.Container */ && !isProjectionMode ? NG_TEMPLATE_SELECTOR : tNode.value;\n return currentSelector === tagNameToCompare;\n}\n/**\n * A utility function to match an Ivy node static data against a simple CSS selector\n *\n * @param tNode static data of the node to match\n * @param selector The selector to try matching against the node.\n * @param isProjectionMode if `true` we are matching for content projection, otherwise we are doing\n * directive matching.\n * @returns true if node matches the selector.\n */\nfunction isNodeMatchingSelector(tNode, selector, isProjectionMode) {\n ngDevMode && assertDefined(selector[0], 'Selector should have a tag name');\n let mode = 4 /* SelectorFlags.ELEMENT */;\n const nodeAttrs = tNode.attrs;\n // Find the index of first attribute that has no value, only a name.\n const nameOnlyMarkerIdx = nodeAttrs !== null ? getNameOnlyMarkerIndex(nodeAttrs) : 0;\n // When processing \":not\" selectors, we skip to the next \":not\" if the\n // current one doesn't match\n let skipToNextSelector = false;\n for (let i = 0; i < selector.length; i++) {\n const current = selector[i];\n if (typeof current === 'number') {\n // If we finish processing a :not selector and it hasn't failed, return false\n if (!skipToNextSelector && !isPositive(mode) && !isPositive(current)) {\n return false;\n }\n // If we are skipping to the next :not() and this mode flag is positive,\n // it's a part of the current :not() selector, and we should keep skipping\n if (skipToNextSelector && isPositive(current))\n continue;\n skipToNextSelector = false;\n mode = current | (mode & 1 /* SelectorFlags.NOT */);\n continue;\n }\n if (skipToNextSelector)\n continue;\n if (mode & 4 /* SelectorFlags.ELEMENT */) {\n mode = 2 /* SelectorFlags.ATTRIBUTE */ | (mode & 1 /* SelectorFlags.NOT */);\n if ((current !== '' && !hasTagAndTypeMatch(tNode, current, isProjectionMode)) ||\n (current === '' && selector.length === 1)) {\n if (isPositive(mode))\n return false;\n skipToNextSelector = true;\n }\n }\n else if (mode & 8 /* SelectorFlags.CLASS */) {\n if (nodeAttrs === null || !isCssClassMatching(tNode, nodeAttrs, current, isProjectionMode)) {\n if (isPositive(mode))\n return false;\n skipToNextSelector = true;\n }\n }\n else {\n const selectorAttrValue = selector[++i];\n const attrIndexInNode = findAttrIndexInNode(current, nodeAttrs, isInlineTemplate(tNode), isProjectionMode);\n if (attrIndexInNode === -1) {\n if (isPositive(mode))\n return false;\n skipToNextSelector = true;\n continue;\n }\n if (selectorAttrValue !== '') {\n let nodeAttrValue;\n if (attrIndexInNode > nameOnlyMarkerIdx) {\n nodeAttrValue = '';\n }\n else {\n ngDevMode &&\n assertNotEqual(nodeAttrs[attrIndexInNode], 0 /* AttributeMarker.NamespaceURI */, 'We do not match directives on namespaced attributes');\n // we lowercase the attribute value to be able to match\n // selectors without case-sensitivity\n // (selectors are already in lowercase when generated)\n nodeAttrValue = nodeAttrs[attrIndexInNode + 1].toLowerCase();\n }\n if (mode & 2 /* SelectorFlags.ATTRIBUTE */ && selectorAttrValue !== nodeAttrValue) {\n if (isPositive(mode))\n return false;\n skipToNextSelector = true;\n }\n }\n }\n }\n return isPositive(mode) || skipToNextSelector;\n}\nfunction isPositive(mode) {\n return (mode & 1 /* SelectorFlags.NOT */) === 0;\n}\n/**\n * Examines the attribute's definition array for a node to find the index of the\n * attribute that matches the given `name`.\n *\n * NOTE: This will not match namespaced attributes.\n *\n * Attribute matching depends upon `isInlineTemplate` and `isProjectionMode`.\n * The following table summarizes which types of attributes we attempt to match:\n *\n * ===========================================================================================================\n * Modes | Normal Attributes | Bindings Attributes | Template Attributes | I18n\n * Attributes\n * ===========================================================================================================\n * Inline + Projection | YES | YES | NO | YES\n * -----------------------------------------------------------------------------------------------------------\n * Inline + Directive | NO | NO | YES | NO\n * -----------------------------------------------------------------------------------------------------------\n * Non-inline + Projection | YES | YES | NO | YES\n * -----------------------------------------------------------------------------------------------------------\n * Non-inline + Directive | YES | YES | NO | YES\n * ===========================================================================================================\n *\n * @param name the name of the attribute to find\n * @param attrs the attribute array to examine\n * @param isInlineTemplate true if the node being matched is an inline template (e.g. `*ngFor`)\n * rather than a manually expanded template node (e.g `<ng-template>`).\n * @param isProjectionMode true if we are matching against content projection otherwise we are\n * matching against directives.\n */\nfunction findAttrIndexInNode(name, attrs, isInlineTemplate, isProjectionMode) {\n if (attrs === null)\n return -1;\n let i = 0;\n if (isProjectionMode || !isInlineTemplate) {\n let bindingsMode = false;\n while (i < attrs.length) {\n const maybeAttrName = attrs[i];\n if (maybeAttrName === name) {\n return i;\n }\n else if (maybeAttrName === 3 /* AttributeMarker.Bindings */ ||\n maybeAttrName === 6 /* AttributeMarker.I18n */) {\n bindingsMode = true;\n }\n else if (maybeAttrName === 1 /* AttributeMarker.Classes */ ||\n maybeAttrName === 2 /* AttributeMarker.Styles */) {\n let value = attrs[++i];\n // We should skip classes here because we have a separate mechanism for\n // matching classes in projection mode.\n while (typeof value === 'string') {\n value = attrs[++i];\n }\n continue;\n }\n else if (maybeAttrName === 4 /* AttributeMarker.Template */) {\n // We do not care about Template attributes in this scenario.\n break;\n }\n else if (maybeAttrName === 0 /* AttributeMarker.NamespaceURI */) {\n // Skip the whole namespaced attribute and value. This is by design.\n i += 4;\n continue;\n }\n // In binding mode there are only names, rather than name-value pairs.\n i += bindingsMode ? 1 : 2;\n }\n // We did not match the attribute\n return -1;\n }\n else {\n return matchTemplateAttribute(attrs, name);\n }\n}\nfunction isNodeMatchingSelectorList(tNode, selector, isProjectionMode = false) {\n for (let i = 0; i < selector.length; i++) {\n if (isNodeMatchingSelector(tNode, selector[i], isProjectionMode)) {\n return true;\n }\n }\n return false;\n}\nfunction getProjectAsAttrValue(tNode) {\n const nodeAttrs = tNode.attrs;\n if (nodeAttrs != null) {\n const ngProjectAsAttrIdx = nodeAttrs.indexOf(5 /* AttributeMarker.ProjectAs */);\n // only check for ngProjectAs in attribute names, don't accidentally match attribute's value\n // (attribute names are stored at even indexes)\n if ((ngProjectAsAttrIdx & 1) === 0) {\n return nodeAttrs[ngProjectAsAttrIdx + 1];\n }\n }\n return null;\n}\nfunction getNameOnlyMarkerIndex(nodeAttrs) {\n for (let i = 0; i < nodeAttrs.length; i++) {\n const nodeAttr = nodeAttrs[i];\n if (isNameOnlyAttributeMarker(nodeAttr)) {\n return i;\n }\n }\n return nodeAttrs.length;\n}\nfunction matchTemplateAttribute(attrs, name) {\n let i = attrs.indexOf(4 /* AttributeMarker.Template */);\n if (i > -1) {\n i++;\n while (i < attrs.length) {\n const attr = attrs[i];\n // Return in case we checked all template attrs and are switching to the next section in the\n // attrs array (that starts with a number that represents an attribute marker).\n if (typeof attr === 'number')\n return -1;\n if (attr === name)\n return i;\n i++;\n }\n }\n return -1;\n}\n/**\n * Checks whether a selector is inside a CssSelectorList\n * @param selector Selector to be checked.\n * @param list List in which to look for the selector.\n */\nfunction isSelectorInSelectorList(selector, list) {\n selectorListLoop: for (let i = 0; i < list.length; i++) {\n const currentSelectorInList = list[i];\n if (selector.length !== currentSelectorInList.length) {\n continue;\n }\n for (let j = 0; j < selector.length; j++) {\n if (selector[j] !== currentSelectorInList[j]) {\n continue selectorListLoop;\n }\n }\n return true;\n }\n return false;\n}\nfunction maybeWrapInNotSelector(isNegativeMode, chunk) {\n return isNegativeMode ? ':not(' + chunk.trim() + ')' : chunk;\n}\nfunction stringifyCSSSelector(selector) {\n let result = selector[0];\n let i = 1;\n let mode = 2 /* SelectorFlags.ATTRIBUTE */;\n let currentChunk = '';\n let isNegativeMode = false;\n while (i < selector.length) {\n let valueOrMarker = selector[i];\n if (typeof valueOrMarker === 'string') {\n if (mode & 2 /* SelectorFlags.ATTRIBUTE */) {\n const attrValue = selector[++i];\n currentChunk +=\n '[' + valueOrMarker + (attrValue.length > 0 ? '=\"' + attrValue + '\"' : '') + ']';\n }\n else if (mode & 8 /* SelectorFlags.CLASS */) {\n currentChunk += '.' + valueOrMarker;\n }\n else if (mode & 4 /* SelectorFlags.ELEMENT */) {\n currentChunk += ' ' + valueOrMarker;\n }\n }\n else {\n //\n // Append current chunk to the final result in case we come across SelectorFlag, which\n // indicates that the previous section of a selector is over. We need to accumulate content\n // between flags to make sure we wrap the chunk later in :not() selector if needed, e.g.\n // ```\n // ['', Flags.CLASS, '.classA', Flags.CLASS | Flags.NOT, '.classB', '.classC']\n // ```\n // should be transformed to `.classA :not(.classB .classC)`.\n //\n // Note: for negative selector part, we accumulate content between flags until we find the\n // next negative flag. This is needed to support a case where `:not()` rule contains more than\n // one chunk, e.g. the following selector:\n // ```\n // ['', Flags.ELEMENT | Flags.NOT, 'p', Flags.CLASS, 'foo', Flags.CLASS | Flags.NOT, 'bar']\n // ```\n // should be stringified to `:not(p.foo) :not(.bar)`\n //\n if (currentChunk !== '' && !isPositive(valueOrMarker)) {\n result += maybeWrapInNotSelector(isNegativeMode, currentChunk);\n currentChunk = '';\n }\n mode = valueOrMarker;\n // According to CssSelector spec, once we come across `SelectorFlags.NOT` flag, the negative\n // mode is maintained for remaining chunks of a selector.\n isNegativeMode = isNegativeMode || !isPositive(mode);\n }\n i++;\n }\n if (currentChunk !== '') {\n result += maybeWrapInNotSelector(isNegativeMode, currentChunk);\n }\n return result;\n}\n/**\n * Generates string representation of CSS selector in parsed form.\n *\n * ComponentDef and DirectiveDef are generated with the selector in parsed form to avoid doing\n * additional parsing at runtime (for example, for directive matching). However in some cases (for\n * example, while bootstrapping a component), a string version of the selector is required to query\n * for the host element on the page. This function takes the parsed form of a selector and returns\n * its string representation.\n *\n * @param selectorList selector in parsed form\n * @returns string representation of a given selector\n */\nfunction stringifyCSSSelectorList(selectorList) {\n return selectorList.map(stringifyCSSSelector).join(',');\n}\n/**\n * Extracts attributes and classes information from a given CSS selector.\n *\n * This function is used while creating a component dynamically. In this case, the host element\n * (that is created dynamically) should contain attributes and classes specified in component's CSS\n * selector.\n *\n * @param selector CSS selector in parsed form (in a form of array)\n * @returns object with `attrs` and `classes` fields that contain extracted information\n */\nfunction extractAttrsAndClassesFromSelector(selector) {\n const attrs = [];\n const classes = [];\n let i = 1;\n let mode = 2 /* SelectorFlags.ATTRIBUTE */;\n while (i < selector.length) {\n let valueOrMarker = selector[i];\n if (typeof valueOrMarker === 'string') {\n if (mode === 2 /* SelectorFlags.ATTRIBUTE */) {\n if (valueOrMarker !== '') {\n attrs.push(valueOrMarker, selector[++i]);\n }\n }\n else if (mode === 8 /* SelectorFlags.CLASS */) {\n classes.push(valueOrMarker);\n }\n }\n else {\n // According to CssSelector spec, once we come across `SelectorFlags.NOT` flag, the negative\n // mode is maintained for remaining chunks of a selector. Since attributes and classes are\n // extracted only for \"positive\" part of the selector, we can stop here.\n if (!isPositive(mode))\n break;\n mode = valueOrMarker;\n }\n i++;\n }\n if (classes.length) {\n attrs.push(1 /* AttributeMarker.Classes */, ...classes);\n }\n return attrs;\n}\n\n/** A special value which designates that a value has not changed. */\nconst NO_CHANGE = typeof ngDevMode === 'undefined' || ngDevMode ? { __brand__: 'NO_CHANGE' } : {};\n\nfunction createTextNode(renderer, value) {\n return renderer.createText(value);\n}\nfunction updateTextNode(renderer, rNode, value) {\n renderer.setValue(rNode, value);\n}\nfunction createCommentNode(renderer, value) {\n return renderer.createComment(escapeCommentText(value));\n}\n/**\n * Creates a native element from a tag name, using a renderer.\n * @param renderer A renderer to use\n * @param name the tag name\n * @param namespace Optional namespace for element.\n * @returns the element created\n */\nfunction createElementNode(renderer, name, namespace) {\n return renderer.createElement(name, namespace);\n}\n/**\n * Inserts a native node before another native node for a given parent.\n * This is a utility function that can be used when native nodes were determined.\n */\nfunction nativeInsertBefore(renderer, parent, child, beforeNode, isMove) {\n renderer.insertBefore(parent, child, beforeNode, isMove);\n}\nfunction nativeAppendChild(renderer, parent, child) {\n ngDevMode && assertDefined(parent, 'parent node must be defined');\n renderer.appendChild(parent, child);\n}\nfunction nativeAppendOrInsertBefore(renderer, parent, child, beforeNode, isMove) {\n if (beforeNode !== null) {\n nativeInsertBefore(renderer, parent, child, beforeNode, isMove);\n }\n else {\n nativeAppendChild(renderer, parent, child);\n }\n}\n/**\n * Removes a native node itself using a given renderer. To remove the node we are looking up its\n * parent from the native tree as not all platforms / browsers support the equivalent of\n * node.remove().\n *\n * @param renderer A renderer to be used\n * @param rNode The native node that should be removed\n * @param isHostElement A flag indicating if a node to be removed is a host of a component.\n */\nfunction nativeRemoveNode(renderer, rNode, isHostElement) {\n renderer.removeChild(null, rNode, isHostElement);\n}\n/**\n * Clears the contents of a given RElement.\n *\n * @param rElement the native RElement to be cleared\n */\nfunction clearElementContents(rElement) {\n rElement.textContent = '';\n}\n/**\n * Write `cssText` to `RElement`.\n *\n * This function does direct write without any reconciliation. Used for writing initial values, so\n * that static styling values do not pull in the style parser.\n *\n * @param renderer Renderer to use\n * @param element The element which needs to be updated.\n * @param newValue The new class list to write.\n */\nfunction writeDirectStyle(renderer, element, newValue) {\n ngDevMode && assertString(newValue, \"'newValue' should be a string\");\n renderer.setAttribute(element, 'style', newValue);\n}\n/**\n * Write `className` to `RElement`.\n *\n * This function does direct write without any reconciliation. Used for writing initial values, so\n * that static styling values do not pull in the style parser.\n *\n * @param renderer Renderer to use\n * @param element The element which needs to be updated.\n * @param newValue The new class list to write.\n */\nfunction writeDirectClass(renderer, element, newValue) {\n ngDevMode && assertString(newValue, \"'newValue' should be a string\");\n if (newValue === '') {\n // There are tests in `google3` which expect `element.getAttribute('class')` to be `null`.\n renderer.removeAttribute(element, 'class');\n }\n else {\n renderer.setAttribute(element, 'class', newValue);\n }\n}\n/** Sets up the static DOM attributes on an `RNode`. */\nfunction setupStaticAttributes(renderer, element, tNode) {\n const { mergedAttrs, classes, styles } = tNode;\n if (mergedAttrs !== null) {\n setUpAttributes(renderer, element, mergedAttrs);\n }\n if (classes !== null) {\n writeDirectClass(renderer, element, classes);\n }\n if (styles !== null) {\n writeDirectStyle(renderer, element, styles);\n }\n}\n\n/**\n * Creates a TView instance\n *\n * @param type Type of `TView`.\n * @param declTNode Declaration location of this `TView`.\n * @param templateFn Template function\n * @param decls The number of nodes, local refs, and pipes in this template\n * @param directives Registry of directives for this view\n * @param pipes Registry of pipes for this view\n * @param viewQuery View queries for this view\n * @param schemas Schemas for this view\n * @param consts Constants for this view\n */\nfunction createTView(type, declTNode, templateFn, decls, vars, directives, pipes, viewQuery, schemas, constsOrFactory, ssrId) {\n const bindingStartIndex = HEADER_OFFSET + decls;\n // This length does not yet contain host bindings from child directives because at this point,\n // we don't know which directives are active on this template. As soon as a directive is matched\n // that has a host binding, we will update the blueprint with that def's hostVars count.\n const initialViewLength = bindingStartIndex + vars;\n const blueprint = createViewBlueprint(bindingStartIndex, initialViewLength);\n const consts = typeof constsOrFactory === 'function' ? constsOrFactory() : constsOrFactory;\n const tView = (blueprint[TVIEW] = {\n type: type,\n blueprint: blueprint,\n template: templateFn,\n queries: null,\n viewQuery: viewQuery,\n declTNode: declTNode,\n data: blueprint.slice().fill(null, bindingStartIndex),\n bindingStartIndex: bindingStartIndex,\n expandoStartIndex: initialViewLength,\n hostBindingOpCodes: null,\n firstCreatePass: true,\n firstUpdatePass: true,\n staticViewQueries: false,\n staticContentQueries: false,\n preOrderHooks: null,\n preOrderCheckHooks: null,\n contentHooks: null,\n contentCheckHooks: null,\n viewHooks: null,\n viewCheckHooks: null,\n destroyHooks: null,\n cleanup: null,\n contentQueries: null,\n components: null,\n directiveRegistry: typeof directives === 'function' ? directives() : directives,\n pipeRegistry: typeof pipes === 'function' ? pipes() : pipes,\n firstChild: null,\n schemas: schemas,\n consts: consts,\n incompleteFirstPass: false,\n ssrId,\n });\n if (ngDevMode) {\n // For performance reasons it is important that the tView retains the same shape during runtime.\n // (To make sure that all of the code is monomorphic.) For this reason we seal the object to\n // prevent class transitions.\n Object.seal(tView);\n }\n return tView;\n}\nfunction createViewBlueprint(bindingStartIndex, initialViewLength) {\n const blueprint = [];\n for (let i = 0; i < initialViewLength; i++) {\n blueprint.push(i < bindingStartIndex ? null : NO_CHANGE);\n }\n return blueprint;\n}\n/**\n * Gets TView from a template function or creates a new TView\n * if it doesn't already exist.\n *\n * @param def ComponentDef\n * @returns TView\n */\nfunction getOrCreateComponentTView(def) {\n const tView = def.tView;\n // Create a TView if there isn't one, or recreate it if the first create pass didn't\n // complete successfully since we can't know for sure whether it's in a usable shape.\n if (tView === null || tView.incompleteFirstPass) {\n // Declaration node here is null since this function is called when we dynamically create a\n // component and hence there is no declaration.\n const declTNode = null;\n return (def.tView = createTView(1 /* TViewType.Component */, declTNode, def.template, def.decls, def.vars, def.directiveDefs, def.pipeDefs, def.viewQuery, def.schemas, def.consts, def.id));\n }\n return tView;\n}\nfunction createLView(parentLView, tView, context, flags, host, tHostNode, environment, renderer, injector, embeddedViewInjector, hydrationInfo) {\n const lView = tView.blueprint.slice();\n lView[HOST] = host;\n lView[FLAGS] =\n flags |\n 4 /* LViewFlags.CreationMode */ |\n 128 /* LViewFlags.Attached */ |\n 8 /* LViewFlags.FirstLViewPass */ |\n 64 /* LViewFlags.Dirty */ |\n 1024 /* LViewFlags.RefreshView */;\n if (embeddedViewInjector !== null ||\n (parentLView && parentLView[FLAGS] & 2048 /* LViewFlags.HasEmbeddedViewInjector */)) {\n lView[FLAGS] |= 2048 /* LViewFlags.HasEmbeddedViewInjector */;\n }\n resetPreOrderHookFlags(lView);\n ngDevMode && tView.declTNode && parentLView && assertTNodeForLView(tView.declTNode, parentLView);\n lView[PARENT] = lView[DECLARATION_VIEW] = parentLView;\n lView[CONTEXT] = context;\n lView[ENVIRONMENT] = (environment || (parentLView && parentLView[ENVIRONMENT]));\n ngDevMode && assertDefined(lView[ENVIRONMENT], 'LViewEnvironment is required');\n lView[RENDERER] = (renderer || (parentLView && parentLView[RENDERER]));\n ngDevMode && assertDefined(lView[RENDERER], 'Renderer is required');\n lView[INJECTOR] = injector || (parentLView && parentLView[INJECTOR]) || null;\n lView[T_HOST] = tHostNode;\n lView[ID] = getUniqueLViewId();\n lView[HYDRATION] = hydrationInfo;\n lView[EMBEDDED_VIEW_INJECTOR] = embeddedViewInjector;\n ngDevMode &&\n assertEqual(tView.type == 2 /* TViewType.Embedded */ ? parentLView !== null : true, true, 'Embedded views must have parentLView');\n lView[DECLARATION_COMPONENT_VIEW] =\n tView.type == 2 /* TViewType.Embedded */ ? parentLView[DECLARATION_COMPONENT_VIEW] : lView;\n return lView;\n}\nfunction createComponentLView(lView, hostTNode, def) {\n const native = getNativeByTNode(hostTNode, lView);\n const tView = getOrCreateComponentTView(def);\n // Only component views should be added to the view tree directly. Embedded views are\n // accessed through their containers because they may be removed / re-added later.\n const rendererFactory = lView[ENVIRONMENT].rendererFactory;\n const componentView = addToEndOfViewTree(lView, createLView(lView, tView, null, getInitialLViewFlagsFromDef(def), native, hostTNode, null, rendererFactory.createRenderer(native, def), null, null, null));\n // Component view will always be created before any injected LContainers,\n // so this is a regular element, wrap it with the component view\n return (lView[hostTNode.index] = componentView);\n}\n/**\n * Gets the initial set of LView flags based on the component definition that the LView represents.\n * @param def Component definition from which to determine the flags.\n */\nfunction getInitialLViewFlagsFromDef(def) {\n let flags = 16 /* LViewFlags.CheckAlways */;\n if (def.signals) {\n flags = 4096 /* LViewFlags.SignalView */;\n }\n else if (def.onPush) {\n flags = 64 /* LViewFlags.Dirty */;\n }\n return flags;\n}\n/**\n * When elements are created dynamically after a view blueprint is created (e.g. through\n * i18nApply()), we need to adjust the blueprint for future template passes.\n *\n * @param tView `TView` associated with `LView`\n * @param lView The `LView` containing the blueprint to adjust\n * @param numSlotsToAlloc The number of slots to alloc in the LView, should be >0\n * @param initialValue Initial value to store in blueprint\n */\nfunction allocExpando(tView, lView, numSlotsToAlloc, initialValue) {\n if (numSlotsToAlloc === 0)\n return -1;\n if (ngDevMode) {\n assertFirstCreatePass(tView);\n assertSame(tView, lView[TVIEW], '`LView` must be associated with `TView`!');\n assertEqual(tView.data.length, lView.length, 'Expecting LView to be same size as TView');\n assertEqual(tView.data.length, tView.blueprint.length, 'Expecting Blueprint to be same size as TView');\n assertFirstUpdatePass(tView);\n }\n const allocIdx = lView.length;\n for (let i = 0; i < numSlotsToAlloc; i++) {\n lView.push(initialValue);\n tView.blueprint.push(initialValue);\n tView.data.push(null);\n }\n return allocIdx;\n}\n/**\n * Adds LView or LContainer to the end of the current view tree.\n *\n * This structure will be used to traverse through nested views to remove listeners\n * and call onDestroy callbacks.\n *\n * @param lView The view where LView or LContainer should be added\n * @param adjustedHostIndex Index of the view's host node in LView[], adjusted for header\n * @param lViewOrLContainer The LView or LContainer to add to the view tree\n * @returns The state passed in\n */\nfunction addToEndOfViewTree(lView, lViewOrLContainer) {\n // TODO(benlesh/misko): This implementation is incorrect, because it always adds the LContainer\n // to the end of the queue, which means if the developer retrieves the LContainers from RNodes out\n // of order, the change detection will run out of order, as the act of retrieving the the\n // LContainer from the RNode is what adds it to the queue.\n if (lView[CHILD_HEAD]) {\n lView[CHILD_TAIL][NEXT] = lViewOrLContainer;\n }\n else {\n lView[CHILD_HEAD] = lViewOrLContainer;\n }\n lView[CHILD_TAIL] = lViewOrLContainer;\n return lViewOrLContainer;\n}\n\n/**\n * Advances to an element for later binding instructions.\n *\n * Used in conjunction with instructions like {@link property} to act on elements with specified\n * indices, for example those created with {@link element} or {@link elementStart}.\n *\n * ```ts\n * (rf: RenderFlags, ctx: any) => {\n * if (rf & 1) {\n * text(0, 'Hello');\n * text(1, 'Goodbye')\n * element(2, 'div');\n * }\n * if (rf & 2) {\n * advance(2); // Advance twice to the <div>.\n * property('title', 'test');\n * }\n * }\n * ```\n * @param delta Number of elements to advance forwards by.\n *\n * @codeGenApi\n */\nfunction ɵɵadvance(delta = 1) {\n ngDevMode && assertGreaterThan(delta, 0, 'Can only advance forward');\n selectIndexInternal(getTView(), getLView(), getSelectedIndex() + delta, !!ngDevMode && isInCheckNoChangesMode());\n}\nfunction selectIndexInternal(tView, lView, index, checkNoChangesMode) {\n ngDevMode && assertIndexInDeclRange(lView[TVIEW], index);\n // Flush the initial hooks for elements in the view that have been added up to this point.\n // PERF WARNING: do NOT extract this to a separate function without running benchmarks\n if (!checkNoChangesMode) {\n const hooksInitPhaseCompleted = (lView[FLAGS] & 3 /* LViewFlags.InitPhaseStateMask */) === 3 /* InitPhaseState.InitPhaseCompleted */;\n if (hooksInitPhaseCompleted) {\n const preOrderCheckHooks = tView.preOrderCheckHooks;\n if (preOrderCheckHooks !== null) {\n executeCheckHooks(lView, preOrderCheckHooks, index);\n }\n }\n else {\n const preOrderHooks = tView.preOrderHooks;\n if (preOrderHooks !== null) {\n executeInitAndCheckHooks(lView, preOrderHooks, 0 /* InitPhaseState.OnInitHooksToBeRun */, index);\n }\n }\n }\n // We must set the selected index *after* running the hooks, because hooks may have side-effects\n // that cause other template functions to run, thus updating the selected index, which is global\n // state. If we run `setSelectedIndex` *before* we run the hooks, in some cases the selected index\n // will be altered by the time we leave the `ɵɵadvance` instruction.\n setSelectedIndex(index);\n}\n\n/** Flags describing an input for a directive. */\nvar InputFlags;\n(function (InputFlags) {\n InputFlags[InputFlags[\"None\"] = 0] = \"None\";\n InputFlags[InputFlags[\"SignalBased\"] = 1] = \"SignalBased\";\n InputFlags[InputFlags[\"HasDecoratorInputTransform\"] = 2] = \"HasDecoratorInputTransform\";\n})(InputFlags || (InputFlags = {}));\n\nfunction writeToDirectiveInput(def, instance, publicName, value) {\n const prevConsumer = setActiveConsumer(null);\n try {\n if (ngDevMode) {\n if (!def.inputs.hasOwnProperty(publicName)) {\n throw new Error(`ASSERTION ERROR: Directive ${def.type.name} does not have an input with a public name of \"${publicName}\"`);\n }\n // Usually we resolve the directive instance using `LView[someIndex]` before writing to an\n // input, however if the read happens to early, the `LView[someIndex]` might actually be a\n // `NodeInjectorFactory`. Check for this specific case here since it can break in subtle ways.\n if (instance instanceof NodeInjectorFactory) {\n throw new Error(`ASSERTION ERROR: Cannot write input to factory for type ${def.type.name}. Directive has not been created yet.`);\n }\n }\n const [privateName, flags, transform] = def.inputs[publicName];\n // If we know we are dealing with a signal input, we cache its reference\n // in a tree-shakable way. The input signal node can then be used for\n // value transform execution or actual value updates without introducing\n // additional megamorphic accesses for accessing the instance field.\n let inputSignalNode = null;\n if ((flags & InputFlags.SignalBased) !== 0) {\n const field = instance[privateName];\n inputSignalNode = field[SIGNAL];\n }\n // If there is a signal node and a transform, run it before potentially\n // delegating to features like `NgOnChanges`.\n if (inputSignalNode !== null && inputSignalNode.transformFn !== undefined) {\n value = inputSignalNode.transformFn(value);\n }\n else if (transform !== null) {\n // If there is a decorator input transform, run it.\n value = transform.call(instance, value);\n }\n if (def.setInput !== null) {\n def.setInput(instance, inputSignalNode, value, publicName, privateName);\n }\n else {\n applyValueToInputField(instance, inputSignalNode, privateName, value);\n }\n }\n finally {\n setActiveConsumer(prevConsumer);\n }\n}\n\n/**\n * Flags for renderer-specific style modifiers.\n * @publicApi\n */\nvar RendererStyleFlags2;\n(function (RendererStyleFlags2) {\n // TODO(misko): This needs to be refactored into a separate file so that it can be imported from\n // `node_manipulation.ts` Currently doing the import cause resolution order to change and fails\n // the tests. The work around is to have hard coded value in `node_manipulation.ts` for now.\n /**\n * Marks a style as important.\n */\n RendererStyleFlags2[RendererStyleFlags2[\"Important\"] = 1] = \"Important\";\n /**\n * Marks a style as using dash case naming (this-is-dash-case).\n */\n RendererStyleFlags2[RendererStyleFlags2[\"DashCase\"] = 2] = \"DashCase\";\n})(RendererStyleFlags2 || (RendererStyleFlags2 = {}));\n\nlet _icuContainerIterate;\n/**\n * Iterator which provides ability to visit all of the `TIcuContainerNode` root `RNode`s.\n */\nfunction icuContainerIterate(tIcuContainerNode, lView) {\n return _icuContainerIterate(tIcuContainerNode, lView);\n}\n/**\n * Ensures that `IcuContainerVisitor`'s implementation is present.\n *\n * This function is invoked when i18n instruction comes across an ICU. The purpose is to allow the\n * bundler to tree shake ICU logic and only load it if ICU instruction is executed.\n */\nfunction ensureIcuContainerVisitorLoaded(loader) {\n if (_icuContainerIterate === undefined) {\n // Do not inline this function. We want to keep `ensureIcuContainerVisitorLoaded` light, so it\n // can be inlined into call-site.\n _icuContainerIterate = loader();\n }\n}\n\n/**\n * NOTE: for performance reasons, the possible actions are inlined within the function instead of\n * being passed as an argument.\n */\nfunction applyToElementOrContainer(action, renderer, parent, lNodeToHandle, beforeNode) {\n // If this slot was allocated for a text node dynamically created by i18n, the text node itself\n // won't be created until i18nApply() in the update block, so this node should be skipped.\n // For more info, see \"ICU expressions should work inside an ngTemplateOutlet inside an ngFor\"\n // in `i18n_spec.ts`.\n if (lNodeToHandle != null) {\n let lContainer;\n let isComponent = false;\n // We are expecting an RNode, but in the case of a component or LContainer the `RNode` is\n // wrapped in an array which needs to be unwrapped. We need to know if it is a component and if\n // it has LContainer so that we can process all of those cases appropriately.\n if (isLContainer(lNodeToHandle)) {\n lContainer = lNodeToHandle;\n }\n else if (isLView(lNodeToHandle)) {\n isComponent = true;\n ngDevMode && assertDefined(lNodeToHandle[HOST], 'HOST must be defined for a component LView');\n lNodeToHandle = lNodeToHandle[HOST];\n }\n const rNode = unwrapRNode(lNodeToHandle);\n if (action === 0 /* WalkTNodeTreeAction.Create */ && parent !== null) {\n if (beforeNode == null) {\n nativeAppendChild(renderer, parent, rNode);\n }\n else {\n nativeInsertBefore(renderer, parent, rNode, beforeNode || null, true);\n }\n }\n else if (action === 1 /* WalkTNodeTreeAction.Insert */ && parent !== null) {\n nativeInsertBefore(renderer, parent, rNode, beforeNode || null, true);\n }\n else if (action === 2 /* WalkTNodeTreeAction.Detach */) {\n nativeRemoveNode(renderer, rNode, isComponent);\n }\n else if (action === 3 /* WalkTNodeTreeAction.Destroy */) {\n renderer.destroyNode(rNode);\n }\n if (lContainer != null) {\n applyContainer(renderer, action, lContainer, parent, beforeNode);\n }\n }\n}\n/**\n * Removes all DOM elements associated with a view.\n *\n * Because some root nodes of the view may be containers, we sometimes need\n * to propagate deeply into the nested containers to remove all elements in the\n * views beneath it.\n *\n * @param tView The `TView' of the `LView` from which elements should be added or removed\n * @param lView The view from which elements should be added or removed\n */\nfunction removeViewFromDOM(tView, lView) {\n detachViewFromDOM(tView, lView);\n lView[HOST] = null;\n lView[T_HOST] = null;\n}\n/**\n * Adds all DOM elements associated with a view.\n *\n * Because some root nodes of the view may be containers, we sometimes need\n * to propagate deeply into the nested containers to add all elements in the\n * views beneath it.\n *\n * @param tView The `TView' of the `LView` from which elements should be added or removed\n * @param parentTNode The `TNode` where the `LView` should be attached to.\n * @param renderer Current renderer to use for DOM manipulations.\n * @param lView The view from which elements should be added or removed\n * @param parentNativeNode The parent `RElement` where it should be inserted into.\n * @param beforeNode The node before which elements should be added, if insert mode\n */\nfunction addViewToDOM(tView, parentTNode, renderer, lView, parentNativeNode, beforeNode) {\n lView[HOST] = parentNativeNode;\n lView[T_HOST] = parentTNode;\n applyView(tView, lView, renderer, 1 /* WalkTNodeTreeAction.Insert */, parentNativeNode, beforeNode);\n}\n/**\n * Detach a `LView` from the DOM by detaching its nodes.\n *\n * @param tView The `TView' of the `LView` to be detached\n * @param lView the `LView` to be detached.\n */\nfunction detachViewFromDOM(tView, lView) {\n // When we remove a view from the DOM, we need to rerun afterRender hooks\n // We don't necessarily needs to run change detection. DOM removal only requires\n // change detection if animations are enabled (this notification is handled by animations).\n lView[ENVIRONMENT].changeDetectionScheduler?.notify(9 /* NotificationSource.ViewDetachedFromDOM */);\n applyView(tView, lView, lView[RENDERER], 2 /* WalkTNodeTreeAction.Detach */, null, null);\n}\n/**\n * Traverses down and up the tree of views and containers to remove listeners and\n * call onDestroy callbacks.\n *\n * Notes:\n * - Because it's used for onDestroy calls, it needs to be bottom-up.\n * - Must process containers instead of their views to avoid splicing\n * when views are destroyed and re-added.\n * - Using a while loop because it's faster than recursion\n * - Destroy only called on movement to sibling or movement to parent (laterally or up)\n *\n * @param rootView The view to destroy\n */\nfunction destroyViewTree(rootView) {\n // If the view has no children, we can clean it up and return early.\n let lViewOrLContainer = rootView[CHILD_HEAD];\n if (!lViewOrLContainer) {\n return cleanUpView(rootView[TVIEW], rootView);\n }\n while (lViewOrLContainer) {\n let next = null;\n if (isLView(lViewOrLContainer)) {\n // If LView, traverse down to child.\n next = lViewOrLContainer[CHILD_HEAD];\n }\n else {\n ngDevMode && assertLContainer(lViewOrLContainer);\n // If container, traverse down to its first LView.\n const firstView = lViewOrLContainer[CONTAINER_HEADER_OFFSET];\n if (firstView)\n next = firstView;\n }\n if (!next) {\n // Only clean up view when moving to the side or up, as destroy hooks\n // should be called in order from the bottom up.\n while (lViewOrLContainer && !lViewOrLContainer[NEXT] && lViewOrLContainer !== rootView) {\n if (isLView(lViewOrLContainer)) {\n cleanUpView(lViewOrLContainer[TVIEW], lViewOrLContainer);\n }\n lViewOrLContainer = lViewOrLContainer[PARENT];\n }\n if (lViewOrLContainer === null)\n lViewOrLContainer = rootView;\n if (isLView(lViewOrLContainer)) {\n cleanUpView(lViewOrLContainer[TVIEW], lViewOrLContainer);\n }\n next = lViewOrLContainer && lViewOrLContainer[NEXT];\n }\n lViewOrLContainer = next;\n }\n}\nfunction detachMovedView(declarationContainer, lView) {\n ngDevMode && assertLContainer(declarationContainer);\n ngDevMode &&\n assertDefined(declarationContainer[MOVED_VIEWS], 'A projected view should belong to a non-empty projected views collection');\n const movedViews = declarationContainer[MOVED_VIEWS];\n const declarationViewIndex = movedViews.indexOf(lView);\n movedViews.splice(declarationViewIndex, 1);\n}\n/**\n * A standalone function which destroys an LView,\n * conducting clean up (e.g. removing listeners, calling onDestroys).\n *\n * @param tView The `TView' of the `LView` to be destroyed\n * @param lView The view to be destroyed.\n */\nfunction destroyLView(tView, lView) {\n if (isDestroyed(lView)) {\n return;\n }\n const renderer = lView[RENDERER];\n if (renderer.destroyNode) {\n applyView(tView, lView, renderer, 3 /* WalkTNodeTreeAction.Destroy */, null, null);\n }\n destroyViewTree(lView);\n}\n/**\n * Calls onDestroys hooks for all directives and pipes in a given view and then removes all\n * listeners. Listeners are removed as the last step so events delivered in the onDestroys hooks\n * can be propagated to @Output listeners.\n *\n * @param tView `TView` for the `LView` to clean up.\n * @param lView The LView to clean up\n */\nfunction cleanUpView(tView, lView) {\n if (isDestroyed(lView)) {\n return;\n }\n const prevConsumer = setActiveConsumer(null);\n try {\n // Usually the Attached flag is removed when the view is detached from its parent, however\n // if it's a root view, the flag won't be unset hence why we're also removing on destroy.\n lView[FLAGS] &= ~128 /* LViewFlags.Attached */;\n // Mark the LView as destroyed *before* executing the onDestroy hooks. An onDestroy hook\n // runs arbitrary user code, which could include its own `viewRef.destroy()` (or similar). If\n // We don't flag the view as destroyed before the hooks, this could lead to an infinite loop.\n // This also aligns with the ViewEngine behavior. It also means that the onDestroy hook is\n // really more of an \"afterDestroy\" hook if you think about it.\n lView[FLAGS] |= 256 /* LViewFlags.Destroyed */;\n lView[REACTIVE_TEMPLATE_CONSUMER] && consumerDestroy(lView[REACTIVE_TEMPLATE_CONSUMER]);\n executeOnDestroys(tView, lView);\n processCleanups(tView, lView);\n // For component views only, the local renderer is destroyed at clean up time.\n if (lView[TVIEW].type === 1 /* TViewType.Component */) {\n lView[RENDERER].destroy();\n }\n const declarationContainer = lView[DECLARATION_LCONTAINER];\n // we are dealing with an embedded view that is still inserted into a container\n if (declarationContainer !== null && isLContainer(lView[PARENT])) {\n // and this is a projected view\n if (declarationContainer !== lView[PARENT]) {\n detachMovedView(declarationContainer, lView);\n }\n // For embedded views still attached to a container: remove query result from this view.\n const lQueries = lView[QUERIES];\n if (lQueries !== null) {\n lQueries.detachView(tView);\n }\n }\n // Unregister the view once everything else has been cleaned up.\n unregisterLView(lView);\n }\n finally {\n setActiveConsumer(prevConsumer);\n }\n}\n/** Removes listeners and unsubscribes from output subscriptions */\nfunction processCleanups(tView, lView) {\n ngDevMode && assertNotReactive(processCleanups.name);\n const tCleanup = tView.cleanup;\n const lCleanup = lView[CLEANUP];\n if (tCleanup !== null) {\n for (let i = 0; i < tCleanup.length - 1; i += 2) {\n if (typeof tCleanup[i] === 'string') {\n // This is a native DOM listener. It will occupy 4 entries in the TCleanup array (hence i +=\n // 2 at the end of this block).\n const targetIdx = tCleanup[i + 3];\n ngDevMode && assertNumber(targetIdx, 'cleanup target must be a number');\n if (targetIdx >= 0) {\n // Destroy anything whose teardown is a function call (e.g. QueryList, ModelSignal).\n lCleanup[targetIdx]();\n }\n else {\n // Subscription\n lCleanup[-targetIdx].unsubscribe();\n }\n i += 2;\n }\n else {\n // This is a cleanup function that is grouped with the index of its context\n const context = lCleanup[tCleanup[i + 1]];\n tCleanup[i].call(context);\n }\n }\n }\n if (lCleanup !== null) {\n lView[CLEANUP] = null;\n }\n const destroyHooks = lView[ON_DESTROY_HOOKS];\n if (destroyHooks !== null) {\n // Reset the ON_DESTROY_HOOKS array before iterating over it to prevent hooks that unregister\n // themselves from mutating the array during iteration.\n lView[ON_DESTROY_HOOKS] = null;\n for (let i = 0; i < destroyHooks.length; i++) {\n const destroyHooksFn = destroyHooks[i];\n ngDevMode && assertFunction(destroyHooksFn, 'Expecting destroy hook to be a function.');\n destroyHooksFn();\n }\n }\n // Destroy effects registered to the view. Many of these will have been processed above.\n const effects = lView[EFFECTS];\n if (effects !== null) {\n lView[EFFECTS] = null;\n for (const effect of effects) {\n effect.destroy();\n }\n }\n}\n/** Calls onDestroy hooks for this view */\nfunction executeOnDestroys(tView, lView) {\n ngDevMode && assertNotReactive(executeOnDestroys.name);\n let destroyHooks;\n if (tView != null && (destroyHooks = tView.destroyHooks) != null) {\n for (let i = 0; i < destroyHooks.length; i += 2) {\n const context = lView[destroyHooks[i]];\n // Only call the destroy hook if the context has been requested.\n if (!(context instanceof NodeInjectorFactory)) {\n const toCall = destroyHooks[i + 1];\n if (Array.isArray(toCall)) {\n for (let j = 0; j < toCall.length; j += 2) {\n const callContext = context[toCall[j]];\n const hook = toCall[j + 1];\n profiler(4 /* ProfilerEvent.LifecycleHookStart */, callContext, hook);\n try {\n hook.call(callContext);\n }\n finally {\n profiler(5 /* ProfilerEvent.LifecycleHookEnd */, callContext, hook);\n }\n }\n }\n else {\n profiler(4 /* ProfilerEvent.LifecycleHookStart */, context, toCall);\n try {\n toCall.call(context);\n }\n finally {\n profiler(5 /* ProfilerEvent.LifecycleHookEnd */, context, toCall);\n }\n }\n }\n }\n }\n}\n/**\n * Returns a native element if a node can be inserted into the given parent.\n *\n * There are two reasons why we may not be able to insert a element immediately.\n * - Projection: When creating a child content element of a component, we have to skip the\n * insertion because the content of a component will be projected.\n * `<component><content>delayed due to projection</content></component>`\n * - Parent container is disconnected: This can happen when we are inserting a view into\n * parent container, which itself is disconnected. For example the parent container is part\n * of a View which has not be inserted or is made for projection but has not been inserted\n * into destination.\n *\n * @param tView: Current `TView`.\n * @param tNode: `TNode` for which we wish to retrieve render parent.\n * @param lView: Current `LView`.\n */\nfunction getParentRElement(tView, tNode, lView) {\n return getClosestRElement(tView, tNode.parent, lView);\n}\n/**\n * Get closest `RElement` or `null` if it can't be found.\n *\n * If `TNode` is `TNodeType.Element` => return `RElement` at `LView[tNode.index]` location.\n * If `TNode` is `TNodeType.ElementContainer|IcuContain` => return the parent (recursively).\n * If `TNode` is `null` then return host `RElement`:\n * - return `null` if projection\n * - return `null` if parent container is disconnected (we have no parent.)\n *\n * @param tView: Current `TView`.\n * @param tNode: `TNode` for which we wish to retrieve `RElement` (or `null` if host element is\n * needed).\n * @param lView: Current `LView`.\n * @returns `null` if the `RElement` can't be determined at this time (no parent / projection)\n */\nfunction getClosestRElement(tView, tNode, lView) {\n let parentTNode = tNode;\n // Skip over element and ICU containers as those are represented by a comment node and\n // can't be used as a render parent. Also skip let declarations since they don't have a\n // corresponding DOM node at all.\n while (parentTNode !== null &&\n parentTNode.type & (8 /* TNodeType.ElementContainer */ | 32 /* TNodeType.Icu */ | 128 /* TNodeType.LetDeclaration */)) {\n tNode = parentTNode;\n parentTNode = tNode.parent;\n }\n // If the parent tNode is null, then we are inserting across views: either into an embedded view\n // or a component view.\n if (parentTNode === null) {\n // We are inserting a root element of the component view into the component host element and\n // it should always be eager.\n return lView[HOST];\n }\n else {\n ngDevMode && assertTNodeType(parentTNode, 3 /* TNodeType.AnyRNode */ | 4 /* TNodeType.Container */);\n if (isComponentHost(parentTNode)) {\n ngDevMode && assertTNodeForLView(parentTNode, lView);\n const { encapsulation } = tView.data[parentTNode.directiveStart + parentTNode.componentOffset];\n // We've got a parent which is an element in the current view. We just need to verify if the\n // parent element is not a component. Component's content nodes are not inserted immediately\n // because they will be projected, and so doing insert at this point would be wasteful.\n // Since the projection would then move it to its final destination. Note that we can't\n // make this assumption when using the Shadow DOM, because the native projection placeholders\n // (<content> or <slot>) have to be in place as elements are being inserted.\n if (encapsulation === ViewEncapsulation.None ||\n encapsulation === ViewEncapsulation.Emulated) {\n return null;\n }\n }\n return getNativeByTNode(parentTNode, lView);\n }\n}\n/**\n * Find a node in front of which `currentTNode` should be inserted.\n *\n * This method determines the `RNode` in front of which we should insert the `currentRNode`. This\n * takes `TNode.insertBeforeIndex` into account if i18n code has been invoked.\n *\n * @param parentTNode parent `TNode`\n * @param currentTNode current `TNode` (The node which we would like to insert into the DOM)\n * @param lView current `LView`\n */\nfunction getInsertInFrontOfRNode(parentTNode, currentTNode, lView) {\n return _getInsertInFrontOfRNodeWithI18n(parentTNode, currentTNode, lView);\n}\n/**\n * Find a node in front of which `currentTNode` should be inserted. (Does not take i18n into\n * account)\n *\n * This method determines the `RNode` in front of which we should insert the `currentRNode`. This\n * does not take `TNode.insertBeforeIndex` into account.\n *\n * @param parentTNode parent `TNode`\n * @param currentTNode current `TNode` (The node which we would like to insert into the DOM)\n * @param lView current `LView`\n */\nfunction getInsertInFrontOfRNodeWithNoI18n(parentTNode, currentTNode, lView) {\n if (parentTNode.type & (8 /* TNodeType.ElementContainer */ | 32 /* TNodeType.Icu */)) {\n return getNativeByTNode(parentTNode, lView);\n }\n return null;\n}\n/**\n * Tree shakable boundary for `getInsertInFrontOfRNodeWithI18n` function.\n *\n * This function will only be set if i18n code runs.\n */\nlet _getInsertInFrontOfRNodeWithI18n = getInsertInFrontOfRNodeWithNoI18n;\n/**\n * Tree shakable boundary for `processI18nInsertBefore` function.\n *\n * This function will only be set if i18n code runs.\n */\nlet _processI18nInsertBefore;\nfunction setI18nHandling(getInsertInFrontOfRNodeWithI18n, processI18nInsertBefore) {\n _getInsertInFrontOfRNodeWithI18n = getInsertInFrontOfRNodeWithI18n;\n _processI18nInsertBefore = processI18nInsertBefore;\n}\n/**\n * Appends the `child` native node (or a collection of nodes) to the `parent`.\n *\n * @param tView The `TView' to be appended\n * @param lView The current LView\n * @param childRNode The native child (or children) that should be appended\n * @param childTNode The TNode of the child element\n */\nfunction appendChild(tView, lView, childRNode, childTNode) {\n const parentRNode = getParentRElement(tView, childTNode, lView);\n const renderer = lView[RENDERER];\n const parentTNode = childTNode.parent || lView[T_HOST];\n const anchorNode = getInsertInFrontOfRNode(parentTNode, childTNode, lView);\n if (parentRNode != null) {\n if (Array.isArray(childRNode)) {\n for (let i = 0; i < childRNode.length; i++) {\n nativeAppendOrInsertBefore(renderer, parentRNode, childRNode[i], anchorNode, false);\n }\n }\n else {\n nativeAppendOrInsertBefore(renderer, parentRNode, childRNode, anchorNode, false);\n }\n }\n _processI18nInsertBefore !== undefined &&\n _processI18nInsertBefore(renderer, childTNode, lView, childRNode, parentRNode);\n}\n/**\n * Returns the first native node for a given LView, starting from the provided TNode.\n *\n * Native nodes are returned in the order in which those appear in the native tree (DOM).\n */\nfunction getFirstNativeNode(lView, tNode) {\n if (tNode !== null) {\n ngDevMode &&\n assertTNodeType(tNode, 3 /* TNodeType.AnyRNode */ |\n 12 /* TNodeType.AnyContainer */ |\n 32 /* TNodeType.Icu */ |\n 16 /* TNodeType.Projection */ |\n 128 /* TNodeType.LetDeclaration */);\n const tNodeType = tNode.type;\n if (tNodeType & 3 /* TNodeType.AnyRNode */) {\n return getNativeByTNode(tNode, lView);\n }\n else if (tNodeType & 4 /* TNodeType.Container */) {\n return getBeforeNodeForView(-1, lView[tNode.index]);\n }\n else if (tNodeType & 8 /* TNodeType.ElementContainer */) {\n const elIcuContainerChild = tNode.child;\n if (elIcuContainerChild !== null) {\n return getFirstNativeNode(lView, elIcuContainerChild);\n }\n else {\n const rNodeOrLContainer = lView[tNode.index];\n if (isLContainer(rNodeOrLContainer)) {\n return getBeforeNodeForView(-1, rNodeOrLContainer);\n }\n else {\n return unwrapRNode(rNodeOrLContainer);\n }\n }\n }\n else if (tNodeType & 128 /* TNodeType.LetDeclaration */) {\n return getFirstNativeNode(lView, tNode.next);\n }\n else if (tNodeType & 32 /* TNodeType.Icu */) {\n let nextRNode = icuContainerIterate(tNode, lView);\n let rNode = nextRNode();\n // If the ICU container has no nodes, than we use the ICU anchor as the node.\n return rNode || unwrapRNode(lView[tNode.index]);\n }\n else {\n const projectionNodes = getProjectionNodes(lView, tNode);\n if (projectionNodes !== null) {\n if (Array.isArray(projectionNodes)) {\n return projectionNodes[0];\n }\n const parentView = getLViewParent(lView[DECLARATION_COMPONENT_VIEW]);\n ngDevMode && assertParentView(parentView);\n return getFirstNativeNode(parentView, projectionNodes);\n }\n else {\n return getFirstNativeNode(lView, tNode.next);\n }\n }\n }\n return null;\n}\nfunction getProjectionNodes(lView, tNode) {\n if (tNode !== null) {\n const componentView = lView[DECLARATION_COMPONENT_VIEW];\n const componentHost = componentView[T_HOST];\n const slotIdx = tNode.projection;\n ngDevMode && assertProjectionSlots(lView);\n return componentHost.projection[slotIdx];\n }\n return null;\n}\nfunction getBeforeNodeForView(viewIndexInContainer, lContainer) {\n const nextViewIndex = CONTAINER_HEADER_OFFSET + viewIndexInContainer + 1;\n if (nextViewIndex < lContainer.length) {\n const lView = lContainer[nextViewIndex];\n const firstTNodeOfView = lView[TVIEW].firstChild;\n if (firstTNodeOfView !== null) {\n return getFirstNativeNode(lView, firstTNodeOfView);\n }\n }\n return lContainer[NATIVE];\n}\n/**\n * Performs the operation of `action` on the node. Typically this involves inserting or removing\n * nodes on the LView or projection boundary.\n */\nfunction applyNodes(renderer, action, tNode, lView, parentRElement, beforeNode, isProjection) {\n while (tNode != null) {\n ngDevMode && assertTNodeForLView(tNode, lView);\n // Let declarations don't have corresponding DOM nodes so we skip over them.\n if (tNode.type === 128 /* TNodeType.LetDeclaration */) {\n tNode = tNode.next;\n continue;\n }\n ngDevMode &&\n assertTNodeType(tNode, 3 /* TNodeType.AnyRNode */ | 12 /* TNodeType.AnyContainer */ | 16 /* TNodeType.Projection */ | 32 /* TNodeType.Icu */);\n const rawSlotValue = lView[tNode.index];\n const tNodeType = tNode.type;\n if (isProjection) {\n if (action === 0 /* WalkTNodeTreeAction.Create */) {\n rawSlotValue && attachPatchData(unwrapRNode(rawSlotValue), lView);\n tNode.flags |= 2 /* TNodeFlags.isProjected */;\n }\n }\n if (!isDetachedByI18n(tNode)) {\n if (tNodeType & 8 /* TNodeType.ElementContainer */) {\n applyNodes(renderer, action, tNode.child, lView, parentRElement, beforeNode, false);\n applyToElementOrContainer(action, renderer, parentRElement, rawSlotValue, beforeNode);\n }\n else if (tNodeType & 32 /* TNodeType.Icu */) {\n const nextRNode = icuContainerIterate(tNode, lView);\n let rNode;\n while ((rNode = nextRNode())) {\n applyToElementOrContainer(action, renderer, parentRElement, rNode, beforeNode);\n }\n applyToElementOrContainer(action, renderer, parentRElement, rawSlotValue, beforeNode);\n }\n else if (tNodeType & 16 /* TNodeType.Projection */) {\n applyProjectionRecursive(renderer, action, lView, tNode, parentRElement, beforeNode);\n }\n else {\n ngDevMode && assertTNodeType(tNode, 3 /* TNodeType.AnyRNode */ | 4 /* TNodeType.Container */);\n applyToElementOrContainer(action, renderer, parentRElement, rawSlotValue, beforeNode);\n }\n }\n tNode = isProjection ? tNode.projectionNext : tNode.next;\n }\n}\nfunction applyView(tView, lView, renderer, action, parentRElement, beforeNode) {\n applyNodes(renderer, action, tView.firstChild, lView, parentRElement, beforeNode, false);\n}\n/**\n * `applyProjection` performs operation on the projection.\n *\n * Inserting a projection requires us to locate the projected nodes from the parent component. The\n * complication is that those nodes themselves could be re-projected from their parent component.\n *\n * @param tView The `TView` of `LView` which needs to be inserted, detached, destroyed\n * @param lView The `LView` which needs to be inserted, detached, destroyed.\n * @param tProjectionNode node to project\n */\nfunction applyProjection(tView, lView, tProjectionNode) {\n const renderer = lView[RENDERER];\n const parentRNode = getParentRElement(tView, tProjectionNode, lView);\n const parentTNode = tProjectionNode.parent || lView[T_HOST];\n let beforeNode = getInsertInFrontOfRNode(parentTNode, tProjectionNode, lView);\n applyProjectionRecursive(renderer, 0 /* WalkTNodeTreeAction.Create */, lView, tProjectionNode, parentRNode, beforeNode);\n}\n/**\n * `applyProjectionRecursive` performs operation on the projection specified by `action` (insert,\n * detach, destroy)\n *\n * Inserting a projection requires us to locate the projected nodes from the parent component. The\n * complication is that those nodes themselves could be re-projected from their parent component.\n *\n * @param renderer Render to use\n * @param action action to perform (insert, detach, destroy)\n * @param lView The LView which needs to be inserted, detached, destroyed.\n * @param tProjectionNode node to project\n * @param parentRElement parent DOM element for insertion/removal.\n * @param beforeNode Before which node the insertions should happen.\n */\nfunction applyProjectionRecursive(renderer, action, lView, tProjectionNode, parentRElement, beforeNode) {\n const componentLView = lView[DECLARATION_COMPONENT_VIEW];\n const componentNode = componentLView[T_HOST];\n ngDevMode &&\n assertEqual(typeof tProjectionNode.projection, 'number', 'expecting projection index');\n const nodeToProjectOrRNodes = componentNode.projection[tProjectionNode.projection];\n if (Array.isArray(nodeToProjectOrRNodes)) {\n // This should not exist, it is a bit of a hack. When we bootstrap a top level node and we\n // need to support passing projectable nodes, so we cheat and put them in the TNode\n // of the Host TView. (Yes we put instance info at the T Level). We can get away with it\n // because we know that TView is not shared and therefore it will not be a problem.\n // This should be refactored and cleaned up.\n for (let i = 0; i < nodeToProjectOrRNodes.length; i++) {\n const rNode = nodeToProjectOrRNodes[i];\n applyToElementOrContainer(action, renderer, parentRElement, rNode, beforeNode);\n }\n }\n else {\n let nodeToProject = nodeToProjectOrRNodes;\n const projectedComponentLView = componentLView[PARENT];\n // If a parent <ng-content> is located within a skip hydration block,\n // annotate an actual node that is being projected with the same flag too.\n if (hasInSkipHydrationBlockFlag(tProjectionNode)) {\n nodeToProject.flags |= 128 /* TNodeFlags.inSkipHydrationBlock */;\n }\n applyNodes(renderer, action, nodeToProject, projectedComponentLView, parentRElement, beforeNode, true);\n }\n}\n/**\n * `applyContainer` performs an operation on the container and its views as specified by\n * `action` (insert, detach, destroy)\n *\n * Inserting a Container is complicated by the fact that the container may have Views which\n * themselves have containers or projections.\n *\n * @param renderer Renderer to use\n * @param action action to perform (insert, detach, destroy)\n * @param lContainer The LContainer which needs to be inserted, detached, destroyed.\n * @param parentRElement parent DOM element for insertion/removal.\n * @param beforeNode Before which node the insertions should happen.\n */\nfunction applyContainer(renderer, action, lContainer, parentRElement, beforeNode) {\n ngDevMode && assertLContainer(lContainer);\n const anchor = lContainer[NATIVE]; // LContainer has its own before node.\n const native = unwrapRNode(lContainer);\n // An LContainer can be created dynamically on any node by injecting ViewContainerRef.\n // Asking for a ViewContainerRef on an element will result in a creation of a separate anchor\n // node (comment in the DOM) that will be different from the LContainer's host node. In this\n // particular case we need to execute action on 2 nodes:\n // - container's host node (this is done in the executeActionOnElementOrContainer)\n // - container's host node (this is done here)\n if (anchor !== native) {\n // This is very strange to me (Misko). I would expect that the native is same as anchor. I\n // don't see a reason why they should be different, but they are.\n //\n // If they are we need to process the second anchor as well.\n applyToElementOrContainer(action, renderer, parentRElement, anchor, beforeNode);\n }\n for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {\n const lView = lContainer[i];\n applyView(lView[TVIEW], lView, renderer, action, parentRElement, anchor);\n }\n}\n/**\n * Writes class/style to element.\n *\n * @param renderer Renderer to use.\n * @param isClassBased `true` if it should be written to `class` (`false` to write to `style`)\n * @param rNode The Node to write to.\n * @param prop Property to write to. This would be the class/style name.\n * @param value Value to write. If `null`/`undefined`/`false` this is considered a remove (set/add\n * otherwise).\n */\nfunction applyStyling(renderer, isClassBased, rNode, prop, value) {\n if (isClassBased) {\n // We actually want JS true/false here because any truthy value should add the class\n if (!value) {\n renderer.removeClass(rNode, prop);\n }\n else {\n renderer.addClass(rNode, prop);\n }\n }\n else {\n let flags = prop.indexOf('-') === -1 ? undefined : RendererStyleFlags2.DashCase;\n if (value == null /** || value === undefined */) {\n renderer.removeStyle(rNode, prop, flags);\n }\n else {\n // A value is important if it ends with `!important`. The style\n // parser strips any semicolons at the end of the value.\n const isImportant = typeof value === 'string' ? value.endsWith('!important') : false;\n if (isImportant) {\n // !important has to be stripped from the value for it to be valid.\n value = value.slice(0, -10);\n flags |= RendererStyleFlags2.Important;\n }\n renderer.setStyle(rNode, prop, value, flags);\n }\n }\n}\n\nfunction executeTemplate(tView, lView, templateFn, rf, context) {\n const prevSelectedIndex = getSelectedIndex();\n const isUpdatePhase = rf & 2 /* RenderFlags.Update */;\n try {\n setSelectedIndex(-1);\n if (isUpdatePhase && lView.length > HEADER_OFFSET) {\n // When we're updating, inherently select 0 so we don't\n // have to generate that instruction for most update blocks.\n selectIndexInternal(tView, lView, HEADER_OFFSET, !!ngDevMode && isInCheckNoChangesMode());\n }\n const preHookType = isUpdatePhase\n ? 2 /* ProfilerEvent.TemplateUpdateStart */\n : 0 /* ProfilerEvent.TemplateCreateStart */;\n profiler(preHookType, context, templateFn);\n templateFn(rf, context);\n }\n finally {\n setSelectedIndex(prevSelectedIndex);\n const postHookType = isUpdatePhase\n ? 3 /* ProfilerEvent.TemplateUpdateEnd */\n : 1 /* ProfilerEvent.TemplateCreateEnd */;\n profiler(postHookType, context, templateFn);\n }\n}\n/**\n * Creates directive instances.\n */\nfunction createDirectivesInstances(tView, lView, tNode) {\n instantiateAllDirectives(tView, lView, tNode);\n if ((tNode.flags & 64 /* TNodeFlags.hasHostBindings */) === 64 /* TNodeFlags.hasHostBindings */) {\n invokeDirectivesHostBindings(tView, lView, tNode);\n }\n}\n/**\n * Takes a list of local names and indices and pushes the resolved local variable values\n * to LView in the same order as they are loaded in the template with load().\n */\nfunction saveResolvedLocalsInData(viewData, tNode, localRefExtractor = getNativeByTNode) {\n const localNames = tNode.localNames;\n if (localNames !== null) {\n let localIndex = tNode.index + 1;\n for (let i = 0; i < localNames.length; i += 2) {\n const index = localNames[i + 1];\n const value = index === -1\n ? localRefExtractor(tNode, viewData)\n : viewData[index];\n viewData[localIndex++] = value;\n }\n }\n}\n/**\n * Locates the host native element, used for bootstrapping existing nodes into rendering pipeline.\n *\n * @param renderer the renderer used to locate the element.\n * @param elementOrSelector Render element or CSS selector to locate the element.\n * @param encapsulation View Encapsulation defined for component that requests host element.\n * @param injector Root view injector instance.\n */\nfunction locateHostElement(renderer, elementOrSelector, encapsulation, injector) {\n // Note: we use default value for the `PRESERVE_HOST_CONTENT` here even though it's a\n // tree-shakable one (providedIn:'root'). This code path can be triggered during dynamic\n // component creation (after calling ViewContainerRef.createComponent) when an injector\n // instance can be provided. The injector instance might be disconnected from the main DI\n // tree, thus the `PRESERVE_HOST_CONTENT` would not be able to instantiate. In this case, the\n // default value will be used.\n const preserveHostContent = injector.get(PRESERVE_HOST_CONTENT, PRESERVE_HOST_CONTENT_DEFAULT);\n // When using native Shadow DOM, do not clear host element to allow native slot\n // projection.\n const preserveContent = preserveHostContent || encapsulation === ViewEncapsulation.ShadowDom;\n const rootElement = renderer.selectRootElement(elementOrSelector, preserveContent);\n applyRootElementTransform(rootElement);\n return rootElement;\n}\n/**\n * Applies any root element transformations that are needed. If hydration is enabled,\n * this will process corrupted text nodes.\n *\n * @param rootElement the app root HTML Element\n */\nfunction applyRootElementTransform(rootElement) {\n _applyRootElementTransformImpl(rootElement);\n}\n/**\n * Reference to a function that applies transformations to the root HTML element\n * of an app. When hydration is enabled, this processes any corrupt text nodes\n * so they are properly hydratable on the client.\n *\n * @param rootElement the app root HTML Element\n */\nlet _applyRootElementTransformImpl = () => null;\n/**\n * Processes text node markers before hydration begins. This replaces any special comment\n * nodes that were added prior to serialization are swapped out to restore proper text\n * nodes before hydration.\n *\n * @param rootElement the app root HTML Element\n */\nfunction applyRootElementTransformImpl(rootElement) {\n if (hasSkipHydrationAttrOnRElement(rootElement)) {\n // Handle a situation when the `ngSkipHydration` attribute is applied\n // to the root node of an application. In this case, we should clear\n // the contents and render everything from scratch.\n clearElementContents(rootElement);\n }\n else {\n processTextNodeMarkersBeforeHydration(rootElement);\n }\n}\n/**\n * Sets the implementation for the `applyRootElementTransform` function.\n */\nfunction enableApplyRootElementTransformImpl() {\n _applyRootElementTransformImpl = applyRootElementTransformImpl;\n}\n/**\n * Mapping between attributes names that don't correspond to their element property names.\n *\n * Performance note: this function is written as a series of if checks (instead of, say, a property\n * object lookup) for performance reasons - the series of `if` checks seems to be the fastest way of\n * mapping property names. Do NOT change without benchmarking.\n *\n * Note: this mapping has to be kept in sync with the equivalent mappings in the compiler.\n */\nfunction mapPropName(name) {\n if (name === 'class')\n return 'className';\n if (name === 'for')\n return 'htmlFor';\n if (name === 'formaction')\n return 'formAction';\n if (name === 'innerHtml')\n return 'innerHTML';\n if (name === 'readonly')\n return 'readOnly';\n if (name === 'tabindex')\n return 'tabIndex';\n return name;\n}\nfunction setPropertyAndInputs(tNode, lView, propName, value, renderer, sanitizer) {\n ngDevMode && assertNotSame(value, NO_CHANGE, 'Incoming value should never be NO_CHANGE.');\n const tView = lView[TVIEW];\n const hasSetInput = setAllInputsForProperty(tNode, tView, lView, propName, value);\n if (hasSetInput) {\n isComponentHost(tNode) && markDirtyIfOnPush(lView, tNode.index);\n ngDevMode && setNgReflectProperties(lView, tView, tNode, propName, value);\n return; // Stop propcessing if we've matched at least one input.\n }\n // If the property is going to a DOM node, we have to remap it.\n if (tNode.type & 3 /* TNodeType.AnyRNode */) {\n propName = mapPropName(propName);\n }\n setDomProperty(tNode, lView, propName, value, renderer, sanitizer);\n}\n/**\n * Sets a DOM property on a specific node.\n * @param tNode TNode on which to set the value.\n * @param lView View in which the node is located.\n * @param propName Name of the property.\n * @param value Value to set on the property.\n * @param renderer Renderer to use when setting the property.\n * @param sanitizer Function used to sanitize the value before setting it.\n */\nfunction setDomProperty(tNode, lView, propName, value, renderer, sanitizer) {\n if (tNode.type & 3 /* TNodeType.AnyRNode */) {\n const element = getNativeByTNode(tNode, lView);\n if (ngDevMode) {\n validateAgainstEventProperties(propName);\n if (!isPropertyValid(element, propName, tNode.value, lView[TVIEW].schemas)) {\n handleUnknownPropertyError(propName, tNode.value, tNode.type, lView);\n }\n }\n // It is assumed that the sanitizer is only added when the compiler determines that the\n // property is risky, so sanitization can be done without further checks.\n value = sanitizer != null ? sanitizer(value, tNode.value || '', propName) : value;\n renderer.setProperty(element, propName, value);\n }\n else if (tNode.type & 12 /* TNodeType.AnyContainer */) {\n // If the node is a container and the property didn't\n // match any of the inputs or schemas we should throw.\n if (ngDevMode && !matchingSchemas(lView[TVIEW].schemas, tNode.value)) {\n handleUnknownPropertyError(propName, tNode.value, tNode.type, lView);\n }\n }\n}\n/** If node is an OnPush component, marks its LView dirty. */\nfunction markDirtyIfOnPush(lView, viewIndex) {\n ngDevMode && assertLView(lView);\n const childComponentLView = getComponentLViewByIndex(viewIndex, lView);\n if (!(childComponentLView[FLAGS] & 16 /* LViewFlags.CheckAlways */)) {\n childComponentLView[FLAGS] |= 64 /* LViewFlags.Dirty */;\n }\n}\nfunction setNgReflectProperty(lView, tNode, attrName, value) {\n const environment = lView[ENVIRONMENT];\n if (!environment.ngReflect) {\n return;\n }\n const element = getNativeByTNode(tNode, lView);\n const renderer = lView[RENDERER];\n attrName = normalizeDebugBindingName(attrName);\n const debugValue = normalizeDebugBindingValue(value);\n if (tNode.type & 3 /* TNodeType.AnyRNode */) {\n if (value == null) {\n renderer.removeAttribute(element, attrName);\n }\n else {\n renderer.setAttribute(element, attrName, debugValue);\n }\n }\n else {\n const textContent = escapeCommentText(`bindings=${JSON.stringify({ [attrName]: debugValue }, null, 2)}`);\n renderer.setValue(element, textContent);\n }\n}\nfunction setNgReflectProperties(lView, tView, tNode, publicName, value) {\n const environment = lView[ENVIRONMENT];\n if (!environment.ngReflect || !(tNode.type & (3 /* TNodeType.AnyRNode */ | 4 /* TNodeType.Container */))) {\n return;\n }\n const inputConfig = tNode.inputs?.[publicName];\n const hostInputConfig = tNode.hostDirectiveInputs?.[publicName];\n if (hostInputConfig) {\n for (let i = 0; i < hostInputConfig.length; i += 2) {\n const index = hostInputConfig[i];\n const publicName = hostInputConfig[i + 1];\n const def = tView.data[index];\n setNgReflectProperty(lView, tNode, def.inputs[publicName][0], value);\n }\n }\n // Note: we set the private name of the input as the reflected property, not the public one.\n if (inputConfig) {\n for (const index of inputConfig) {\n const def = tView.data[index];\n setNgReflectProperty(lView, tNode, def.inputs[publicName][0], value);\n }\n }\n}\n/**\n * Instantiate all the directives that were previously resolved on the current node.\n */\nfunction instantiateAllDirectives(tView, lView, tNode) {\n const start = tNode.directiveStart;\n const end = tNode.directiveEnd;\n // The component view needs to be created before creating the node injector\n // since it is used to inject some special symbols like `ChangeDetectorRef`.\n if (isComponentHost(tNode)) {\n ngDevMode && assertTNodeType(tNode, 3 /* TNodeType.AnyRNode */);\n createComponentLView(lView, tNode, tView.data[start + tNode.componentOffset]);\n }\n if (!tView.firstCreatePass) {\n getOrCreateNodeInjectorForNode(tNode, lView);\n }\n const initialInputs = tNode.initialInputs;\n for (let i = start; i < end; i++) {\n const def = tView.data[i];\n const directive = getNodeInjectable(lView, tView, i, tNode);\n attachPatchData(directive, lView);\n if (initialInputs !== null) {\n setInputsFromAttrs(lView, i - start, directive, def, tNode, initialInputs);\n }\n if (isComponentDef(def)) {\n const componentView = getComponentLViewByIndex(tNode.index, lView);\n componentView[CONTEXT] = getNodeInjectable(lView, tView, i, tNode);\n }\n }\n}\nfunction invokeDirectivesHostBindings(tView, lView, tNode) {\n const start = tNode.directiveStart;\n const end = tNode.directiveEnd;\n const elementIndex = tNode.index;\n const currentDirectiveIndex = getCurrentDirectiveIndex();\n try {\n setSelectedIndex(elementIndex);\n for (let dirIndex = start; dirIndex < end; dirIndex++) {\n const def = tView.data[dirIndex];\n const directive = lView[dirIndex];\n setCurrentDirectiveIndex(dirIndex);\n if (def.hostBindings !== null || def.hostVars !== 0 || def.hostAttrs !== null) {\n invokeHostBindingsInCreationMode(def, directive);\n }\n }\n }\n finally {\n setSelectedIndex(-1);\n setCurrentDirectiveIndex(currentDirectiveIndex);\n }\n}\n/**\n * Invoke the host bindings in creation mode.\n *\n * @param def `DirectiveDef` which may contain the `hostBindings` function.\n * @param directive Instance of directive.\n */\nfunction invokeHostBindingsInCreationMode(def, directive) {\n if (def.hostBindings !== null) {\n def.hostBindings(1 /* RenderFlags.Create */, directive);\n }\n}\n/**\n * Matches the current node against all available selectors.\n * If a component is matched (at most one), it is returned in first position in the array.\n */\nfunction findDirectiveDefMatches(tView, tNode) {\n ngDevMode && assertFirstCreatePass(tView);\n ngDevMode && assertTNodeType(tNode, 3 /* TNodeType.AnyRNode */ | 12 /* TNodeType.AnyContainer */);\n const registry = tView.directiveRegistry;\n let matches = null;\n if (registry) {\n for (let i = 0; i < registry.length; i++) {\n const def = registry[i];\n if (isNodeMatchingSelectorList(tNode, def.selectors, /* isProjectionMode */ false)) {\n matches ??= [];\n if (isComponentDef(def)) {\n if (ngDevMode) {\n assertTNodeType(tNode, 2 /* TNodeType.Element */, `\"${tNode.value}\" tags cannot be used as component hosts. ` +\n `Please use a different tag to activate the ${stringify(def.type)} component.`);\n if (matches.length && isComponentDef(matches[0])) {\n throwMultipleComponentError(tNode, matches.find(isComponentDef).type, def.type);\n }\n }\n matches.unshift(def);\n }\n else {\n matches.push(def);\n }\n }\n }\n }\n return matches;\n}\nfunction elementAttributeInternal(tNode, lView, name, value, sanitizer, namespace) {\n if (ngDevMode) {\n assertNotSame(value, NO_CHANGE, 'Incoming value should never be NO_CHANGE.');\n validateAgainstEventAttributes(name);\n assertTNodeType(tNode, 2 /* TNodeType.Element */, `Attempted to set attribute \\`${name}\\` on a container node. ` +\n `Host bindings are not valid on ng-container or ng-template.`);\n }\n const element = getNativeByTNode(tNode, lView);\n setElementAttribute(lView[RENDERER], element, namespace, tNode.value, name, value, sanitizer);\n}\nfunction setElementAttribute(renderer, element, namespace, tagName, name, value, sanitizer) {\n if (value == null) {\n renderer.removeAttribute(element, name, namespace);\n }\n else {\n const strValue = sanitizer == null ? renderStringify(value) : sanitizer(value, tagName || '', name);\n renderer.setAttribute(element, name, strValue, namespace);\n }\n}\n/**\n * Sets initial input properties on directive instances from attribute data\n *\n * @param lView Current LView that is being processed.\n * @param directiveIndex Index of the directive in directives array\n * @param instance Instance of the directive on which to set the initial inputs\n * @param def The directive def that contains the list of inputs\n * @param tNode The static data for this node\n */\nfunction setInputsFromAttrs(lView, directiveIndex, instance, def, tNode, initialInputData) {\n const initialInputs = initialInputData[directiveIndex];\n if (initialInputs !== null) {\n for (let i = 0; i < initialInputs.length; i += 2) {\n const lookupName = initialInputs[i];\n const value = initialInputs[i + 1];\n writeToDirectiveInput(def, instance, lookupName, value);\n if (ngDevMode) {\n setNgReflectProperty(lView, tNode, def.inputs[lookupName][0], value);\n }\n }\n }\n}\n/** Shared code between instructions that indicate the start of an element. */\nfunction elementLikeStartShared(tNode, lView, index, name, locateOrCreateNativeNode) {\n const adjustedIndex = HEADER_OFFSET + index;\n const tView = lView[TVIEW];\n const native = locateOrCreateNativeNode(tView, lView, tNode, name, index);\n lView[adjustedIndex] = native;\n setCurrentTNode(tNode, true);\n // It's important that this runs before we've instantiated the directives.\n const isElement = tNode.type === 2 /* TNodeType.Element */;\n if (isElement) {\n setupStaticAttributes(lView[RENDERER], native, tNode);\n // any immediate children of a component or template container must be pre-emptively\n // monkey-patched with the component view data so that the element can be inspected\n // later on using any element discovery utility methods (see `element_discovery.ts`)\n if (getElementDepthCount() === 0 || isDirectiveHost(tNode)) {\n attachPatchData(native, lView);\n }\n increaseElementDepthCount();\n }\n else {\n attachPatchData(native, lView);\n }\n if (wasLastNodeCreated() && (!isElement || !isDetachedByI18n(tNode))) {\n // In the i18n case, the translation may have removed this element, so only add it if it is not\n // detached. See `TNodeType.Placeholder` and `LFrame.inI18n` for more context.\n appendChild(tView, lView, native, tNode);\n }\n return tNode;\n}\n/** Shared code between instructions that indicate the end of an element. */\nfunction elementLikeEndShared(tNode) {\n let currentTNode = tNode;\n if (isCurrentTNodeParent()) {\n setCurrentTNodeAsNotParent();\n }\n else {\n ngDevMode && assertHasParent(getCurrentTNode());\n currentTNode = currentTNode.parent;\n setCurrentTNode(currentTNode, false);\n }\n return currentTNode;\n}\n///////////////////////////////\n//// Bindings & interpolations\n///////////////////////////////\n/**\n * Stores meta-data for a property binding to be used by TestBed's `DebugElement.properties`.\n *\n * In order to support TestBed's `DebugElement.properties` we need to save, for each binding:\n * - a bound property name;\n * - a static parts of interpolated strings;\n *\n * A given property metadata is saved at the binding's index in the `TView.data` (in other words, a\n * property binding metadata will be stored in `TView.data` at the same index as a bound value in\n * `LView`). Metadata are represented as `INTERPOLATION_DELIMITER`-delimited string with the\n * following format:\n * - `propertyName` for bound properties;\n * - `propertyName<6D>prefix<69>interpolation_static_part1<74>..interpolation_static_partN<74>suffix` for\n * interpolated properties.\n *\n * @param tData `TData` where meta-data will be saved;\n * @param tNode `TNode` that is a target of the binding;\n * @param propertyName bound property name;\n * @param bindingIndex binding index in `LView`\n * @param interpolationParts static interpolation parts (for property interpolations)\n */\nfunction storePropertyBindingMetadata(tData, tNode, propertyName, bindingIndex, ...interpolationParts) {\n // Binding meta-data are stored only the first time a given property instruction is processed.\n // Since we don't have a concept of the \"first update pass\" we need to check for presence of the\n // binding meta-data to decide if one should be stored (or if was stored already).\n if (tData[bindingIndex] === null) {\n if (!tNode.inputs?.[propertyName] && !tNode.hostDirectiveInputs?.[propertyName]) {\n const propBindingIdxs = tNode.propertyBindings || (tNode.propertyBindings = []);\n propBindingIdxs.push(bindingIndex);\n let bindingMetadata = propertyName;\n if (interpolationParts.length > 0) {\n bindingMetadata +=\n INTERPOLATION_DELIMITER + interpolationParts.join(INTERPOLATION_DELIMITER);\n }\n tData[bindingIndex] = bindingMetadata;\n }\n }\n}\n/**\n * There are cases where the sub component's renderer needs to be included\n * instead of the current renderer (see the componentSyntheticHost* instructions).\n */\nfunction loadComponentRenderer(currentDef, tNode, lView) {\n // TODO(FW-2043): the `currentDef` is null when host bindings are invoked while creating root\n // component (see packages/core/src/render3/component.ts). This is not consistent with the process\n // of creating inner components, when current directive index is available in the state. In order\n // to avoid relying on current def being `null` (thus special-casing root component creation), the\n // process of creating root component should be unified with the process of creating inner\n // components.\n if (currentDef === null || isComponentDef(currentDef)) {\n lView = unwrapLView(lView[tNode.index]);\n }\n return lView[RENDERER];\n}\n/** Handles an error thrown in an LView. */\nfunction handleUncaughtError(lView, error) {\n const injector = lView[INJECTOR];\n if (!injector) {\n return;\n }\n const errorHandler = injector.get(INTERNAL_APPLICATION_ERROR_HANDLER, null);\n errorHandler?.(error);\n}\n/**\n * Set all directive inputs with the specific public name on the node.\n *\n * @param tNode TNode on which the input is being set.\n * @param tView Current TView\n * @param lView `LView` which contains the directives.\n * @param publicName Public name of the input being set.\n * @param value Value to set.\n */\nfunction setAllInputsForProperty(tNode, tView, lView, publicName, value) {\n const inputs = tNode.inputs?.[publicName];\n const hostDirectiveInputs = tNode.hostDirectiveInputs?.[publicName];\n let hasMatch = false;\n if (hostDirectiveInputs) {\n for (let i = 0; i < hostDirectiveInputs.length; i += 2) {\n const index = hostDirectiveInputs[i];\n ngDevMode && assertIndexInRange(lView, index);\n const publicName = hostDirectiveInputs[i + 1];\n const def = tView.data[index];\n writeToDirectiveInput(def, lView[index], publicName, value);\n hasMatch = true;\n }\n }\n if (inputs) {\n for (const index of inputs) {\n ngDevMode && assertIndexInRange(lView, index);\n const instance = lView[index];\n const def = tView.data[index];\n writeToDirectiveInput(def, instance, publicName, value);\n hasMatch = true;\n }\n }\n return hasMatch;\n}\n/**\n * Sets an input value only on a specific directive and its host directives.\n * @param tNode TNode on which the input is being set.\n * @param tView Current TView\n * @param lView `LView` which contains the directives.\n * @param target Directive on which to set the input.\n * @param publicName Public name of the input being set.\n * @param value Value to set.\n */\nfunction setDirectiveInput(tNode, tView, lView, target, publicName, value) {\n let hostIndex = null;\n let hostDirectivesStart = null;\n let hostDirectivesEnd = null;\n let hasSet = false;\n if (ngDevMode && !tNode.directiveToIndex?.has(target.type)) {\n throw new Error(`Node does not have a directive with type ${target.type.name}`);\n }\n const data = tNode.directiveToIndex.get(target.type);\n if (typeof data === 'number') {\n hostIndex = data;\n }\n else {\n [hostIndex, hostDirectivesStart, hostDirectivesEnd] = data;\n }\n if (hostDirectivesStart !== null &&\n hostDirectivesEnd !== null &&\n tNode.hostDirectiveInputs?.hasOwnProperty(publicName)) {\n const hostDirectiveInputs = tNode.hostDirectiveInputs[publicName];\n for (let i = 0; i < hostDirectiveInputs.length; i += 2) {\n const index = hostDirectiveInputs[i];\n if (index >= hostDirectivesStart && index <= hostDirectivesEnd) {\n ngDevMode && assertIndexInRange(lView, index);\n const def = tView.data[index];\n const hostDirectivePublicName = hostDirectiveInputs[i + 1];\n writeToDirectiveInput(def, lView[index], hostDirectivePublicName, value);\n hasSet = true;\n }\n else if (index > hostDirectivesEnd) {\n // Directives here are in ascending order so we can stop looking once we're past the range.\n break;\n }\n }\n }\n if (hostIndex !== null && target.inputs.hasOwnProperty(publicName)) {\n ngDevMode && assertIndexInRange(lView, hostIndex);\n writeToDirectiveInput(target, lView[hostIndex], publicName, value);\n hasSet = true;\n }\n return hasSet;\n}\n\nfunction renderComponent(hostLView, componentHostIdx) {\n ngDevMode && assertEqual(isCreationMode(hostLView), true, 'Should be run in creation mode');\n const componentView = getComponentLViewByIndex(componentHostIdx, hostLView);\n const componentTView = componentView[TVIEW];\n syncViewWithBlueprint(componentTView, componentView);\n const hostRNode = componentView[HOST];\n // Populate an LView with hydration info retrieved from the DOM via TransferState.\n if (hostRNode !== null && componentView[HYDRATION] === null) {\n componentView[HYDRATION] = retrieveHydrationInfo(hostRNode, componentView[INJECTOR]);\n }\n profiler(18 /* ProfilerEvent.ComponentStart */);\n renderView(componentTView, componentView, componentView[CONTEXT]);\n profiler(19 /* ProfilerEvent.ComponentEnd */, componentView[CONTEXT]);\n}\n/**\n * Syncs an LView instance with its blueprint if they have gotten out of sync.\n *\n * Typically, blueprints and their view instances should always be in sync, so the loop here\n * will be skipped. However, consider this case of two components side-by-side:\n *\n * App template:\n * ```html\n * <comp></comp>\n * <comp></comp>\n * ```\n *\n * The following will happen:\n * 1. App template begins processing.\n * 2. First <comp> is matched as a component and its LView is created.\n * 3. Second <comp> is matched as a component and its LView is created.\n * 4. App template completes processing, so it's time to check child templates.\n * 5. First <comp> template is checked. It has a directive, so its def is pushed to blueprint.\n * 6. Second <comp> template is checked. Its blueprint has been updated by the first\n * <comp> template, but its LView was created before this update, so it is out of sync.\n *\n * Note that embedded views inside ngFor loops will never be out of sync because these views\n * are processed as soon as they are created.\n *\n * @param tView The `TView` that contains the blueprint for syncing\n * @param lView The view to sync\n */\nfunction syncViewWithBlueprint(tView, lView) {\n for (let i = lView.length; i < tView.blueprint.length; i++) {\n lView.push(tView.blueprint[i]);\n }\n}\n/**\n * Processes a view in the creation mode. This includes a number of steps in a specific order:\n * - creating view query functions (if any);\n * - executing a template function in the creation mode;\n * - updating static queries (if any);\n * - creating child components defined in a given view.\n */\nfunction renderView(tView, lView, context) {\n ngDevMode && assertEqual(isCreationMode(lView), true, 'Should be run in creation mode');\n ngDevMode && assertNotReactive(renderView.name);\n enterView(lView);\n try {\n const viewQuery = tView.viewQuery;\n if (viewQuery !== null) {\n executeViewQueryFn(1 /* RenderFlags.Create */, viewQuery, context);\n }\n // Execute a template associated with this view, if it exists. A template function might not be\n // defined for the root component views.\n const templateFn = tView.template;\n if (templateFn !== null) {\n executeTemplate(tView, lView, templateFn, 1 /* RenderFlags.Create */, context);\n }\n // This needs to be set before children are processed to support recursive components.\n // This must be set to false immediately after the first creation run because in an\n // ngFor loop, all the views will be created together before update mode runs and turns\n // off firstCreatePass. If we don't set it here, instances will perform directive\n // matching, etc again and again.\n if (tView.firstCreatePass) {\n tView.firstCreatePass = false;\n }\n // Mark all queries active in this view as dirty. This is necessary for signal-based queries to\n // have a clear marking point where we can read query results atomically (for a given view).\n lView[QUERIES]?.finishViewCreation(tView);\n // We resolve content queries specifically marked as `static` in creation mode. Dynamic\n // content queries are resolved during change detection (i.e. update mode), after embedded\n // views are refreshed (see block above).\n if (tView.staticContentQueries) {\n refreshContentQueries(tView, lView);\n }\n // We must materialize query results before child components are processed\n // in case a child component has projected a container. The LContainer needs\n // to exist so the embedded views are properly attached by the container.\n if (tView.staticViewQueries) {\n executeViewQueryFn(2 /* RenderFlags.Update */, tView.viewQuery, context);\n }\n // Render child component views.\n const components = tView.components;\n if (components !== null) {\n renderChildComponents(lView, components);\n }\n }\n catch (error) {\n // If we didn't manage to get past the first template pass due to\n // an error, mark the view as corrupted so we can try to recover.\n if (tView.firstCreatePass) {\n tView.incompleteFirstPass = true;\n tView.firstCreatePass = false;\n }\n throw error;\n }\n finally {\n lView[FLAGS] &= ~4 /* LViewFlags.CreationMode */;\n leaveView();\n }\n}\n/** Renders child components in the current view (creation mode). */\nfunction renderChildComponents(hostLView, components) {\n for (let i = 0; i < components.length; i++) {\n renderComponent(hostLView, components[i]);\n }\n}\n\nfunction createAndRenderEmbeddedLView(declarationLView, templateTNode, context, options) {\n const prevConsumer = setActiveConsumer(null);\n try {\n const embeddedTView = templateTNode.tView;\n ngDevMode && assertDefined(embeddedTView, 'TView must be defined for a template node.');\n ngDevMode && assertTNodeForLView(templateTNode, declarationLView);\n // Embedded views follow the change detection strategy of the view they're declared in.\n const isSignalView = declarationLView[FLAGS] & 4096 /* LViewFlags.SignalView */;\n const viewFlags = isSignalView ? 4096 /* LViewFlags.SignalView */ : 16 /* LViewFlags.CheckAlways */;\n const embeddedLView = createLView(declarationLView, embeddedTView, context, viewFlags, null, templateTNode, null, null, options?.injector ?? null, options?.embeddedViewInjector ?? null, options?.dehydratedView ?? null);\n const declarationLContainer = declarationLView[templateTNode.index];\n ngDevMode && assertLContainer(declarationLContainer);\n embeddedLView[DECLARATION_LCONTAINER] = declarationLContainer;\n const declarationViewLQueries = declarationLView[QUERIES];\n if (declarationViewLQueries !== null) {\n embeddedLView[QUERIES] = declarationViewLQueries.createEmbeddedView(embeddedTView);\n }\n // execute creation mode of a view\n renderView(embeddedTView, embeddedLView, context);\n return embeddedLView;\n }\n finally {\n setActiveConsumer(prevConsumer);\n }\n}\n/**\n * Returns whether an elements that belong to a view should be\n * inserted into the DOM. For client-only cases, DOM elements are\n * always inserted. For hydration cases, we check whether serialized\n * info is available for a view and the view is not in a \"skip hydration\"\n * block (in which case view contents was re-created, thus needing insertion).\n */\nfunction shouldAddViewToDom(tNode, dehydratedView) {\n return (!dehydratedView || dehydratedView.firstChild === null || hasInSkipHydrationBlockFlag(tNode));\n}\n\nconst USE_EXHAUSTIVE_CHECK_NO_CHANGES_DEFAULT = false;\nconst UseExhaustiveCheckNoChanges = new InjectionToken(ngDevMode ? 'exhaustive checkNoChanges' : '');\n\nfunction collectNativeNodes(tView, lView, tNode, result, isProjection = false) {\n while (tNode !== null) {\n // Let declarations don't have corresponding DOM nodes so we skip over them.\n if (tNode.type === 128 /* TNodeType.LetDeclaration */) {\n tNode = isProjection ? tNode.projectionNext : tNode.next;\n continue;\n }\n ngDevMode &&\n assertTNodeType(tNode, 3 /* TNodeType.AnyRNode */ | 12 /* TNodeType.AnyContainer */ | 16 /* TNodeType.Projection */ | 32 /* TNodeType.Icu */);\n const lNode = lView[tNode.index];\n if (lNode !== null) {\n result.push(unwrapRNode(lNode));\n }\n // A given lNode can represent either a native node or a LContainer (when it is a host of a\n // ViewContainerRef). When we find a LContainer we need to descend into it to collect root nodes\n // from the views in this container.\n if (isLContainer(lNode)) {\n collectNativeNodesInLContainer(lNode, result);\n }\n const tNodeType = tNode.type;\n if (tNodeType & 8 /* TNodeType.ElementContainer */) {\n collectNativeNodes(tView, lView, tNode.child, result);\n }\n else if (tNodeType & 32 /* TNodeType.Icu */) {\n const nextRNode = icuContainerIterate(tNode, lView);\n let rNode;\n while ((rNode = nextRNode())) {\n result.push(rNode);\n }\n }\n else if (tNodeType & 16 /* TNodeType.Projection */) {\n const nodesInSlot = getProjectionNodes(lView, tNode);\n if (Array.isArray(nodesInSlot)) {\n result.push(...nodesInSlot);\n }\n else {\n const parentView = getLViewParent(lView[DECLARATION_COMPONENT_VIEW]);\n ngDevMode && assertParentView(parentView);\n collectNativeNodes(parentView[TVIEW], parentView, nodesInSlot, result, true);\n }\n }\n tNode = isProjection ? tNode.projectionNext : tNode.next;\n }\n return result;\n}\n/**\n * Collects all root nodes in all views in a given LContainer.\n */\nfunction collectNativeNodesInLContainer(lContainer, result) {\n for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {\n const lViewInAContainer = lContainer[i];\n const lViewFirstChildTNode = lViewInAContainer[TVIEW].firstChild;\n if (lViewFirstChildTNode !== null) {\n collectNativeNodes(lViewInAContainer[TVIEW], lViewInAContainer, lViewFirstChildTNode, result);\n }\n }\n // When an LContainer is created, the anchor (comment) node is:\n // - (1) either reused in case of an ElementContainer (<ng-container>)\n // - (2) or a new comment node is created\n // In the first case, the anchor comment node would be added to the final\n // list by the code in the `collectNativeNodes` function\n // (see the `result.push(unwrapRNode(lNode))` line), but the second\n // case requires extra handling: the anchor node needs to be added to the\n // final list manually. See additional information in the `createAnchorNode`\n // function in the `view_container_ref.ts`.\n //\n // In the first case, the same reference would be stored in the `NATIVE`\n // and `HOST` slots in an LContainer. Otherwise, this is the second case and\n // we should add an element to the final list.\n if (lContainer[NATIVE] !== lContainer[HOST]) {\n result.push(lContainer[NATIVE]);\n }\n}\n\nfunction addAfterRenderSequencesForView(lView) {\n if (lView[AFTER_RENDER_SEQUENCES_TO_ADD] !== null) {\n for (const sequence of lView[AFTER_RENDER_SEQUENCES_TO_ADD]) {\n sequence.impl.addSequence(sequence);\n }\n lView[AFTER_RENDER_SEQUENCES_TO_ADD].length = 0;\n }\n}\n\nlet freeConsumers = [];\n/**\n * Create a new template consumer pointing at the specified LView.\n * Sometimes, a previously created consumer may be reused, in order to save on allocations. In that\n * case, the LView will be updated.\n */\nfunction getOrBorrowReactiveLViewConsumer(lView) {\n return lView[REACTIVE_TEMPLATE_CONSUMER] ?? borrowReactiveLViewConsumer(lView);\n}\nfunction borrowReactiveLViewConsumer(lView) {\n const consumer = freeConsumers.pop() ?? Object.create(REACTIVE_LVIEW_CONSUMER_NODE);\n consumer.lView = lView;\n return consumer;\n}\nfunction maybeReturnReactiveLViewConsumer(consumer) {\n if (consumer.lView[REACTIVE_TEMPLATE_CONSUMER] === consumer) {\n // The consumer got committed.\n return;\n }\n consumer.lView = null;\n freeConsumers.push(consumer);\n}\nconst REACTIVE_LVIEW_CONSUMER_NODE = {\n ...REACTIVE_NODE,\n consumerIsAlwaysLive: true,\n kind: 'template',\n consumerMarkedDirty: (node) => {\n markAncestorsForTraversal(node.lView);\n },\n consumerOnSignalRead() {\n this.lView[REACTIVE_TEMPLATE_CONSUMER] = this;\n },\n};\n/**\n * Creates a temporary consumer for use with `LView`s that should not have consumers.\n * If the LView already has a consumer, returns the existing one instead.\n *\n * This is necessary because some APIs may cause change detection directly on an LView\n * that we do not want to have a consumer (Embedded views today). As a result, there\n * would be no active consumer from running change detection on its host component\n * and any signals in the LView template would be untracked. Instead, we create\n * this temporary consumer that marks the first parent that _should_ have a consumer\n * for refresh. Once change detection runs as part of that refresh, we throw away\n * this consumer because its signals will then be tracked by the parent's consumer.\n */\nfunction getOrCreateTemporaryConsumer(lView) {\n const consumer = lView[REACTIVE_TEMPLATE_CONSUMER] ?? Object.create(TEMPORARY_CONSUMER_NODE);\n consumer.lView = lView;\n return consumer;\n}\nconst TEMPORARY_CONSUMER_NODE = {\n ...REACTIVE_NODE,\n consumerIsAlwaysLive: true,\n kind: 'template',\n consumerMarkedDirty: (node) => {\n let parent = getLViewParent(node.lView);\n while (parent && !viewShouldHaveReactiveConsumer(parent[TVIEW])) {\n parent = getLViewParent(parent);\n }\n if (!parent) {\n // If we can't find an appropriate parent that should have a consumer, we\n // don't have a way of appropriately refreshing this LView as part of application synchronization.\n return;\n }\n markViewForRefresh(parent);\n },\n consumerOnSignalRead() {\n this.lView[REACTIVE_TEMPLATE_CONSUMER] = this;\n },\n};\n/**\n * Indicates if the view should get its own reactive consumer node.\n *\n * In the current design, all embedded views share a consumer with the component view. This allows\n * us to refresh at the component level rather than at a per-view level. In addition, root views get\n * their own reactive node because root component will have a host view that executes the\n * component's host bindings. This needs to be tracked in a consumer as well.\n *\n * To get a more granular change detection than per-component, all we would just need to update the\n * condition here so that a given view gets a reactive consumer which can become dirty independently\n * from its parent component. For example embedded views for signal components could be created with\n * a new type \"SignalEmbeddedView\" and the condition here wouldn't even need updating in order to\n * get granular per-view change detection for signal components.\n */\nfunction viewShouldHaveReactiveConsumer(tView) {\n return tView.type !== 2 /* TViewType.Embedded */;\n}\nfunction isReactiveLViewConsumer(node) {\n return node.kind === 'template';\n}\n\nfunction runEffectsInView(view) {\n if (view[EFFECTS] === null) {\n return;\n }\n // Since effects can make other effects dirty, we flush them in a loop until there are no more to\n // flush.\n let tryFlushEffects = true;\n while (tryFlushEffects) {\n let foundDirtyEffect = false;\n for (const effect of view[EFFECTS]) {\n if (!effect.dirty) {\n continue;\n }\n foundDirtyEffect = true;\n // `runEffectsInView` is called during change detection, and therefore runs\n // in the Angular zone if it's available.\n if (effect.zone === null || Zone.current === effect.zone) {\n effect.run();\n }\n else {\n effect.zone.run(() => effect.run());\n }\n }\n // Check if we need to continue flushing. If we didn't find any dirty effects, then there's\n // no need to loop back. Otherwise, check the view to see if it was marked for traversal\n // again. If so, there's a chance that one of the effects we ran caused another effect to\n // become dirty.\n tryFlushEffects = foundDirtyEffect && !!(view[FLAGS] & 8192 /* LViewFlags.HasChildViewsToRefresh */);\n }\n}\n\n/**\n * The maximum number of times the change detection traversal will rerun before throwing an error.\n */\nconst MAXIMUM_REFRESH_RERUNS$1 = 100;\nfunction detectChangesInternal(lView, mode = 0 /* ChangeDetectionMode.Global */) {\n const environment = lView[ENVIRONMENT];\n const rendererFactory = environment.rendererFactory;\n // Check no changes mode is a dev only mode used to verify that bindings have not changed\n // since they were assigned. We do not want to invoke renderer factory functions in that mode\n // to avoid any possible side-effects.\n const checkNoChangesMode = !!ngDevMode && isInCheckNoChangesMode();\n if (!checkNoChangesMode) {\n rendererFactory.begin?.();\n }\n try {\n detectChangesInViewWhileDirty(lView, mode);\n }\n finally {\n if (!checkNoChangesMode) {\n rendererFactory.end?.();\n }\n }\n}\nfunction detectChangesInViewWhileDirty(lView, mode) {\n const lastIsRefreshingViewsValue = isRefreshingViews();\n try {\n setIsRefreshingViews(true);\n detectChangesInView(lView, mode);\n // We don't need or want to do any looping when in exhaustive checkNoChanges because we\n // already traverse all the views and nothing should change so we shouldn't have to do\n // another pass to pick up new changes.\n if (ngDevMode && isExhaustiveCheckNoChanges()) {\n return;\n }\n let retries = 0;\n // If after running change detection, this view still needs to be refreshed or there are\n // descendants views that need to be refreshed due to re-dirtying during the change detection\n // run, detect changes on the view again. We run change detection in `Targeted` mode to only\n // refresh views with the `RefreshView` flag.\n while (requiresRefreshOrTraversal(lView)) {\n if (retries === MAXIMUM_REFRESH_RERUNS$1) {\n throw new RuntimeError(103 /* RuntimeErrorCode.INFINITE_CHANGE_DETECTION */, ngDevMode &&\n 'Infinite change detection while trying to refresh views. ' +\n 'There may be components which each cause the other to require a refresh, ' +\n 'causing an infinite loop.');\n }\n retries++;\n // Even if this view is detached, we still detect changes in targeted mode because this was\n // the root of the change detection run.\n detectChangesInView(lView, 1 /* ChangeDetectionMode.Targeted */);\n }\n }\n finally {\n // restore state to what it was before entering this change detection loop\n setIsRefreshingViews(lastIsRefreshingViewsValue);\n }\n}\nfunction checkNoChangesInternal(lView, exhaustive) {\n setIsInCheckNoChangesMode(exhaustive ? CheckNoChangesMode.Exhaustive : CheckNoChangesMode.OnlyDirtyViews);\n try {\n detectChangesInternal(lView);\n }\n finally {\n setIsInCheckNoChangesMode(CheckNoChangesMode.Off);\n }\n}\n/**\n * Processes a view in update mode. This includes a number of steps in a specific order:\n * - executing a template function in update mode;\n * - executing hooks;\n * - refreshing queries;\n * - setting host bindings;\n * - refreshing child (embedded and component) views.\n */\nfunction refreshView(tView, lView, templateFn, context) {\n ngDevMode && assertEqual(isCreationMode(lView), false, 'Should be run in update mode');\n if (isDestroyed(lView))\n return;\n const flags = lView[FLAGS];\n // Check no changes mode is a dev only mode used to verify that bindings have not changed\n // since they were assigned. We do not want to execute lifecycle hooks in that mode.\n const isInCheckNoChangesPass = ngDevMode && isInCheckNoChangesMode();\n const isInExhaustiveCheckNoChangesPass = ngDevMode && isExhaustiveCheckNoChanges();\n // Start component reactive context\n // - We might already be in a reactive context if this is an embedded view of the host.\n // - We might be descending into a view that needs a consumer.\n enterView(lView);\n let returnConsumerToPool = true;\n let prevConsumer = null;\n let currentConsumer = null;\n if (!isInCheckNoChangesPass) {\n if (viewShouldHaveReactiveConsumer(tView)) {\n currentConsumer = getOrBorrowReactiveLViewConsumer(lView);\n prevConsumer = consumerBeforeComputation(currentConsumer);\n }\n else if (getActiveConsumer() === null) {\n // If the current view should not have a reactive consumer but we don't have an active consumer,\n // we still need to create a temporary consumer to track any signal reads in this template.\n // This is a rare case that can happen with\n // - `viewContainerRef.createEmbeddedView(...).detectChanges()`.\n // - `viewContainerRef.createEmbeddedView(...)` without any other dirty marking on the parent,\n // flagging the parent component for traversal but not triggering a full `refreshView`.\n // This temporary consumer marks the first parent that _should_ have a consumer for refresh.\n // Once that refresh happens, the signals will be tracked in the parent consumer and we can destroy\n // the temporary one.\n returnConsumerToPool = false;\n currentConsumer = getOrCreateTemporaryConsumer(lView);\n prevConsumer = consumerBeforeComputation(currentConsumer);\n }\n else if (lView[REACTIVE_TEMPLATE_CONSUMER]) {\n consumerDestroy(lView[REACTIVE_TEMPLATE_CONSUMER]);\n lView[REACTIVE_TEMPLATE_CONSUMER] = null;\n }\n }\n try {\n resetPreOrderHookFlags(lView);\n setBindingIndex(tView.bindingStartIndex);\n if (templateFn !== null) {\n executeTemplate(tView, lView, templateFn, 2 /* RenderFlags.Update */, context);\n }\n const hooksInitPhaseCompleted = (flags & 3 /* LViewFlags.InitPhaseStateMask */) === 3 /* InitPhaseState.InitPhaseCompleted */;\n // execute pre-order hooks (OnInit, OnChanges, DoCheck)\n // PERF WARNING: do NOT extract this to a separate function without running benchmarks\n if (!isInCheckNoChangesPass) {\n if (hooksInitPhaseCompleted) {\n const preOrderCheckHooks = tView.preOrderCheckHooks;\n if (preOrderCheckHooks !== null) {\n executeCheckHooks(lView, preOrderCheckHooks, null);\n }\n }\n else {\n const preOrderHooks = tView.preOrderHooks;\n if (preOrderHooks !== null) {\n executeInitAndCheckHooks(lView, preOrderHooks, 0 /* InitPhaseState.OnInitHooksToBeRun */, null);\n }\n incrementInitPhaseFlags(lView, 0 /* InitPhaseState.OnInitHooksToBeRun */);\n }\n }\n // We do not need to mark transplanted views for refresh when doing exhaustive checks\n // because all views will be reached anyways during the traversal.\n if (!isInExhaustiveCheckNoChangesPass) {\n // First mark transplanted views that are declared in this lView as needing a refresh at their\n // insertion points. This is needed to avoid the situation where the template is defined in this\n // `LView` but its declaration appears after the insertion component.\n markTransplantedViewsForRefresh(lView);\n }\n runEffectsInView(lView);\n detectChangesInEmbeddedViews(lView, 0 /* ChangeDetectionMode.Global */);\n // Content query results must be refreshed before content hooks are called.\n if (tView.contentQueries !== null) {\n refreshContentQueries(tView, lView);\n }\n // execute content hooks (AfterContentInit, AfterContentChecked)\n // PERF WARNING: do NOT extract this to a separate function without running benchmarks\n if (!isInCheckNoChangesPass) {\n if (hooksInitPhaseCompleted) {\n const contentCheckHooks = tView.contentCheckHooks;\n if (contentCheckHooks !== null) {\n executeCheckHooks(lView, contentCheckHooks);\n }\n }\n else {\n const contentHooks = tView.contentHooks;\n if (contentHooks !== null) {\n executeInitAndCheckHooks(lView, contentHooks, 1 /* InitPhaseState.AfterContentInitHooksToBeRun */);\n }\n incrementInitPhaseFlags(lView, 1 /* InitPhaseState.AfterContentInitHooksToBeRun */);\n }\n }\n processHostBindingOpCodes(tView, lView);\n // Refresh child component views.\n const components = tView.components;\n if (components !== null) {\n detectChangesInChildComponents(lView, components, 0 /* ChangeDetectionMode.Global */);\n }\n // View queries must execute after refreshing child components because a template in this view\n // could be inserted in a child component. If the view query executes before child component\n // refresh, the template might not yet be inserted.\n const viewQuery = tView.viewQuery;\n if (viewQuery !== null) {\n executeViewQueryFn(2 /* RenderFlags.Update */, viewQuery, context);\n }\n // execute view hooks (AfterViewInit, AfterViewChecked)\n // PERF WARNING: do NOT extract this to a separate function without running benchmarks\n if (!isInCheckNoChangesPass) {\n if (hooksInitPhaseCompleted) {\n const viewCheckHooks = tView.viewCheckHooks;\n if (viewCheckHooks !== null) {\n executeCheckHooks(lView, viewCheckHooks);\n }\n }\n else {\n const viewHooks = tView.viewHooks;\n if (viewHooks !== null) {\n executeInitAndCheckHooks(lView, viewHooks, 2 /* InitPhaseState.AfterViewInitHooksToBeRun */);\n }\n incrementInitPhaseFlags(lView, 2 /* InitPhaseState.AfterViewInitHooksToBeRun */);\n }\n }\n if (tView.firstUpdatePass === true) {\n // We need to make sure that we only flip the flag on successful `refreshView` only\n // Don't do this in `finally` block.\n // If we did this in `finally` block then an exception could block the execution of styling\n // instructions which in turn would be unable to insert themselves into the styling linked\n // list. The result of this would be that if the exception would not be throw on subsequent CD\n // the styling would be unable to process it data and reflect to the DOM.\n tView.firstUpdatePass = false;\n }\n // Schedule any effects that are waiting on the update pass of this view.\n if (lView[EFFECTS_TO_SCHEDULE]) {\n for (const notifyEffect of lView[EFFECTS_TO_SCHEDULE]) {\n notifyEffect();\n }\n // Once they've been run, we can drop the array.\n lView[EFFECTS_TO_SCHEDULE] = null;\n }\n // Do not reset the dirty state when running in check no changes mode. We don't want components\n // to behave differently depending on whether check no changes is enabled or not. For example:\n // Marking an OnPush component as dirty from within the `ngAfterViewInit` hook in order to\n // refresh a `NgClass` binding should work. If we would reset the dirty state in the check\n // no changes cycle, the component would be not be dirty for the next update pass. This would\n // be different in production mode where the component dirty state is not reset.\n if (!isInCheckNoChangesPass) {\n addAfterRenderSequencesForView(lView);\n lView[FLAGS] &= ~(64 /* LViewFlags.Dirty */ | 8 /* LViewFlags.FirstLViewPass */);\n }\n }\n catch (e) {\n if (!isInCheckNoChangesPass) {\n // If refreshing a view causes an error, we need to remark the ancestors as needing traversal\n // because the error might have caused a situation where views below the current location are\n // dirty but will be unreachable because the \"has dirty children\" flag in the ancestors has been\n // cleared during change detection and we failed to run to completion.\n markAncestorsForTraversal(lView);\n }\n throw e;\n }\n finally {\n if (currentConsumer !== null) {\n consumerAfterComputation(currentConsumer, prevConsumer);\n if (returnConsumerToPool) {\n maybeReturnReactiveLViewConsumer(currentConsumer);\n }\n }\n leaveView();\n }\n}\n/**\n * Goes over embedded views (ones created through ViewContainerRef APIs) and refreshes\n * them by executing an associated template function.\n */\nfunction detectChangesInEmbeddedViews(lView, mode) {\n for (let lContainer = getFirstLContainer(lView); lContainer !== null; lContainer = getNextLContainer(lContainer)) {\n for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {\n const embeddedLView = lContainer[i];\n detectChangesInViewIfAttached(embeddedLView, mode);\n }\n }\n}\n/**\n * Mark transplanted views as needing to be refreshed at their attachment points.\n *\n * @param lView The `LView` that may have transplanted views.\n */\nfunction markTransplantedViewsForRefresh(lView) {\n for (let lContainer = getFirstLContainer(lView); lContainer !== null; lContainer = getNextLContainer(lContainer)) {\n if (!(lContainer[FLAGS] & 2 /* LContainerFlags.HasTransplantedViews */))\n continue;\n const movedViews = lContainer[MOVED_VIEWS];\n ngDevMode && assertDefined(movedViews, 'Transplanted View flags set but missing MOVED_VIEWS');\n for (let i = 0; i < movedViews.length; i++) {\n const movedLView = movedViews[i];\n markViewForRefresh(movedLView);\n }\n }\n}\n/**\n * Detects changes in a component by entering the component view and processing its bindings,\n * queries, etc. if it is CheckAlways, OnPush and Dirty, etc.\n *\n * @param componentHostIdx Element index in LView[] (adjusted for HEADER_OFFSET)\n */\nfunction detectChangesInComponent(hostLView, componentHostIdx, mode) {\n ngDevMode && assertEqual(isCreationMode(hostLView), false, 'Should be run in update mode');\n profiler(18 /* ProfilerEvent.ComponentStart */);\n const componentView = getComponentLViewByIndex(componentHostIdx, hostLView);\n detectChangesInViewIfAttached(componentView, mode);\n profiler(19 /* ProfilerEvent.ComponentEnd */, componentView[CONTEXT]);\n}\n/**\n * Visits a view as part of change detection traversal.\n *\n * If the view is detached, no additional traversal happens.\n */\nfunction detectChangesInViewIfAttached(lView, mode) {\n if (!viewAttachedToChangeDetector(lView)) {\n return;\n }\n detectChangesInView(lView, mode);\n}\n/**\n * Visits a view as part of change detection traversal.\n *\n * The view is refreshed if:\n * - If the view is CheckAlways or Dirty and ChangeDetectionMode is `Global`\n * - If the view has the `RefreshView` flag\n *\n * The view is not refreshed, but descendants are traversed in `ChangeDetectionMode.Targeted` if the\n * view HasChildViewsToRefresh flag is set.\n */\nfunction detectChangesInView(lView, mode) {\n const isInCheckNoChangesPass = ngDevMode && isInCheckNoChangesMode();\n const tView = lView[TVIEW];\n const flags = lView[FLAGS];\n const consumer = lView[REACTIVE_TEMPLATE_CONSUMER];\n // Refresh CheckAlways views in Global mode.\n let shouldRefreshView = !!(mode === 0 /* ChangeDetectionMode.Global */ && flags & 16 /* LViewFlags.CheckAlways */);\n // Refresh Dirty views in Global mode, as long as we're not in checkNoChanges.\n // CheckNoChanges never worked with `OnPush` components because the `Dirty` flag was\n // cleared before checkNoChanges ran. Because there is now a loop for to check for\n // backwards views, it gives an opportunity for `OnPush` components to be marked `Dirty`\n // before the CheckNoChanges pass. We don't want existing errors that are hidden by the\n // current CheckNoChanges bug to surface when making unrelated changes.\n shouldRefreshView ||= !!(flags & 64 /* LViewFlags.Dirty */ &&\n mode === 0 /* ChangeDetectionMode.Global */ &&\n !isInCheckNoChangesPass);\n // Always refresh views marked for refresh, regardless of mode.\n shouldRefreshView ||= !!(flags & 1024 /* LViewFlags.RefreshView */);\n // Refresh views when they have a dirty reactive consumer, regardless of mode.\n shouldRefreshView ||= !!(consumer?.dirty && consumerPollProducersForChange(consumer));\n shouldRefreshView ||= !!(ngDevMode && isExhaustiveCheckNoChanges());\n // Mark the Flags and `ReactiveNode` as not dirty before refreshing the component, so that they\n // can be re-dirtied during the refresh process.\n if (consumer) {\n consumer.dirty = false;\n }\n lView[FLAGS] &= ~(8192 /* LViewFlags.HasChildViewsToRefresh */ | 1024 /* LViewFlags.RefreshView */);\n if (shouldRefreshView) {\n refreshView(tView, lView, tView.template, lView[CONTEXT]);\n }\n else if (flags & 8192 /* LViewFlags.HasChildViewsToRefresh */) {\n // Set active consumer to null to avoid inheriting an improper reactive context\n const prevConsumer = setActiveConsumer(null);\n try {\n if (!isInCheckNoChangesPass) {\n runEffectsInView(lView);\n }\n detectChangesInEmbeddedViews(lView, 1 /* ChangeDetectionMode.Targeted */);\n const components = tView.components;\n if (components !== null) {\n detectChangesInChildComponents(lView, components, 1 /* ChangeDetectionMode.Targeted */);\n }\n if (!isInCheckNoChangesPass) {\n addAfterRenderSequencesForView(lView);\n }\n }\n finally {\n setActiveConsumer(prevConsumer);\n }\n }\n}\n/** Refreshes child components in the current view (update mode). */\nfunction detectChangesInChildComponents(hostLView, components, mode) {\n for (let i = 0; i < components.length; i++) {\n detectChangesInComponent(hostLView, components[i], mode);\n }\n}\n/**\n * Invoke `HostBindingsFunction`s for view.\n *\n * This methods executes `TView.hostBindingOpCodes`. It is used to execute the\n * `HostBindingsFunction`s associated with the current `LView`.\n *\n * @param tView Current `TView`.\n * @param lView Current `LView`.\n */\nfunction processHostBindingOpCodes(tView, lView) {\n const hostBindingOpCodes = tView.hostBindingOpCodes;\n if (hostBindingOpCodes === null)\n return;\n try {\n for (let i = 0; i < hostBindingOpCodes.length; i++) {\n const opCode = hostBindingOpCodes[i];\n if (opCode < 0) {\n // Negative numbers are element indexes.\n setSelectedIndex(~opCode);\n }\n else {\n // Positive numbers are NumberTuple which store bindingRootIndex and directiveIndex.\n const directiveIdx = opCode;\n const bindingRootIndx = hostBindingOpCodes[++i];\n const hostBindingFn = hostBindingOpCodes[++i];\n setBindingRootForHostBindings(bindingRootIndx, directiveIdx);\n const context = lView[directiveIdx];\n profiler(24 /* ProfilerEvent.HostBindingsUpdateStart */, context);\n hostBindingFn(2 /* RenderFlags.Update */, context);\n profiler(25 /* ProfilerEvent.HostBindingsUpdateEnd */, context);\n }\n }\n }\n finally {\n setSelectedIndex(-1);\n }\n}\n\n/**\n * Marks current view and all ancestors dirty.\n *\n * Returns the root view because it is found as a byproduct of marking the view tree\n * dirty, and can be used by methods that consume markViewDirty() to easily schedule\n * change detection. Otherwise, such methods would need to traverse up the view tree\n * an additional time to get the root view and schedule a tick on it.\n *\n * @param lView The starting LView to mark dirty\n * @returns the root LView\n */\nfunction markViewDirty(lView, source) {\n const dirtyBitsToUse = isRefreshingViews()\n ? // When we are actively refreshing views, we only use the `Dirty` bit to mark a view\n 64 /* LViewFlags.Dirty */\n : // When we are not actively refreshing a view tree, it is absolutely\n // valid to update state and mark views dirty. We use the `RefreshView` flag in this\n // case to allow synchronously rerunning change detection. This applies today to\n // afterRender hooks as well as animation listeners which execute after detecting\n // changes in a view when the render factory flushes.\n 1024 /* LViewFlags.RefreshView */ | 64 /* LViewFlags.Dirty */;\n lView[ENVIRONMENT].changeDetectionScheduler?.notify(source);\n while (lView) {\n lView[FLAGS] |= dirtyBitsToUse;\n const parent = getLViewParent(lView);\n // Stop traversing up as soon as you find a root view that wasn't attached to any container\n if (isRootView(lView) && !parent) {\n return lView;\n }\n // continue otherwise\n lView = parent;\n }\n return null;\n}\n\n/**\n * Creates a LContainer, either from a container instruction, or for a ViewContainerRef.\n *\n * @param hostNative The host element for the LContainer\n * @param hostTNode The host TNode for the LContainer\n * @param currentView The parent view of the LContainer\n * @param native The native comment element\n * @param isForViewContainerRef Optional a flag indicating the ViewContainerRef case\n * @returns LContainer\n */\nfunction createLContainer(hostNative, currentView, native, tNode) {\n ngDevMode && assertLView(currentView);\n const lContainer = [\n hostNative, // host native\n true, // Boolean `true` in this position signifies that this is an `LContainer`\n 0, // flags\n currentView, // parent\n null, // next\n tNode, // t_host\n null, // dehydrated views\n native, // native,\n null, // view refs\n null, // moved views\n ];\n ngDevMode &&\n assertEqual(lContainer.length, CONTAINER_HEADER_OFFSET, 'Should allocate correct number of slots for LContainer header.');\n return lContainer;\n}\nfunction getLViewFromLContainer(lContainer, index) {\n const adjustedIndex = CONTAINER_HEADER_OFFSET + index;\n // avoid reading past the array boundaries\n if (adjustedIndex < lContainer.length) {\n const lView = lContainer[adjustedIndex];\n ngDevMode && assertLView(lView);\n return lView;\n }\n return undefined;\n}\nfunction addLViewToLContainer(lContainer, lView, index, addToDOM = true) {\n const tView = lView[TVIEW];\n // Insert into the view tree so the new view can be change-detected\n insertView(tView, lView, lContainer, index);\n // Insert elements that belong to this view into the DOM tree\n if (addToDOM) {\n const beforeNode = getBeforeNodeForView(index, lContainer);\n const renderer = lView[RENDERER];\n const parentRNode = renderer.parentNode(lContainer[NATIVE]);\n if (parentRNode !== null) {\n addViewToDOM(tView, lContainer[T_HOST], renderer, lView, parentRNode, beforeNode);\n }\n }\n // When in hydration mode, reset the pointer to the first child in\n // the dehydrated view. This indicates that the view was hydrated and\n // further attaching/detaching should work with this view as normal.\n const hydrationInfo = lView[HYDRATION];\n if (hydrationInfo !== null && hydrationInfo.firstChild !== null) {\n hydrationInfo.firstChild = null;\n }\n}\nfunction removeLViewFromLContainer(lContainer, index) {\n const lView = detachView(lContainer, index);\n if (lView !== undefined) {\n destroyLView(lView[TVIEW], lView);\n }\n return lView;\n}\n/**\n * Detaches a view from a container.\n *\n * This method removes the view from the container's array of active views. It also\n * removes the view's elements from the DOM.\n *\n * @param lContainer The container from which to detach a view\n * @param removeIndex The index of the view to detach\n * @returns Detached LView instance.\n */\nfunction detachView(lContainer, removeIndex) {\n if (lContainer.length <= CONTAINER_HEADER_OFFSET)\n return;\n const indexInContainer = CONTAINER_HEADER_OFFSET + removeIndex;\n const viewToDetach = lContainer[indexInContainer];\n if (viewToDetach) {\n const declarationLContainer = viewToDetach[DECLARATION_LCONTAINER];\n if (declarationLContainer !== null && declarationLContainer !== lContainer) {\n detachMovedView(declarationLContainer, viewToDetach);\n }\n if (removeIndex > 0) {\n lContainer[indexInContainer - 1][NEXT] = viewToDetach[NEXT];\n }\n const removedLView = removeFromArray(lContainer, CONTAINER_HEADER_OFFSET + removeIndex);\n removeViewFromDOM(viewToDetach[TVIEW], viewToDetach);\n // notify query that a view has been removed\n const lQueries = removedLView[QUERIES];\n if (lQueries !== null) {\n lQueries.detachView(removedLView[TVIEW]);\n }\n viewToDetach[PARENT] = null;\n viewToDetach[NEXT] = null;\n // Unsets the attached flag\n viewToDetach[FLAGS] &= ~128 /* LViewFlags.Attached */;\n }\n return viewToDetach;\n}\n/**\n * Inserts a view into a container.\n *\n * This adds the view to the container's array of active views in the correct\n * position. It also adds the view's elements to the DOM if the container isn't a\n * root node of another view (in that case, the view's elements will be added when\n * the container's parent view is added later).\n *\n * @param tView The `TView' of the `LView` to insert\n * @param lView The view to insert\n * @param lContainer The container into which the view should be inserted\n * @param index Which index in the container to insert the child view into\n */\nfunction insertView(tView, lView, lContainer, index) {\n ngDevMode && assertLView(lView);\n ngDevMode && assertLContainer(lContainer);\n const indexInContainer = CONTAINER_HEADER_OFFSET + index;\n const containerLength = lContainer.length;\n if (index > 0) {\n // This is a new view, we need to add it to the children.\n lContainer[indexInContainer - 1][NEXT] = lView;\n }\n if (index < containerLength - CONTAINER_HEADER_OFFSET) {\n lView[NEXT] = lContainer[indexInContainer];\n addToArray(lContainer, CONTAINER_HEADER_OFFSET + index, lView);\n }\n else {\n lContainer.push(lView);\n lView[NEXT] = null;\n }\n lView[PARENT] = lContainer;\n // track views where declaration and insertion points are different\n const declarationLContainer = lView[DECLARATION_LCONTAINER];\n if (declarationLContainer !== null && lContainer !== declarationLContainer) {\n trackMovedView(declarationLContainer, lView);\n }\n // notify query that a new view has been added\n const lQueries = lView[QUERIES];\n if (lQueries !== null) {\n lQueries.insertView(tView);\n }\n updateAncestorTraversalFlagsOnAttach(lView);\n // Sets the attached flag\n lView[FLAGS] |= 128 /* LViewFlags.Attached */;\n}\n/**\n * Track views created from the declaration container (TemplateRef) and inserted into a\n * different LContainer or attached directly to ApplicationRef.\n */\nfunction trackMovedView(declarationContainer, lView) {\n ngDevMode && assertDefined(lView, 'LView required');\n ngDevMode && assertLContainer(declarationContainer);\n const movedViews = declarationContainer[MOVED_VIEWS];\n const parent = lView[PARENT];\n ngDevMode && assertDefined(parent, 'missing parent');\n if (isLView(parent)) {\n declarationContainer[FLAGS] |= 2 /* LContainerFlags.HasTransplantedViews */;\n }\n else {\n const insertedComponentLView = parent[PARENT][DECLARATION_COMPONENT_VIEW];\n ngDevMode && assertDefined(insertedComponentLView, 'Missing insertedComponentLView');\n const declaredComponentLView = lView[DECLARATION_COMPONENT_VIEW];\n ngDevMode && assertDefined(declaredComponentLView, 'Missing declaredComponentLView');\n if (declaredComponentLView !== insertedComponentLView) {\n // At this point the declaration-component is not same as insertion-component; this means that\n // this is a transplanted view. Mark the declared lView as having transplanted views so that\n // those views can participate in CD.\n declarationContainer[FLAGS] |= 2 /* LContainerFlags.HasTransplantedViews */;\n }\n }\n if (movedViews === null) {\n declarationContainer[MOVED_VIEWS] = [lView];\n }\n else {\n movedViews.push(lView);\n }\n}\n\nclass ViewRef {\n _lView;\n _cdRefInjectingView;\n _appRef = null;\n _attachedToViewContainer = false;\n exhaustive;\n get rootNodes() {\n const lView = this._lView;\n const tView = lView[TVIEW];\n return collectNativeNodes(tView, lView, tView.firstChild, []);\n }\n constructor(\n /**\n * This represents `LView` associated with the component when ViewRef is a ChangeDetectorRef.\n *\n * When ViewRef is created for a dynamic component, this also represents the `LView` for the\n * component.\n *\n * For a \"regular\" ViewRef created for an embedded view, this is the `LView` for the embedded\n * view.\n *\n * @internal\n */\n _lView, \n /**\n * This represents the `LView` associated with the point where `ChangeDetectorRef` was\n * requested.\n *\n * This may be different from `_lView` if the `_cdRefInjectingView` is an embedded view.\n */\n _cdRefInjectingView) {\n this._lView = _lView;\n this._cdRefInjectingView = _cdRefInjectingView;\n }\n get context() {\n return this._lView[CONTEXT];\n }\n /**\n * @deprecated Replacing the full context object is not supported. Modify the context\n * directly, or consider using a `Proxy` if you need to replace the full object.\n * // TODO(devversion): Remove this.\n */\n set context(value) {\n if (ngDevMode) {\n // Note: We have a warning message here because the `@deprecated` JSDoc will not be picked\n // up for assignments on the setter. We want to let users know about the deprecated usage.\n console.warn('Angular: Replacing the `context` object of an `EmbeddedViewRef` is deprecated.');\n }\n this._lView[CONTEXT] = value;\n }\n get destroyed() {\n return isDestroyed(this._lView);\n }\n destroy() {\n if (this._appRef) {\n this._appRef.detachView(this);\n }\n else if (this._attachedToViewContainer) {\n const parent = this._lView[PARENT];\n if (isLContainer(parent)) {\n const viewRefs = parent[VIEW_REFS];\n const index = viewRefs ? viewRefs.indexOf(this) : -1;\n if (index > -1) {\n ngDevMode &&\n assertEqual(index, parent.indexOf(this._lView) - CONTAINER_HEADER_OFFSET, 'An attached view should be in the same position within its container as its ViewRef in the VIEW_REFS array.');\n detachView(parent, index);\n removeFromArray(viewRefs, index);\n }\n }\n this._attachedToViewContainer = false;\n }\n destroyLView(this._lView[TVIEW], this._lView);\n }\n onDestroy(callback) {\n storeLViewOnDestroy(this._lView, callback);\n }\n /**\n * Marks a view and all of its ancestors dirty.\n *\n * This can be used to ensure an {@link ChangeDetectionStrategy#OnPush} component is\n * checked when it needs to be re-rendered but the two normal triggers haven't marked it\n * dirty (i.e. inputs haven't changed and events haven't fired in the view).\n *\n * <!-- TODO: Add a link to a chapter on OnPush components -->\n *\n * @usageNotes\n * ### Example\n *\n * ```ts\n * @Component({\n * selector: 'app-root',\n * template: `Number of ticks: {{numberOfTicks}}`\n * changeDetection: ChangeDetectionStrategy.OnPush,\n * })\n * class AppComponent {\n * numberOfTicks = 0;\n *\n * constructor(private ref: ChangeDetectorRef) {\n * setInterval(() => {\n * this.numberOfTicks++;\n * // the following is required, otherwise the view will not be updated\n * this.ref.markForCheck();\n * }, 1000);\n * }\n * }\n * ```\n */\n markForCheck() {\n markViewDirty(this._cdRefInjectingView || this._lView, 4 /* NotificationSource.MarkForCheck */);\n }\n /**\n * Detaches the view from the change detection tree.\n *\n * Detached views will not be checked during change detection runs until they are\n * re-attached, even if they are dirty. `detach` can be used in combination with\n * {@link ChangeDetectorRef#detectChanges} to implement local change\n * detection checks.\n *\n * <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->\n * <!-- TODO: Add a live demo once ref.detectChanges is merged into master -->\n *\n * @usageNotes\n * ### Example\n *\n * The following example defines a component with a large list of readonly data.\n * Imagine the data changes constantly, many times per second. For performance reasons,\n * we want to check and update the list every five seconds. We can do that by detaching\n * the component's change detector and doing a local check every five seconds.\n *\n * ```ts\n * class DataProvider {\n * // in a real application the returned data will be different every time\n * get data() {\n * return [1,2,3,4,5];\n * }\n * }\n *\n * @Component({\n * selector: 'giant-list',\n * template: `\n * @for(d of dataProvider.data; track $index) {\n * <li>Data {{d}}</li>\n * }\n * `,\n * })\n * class GiantList {\n * constructor(private ref: ChangeDetectorRef, private dataProvider: DataProvider) {\n * ref.detach();\n * setInterval(() => {\n * this.ref.detectChanges();\n * }, 5000);\n * }\n * }\n *\n * @Component({\n * selector: 'app',\n * providers: [DataProvider],\n * template: `\n * <giant-list><giant-list>\n * `,\n * })\n * class App {\n * }\n * ```\n */\n detach() {\n this._lView[FLAGS] &= ~128 /* LViewFlags.Attached */;\n }\n /**\n * Re-attaches a view to the change detection tree.\n *\n * This can be used to re-attach views that were previously detached from the tree\n * using {@link ChangeDetectorRef#detach}. Views are attached to the tree by default.\n *\n * <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->\n *\n * @usageNotes\n * ### Example\n *\n * The following example creates a component displaying `live` data. The component will detach\n * its change detector from the main change detector tree when the component's live property\n * is set to false.\n *\n * ```ts\n * class DataProvider {\n * data = 1;\n *\n * constructor() {\n * setInterval(() => {\n * this.data = this.data * 2;\n * }, 500);\n * }\n * }\n *\n * @Component({\n * selector: 'live-data',\n * inputs: ['live'],\n * template: 'Data: {{dataProvider.data}}'\n * })\n * class LiveData {\n * constructor(private ref: ChangeDetectorRef, private dataProvider: DataProvider) {}\n *\n * set live(value) {\n * if (value) {\n * this.ref.reattach();\n * } else {\n * this.ref.detach();\n * }\n * }\n * }\n *\n * @Component({\n * selector: 'app-root',\n * providers: [DataProvider],\n * template: `\n * Live Update: <input type=\"checkbox\" [(ngModel)]=\"live\">\n * <live-data [live]=\"live\"><live-data>\n * `,\n * })\n * class AppComponent {\n * live = true;\n * }\n * ```\n */\n reattach() {\n updateAncestorTraversalFlagsOnAttach(this._lView);\n this._lView[FLAGS] |= 128 /* LViewFlags.Attached */;\n }\n /**\n * Checks the view and its children.\n *\n * This can also be used in combination with {@link ChangeDetectorRef#detach} to implement\n * local change detection checks.\n *\n * <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->\n * <!-- TODO: Add a live demo once ref.detectChanges is merged into master -->\n *\n * @usageNotes\n * ### Example\n *\n * The following example defines a component with a large list of readonly data.\n * Imagine, the data changes constantly, many times per second. For performance reasons,\n * we want to check and update the list every five seconds.\n *\n * We can do that by detaching the component's change detector and doing a local change detection\n * check every five seconds.\n *\n * See {@link ChangeDetectorRef#detach} for more information.\n */\n detectChanges() {\n // Add `RefreshView` flag to ensure this view is refreshed if not already dirty.\n // `RefreshView` flag is used intentionally over `Dirty` because it gets cleared before\n // executing any of the actual refresh code while the `Dirty` flag doesn't get cleared\n // until the end of the refresh. Using `RefreshView` prevents creating a potential difference\n // in the state of the LViewFlags during template execution.\n this._lView[FLAGS] |= 1024 /* LViewFlags.RefreshView */;\n detectChangesInternal(this._lView);\n }\n /**\n * Checks the change detector and its children, and throws if any changes are detected.\n *\n * This is used in development mode to verify that running change detection doesn't\n * introduce other changes.\n */\n checkNoChanges() {\n if (!ngDevMode)\n return;\n try {\n this.exhaustive ??= this._lView[INJECTOR].get(UseExhaustiveCheckNoChanges, USE_EXHAUSTIVE_CHECK_NO_CHANGES_DEFAULT);\n }\n catch {\n this.exhaustive = USE_EXHAUSTIVE_CHECK_NO_CHANGES_DEFAULT;\n }\n checkNoChangesInternal(this._lView, this.exhaustive);\n }\n attachToViewContainerRef() {\n if (this._appRef) {\n throw new RuntimeError(902 /* RuntimeErrorCode.VIEW_ALREADY_ATTACHED */, ngDevMode && 'This view is already attached directly to the ApplicationRef!');\n }\n this._attachedToViewContainer = true;\n }\n detachFromAppRef() {\n this._appRef = null;\n const isRoot = isRootView(this._lView);\n const declarationContainer = this._lView[DECLARATION_LCONTAINER];\n if (declarationContainer !== null && !isRoot) {\n detachMovedView(declarationContainer, this._lView);\n }\n detachViewFromDOM(this._lView[TVIEW], this._lView);\n }\n attachToAppRef(appRef) {\n if (this._attachedToViewContainer) {\n throw new RuntimeError(902 /* RuntimeErrorCode.VIEW_ALREADY_ATTACHED */, ngDevMode && 'This view is already attached to a ViewContainer!');\n }\n this._appRef = appRef;\n const isRoot = isRootView(this._lView);\n const declarationContainer = this._lView[DECLARATION_LCONTAINER];\n if (declarationContainer !== null && !isRoot) {\n trackMovedView(declarationContainer, this._lView);\n }\n updateAncestorTraversalFlagsOnAttach(this._lView);\n }\n}\n/**\n * Reports whether the given view is considered dirty according to the different marking mechanisms.\n */\nfunction isViewDirty(view) {\n return requiresRefreshOrTraversal(view._lView) || !!(view._lView[FLAGS] & 64 /* LViewFlags.Dirty */);\n}\nfunction markForRefresh(view) {\n // This function is only used by elements where _cdRefInjectingView is the same as _lView\n markViewForRefresh(view._lView);\n}\n\n/**\n * Represents an embedded template that can be used to instantiate embedded views.\n * To instantiate embedded views based on a template, use the `ViewContainerRef`\n * method `createEmbeddedView()`.\n *\n * Access a `TemplateRef` instance by placing a directive on an `<ng-template>`\n * element (or directive prefixed with `*`). The `TemplateRef` for the embedded view\n * is injected into the constructor of the directive,\n * using the `TemplateRef` token.\n *\n * You can also use a `Query` to find a `TemplateRef` associated with\n * a component or a directive.\n *\n * @see {@link ViewContainerRef}\n *\n * @publicApi\n */\nclass TemplateRef {\n _declarationLView;\n _declarationTContainer;\n /**\n * The anchor element in the parent view for this embedded view.\n *\n * The data-binding and [injection contexts](guide/di/dependency-injection-context) of embedded\n * views created from this `TemplateRef` inherit from the contexts of this location.\n *\n * Typically new embedded views are attached to the view container of this location, but in\n * advanced use-cases, the view can be attached to a different container while keeping the\n * data-binding and injection context from the original location.\n *\n */\n elementRef;\n /**\n * @internal\n * @nocollapse\n */\n static __NG_ELEMENT_ID__ = injectTemplateRef;\n /** @internal */\n constructor(_declarationLView, _declarationTContainer, elementRef) {\n this._declarationLView = _declarationLView;\n this._declarationTContainer = _declarationTContainer;\n this.elementRef = elementRef;\n }\n /**\n * Returns an `ssrId` associated with a TView, which was used to\n * create this instance of the `TemplateRef`.\n *\n * @internal\n */\n get ssrId() {\n return this._declarationTContainer.tView?.ssrId || null;\n }\n /**\n * Instantiates an unattached embedded view based on this template.\n * @param context The data-binding context of the embedded view, as declared\n * in the `<ng-template>` usage.\n * @param injector Injector to be used within the embedded view.\n * @returns The new embedded view object.\n */\n createEmbeddedView(context, injector) {\n return this.createEmbeddedViewImpl(context, injector);\n }\n /**\n * Implementation of the `createEmbeddedView` function.\n *\n * This implementation is internal and allows framework code\n * to invoke it with extra parameters (e.g. for hydration) without\n * affecting public API.\n *\n * @internal\n */\n createEmbeddedViewImpl(context, injector, dehydratedView) {\n const embeddedLView = createAndRenderEmbeddedLView(this._declarationLView, this._declarationTContainer, context, { embeddedViewInjector: injector, dehydratedView });\n return new ViewRef(embeddedLView);\n }\n}\n/**\n * Creates a TemplateRef given a node.\n *\n * @returns The TemplateRef instance to use\n */\nfunction injectTemplateRef() {\n return createTemplateRef(getCurrentTNode(), getLView());\n}\n/**\n * Creates a TemplateRef and stores it on the injector.\n *\n * @param hostTNode The node on which a TemplateRef is requested\n * @param hostLView The `LView` to which the node belongs\n * @returns The TemplateRef instance or null if we can't create a TemplateRef on a given node type\n */\nfunction createTemplateRef(hostTNode, hostLView) {\n if (hostTNode.type & 4 /* TNodeType.Container */) {\n ngDevMode && assertDefined(hostTNode.tView, 'TView must be allocated');\n return new TemplateRef(hostLView, hostTNode, createElementRef(hostTNode, hostLView));\n }\n return null;\n}\n\nconst AT_THIS_LOCATION = '<-- AT THIS LOCATION';\n/**\n * Retrieves a user friendly string for a given TNodeType for use in\n * friendly error messages\n *\n * @param tNodeType\n * @returns\n */\nfunction getFriendlyStringFromTNodeType(tNodeType) {\n switch (tNodeType) {\n case 4 /* TNodeType.Container */:\n return 'view container';\n case 2 /* TNodeType.Element */:\n return 'element';\n case 8 /* TNodeType.ElementContainer */:\n return 'ng-container';\n case 32 /* TNodeType.Icu */:\n return 'icu';\n case 64 /* TNodeType.Placeholder */:\n return 'i18n';\n case 16 /* TNodeType.Projection */:\n return 'projection';\n case 1 /* TNodeType.Text */:\n return 'text';\n case 128 /* TNodeType.LetDeclaration */:\n return '@let';\n default:\n // This should not happen as we cover all possible TNode types above.\n return '<unknown>';\n }\n}\n/**\n * Validates that provided nodes match during the hydration process.\n */\nfunction validateMatchingNode(node, nodeType, tagName, lView, tNode, isViewContainerAnchor = false) {\n if (!node ||\n node.nodeType !== nodeType ||\n (node.nodeType === Node.ELEMENT_NODE &&\n node.tagName.toLowerCase() !== tagName?.toLowerCase())) {\n const expectedNode = shortRNodeDescription(nodeType, tagName, null);\n let header = `During hydration Angular expected ${expectedNode} but `;\n const hostComponentDef = getDeclarationComponentDef(lView);\n const componentClassName = hostComponentDef?.type?.name;\n const expectedDom = describeExpectedDom(lView, tNode, isViewContainerAnchor);\n const expected = `Angular expected this DOM:\\n\\n${expectedDom}\\n\\n`;\n let actual = '';\n const componentHostElement = unwrapRNode(lView[HOST]);\n if (!node) {\n // No node found during hydration.\n header += `the node was not found.\\n\\n`;\n // Since the node is missing, we use the closest node to attach the error to\n markRNodeAsHavingHydrationMismatch(componentHostElement, expectedDom);\n }\n else {\n const actualNode = shortRNodeDescription(node.nodeType, node.tagName ?? null, node.textContent ?? null);\n header += `found ${actualNode}.\\n\\n`;\n const actualDom = describeDomFromNode(node);\n actual = `Actual DOM is:\\n\\n${actualDom}\\n\\n`;\n // DevTools only report hydration issues on the component level, so we attach extra debug\n // info to a component host element to make it available to DevTools.\n markRNodeAsHavingHydrationMismatch(componentHostElement, expectedDom, actualDom);\n }\n const footer = getHydrationErrorFooter(componentClassName);\n const message = header + expected + actual + getHydrationAttributeNote() + footer;\n throw new RuntimeError(-500 /* RuntimeErrorCode.HYDRATION_NODE_MISMATCH */, message);\n }\n}\n/**\n * Validates that a given node has sibling nodes\n */\nfunction validateSiblingNodeExists(node) {\n validateNodeExists(node);\n if (!node.nextSibling) {\n const header = 'During hydration Angular expected more sibling nodes to be present.\\n\\n';\n const actual = `Actual DOM is:\\n\\n${describeDomFromNode(node)}\\n\\n`;\n const footer = getHydrationErrorFooter();\n const message = header + actual + footer;\n markRNodeAsHavingHydrationMismatch(node, '', actual);\n throw new RuntimeError(-501 /* RuntimeErrorCode.HYDRATION_MISSING_SIBLINGS */, message);\n }\n}\n/**\n * Validates that a node exists or throws\n */\nfunction validateNodeExists(node, lView = null, tNode = null) {\n if (!node) {\n const header = 'During hydration, Angular expected an element to be present at this location.\\n\\n';\n let expected = '';\n let footer = '';\n if (lView !== null && tNode !== null) {\n expected = describeExpectedDom(lView, tNode, false);\n footer = getHydrationErrorFooter();\n // Since the node is missing, we use the closest node to attach the error to\n markRNodeAsHavingHydrationMismatch(unwrapRNode(lView[HOST]), expected, '');\n }\n throw new RuntimeError(-502 /* RuntimeErrorCode.HYDRATION_MISSING_NODE */, `${header}${expected}\\n\\n${footer}`);\n }\n}\n/**\n * Builds the hydration error message when a node is not found\n *\n * @param lView the LView where the node exists\n * @param tNode the TNode\n */\nfunction nodeNotFoundError(lView, tNode) {\n const header = 'During serialization, Angular was unable to find an element in the DOM:\\n\\n';\n const expected = `${describeExpectedDom(lView, tNode, false)}\\n\\n`;\n const footer = getHydrationErrorFooter();\n throw new RuntimeError(-502 /* RuntimeErrorCode.HYDRATION_MISSING_NODE */, header + expected + footer);\n}\n/**\n * Builds a hydration error message when a node is not found at a path location\n *\n * @param host the Host Node\n * @param path the path to the node\n */\nfunction nodeNotFoundAtPathError(host, path) {\n const header = `During hydration Angular was unable to locate a node ` +\n `using the \"${path}\" path, starting from the ${describeRNode(host)} node.\\n\\n`;\n const footer = getHydrationErrorFooter();\n markRNodeAsHavingHydrationMismatch(host);\n throw new RuntimeError(-502 /* RuntimeErrorCode.HYDRATION_MISSING_NODE */, header + footer);\n}\n/**\n * Builds the hydration error message in the case that dom nodes are created outside of\n * the Angular context and are being used as projected nodes\n *\n * @param lView the LView\n * @param tNode the TNode\n * @returns an error\n */\nfunction unsupportedProjectionOfDomNodes(rNode) {\n const header = 'During serialization, Angular detected DOM nodes ' +\n 'that were created outside of Angular context and provided as projectable nodes ' +\n '(likely via `ViewContainerRef.createComponent` or `createComponent` APIs). ' +\n 'Hydration is not supported for such cases, consider refactoring the code to avoid ' +\n 'this pattern or using `ngSkipHydration` on the host element of the component.\\n\\n';\n const actual = `${describeDomFromNode(rNode)}\\n\\n`;\n const message = header + actual + getHydrationAttributeNote();\n return new RuntimeError(-503 /* RuntimeErrorCode.UNSUPPORTED_PROJECTION_DOM_NODES */, message);\n}\n/**\n * Builds the hydration error message in the case that ngSkipHydration was used on a\n * node that is not a component host element or host binding\n *\n * @param rNode the HTML Element\n * @returns an error\n */\nfunction invalidSkipHydrationHost(rNode) {\n const header = 'The `ngSkipHydration` flag is applied on a node ' +\n \"that doesn't act as a component host. Hydration can be \" +\n 'skipped only on per-component basis.\\n\\n';\n const actual = `${describeDomFromNode(rNode)}\\n\\n`;\n const footer = 'Please move the `ngSkipHydration` attribute to the component host element.\\n\\n';\n const message = header + actual + footer;\n return new RuntimeError(-504 /* RuntimeErrorCode.INVALID_SKIP_HYDRATION_HOST */, message);\n}\n// Stringification methods\n/**\n * Stringifies a given TNode's attributes\n *\n * @param tNode a provided TNode\n * @returns string\n */\nfunction stringifyTNodeAttrs(tNode) {\n const results = [];\n if (tNode.attrs) {\n for (let i = 0; i < tNode.attrs.length;) {\n const attrName = tNode.attrs[i++];\n // Once we reach the first flag, we know that the list of\n // attributes is over.\n if (typeof attrName == 'number') {\n break;\n }\n const attrValue = tNode.attrs[i++];\n results.push(`${attrName}=\"${shorten(attrValue)}\"`);\n }\n }\n return results.join(' ');\n}\n/**\n * The list of internal attributes that should be filtered out while\n * producing an error message.\n */\nconst internalAttrs = new Set(['ngh', 'ng-version', 'ng-server-context']);\n/**\n * Stringifies an HTML Element's attributes\n *\n * @param rNode an HTML Element\n * @returns string\n */\nfunction stringifyRNodeAttrs(rNode) {\n const results = [];\n for (let i = 0; i < rNode.attributes.length; i++) {\n const attr = rNode.attributes[i];\n if (internalAttrs.has(attr.name))\n continue;\n results.push(`${attr.name}=\"${shorten(attr.value)}\"`);\n }\n return results.join(' ');\n}\n// Methods for Describing the DOM\n/**\n * Converts a tNode to a helpful readable string value for use in error messages\n *\n * @param tNode a given TNode\n * @param innerContent the content of the node\n * @returns string\n */\nfunction describeTNode(tNode, innerContent = '…') {\n switch (tNode.type) {\n case 1 /* TNodeType.Text */:\n const content = tNode.value ? `(${tNode.value})` : '';\n return `#text${content}`;\n case 2 /* TNodeType.Element */:\n const attrs = stringifyTNodeAttrs(tNode);\n const tag = tNode.value.toLowerCase();\n return `<${tag}${attrs ? ' ' + attrs : ''}>${innerContent}</${tag}>`;\n case 8 /* TNodeType.ElementContainer */:\n return '<!-- ng-container -->';\n case 4 /* TNodeType.Container */:\n return '<!-- container -->';\n default:\n const typeAsString = getFriendlyStringFromTNodeType(tNode.type);\n return `#node(${typeAsString})`;\n }\n}\n/**\n * Converts an RNode to a helpful readable string value for use in error messages\n *\n * @param rNode a given RNode\n * @param innerContent the content of the node\n * @returns string\n */\nfunction describeRNode(rNode, innerContent = '…') {\n const node = rNode;\n switch (node.nodeType) {\n case Node.ELEMENT_NODE:\n const tag = node.tagName.toLowerCase();\n const attrs = stringifyRNodeAttrs(node);\n return `<${tag}${attrs ? ' ' + attrs : ''}>${innerContent}</${tag}>`;\n case Node.TEXT_NODE:\n const content = node.textContent ? shorten(node.textContent) : '';\n return `#text${content ? `(${content})` : ''}`;\n case Node.COMMENT_NODE:\n return `<!-- ${shorten(node.textContent ?? '')} -->`;\n default:\n return `#node(${node.nodeType})`;\n }\n}\n/**\n * Builds the string containing the expected DOM present given the LView and TNode\n * values for a readable error message\n *\n * @param lView the lView containing the DOM\n * @param tNode the tNode\n * @param isViewContainerAnchor boolean\n * @returns string\n */\nfunction describeExpectedDom(lView, tNode, isViewContainerAnchor) {\n const spacer = ' ';\n let content = '';\n if (tNode.prev) {\n content += spacer + '…\\n';\n content += spacer + describeTNode(tNode.prev) + '\\n';\n }\n else if (tNode.type && tNode.type & 12 /* TNodeType.AnyContainer */) {\n content += spacer + '…\\n';\n }\n if (isViewContainerAnchor) {\n content += spacer + describeTNode(tNode) + '\\n';\n content += spacer + `<!-- container --> ${AT_THIS_LOCATION}\\n`;\n }\n else {\n content += spacer + describeTNode(tNode) + ` ${AT_THIS_LOCATION}\\n`;\n }\n content += spacer + '…\\n';\n const parentRNode = tNode.type ? getParentRElement(lView[TVIEW], tNode, lView) : null;\n if (parentRNode) {\n content = describeRNode(parentRNode, '\\n' + content);\n }\n return content;\n}\n/**\n * Builds the string containing the DOM present around a given RNode for a\n * readable error message\n *\n * @param node the RNode\n * @returns string\n */\nfunction describeDomFromNode(node) {\n const spacer = ' ';\n let content = '';\n const currentNode = node;\n if (currentNode.previousSibling) {\n content += spacer + '…\\n';\n content += spacer + describeRNode(currentNode.previousSibling) + '\\n';\n }\n content += spacer + describeRNode(currentNode) + ` ${AT_THIS_LOCATION}\\n`;\n if (node.nextSibling) {\n content += spacer + '…\\n';\n }\n if (node.parentNode) {\n content = describeRNode(currentNode.parentNode, '\\n' + content);\n }\n return content;\n}\n/**\n * Shortens the description of a given RNode by its type for readability\n *\n * @param nodeType the type of node\n * @param tagName the node tag name\n * @param textContent the text content in the node\n * @returns string\n */\nfunction shortRNodeDescription(nodeType, tagName, textContent) {\n switch (nodeType) {\n case Node.ELEMENT_NODE:\n return `<${tagName.toLowerCase()}>`;\n case Node.TEXT_NODE:\n const content = textContent ? ` (with the \"${shorten(textContent)}\" content)` : '';\n return `a text node${content}`;\n case Node.COMMENT_NODE:\n return 'a comment node';\n default:\n return `#node(nodeType=${nodeType})`;\n }\n}\n/**\n * Builds the footer hydration error message\n *\n * @param componentClassName the name of the component class\n * @returns string\n */\nfunction getHydrationErrorFooter(componentClassName) {\n const componentInfo = componentClassName ? `the \"${componentClassName}\"` : 'corresponding';\n return (`To fix this problem:\\n` +\n ` * check ${componentInfo} component for hydration-related issues\\n` +\n ` * check to see if your template has valid HTML structure\\n` +\n ` * or skip hydration by adding the \\`ngSkipHydration\\` attribute ` +\n `to its host node in a template\\n\\n`);\n}\n/**\n * An attribute related note for hydration errors\n */\nfunction getHydrationAttributeNote() {\n return ('Note: attributes are only displayed to better represent the DOM' +\n ' but have no effect on hydration mismatches.\\n\\n');\n}\n// Node string utility functions\n/**\n * Strips all newlines out of a given string\n *\n * @param input a string to be cleared of new line characters\n * @returns\n */\nfunction stripNewlines(input) {\n return input.replace(/\\s+/gm, '');\n}\n/**\n * Reduces a string down to a maximum length of characters with ellipsis for readability\n *\n * @param input a string input\n * @param maxLength a maximum length in characters\n * @returns string\n */\nfunction shorten(input, maxLength = 50) {\n if (!input) {\n return '';\n }\n input = stripNewlines(input);\n return input.length > maxLength ? `${input.substring(0, maxLength - 1)}…` : input;\n}\n\n/**\n * Find a node in front of which `currentTNode` should be inserted (takes i18n into account).\n *\n * This method determines the `RNode` in front of which we should insert the `currentRNode`. This\n * takes `TNode.insertBeforeIndex` into account.\n *\n * @param parentTNode parent `TNode`\n * @param currentTNode current `TNode` (The node which we would like to insert into the DOM)\n * @param lView current `LView`\n */\nfunction getInsertInFrontOfRNodeWithI18n(parentTNode, currentTNode, lView) {\n const tNodeInsertBeforeIndex = currentTNode.insertBeforeIndex;\n const insertBeforeIndex = Array.isArray(tNodeInsertBeforeIndex)\n ? tNodeInsertBeforeIndex[0]\n : tNodeInsertBeforeIndex;\n if (insertBeforeIndex === null) {\n return getInsertInFrontOfRNodeWithNoI18n(parentTNode, currentTNode, lView);\n }\n else {\n ngDevMode && assertIndexInRange(lView, insertBeforeIndex);\n return unwrapRNode(lView[insertBeforeIndex]);\n }\n}\n/**\n * Process `TNode.insertBeforeIndex` by adding i18n text nodes.\n *\n * See `TNode.insertBeforeIndex`\n */\nfunction processI18nInsertBefore(renderer, childTNode, lView, childRNode, parentRElement) {\n const tNodeInsertBeforeIndex = childTNode.insertBeforeIndex;\n if (Array.isArray(tNodeInsertBeforeIndex)) {\n // An array indicates that there are i18n nodes that need to be added as children of this\n // `childRNode`. These i18n nodes were created before this `childRNode` was available and so\n // only now can be added. The first element of the array is the normal index where we should\n // insert the `childRNode`. Additional elements are the extra nodes to be added as children of\n // `childRNode`.\n ngDevMode && assertDomNode(childRNode);\n let i18nParent = childRNode;\n let anchorRNode = null;\n if (!(childTNode.type & 3 /* TNodeType.AnyRNode */)) {\n anchorRNode = i18nParent;\n i18nParent = parentRElement;\n }\n if (i18nParent !== null && childTNode.componentOffset === -1) {\n for (let i = 1; i < tNodeInsertBeforeIndex.length; i++) {\n // No need to `unwrapRNode` because all of the indexes point to i18n text nodes.\n // see `assertDomNode` below.\n const i18nChild = lView[tNodeInsertBeforeIndex[i]];\n nativeInsertBefore(renderer, i18nParent, i18nChild, anchorRNode, false);\n }\n }\n }\n}\n\nfunction getOrCreateTNode(tView, index, type, name, attrs) {\n ngDevMode &&\n index !== 0 && // 0 are bogus nodes and they are OK. See `createContainerRef` in\n // `view_engine_compatibility` for additional context.\n assertGreaterThanOrEqual(index, HEADER_OFFSET, \"TNodes can't be in the LView header.\");\n // Keep this function short, so that the VM will inline it.\n ngDevMode && assertPureTNodeType(type);\n let tNode = tView.data[index];\n if (tNode === null) {\n tNode = createTNodeAtIndex(tView, index, type, name, attrs);\n if (isInI18nBlock()) {\n // If we are in i18n block then all elements should be pre declared through `Placeholder`\n // See `TNodeType.Placeholder` and `LFrame.inI18n` for more context.\n // If the `TNode` was not pre-declared than it means it was not mentioned which means it was\n // removed, so we mark it as detached.\n tNode.flags |= 32 /* TNodeFlags.isDetached */;\n }\n }\n else if (tNode.type & 64 /* TNodeType.Placeholder */) {\n tNode.type = type;\n tNode.value = name;\n tNode.attrs = attrs;\n const parent = getCurrentParentTNode();\n tNode.injectorIndex = parent === null ? -1 : parent.injectorIndex;\n ngDevMode && assertTNodeForTView(tNode, tView);\n ngDevMode && assertEqual(index, tNode.index, 'Expecting same index');\n }\n setCurrentTNode(tNode, true);\n return tNode;\n}\nfunction createTNodeAtIndex(tView, index, type, name, attrs) {\n const currentTNode = getCurrentTNodePlaceholderOk();\n const isParent = isCurrentTNodeParent();\n const parent = isParent ? currentTNode : currentTNode && currentTNode.parent;\n // Parents cannot cross component boundaries because components will be used in multiple places.\n const tNode = (tView.data[index] = createTNode(tView, parent, type, index, name, attrs));\n // Assign a pointer to the first child node of a given view. The first node is not always the one\n // at index 0, in case of i18n, index 0 can be the instruction `i18nStart` and the first node has\n // the index 1 or more, so we can't just check node index.\n linkTNodeInTView(tView, tNode, currentTNode, isParent);\n return tNode;\n}\nfunction linkTNodeInTView(tView, tNode, currentTNode, isParent) {\n if (tView.firstChild === null) {\n tView.firstChild = tNode;\n }\n if (currentTNode !== null) {\n if (isParent) {\n // FIXME(misko): This logic looks unnecessarily complicated. Could we simplify?\n if (currentTNode.child == null && tNode.parent !== null) {\n // We are in the same view, which means we are adding content node to the parent view.\n currentTNode.child = tNode;\n }\n }\n else {\n if (currentTNode.next === null) {\n // In the case of i18n the `currentTNode` may already be linked, in which case we don't want\n // to break the links which i18n created.\n currentTNode.next = tNode;\n tNode.prev = currentTNode;\n }\n }\n }\n}\nfunction createTNode(tView, tParent, type, index, value, attrs) {\n ngDevMode &&\n index !== 0 && // 0 are bogus nodes and they are OK. See `createContainerRef` in\n // `view_engine_compatibility` for additional context.\n assertGreaterThanOrEqual(index, HEADER_OFFSET, \"TNodes can't be in the LView header.\");\n ngDevMode && assertNotSame(attrs, undefined, \"'undefined' is not valid value for 'attrs'\");\n ngDevMode && tParent && assertTNodeForTView(tParent, tView);\n let injectorIndex = tParent ? tParent.injectorIndex : -1;\n let flags = 0;\n if (isInSkipHydrationBlock$1()) {\n flags |= 128 /* TNodeFlags.inSkipHydrationBlock */;\n }\n // TODO: would it be helpful to use a prototypal inheritance here, similar to the way we do so with signals?\n const tNode = {\n type,\n index,\n insertBeforeIndex: null,\n injectorIndex,\n directiveStart: -1,\n directiveEnd: -1,\n directiveStylingLast: -1,\n componentOffset: -1,\n propertyBindings: null,\n flags,\n providerIndexes: 0,\n value: value,\n attrs: attrs,\n mergedAttrs: null,\n localNames: null,\n initialInputs: null,\n inputs: null,\n hostDirectiveInputs: null,\n outputs: null,\n hostDirectiveOutputs: null,\n directiveToIndex: null,\n tView: null,\n next: null,\n prev: null,\n projectionNext: null,\n child: null,\n parent: tParent,\n projection: null,\n styles: null,\n stylesWithoutHost: null,\n residualStyles: undefined,\n classes: null,\n classesWithoutHost: null,\n residualClasses: undefined,\n classBindings: 0,\n styleBindings: 0,\n };\n if (ngDevMode) {\n // For performance reasons it is important that the tNode retains the same shape during runtime.\n // (To make sure that all of the code is monomorphic.) For this reason we seal the object to\n // prevent class transitions.\n Object.seal(tNode);\n }\n return tNode;\n}\n\n/**\n * Add `tNode` to `previousTNodes` list and update relevant `TNode`s in `previousTNodes` list\n * `tNode.insertBeforeIndex`.\n *\n * Things to keep in mind:\n * 1. All i18n text nodes are encoded as `TNodeType.Element` and are created eagerly by the\n * `ɵɵi18nStart` instruction.\n * 2. All `TNodeType.Placeholder` `TNodes` are elements which will be created later by\n * `ɵɵelementStart` instruction.\n * 3. `ɵɵelementStart` instruction will create `TNode`s in the ascending `TNode.index` order. (So a\n * smaller index `TNode` is guaranteed to be created before a larger one)\n *\n * We use the above three invariants to determine `TNode.insertBeforeIndex`.\n *\n * In an ideal world `TNode.insertBeforeIndex` would always be `TNode.next.index`. However,\n * this will not work because `TNode.next.index` may be larger than `TNode.index` which means that\n * the next node is not yet created and therefore we can't insert in front of it.\n *\n * Rule1: `TNode.insertBeforeIndex = null` if `TNode.next === null` (Initial condition, as we don't\n * know if there will be further `TNode`s inserted after.)\n * Rule2: If `previousTNode` is created after the `tNode` being inserted, then\n * `previousTNode.insertBeforeNode = tNode.index` (So when a new `tNode` is added we check\n * previous to see if we can update its `insertBeforeTNode`)\n *\n * See `TNode.insertBeforeIndex` for more context.\n *\n * @param previousTNodes A list of previous TNodes so that we can easily traverse `TNode`s in\n * reverse order. (If `TNode` would have `previous` this would not be necessary.)\n * @param newTNode A TNode to add to the `previousTNodes` list.\n */\nfunction addTNodeAndUpdateInsertBeforeIndex(previousTNodes, newTNode) {\n // Start with Rule1\n ngDevMode &&\n assertEqual(newTNode.insertBeforeIndex, null, 'We expect that insertBeforeIndex is not set');\n previousTNodes.push(newTNode);\n if (previousTNodes.length > 1) {\n for (let i = previousTNodes.length - 2; i >= 0; i--) {\n const existingTNode = previousTNodes[i];\n // Text nodes are created eagerly and so they don't need their `indexBeforeIndex` updated.\n // It is safe to ignore them.\n if (!isI18nText(existingTNode)) {\n if (isNewTNodeCreatedBefore(existingTNode, newTNode) &&\n getInsertBeforeIndex(existingTNode) === null) {\n // If it was created before us in time, (and it does not yet have `insertBeforeIndex`)\n // then add the `insertBeforeIndex`.\n setInsertBeforeIndex(existingTNode, newTNode.index);\n }\n }\n }\n }\n}\nfunction isI18nText(tNode) {\n return !(tNode.type & 64 /* TNodeType.Placeholder */);\n}\nfunction isNewTNodeCreatedBefore(existingTNode, newTNode) {\n return isI18nText(newTNode) || existingTNode.index > newTNode.index;\n}\nfunction getInsertBeforeIndex(tNode) {\n const index = tNode.insertBeforeIndex;\n return Array.isArray(index) ? index[0] : index;\n}\nfunction setInsertBeforeIndex(tNode, value) {\n const index = tNode.insertBeforeIndex;\n if (Array.isArray(index)) {\n // Array is stored if we have to insert child nodes. See `TNode.insertBeforeIndex`\n index[0] = value;\n }\n else {\n setI18nHandling(getInsertInFrontOfRNodeWithI18n, processI18nInsertBefore);\n tNode.insertBeforeIndex = value;\n }\n}\n\n/**\n * Retrieve `TIcu` at a given `index`.\n *\n * The `TIcu` can be stored either directly (if it is nested ICU) OR\n * it is stored inside tho `TIcuContainer` if it is top level ICU.\n *\n * The reason for this is that the top level ICU need a `TNode` so that they are part of the render\n * tree, but nested ICU's have no TNode, because we don't know ahead of time if the nested ICU is\n * expressed (parent ICU may have selected a case which does not contain it.)\n *\n * @param tView Current `TView`.\n * @param index Index where the value should be read from.\n */\nfunction getTIcu(tView, index) {\n const value = tView.data[index];\n if (value === null || typeof value === 'string')\n return null;\n if (ngDevMode &&\n !(value.hasOwnProperty('tView') || value.hasOwnProperty('currentCaseLViewIndex'))) {\n throwError(\"We expect to get 'null'|'TIcu'|'TIcuContainer', but got: \" + value);\n }\n // Here the `value.hasOwnProperty('currentCaseLViewIndex')` is a polymorphic read as it can be\n // either TIcu or TIcuContainerNode. This is not ideal, but we still think it is OK because it\n // will be just two cases which fits into the browser inline cache (inline cache can take up to\n // 4)\n const tIcu = value.hasOwnProperty('currentCaseLViewIndex')\n ? value\n : value.value;\n ngDevMode && assertTIcu(tIcu);\n return tIcu;\n}\n/**\n * Store `TIcu` at a give `index`.\n *\n * The `TIcu` can be stored either directly (if it is nested ICU) OR\n * it is stored inside tho `TIcuContainer` if it is top level ICU.\n *\n * The reason for this is that the top level ICU need a `TNode` so that they are part of the render\n * tree, but nested ICU's have no TNode, because we don't know ahead of time if the nested ICU is\n * expressed (parent ICU may have selected a case which does not contain it.)\n *\n * @param tView Current `TView`.\n * @param index Index where the value should be stored at in `Tview.data`\n * @param tIcu The TIcu to store.\n */\nfunction setTIcu(tView, index, tIcu) {\n const tNode = tView.data[index];\n ngDevMode &&\n assertEqual(tNode === null || tNode.hasOwnProperty('tView'), true, \"We expect to get 'null'|'TIcuContainer'\");\n if (tNode === null) {\n tView.data[index] = tIcu;\n }\n else {\n ngDevMode && assertTNodeType(tNode, 32 /* TNodeType.Icu */);\n tNode.value = tIcu;\n }\n}\n/**\n * Set `TNode.insertBeforeIndex` taking the `Array` into account.\n *\n * See `TNode.insertBeforeIndex`\n */\nfunction setTNodeInsertBeforeIndex(tNode, index) {\n ngDevMode && assertTNode(tNode);\n let insertBeforeIndex = tNode.insertBeforeIndex;\n if (insertBeforeIndex === null) {\n setI18nHandling(getInsertInFrontOfRNodeWithI18n, processI18nInsertBefore);\n insertBeforeIndex = tNode.insertBeforeIndex = [\n null /* may be updated to number later */,\n index,\n ];\n }\n else {\n assertEqual(Array.isArray(insertBeforeIndex), true, 'Expecting array here');\n insertBeforeIndex.push(index);\n }\n}\n/**\n * Create `TNode.type=TNodeType.Placeholder` node.\n *\n * See `TNodeType.Placeholder` for more information.\n */\nfunction createTNodePlaceholder(tView, previousTNodes, index) {\n const tNode = createTNodeAtIndex(tView, index, 64 /* TNodeType.Placeholder */, null, null);\n addTNodeAndUpdateInsertBeforeIndex(previousTNodes, tNode);\n return tNode;\n}\n/**\n * Returns current ICU case.\n *\n * ICU cases are stored as index into the `TIcu.cases`.\n * At times it is necessary to communicate that the ICU case just switched and that next ICU update\n * should update all bindings regardless of the mask. In such a case the we store negative numbers\n * for cases which have just been switched. This function removes the negative flag.\n */\nfunction getCurrentICUCaseIndex(tIcu, lView) {\n const currentCase = lView[tIcu.currentCaseLViewIndex];\n return currentCase === null ? currentCase : currentCase < 0 ? ~currentCase : currentCase;\n}\nfunction getParentFromIcuCreateOpCode(mergedCode) {\n return mergedCode >>> 17 /* IcuCreateOpCode.SHIFT_PARENT */;\n}\nfunction getRefFromIcuCreateOpCode(mergedCode) {\n return (mergedCode & 131070 /* IcuCreateOpCode.MASK_REF */) >>> 1 /* IcuCreateOpCode.SHIFT_REF */;\n}\nfunction getInstructionFromIcuCreateOpCode(mergedCode) {\n return mergedCode & 1 /* IcuCreateOpCode.MASK_INSTRUCTION */;\n}\nfunction icuCreateOpCode(opCode, parentIdx, refIdx) {\n ngDevMode && assertGreaterThanOrEqual(parentIdx, 0, 'Missing parent index');\n ngDevMode && assertGreaterThan(refIdx, 0, 'Missing ref index');\n return (opCode | (parentIdx << 17 /* IcuCreateOpCode.SHIFT_PARENT */) | (refIdx << 1 /* IcuCreateOpCode.SHIFT_REF */));\n}\n// Returns whether the given value corresponds to a root template message,\n// or a sub-template.\nfunction isRootTemplateMessage(subTemplateIndex) {\n return subTemplateIndex === -1;\n}\n\nfunction enterIcu(state, tIcu, lView) {\n state.index = 0;\n const currentCase = getCurrentICUCaseIndex(tIcu, lView);\n if (currentCase !== null) {\n ngDevMode && assertNumberInRange(currentCase, 0, tIcu.cases.length - 1);\n state.removes = tIcu.remove[currentCase];\n }\n else {\n state.removes = EMPTY_ARRAY;\n }\n}\nfunction icuContainerIteratorNext(state) {\n if (state.index < state.removes.length) {\n const removeOpCode = state.removes[state.index++];\n ngDevMode && assertNumber(removeOpCode, 'Expecting OpCode number');\n if (removeOpCode > 0) {\n const rNode = state.lView[removeOpCode];\n ngDevMode && assertDomNode(rNode);\n return rNode;\n }\n else {\n state.stack.push(state.index, state.removes);\n // ICUs are represented by negative indices\n const tIcuIndex = ~removeOpCode;\n const tIcu = state.lView[TVIEW].data[tIcuIndex];\n ngDevMode && assertTIcu(tIcu);\n enterIcu(state, tIcu, state.lView);\n return icuContainerIteratorNext(state);\n }\n }\n else {\n if (state.stack.length === 0) {\n return null;\n }\n else {\n state.removes = state.stack.pop();\n state.index = state.stack.pop();\n return icuContainerIteratorNext(state);\n }\n }\n}\nfunction loadIcuContainerVisitor() {\n const _state = {\n stack: [],\n index: -1,\n };\n /**\n * Retrieves a set of root nodes from `TIcu.remove`. Used by `TNodeType.ICUContainer`\n * to determine which root belong to the ICU.\n *\n * Example of usage.\n * ```ts\n * const nextRNode = icuContainerIteratorStart(tIcuContainerNode, lView);\n * let rNode: RNode|null;\n * while(rNode = nextRNode()) {\n * console.log(rNode);\n * }\n * ```\n *\n * @param tIcuContainerNode Current `TIcuContainerNode`\n * @param lView `LView` where the `RNode`s should be looked up.\n */\n function icuContainerIteratorStart(tIcuContainerNode, lView) {\n _state.lView = lView;\n while (_state.stack.length)\n _state.stack.pop();\n ngDevMode && assertTNodeForLView(tIcuContainerNode, lView);\n enterIcu(_state, tIcuContainerNode.value, lView);\n return icuContainerIteratorNext.bind(null, _state);\n }\n return icuContainerIteratorStart;\n}\nfunction createIcuIterator(tIcu, lView) {\n const state = {\n stack: [],\n index: -1,\n lView,\n };\n ngDevMode && assertTIcu(tIcu);\n enterIcu(state, tIcu, lView);\n return icuContainerIteratorNext.bind(null, state);\n}\n\n/**\n * Regexp that extracts a reference node information from the compressed node location.\n * The reference node is represented as either:\n * - a number which points to an LView slot\n * - the `b` char which indicates that the lookup should start from the `document.body`\n * - the `h` char to start lookup from the component host node (`lView[HOST]`)\n */\nconst REF_EXTRACTOR_REGEXP = /* @__PURE__ */ new RegExp(`^(\\\\d+)*(${REFERENCE_NODE_BODY}|${REFERENCE_NODE_HOST})*(.*)`);\n/**\n * Helper function that takes a reference node location and a set of navigation steps\n * (from the reference node) to a target node and outputs a string that represents\n * a location.\n *\n * For example, given: referenceNode = 'b' (body) and path = ['firstChild', 'firstChild',\n * 'nextSibling'], the function returns: `bf2n`.\n */\nfunction compressNodeLocation(referenceNode, path) {\n const result = [referenceNode];\n for (const segment of path) {\n const lastIdx = result.length - 1;\n if (lastIdx > 0 && result[lastIdx - 1] === segment) {\n // An empty string in a count slot represents 1 occurrence of an instruction.\n const value = (result[lastIdx] || 1);\n result[lastIdx] = value + 1;\n }\n else {\n // Adding a new segment to the path.\n // Using an empty string in a counter field to avoid encoding `1`s\n // into the path, since they are implicit (e.g. `f1n1` vs `fn`), so\n // it's enough to have a single char in this case.\n result.push(segment, '');\n }\n }\n return result.join('');\n}\n/**\n * Helper function that reverts the `compressNodeLocation` and transforms a given\n * string into an array where at 0th position there is a reference node info and\n * after that it contains information (in pairs) about a navigation step and the\n * number of repetitions.\n *\n * For example, the path like 'bf2n' will be transformed to:\n * ['b', 'firstChild', 2, 'nextSibling', 1].\n *\n * This information is later consumed by the code that navigates the DOM to find\n * a given node by its location.\n */\nfunction decompressNodeLocation(path) {\n const matches = path.match(REF_EXTRACTOR_REGEXP);\n const [_, refNodeId, refNodeName, rest] = matches;\n // If a reference node is represented by an index, transform it to a number.\n const ref = refNodeId ? parseInt(refNodeId, 10) : refNodeName;\n const steps = [];\n // Match all segments in a path.\n for (const [_, step, count] of rest.matchAll(/(f|n)(\\d*)/g)) {\n const repeat = parseInt(count, 10) || 1;\n steps.push(step, repeat);\n }\n return [ref, ...steps];\n}\n\n/** Whether current TNode is a first node in an <ng-container>. */\nfunction isFirstElementInNgContainer(tNode) {\n return !tNode.prev && tNode.parent?.type === 8 /* TNodeType.ElementContainer */;\n}\n/** Returns an instruction index (subtracting HEADER_OFFSET). */\nfunction getNoOffsetIndex(tNode) {\n return tNode.index - HEADER_OFFSET;\n}\n/**\n * Check whether a given node exists, but is disconnected from the DOM.\n */\nfunction isDisconnectedNode(tNode, lView) {\n return (!(tNode.type & (16 /* TNodeType.Projection */ | 128 /* TNodeType.LetDeclaration */)) &&\n !!lView[tNode.index] &&\n isDisconnectedRNode(unwrapRNode(lView[tNode.index])));\n}\n/**\n * Check whether the given node exists, but is disconnected from the DOM.\n *\n * Note: we leverage the fact that we have this information available in the DOM emulation\n * layer (in Domino) for now. Longer-term solution should not rely on the DOM emulation and\n * only use internal data structures and state to compute this information.\n */\nfunction isDisconnectedRNode(rNode) {\n return !!rNode && !rNode.isConnected;\n}\n/**\n * Locate a node in an i18n tree that corresponds to a given instruction index.\n *\n * @param hydrationInfo The hydration annotation data\n * @param noOffsetIndex the instruction index\n * @returns an RNode that corresponds to the instruction index\n */\nfunction locateI18nRNodeByIndex(hydrationInfo, noOffsetIndex) {\n const i18nNodes = hydrationInfo.i18nNodes;\n if (i18nNodes) {\n return i18nNodes.get(noOffsetIndex);\n }\n return undefined;\n}\n/**\n * Attempt to locate an RNode by a path, if it exists.\n *\n * @param hydrationInfo The hydration annotation data\n * @param lView the current lView\n * @param noOffsetIndex the instruction index\n * @returns an RNode that corresponds to the instruction index or null if no path exists\n */\nfunction tryLocateRNodeByPath(hydrationInfo, lView, noOffsetIndex) {\n const nodes = hydrationInfo.data[NODES];\n const path = nodes?.[noOffsetIndex];\n return path ? locateRNodeByPath(path, lView) : null;\n}\n/**\n * Locate a node in DOM tree that corresponds to a given TNode.\n *\n * @param hydrationInfo The hydration annotation data\n * @param tView the current tView\n * @param lView the current lView\n * @param tNode the current tNode\n * @returns an RNode that represents a given tNode\n */\nfunction locateNextRNode(hydrationInfo, tView, lView, tNode) {\n const noOffsetIndex = getNoOffsetIndex(tNode);\n let native = locateI18nRNodeByIndex(hydrationInfo, noOffsetIndex);\n if (native === undefined) {\n const nodes = hydrationInfo.data[NODES];\n if (nodes?.[noOffsetIndex]) {\n // We know the exact location of the node.\n native = locateRNodeByPath(nodes[noOffsetIndex], lView);\n }\n else if (tView.firstChild === tNode) {\n // We create a first node in this view, so we use a reference\n // to the first child in this DOM segment.\n native = hydrationInfo.firstChild;\n }\n else {\n // Locate a node based on a previous sibling or a parent node.\n const previousTNodeParent = tNode.prev === null;\n const previousTNode = (tNode.prev ?? tNode.parent);\n ngDevMode &&\n assertDefined(previousTNode, 'Unexpected state: current TNode does not have a connection ' +\n 'to the previous node or a parent node.');\n if (isFirstElementInNgContainer(tNode)) {\n const noOffsetParentIndex = getNoOffsetIndex(tNode.parent);\n native = getSegmentHead(hydrationInfo, noOffsetParentIndex);\n }\n else {\n let previousRElement = getNativeByTNode(previousTNode, lView);\n if (previousTNodeParent) {\n native = previousRElement.firstChild;\n }\n else {\n // If the previous node is an element, but it also has container info,\n // this means that we are processing a node like `<div #vcrTarget>`, which is\n // represented in the DOM as `<div></div>...<!--container-->`.\n // In this case, there are nodes *after* this element and we need to skip\n // all of them to reach an element that we are looking for.\n const noOffsetPrevSiblingIndex = getNoOffsetIndex(previousTNode);\n const segmentHead = getSegmentHead(hydrationInfo, noOffsetPrevSiblingIndex);\n if (previousTNode.type === 2 /* TNodeType.Element */ && segmentHead) {\n const numRootNodesToSkip = calcSerializedContainerSize(hydrationInfo, noOffsetPrevSiblingIndex);\n // `+1` stands for an anchor comment node after all the views in this container.\n const nodesToSkip = numRootNodesToSkip + 1;\n // First node after this segment.\n native = siblingAfter(nodesToSkip, segmentHead);\n }\n else {\n native = previousRElement.nextSibling;\n }\n }\n }\n }\n }\n return native;\n}\n/**\n * Skips over a specified number of nodes and returns the next sibling node after that.\n */\nfunction siblingAfter(skip, from) {\n let currentNode = from;\n for (let i = 0; i < skip; i++) {\n ngDevMode && validateSiblingNodeExists(currentNode);\n currentNode = currentNode.nextSibling;\n }\n return currentNode;\n}\n/**\n * Helper function to produce a string representation of the navigation steps\n * (in terms of `nextSibling` and `firstChild` navigations). Used in error\n * messages in dev mode.\n */\nfunction stringifyNavigationInstructions(instructions) {\n const container = [];\n for (let i = 0; i < instructions.length; i += 2) {\n const step = instructions[i];\n const repeat = instructions[i + 1];\n for (let r = 0; r < repeat; r++) {\n container.push(step === NODE_NAVIGATION_STEP_FIRST_CHILD ? 'firstChild' : 'nextSibling');\n }\n }\n return container.join('.');\n}\n/**\n * Helper function that navigates from a starting point node (the `from` node)\n * using provided set of navigation instructions (within `path` argument).\n */\nfunction navigateToNode(from, instructions) {\n let node = from;\n for (let i = 0; i < instructions.length; i += 2) {\n const step = instructions[i];\n const repeat = instructions[i + 1];\n for (let r = 0; r < repeat; r++) {\n if (ngDevMode && !node) {\n throw nodeNotFoundAtPathError(from, stringifyNavigationInstructions(instructions));\n }\n switch (step) {\n case NODE_NAVIGATION_STEP_FIRST_CHILD:\n node = node.firstChild;\n break;\n case NODE_NAVIGATION_STEP_NEXT_SIBLING:\n node = node.nextSibling;\n break;\n }\n }\n }\n if (ngDevMode && !node) {\n throw nodeNotFoundAtPathError(from, stringifyNavigationInstructions(instructions));\n }\n return node;\n}\n/**\n * Locates an RNode given a set of navigation instructions (which also contains\n * a starting point node info).\n */\nfunction locateRNodeByPath(path, lView) {\n const [referenceNode, ...navigationInstructions] = decompressNodeLocation(path);\n let ref;\n if (referenceNode === REFERENCE_NODE_HOST) {\n ref = lView[DECLARATION_COMPONENT_VIEW][HOST];\n }\n else if (referenceNode === REFERENCE_NODE_BODY) {\n ref = ɵɵresolveBody(lView[DECLARATION_COMPONENT_VIEW][HOST]);\n }\n else {\n const parentElementId = Number(referenceNode);\n ref = unwrapRNode(lView[parentElementId + HEADER_OFFSET]);\n }\n return navigateToNode(ref, navigationInstructions);\n}\n/**\n * Generate a list of DOM navigation operations to get from node `start` to node `finish`.\n *\n * Note: assumes that node `start` occurs before node `finish` in an in-order traversal of the DOM\n * tree. That is, we should be able to get from `start` to `finish` purely by using `.firstChild`\n * and `.nextSibling` operations.\n */\nfunction navigateBetween(start, finish) {\n if (start === finish) {\n return [];\n }\n else if (start.parentElement == null || finish.parentElement == null) {\n return null;\n }\n else if (start.parentElement === finish.parentElement) {\n return navigateBetweenSiblings(start, finish);\n }\n else {\n // `finish` is a child of its parent, so the parent will always have a child.\n const parent = finish.parentElement;\n const parentPath = navigateBetween(start, parent);\n const childPath = navigateBetween(parent.firstChild, finish);\n if (!parentPath || !childPath)\n return null;\n return [\n // First navigate to `finish`'s parent\n ...parentPath,\n // Then to its first child.\n NODE_NAVIGATION_STEP_FIRST_CHILD,\n // And finally from that node to `finish` (maybe a no-op if we're already there).\n ...childPath,\n ];\n }\n}\n/**\n * Calculates a path between 2 sibling nodes (generates a number of `NextSibling` navigations).\n * Returns `null` if no such path exists between the given nodes.\n */\nfunction navigateBetweenSiblings(start, finish) {\n const nav = [];\n let node = null;\n for (node = start; node != null && node !== finish; node = node.nextSibling) {\n nav.push(NODE_NAVIGATION_STEP_NEXT_SIBLING);\n }\n // If the `node` becomes `null` or `undefined` at the end, that means that we\n // didn't find the `end` node, thus return `null` (which would trigger serialization\n // error to be produced).\n return node == null ? null : nav;\n}\n/**\n * Calculates a path between 2 nodes in terms of `nextSibling` and `firstChild`\n * navigations:\n * - the `from` node is a known node, used as an starting point for the lookup\n * (the `fromNodeName` argument is a string representation of the node).\n * - the `to` node is a node that the runtime logic would be looking up,\n * using the path generated by this function.\n */\nfunction calcPathBetween(from, to, fromNodeName) {\n const path = navigateBetween(from, to);\n return path === null ? null : compressNodeLocation(fromNodeName, path);\n}\n/**\n * Invoked at serialization time (on the server) when a set of navigation\n * instructions needs to be generated for a TNode.\n */\nfunction calcPathForNode(tNode, lView, excludedParentNodes) {\n let parentTNode = tNode.parent;\n let parentIndex;\n let parentRNode;\n let referenceNodeName;\n // Skip over all parent nodes that are disconnected from the DOM, such nodes\n // can not be used as anchors.\n //\n // This might happen in certain content projection-based use-cases, where\n // a content of an element is projected and used, when a parent element\n // itself remains detached from DOM. In this scenario we try to find a parent\n // element that is attached to DOM and can act as an anchor instead.\n //\n // It can also happen that the parent node should be excluded, for example,\n // because it belongs to an i18n block, which requires paths which aren't\n // relative to other views in an i18n block.\n while (parentTNode !== null &&\n (isDisconnectedNode(parentTNode, lView) || excludedParentNodes?.has(parentTNode.index))) {\n parentTNode = parentTNode.parent;\n }\n if (parentTNode === null || !(parentTNode.type & 3 /* TNodeType.AnyRNode */)) {\n // If there is no parent TNode or a parent TNode does not represent an RNode\n // (i.e. not a DOM node), use component host element as a reference node.\n parentIndex = referenceNodeName = REFERENCE_NODE_HOST;\n parentRNode = lView[DECLARATION_COMPONENT_VIEW][HOST];\n }\n else {\n // Use parent TNode as a reference node.\n parentIndex = parentTNode.index;\n parentRNode = unwrapRNode(lView[parentIndex]);\n referenceNodeName = renderStringify(parentIndex - HEADER_OFFSET);\n }\n let rNode = unwrapRNode(lView[tNode.index]);\n if (tNode.type & (12 /* TNodeType.AnyContainer */ | 32 /* TNodeType.Icu */)) {\n // For <ng-container> nodes, instead of serializing a reference\n // to the anchor comment node, serialize a location of the first\n // DOM element. Paired with the container size (serialized as a part\n // of `ngh.containers`), it should give enough information for runtime\n // to hydrate nodes in this container.\n const firstRNode = getFirstNativeNode(lView, tNode);\n // If container is not empty, use a reference to the first element,\n // otherwise, rNode would point to an anchor comment node.\n if (firstRNode) {\n rNode = firstRNode;\n }\n }\n let path = calcPathBetween(parentRNode, rNode, referenceNodeName);\n if (path === null && parentRNode !== rNode) {\n // Searching for a path between elements within a host node failed.\n // Trying to find a path to an element starting from the `document.body` instead.\n //\n // Important note: this type of reference is relatively unstable, since Angular\n // may not be able to control parts of the page that the runtime logic navigates\n // through. This is mostly needed to cover \"portals\" use-case (like menus, dialog boxes,\n // etc), where nodes are content-projected (including direct DOM manipulations) outside\n // of the host node. The better solution is to provide APIs to work with \"portals\",\n // at which point this code path would not be needed.\n const body = parentRNode.ownerDocument.body;\n path = calcPathBetween(body, rNode, REFERENCE_NODE_BODY);\n if (path === null) {\n // If the path is still empty, it's likely that this node is detached and\n // won't be found during hydration.\n throw nodeNotFoundError(lView, tNode);\n }\n }\n return path;\n}\n/**\n * Retrieves all comments nodes that contain ngh comments referring to a defer block\n */\nfunction gatherDeferBlocksCommentNodes(doc, node) {\n const commentNodesIterator = doc.createNodeIterator(node, NodeFilter.SHOW_COMMENT, { acceptNode });\n let currentNode;\n const nodesByBlockId = new Map();\n while ((currentNode = commentNodesIterator.nextNode())) {\n const nghPattern = 'ngh=';\n const content = currentNode?.textContent;\n const nghIdx = content?.indexOf(nghPattern) ?? -1;\n if (nghIdx > -1) {\n const nghValue = content.substring(nghIdx + nghPattern.length).trim();\n // Make sure the value has an expected format.\n ngDevMode &&\n assertEqual(nghValue.startsWith('d'), true, 'Invalid defer block id found in a comment node.');\n nodesByBlockId.set(nghValue, currentNode);\n }\n }\n return nodesByBlockId;\n}\nfunction acceptNode(node) {\n return node.textContent?.trimStart().startsWith('ngh=')\n ? NodeFilter.FILTER_ACCEPT\n : NodeFilter.FILTER_REJECT;\n}\n\nlet _isI18nHydrationSupportEnabled = false;\nlet _prepareI18nBlockForHydrationImpl = () => {\n // noop unless `enablePrepareI18nBlockForHydrationImpl` is invoked.\n};\nfunction setIsI18nHydrationSupportEnabled(enabled) {\n _isI18nHydrationSupportEnabled = enabled;\n}\nfunction isI18nHydrationSupportEnabled() {\n return _isI18nHydrationSupportEnabled;\n}\n/**\n * Prepares an i18n block and its children, located at the given\n * view and instruction index, for hydration.\n *\n * @param lView lView with the i18n block\n * @param index index of the i18n block in the lView\n * @param parentTNode TNode of the parent of the i18n block\n * @param subTemplateIndex sub-template index, or -1 for the main template\n */\nfunction prepareI18nBlockForHydration(lView, index, parentTNode, subTemplateIndex) {\n _prepareI18nBlockForHydrationImpl(lView, index, parentTNode, subTemplateIndex);\n}\nfunction enablePrepareI18nBlockForHydrationImpl() {\n _prepareI18nBlockForHydrationImpl = prepareI18nBlockForHydrationImpl;\n}\nfunction isI18nHydrationEnabled(injector) {\n injector = injector ?? inject(Injector);\n return injector.get(IS_I18N_HYDRATION_ENABLED, false);\n}\n/**\n * Collects, if not already cached, all of the indices in the\n * given TView which are children of an i18n block.\n *\n * Since i18n blocks don't introduce a parent TNode, this is necessary\n * in order to determine which indices in a LView are translated.\n */\nfunction getOrComputeI18nChildren(tView, context) {\n let i18nChildren = context.i18nChildren.get(tView);\n if (i18nChildren === undefined) {\n i18nChildren = collectI18nChildren(tView);\n context.i18nChildren.set(tView, i18nChildren);\n }\n return i18nChildren;\n}\nfunction collectI18nChildren(tView) {\n const children = new Set();\n function collectI18nViews(node) {\n children.add(node.index);\n switch (node.kind) {\n case 1 /* I18nNodeKind.ELEMENT */:\n case 2 /* I18nNodeKind.PLACEHOLDER */: {\n for (const childNode of node.children) {\n collectI18nViews(childNode);\n }\n break;\n }\n case 3 /* I18nNodeKind.ICU */: {\n for (const caseNodes of node.cases) {\n for (const caseNode of caseNodes) {\n collectI18nViews(caseNode);\n }\n }\n break;\n }\n }\n }\n // Traverse through the AST of each i18n block in the LView,\n // and collect every instruction index.\n for (let i = HEADER_OFFSET; i < tView.bindingStartIndex; i++) {\n const tI18n = tView.data[i];\n if (!tI18n || !tI18n.ast) {\n continue;\n }\n for (const node of tI18n.ast) {\n collectI18nViews(node);\n }\n }\n return children.size === 0 ? null : children;\n}\n/**\n * Attempts to serialize i18n data for an i18n block, located at\n * the given view and instruction index.\n *\n * @param lView lView with the i18n block\n * @param index index of the i18n block in the lView\n * @param context the hydration context\n * @returns the i18n data, or null if there is no relevant data\n */\nfunction trySerializeI18nBlock(lView, index, context) {\n if (!context.isI18nHydrationEnabled) {\n return null;\n }\n const tView = lView[TVIEW];\n const tI18n = tView.data[index];\n if (!tI18n || !tI18n.ast) {\n return null;\n }\n const parentTNode = tView.data[tI18n.parentTNodeIndex];\n if (parentTNode && isI18nInSkipHydrationBlock(parentTNode)) {\n return null;\n }\n const serializedI18nBlock = {\n caseQueue: [],\n disconnectedNodes: new Set(),\n disjointNodes: new Set(),\n };\n serializeI18nBlock(lView, serializedI18nBlock, context, tI18n.ast);\n return serializedI18nBlock.caseQueue.length === 0 &&\n serializedI18nBlock.disconnectedNodes.size === 0 &&\n serializedI18nBlock.disjointNodes.size === 0\n ? null\n : serializedI18nBlock;\n}\nfunction serializeI18nBlock(lView, serializedI18nBlock, context, nodes) {\n let prevRNode = null;\n for (const node of nodes) {\n const nextRNode = serializeI18nNode(lView, serializedI18nBlock, context, node);\n if (nextRNode) {\n if (isDisjointNode(prevRNode, nextRNode)) {\n serializedI18nBlock.disjointNodes.add(node.index - HEADER_OFFSET);\n }\n prevRNode = nextRNode;\n }\n }\n return prevRNode;\n}\n/**\n * Helper to determine whether the given nodes are \"disjoint\".\n *\n * The i18n hydration process walks through the DOM and i18n nodes\n * at the same time. It expects the sibling DOM node of the previous\n * i18n node to be the first node of the next i18n node.\n *\n * In cases of content projection, this won't always be the case. So\n * when we detect that, we mark the node as \"disjoint\", ensuring that\n * we will serialize the path to the node. This way, when we hydrate the\n * i18n node, we will be able to find the correct place to start.\n */\nfunction isDisjointNode(prevNode, nextNode) {\n return prevNode && prevNode.nextSibling !== nextNode;\n}\n/**\n * Process the given i18n node for serialization.\n * Returns the first RNode for the i18n node to begin hydration.\n */\nfunction serializeI18nNode(lView, serializedI18nBlock, context, node) {\n const maybeRNode = unwrapRNode(lView[node.index]);\n if (!maybeRNode || isDisconnectedRNode(maybeRNode)) {\n serializedI18nBlock.disconnectedNodes.add(node.index - HEADER_OFFSET);\n return null;\n }\n const rNode = maybeRNode;\n switch (node.kind) {\n case 0 /* I18nNodeKind.TEXT */: {\n processTextNodeBeforeSerialization(context, rNode);\n break;\n }\n case 1 /* I18nNodeKind.ELEMENT */:\n case 2 /* I18nNodeKind.PLACEHOLDER */: {\n serializeI18nBlock(lView, serializedI18nBlock, context, node.children);\n break;\n }\n case 3 /* I18nNodeKind.ICU */: {\n const currentCase = lView[node.currentCaseLViewIndex];\n if (currentCase != null) {\n // i18n uses a negative value to signal a change to a new case, so we\n // need to invert it to get the proper value.\n const caseIdx = currentCase < 0 ? ~currentCase : currentCase;\n serializedI18nBlock.caseQueue.push(caseIdx);\n serializeI18nBlock(lView, serializedI18nBlock, context, node.cases[caseIdx]);\n }\n break;\n }\n }\n return getFirstNativeNodeForI18nNode(lView, node);\n}\n/**\n * Helper function to get the first native node to begin hydrating\n * the given i18n node.\n */\nfunction getFirstNativeNodeForI18nNode(lView, node) {\n const tView = lView[TVIEW];\n const maybeTNode = tView.data[node.index];\n if (isTNodeShape(maybeTNode)) {\n // If the node is backed by an actual TNode, we can simply delegate.\n return getFirstNativeNode(lView, maybeTNode);\n }\n else if (node.kind === 3 /* I18nNodeKind.ICU */) {\n // A nested ICU container won't have an actual TNode. In that case, we can use\n // an iterator to find the first child.\n const icuIterator = createIcuIterator(maybeTNode, lView);\n let rNode = icuIterator();\n // If the ICU container has no nodes, then we use the ICU anchor as the node.\n return rNode ?? unwrapRNode(lView[node.index]);\n }\n else {\n // Otherwise, the node is a text or trivial element in an ICU container,\n // and we can just use the RNode directly.\n return unwrapRNode(lView[node.index]) ?? null;\n }\n}\nfunction setCurrentNode(state, node) {\n state.currentNode = node;\n}\n/**\n * Marks the current RNode as the hydration root for the given\n * AST node.\n */\nfunction appendI18nNodeToCollection(context, state, astNode) {\n const noOffsetIndex = astNode.index - HEADER_OFFSET;\n const { disconnectedNodes } = context;\n const currentNode = state.currentNode;\n if (state.isConnected) {\n context.i18nNodes.set(noOffsetIndex, currentNode);\n // We expect the node to be connected, so ensure that it\n // is not in the set, regardless of whether we found it,\n // so that the downstream error handling can provide the\n // proper context.\n disconnectedNodes.delete(noOffsetIndex);\n }\n else {\n disconnectedNodes.add(noOffsetIndex);\n }\n return currentNode;\n}\n/**\n * Skip over some sibling nodes during hydration.\n *\n * Note: we use this instead of `siblingAfter` as it's expected that\n * sometimes we might encounter null nodes. In those cases, we want to\n * defer to downstream error handling to provide proper context.\n */\nfunction skipSiblingNodes(state, skip) {\n let currentNode = state.currentNode;\n for (let i = 0; i < skip; i++) {\n if (!currentNode) {\n break;\n }\n currentNode = currentNode?.nextSibling ?? null;\n }\n return currentNode;\n}\n/**\n * Fork the given state into a new state for hydrating children.\n */\nfunction forkHydrationState(state, nextNode) {\n return { currentNode: nextNode, isConnected: state.isConnected };\n}\nfunction prepareI18nBlockForHydrationImpl(lView, index, parentTNode, subTemplateIndex) {\n const hydrationInfo = lView[HYDRATION];\n if (!hydrationInfo) {\n return;\n }\n if (!isI18nHydrationSupportEnabled() ||\n (parentTNode &&\n (isI18nInSkipHydrationBlock(parentTNode) ||\n isDisconnectedNode$1(hydrationInfo, parentTNode.index - HEADER_OFFSET)))) {\n return;\n }\n const tView = lView[TVIEW];\n const tI18n = tView.data[index];\n ngDevMode &&\n assertDefined(tI18n, 'Expected i18n data to be present in a given TView slot during hydration');\n function findHydrationRoot() {\n if (isRootTemplateMessage(subTemplateIndex)) {\n // This is the root of an i18n block. In this case, our hydration root will\n // depend on where our parent TNode (i.e. the block with i18n applied) is\n // in the DOM.\n ngDevMode && assertDefined(parentTNode, 'Expected parent TNode while hydrating i18n root');\n const rootNode = locateNextRNode(hydrationInfo, tView, lView, parentTNode);\n // If this i18n block is attached to an <ng-container>, then we want to begin\n // hydrating directly with the RNode. Otherwise, for a TNode with a physical DOM\n // element, we want to recurse into the first child and begin there.\n return parentTNode.type & 8 /* TNodeType.ElementContainer */ ? rootNode : rootNode.firstChild;\n }\n // This is a nested template in an i18n block. In this case, the entire view\n // is translated, and part of a dehydrated view in a container. This means that\n // we can simply begin hydration with the first dehydrated child.\n return hydrationInfo?.firstChild;\n }\n const currentNode = findHydrationRoot();\n ngDevMode && assertDefined(currentNode, 'Expected root i18n node during hydration');\n const disconnectedNodes = initDisconnectedNodes(hydrationInfo) ?? new Set();\n const i18nNodes = (hydrationInfo.i18nNodes ??= new Map());\n const caseQueue = hydrationInfo.data[I18N_DATA]?.[index - HEADER_OFFSET] ?? [];\n const dehydratedIcuData = (hydrationInfo.dehydratedIcuData ??= new Map());\n collectI18nNodesFromDom({ hydrationInfo, lView, i18nNodes, disconnectedNodes, caseQueue, dehydratedIcuData }, { currentNode, isConnected: true }, tI18n.ast);\n // Nodes from inactive ICU cases should be considered disconnected. We track them above\n // because they aren't (and shouldn't be) serialized. Since we may mutate or create a\n // new set, we need to be sure to write the expected value back to the DehydratedView.\n hydrationInfo.disconnectedNodes = disconnectedNodes.size === 0 ? null : disconnectedNodes;\n}\nfunction collectI18nNodesFromDom(context, state, nodeOrNodes) {\n if (Array.isArray(nodeOrNodes)) {\n let nextState = state;\n for (const node of nodeOrNodes) {\n // Whenever a node doesn't directly follow the previous RNode, it\n // is given a path. We need to resume collecting nodes from that location\n // until and unless we find another disjoint node.\n const targetNode = tryLocateRNodeByPath(context.hydrationInfo, context.lView, node.index - HEADER_OFFSET);\n if (targetNode) {\n nextState = forkHydrationState(state, targetNode);\n }\n collectI18nNodesFromDom(context, nextState, node);\n }\n }\n else {\n if (context.disconnectedNodes.has(nodeOrNodes.index - HEADER_OFFSET)) {\n // i18n nodes can be considered disconnected if e.g. they were projected.\n // In that case, we have to make sure to skip over them.\n return;\n }\n switch (nodeOrNodes.kind) {\n case 0 /* I18nNodeKind.TEXT */: {\n // Claim a text node for hydration\n const currentNode = appendI18nNodeToCollection(context, state, nodeOrNodes);\n setCurrentNode(state, currentNode?.nextSibling ?? null);\n break;\n }\n case 1 /* I18nNodeKind.ELEMENT */: {\n // Recurse into the current element's children...\n collectI18nNodesFromDom(context, forkHydrationState(state, state.currentNode?.firstChild ?? null), nodeOrNodes.children);\n // And claim the parent element itself.\n const currentNode = appendI18nNodeToCollection(context, state, nodeOrNodes);\n setCurrentNode(state, currentNode?.nextSibling ?? null);\n break;\n }\n case 2 /* I18nNodeKind.PLACEHOLDER */: {\n const noOffsetIndex = nodeOrNodes.index - HEADER_OFFSET;\n const { hydrationInfo } = context;\n const containerSize = getNgContainerSize(hydrationInfo, noOffsetIndex);\n switch (nodeOrNodes.type) {\n case 0 /* I18nPlaceholderType.ELEMENT */: {\n // Hydration expects to find the head of the element.\n const currentNode = appendI18nNodeToCollection(context, state, nodeOrNodes);\n // A TNode for the node may not yet if we're hydrating during the first pass,\n // so use the serialized data to determine if this is an <ng-container>.\n if (isSerializedElementContainer(hydrationInfo, noOffsetIndex)) {\n // An <ng-container> doesn't have a physical DOM node, so we need to\n // continue hydrating from siblings.\n collectI18nNodesFromDom(context, state, nodeOrNodes.children);\n // Skip over the anchor element. It will be claimed by the\n // downstream container hydration.\n const nextNode = skipSiblingNodes(state, 1);\n setCurrentNode(state, nextNode);\n }\n else {\n // Non-container elements represent an actual node in the DOM, so we\n // need to continue hydration with the children, and claim the node.\n collectI18nNodesFromDom(context, forkHydrationState(state, state.currentNode?.firstChild ?? null), nodeOrNodes.children);\n setCurrentNode(state, currentNode?.nextSibling ?? null);\n // Elements can also be the anchor of a view container, so there may\n // be elements after this node that we need to skip.\n if (containerSize !== null) {\n // `+1` stands for an anchor node after all of the views in the container.\n const nextNode = skipSiblingNodes(state, containerSize + 1);\n setCurrentNode(state, nextNode);\n }\n }\n break;\n }\n case 1 /* I18nPlaceholderType.SUBTEMPLATE */: {\n ngDevMode &&\n assertNotEqual(containerSize, null, 'Expected a container size while hydrating i18n subtemplate');\n // Hydration expects to find the head of the template.\n appendI18nNodeToCollection(context, state, nodeOrNodes);\n // Skip over all of the template children, as well as the anchor\n // node, since the template itself will handle them instead.\n const nextNode = skipSiblingNodes(state, containerSize + 1);\n setCurrentNode(state, nextNode);\n break;\n }\n }\n break;\n }\n case 3 /* I18nNodeKind.ICU */: {\n // If the current node is connected, we need to pop the next case from the\n // queue, so that the active case is also considered connected.\n const selectedCase = state.isConnected ? context.caseQueue.shift() : null;\n const childState = { currentNode: null, isConnected: false };\n // We traverse through each case, even if it's not active,\n // so that we correctly populate disconnected nodes.\n for (let i = 0; i < nodeOrNodes.cases.length; i++) {\n collectI18nNodesFromDom(context, i === selectedCase ? state : childState, nodeOrNodes.cases[i]);\n }\n if (selectedCase !== null) {\n // ICUs represent a branching state, and the selected case could be different\n // than what it was on the server. In that case, we need to be able to clean\n // up the nodes from the original case. To do that, we store the selected case.\n context.dehydratedIcuData.set(nodeOrNodes.index, { case: selectedCase, node: nodeOrNodes });\n }\n // Hydration expects to find the ICU anchor element.\n const currentNode = appendI18nNodeToCollection(context, state, nodeOrNodes);\n setCurrentNode(state, currentNode?.nextSibling ?? null);\n break;\n }\n }\n }\n}\nlet _claimDehydratedIcuCaseImpl = () => {\n // noop unless `enableClaimDehydratedIcuCaseImpl` is invoked\n};\n/**\n * Mark the case for the ICU node at the given index in the view as claimed,\n * allowing its nodes to be hydrated and not cleaned up.\n */\nfunction claimDehydratedIcuCase(lView, icuIndex, caseIndex) {\n _claimDehydratedIcuCaseImpl(lView, icuIndex, caseIndex);\n}\nfunction enableClaimDehydratedIcuCaseImpl() {\n _claimDehydratedIcuCaseImpl = claimDehydratedIcuCaseImpl;\n}\nfunction claimDehydratedIcuCaseImpl(lView, icuIndex, caseIndex) {\n const dehydratedIcuDataMap = lView[HYDRATION]?.dehydratedIcuData;\n if (dehydratedIcuDataMap) {\n const dehydratedIcuData = dehydratedIcuDataMap.get(icuIndex);\n if (dehydratedIcuData?.case === caseIndex) {\n // If the case we're attempting to claim matches the dehydrated one,\n // we remove it from the map to mark it as \"claimed.\"\n dehydratedIcuDataMap.delete(icuIndex);\n }\n }\n}\n/**\n * Clean up all i18n hydration data associated with the given view.\n */\nfunction cleanupI18nHydrationData(lView) {\n const hydrationInfo = lView[HYDRATION];\n if (hydrationInfo) {\n const { i18nNodes, dehydratedIcuData: dehydratedIcuDataMap } = hydrationInfo;\n if (i18nNodes && dehydratedIcuDataMap) {\n const renderer = lView[RENDERER];\n for (const dehydratedIcuData of dehydratedIcuDataMap.values()) {\n cleanupDehydratedIcuData(renderer, i18nNodes, dehydratedIcuData);\n }\n }\n hydrationInfo.i18nNodes = undefined;\n hydrationInfo.dehydratedIcuData = undefined;\n }\n}\nfunction cleanupDehydratedIcuData(renderer, i18nNodes, dehydratedIcuData) {\n for (const node of dehydratedIcuData.node.cases[dehydratedIcuData.case]) {\n const rNode = i18nNodes.get(node.index - HEADER_OFFSET);\n if (rNode) {\n nativeRemoveNode(renderer, rNode, false);\n }\n }\n}\n\n/**\n * Removes all dehydrated views from a given LContainer:\n * both in internal data structure, as well as removing\n * corresponding DOM nodes that belong to that dehydrated view.\n */\nfunction removeDehydratedViews(lContainer) {\n const views = lContainer[DEHYDRATED_VIEWS] ?? [];\n const parentLView = lContainer[PARENT];\n const renderer = parentLView[RENDERER];\n const retainedViews = [];\n for (const view of views) {\n // Do not clean up contents of `@defer` blocks.\n // The cleanup for this content would happen once a given block\n // is triggered and hydrated.\n if (view.data[DEFER_BLOCK_ID] !== undefined) {\n retainedViews.push(view);\n }\n else {\n removeDehydratedView(view, renderer);\n ngDevMode && ngDevMode.dehydratedViewsRemoved++;\n }\n }\n // Reset the value to an array to indicate that no\n // further processing of dehydrated views is needed for\n // this view container (i.e. do not trigger the lookup process\n // once again in case a `ViewContainerRef` is created later).\n lContainer[DEHYDRATED_VIEWS] = retainedViews;\n}\nfunction removeDehydratedViewList(deferBlock) {\n const { lContainer } = deferBlock;\n const dehydratedViews = lContainer[DEHYDRATED_VIEWS];\n if (dehydratedViews === null)\n return;\n const parentLView = lContainer[PARENT];\n const renderer = parentLView[RENDERER];\n for (const view of dehydratedViews) {\n removeDehydratedView(view, renderer);\n ngDevMode && ngDevMode.dehydratedViewsRemoved++;\n }\n}\n/**\n * Helper function to remove all nodes from a dehydrated view.\n */\nfunction removeDehydratedView(dehydratedView, renderer) {\n let nodesRemoved = 0;\n let currentRNode = dehydratedView.firstChild;\n if (currentRNode) {\n const numNodes = dehydratedView.data[NUM_ROOT_NODES];\n while (nodesRemoved < numNodes) {\n ngDevMode && validateSiblingNodeExists(currentRNode);\n const nextSibling = currentRNode.nextSibling;\n nativeRemoveNode(renderer, currentRNode, false);\n currentRNode = nextSibling;\n nodesRemoved++;\n }\n }\n}\n/**\n * Walks over all views within this LContainer invokes dehydrated views\n * cleanup function for each one.\n */\nfunction cleanupLContainer(lContainer) {\n removeDehydratedViews(lContainer);\n // The host could be an LView if this container is on a component node.\n // In this case, descend into host LView for further cleanup. See also\n // LContainer[HOST] docs for additional information.\n const hostLView = lContainer[HOST];\n if (isLView(hostLView)) {\n cleanupLView(hostLView);\n }\n for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {\n cleanupLView(lContainer[i]);\n }\n}\n/**\n * Walks over `LContainer`s and components registered within\n * this LView and invokes dehydrated views cleanup function for each one.\n */\nfunction cleanupLView(lView) {\n cleanupI18nHydrationData(lView);\n const tView = lView[TVIEW];\n for (let i = HEADER_OFFSET; i < tView.bindingStartIndex; i++) {\n if (isLContainer(lView[i])) {\n const lContainer = lView[i];\n cleanupLContainer(lContainer);\n }\n else if (isLView(lView[i])) {\n // This is a component, enter the `cleanupLView` recursively.\n cleanupLView(lView[i]);\n }\n }\n}\n/**\n * Walks over all views registered within the ApplicationRef and removes\n * all dehydrated views from all `LContainer`s along the way.\n */\nfunction cleanupDehydratedViews(appRef) {\n const viewRefs = appRef._views;\n for (const viewRef of viewRefs) {\n const lNode = getLNodeForHydration(viewRef);\n // An `lView` might be `null` if a `ViewRef` represents\n // an embedded view (not a component view).\n if (lNode !== null && lNode[HOST] !== null) {\n if (isLView(lNode)) {\n cleanupLView(lNode);\n }\n else {\n // Cleanup in all views within this view container\n cleanupLContainer(lNode);\n }\n ngDevMode && ngDevMode.dehydratedViewsCleanupRuns++;\n }\n }\n}\n/**\n * post hydration cleanup handling for defer blocks that were incrementally\n * hydrated. This removes all the jsaction attributes, timers, observers,\n * dehydrated views and containers\n */\nfunction cleanupHydratedDeferBlocks(deferBlock, hydratedBlocks, registry, appRef) {\n if (deferBlock !== null) {\n registry.cleanup(hydratedBlocks);\n cleanupLContainer(deferBlock.lContainer);\n cleanupDehydratedViews(appRef);\n }\n}\n\n/**\n * Given a current DOM node and a serialized information about the views\n * in a container, walks over the DOM structure, collecting the list of\n * dehydrated views.\n */\nfunction locateDehydratedViewsInContainer(currentRNode, serializedViews) {\n const dehydratedViews = [];\n for (const serializedView of serializedViews) {\n // Repeats a view multiple times as needed, based on the serialized information\n // (for example, for *ngFor-produced views).\n for (let i = 0; i < (serializedView[MULTIPLIER] ?? 1); i++) {\n const view = {\n data: serializedView,\n firstChild: null,\n };\n if (serializedView[NUM_ROOT_NODES] > 0) {\n // Keep reference to the first node in this view,\n // so it can be accessed while invoking template instructions.\n view.firstChild = currentRNode;\n // Move over to the next node after this view, which can\n // either be a first node of the next view or an anchor comment\n // node after the last view in a container.\n currentRNode = siblingAfter(serializedView[NUM_ROOT_NODES], currentRNode);\n }\n dehydratedViews.push(view);\n }\n }\n return [currentRNode, dehydratedViews];\n}\n/**\n * Reference to a function that searches for a matching dehydrated views\n * stored on a given lContainer.\n * Returns `null` by default, when hydration is not enabled.\n */\nlet _findMatchingDehydratedViewImpl = () => null;\n/**\n * Reference to a function that searches for a matching dehydrated view\n * stored on a control flow lContainer and removes the dehydrated content\n * once found.\n * Returns `null` by default, when hydration is not enabled.\n */\nlet _findAndReconcileMatchingDehydratedViewsImpl = () => null;\nfunction enableFindMatchingDehydratedViewImpl() {\n _findMatchingDehydratedViewImpl = findMatchingDehydratedViewImpl;\n _findAndReconcileMatchingDehydratedViewsImpl = findAndReconcileMatchingDehydratedViewsImpl;\n}\n/**\n * Retrieves the next dehydrated view from the LContainer and verifies that\n * it matches a given template id (from the TView that was used to create this\n * instance of a view). If the id doesn't match, that means that we are in an\n * unexpected state and can not complete the reconciliation process. Thus,\n * all dehydrated views from this LContainer are removed (including corresponding\n * DOM nodes) and the rendering is performed as if there were no dehydrated views\n * in this container.\n */\nfunction findMatchingDehydratedViewImpl(lContainer, template) {\n if (hasMatchingDehydratedView(lContainer, template)) {\n return lContainer[DEHYDRATED_VIEWS].shift();\n }\n else {\n // Otherwise, we are at the state when reconciliation can not be completed,\n // thus we remove all dehydrated views within this container (remove them\n // from internal data structures as well as delete associated elements from\n // the DOM tree).\n removeDehydratedViews(lContainer);\n return null;\n }\n}\nfunction findMatchingDehydratedView(lContainer, template) {\n return _findMatchingDehydratedViewImpl(lContainer, template);\n}\nfunction findAndReconcileMatchingDehydratedViewsImpl(lContainer, templateTNode, hostLView) {\n if (templateTNode.tView.ssrId === null)\n return null;\n const dehydratedView = findMatchingDehydratedView(lContainer, templateTNode.tView.ssrId);\n // we know that an ssrId was generated, but we were unable to match it to\n // a dehydrated view, which means that we may have changed branches\n // between server and client. We'll need to find and remove those\n // stale dehydrated views.\n if (hostLView[TVIEW].firstUpdatePass && dehydratedView === null) {\n removeStaleDehydratedBranch(hostLView, templateTNode);\n }\n return dehydratedView;\n}\nfunction findAndReconcileMatchingDehydratedViews(lContainer, templateTNode, hostLView) {\n return _findAndReconcileMatchingDehydratedViewsImpl(lContainer, templateTNode, hostLView);\n}\n/**\n * In the case that we have control flow that changes branches between server and\n * client, we're left with dehydrated content that will not be used. We need to find\n * it and clean it up at the right time so that we don't see duplicate content for\n * a few moments before the application reaches stability. This navigates the\n * control flow containers by looking at the TNodeFlags to find the matching\n * dehydrated content for the branch that is now stale from the server and removes it.\n */\nfunction removeStaleDehydratedBranch(hostLView, tNode) {\n let currentTNode = tNode;\n while (currentTNode) {\n // We can return here if we've found the dehydrated view and cleaned it up.\n // Otherwise we continue on until we either find it or reach the start of\n // the control flow.\n if (cleanupMatchingDehydratedViews(hostLView, currentTNode))\n return;\n if ((currentTNode.flags & 256 /* TNodeFlags.isControlFlowStart */) === 256 /* TNodeFlags.isControlFlowStart */) {\n // we've hit the top of the control flow loop\n break;\n }\n currentTNode = currentTNode.prev;\n }\n currentTNode = tNode.next; // jump to place we started so we can navigate down from there\n while (currentTNode) {\n if ((currentTNode.flags & 512 /* TNodeFlags.isInControlFlow */) !== 512 /* TNodeFlags.isInControlFlow */) {\n // we've exited control flow and need to exit the loop.\n break;\n }\n // Similar to above, we can return here if we've found the dehydrated view\n // and cleaned it up. Otherwise we continue on until we either find it or\n // reach the end of the control flow.\n if (cleanupMatchingDehydratedViews(hostLView, currentTNode))\n return;\n currentTNode = currentTNode.next;\n }\n}\nfunction hasMatchingDehydratedView(lContainer, template) {\n const views = lContainer[DEHYDRATED_VIEWS];\n if (!template || views === null || views.length === 0) {\n return false;\n }\n // Verify whether the first dehydrated view in the container matches\n // the template id passed to this function (that originated from a TView\n // that was used to create an instance of an embedded or component views.\n return views[0].data[TEMPLATE_ID] === template;\n}\nfunction cleanupMatchingDehydratedViews(hostLView, currentTNode) {\n const ssrId = currentTNode.tView?.ssrId;\n if (ssrId == null /* check both `null` and `undefined` */)\n return false;\n const container = hostLView[currentTNode.index];\n // if we can find the dehydrated view in this container, we know we've found the stale view\n // and we can remove it.\n if (isLContainer(container) && hasMatchingDehydratedView(container, ssrId)) {\n removeDehydratedViews(container);\n return true;\n }\n return false;\n}\n\n/**\n * Represents a component created by a `ComponentFactory`.\n * Provides access to the component instance and related objects,\n * and provides the means of destroying the instance.\n *\n * @publicApi\n */\nlet ComponentRef$1 = class ComponentRef {\n};\n/**\n * Base class for a factory that can create a component dynamically.\n * Instantiate a factory for a given type of component with `resolveComponentFactory()`.\n * Use the resulting `ComponentFactory.create()` method to create a component of that type.\n *\n * @publicApi\n *\n * @deprecated Angular no longer requires Component factories. Please use other APIs where\n * Component class can be used directly.\n */\nlet ComponentFactory$1 = class ComponentFactory {\n};\n\nclass _NullComponentFactoryResolver {\n resolveComponentFactory(component) {\n throw new RuntimeError(917 /* RuntimeErrorCode.NO_COMPONENT_FACTORY_FOUND */, typeof ngDevMode !== 'undefined' &&\n ngDevMode &&\n `No component factory found for ${stringify(component)}.`);\n }\n}\n/**\n * A simple registry that maps `Components` to generated `ComponentFactory` classes\n * that can be used to create instances of components.\n * Use to obtain the factory for a given component type,\n * then use the factory's `create()` method to create a component of that type.\n *\n * Note: since v13, dynamic component creation via\n * [`ViewContainerRef.createComponent`](api/core/ViewContainerRef#createComponent)\n * does **not** require resolving component factory: component class can be used directly.\n *\n * @publicApi\n *\n * @deprecated Angular no longer requires Component factories. Please use other APIs where\n * Component class can be used directly.\n */\nlet ComponentFactoryResolver$1 = class ComponentFactoryResolver {\n static NULL = new _NullComponentFactoryResolver();\n};\n\n/**\n * Creates and initializes a custom renderer that implements the `Renderer2` base class.\n *\n * @publicApi\n */\nclass RendererFactory2 {\n}\n/**\n * Extend this base class to implement custom rendering. By default, Angular\n * renders a template into DOM. You can use custom rendering to intercept\n * rendering calls, or to render to something other than DOM.\n *\n * <div class=\"docs-alert docs-alert-important\">\n * <p>\n * Please be aware that usage of `Renderer2`, in context of accessing DOM elements, provides no\n * extra security which makes it equivalent to\n * {@link /best-practices/security#direct-use-of-the-dom-apis-and-explicit-sanitization-calls Security vulnerabilities}.\n * </p>\n * </div>\n *\n * Create your custom renderer using `RendererFactory2`.\n *\n * Use a custom renderer to bypass Angular's templating and\n * make custom UI changes that can't be expressed declaratively.\n * For example if you need to set a property or an attribute whose name is\n * not statically known, use the `setProperty()` or\n * `setAttribute()` method.\n *\n * @publicApi\n */\nclass Renderer2 {\n /**\n * If null or undefined, the view engine won't call it.\n * This is used as a performance optimization for production mode.\n */\n destroyNode = null;\n /**\n * @internal\n * @nocollapse\n */\n static __NG_ELEMENT_ID__ = () => injectRenderer2();\n}\n/** Injects a Renderer2 for the current component. */\nfunction injectRenderer2() {\n // We need the Renderer to be based on the component that it's being injected into, however since\n // DI happens before we've entered its view, `getLView` will return the parent view instead.\n const lView = getLView();\n const tNode = getCurrentTNode();\n const nodeAtIndex = getComponentLViewByIndex(tNode.index, lView);\n return (isLView(nodeAtIndex) ? nodeAtIndex : lView)[RENDERER];\n}\n\n/**\n * Sanitizer is used by the views to sanitize potentially dangerous values.\n *\n * @publicApi\n */\nclass Sanitizer {\n /** @nocollapse */\n static ɵprov = /** @pureOrBreakMyCode */ /* @__PURE__ */ __defineInjectable({\n token: Sanitizer,\n providedIn: 'root',\n factory: () => null,\n });\n}\n\nfunction isModuleWithProviders(value) {\n return value.ngModule !== undefined;\n}\nfunction isNgModule(value) {\n return !!getNgModuleDef(value);\n}\nfunction isPipe(value) {\n return !!getPipeDef$1(value);\n}\nfunction isDirective(value) {\n return !!getDirectiveDef(value);\n}\nfunction isComponent(value) {\n return !!getComponentDef(value);\n}\nfunction getDependencyTypeForError(type) {\n if (getComponentDef(type))\n return 'component';\n if (getDirectiveDef(type))\n return 'directive';\n if (getPipeDef$1(type))\n return 'pipe';\n return 'type';\n}\nfunction verifyStandaloneImport(depType, importingType) {\n if (isForwardRef(depType)) {\n depType = resolveForwardRef(depType);\n if (!depType) {\n throw new Error(`Expected forwardRef function, imported from \"${stringifyForError(importingType)}\", to return a standalone entity or NgModule but got \"${stringifyForError(depType) || depType}\".`);\n }\n }\n if (getNgModuleDef(depType) == null) {\n const def = getComponentDef(depType) || getDirectiveDef(depType) || getPipeDef$1(depType);\n if (def != null) {\n // if a component, directive or pipe is imported make sure that it is standalone\n if (!def.standalone) {\n throw new Error(`The \"${stringifyForError(depType)}\" ${getDependencyTypeForError(depType)}, imported from \"${stringifyForError(importingType)}\", is not standalone. Did you forget to add the standalone: true flag?`);\n }\n }\n else {\n // it can be either a module with provider or an unknown (not annotated) type\n if (isModuleWithProviders(depType)) {\n throw new Error(`A module with providers was imported from \"${stringifyForError(importingType)}\". Modules with providers are not supported in standalone components imports.`);\n }\n else {\n throw new Error(`The \"${stringifyForError(depType)}\" type, imported from \"${stringifyForError(importingType)}\", must be a standalone component / directive / pipe or an NgModule. Did you forget to add the required @Component / @Directive / @Pipe or @NgModule annotation?`);\n }\n }\n }\n}\n\n/**\n * An implementation of DepsTrackerApi which will be used for JIT and local compilation.\n */\nclass DepsTracker {\n ownerNgModule = new Map();\n ngModulesWithSomeUnresolvedDecls = new Set();\n ngModulesScopeCache = new Map();\n standaloneComponentsScopeCache = new Map();\n /**\n * Attempts to resolve ng module's forward ref declarations as much as possible and add them to\n * the `ownerNgModule` map. This method normally should be called after the initial parsing when\n * all the forward refs are resolved (e.g., when trying to render a component)\n */\n resolveNgModulesDecls() {\n if (this.ngModulesWithSomeUnresolvedDecls.size === 0) {\n return;\n }\n for (const moduleType of this.ngModulesWithSomeUnresolvedDecls) {\n const def = getNgModuleDef(moduleType);\n if (def?.declarations) {\n for (const decl of maybeUnwrapFn(def.declarations)) {\n if (isComponent(decl)) {\n this.ownerNgModule.set(decl, moduleType);\n }\n }\n }\n }\n this.ngModulesWithSomeUnresolvedDecls.clear();\n }\n /** @override */\n getComponentDependencies(type, rawImports) {\n this.resolveNgModulesDecls();\n const def = getComponentDef(type);\n if (def === null) {\n throw new Error(`Attempting to get component dependencies for a type that is not a component: ${type}`);\n }\n if (def.standalone) {\n const scope = this.getStandaloneComponentScope(type, rawImports);\n if (scope.compilation.isPoisoned) {\n return { dependencies: [] };\n }\n return {\n dependencies: [\n ...scope.compilation.directives,\n ...scope.compilation.pipes,\n ...scope.compilation.ngModules,\n ],\n };\n }\n else {\n if (!this.ownerNgModule.has(type)) {\n // This component is orphan! No need to handle the error since the component rendering\n // pipeline (e.g., view_container_ref) will check for this error based on configs.\n return { dependencies: [] };\n }\n const scope = this.getNgModuleScope(this.ownerNgModule.get(type));\n if (scope.compilation.isPoisoned) {\n return { dependencies: [] };\n }\n return {\n dependencies: [...scope.compilation.directives, ...scope.compilation.pipes],\n };\n }\n }\n /**\n * @override\n * This implementation does not make use of param scopeInfo since it assumes the scope info is\n * already added to the type itself through methods like {@link ɵɵsetNgModuleScope}\n */\n registerNgModule(type, scopeInfo) {\n if (!isNgModule(type)) {\n throw new Error(`Attempting to register a Type which is not NgModule as NgModule: ${type}`);\n }\n // Lazily process the NgModules later when needed.\n this.ngModulesWithSomeUnresolvedDecls.add(type);\n }\n /** @override */\n clearScopeCacheFor(type) {\n this.ngModulesScopeCache.delete(type);\n this.standaloneComponentsScopeCache.delete(type);\n }\n /** @override */\n getNgModuleScope(type) {\n if (this.ngModulesScopeCache.has(type)) {\n return this.ngModulesScopeCache.get(type);\n }\n const scope = this.computeNgModuleScope(type);\n this.ngModulesScopeCache.set(type, scope);\n return scope;\n }\n /** Compute NgModule scope afresh. */\n computeNgModuleScope(type) {\n const def = getNgModuleDefOrThrow(type);\n const scope = {\n exported: { directives: new Set(), pipes: new Set() },\n compilation: { directives: new Set(), pipes: new Set() },\n };\n // Analyzing imports\n for (const imported of maybeUnwrapFn(def.imports)) {\n if (isNgModule(imported)) {\n const importedScope = this.getNgModuleScope(imported);\n // When this module imports another, the imported module's exported directives and pipes\n // are added to the compilation scope of this module.\n addSet(importedScope.exported.directives, scope.compilation.directives);\n addSet(importedScope.exported.pipes, scope.compilation.pipes);\n }\n else if (isStandalone(imported)) {\n if (isDirective(imported) || isComponent(imported)) {\n scope.compilation.directives.add(imported);\n }\n else if (isPipe(imported)) {\n scope.compilation.pipes.add(imported);\n }\n else {\n // The standalone thing is neither a component nor a directive nor a pipe ... (what?)\n throw new RuntimeError(980 /* RuntimeErrorCode.RUNTIME_DEPS_INVALID_IMPORTED_TYPE */, 'The standalone imported type is neither a component nor a directive nor a pipe');\n }\n }\n else {\n // The import is neither a module nor a module-with-providers nor a standalone thing. This\n // is going to be an error. So we short circuit.\n scope.compilation.isPoisoned = true;\n break;\n }\n }\n // Analyzing declarations\n if (!scope.compilation.isPoisoned) {\n for (const decl of maybeUnwrapFn(def.declarations)) {\n // Cannot declare another NgModule or a standalone thing\n if (isNgModule(decl) || isStandalone(decl)) {\n scope.compilation.isPoisoned = true;\n break;\n }\n if (isPipe(decl)) {\n scope.compilation.pipes.add(decl);\n }\n else {\n // decl is either a directive or a component. The component may not yet have the ɵcmp due\n // to async compilation.\n scope.compilation.directives.add(decl);\n }\n }\n }\n // Analyzing exports\n for (const exported of maybeUnwrapFn(def.exports)) {\n if (isNgModule(exported)) {\n // When this module exports another, the exported module's exported directives and pipes\n // are added to both the compilation and exported scopes of this module.\n const exportedScope = this.getNgModuleScope(exported);\n // Based on the current logic there is no way to have poisoned exported scope. So no need to\n // check for it.\n addSet(exportedScope.exported.directives, scope.exported.directives);\n addSet(exportedScope.exported.pipes, scope.exported.pipes);\n // Some test toolings which run in JIT mode depend on this behavior that the exported scope\n // should also be present in the compilation scope, even though AoT does not support this\n // and it is also in odds with NgModule metadata definitions. Without this some tests in\n // Google will fail.\n addSet(exportedScope.exported.directives, scope.compilation.directives);\n addSet(exportedScope.exported.pipes, scope.compilation.pipes);\n }\n else if (isPipe(exported)) {\n scope.exported.pipes.add(exported);\n }\n else {\n scope.exported.directives.add(exported);\n }\n }\n return scope;\n }\n /** @override */\n getStandaloneComponentScope(type, rawImports) {\n if (this.standaloneComponentsScopeCache.has(type)) {\n return this.standaloneComponentsScopeCache.get(type);\n }\n const ans = this.computeStandaloneComponentScope(type, rawImports);\n this.standaloneComponentsScopeCache.set(type, ans);\n return ans;\n }\n computeStandaloneComponentScope(type, rawImports) {\n const ans = {\n compilation: {\n // Standalone components are always able to self-reference.\n directives: new Set([type]),\n pipes: new Set(),\n ngModules: new Set(),\n },\n };\n for (const rawImport of flatten(rawImports ?? [])) {\n const imported = resolveForwardRef(rawImport);\n try {\n verifyStandaloneImport(imported, type);\n }\n catch (e) {\n // Short-circuit if an import is not valid\n ans.compilation.isPoisoned = true;\n return ans;\n }\n if (isNgModule(imported)) {\n ans.compilation.ngModules.add(imported);\n const importedScope = this.getNgModuleScope(imported);\n // Short-circuit if an imported NgModule has corrupted exported scope.\n if (importedScope.exported.isPoisoned) {\n ans.compilation.isPoisoned = true;\n return ans;\n }\n addSet(importedScope.exported.directives, ans.compilation.directives);\n addSet(importedScope.exported.pipes, ans.compilation.pipes);\n }\n else if (isPipe(imported)) {\n ans.compilation.pipes.add(imported);\n }\n else if (isDirective(imported) || isComponent(imported)) {\n ans.compilation.directives.add(imported);\n }\n else {\n // The imported thing is not module/pipe/directive/component, so we error and short-circuit\n // here\n ans.compilation.isPoisoned = true;\n return ans;\n }\n }\n return ans;\n }\n /** @override */\n isOrphanComponent(cmp) {\n const def = getComponentDef(cmp);\n if (!def || def.standalone) {\n return false;\n }\n this.resolveNgModulesDecls();\n return !this.ownerNgModule.has(cmp);\n }\n}\nfunction addSet(sourceSet, targetSet) {\n for (const m of sourceSet) {\n targetSet.add(m);\n }\n}\n/** The deps tracker to be used in the current Angular app in dev mode. */\nconst depsTracker = new DepsTracker();\n\n// This default value is when checking the hierarchy for a token.\n//\n// It means both:\n// - the token is not provided by the current injector,\n// - only the element injectors should be checked (ie do not check module injectors\n//\n// mod1\n// /\n// el1 mod2\n// \\ /\n// el2\n//\n// When requesting el2.injector.get(token), we should check in the following order and return the\n// first found value:\n// - el2.injector.get(token, default)\n// - el1.injector.get(token, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR) -> do not check the module\n// - mod2.injector.get(token, default)\nconst NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR = {};\n\n/**\n * Injector that looks up a value using a specific injector, before falling back to the module\n * injector. Used primarily when creating components or embedded views dynamically.\n */\nclass ChainedInjector {\n injector;\n parentInjector;\n constructor(injector, parentInjector) {\n this.injector = injector;\n this.parentInjector = parentInjector;\n }\n get(token, notFoundValue, options) {\n const value = this.injector.get(token, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR, options);\n if (value !== NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR ||\n notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR) {\n // Return the value from the root element injector when\n // - it provides it\n // (value !== NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR)\n // - the module injector should not be checked\n // (notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR)\n return value;\n }\n return this.parentInjector.get(token, notFoundValue, options);\n }\n}\n\n/**\n * Compute the static styling (class/style) from `TAttributes`.\n *\n * This function should be called during `firstCreatePass` only.\n *\n * @param tNode The `TNode` into which the styling information should be loaded.\n * @param attrs `TAttributes` containing the styling information.\n * @param writeToHost Where should the resulting static styles be written?\n * - `false` Write to `TNode.stylesWithoutHost` / `TNode.classesWithoutHost`\n * - `true` Write to `TNode.styles` / `TNode.classes`\n */\nfunction computeStaticStyling(tNode, attrs, writeToHost) {\n ngDevMode &&\n assertFirstCreatePass(getTView(), 'Expecting to be called in first template pass only');\n let styles = writeToHost ? tNode.styles : null;\n let classes = writeToHost ? tNode.classes : null;\n let mode = 0;\n if (attrs !== null) {\n for (let i = 0; i < attrs.length; i++) {\n const value = attrs[i];\n if (typeof value === 'number') {\n mode = value;\n }\n else if (mode == 1 /* AttributeMarker.Classes */) {\n classes = concatStringsWithSpace(classes, value);\n }\n else if (mode == 2 /* AttributeMarker.Styles */) {\n const style = value;\n const styleValue = attrs[++i];\n styles = concatStringsWithSpace(styles, style + ': ' + styleValue + ';');\n }\n }\n }\n writeToHost ? (tNode.styles = styles) : (tNode.stylesWithoutHost = styles);\n writeToHost ? (tNode.classes = classes) : (tNode.classesWithoutHost = classes);\n}\n\nfunction ɵɵdirectiveInject(token, flags = 0 /* InternalInjectFlags.Default */) {\n const lView = getLView();\n // Fall back to inject() if view hasn't been created. This situation can happen in tests\n // if inject utilities are used before bootstrapping.\n if (lView === null) {\n // Verify that we will not get into infinite loop.\n ngDevMode && assertInjectImplementationNotEqual(ɵɵdirectiveInject);\n return __inject(token, flags);\n }\n const tNode = getCurrentTNode();\n const value = getOrCreateInjectable(tNode, lView, resolveForwardRef(token), flags);\n ngDevMode && emitInjectEvent(token, value, flags);\n return value;\n}\n/**\n * Throws an error indicating that a factory function could not be generated by the compiler for a\n * particular class.\n *\n * This instruction allows the actual error message to be optimized away when ngDevMode is turned\n * off, saving bytes of generated code while still providing a good experience in dev mode.\n *\n * The name of the class is not mentioned here, but will be in the generated factory function name\n * and thus in the stack trace.\n *\n * @codeGenApi\n */\nfunction ɵɵinvalidFactory() {\n const msg = ngDevMode\n ? `This constructor was not compatible with Dependency Injection.`\n : 'invalid';\n throw new Error(msg);\n}\n\n/**\n * Resolve the matched directives on a node.\n */\nfunction resolveDirectives(tView, lView, tNode, localRefs, directiveMatcher) {\n // Please make sure to have explicit type for `exportsMap`. Inferred type triggers bug in tsickle.\n ngDevMode && assertFirstCreatePass(tView);\n const exportsMap = localRefs === null ? null : { '': -1 };\n const matchedDirectiveDefs = directiveMatcher(tView, tNode);\n if (matchedDirectiveDefs !== null) {\n let directiveDefs = matchedDirectiveDefs;\n let hostDirectiveDefs = null;\n let hostDirectiveRanges = null;\n for (const def of matchedDirectiveDefs) {\n if (def.resolveHostDirectives !== null) {\n [directiveDefs, hostDirectiveDefs, hostDirectiveRanges] =\n def.resolveHostDirectives(matchedDirectiveDefs);\n break;\n }\n }\n ngDevMode && assertNoDuplicateDirectives(directiveDefs);\n initializeDirectives(tView, lView, tNode, directiveDefs, exportsMap, hostDirectiveDefs, hostDirectiveRanges);\n }\n if (exportsMap !== null && localRefs !== null) {\n cacheMatchingLocalNames(tNode, localRefs, exportsMap);\n }\n}\n/** Caches local names and their matching directive indices for query and template lookups. */\nfunction cacheMatchingLocalNames(tNode, localRefs, exportsMap) {\n const localNames = (tNode.localNames = []);\n // Local names must be stored in tNode in the same order that localRefs are defined\n // in the template to ensure the data is loaded in the same slots as their refs\n // in the template (for template queries).\n for (let i = 0; i < localRefs.length; i += 2) {\n const index = exportsMap[localRefs[i + 1]];\n if (index == null)\n throw new RuntimeError(-301 /* RuntimeErrorCode.EXPORT_NOT_FOUND */, ngDevMode && `Export of name '${localRefs[i + 1]}' not found!`);\n localNames.push(localRefs[i], index);\n }\n}\n/**\n * Marks a given TNode as a component's host. This consists of:\n * - setting the component offset on the TNode.\n * - storing index of component's host element so it will be queued for view refresh during CD.\n */\nfunction markAsComponentHost(tView, hostTNode, componentOffset) {\n ngDevMode && assertFirstCreatePass(tView);\n ngDevMode && assertGreaterThan(componentOffset, -1, 'componentOffset must be great than -1');\n hostTNode.componentOffset = componentOffset;\n (tView.components ??= []).push(hostTNode.index);\n}\n/** Initializes the data structures necessary for a list of directives to be instantiated. */\nfunction initializeDirectives(tView, lView, tNode, directives, exportsMap, hostDirectiveDefs, hostDirectiveRanges) {\n ngDevMode && assertFirstCreatePass(tView);\n const directivesLength = directives.length;\n let hasSeenComponent = false;\n // Publishes the directive types to DI so they can be injected. Needs to\n // happen in a separate pass before the TNode flags have been initialized.\n for (let i = 0; i < directivesLength; i++) {\n const def = directives[i];\n if (!hasSeenComponent && isComponentDef(def)) {\n hasSeenComponent = true;\n markAsComponentHost(tView, tNode, i);\n }\n diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, lView), tView, def.type);\n }\n initTNodeFlags(tNode, tView.data.length, directivesLength);\n // When the same token is provided by several directives on the same node, some rules apply in\n // the viewEngine:\n // - viewProviders have priority over providers\n // - the last directive in NgModule.declarations has priority over the previous one\n // So to match these rules, the order in which providers are added in the arrays is very\n // important.\n for (let i = 0; i < directivesLength; i++) {\n const def = directives[i];\n if (def.providersResolver)\n def.providersResolver(def);\n }\n let preOrderHooksFound = false;\n let preOrderCheckHooksFound = false;\n let directiveIdx = allocExpando(tView, lView, directivesLength, null);\n ngDevMode &&\n assertSame(directiveIdx, tNode.directiveStart, 'TNode.directiveStart should point to just allocated space');\n // If there's at least one directive, we'll have to track it so initialize the map.\n if (directivesLength > 0) {\n tNode.directiveToIndex = new Map();\n }\n for (let i = 0; i < directivesLength; i++) {\n const def = directives[i];\n // Merge the attrs in the order of matches. This assumes that the first directive is the\n // component itself, so that the component has the least priority.\n tNode.mergedAttrs = mergeHostAttrs(tNode.mergedAttrs, def.hostAttrs);\n configureViewWithDirective(tView, tNode, lView, directiveIdx, def);\n saveNameToExportMap(directiveIdx, def, exportsMap);\n // If a directive has host directives, we need to track both its index and the range within\n // the host directives are declared. Host directives are not tracked, but should be resolved\n // by looking up the host and getting its indexes from there.\n if (hostDirectiveRanges !== null && hostDirectiveRanges.has(def)) {\n const [start, end] = hostDirectiveRanges.get(def);\n tNode.directiveToIndex.set(def.type, [\n directiveIdx,\n start + tNode.directiveStart,\n end + tNode.directiveStart,\n ]);\n }\n else if (hostDirectiveDefs === null || !hostDirectiveDefs.has(def)) {\n tNode.directiveToIndex.set(def.type, directiveIdx);\n }\n if (def.contentQueries !== null)\n tNode.flags |= 4 /* TNodeFlags.hasContentQuery */;\n if (def.hostBindings !== null || def.hostAttrs !== null || def.hostVars !== 0)\n tNode.flags |= 64 /* TNodeFlags.hasHostBindings */;\n const lifeCycleHooks = def.type.prototype;\n // Only push a node index into the preOrderHooks array if this is the first\n // pre-order hook found on this node.\n if (!preOrderHooksFound &&\n (lifeCycleHooks.ngOnChanges || lifeCycleHooks.ngOnInit || lifeCycleHooks.ngDoCheck)) {\n // We will push the actual hook function into this array later during dir instantiation.\n // We cannot do it now because we must ensure hooks are registered in the same\n // order that directives are created (i.e. injection order).\n (tView.preOrderHooks ??= []).push(tNode.index);\n preOrderHooksFound = true;\n }\n if (!preOrderCheckHooksFound && (lifeCycleHooks.ngOnChanges || lifeCycleHooks.ngDoCheck)) {\n (tView.preOrderCheckHooks ??= []).push(tNode.index);\n preOrderCheckHooksFound = true;\n }\n directiveIdx++;\n }\n initializeInputAndOutputAliases(tView, tNode, hostDirectiveDefs);\n}\n/**\n * Initializes data structures required to work with directive inputs and outputs.\n * Initialization is done for all directives matched on a given TNode.\n */\nfunction initializeInputAndOutputAliases(tView, tNode, hostDirectiveDefs) {\n ngDevMode && assertFirstCreatePass(tView);\n for (let index = tNode.directiveStart; index < tNode.directiveEnd; index++) {\n const directiveDef = tView.data[index];\n if (hostDirectiveDefs === null || !hostDirectiveDefs.has(directiveDef)) {\n setupSelectorMatchedInputsOrOutputs(0 /* BindingType.Inputs */, tNode, directiveDef, index);\n setupSelectorMatchedInputsOrOutputs(1 /* BindingType.Outputs */, tNode, directiveDef, index);\n setupInitialInputs(tNode, index, false);\n }\n else {\n const hostDirectiveDef = hostDirectiveDefs.get(directiveDef);\n setupHostDirectiveInputsOrOutputs(0 /* BindingType.Inputs */, tNode, hostDirectiveDef, index);\n setupHostDirectiveInputsOrOutputs(1 /* BindingType.Outputs */, tNode, hostDirectiveDef, index);\n setupInitialInputs(tNode, index, true);\n }\n }\n}\n/**\n * Sets up the input/output bindings for a directive that was matched in the template through its\n * selector. This method is called repeatedly to build up all of the available inputs on a node.\n *\n * @param mode Whether inputs or outputs are being contructed.\n * @param tNode Node on which the bindings are being set up.\n * @param def Directive definition for which the bindings are being set up.\n * @param directiveIndex Index at which the directive instance will be stored in the LView.\n */\nfunction setupSelectorMatchedInputsOrOutputs(mode, tNode, def, directiveIndex) {\n const aliasMap = mode === 0 /* BindingType.Inputs */ ? def.inputs : def.outputs;\n for (const publicName in aliasMap) {\n if (aliasMap.hasOwnProperty(publicName)) {\n let bindings;\n if (mode === 0 /* BindingType.Inputs */) {\n bindings = tNode.inputs ??= {};\n }\n else {\n bindings = tNode.outputs ??= {};\n }\n bindings[publicName] ??= [];\n bindings[publicName].push(directiveIndex);\n setShadowStylingInputFlags(tNode, publicName);\n }\n }\n}\n/**\n * Sets up input/output bindings that were defined through host directives on a specific node.\n * @param mode Whether inputs or outputs are being contructed.\n * @param tNode Node on which the bindings are being set up.\n * @param config Host directive definition that is being set up.\n * @param directiveIndex Index at which the directive instance will be stored in the LView.\n */\nfunction setupHostDirectiveInputsOrOutputs(mode, tNode, config, directiveIndex) {\n const aliasMap = mode === 0 /* BindingType.Inputs */ ? config.inputs : config.outputs;\n for (const initialName in aliasMap) {\n if (aliasMap.hasOwnProperty(initialName)) {\n const publicName = aliasMap[initialName];\n let bindings;\n if (mode === 0 /* BindingType.Inputs */) {\n bindings = tNode.hostDirectiveInputs ??= {};\n }\n else {\n bindings = tNode.hostDirectiveOutputs ??= {};\n }\n bindings[publicName] ??= [];\n bindings[publicName].push(directiveIndex, initialName);\n setShadowStylingInputFlags(tNode, publicName);\n }\n }\n}\nfunction setShadowStylingInputFlags(tNode, publicName) {\n if (publicName === 'class') {\n tNode.flags |= 8 /* TNodeFlags.hasClassInput */;\n }\n else if (publicName === 'style') {\n tNode.flags |= 16 /* TNodeFlags.hasStyleInput */;\n }\n}\n/**\n * Sets up the initialInputData for a node and stores it in the template's static storage\n * so subsequent template invocations don't have to recalculate it.\n *\n * initialInputData is an array containing values that need to be set as input properties\n * for directives on this node, but only once on creation. We need this array to support\n * the case where you set an @Input property of a directive using attribute-like syntax.\n * e.g. if you have a `name` @Input, you can set it once like this:\n *\n * <my-component name=\"Bess\"></my-component>\n *\n * @param tNode TNode on which to set up the initial inputs.\n * @param directiveIndex Index of the directive that is currently being processed.\n */\nfunction setupInitialInputs(tNode, directiveIndex, isHostDirective) {\n const { attrs, inputs, hostDirectiveInputs } = tNode;\n if (attrs === null ||\n (!isHostDirective && inputs === null) ||\n (isHostDirective && hostDirectiveInputs === null) ||\n // Do not use unbound attributes as inputs to structural directives, since structural\n // directive inputs can only be set using microsyntax (e.g. `<div *dir=\"exp\">`).\n isInlineTemplate(tNode)) {\n tNode.initialInputs ??= [];\n tNode.initialInputs.push(null);\n return;\n }\n let inputsToStore = null;\n let i = 0;\n while (i < attrs.length) {\n const attrName = attrs[i];\n if (attrName === 0 /* AttributeMarker.NamespaceURI */) {\n // We do not allow inputs on namespaced attributes.\n i += 4;\n continue;\n }\n else if (attrName === 5 /* AttributeMarker.ProjectAs */) {\n // Skip over the `ngProjectAs` value.\n i += 2;\n continue;\n }\n else if (typeof attrName === 'number') {\n // If we hit any other attribute markers, we're done anyway. None of those are valid inputs.\n break;\n }\n if (!isHostDirective && inputs.hasOwnProperty(attrName)) {\n // Find the input's public name from the input store. Note that we can be found easier\n // through the directive def, but we want to do it using the inputs store so that it can\n // account for host directive aliases.\n const inputConfig = inputs[attrName];\n for (const index of inputConfig) {\n if (index === directiveIndex) {\n inputsToStore ??= [];\n inputsToStore.push(attrName, attrs[i + 1]);\n // A directive can't have multiple inputs with the same name so we can break here.\n break;\n }\n }\n }\n else if (isHostDirective && hostDirectiveInputs.hasOwnProperty(attrName)) {\n const config = hostDirectiveInputs[attrName];\n for (let j = 0; j < config.length; j += 2) {\n if (config[j] === directiveIndex) {\n inputsToStore ??= [];\n inputsToStore.push(config[j + 1], attrs[i + 1]);\n break;\n }\n }\n }\n i += 2;\n }\n tNode.initialInputs ??= [];\n tNode.initialInputs.push(inputsToStore);\n}\n/**\n * Setup directive for instantiation.\n *\n * We need to create a `NodeInjectorFactory` which is then inserted in both the `Blueprint` as well\n * as `LView`. `TView` gets the `DirectiveDef`.\n *\n * @param tView `TView`\n * @param tNode `TNode`\n * @param lView `LView`\n * @param directiveIndex Index where the directive will be stored in the Expando.\n * @param def `DirectiveDef`\n */\nfunction configureViewWithDirective(tView, tNode, lView, directiveIndex, def) {\n ngDevMode &&\n assertGreaterThanOrEqual(directiveIndex, HEADER_OFFSET, 'Must be in Expando section');\n tView.data[directiveIndex] = def;\n const directiveFactory = def.factory || (def.factory = getFactoryDef(def.type, true));\n // Even though `directiveFactory` will already be using `ɵɵdirectiveInject` in its generated code,\n // we also want to support `inject()` directly from the directive constructor context so we set\n // `ɵɵdirectiveInject` as the inject implementation here too.\n const nodeInjectorFactory = new NodeInjectorFactory(directiveFactory, isComponentDef(def), ɵɵdirectiveInject, ngDevMode ? def.type.name : null);\n tView.blueprint[directiveIndex] = nodeInjectorFactory;\n lView[directiveIndex] = nodeInjectorFactory;\n registerHostBindingOpCodes(tView, tNode, directiveIndex, allocExpando(tView, lView, def.hostVars, NO_CHANGE), def);\n}\n/**\n * Add `hostBindings` to the `TView.hostBindingOpCodes`.\n *\n * @param tView `TView` to which the `hostBindings` should be added.\n * @param tNode `TNode` the element which contains the directive\n * @param directiveIdx Directive index in view.\n * @param directiveVarsIdx Where will the directive's vars be stored\n * @param def `ComponentDef`/`DirectiveDef`, which contains the `hostVars`/`hostBindings` to add.\n */\nfunction registerHostBindingOpCodes(tView, tNode, directiveIdx, directiveVarsIdx, def) {\n ngDevMode && assertFirstCreatePass(tView);\n const hostBindings = def.hostBindings;\n if (hostBindings) {\n let hostBindingOpCodes = tView.hostBindingOpCodes;\n if (hostBindingOpCodes === null) {\n hostBindingOpCodes = tView.hostBindingOpCodes = [];\n }\n const elementIndx = ~tNode.index;\n if (lastSelectedElementIdx(hostBindingOpCodes) != elementIndx) {\n // Conditionally add select element so that we are more efficient in execution.\n // NOTE: this is strictly not necessary and it trades code size for runtime perf.\n // (We could just always add it.)\n hostBindingOpCodes.push(elementIndx);\n }\n hostBindingOpCodes.push(directiveIdx, directiveVarsIdx, hostBindings);\n }\n}\n/**\n * Returns the last selected element index in the `HostBindingOpCodes`\n *\n * For perf reasons we don't need to update the selected element index in `HostBindingOpCodes` only\n * if it changes. This method returns the last index (or '0' if not found.)\n *\n * Selected element index are only the ones which are negative.\n */\nfunction lastSelectedElementIdx(hostBindingOpCodes) {\n let i = hostBindingOpCodes.length;\n while (i > 0) {\n const value = hostBindingOpCodes[--i];\n if (typeof value === 'number' && value < 0) {\n return value;\n }\n }\n return 0;\n}\n/**\n * Builds up an export map as directives are created, so local refs can be quickly mapped\n * to their directive instances.\n */\nfunction saveNameToExportMap(directiveIdx, def, exportsMap) {\n if (exportsMap) {\n if (def.exportAs) {\n for (let i = 0; i < def.exportAs.length; i++) {\n exportsMap[def.exportAs[i]] = directiveIdx;\n }\n }\n if (isComponentDef(def))\n exportsMap[''] = directiveIdx;\n }\n}\n/**\n * Initializes the flags on the current node, setting all indices to the initial index,\n * the directive count to 0, and adding the isComponent flag.\n * @param index the initial index\n */\nfunction initTNodeFlags(tNode, index, numberOfDirectives) {\n ngDevMode &&\n assertNotEqual(numberOfDirectives, tNode.directiveEnd - tNode.directiveStart, 'Reached the max number of directives');\n tNode.flags |= 1 /* TNodeFlags.isDirectiveHost */;\n // When the first directive is created on a node, save the index\n tNode.directiveStart = index;\n tNode.directiveEnd = index + numberOfDirectives;\n tNode.providerIndexes = index;\n}\nfunction assertNoDuplicateDirectives(directives) {\n // The array needs at least two elements in order to have duplicates.\n if (directives.length < 2) {\n return;\n }\n const seenDirectives = new Set();\n for (const current of directives) {\n if (seenDirectives.has(current)) {\n throw new RuntimeError(309 /* RuntimeErrorCode.DUPLICATE_DIRECTIVE */, `Directive ${current.type.name} matches multiple times on the same element. ` +\n `Directives can only match an element once.`);\n }\n seenDirectives.add(current);\n }\n}\n\nfunction directiveHostFirstCreatePass(index, lView, type, name, directiveMatcher, bindingsEnabled, attrsIndex, localRefsIndex) {\n const tView = lView[TVIEW];\n ngDevMode && assertFirstCreatePass(tView);\n const tViewConsts = tView.consts;\n const attrs = getConstant(tViewConsts, attrsIndex);\n const tNode = getOrCreateTNode(tView, index, type, name, attrs);\n if (bindingsEnabled) {\n resolveDirectives(tView, lView, tNode, getConstant(tViewConsts, localRefsIndex), directiveMatcher);\n }\n // Merge the template attrs last so that they have the highest priority.\n tNode.mergedAttrs = mergeHostAttrs(tNode.mergedAttrs, tNode.attrs);\n if (tNode.attrs !== null) {\n computeStaticStyling(tNode, tNode.attrs, false);\n }\n if (tNode.mergedAttrs !== null) {\n computeStaticStyling(tNode, tNode.mergedAttrs, true);\n }\n if (tView.queries !== null) {\n tView.queries.elementStart(tView, tNode);\n }\n return tNode;\n}\nfunction directiveHostEndFirstCreatePass(tView, tNode) {\n ngDevMode && assertFirstCreatePass(tView);\n registerPostOrderHooks(tView, tNode);\n if (isContentQueryHost(tNode)) {\n tView.queries.elementEnd(tNode);\n }\n}\nfunction domOnlyFirstCreatePass(index, tView, type, name, attrsIndex, localRefsIndex) {\n ngDevMode && assertFirstCreatePass(tView);\n const tViewConsts = tView.consts;\n const attrs = getConstant(tViewConsts, attrsIndex);\n const tNode = getOrCreateTNode(tView, index, type, name, attrs);\n // Merge the template attrs last so that they have the highest priority.\n tNode.mergedAttrs = mergeHostAttrs(tNode.mergedAttrs, tNode.attrs);\n if (localRefsIndex != null) {\n const refs = getConstant(tViewConsts, localRefsIndex);\n tNode.localNames = [];\n for (let i = 0; i < refs.length; i += 2) {\n // Always -1 since DOM-only instructions can only refer to the native node.\n tNode.localNames.push(refs[i], -1);\n }\n }\n if (tNode.attrs !== null) {\n computeStaticStyling(tNode, tNode.attrs, false);\n }\n if (tNode.mergedAttrs !== null) {\n computeStaticStyling(tNode, tNode.mergedAttrs, true);\n }\n if (tView.queries !== null) {\n tView.queries.elementStart(tView, tNode);\n }\n return tNode;\n}\n\nfunction isListLikeIterable(obj) {\n if (!isJsObject(obj))\n return false;\n return (Array.isArray(obj) ||\n (!(obj instanceof Map) && // JS Map are iterables but return entries as [k, v]\n Symbol.iterator in obj)); // JS Iterable have a Symbol.iterator prop\n}\nfunction areIterablesEqual(a, b, comparator) {\n const iterator1 = a[Symbol.iterator]();\n const iterator2 = b[Symbol.iterator]();\n while (true) {\n const item1 = iterator1.next();\n const item2 = iterator2.next();\n if (item1.done && item2.done)\n return true;\n if (item1.done || item2.done)\n return false;\n if (!comparator(item1.value, item2.value))\n return false;\n }\n}\nfunction iterateListLike(obj, fn) {\n if (Array.isArray(obj)) {\n for (let i = 0; i < obj.length; i++) {\n fn(obj[i]);\n }\n }\n else {\n const iterator = obj[Symbol.iterator]();\n let item;\n while (!(item = iterator.next()).done) {\n fn(item.value);\n }\n }\n}\nfunction isJsObject(o) {\n return o !== null && (typeof o === 'function' || typeof o === 'object');\n}\n\nfunction devModeEqual(a, b) {\n const isListLikeIterableA = isListLikeIterable(a);\n const isListLikeIterableB = isListLikeIterable(b);\n if (isListLikeIterableA && isListLikeIterableB) {\n return areIterablesEqual(a, b, devModeEqual);\n }\n else {\n const isAObject = a && (typeof a === 'object' || typeof a === 'function');\n const isBObject = b && (typeof b === 'object' || typeof b === 'function');\n if (!isListLikeIterableA && isAObject && !isListLikeIterableB && isBObject) {\n return true;\n }\n else {\n return Object.is(a, b);\n }\n }\n}\n\n// TODO(misko): consider inlining\n/** Updates binding and returns the value. */\nfunction updateBinding(lView, bindingIndex, value) {\n return (lView[bindingIndex] = value);\n}\n/** Gets the current binding value. */\nfunction getBinding(lView, bindingIndex) {\n ngDevMode && assertIndexInRange(lView, bindingIndex);\n ngDevMode &&\n assertNotSame(lView[bindingIndex], NO_CHANGE, 'Stored value should never be NO_CHANGE.');\n return lView[bindingIndex];\n}\n/**\n * Updates binding if changed, then returns whether it was updated.\n *\n * This function also checks the `CheckNoChangesMode` and throws if changes are made.\n * Some changes (Objects/iterables) during `CheckNoChangesMode` are exempt to comply with VE\n * behavior.\n *\n * @param lView current `LView`\n * @param bindingIndex The binding in the `LView` to check\n * @param value New value to check against `lView[bindingIndex]`\n * @returns `true` if the bindings has changed. (Throws if binding has changed during\n * `CheckNoChangesMode`)\n */\nfunction bindingUpdated(lView, bindingIndex, value) {\n ngDevMode &&\n assertLessThan(bindingIndex, lView.length, `Slot should have been initialized to NO_CHANGE`);\n if (value === NO_CHANGE) {\n return false;\n }\n const oldValue = lView[bindingIndex];\n if (Object.is(oldValue, value)) {\n return false;\n }\n else {\n if (ngDevMode && isInCheckNoChangesMode()) {\n // View engine didn't report undefined values as changed on the first checkNoChanges pass\n // (before the change detection was run).\n const oldValueToCompare = oldValue !== NO_CHANGE ? oldValue : undefined;\n if (!devModeEqual(oldValueToCompare, value)) {\n const details = getExpressionChangedErrorDetails(lView, bindingIndex, oldValueToCompare, value);\n throwErrorIfNoChangesMode(oldValue === NO_CHANGE, details.oldValue, details.newValue, details.propName, lView);\n }\n // There was a change, but the `devModeEqual` decided that the change is exempt from an error.\n // For this reason we exit as if no change. The early exit is needed to prevent the changed\n // value to be written into `LView` (If we would write the new value that we would not see it\n // as change on next CD.)\n return false;\n }\n lView[bindingIndex] = value;\n return true;\n }\n}\n/** Updates 2 bindings if changed, then returns whether either was updated. */\nfunction bindingUpdated2(lView, bindingIndex, exp1, exp2) {\n const different = bindingUpdated(lView, bindingIndex, exp1);\n return bindingUpdated(lView, bindingIndex + 1, exp2) || different;\n}\n/** Updates 3 bindings if changed, then returns whether any was updated. */\nfunction bindingUpdated3(lView, bindingIndex, exp1, exp2, exp3) {\n const different = bindingUpdated2(lView, bindingIndex, exp1, exp2);\n return bindingUpdated(lView, bindingIndex + 2, exp3) || different;\n}\n/** Updates 4 bindings if changed, then returns whether any was updated. */\nfunction bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4) {\n const different = bindingUpdated2(lView, bindingIndex, exp1, exp2);\n return bindingUpdated2(lView, bindingIndex + 2, exp3, exp4) || different;\n}\n\n/**\n * Wraps an event listener with a function that marks ancestors dirty and prevents default behavior,\n * if applicable.\n *\n * @param tNode The TNode associated with this listener\n * @param lView The LView that contains this listener\n * @param listenerFn The listener function to call\n * @param wrapWithPreventDefault Whether or not to prevent default behavior\n * (the procedural renderer does this already, so in those cases, we should skip)\n */\nfunction wrapListener(tNode, lView, listenerFn) {\n // Note: we are performing most of the work in the listener function itself\n // to optimize listener registration.\n return function wrapListenerIn_markDirtyAndPreventDefault(event) {\n // In order to be backwards compatible with View Engine, events on component host nodes\n // must also mark the component view itself dirty (i.e. the view that it owns).\n const startView = isComponentHost(tNode) ? getComponentLViewByIndex(tNode.index, lView) : lView;\n markViewDirty(startView, 5 /* NotificationSource.Listener */);\n const context = lView[CONTEXT];\n let result = executeListenerWithErrorHandling(lView, context, listenerFn, event);\n // A just-invoked listener function might have coalesced listeners so we need to check for\n // their presence and invoke as needed.\n let nextListenerFn = wrapListenerIn_markDirtyAndPreventDefault.__ngNextListenerFn__;\n while (nextListenerFn) {\n // We should prevent default if any of the listeners explicitly return false\n result = executeListenerWithErrorHandling(lView, context, nextListenerFn, event) && result;\n nextListenerFn = nextListenerFn.__ngNextListenerFn__;\n }\n return result;\n };\n}\nfunction executeListenerWithErrorHandling(lView, context, listenerFn, e) {\n const prevConsumer = setActiveConsumer$1(null);\n try {\n profiler(6 /* ProfilerEvent.OutputStart */, context, listenerFn);\n // Only explicitly returning false from a listener should preventDefault\n return listenerFn(e) !== false;\n }\n catch (error) {\n handleUncaughtError(lView, error);\n return false;\n }\n finally {\n profiler(7 /* ProfilerEvent.OutputEnd */, context, listenerFn);\n setActiveConsumer$1(prevConsumer);\n }\n}\n/**\n * Listen to a DOM event on a specific node.\n * @param tNode TNode on which to listen.\n * @param tView TView in which the node is placed.\n * @param lView LView in which the node instance is placed.\n * @param eventTargetResolver Resolver for global event targets.\n * @param renderer Renderer to use for listening to the event.\n * @param eventName Name of the event.\n * @param originalListener Original listener as it was created by the compiler. Necessary for event\n * coalescing.\n * @param wrappedListener Listener wrapped with additional logic like marking for check and error\n * handling.\n * @returns Boolean indicating whether the event was bound or was coalesced into an existing\n * listener.\n */\nfunction listenToDomEvent(tNode, tView, lView, eventTargetResolver, renderer, eventName, originalListener, wrappedListener) {\n ngDevMode &&\n assertNotSame(wrappedListener, originalListener, 'Expected wrapped and original listeners to be different.');\n const isTNodeDirectiveHost = isDirectiveHost(tNode);\n let hasCoalesced = false;\n // In order to match current behavior, native DOM event listeners must be added for all\n // events (including outputs).\n // There might be cases where multiple directives on the same element try to register an event\n // handler function for the same event. In this situation we want to avoid registration of\n // several native listeners as each registration would be intercepted by NgZone and\n // trigger change detection. This would mean that a single user action would result in several\n // change detections being invoked. To avoid this situation we want to have only one call to\n // native handler registration (for the same element and same type of event).\n //\n // In order to have just one native event handler in presence of multiple handler functions,\n // we just register a first handler function as a native event listener and then chain\n // (coalesce) other handler functions on top of the first native handler function.\n let existingListener = null;\n // Please note that the coalescing described here doesn't happen for events specifying an\n // alternative target (ex. (document:click)) - this is to keep backward compatibility with the\n // view engine.\n // Also, we don't have to search for existing listeners if there are no directives\n // matching on a given node as we can't register multiple event handlers for the same event in\n // a template (this would mean having duplicate attributes).\n if (!eventTargetResolver && isTNodeDirectiveHost) {\n existingListener = findExistingListener(tView, lView, eventName, tNode.index);\n }\n if (existingListener !== null) {\n // Attach a new listener to coalesced listeners list, maintaining the order in which\n // listeners are registered. For performance reasons, we keep a reference to the last\n // listener in that list (in `__ngLastListenerFn__` field), so we can avoid going through\n // the entire set each time we need to add a new listener.\n const lastListenerFn = existingListener.__ngLastListenerFn__ || existingListener;\n lastListenerFn.__ngNextListenerFn__ = originalListener;\n existingListener.__ngLastListenerFn__ = originalListener;\n hasCoalesced = true;\n }\n else {\n const native = getNativeByTNode(tNode, lView);\n const target = eventTargetResolver ? eventTargetResolver(native) : native;\n stashEventListenerImpl(lView, target, eventName, wrappedListener);\n const cleanupFn = renderer.listen(target, eventName, wrappedListener);\n const idxOrTargetGetter = eventTargetResolver\n ? (_lView) => eventTargetResolver(unwrapRNode(_lView[tNode.index]))\n : tNode.index;\n storeListenerCleanup(idxOrTargetGetter, tView, lView, eventName, wrappedListener, cleanupFn, false);\n }\n return hasCoalesced;\n}\n/**\n * A utility function that checks if a given element has already an event handler registered for an\n * event with a specified name. The TView.cleanup data structure is used to find out which events\n * are registered for a given element.\n */\nfunction findExistingListener(tView, lView, eventName, tNodeIndex) {\n const tCleanup = tView.cleanup;\n if (tCleanup != null) {\n for (let i = 0; i < tCleanup.length - 1; i += 2) {\n const cleanupEventName = tCleanup[i];\n if (cleanupEventName === eventName && tCleanup[i + 1] === tNodeIndex) {\n // We have found a matching event name on the same node but it might not have been\n // registered yet, so we must explicitly verify entries in the LView cleanup data\n // structures.\n const lCleanup = lView[CLEANUP];\n const listenerIdxInLCleanup = tCleanup[i + 2];\n return lCleanup && lCleanup.length > listenerIdxInLCleanup\n ? lCleanup[listenerIdxInLCleanup]\n : null;\n }\n // TView.cleanup can have a mix of 4-elements entries (for event handler cleanups) or\n // 2-element entries (for directive and queries destroy hooks). As such we can encounter\n // blocks of 4 or 2 items in the tView.cleanup and this is why we iterate over 2 elements\n // first and jump another 2 elements if we detect listeners cleanup (4 elements). Also check\n // documentation of TView.cleanup for more details of this data structure layout.\n if (typeof cleanupEventName === 'string') {\n i += 2;\n }\n }\n }\n return null;\n}\n/**\n * Stores a cleanup function for an event listener.\n * @param indexOrTargetGetter Either the index of the TNode on which the event is bound or a\n * function that when invoked will return the event target.\n * @param tView TView in which the event is bound.\n * @param lView LView in which the event is bound.\n * @param eventName Name of the event.\n * @param listenerFn Final callback of the event.\n * @param cleanup Function to invoke during cleanup.\n * @param isOutput Whether this is an output listener or a native DOM listener.\n */\nfunction storeListenerCleanup(indexOrTargetGetter, tView, lView, eventName, listenerFn, cleanup, isOutput) {\n const tCleanup = tView.firstCreatePass ? getOrCreateTViewCleanup(tView) : null;\n const lCleanup = getOrCreateLViewCleanup(lView);\n const index = lCleanup.length;\n lCleanup.push(listenerFn, cleanup);\n tCleanup &&\n tCleanup.push(eventName, indexOrTargetGetter, index, (index + 1) * (isOutput ? -1 : 1));\n}\n\nfunction createOutputListener(tNode, lView, listenerFn, targetDef, eventName) {\n // TODO(pk): decouple checks from the actual binding\n const wrappedListener = wrapListener(tNode, lView, listenerFn);\n const hasBound = listenToDirectiveOutput(tNode, lView, targetDef, eventName, wrappedListener);\n if (!hasBound && ngDevMode) {\n throw new RuntimeError(316 /* RuntimeErrorCode.INVALID_BINDING_TARGET */, `${stringifyForError(targetDef.type)} does not have an output with a public name of \"${eventName}\".`);\n }\n}\n/** Listens to an output on a specific directive. */\nfunction listenToDirectiveOutput(tNode, lView, target, eventName, listenerFn) {\n let hostIndex = null;\n let hostDirectivesStart = null;\n let hostDirectivesEnd = null;\n let hasOutput = false;\n if (ngDevMode && !tNode.directiveToIndex?.has(target.type)) {\n throw new Error(`Node does not have a directive with type ${target.type.name}`);\n }\n const data = tNode.directiveToIndex.get(target.type);\n if (typeof data === 'number') {\n hostIndex = data;\n }\n else {\n [hostIndex, hostDirectivesStart, hostDirectivesEnd] = data;\n }\n if (hostDirectivesStart !== null &&\n hostDirectivesEnd !== null &&\n tNode.hostDirectiveOutputs?.hasOwnProperty(eventName)) {\n const hostDirectiveOutputs = tNode.hostDirectiveOutputs[eventName];\n for (let i = 0; i < hostDirectiveOutputs.length; i += 2) {\n const index = hostDirectiveOutputs[i];\n if (index >= hostDirectivesStart && index <= hostDirectivesEnd) {\n ngDevMode && assertIndexInRange(lView, index);\n hasOutput = true;\n listenToOutput(tNode, lView, index, hostDirectiveOutputs[i + 1], eventName, listenerFn);\n }\n else if (index > hostDirectivesEnd) {\n break;\n }\n }\n }\n if (target.outputs.hasOwnProperty(eventName)) {\n ngDevMode && assertIndexInRange(lView, hostIndex);\n hasOutput = true;\n listenToOutput(tNode, lView, hostIndex, eventName, eventName, listenerFn);\n }\n return hasOutput;\n}\nfunction listenToOutput(tNode, lView, directiveIndex, lookupName, eventName, listenerFn) {\n ngDevMode && assertIndexInRange(lView, directiveIndex);\n const instance = lView[directiveIndex];\n const tView = lView[TVIEW];\n const def = tView.data[directiveIndex];\n const propertyName = def.outputs[lookupName];\n const output = instance[propertyName];\n if (ngDevMode && !isOutputSubscribable(output)) {\n throw new Error(`@Output ${propertyName} not initialized in '${instance.constructor.name}'.`);\n }\n const subscription = output.subscribe(listenerFn);\n storeListenerCleanup(tNode.index, tView, lView, eventName, listenerFn, subscription, true);\n}\n/**\n * Whether the given value represents a subscribable output.\n *\n * For example, an `EventEmitter, a `Subject`, an `Observable` or an\n * `OutputEmitter`.\n */\nfunction isOutputSubscribable(value) {\n return (value != null && typeof value.subscribe === 'function');\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/** Symbol used to store and retrieve metadata about a binding. */\nconst BINDING = /* @__PURE__ */ Symbol('BINDING');\n// These are constant between all the bindings so we can reuse the objects.\nconst INPUT_BINDING_METADATA = { kind: 'input', requiredVars: 1 };\nconst OUTPUT_BINDING_METADATA = { kind: 'output', requiredVars: 0 };\n// TODO(pk): this is a sketch of an input binding instruction that still needs some cleanups\n// - take an index of a directive on TNode (as matched), review all the index mappings that we need to do\n// - move more logic to the first creation pass\n// - move this function to under the instructions folder\nfunction inputBindingUpdate(targetDirectiveIdx, publicName, value) {\n const lView = getLView();\n const bindingIndex = nextBindingIndex();\n if (bindingUpdated(lView, bindingIndex, value)) {\n const tView = lView[TVIEW];\n const tNode = getSelectedTNode();\n const componentLView = getComponentLViewByIndex(tNode.index, lView);\n markViewDirty(componentLView, 1 /* NotificationSource.SetInput */);\n // TODO(pk): don't check on each and every binding, just assert in dev mode\n const targetDef = tView.directiveRegistry[targetDirectiveIdx];\n if (ngDevMode && !targetDef) {\n throw new RuntimeError(315 /* RuntimeErrorCode.NO_BINDING_TARGET */, `Input binding to property \"${publicName}\" does not have a target.`);\n }\n // TODO(pk): the hasSet check should be replaced by one-off check in the first creation pass\n const hasSet = setDirectiveInput(tNode, tView, lView, targetDef, publicName, value);\n if (ngDevMode) {\n if (!hasSet) {\n throw new RuntimeError(315 /* RuntimeErrorCode.NO_BINDING_TARGET */, `${stringifyForError(targetDef.type)} does not have an input with a public name of \"${publicName}\".`);\n }\n storePropertyBindingMetadata(tView.data, tNode, publicName, bindingIndex);\n }\n }\n}\n/**\n * Creates an input binding.\n * @param publicName Public name of the input to bind to.\n * @param value Callback that returns the current value for the binding. Can be either a signal or\n * a plain getter function.\n *\n * ### Usage Example\n * In this example we create an instance of the `MyButton` component and bind the value of\n * the `isDisabled` signal to its `disabled` input.\n *\n * ```\n * const isDisabled = signal(false);\n *\n * createComponent(MyButton, {\n * bindings: [inputBinding('disabled', isDisabled)]\n * });\n * ```\n */\nfunction inputBinding(publicName, value) {\n // Note: ideally we would use a class here, but it seems like they\n // don't get tree shaken when constructed by a function like this.\n const binding = {\n [BINDING]: INPUT_BINDING_METADATA,\n update: () => inputBindingUpdate(binding.targetIdx, publicName, value()),\n };\n return binding;\n}\n/**\n * Creates an output binding.\n * @param eventName Public name of the output to listen to.\n * @param listener Function to be called when the output emits.\n *\n * ### Usage example\n * In this example we create an instance of the `MyCheckbox` component and listen\n * to its `onChange` event.\n *\n * ```\n * interface CheckboxChange {\n * value: string;\n * }\n *\n * createComponent(MyCheckbox, {\n * bindings: [\n * outputBinding<CheckboxChange>('onChange', event => console.log(event.value))\n * ],\n * });\n * ```\n */\nfunction outputBinding(eventName, listener) {\n // Note: ideally we would use a class here, but it seems like they\n // don't get tree shaken when constructed by a function like this.\n const binding = {\n [BINDING]: OUTPUT_BINDING_METADATA,\n create: () => {\n const lView = getLView();\n const tNode = getCurrentTNode();\n const tView = lView[TVIEW];\n const targetDef = tView.directiveRegistry[binding.targetIdx];\n createOutputListener(tNode, lView, listener, targetDef, eventName);\n },\n };\n return binding;\n}\n/**\n * Creates a two-way binding.\n * @param eventName Public name of the two-way compatible input.\n * @param value Writable signal from which to get the current value and to which to write new\n * values.\n *\n * ### Usage example\n * In this example we create an instance of the `MyCheckbox` component and bind to its `value`\n * input using a two-way binding.\n *\n * ```\n * const checkboxValue = signal('');\n *\n * createComponent(MyCheckbox, {\n * bindings: [\n * twoWayBinding('value', checkboxValue),\n * ],\n * });\n * ```\n */\nfunction twoWayBinding(publicName, value) {\n const input = inputBinding(publicName, value);\n const output = outputBinding(publicName + 'Change', (eventValue) => value.set(eventValue));\n // We take advantage of inputs only having a `create` block and outputs only having an `update`\n // block by passing them through directly instead of creating dedicated functions here. This\n // assumption can break down if one of them starts targeting both blocks. These assertions\n // are here to help us catch it if something changes in the future.\n ngDevMode && assertNotDefined(input.create, 'Unexpected `create` callback in inputBinding');\n ngDevMode && assertNotDefined(output.update, 'Unexpected `update` callback in outputBinding');\n const binding = {\n [BINDING]: {\n kind: 'twoWay',\n requiredVars: input[BINDING].requiredVars + output[BINDING].requiredVars,\n },\n set targetIdx(idx) {\n input.targetIdx = idx;\n output.targetIdx = idx;\n },\n create: output.create,\n update: input.update,\n };\n return binding;\n}\n\nclass ComponentFactoryResolver extends ComponentFactoryResolver$1 {\n ngModule;\n /**\n * @param ngModule The NgModuleRef to which all resolved factories are bound.\n */\n constructor(ngModule) {\n super();\n this.ngModule = ngModule;\n }\n resolveComponentFactory(component) {\n ngDevMode && assertComponentType(component);\n const componentDef = getComponentDef(component);\n return new ComponentFactory(componentDef, this.ngModule);\n }\n}\nfunction toInputRefArray(map) {\n return Object.keys(map).map((name) => {\n const [propName, flags, transform] = map[name];\n const inputData = {\n propName: propName,\n templateName: name,\n isSignal: (flags & InputFlags.SignalBased) !== 0,\n };\n if (transform) {\n inputData.transform = transform;\n }\n return inputData;\n });\n}\nfunction toOutputRefArray(map) {\n return Object.keys(map).map((name) => ({ propName: map[name], templateName: name }));\n}\nfunction verifyNotAnOrphanComponent(componentDef) {\n // TODO(pk): create assert that verifies ngDevMode\n if ((typeof ngJitMode === 'undefined' || ngJitMode) &&\n componentDef.debugInfo?.forbidOrphanRendering) {\n if (depsTracker.isOrphanComponent(componentDef.type)) {\n throw new RuntimeError(981 /* RuntimeErrorCode.RUNTIME_DEPS_ORPHAN_COMPONENT */, `Orphan component found! Trying to render the component ${debugStringifyTypeForError(componentDef.type)} without first loading the NgModule that declares it. It is recommended to make this component standalone in order to avoid this error. If this is not possible now, import the component's NgModule in the appropriate NgModule, or the standalone component in which you are trying to render this component. If this is a lazy import, load the NgModule lazily as well and use its module injector.`);\n }\n }\n}\nfunction createRootViewInjector(componentDef, environmentInjector, injector) {\n let realEnvironmentInjector = environmentInjector instanceof EnvironmentInjector\n ? environmentInjector\n : environmentInjector?.injector;\n if (realEnvironmentInjector && componentDef.getStandaloneInjector !== null) {\n realEnvironmentInjector =\n componentDef.getStandaloneInjector(realEnvironmentInjector) || realEnvironmentInjector;\n }\n const rootViewInjector = realEnvironmentInjector\n ? new ChainedInjector(injector, realEnvironmentInjector)\n : injector;\n return rootViewInjector;\n}\nfunction createRootLViewEnvironment(rootLViewInjector) {\n const rendererFactory = rootLViewInjector.get(RendererFactory2, null);\n if (rendererFactory === null) {\n throw new RuntimeError(407 /* RuntimeErrorCode.RENDERER_NOT_FOUND */, ngDevMode &&\n 'Angular was not able to inject a renderer (RendererFactory2). ' +\n 'Likely this is due to a broken DI hierarchy. ' +\n 'Make sure that any injector used to create this component has a correct parent.');\n }\n const sanitizer = rootLViewInjector.get(Sanitizer, null);\n const changeDetectionScheduler = rootLViewInjector.get(ChangeDetectionScheduler, null);\n let ngReflect = false;\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n ngReflect = rootLViewInjector.get(NG_REFLECT_ATTRS_FLAG, NG_REFLECT_ATTRS_FLAG_DEFAULT);\n }\n return {\n rendererFactory,\n sanitizer,\n changeDetectionScheduler,\n ngReflect,\n };\n}\nfunction createHostElement(componentDef, render) {\n // Determine a tag name used for creating host elements when this component is created\n // dynamically. Default to 'div' if this component did not specify any tag name in its\n // selector.\n const tagName = (componentDef.selectors[0][0] || 'div').toLowerCase();\n const namespace = tagName === 'svg' ? SVG_NAMESPACE : tagName === 'math' ? MATH_ML_NAMESPACE : null;\n return createElementNode(render, tagName, namespace);\n}\n/**\n * ComponentFactory interface implementation.\n */\nclass ComponentFactory extends ComponentFactory$1 {\n componentDef;\n ngModule;\n selector;\n componentType;\n ngContentSelectors;\n isBoundToModule;\n cachedInputs = null;\n cachedOutputs = null;\n get inputs() {\n this.cachedInputs ??= toInputRefArray(this.componentDef.inputs);\n return this.cachedInputs;\n }\n get outputs() {\n this.cachedOutputs ??= toOutputRefArray(this.componentDef.outputs);\n return this.cachedOutputs;\n }\n /**\n * @param componentDef The component definition.\n * @param ngModule The NgModuleRef to which the factory is bound.\n */\n constructor(componentDef, ngModule) {\n super();\n this.componentDef = componentDef;\n this.ngModule = ngModule;\n this.componentType = componentDef.type;\n this.selector = stringifyCSSSelectorList(componentDef.selectors);\n this.ngContentSelectors = componentDef.ngContentSelectors ?? [];\n this.isBoundToModule = !!ngModule;\n }\n create(injector, projectableNodes, rootSelectorOrNode, environmentInjector, directives, componentBindings) {\n profiler(22 /* ProfilerEvent.DynamicComponentStart */);\n const prevConsumer = setActiveConsumer(null);\n try {\n const cmpDef = this.componentDef;\n ngDevMode && verifyNotAnOrphanComponent(cmpDef);\n const rootTView = createRootTView(rootSelectorOrNode, cmpDef, componentBindings, directives);\n const rootViewInjector = createRootViewInjector(cmpDef, environmentInjector || this.ngModule, injector);\n const environment = createRootLViewEnvironment(rootViewInjector);\n const hostRenderer = environment.rendererFactory.createRenderer(null, cmpDef);\n const hostElement = rootSelectorOrNode\n ? locateHostElement(hostRenderer, rootSelectorOrNode, cmpDef.encapsulation, rootViewInjector)\n : createHostElement(cmpDef, hostRenderer);\n const hasInputBindings = componentBindings?.some(isInputBinding) ||\n directives?.some((d) => typeof d !== 'function' && d.bindings.some(isInputBinding));\n const rootLView = createLView(null, rootTView, null, 512 /* LViewFlags.IsRoot */ | getInitialLViewFlagsFromDef(cmpDef), null, null, environment, hostRenderer, rootViewInjector, null, retrieveHydrationInfo(hostElement, rootViewInjector, true /* isRootView */));\n rootLView[HEADER_OFFSET] = hostElement;\n // rootView is the parent when bootstrapping\n // TODO(misko): it looks like we are entering view here but we don't really need to as\n // `renderView` does that. However as the code is written it is needed because\n // `createRootComponentView` and `createRootComponent` both read global state. Fixing those\n // issues would allow us to drop this.\n enterView(rootLView);\n let componentView = null;\n try {\n const hostTNode = directiveHostFirstCreatePass(HEADER_OFFSET, rootLView, 2 /* TNodeType.Element */, '#host', () => rootTView.directiveRegistry, true, 0);\n // ---- element instruction\n // TODO(crisbeto): in practice `hostElement` should always be defined, but there are some\n // tests where the renderer is mocked out and `undefined` is returned. We should update the\n // tests so that this check can be removed.\n if (hostElement) {\n setupStaticAttributes(hostRenderer, hostElement, hostTNode);\n attachPatchData(hostElement, rootLView);\n }\n // TODO(pk): this logic is similar to the instruction code where a node can have directives\n createDirectivesInstances(rootTView, rootLView, hostTNode);\n executeContentQueries(rootTView, hostTNode, rootLView);\n directiveHostEndFirstCreatePass(rootTView, hostTNode);\n if (projectableNodes !== undefined) {\n projectNodes(hostTNode, this.ngContentSelectors, projectableNodes);\n }\n componentView = getComponentLViewByIndex(hostTNode.index, rootLView);\n // TODO(pk): why do we need this logic?\n rootLView[CONTEXT] = componentView[CONTEXT];\n renderView(rootTView, rootLView, null);\n }\n catch (e) {\n // Stop tracking the views if creation failed since\n // the consumer won't have a way to dereference them.\n if (componentView !== null) {\n unregisterLView(componentView);\n }\n unregisterLView(rootLView);\n throw e;\n }\n finally {\n profiler(23 /* ProfilerEvent.DynamicComponentEnd */);\n leaveView();\n }\n return new ComponentRef(this.componentType, rootLView, !!hasInputBindings);\n }\n finally {\n setActiveConsumer(prevConsumer);\n }\n }\n}\nfunction createRootTView(rootSelectorOrNode, componentDef, componentBindings, directives) {\n const tAttributes = rootSelectorOrNode\n ? ['ng-version', '20.1.4']\n : // Extract attributes and classes from the first selector only to match VE behavior.\n extractAttrsAndClassesFromSelector(componentDef.selectors[0]);\n let creationBindings = null;\n let updateBindings = null;\n let varsToAllocate = 0;\n if (componentBindings) {\n for (const binding of componentBindings) {\n varsToAllocate += binding[BINDING].requiredVars;\n if (binding.create) {\n binding.targetIdx = 0;\n (creationBindings ??= []).push(binding);\n }\n if (binding.update) {\n binding.targetIdx = 0;\n (updateBindings ??= []).push(binding);\n }\n }\n }\n if (directives) {\n for (let i = 0; i < directives.length; i++) {\n const directive = directives[i];\n if (typeof directive !== 'function') {\n for (const binding of directive.bindings) {\n varsToAllocate += binding[BINDING].requiredVars;\n const targetDirectiveIdx = i + 1;\n if (binding.create) {\n binding.targetIdx = targetDirectiveIdx;\n (creationBindings ??= []).push(binding);\n }\n if (binding.update) {\n binding.targetIdx = targetDirectiveIdx;\n (updateBindings ??= []).push(binding);\n }\n }\n }\n }\n }\n const directivesToApply = [componentDef];\n if (directives) {\n for (const directive of directives) {\n const directiveType = typeof directive === 'function' ? directive : directive.type;\n const directiveDef = ngDevMode\n ? getDirectiveDefOrThrow(directiveType)\n : getDirectiveDef(directiveType);\n if (ngDevMode && !directiveDef.standalone) {\n throw new RuntimeError(907 /* RuntimeErrorCode.TYPE_IS_NOT_STANDALONE */, `The ${stringifyForError(directiveType)} directive must be standalone in ` +\n `order to be applied to a dynamically-created component.`);\n }\n directivesToApply.push(directiveDef);\n }\n }\n const rootTView = createTView(0 /* TViewType.Root */, null, getRootTViewTemplate(creationBindings, updateBindings), 1, varsToAllocate, directivesToApply, null, null, null, [tAttributes], null);\n return rootTView;\n}\nfunction getRootTViewTemplate(creationBindings, updateBindings) {\n if (!creationBindings && !updateBindings) {\n return null;\n }\n return (flags) => {\n if (flags & 1 /* RenderFlags.Create */ && creationBindings) {\n for (const binding of creationBindings) {\n binding.create();\n }\n }\n if (flags & 2 /* RenderFlags.Update */ && updateBindings) {\n for (const binding of updateBindings) {\n binding.update();\n }\n }\n };\n}\nfunction isInputBinding(binding) {\n const kind = binding[BINDING].kind;\n return kind === 'input' || kind === 'twoWay';\n}\n/**\n * Represents an instance of a Component created via a {@link ComponentFactory}.\n *\n * `ComponentRef` provides access to the Component Instance as well other objects related to this\n * Component Instance and allows you to destroy the Component Instance via the {@link #destroy}\n * method.\n *\n */\nclass ComponentRef extends ComponentRef$1 {\n _rootLView;\n _hasInputBindings;\n instance;\n hostView;\n changeDetectorRef;\n componentType;\n location;\n previousInputValues = null;\n _tNode;\n constructor(componentType, _rootLView, _hasInputBindings) {\n super();\n this._rootLView = _rootLView;\n this._hasInputBindings = _hasInputBindings;\n this._tNode = getTNode(_rootLView[TVIEW], HEADER_OFFSET);\n this.location = createElementRef(this._tNode, _rootLView);\n this.instance = getComponentLViewByIndex(this._tNode.index, _rootLView)[CONTEXT];\n this.hostView = this.changeDetectorRef = new ViewRef(_rootLView, undefined /* _cdRefInjectingView */);\n this.componentType = componentType;\n }\n setInput(name, value) {\n if (this._hasInputBindings && ngDevMode) {\n throw new RuntimeError(317 /* RuntimeErrorCode.INVALID_SET_INPUT_CALL */, 'Cannot call `setInput` on a component that is using the `inputBinding` or `twoWayBinding` functions.');\n }\n const tNode = this._tNode;\n this.previousInputValues ??= new Map();\n // Do not set the input if it is the same as the last value\n // This behavior matches `bindingUpdated` when binding inputs in templates.\n if (this.previousInputValues.has(name) &&\n Object.is(this.previousInputValues.get(name), value)) {\n return;\n }\n const lView = this._rootLView;\n const hasSetInput = setAllInputsForProperty(tNode, lView[TVIEW], lView, name, value);\n this.previousInputValues.set(name, value);\n const childComponentLView = getComponentLViewByIndex(tNode.index, lView);\n markViewDirty(childComponentLView, 1 /* NotificationSource.SetInput */);\n if (ngDevMode && !hasSetInput) {\n const cmpNameForError = stringifyForError(this.componentType);\n let message = `Can't set value of the '${name}' input on the '${cmpNameForError}' component. `;\n message += `Make sure that the '${name}' property is declared as an input using the @Input() decorator or the input() function.`;\n reportUnknownPropertyError(message);\n }\n }\n get injector() {\n return new NodeInjector(this._tNode, this._rootLView);\n }\n destroy() {\n this.hostView.destroy();\n }\n onDestroy(callback) {\n this.hostView.onDestroy(callback);\n }\n}\n/** Projects the `projectableNodes` that were specified when creating a root component. */\nfunction projectNodes(tNode, ngContentSelectors, projectableNodes) {\n const projection = (tNode.projection = []);\n for (let i = 0; i < ngContentSelectors.length; i++) {\n const nodesforSlot = projectableNodes[i];\n // Projectable nodes can be passed as array of arrays or an array of iterables (ngUpgrade\n // case). Here we do normalize passed data structure to be an array of arrays to avoid\n // complex checks down the line.\n // We also normalize the length of the passed in projectable nodes (to match the number of\n // <ng-container> slots defined by a component).\n projection.push(nodesforSlot != null && nodesforSlot.length ? Array.from(nodesforSlot) : null);\n }\n}\n\n/**\n * Represents a container where one or more views can be attached to a component.\n *\n * Can contain *host views* (created by instantiating a\n * component with the `createComponent()` method), and *embedded views*\n * (created by instantiating a `TemplateRef` with the `createEmbeddedView()` method).\n *\n * A view container instance can contain other view containers,\n * creating a view hierarchy.\n *\n * @usageNotes\n *\n * The example below demonstrates how the `createComponent` function can be used\n * to create an instance of a ComponentRef dynamically and attach it to an ApplicationRef,\n * so that it gets included into change detection cycles.\n *\n * Note: the example uses standalone components, but the function can also be used for\n * non-standalone components (declared in an NgModule) as well.\n *\n * ```angular-ts\n * @Component({\n * standalone: true,\n * selector: 'dynamic',\n * template: `<span>This is a content of a dynamic component.</span>`,\n * })\n * class DynamicComponent {\n * vcr = inject(ViewContainerRef);\n * }\n *\n * @Component({\n * standalone: true,\n * selector: 'app',\n * template: `<main>Hi! This is the main content.</main>`,\n * })\n * class AppComponent {\n * vcr = inject(ViewContainerRef);\n *\n * ngAfterViewInit() {\n * const compRef = this.vcr.createComponent(DynamicComponent);\n * compRef.changeDetectorRef.detectChanges();\n * }\n * }\n * ```\n *\n * @see {@link ComponentRef}\n * @see {@link EmbeddedViewRef}\n *\n * @publicApi\n */\nclass ViewContainerRef {\n /**\n * @internal\n * @nocollapse\n */\n static __NG_ELEMENT_ID__ = injectViewContainerRef;\n}\n/**\n * Creates a ViewContainerRef and stores it on the injector. Or, if the ViewContainerRef\n * already exists, retrieves the existing ViewContainerRef.\n *\n * @returns The ViewContainerRef instance to use\n */\nfunction injectViewContainerRef() {\n const previousTNode = getCurrentTNode();\n return createContainerRef(previousTNode, getLView());\n}\nconst VE_ViewContainerRef = ViewContainerRef;\n// TODO(alxhub): cleaning up this indirection triggers a subtle bug in Closure in g3. Once the fix\n// for that lands, this can be cleaned up.\nconst R3ViewContainerRef = class ViewContainerRef extends VE_ViewContainerRef {\n _lContainer;\n _hostTNode;\n _hostLView;\n constructor(_lContainer, _hostTNode, _hostLView) {\n super();\n this._lContainer = _lContainer;\n this._hostTNode = _hostTNode;\n this._hostLView = _hostLView;\n }\n get element() {\n return createElementRef(this._hostTNode, this._hostLView);\n }\n get injector() {\n return new NodeInjector(this._hostTNode, this._hostLView);\n }\n /** @deprecated No replacement */\n get parentInjector() {\n const parentLocation = getParentInjectorLocation(this._hostTNode, this._hostLView);\n if (hasParentInjector(parentLocation)) {\n const parentView = getParentInjectorView(parentLocation, this._hostLView);\n const injectorIndex = getParentInjectorIndex(parentLocation);\n ngDevMode && assertNodeInjector(parentView, injectorIndex);\n const parentTNode = parentView[TVIEW].data[injectorIndex + 8 /* NodeInjectorOffset.TNODE */];\n return new NodeInjector(parentTNode, parentView);\n }\n else {\n return new NodeInjector(null, this._hostLView);\n }\n }\n clear() {\n while (this.length > 0) {\n this.remove(this.length - 1);\n }\n }\n get(index) {\n const viewRefs = getViewRefs(this._lContainer);\n return (viewRefs !== null && viewRefs[index]) || null;\n }\n get length() {\n return this._lContainer.length - CONTAINER_HEADER_OFFSET;\n }\n createEmbeddedView(templateRef, context, indexOrOptions) {\n let index;\n let injector;\n if (typeof indexOrOptions === 'number') {\n index = indexOrOptions;\n }\n else if (indexOrOptions != null) {\n index = indexOrOptions.index;\n injector = indexOrOptions.injector;\n }\n const dehydratedView = findMatchingDehydratedView(this._lContainer, templateRef.ssrId);\n const viewRef = templateRef.createEmbeddedViewImpl(context || {}, injector, dehydratedView);\n this.insertImpl(viewRef, index, shouldAddViewToDom(this._hostTNode, dehydratedView));\n return viewRef;\n }\n createComponent(componentFactoryOrType, indexOrOptions, injector, projectableNodes, environmentInjector, directives, bindings) {\n const isComponentFactory = componentFactoryOrType && !isType(componentFactoryOrType);\n let index;\n // This function supports 2 signatures and we need to handle options correctly for both:\n // 1. When first argument is a Component type. This signature also requires extra\n // options to be provided as object (more ergonomic option).\n // 2. First argument is a Component factory. In this case extra options are represented as\n // positional arguments. This signature is less ergonomic and will be deprecated.\n if (isComponentFactory) {\n if (ngDevMode) {\n assertEqual(typeof indexOrOptions !== 'object', true, 'It looks like Component factory was provided as the first argument ' +\n 'and an options object as the second argument. This combination of arguments ' +\n 'is incompatible. You can either change the first argument to provide Component ' +\n 'type or change the second argument to be a number (representing an index at ' +\n \"which to insert the new component's host view into this container)\");\n }\n index = indexOrOptions;\n }\n else {\n if (ngDevMode) {\n assertDefined(getComponentDef(componentFactoryOrType), `Provided Component class doesn't contain Component definition. ` +\n `Please check whether provided class has @Component decorator.`);\n assertEqual(typeof indexOrOptions !== 'number', true, 'It looks like Component type was provided as the first argument ' +\n \"and a number (representing an index at which to insert the new component's \" +\n 'host view into this container as the second argument. This combination of arguments ' +\n 'is incompatible. Please use an object as the second argument instead.');\n }\n const options = (indexOrOptions || {});\n if (ngDevMode && options.environmentInjector && options.ngModuleRef) {\n throwError(`Cannot pass both environmentInjector and ngModuleRef options to createComponent().`);\n }\n index = options.index;\n injector = options.injector;\n projectableNodes = options.projectableNodes;\n environmentInjector = options.environmentInjector || options.ngModuleRef;\n directives = options.directives;\n bindings = options.bindings;\n }\n const componentFactory = isComponentFactory\n ? componentFactoryOrType\n : new ComponentFactory(getComponentDef(componentFactoryOrType));\n const contextInjector = injector || this.parentInjector;\n // If an `NgModuleRef` is not provided explicitly, try retrieving it from the DI tree.\n if (!environmentInjector && componentFactory.ngModule == null) {\n // For the `ComponentFactory` case, entering this logic is very unlikely, since we expect that\n // an instance of a `ComponentFactory`, resolved via `ComponentFactoryResolver` would have an\n // `ngModule` field. This is possible in some test scenarios and potentially in some JIT-based\n // use-cases. For the `ComponentFactory` case we preserve backwards-compatibility and try\n // using a provided injector first, then fall back to the parent injector of this\n // `ViewContainerRef` instance.\n //\n // For the factory-less case, it's critical to establish a connection with the module\n // injector tree (by retrieving an instance of an `NgModuleRef` and accessing its injector),\n // so that a component can use DI tokens provided in MgModules. For this reason, we can not\n // rely on the provided injector, since it might be detached from the DI tree (for example, if\n // it was created via `Injector.create` without specifying a parent injector, or if an\n // injector is retrieved from an `NgModuleRef` created via `createNgModule` using an\n // NgModule outside of a module tree). Instead, we always use `ViewContainerRef`'s parent\n // injector, which is normally connected to the DI tree, which includes module injector\n // subtree.\n const _injector = isComponentFactory ? contextInjector : this.parentInjector;\n // DO NOT REFACTOR. The code here used to have a `injector.get(NgModuleRef, null) ||\n // undefined` expression which seems to cause internal google apps to fail. This is documented\n // in the following internal bug issue: go/b/142967802\n const result = _injector.get(EnvironmentInjector, null);\n if (result) {\n environmentInjector = result;\n }\n }\n const componentDef = getComponentDef(componentFactory.componentType ?? {});\n const dehydratedView = findMatchingDehydratedView(this._lContainer, componentDef?.id ?? null);\n const rNode = dehydratedView?.firstChild ?? null;\n const componentRef = componentFactory.create(contextInjector, projectableNodes, rNode, environmentInjector, directives, bindings);\n this.insertImpl(componentRef.hostView, index, shouldAddViewToDom(this._hostTNode, dehydratedView));\n return componentRef;\n }\n insert(viewRef, index) {\n return this.insertImpl(viewRef, index, true);\n }\n insertImpl(viewRef, index, addToDOM) {\n const lView = viewRef._lView;\n if (ngDevMode && viewRef.destroyed) {\n throw new Error('Cannot insert a destroyed View in a ViewContainer!');\n }\n if (viewAttachedToContainer(lView)) {\n // If view is already attached, detach it first so we clean up references appropriately.\n const prevIdx = this.indexOf(viewRef);\n // A view might be attached either to this or a different container. The `prevIdx` for\n // those cases will be:\n // equal to -1 for views attached to this ViewContainerRef\n // >= 0 for views attached to a different ViewContainerRef\n if (prevIdx !== -1) {\n this.detach(prevIdx);\n }\n else {\n const prevLContainer = lView[PARENT];\n ngDevMode &&\n assertEqual(isLContainer(prevLContainer), true, 'An attached view should have its PARENT point to a container.');\n // We need to re-create a R3ViewContainerRef instance since those are not stored on\n // LView (nor anywhere else).\n const prevVCRef = new R3ViewContainerRef(prevLContainer, prevLContainer[T_HOST], prevLContainer[PARENT]);\n prevVCRef.detach(prevVCRef.indexOf(viewRef));\n }\n }\n // Logical operation of adding `LView` to `LContainer`\n const adjustedIdx = this._adjustIndex(index);\n const lContainer = this._lContainer;\n addLViewToLContainer(lContainer, lView, adjustedIdx, addToDOM);\n viewRef.attachToViewContainerRef();\n addToArray(getOrCreateViewRefs(lContainer), adjustedIdx, viewRef);\n return viewRef;\n }\n move(viewRef, newIndex) {\n if (ngDevMode && viewRef.destroyed) {\n throw new Error('Cannot move a destroyed View in a ViewContainer!');\n }\n return this.insert(viewRef, newIndex);\n }\n indexOf(viewRef) {\n const viewRefsArr = getViewRefs(this._lContainer);\n return viewRefsArr !== null ? viewRefsArr.indexOf(viewRef) : -1;\n }\n remove(index) {\n const adjustedIdx = this._adjustIndex(index, -1);\n const detachedView = detachView(this._lContainer, adjustedIdx);\n if (detachedView) {\n // Before destroying the view, remove it from the container's array of `ViewRef`s.\n // This ensures the view container length is updated before calling\n // `destroyLView`, which could recursively call view container methods that\n // rely on an accurate container length.\n // (e.g. a method on this view container being called by a child directive's OnDestroy\n // lifecycle hook)\n removeFromArray(getOrCreateViewRefs(this._lContainer), adjustedIdx);\n destroyLView(detachedView[TVIEW], detachedView);\n }\n }\n detach(index) {\n const adjustedIdx = this._adjustIndex(index, -1);\n const view = detachView(this._lContainer, adjustedIdx);\n const wasDetached = view && removeFromArray(getOrCreateViewRefs(this._lContainer), adjustedIdx) != null;\n return wasDetached ? new ViewRef(view) : null;\n }\n _adjustIndex(index, shift = 0) {\n if (index == null) {\n return this.length + shift;\n }\n if (ngDevMode) {\n assertGreaterThan(index, -1, `ViewRef index must be positive, got ${index}`);\n // +1 because it's legal to insert at the end.\n assertLessThan(index, this.length + 1 + shift, 'index');\n }\n return index;\n }\n};\nfunction getViewRefs(lContainer) {\n return lContainer[VIEW_REFS];\n}\nfunction getOrCreateViewRefs(lContainer) {\n return (lContainer[VIEW_REFS] || (lContainer[VIEW_REFS] = []));\n}\n/**\n * Creates a ViewContainerRef and stores it on the injector.\n *\n * @param hostTNode The node that is requesting a ViewContainerRef\n * @param hostLView The view to which the node belongs\n * @returns The ViewContainerRef instance to use\n */\nfunction createContainerRef(hostTNode, hostLView) {\n ngDevMode && assertTNodeType(hostTNode, 12 /* TNodeType.AnyContainer */ | 3 /* TNodeType.AnyRNode */);\n let lContainer;\n const slotValue = hostLView[hostTNode.index];\n if (isLContainer(slotValue)) {\n // If the host is a container, we don't need to create a new LContainer\n lContainer = slotValue;\n }\n else {\n // An LContainer anchor can not be `null`, but we set it here temporarily\n // and update to the actual value later in this function (see\n // `_locateOrCreateAnchorNode`).\n lContainer = createLContainer(slotValue, hostLView, null, hostTNode);\n hostLView[hostTNode.index] = lContainer;\n addToEndOfViewTree(hostLView, lContainer);\n }\n _locateOrCreateAnchorNode(lContainer, hostLView, hostTNode, slotValue);\n return new R3ViewContainerRef(lContainer, hostTNode, hostLView);\n}\n/**\n * Creates and inserts a comment node that acts as an anchor for a view container.\n *\n * If the host is a regular element, we have to insert a comment node manually which will\n * be used as an anchor when inserting elements. In this specific case we use low-level DOM\n * manipulation to insert it.\n */\nfunction insertAnchorNode(hostLView, hostTNode) {\n const renderer = hostLView[RENDERER];\n const commentNode = renderer.createComment(ngDevMode ? 'container' : '');\n const hostNative = getNativeByTNode(hostTNode, hostLView);\n const parentOfHostNative = renderer.parentNode(hostNative);\n nativeInsertBefore(renderer, parentOfHostNative, commentNode, renderer.nextSibling(hostNative), false);\n return commentNode;\n}\nlet _locateOrCreateAnchorNode = createAnchorNode;\nlet _populateDehydratedViewsInLContainer = () => false; // noop by default\n/**\n * Looks up dehydrated views that belong to a given LContainer and populates\n * this information into the `LContainer[DEHYDRATED_VIEWS]` slot. When running\n * in client-only mode, this function is a noop.\n *\n * @param lContainer LContainer that should be populated.\n * @param tNode Corresponding TNode.\n * @param hostLView LView that hosts LContainer.\n * @returns a boolean flag that indicates whether a populating operation\n * was successful. The operation might be unsuccessful in case is has completed\n * previously, we are rendering in client-only mode or this content is located\n * in a skip hydration section.\n */\nfunction populateDehydratedViewsInLContainer(lContainer, tNode, hostLView) {\n return _populateDehydratedViewsInLContainer(lContainer, tNode, hostLView);\n}\n/**\n * Regular creation mode: an anchor is created and\n * assigned to the `lContainer[NATIVE]` slot.\n */\nfunction createAnchorNode(lContainer, hostLView, hostTNode, slotValue) {\n // We already have a native element (anchor) set, return.\n if (lContainer[NATIVE])\n return;\n let commentNode;\n // If the host is an element container, the native host element is guaranteed to be a\n // comment and we can reuse that comment as anchor element for the new LContainer.\n // The comment node in question is already part of the DOM structure so we don't need to append\n // it again.\n if (hostTNode.type & 8 /* TNodeType.ElementContainer */) {\n commentNode = unwrapRNode(slotValue);\n }\n else {\n commentNode = insertAnchorNode(hostLView, hostTNode);\n }\n lContainer[NATIVE] = commentNode;\n}\n/**\n * Hydration logic that looks up all dehydrated views in this container\n * and puts them into `lContainer[DEHYDRATED_VIEWS]` slot.\n *\n * @returns a boolean flag that indicates whether a populating operation\n * was successful. The operation might be unsuccessful in case is has completed\n * previously, we are rendering in client-only mode or this content is located\n * in a skip hydration section.\n */\nfunction populateDehydratedViewsInLContainerImpl(lContainer, tNode, hostLView) {\n // We already have a native element (anchor) set and the process\n // of finding dehydrated views happened (so the `lContainer[DEHYDRATED_VIEWS]`\n // is not null), exit early.\n if (lContainer[NATIVE] && lContainer[DEHYDRATED_VIEWS]) {\n return true;\n }\n const hydrationInfo = hostLView[HYDRATION];\n const noOffsetIndex = tNode.index - HEADER_OFFSET;\n const isNodeCreationMode = !hydrationInfo ||\n isInSkipHydrationBlock(tNode) ||\n isDisconnectedNode$1(hydrationInfo, noOffsetIndex);\n // Regular creation mode.\n if (isNodeCreationMode) {\n return false;\n }\n // Hydration mode, looking up an anchor node and dehydrated views in DOM.\n const currentRNode = getSegmentHead(hydrationInfo, noOffsetIndex);\n const serializedViews = hydrationInfo.data[CONTAINERS]?.[noOffsetIndex];\n ngDevMode &&\n assertDefined(serializedViews, 'Unexpected state: no hydration info available for a given TNode, ' +\n 'which represents a view container.');\n const [commentNode, dehydratedViews] = locateDehydratedViewsInContainer(currentRNode, serializedViews);\n if (ngDevMode) {\n validateMatchingNode(commentNode, Node.COMMENT_NODE, null, hostLView, tNode, true);\n // Do not throw in case this node is already claimed (thus `false` as a second\n // argument). If this container is created based on an `<ng-template>`, the comment\n // node would be already claimed from the `template` instruction. If an element acts\n // as an anchor (e.g. <div #vcRef>), a separate comment node would be created/located,\n // so we need to claim it here.\n markRNodeAsClaimedByHydration(commentNode, false);\n }\n lContainer[NATIVE] = commentNode;\n lContainer[DEHYDRATED_VIEWS] = dehydratedViews;\n return true;\n}\nfunction locateOrCreateAnchorNode(lContainer, hostLView, hostTNode, slotValue) {\n if (!_populateDehydratedViewsInLContainer(lContainer, hostTNode, hostLView)) {\n // Populating dehydrated views operation returned `false`, which indicates\n // that the logic was running in client-only mode, this an anchor comment\n // node should be created for this container.\n createAnchorNode(lContainer, hostLView, hostTNode, slotValue);\n }\n}\nfunction enableLocateOrCreateContainerRefImpl() {\n _locateOrCreateAnchorNode = locateOrCreateAnchorNode;\n _populateDehydratedViewsInLContainer = populateDehydratedViewsInLContainerImpl;\n}\n\nclass LQuery_ {\n queryList;\n matches = null;\n constructor(queryList) {\n this.queryList = queryList;\n }\n clone() {\n return new LQuery_(this.queryList);\n }\n setDirty() {\n this.queryList.setDirty();\n }\n}\nclass LQueries_ {\n queries;\n constructor(queries = []) {\n this.queries = queries;\n }\n createEmbeddedView(tView) {\n const tQueries = tView.queries;\n if (tQueries !== null) {\n const noOfInheritedQueries = tView.contentQueries !== null ? tView.contentQueries[0] : tQueries.length;\n const viewLQueries = [];\n // An embedded view has queries propagated from a declaration view at the beginning of the\n // TQueries collection and up until a first content query declared in the embedded view. Only\n // propagated LQueries are created at this point (LQuery corresponding to declared content\n // queries will be instantiated from the content query instructions for each directive).\n for (let i = 0; i < noOfInheritedQueries; i++) {\n const tQuery = tQueries.getByIndex(i);\n const parentLQuery = this.queries[tQuery.indexInDeclarationView];\n viewLQueries.push(parentLQuery.clone());\n }\n return new LQueries_(viewLQueries);\n }\n return null;\n }\n insertView(tView) {\n this.dirtyQueriesWithMatches(tView);\n }\n detachView(tView) {\n this.dirtyQueriesWithMatches(tView);\n }\n finishViewCreation(tView) {\n this.dirtyQueriesWithMatches(tView);\n }\n dirtyQueriesWithMatches(tView) {\n for (let i = 0; i < this.queries.length; i++) {\n if (getTQuery(tView, i).matches !== null) {\n this.queries[i].setDirty();\n }\n }\n }\n}\nclass TQueryMetadata_ {\n flags;\n read;\n predicate;\n constructor(predicate, flags, read = null) {\n this.flags = flags;\n this.read = read;\n // Compiler might not be able to pre-optimize and split multiple selectors.\n if (typeof predicate === 'string') {\n this.predicate = splitQueryMultiSelectors(predicate);\n }\n else {\n this.predicate = predicate;\n }\n }\n}\nclass TQueries_ {\n queries;\n constructor(queries = []) {\n this.queries = queries;\n }\n elementStart(tView, tNode) {\n ngDevMode &&\n assertFirstCreatePass(tView, 'Queries should collect results on the first template pass only');\n for (let i = 0; i < this.queries.length; i++) {\n this.queries[i].elementStart(tView, tNode);\n }\n }\n elementEnd(tNode) {\n for (let i = 0; i < this.queries.length; i++) {\n this.queries[i].elementEnd(tNode);\n }\n }\n embeddedTView(tNode) {\n let queriesForTemplateRef = null;\n for (let i = 0; i < this.length; i++) {\n const childQueryIndex = queriesForTemplateRef !== null ? queriesForTemplateRef.length : 0;\n const tqueryClone = this.getByIndex(i).embeddedTView(tNode, childQueryIndex);\n if (tqueryClone) {\n tqueryClone.indexInDeclarationView = i;\n if (queriesForTemplateRef !== null) {\n queriesForTemplateRef.push(tqueryClone);\n }\n else {\n queriesForTemplateRef = [tqueryClone];\n }\n }\n }\n return queriesForTemplateRef !== null ? new TQueries_(queriesForTemplateRef) : null;\n }\n template(tView, tNode) {\n ngDevMode &&\n assertFirstCreatePass(tView, 'Queries should collect results on the first template pass only');\n for (let i = 0; i < this.queries.length; i++) {\n this.queries[i].template(tView, tNode);\n }\n }\n getByIndex(index) {\n ngDevMode && assertIndexInRange(this.queries, index);\n return this.queries[index];\n }\n get length() {\n return this.queries.length;\n }\n track(tquery) {\n this.queries.push(tquery);\n }\n}\nclass TQuery_ {\n metadata;\n matches = null;\n indexInDeclarationView = -1;\n crossesNgTemplate = false;\n /**\n * A node index on which a query was declared (-1 for view queries and ones inherited from the\n * declaration template). We use this index (alongside with _appliesToNextNode flag) to know\n * when to apply content queries to elements in a template.\n */\n _declarationNodeIndex;\n /**\n * A flag indicating if a given query still applies to nodes it is crossing. We use this flag\n * (alongside with _declarationNodeIndex) to know when to stop applying content queries to\n * elements in a template.\n */\n _appliesToNextNode = true;\n constructor(metadata, nodeIndex = -1) {\n this.metadata = metadata;\n this._declarationNodeIndex = nodeIndex;\n }\n elementStart(tView, tNode) {\n if (this.isApplyingToNode(tNode)) {\n this.matchTNode(tView, tNode);\n }\n }\n elementEnd(tNode) {\n if (this._declarationNodeIndex === tNode.index) {\n this._appliesToNextNode = false;\n }\n }\n template(tView, tNode) {\n this.elementStart(tView, tNode);\n }\n embeddedTView(tNode, childQueryIndex) {\n if (this.isApplyingToNode(tNode)) {\n this.crossesNgTemplate = true;\n // A marker indicating a `<ng-template>` element (a placeholder for query results from\n // embedded views created based on this `<ng-template>`).\n this.addMatch(-tNode.index, childQueryIndex);\n return new TQuery_(this.metadata);\n }\n return null;\n }\n isApplyingToNode(tNode) {\n if (this._appliesToNextNode &&\n (this.metadata.flags & 1 /* QueryFlags.descendants */) !== 1 /* QueryFlags.descendants */) {\n const declarationNodeIdx = this._declarationNodeIndex;\n let parent = tNode.parent;\n // Determine if a given TNode is a \"direct\" child of a node on which a content query was\n // declared (only direct children of query's host node can match with the descendants: false\n // option). There are 3 main use-case / conditions to consider here:\n // - <needs-target><i #target></i></needs-target>: here <i #target> parent node is a query\n // host node;\n // - <needs-target><ng-template [ngIf]=\"true\"><i #target></i></ng-template></needs-target>:\n // here <i #target> parent node is null;\n // - <needs-target><ng-container><i #target></i></ng-container></needs-target>: here we need\n // to go past `<ng-container>` to determine <i #target> parent node (but we shouldn't traverse\n // up past the query's host node!).\n while (parent !== null &&\n parent.type & 8 /* TNodeType.ElementContainer */ &&\n parent.index !== declarationNodeIdx) {\n parent = parent.parent;\n }\n return declarationNodeIdx === (parent !== null ? parent.index : -1);\n }\n return this._appliesToNextNode;\n }\n matchTNode(tView, tNode) {\n const predicate = this.metadata.predicate;\n if (Array.isArray(predicate)) {\n for (let i = 0; i < predicate.length; i++) {\n const name = predicate[i];\n this.matchTNodeWithReadOption(tView, tNode, getIdxOfMatchingSelector(tNode, name));\n // Also try matching the name to a provider since strings can be used as DI tokens too.\n this.matchTNodeWithReadOption(tView, tNode, locateDirectiveOrProvider(tNode, tView, name, false, false));\n }\n }\n else {\n if (predicate === TemplateRef) {\n if (tNode.type & 4 /* TNodeType.Container */) {\n this.matchTNodeWithReadOption(tView, tNode, -1);\n }\n }\n else {\n this.matchTNodeWithReadOption(tView, tNode, locateDirectiveOrProvider(tNode, tView, predicate, false, false));\n }\n }\n }\n matchTNodeWithReadOption(tView, tNode, nodeMatchIdx) {\n if (nodeMatchIdx !== null) {\n const read = this.metadata.read;\n if (read !== null) {\n if (read === ElementRef ||\n read === ViewContainerRef ||\n (read === TemplateRef && tNode.type & 4 /* TNodeType.Container */)) {\n this.addMatch(tNode.index, -2);\n }\n else {\n const directiveOrProviderIdx = locateDirectiveOrProvider(tNode, tView, read, false, false);\n if (directiveOrProviderIdx !== null) {\n this.addMatch(tNode.index, directiveOrProviderIdx);\n }\n }\n }\n else {\n this.addMatch(tNode.index, nodeMatchIdx);\n }\n }\n }\n addMatch(tNodeIdx, matchIdx) {\n if (this.matches === null) {\n this.matches = [tNodeIdx, matchIdx];\n }\n else {\n this.matches.push(tNodeIdx, matchIdx);\n }\n }\n}\n/**\n * Iterates over local names for a given node and returns directive index\n * (or -1 if a local name points to an element).\n *\n * @param tNode static data of a node to check\n * @param selector selector to match\n * @returns directive index, -1 or null if a selector didn't match any of the local names\n */\nfunction getIdxOfMatchingSelector(tNode, selector) {\n const localNames = tNode.localNames;\n if (localNames !== null) {\n for (let i = 0; i < localNames.length; i += 2) {\n if (localNames[i] === selector) {\n return localNames[i + 1];\n }\n }\n }\n return null;\n}\nfunction createResultByTNodeType(tNode, currentView) {\n if (tNode.type & (3 /* TNodeType.AnyRNode */ | 8 /* TNodeType.ElementContainer */)) {\n return createElementRef(tNode, currentView);\n }\n else if (tNode.type & 4 /* TNodeType.Container */) {\n return createTemplateRef(tNode, currentView);\n }\n return null;\n}\nfunction createResultForNode(lView, tNode, matchingIdx, read) {\n if (matchingIdx === -1) {\n // if read token and / or strategy is not specified, detect it using appropriate tNode type\n return createResultByTNodeType(tNode, lView);\n }\n else if (matchingIdx === -2) {\n // read a special token from a node injector\n return createSpecialToken(lView, tNode, read);\n }\n else {\n // read a token\n return getNodeInjectable(lView, lView[TVIEW], matchingIdx, tNode);\n }\n}\nfunction createSpecialToken(lView, tNode, read) {\n if (read === ElementRef) {\n return createElementRef(tNode, lView);\n }\n else if (read === TemplateRef) {\n return createTemplateRef(tNode, lView);\n }\n else if (read === ViewContainerRef) {\n ngDevMode && assertTNodeType(tNode, 3 /* TNodeType.AnyRNode */ | 12 /* TNodeType.AnyContainer */);\n return createContainerRef(tNode, lView);\n }\n else {\n ngDevMode &&\n throwError(`Special token to read should be one of ElementRef, TemplateRef or ViewContainerRef but got ${stringify(read)}.`);\n }\n}\n/**\n * A helper function that creates query results for a given view. This function is meant to do the\n * processing once and only once for a given view instance (a set of results for a given view\n * doesn't change).\n */\nfunction materializeViewResults(tView, lView, tQuery, queryIndex) {\n const lQuery = lView[QUERIES].queries[queryIndex];\n if (lQuery.matches === null) {\n const tViewData = tView.data;\n const tQueryMatches = tQuery.matches;\n const result = [];\n for (let i = 0; tQueryMatches !== null && i < tQueryMatches.length; i += 2) {\n const matchedNodeIdx = tQueryMatches[i];\n if (matchedNodeIdx < 0) {\n // we at the <ng-template> marker which might have results in views created based on this\n // <ng-template> - those results will be in separate views though, so here we just leave\n // null as a placeholder\n result.push(null);\n }\n else {\n ngDevMode && assertIndexInRange(tViewData, matchedNodeIdx);\n const tNode = tViewData[matchedNodeIdx];\n result.push(createResultForNode(lView, tNode, tQueryMatches[i + 1], tQuery.metadata.read));\n }\n }\n lQuery.matches = result;\n }\n return lQuery.matches;\n}\n/**\n * A helper function that collects (already materialized) query results from a tree of views,\n * starting with a provided LView.\n */\nfunction collectQueryResults(tView, lView, queryIndex, result) {\n const tQuery = tView.queries.getByIndex(queryIndex);\n const tQueryMatches = tQuery.matches;\n if (tQueryMatches !== null) {\n const lViewResults = materializeViewResults(tView, lView, tQuery, queryIndex);\n for (let i = 0; i < tQueryMatches.length; i += 2) {\n const tNodeIdx = tQueryMatches[i];\n if (tNodeIdx > 0) {\n result.push(lViewResults[i / 2]);\n }\n else {\n const childQueryIndex = tQueryMatches[i + 1];\n const declarationLContainer = lView[-tNodeIdx];\n ngDevMode && assertLContainer(declarationLContainer);\n // collect matches for views inserted in this container\n for (let i = CONTAINER_HEADER_OFFSET; i < declarationLContainer.length; i++) {\n const embeddedLView = declarationLContainer[i];\n if (embeddedLView[DECLARATION_LCONTAINER] === embeddedLView[PARENT]) {\n collectQueryResults(embeddedLView[TVIEW], embeddedLView, childQueryIndex, result);\n }\n }\n // collect matches for views created from this declaration container and inserted into\n // different containers\n if (declarationLContainer[MOVED_VIEWS] !== null) {\n const embeddedLViews = declarationLContainer[MOVED_VIEWS];\n for (let i = 0; i < embeddedLViews.length; i++) {\n const embeddedLView = embeddedLViews[i];\n collectQueryResults(embeddedLView[TVIEW], embeddedLView, childQueryIndex, result);\n }\n }\n }\n }\n }\n return result;\n}\nfunction loadQueryInternal(lView, queryIndex) {\n ngDevMode &&\n assertDefined(lView[QUERIES], 'LQueries should be defined when trying to load a query');\n ngDevMode && assertIndexInRange(lView[QUERIES].queries, queryIndex);\n return lView[QUERIES].queries[queryIndex].queryList;\n}\n/**\n * Creates a new instance of LQuery and returns its index in the collection of LQuery objects.\n *\n * @returns index in the collection of LQuery objects\n */\nfunction createLQuery(tView, lView, flags) {\n const queryList = new QueryList((flags & 4 /* QueryFlags.emitDistinctChangesOnly */) === 4 /* QueryFlags.emitDistinctChangesOnly */);\n storeCleanupWithContext(tView, lView, queryList, queryList.destroy);\n const lQueries = (lView[QUERIES] ??= new LQueries_()).queries;\n return lQueries.push(new LQuery_(queryList)) - 1;\n}\nfunction createViewQuery(predicate, flags, read) {\n ngDevMode && assertNumber(flags, 'Expecting flags');\n const tView = getTView();\n if (tView.firstCreatePass) {\n createTQuery(tView, new TQueryMetadata_(predicate, flags, read), -1);\n if ((flags & 2 /* QueryFlags.isStatic */) === 2 /* QueryFlags.isStatic */) {\n tView.staticViewQueries = true;\n }\n }\n return createLQuery(tView, getLView(), flags);\n}\nfunction createContentQuery(directiveIndex, predicate, flags, read) {\n ngDevMode && assertNumber(flags, 'Expecting flags');\n const tView = getTView();\n if (tView.firstCreatePass) {\n const tNode = getCurrentTNode();\n createTQuery(tView, new TQueryMetadata_(predicate, flags, read), tNode.index);\n saveContentQueryAndDirectiveIndex(tView, directiveIndex);\n if ((flags & 2 /* QueryFlags.isStatic */) === 2 /* QueryFlags.isStatic */) {\n tView.staticContentQueries = true;\n }\n }\n return createLQuery(tView, getLView(), flags);\n}\n/** Splits multiple selectors in the locator. */\nfunction splitQueryMultiSelectors(locator) {\n return locator.split(',').map((s) => s.trim());\n}\nfunction createTQuery(tView, metadata, nodeIndex) {\n if (tView.queries === null)\n tView.queries = new TQueries_();\n tView.queries.track(new TQuery_(metadata, nodeIndex));\n}\nfunction saveContentQueryAndDirectiveIndex(tView, directiveIndex) {\n const tViewContentQueries = tView.contentQueries || (tView.contentQueries = []);\n const lastSavedDirectiveIndex = tViewContentQueries.length\n ? tViewContentQueries[tViewContentQueries.length - 1]\n : -1;\n if (directiveIndex !== lastSavedDirectiveIndex) {\n tViewContentQueries.push(tView.queries.length - 1, directiveIndex);\n }\n}\nfunction getTQuery(tView, index) {\n ngDevMode && assertDefined(tView.queries, 'TQueries must be defined to retrieve a TQuery');\n return tView.queries.getByIndex(index);\n}\n/**\n * A helper function collecting results from all the views where a given query was active.\n * @param lView\n * @param queryIndex\n */\nfunction getQueryResults(lView, queryIndex) {\n const tView = lView[TVIEW];\n const tQuery = getTQuery(tView, queryIndex);\n return tQuery.crossesNgTemplate\n ? collectQueryResults(tView, lView, queryIndex, [])\n : materializeViewResults(tView, lView, tQuery, queryIndex);\n}\n\n/**\n * A signal factory function in charge of creating a new computed signal capturing query\n * results. This centralized creation function is used by all types of queries (child / children,\n * required / optional).\n *\n * @param firstOnly indicates if all or only the first result should be returned\n * @param required indicates if at least one result is required\n * @returns a read-only signal with query results\n */\nfunction createQuerySignalFn(firstOnly, required, opts) {\n let node;\n const signalFn = createComputed(() => {\n // A dedicated signal that increments its value every time a query changes its dirty status. By\n // using this signal we can implement a query as computed and avoid creation of a specialized\n // reactive node type. Please note that a query gets marked dirty under the following\n // circumstances:\n // - a view (where a query is active) finished its first creation pass;\n // - a new view is inserted / deleted and it impacts query results.\n node._dirtyCounter();\n const value = refreshSignalQuery(node, firstOnly);\n if (required && value === undefined) {\n throw new RuntimeError(-951 /* RuntimeErrorCode.REQUIRED_QUERY_NO_VALUE */, ngDevMode && 'Child query result is required but no value is available.');\n }\n return value;\n });\n node = signalFn[SIGNAL];\n node._dirtyCounter = signal(0);\n node._flatValue = undefined;\n if (ngDevMode) {\n signalFn.toString = () => `[Query Signal]`;\n node.debugName = opts?.debugName;\n }\n return signalFn;\n}\nfunction createSingleResultOptionalQuerySignalFn(opts) {\n return createQuerySignalFn(/* firstOnly */ true, /* required */ false, opts);\n}\nfunction createSingleResultRequiredQuerySignalFn(opts) {\n return createQuerySignalFn(/* firstOnly */ true, /* required */ true, opts);\n}\nfunction createMultiResultQuerySignalFn(opts) {\n return createQuerySignalFn(/* firstOnly */ false, /* required */ false, opts);\n}\nfunction bindQueryToSignal(target, queryIndex) {\n const node = target[SIGNAL];\n node._lView = getLView();\n node._queryIndex = queryIndex;\n node._queryList = loadQueryInternal(node._lView, queryIndex);\n node._queryList.onDirty(() => node._dirtyCounter.update((v) => v + 1));\n}\nfunction refreshSignalQuery(node, firstOnly) {\n const lView = node._lView;\n const queryIndex = node._queryIndex;\n // There are 2 conditions under which we want to return \"empty\" results instead of the ones\n // collected by a query:\n //\n // 1) a given query wasn't created yet (this is a period of time between the directive creation\n // and execution of the query creation function) - in this case a query doesn't exist yet and we\n // don't have any results to return.\n //\n // 2) we are in the process of constructing a view (the first\n // creation pass didn't finish) and a query might have partial results, but we don't want to\n // return those - instead we do delay results collection until all nodes had a chance of matching\n // and we can present consistent, \"atomic\" (on a view level) results.\n if (lView === undefined || queryIndex === undefined || lView[FLAGS] & 4 /* LViewFlags.CreationMode */) {\n return (firstOnly ? undefined : EMPTY_ARRAY);\n }\n const queryList = loadQueryInternal(lView, queryIndex);\n const results = getQueryResults(lView, queryIndex);\n queryList.reset(results, unwrapElementRef);\n if (firstOnly) {\n return queryList.first;\n }\n else {\n // TODO: remove access to the private _changesDetected field by abstracting / removing usage of\n // QueryList in the signal-based queries (perf follow-up)\n const resultChanged = queryList._changesDetected;\n if (resultChanged || node._flatValue === undefined) {\n return (node._flatValue = queryList.toArray());\n }\n return node._flatValue;\n }\n}\n\n/**\n * Used to resolve resource URLs on `@Component` when used with JIT compilation.\n *\n * Example:\n * ```ts\n * @Component({\n * selector: 'my-comp',\n * templateUrl: 'my-comp.html', // This requires asynchronous resolution\n * })\n * class MyComponent{\n * }\n *\n * // Calling `renderComponent` will fail because `renderComponent` is a synchronous process\n * // and `MyComponent`'s `@Component.templateUrl` needs to be resolved asynchronously.\n *\n * // Calling `resolveComponentResources()` will resolve `@Component.templateUrl` into\n * // `@Component.template`, which allows `renderComponent` to proceed in a synchronous manner.\n *\n * // Use browser's `fetch()` function as the default resource resolution strategy.\n * resolveComponentResources(fetch).then(() => {\n * // After resolution all URLs have been converted into `template` strings.\n * renderComponent(MyComponent);\n * });\n *\n * ```\n *\n * NOTE: In AOT the resolution happens during compilation, and so there should be no need\n * to call this method outside JIT mode.\n *\n * @param resourceResolver a function which is responsible for returning a `Promise` to the\n * contents of the resolved URL. Browser's `fetch()` method is a good default implementation.\n */\nfunction resolveComponentResources(resourceResolver) {\n // Store all promises which are fetching the resources.\n const componentResolved = [];\n // Cache so that we don't fetch the same resource more than once.\n const urlMap = new Map();\n function cachedResourceResolve(url) {\n let promise = urlMap.get(url);\n if (!promise) {\n const resp = resourceResolver(url);\n urlMap.set(url, (promise = resp.then(unwrapResponse)));\n }\n return promise;\n }\n componentResourceResolutionQueue.forEach((component, type) => {\n const promises = [];\n if (component.templateUrl) {\n promises.push(cachedResourceResolve(component.templateUrl).then((template) => {\n component.template = template;\n }));\n }\n const styles = typeof component.styles === 'string' ? [component.styles] : component.styles || [];\n component.styles = styles;\n if (component.styleUrl && component.styleUrls?.length) {\n throw new Error('@Component cannot define both `styleUrl` and `styleUrls`. ' +\n 'Use `styleUrl` if the component has one stylesheet, or `styleUrls` if it has multiple');\n }\n else if (component.styleUrls?.length) {\n const styleOffset = component.styles.length;\n const styleUrls = component.styleUrls;\n component.styleUrls.forEach((styleUrl, index) => {\n styles.push(''); // pre-allocate array.\n promises.push(cachedResourceResolve(styleUrl).then((style) => {\n styles[styleOffset + index] = style;\n styleUrls.splice(styleUrls.indexOf(styleUrl), 1);\n if (styleUrls.length == 0) {\n component.styleUrls = undefined;\n }\n }));\n });\n }\n else if (component.styleUrl) {\n promises.push(cachedResourceResolve(component.styleUrl).then((style) => {\n styles.push(style);\n component.styleUrl = undefined;\n }));\n }\n const fullyResolved = Promise.all(promises).then(() => componentDefResolved(type));\n componentResolved.push(fullyResolved);\n });\n clearResolutionOfComponentResourcesQueue();\n return Promise.all(componentResolved).then(() => undefined);\n}\nlet componentResourceResolutionQueue = new Map();\n// Track when existing ɵcmp for a Type is waiting on resources.\nconst componentDefPendingResolution = new Set();\nfunction maybeQueueResolutionOfComponentResources(type, metadata) {\n if (componentNeedsResolution(metadata)) {\n componentResourceResolutionQueue.set(type, metadata);\n componentDefPendingResolution.add(type);\n }\n}\nfunction isComponentDefPendingResolution(type) {\n return componentDefPendingResolution.has(type);\n}\nfunction componentNeedsResolution(component) {\n return !!((component.templateUrl && !component.hasOwnProperty('template')) ||\n (component.styleUrls && component.styleUrls.length) ||\n component.styleUrl);\n}\nfunction clearResolutionOfComponentResourcesQueue() {\n const old = componentResourceResolutionQueue;\n componentResourceResolutionQueue = new Map();\n return old;\n}\nfunction restoreComponentResolutionQueue(queue) {\n componentDefPendingResolution.clear();\n queue.forEach((_, type) => componentDefPendingResolution.add(type));\n componentResourceResolutionQueue = queue;\n}\nfunction isComponentResourceResolutionQueueEmpty() {\n return componentResourceResolutionQueue.size === 0;\n}\nfunction unwrapResponse(response) {\n return typeof response == 'string' ? response : response.text();\n}\nfunction componentDefResolved(type) {\n componentDefPendingResolution.delete(type);\n}\n\n/**\n * Map of module-id to the corresponding NgModule.\n */\nconst modules = new Map();\n/**\n * Whether to check for duplicate NgModule registrations.\n *\n * This can be disabled for testing.\n */\nlet checkForDuplicateNgModules = true;\nfunction assertSameOrNotExisting(id, type, incoming) {\n if (type && type !== incoming && checkForDuplicateNgModules) {\n throw new Error(`Duplicate module registered for ${id} - ${stringify(type)} vs ${stringify(type.name)}`);\n }\n}\n/**\n * Adds the given NgModule type to Angular's NgModule registry.\n *\n * This is generated as a side-effect of NgModule compilation. Note that the `id` is passed in\n * explicitly and not read from the NgModule definition. This is for two reasons: it avoids a\n * megamorphic read, and in JIT there's a chicken-and-egg problem where the NgModule may not be\n * fully resolved when it's registered.\n *\n * @codeGenApi\n */\nfunction registerNgModuleType(ngModuleType, id) {\n const existing = modules.get(id) || null;\n assertSameOrNotExisting(id, existing, ngModuleType);\n modules.set(id, ngModuleType);\n}\nfunction getRegisteredNgModuleType(id) {\n return modules.get(id);\n}\n/**\n * Control whether the NgModule registration system enforces that each NgModule type registered has\n * a unique id.\n *\n * This is useful for testing as the NgModule registry cannot be properly reset between tests with\n * Angular's current API.\n */\nfunction setAllowDuplicateNgModuleIdsForTest(allowDuplicates) {\n checkForDuplicateNgModules = !allowDuplicates;\n}\n\n/**\n * Validation function invoked at runtime for each binding that might potentially\n * represent a security-sensitive attribute of an <iframe>.\n * See `IFRAME_SECURITY_SENSITIVE_ATTRS` in the\n * `packages/compiler/src/schema/dom_security_schema.ts` script for the full list\n * of such attributes.\n *\n * @codeGenApi\n */\nfunction ɵɵvalidateIframeAttribute(attrValue, tagName, attrName) {\n const lView = getLView();\n const tNode = getSelectedTNode();\n const element = getNativeByTNode(tNode, lView);\n // Restrict any dynamic bindings of security-sensitive attributes/properties\n // on an <iframe> for security reasons.\n if (tNode.type === 2 /* TNodeType.Element */ && tagName.toLowerCase() === 'iframe') {\n const iframe = element;\n // Unset previously applied `src` and `srcdoc` if we come across a situation when\n // a security-sensitive attribute is set later via an attribute/property binding.\n iframe.src = '';\n iframe.srcdoc = trustedHTMLFromString('');\n // Also remove the <iframe> from the document.\n nativeRemoveNode(lView[RENDERER], iframe);\n const errorMessage = ngDevMode &&\n `Angular has detected that the \\`${attrName}\\` was applied ` +\n `as a binding to an <iframe>${getTemplateLocationDetails(lView)}. ` +\n `For security reasons, the \\`${attrName}\\` can be set on an <iframe> ` +\n `as a static attribute only. \\n` +\n `To fix this, switch the \\`${attrName}\\` binding to a static attribute ` +\n `in a template or in host bindings section.`;\n throw new RuntimeError(-910 /* RuntimeErrorCode.UNSAFE_IFRAME_ATTRS */, errorMessage);\n }\n return attrValue;\n}\n\nconst markedFeatures = new Set();\n// tslint:disable:ban\n/**\n * A guarded `performance.mark` for feature marking.\n *\n * This method exists because while all supported browser and node.js version supported by Angular\n * support performance.mark API. This is not the case for other environments such as JSDOM and\n * Cloudflare workers.\n */\nfunction performanceMarkFeature(feature) {\n if (markedFeatures.has(feature)) {\n return;\n }\n markedFeatures.add(feature);\n performance?.mark?.('mark_feature_usage', { detail: { feature } });\n}\n\n/**\n * Represents an instance of an `NgModule` created by an `NgModuleFactory`.\n * Provides access to the `NgModule` instance and related objects.\n *\n * @publicApi\n */\nlet NgModuleRef$1 = class NgModuleRef {\n};\n/**\n * @publicApi\n *\n * @deprecated\n * This class was mostly used as a part of ViewEngine-based JIT API and is no longer needed in Ivy\n * JIT mode. Angular provides APIs that accept NgModule classes directly (such as\n * [PlatformRef.bootstrapModule](api/core/PlatformRef#bootstrapModule) and\n * [createNgModule](api/core/createNgModule)), consider switching to those APIs instead of\n * using factory-based ones.\n */\nlet NgModuleFactory$1 = class NgModuleFactory {\n};\n\n/**\n * Returns a new NgModuleRef instance based on the NgModule class and parent injector provided.\n *\n * @param ngModule NgModule class.\n * @param parentInjector Optional injector instance to use as a parent for the module injector. If\n * not provided, `NullInjector` will be used instead.\n * @returns NgModuleRef that represents an NgModule instance.\n *\n * @publicApi\n */\nfunction createNgModule(ngModule, parentInjector) {\n return new NgModuleRef(ngModule, parentInjector ?? null, []);\n}\n/**\n * The `createNgModule` function alias for backwards-compatibility.\n * Please avoid using it directly and use `createNgModule` instead.\n *\n * @deprecated Use `createNgModule` instead.\n */\nconst createNgModuleRef = createNgModule;\nclass NgModuleRef extends NgModuleRef$1 {\n ngModuleType;\n _parent;\n // tslint:disable-next-line:require-internal-with-underscore\n _bootstrapComponents = [];\n _r3Injector;\n instance;\n destroyCbs = [];\n // When bootstrapping a module we have a dependency graph that looks like this:\n // ApplicationRef -> ComponentFactoryResolver -> NgModuleRef. The problem is that if the\n // module being resolved tries to inject the ComponentFactoryResolver, it'll create a\n // circular dependency which will result in a runtime error, because the injector doesn't\n // exist yet. We work around the issue by creating the ComponentFactoryResolver ourselves\n // and providing it, rather than letting the injector resolve it.\n componentFactoryResolver = new ComponentFactoryResolver(this);\n constructor(ngModuleType, _parent, additionalProviders, runInjectorInitializers = true) {\n super();\n this.ngModuleType = ngModuleType;\n this._parent = _parent;\n const ngModuleDef = getNgModuleDef(ngModuleType);\n ngDevMode &&\n assertDefined(ngModuleDef, `NgModule '${stringify(ngModuleType)}' is not a subtype of 'NgModuleType'.`);\n this._bootstrapComponents = maybeUnwrapFn(ngModuleDef.bootstrap);\n this._r3Injector = createInjectorWithoutInjectorInstances(ngModuleType, _parent, [\n { provide: NgModuleRef$1, useValue: this },\n {\n provide: ComponentFactoryResolver$1,\n useValue: this.componentFactoryResolver,\n },\n ...additionalProviders,\n ], stringify(ngModuleType), new Set(['environment']));\n // We need to resolve the injector types separately from the injector creation, because\n // the module might be trying to use this ref in its constructor for DI which will cause a\n // circular error that will eventually error out, because the injector isn't created yet.\n if (runInjectorInitializers) {\n this.resolveInjectorInitializers();\n }\n }\n resolveInjectorInitializers() {\n this._r3Injector.resolveInjectorInitializers();\n this.instance = this._r3Injector.get(this.ngModuleType);\n }\n get injector() {\n return this._r3Injector;\n }\n destroy() {\n ngDevMode && assertDefined(this.destroyCbs, 'NgModule already destroyed');\n const injector = this._r3Injector;\n !injector.destroyed && injector.destroy();\n this.destroyCbs.forEach((fn) => fn());\n this.destroyCbs = null;\n }\n onDestroy(callback) {\n ngDevMode && assertDefined(this.destroyCbs, 'NgModule already destroyed');\n this.destroyCbs.push(callback);\n }\n}\nclass NgModuleFactory extends NgModuleFactory$1 {\n moduleType;\n constructor(moduleType) {\n super();\n this.moduleType = moduleType;\n }\n create(parentInjector) {\n return new NgModuleRef(this.moduleType, parentInjector, []);\n }\n}\nfunction createNgModuleRefWithProviders(moduleType, parentInjector, additionalProviders) {\n return new NgModuleRef(moduleType, parentInjector, additionalProviders, false);\n}\nclass EnvironmentNgModuleRefAdapter extends NgModuleRef$1 {\n injector;\n componentFactoryResolver = new ComponentFactoryResolver(this);\n instance = null;\n constructor(config) {\n super();\n const injector = new R3Injector([\n ...config.providers,\n { provide: NgModuleRef$1, useValue: this },\n { provide: ComponentFactoryResolver$1, useValue: this.componentFactoryResolver },\n ], config.parent || getNullInjector(), config.debugName, new Set(['environment']));\n this.injector = injector;\n if (config.runEnvironmentInitializers) {\n injector.resolveInjectorInitializers();\n }\n }\n destroy() {\n this.injector.destroy();\n }\n onDestroy(callback) {\n this.injector.onDestroy(callback);\n }\n}\n/**\n * Create a new environment injector.\n *\n * @param providers An array of providers.\n * @param parent A parent environment injector.\n * @param debugName An optional name for this injector instance, which will be used in error\n * messages.\n *\n * @publicApi\n */\nfunction createEnvironmentInjector(providers, parent, debugName = null) {\n const adapter = new EnvironmentNgModuleRefAdapter({\n providers,\n parent,\n debugName,\n runEnvironmentInitializers: true,\n });\n return adapter.injector;\n}\n\n/**\n * A service used by the framework to create instances of standalone injectors. Those injectors are\n * created on demand in case of dynamic component instantiation and contain ambient providers\n * collected from the imports graph rooted at a given standalone component.\n */\nclass StandaloneService {\n _injector;\n cachedInjectors = new Map();\n constructor(_injector) {\n this._injector = _injector;\n }\n getOrCreateStandaloneInjector(componentDef) {\n if (!componentDef.standalone) {\n return null;\n }\n if (!this.cachedInjectors.has(componentDef)) {\n const providers = internalImportProvidersFrom(false, componentDef.type);\n const standaloneInjector = providers.length > 0\n ? createEnvironmentInjector([providers], this._injector, `Standalone[${componentDef.type.name}]`)\n : null;\n this.cachedInjectors.set(componentDef, standaloneInjector);\n }\n return this.cachedInjectors.get(componentDef);\n }\n ngOnDestroy() {\n try {\n for (const injector of this.cachedInjectors.values()) {\n if (injector !== null) {\n injector.destroy();\n }\n }\n }\n finally {\n this.cachedInjectors.clear();\n }\n }\n /** @nocollapse */\n static ɵprov = /** @pureOrBreakMyCode */ /* @__PURE__ */ __defineInjectable({\n token: StandaloneService,\n providedIn: 'environment',\n factory: () => new StandaloneService(__inject(EnvironmentInjector)),\n });\n}\n\n/**\n * Create a component definition object.\n *\n *\n * # Example\n * ```ts\n * class MyComponent {\n * // Generated by Angular Template Compiler\n * // [Symbol] syntax will not be supported by TypeScript until v2.7\n * static ɵcmp = defineComponent({\n * ...\n * });\n * }\n * ```\n * @codeGenApi\n */\nfunction ɵɵdefineComponent(componentDefinition) {\n return noSideEffects(() => {\n // Initialize ngDevMode. This must be the first statement in ɵɵdefineComponent.\n // See the `initNgDevMode` docstring for more information.\n (typeof ngDevMode === 'undefined' || ngDevMode) && initNgDevMode();\n const baseDef = getNgDirectiveDef(componentDefinition);\n const def = {\n ...baseDef,\n decls: componentDefinition.decls,\n vars: componentDefinition.vars,\n template: componentDefinition.template,\n consts: componentDefinition.consts || null,\n ngContentSelectors: componentDefinition.ngContentSelectors,\n onPush: componentDefinition.changeDetection === ChangeDetectionStrategy.OnPush,\n directiveDefs: null, // assigned in noSideEffects\n pipeDefs: null, // assigned in noSideEffects\n dependencies: (baseDef.standalone && componentDefinition.dependencies) || null,\n getStandaloneInjector: baseDef.standalone\n ? (parentInjector) => {\n return parentInjector.get(StandaloneService).getOrCreateStandaloneInjector(def);\n }\n : null,\n getExternalStyles: null,\n signals: componentDefinition.signals ?? false,\n data: componentDefinition.data || {},\n encapsulation: componentDefinition.encapsulation || ViewEncapsulation.Emulated,\n styles: componentDefinition.styles || EMPTY_ARRAY,\n _: null,\n schemas: componentDefinition.schemas || null,\n tView: null,\n id: '',\n };\n // TODO: Do we still need/want this ?\n if (baseDef.standalone) {\n performanceMarkFeature('NgStandalone');\n }\n initFeatures(def);\n const dependencies = componentDefinition.dependencies;\n def.directiveDefs = extractDefListOrFactory(dependencies, extractDirectiveDef);\n def.pipeDefs = extractDefListOrFactory(dependencies, getPipeDef$1);\n def.id = getComponentId(def);\n return def;\n });\n}\nfunction extractDirectiveDef(type) {\n return getComponentDef(type) || getDirectiveDef(type);\n}\n/**\n * @codeGenApi\n */\nfunction ɵɵdefineNgModule(def) {\n return noSideEffects(() => {\n const res = {\n type: def.type,\n bootstrap: def.bootstrap || EMPTY_ARRAY,\n declarations: def.declarations || EMPTY_ARRAY,\n imports: def.imports || EMPTY_ARRAY,\n exports: def.exports || EMPTY_ARRAY,\n transitiveCompileScopes: null,\n schemas: def.schemas || null,\n id: def.id || null,\n };\n return res;\n });\n}\n/**\n * Converts binding objects from the `DirectiveDefinition` into more efficient\n * lookup dictionaries that are optimized for the framework runtime.\n *\n * This function converts inputs or output directive information into new objects\n * where the public name conveniently maps to the minified internal field name.\n *\n * For inputs, the input flags are additionally persisted into the new data structure,\n * so that those can be quickly retrieved when needed.\n *\n * e.g. for\n *\n * ```ts\n * class Comp {\n * @Input()\n * propName1: string;\n *\n * @Input('publicName2')\n * declaredPropName2: number;\n *\n * inputSignal = input(3);\n * }\n * ```\n *\n * will be serialized as\n *\n * ```ts\n * {\n * propName1: 'propName1',\n * declaredPropName2: ['publicName2', 'declaredPropName2'],\n * inputSignal: [InputFlags.SignalBased, 'inputSignal'],\n * }\n * ```\n *\n * which is than translated by the minifier as:\n *\n * ```ts\n * {\n * minifiedPropName1: 'propName1',\n * minifiedPropName2: ['publicName2', 'declaredPropName2'],\n * minifiedInputSignal: [InputFlags.SignalBased, 'inputSignal'],\n * }\n * ```\n *\n * becomes: (public name => minifiedName + isSignal if needed)\n *\n * ```ts\n * {\n * 'propName1': 'minifiedPropName1',\n * 'publicName2': 'minifiedPropName2',\n * 'inputSignal': ['minifiedInputSignal', InputFlags.SignalBased],\n * }\n * ```\n *\n * Optionally the function can take `declaredInputs` which will result\n * in: (public name => declared name)\n *\n * ```ts\n * {\n * 'propName1': 'propName1',\n * 'publicName2': 'declaredPropName2',\n * 'inputSignal': 'inputSignal',\n * }\n * ```\n *\n\n */\nfunction parseAndConvertInputsForDefinition(obj, declaredInputs) {\n if (obj == null)\n return EMPTY_OBJ;\n const newLookup = {};\n for (const minifiedKey in obj) {\n if (obj.hasOwnProperty(minifiedKey)) {\n const value = obj[minifiedKey];\n let publicName;\n let declaredName;\n let inputFlags;\n let transform;\n if (Array.isArray(value)) {\n inputFlags = value[0];\n publicName = value[1];\n declaredName = value[2] ?? publicName; // declared name might not be set to save bytes.\n transform = value[3] || null;\n }\n else {\n publicName = value;\n declaredName = value;\n inputFlags = InputFlags.None;\n transform = null;\n }\n newLookup[publicName] = [minifiedKey, inputFlags, transform];\n declaredInputs[publicName] = declaredName;\n }\n }\n return newLookup;\n}\nfunction parseAndConvertOutputsForDefinition(obj) {\n if (obj == null)\n return EMPTY_OBJ;\n const newLookup = {};\n for (const minifiedKey in obj) {\n if (obj.hasOwnProperty(minifiedKey)) {\n newLookup[obj[minifiedKey]] = minifiedKey;\n }\n }\n return newLookup;\n}\n/**\n * Create a directive definition object.\n *\n * # Example\n * ```ts\n * class MyDirective {\n * // Generated by Angular Template Compiler\n * // [Symbol] syntax will not be supported by TypeScript until v2.7\n * static ɵdir = ɵɵdefineDirective({\n * ...\n * });\n * }\n * ```\n *\n * @codeGenApi\n */\nfunction ɵɵdefineDirective(directiveDefinition) {\n return noSideEffects(() => {\n const def = getNgDirectiveDef(directiveDefinition);\n initFeatures(def);\n return def;\n });\n}\n/**\n * Create a pipe definition object.\n *\n * # Example\n * ```ts\n * class MyPipe implements PipeTransform {\n * // Generated by Angular Template Compiler\n * static ɵpipe = definePipe({\n * ...\n * });\n * }\n * ```\n * @param pipeDef Pipe definition generated by the compiler\n *\n * @codeGenApi\n */\nfunction ɵɵdefinePipe(pipeDef) {\n return {\n type: pipeDef.type,\n name: pipeDef.name,\n factory: null,\n pure: pipeDef.pure !== false,\n standalone: pipeDef.standalone ?? true,\n onDestroy: pipeDef.type.prototype.ngOnDestroy || null,\n };\n}\nfunction getNgDirectiveDef(directiveDefinition) {\n const declaredInputs = {};\n return {\n type: directiveDefinition.type,\n providersResolver: null,\n factory: null,\n hostBindings: directiveDefinition.hostBindings || null,\n hostVars: directiveDefinition.hostVars || 0,\n hostAttrs: directiveDefinition.hostAttrs || null,\n contentQueries: directiveDefinition.contentQueries || null,\n declaredInputs: declaredInputs,\n inputConfig: directiveDefinition.inputs || EMPTY_OBJ,\n exportAs: directiveDefinition.exportAs || null,\n standalone: directiveDefinition.standalone ?? true,\n signals: directiveDefinition.signals === true,\n selectors: directiveDefinition.selectors || EMPTY_ARRAY,\n viewQuery: directiveDefinition.viewQuery || null,\n features: directiveDefinition.features || null,\n setInput: null,\n resolveHostDirectives: null,\n hostDirectives: null,\n inputs: parseAndConvertInputsForDefinition(directiveDefinition.inputs, declaredInputs),\n outputs: parseAndConvertOutputsForDefinition(directiveDefinition.outputs),\n debugInfo: null,\n };\n}\nfunction initFeatures(definition) {\n definition.features?.forEach((fn) => fn(definition));\n}\nfunction extractDefListOrFactory(dependencies, defExtractor) {\n if (!dependencies) {\n return null;\n }\n return () => {\n const resolvedDependencies = typeof dependencies === 'function' ? dependencies() : dependencies;\n const result = [];\n for (const dep of resolvedDependencies) {\n const definition = defExtractor(dep);\n if (definition !== null) {\n result.push(definition);\n }\n }\n return result;\n };\n}\n/**\n * A map that contains the generated component IDs and type.\n */\nconst GENERATED_COMP_IDS = new Map();\n/**\n * A method can returns a component ID from the component definition using a variant of DJB2 hash\n * algorithm.\n */\nfunction getComponentId(componentDef) {\n let hash = 0;\n // For components with i18n in templates, the `consts` array is generated by the compiler\n // as a function. If client and server bundles were produced with different minification\n // configurations, the serializable contents of the function body would be different on\n // the client and on the server. This might result in different ids generated. To avoid this\n // issue, we do not take the `consts` contents into account if it's a function.\n // See https://github.com/angular/angular/issues/58713.\n const componentDefConsts = typeof componentDef.consts === 'function' ? '' : componentDef.consts;\n // We cannot rely solely on the component selector as the same selector can be used in different\n // modules.\n //\n // `componentDef.style` is not used, due to it causing inconsistencies. Ex: when server\n // component styles has no sourcemaps and browsers do.\n //\n // Example:\n // https://github.com/angular/components/blob/d9f82c8f95309e77a6d82fd574c65871e91354c2/src/material/core/option/option.ts#L248\n // https://github.com/angular/components/blob/285f46dc2b4c5b127d356cb7c4714b221f03ce50/src/material/legacy-core/option/option.ts#L32\n const hashSelectors = [\n componentDef.selectors,\n componentDef.ngContentSelectors,\n componentDef.hostVars,\n componentDef.hostAttrs,\n componentDefConsts,\n componentDef.vars,\n componentDef.decls,\n componentDef.encapsulation,\n componentDef.standalone,\n componentDef.signals,\n componentDef.exportAs,\n JSON.stringify(componentDef.inputs),\n JSON.stringify(componentDef.outputs),\n // We cannot use 'componentDef.type.name' as the name of the symbol will change and will not\n // match in the server and browser bundles.\n Object.getOwnPropertyNames(componentDef.type.prototype),\n !!componentDef.contentQueries,\n !!componentDef.viewQuery,\n ];\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n // If client and server bundles were produced with different minification configurations,\n // the serializable contents of the function body would be different on the client and on\n // the server. Ensure that we do not accidentally use functions in component id computation.\n for (const item of hashSelectors) {\n assertNotEqual(typeof item, 'function', 'Internal error: attempting to use a function in component id computation logic.');\n }\n }\n for (const char of hashSelectors.join('|')) {\n hash = (Math.imul(31, hash) + char.charCodeAt(0)) << 0;\n }\n // Force positive number hash.\n // 2147483647 = equivalent of Integer.MAX_VALUE.\n hash += 2147483647 + 1;\n const compId = 'c' + hash;\n if ((typeof ngDevMode === 'undefined' || ngDevMode) &&\n // Skip the check on the server since we can't guarantee the same component instance between\n // requests. Note that we can't use DI to check if we're on the server, because the component\n // hasn't been instantiated yet.\n (typeof ngServerMode === 'undefined' || !ngServerMode)) {\n if (GENERATED_COMP_IDS.has(compId)) {\n const previousCompDefType = GENERATED_COMP_IDS.get(compId);\n if (previousCompDefType !== componentDef.type) {\n console.warn(formatRuntimeError(-912 /* RuntimeErrorCode.COMPONENT_ID_COLLISION */, `Component ID generation collision detected. Components '${previousCompDefType.name}' and '${componentDef.type.name}' with selector '${stringifyCSSSelectorList(componentDef.selectors)}' generated the same component ID. To fix this, you can change the selector of one of those components or add an extra host attribute to force a different ID.`));\n }\n }\n else {\n GENERATED_COMP_IDS.set(compId, componentDef.type);\n }\n }\n return compId;\n}\n\nfunction getSuperType(type) {\n return Object.getPrototypeOf(type.prototype).constructor;\n}\n/**\n * Merges the definition from a super class to a sub class.\n * @param definition The definition that is a SubClass of another directive of component\n *\n * @codeGenApi\n */\nfunction ɵɵInheritDefinitionFeature(definition) {\n let superType = getSuperType(definition.type);\n let shouldInheritFields = true;\n const inheritanceChain = [definition];\n while (superType) {\n let superDef = undefined;\n if (isComponentDef(definition)) {\n // Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.\n superDef = superType.ɵcmp || superType.ɵdir;\n }\n else {\n if (superType.ɵcmp) {\n throw new RuntimeError(903 /* RuntimeErrorCode.INVALID_INHERITANCE */, ngDevMode &&\n `Directives cannot inherit Components. Directive ${stringifyForError(definition.type)} is attempting to extend component ${stringifyForError(superType)}`);\n }\n // Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.\n superDef = superType.ɵdir;\n }\n if (superDef) {\n if (shouldInheritFields) {\n inheritanceChain.push(superDef);\n // Some fields in the definition may be empty, if there were no values to put in them that\n // would've justified object creation. Unwrap them if necessary.\n const writeableDef = definition;\n writeableDef.inputs = maybeUnwrapEmpty(definition.inputs);\n writeableDef.declaredInputs = maybeUnwrapEmpty(definition.declaredInputs);\n writeableDef.outputs = maybeUnwrapEmpty(definition.outputs);\n // Merge hostBindings\n const superHostBindings = superDef.hostBindings;\n superHostBindings && inheritHostBindings(definition, superHostBindings);\n // Merge queries\n const superViewQuery = superDef.viewQuery;\n const superContentQueries = superDef.contentQueries;\n superViewQuery && inheritViewQuery(definition, superViewQuery);\n superContentQueries && inheritContentQueries(definition, superContentQueries);\n // Merge inputs and outputs\n mergeInputsWithTransforms(definition, superDef);\n fillProperties(definition.outputs, superDef.outputs);\n // Merge animations metadata.\n // If `superDef` is a Component, the `data` field is present (defaults to an empty object).\n if (isComponentDef(superDef) && superDef.data.animation) {\n // If super def is a Component, the `definition` is also a Component, since Directives can\n // not inherit Components (we throw an error above and cannot reach this code).\n const defData = definition.data;\n defData.animation = (defData.animation || []).concat(superDef.data.animation);\n }\n }\n // Run parent features\n const features = superDef.features;\n if (features) {\n for (let i = 0; i < features.length; i++) {\n const feature = features[i];\n if (feature && feature.ngInherit) {\n feature(definition);\n }\n // If `InheritDefinitionFeature` is a part of the current `superDef`, it means that this\n // def already has all the necessary information inherited from its super class(es), so we\n // can stop merging fields from super classes. However we need to iterate through the\n // prototype chain to look for classes that might contain other \"features\" (like\n // NgOnChanges), which we should invoke for the original `definition`. We set the\n // `shouldInheritFields` flag to indicate that, essentially skipping fields inheritance\n // logic and only invoking functions from the \"features\" list.\n if (feature === ɵɵInheritDefinitionFeature) {\n shouldInheritFields = false;\n }\n }\n }\n }\n superType = Object.getPrototypeOf(superType);\n }\n mergeHostAttrsAcrossInheritance(inheritanceChain);\n}\nfunction mergeInputsWithTransforms(target, source) {\n for (const key in source.inputs) {\n if (!source.inputs.hasOwnProperty(key)) {\n continue;\n }\n if (target.inputs.hasOwnProperty(key)) {\n continue;\n }\n const value = source.inputs[key];\n if (value !== undefined) {\n target.inputs[key] = value;\n target.declaredInputs[key] = source.declaredInputs[key];\n }\n }\n}\n/**\n * Merge the `hostAttrs` and `hostVars` from the inherited parent to the base class.\n *\n * @param inheritanceChain A list of `WritableDefs` starting at the top most type and listing\n * sub-types in order. For each type take the `hostAttrs` and `hostVars` and merge it with the child\n * type.\n */\nfunction mergeHostAttrsAcrossInheritance(inheritanceChain) {\n let hostVars = 0;\n let hostAttrs = null;\n // We process the inheritance order from the base to the leaves here.\n for (let i = inheritanceChain.length - 1; i >= 0; i--) {\n const def = inheritanceChain[i];\n // For each `hostVars`, we need to add the superclass amount.\n def.hostVars = hostVars += def.hostVars;\n // for each `hostAttrs` we need to merge it with superclass.\n def.hostAttrs = mergeHostAttrs(def.hostAttrs, (hostAttrs = mergeHostAttrs(hostAttrs, def.hostAttrs)));\n }\n}\nfunction maybeUnwrapEmpty(value) {\n if (value === EMPTY_OBJ) {\n return {};\n }\n else if (value === EMPTY_ARRAY) {\n return [];\n }\n else {\n return value;\n }\n}\nfunction inheritViewQuery(definition, superViewQuery) {\n const prevViewQuery = definition.viewQuery;\n if (prevViewQuery) {\n definition.viewQuery = (rf, ctx) => {\n superViewQuery(rf, ctx);\n prevViewQuery(rf, ctx);\n };\n }\n else {\n definition.viewQuery = superViewQuery;\n }\n}\nfunction inheritContentQueries(definition, superContentQueries) {\n const prevContentQueries = definition.contentQueries;\n if (prevContentQueries) {\n definition.contentQueries = (rf, ctx, directiveIndex) => {\n superContentQueries(rf, ctx, directiveIndex);\n prevContentQueries(rf, ctx, directiveIndex);\n };\n }\n else {\n definition.contentQueries = superContentQueries;\n }\n}\nfunction inheritHostBindings(definition, superHostBindings) {\n const prevHostBindings = definition.hostBindings;\n if (prevHostBindings) {\n definition.hostBindings = (rf, ctx) => {\n superHostBindings(rf, ctx);\n prevHostBindings(rf, ctx);\n };\n }\n else {\n definition.hostBindings = superHostBindings;\n }\n}\n\n/**\n * Fields which exist on either directive or component definitions, and need to be copied from\n * parent to child classes by the `ɵɵCopyDefinitionFeature`.\n */\nconst COPY_DIRECTIVE_FIELDS = [\n // The child class should use the providers of its parent.\n 'providersResolver',\n // Not listed here are any fields which are handled by the `ɵɵInheritDefinitionFeature`, such\n // as inputs, outputs, and host binding functions.\n];\n/**\n * Fields which exist only on component definitions, and need to be copied from parent to child\n * classes by the `ɵɵCopyDefinitionFeature`.\n *\n * The type here allows any field of `ComponentDef` which is not also a property of `DirectiveDef`,\n * since those should go in `COPY_DIRECTIVE_FIELDS` above.\n */\nconst COPY_COMPONENT_FIELDS = [\n // The child class should use the template function of its parent, including all template\n // semantics.\n 'template',\n 'decls',\n 'consts',\n 'vars',\n 'onPush',\n 'ngContentSelectors',\n // The child class should use the CSS styles of its parent, including all styling semantics.\n 'styles',\n 'encapsulation',\n // The child class should be checked by the runtime in the same way as its parent.\n 'schemas',\n];\n/**\n * Copies the fields not handled by the `ɵɵInheritDefinitionFeature` from the supertype of a\n * definition.\n *\n * This exists primarily to support ngcc migration of an existing View Engine pattern, where an\n * entire decorator is inherited from a parent to a child class. When ngcc detects this case, it\n * generates a skeleton definition on the child class, and applies this feature.\n *\n * The `ɵɵCopyDefinitionFeature` then copies any needed fields from the parent class' definition,\n * including things like the component template function.\n *\n * @param definition The definition of a child class which inherits from a parent class with its\n * own definition.\n *\n * @codeGenApi\n */\nfunction ɵɵCopyDefinitionFeature(definition) {\n let superType = getSuperType(definition.type);\n let superDef = undefined;\n if (isComponentDef(definition)) {\n // Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.\n superDef = superType.ɵcmp;\n }\n else {\n // Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.\n superDef = superType.ɵdir;\n }\n // Needed because `definition` fields are readonly.\n const defAny = definition;\n // Copy over any fields that apply to either directives or components.\n for (const field of COPY_DIRECTIVE_FIELDS) {\n defAny[field] = superDef[field];\n }\n if (isComponentDef(superDef)) {\n // Copy over any component-specific fields.\n for (const field of COPY_COMPONENT_FIELDS) {\n defAny[field] = superDef[field];\n }\n }\n}\n\n/**\n * This feature adds the host directives behavior to a directive definition by patching a\n * function onto it. The expectation is that the runtime will invoke the function during\n * directive matching.\n *\n * For example:\n * ```ts\n * class ComponentWithHostDirective {\n * static ɵcmp = defineComponent({\n * type: ComponentWithHostDirective,\n * features: [ɵɵHostDirectivesFeature([\n * SimpleHostDirective,\n * {directive: AdvancedHostDirective, inputs: ['foo: alias'], outputs: ['bar']},\n * ])]\n * });\n * }\n * ```\n *\n * @codeGenApi\n */\nfunction ɵɵHostDirectivesFeature(rawHostDirectives) {\n const feature = (definition) => {\n const isEager = Array.isArray(rawHostDirectives);\n if (definition.hostDirectives === null) {\n definition.resolveHostDirectives = resolveHostDirectives;\n definition.hostDirectives = isEager\n ? rawHostDirectives.map(createHostDirectiveDef)\n : [rawHostDirectives];\n }\n else if (isEager) {\n definition.hostDirectives.unshift(...rawHostDirectives.map(createHostDirectiveDef));\n }\n else {\n definition.hostDirectives.unshift(rawHostDirectives);\n }\n };\n feature.ngInherit = true;\n return feature;\n}\n/**\n * Function that will be patched onto a definition to enable host directives. It is intended to\n * be called once during directive matching and is the same for all definitions.\n * @param matches Directives resolved through selector matching.\n */\nfunction resolveHostDirectives(matches) {\n const allDirectiveDefs = [];\n let hasComponent = false;\n let hostDirectiveDefs = null;\n let hostDirectiveRanges = null;\n // Components are inserted at the front of the matches array so that their lifecycle\n // hooks run before any directive lifecycle hooks. This appears to be for ViewEngine\n // compatibility. This logic doesn't make sense with host directives, because it\n // would allow the host directives to undo any overrides the host may have made.\n // To handle this case, the host directives of components are inserted at the beginning\n // of the array, followed by the component. As such, the insertion order is as follows:\n // 1. Host directives belonging to the selector-matched component.\n // 2. Selector-matched component.\n // 3. Host directives belonging to selector-matched directives.\n // 4. Selector-matched dir\n for (let i = 0; i < matches.length; i++) {\n const def = matches[i];\n if (def.hostDirectives !== null) {\n const start = allDirectiveDefs.length;\n hostDirectiveDefs ??= new Map();\n hostDirectiveRanges ??= new Map();\n // TODO(pk): probably could return matches instead of taking in an array to fill in?\n findHostDirectiveDefs(def, allDirectiveDefs, hostDirectiveDefs);\n // Note that these indexes are within the offset by `directiveStart`. We can't do the\n // offsetting here, because `directiveStart` hasn't been initialized on the TNode yet.\n hostDirectiveRanges.set(def, [start, allDirectiveDefs.length - 1]);\n }\n // Component definition is always first and needs to be\n // pushed early to maintain the correct ordering.\n if (i === 0 && isComponentDef(def)) {\n hasComponent = true;\n allDirectiveDefs.push(def);\n }\n }\n for (let i = hasComponent ? 1 : 0; i < matches.length; i++) {\n allDirectiveDefs.push(matches[i]);\n }\n return [allDirectiveDefs, hostDirectiveDefs, hostDirectiveRanges];\n}\nfunction findHostDirectiveDefs(currentDef, matchedDefs, hostDirectiveDefs) {\n if (currentDef.hostDirectives !== null) {\n for (const configOrFn of currentDef.hostDirectives) {\n if (typeof configOrFn === 'function') {\n const resolved = configOrFn();\n for (const config of resolved) {\n trackHostDirectiveDef(createHostDirectiveDef(config), matchedDefs, hostDirectiveDefs);\n }\n }\n else {\n trackHostDirectiveDef(configOrFn, matchedDefs, hostDirectiveDefs);\n }\n }\n }\n}\n/** Tracks a single host directive during directive matching. */\nfunction trackHostDirectiveDef(def, matchedDefs, hostDirectiveDefs) {\n const hostDirectiveDef = getDirectiveDef(def.directive);\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n validateHostDirective(def, hostDirectiveDef);\n }\n // We need to patch the `declaredInputs` so that\n // `ngOnChanges` can map the properties correctly.\n patchDeclaredInputs(hostDirectiveDef.declaredInputs, def.inputs);\n // Host directives execute before the host so that its host bindings can be overwritten.\n findHostDirectiveDefs(hostDirectiveDef, matchedDefs, hostDirectiveDefs);\n hostDirectiveDefs.set(hostDirectiveDef, def);\n matchedDefs.push(hostDirectiveDef);\n}\n/** Creates a `HostDirectiveDef` from a used-defined host directive configuration. */\nfunction createHostDirectiveDef(config) {\n return typeof config === 'function'\n ? { directive: resolveForwardRef(config), inputs: EMPTY_OBJ, outputs: EMPTY_OBJ }\n : {\n directive: resolveForwardRef(config.directive),\n inputs: bindingArrayToMap(config.inputs),\n outputs: bindingArrayToMap(config.outputs),\n };\n}\n/**\n * Converts an array in the form of `['publicName', 'alias', 'otherPublicName', 'otherAlias']` into\n * a map in the form of `{publicName: 'alias', otherPublicName: 'otherAlias'}`.\n */\nfunction bindingArrayToMap(bindings) {\n if (bindings === undefined || bindings.length === 0) {\n return EMPTY_OBJ;\n }\n const result = {};\n for (let i = 0; i < bindings.length; i += 2) {\n result[bindings[i]] = bindings[i + 1];\n }\n return result;\n}\n/**\n * `ngOnChanges` has some leftover legacy ViewEngine behavior where the keys inside the\n * `SimpleChanges` event refer to the *declared* name of the input, not its public name or its\n * minified name. E.g. in `@Input('alias') foo: string`, the name in the `SimpleChanges` object\n * will always be `foo`, and not `alias` or the minified name of `foo` in apps using property\n * minification.\n *\n * This is achieved through the `DirectiveDef.declaredInputs` map that is constructed when the\n * definition is declared. When a property is written to the directive instance, the\n * `NgOnChangesFeature` will try to remap the property name being written to using the\n * `declaredInputs`.\n *\n * Since the host directive input remapping happens during directive matching, `declaredInputs`\n * won't contain the new alias that the input is available under. This function addresses the\n * issue by patching the host directive aliases to the `declaredInputs`. There is *not* a risk of\n * this patching accidentally introducing new inputs to the host directive, because `declaredInputs`\n * is used *only* by the `NgOnChangesFeature` when determining what name is used in the\n * `SimpleChanges` object which won't be reached if an input doesn't exist.\n */\nfunction patchDeclaredInputs(declaredInputs, exposedInputs) {\n for (const publicName in exposedInputs) {\n if (exposedInputs.hasOwnProperty(publicName)) {\n const remappedPublicName = exposedInputs[publicName];\n const privateName = declaredInputs[publicName];\n // We *technically* shouldn't be able to hit this case because we can't have multiple\n // inputs on the same property and we have validations against conflicting aliases in\n // `validateMappings`. If we somehow did, it would lead to `ngOnChanges` being invoked\n // with the wrong name so we have a non-user-friendly assertion here just in case.\n if ((typeof ngDevMode === 'undefined' || ngDevMode) &&\n declaredInputs.hasOwnProperty(remappedPublicName)) {\n assertEqual(declaredInputs[remappedPublicName], declaredInputs[publicName], `Conflicting host directive input alias ${publicName}.`);\n }\n declaredInputs[remappedPublicName] = privateName;\n }\n }\n}\n/**\n * Verifies that the host directive has been configured correctly.\n * @param hostDirectiveConfig Host directive configuration object.\n * @param directiveDef Directive definition of the host directive.\n */\nfunction validateHostDirective(hostDirectiveConfig, directiveDef) {\n const type = hostDirectiveConfig.directive;\n if (directiveDef === null) {\n if (getComponentDef(type) !== null) {\n throw new RuntimeError(310 /* RuntimeErrorCode.HOST_DIRECTIVE_COMPONENT */, `Host directive ${type.name} cannot be a component.`);\n }\n throw new RuntimeError(307 /* RuntimeErrorCode.HOST_DIRECTIVE_UNRESOLVABLE */, `Could not resolve metadata for host directive ${type.name}. ` +\n `Make sure that the ${type.name} class is annotated with an @Directive decorator.`);\n }\n if (!directiveDef.standalone) {\n throw new RuntimeError(308 /* RuntimeErrorCode.HOST_DIRECTIVE_NOT_STANDALONE */, `Host directive ${directiveDef.type.name} must be standalone.`);\n }\n validateMappings('input', directiveDef, hostDirectiveConfig.inputs);\n validateMappings('output', directiveDef, hostDirectiveConfig.outputs);\n}\n/**\n * Checks that the host directive inputs/outputs configuration is valid.\n * @param bindingType Kind of binding that is being validated. Used in the error message.\n * @param def Definition of the host directive that is being validated against.\n * @param hostDirectiveBindings Host directive mapping object that shold be validated.\n */\nfunction validateMappings(bindingType, def, hostDirectiveBindings) {\n const className = def.type.name;\n const bindings = bindingType === 'input' ? def.inputs : def.outputs;\n for (const publicName in hostDirectiveBindings) {\n if (hostDirectiveBindings.hasOwnProperty(publicName)) {\n if (!bindings.hasOwnProperty(publicName)) {\n throw new RuntimeError(311 /* RuntimeErrorCode.HOST_DIRECTIVE_UNDEFINED_BINDING */, `Directive ${className} does not have an ${bindingType} with a public name of ${publicName}.`);\n }\n const remappedPublicName = hostDirectiveBindings[publicName];\n if (bindings.hasOwnProperty(remappedPublicName) && remappedPublicName !== publicName) {\n throw new RuntimeError(312 /* RuntimeErrorCode.HOST_DIRECTIVE_CONFLICTING_ALIAS */, `Cannot alias ${bindingType} ${publicName} of host directive ${className} to ${remappedPublicName}, because it already has a different ${bindingType} with the same public name.`);\n }\n }\n }\n}\n\nfunction templateCreate(tNode, declarationLView, declarationTView, index, templateFn, decls, vars, flags) {\n if (declarationTView.firstCreatePass) {\n // Merge the template attrs last so that they have the highest priority.\n tNode.mergedAttrs = mergeHostAttrs(tNode.mergedAttrs, tNode.attrs);\n const embeddedTView = (tNode.tView = createTView(2 /* TViewType.Embedded */, tNode, templateFn, decls, vars, declarationTView.directiveRegistry, declarationTView.pipeRegistry, null, declarationTView.schemas, declarationTView.consts, null /* ssrId */));\n if (declarationTView.queries !== null) {\n declarationTView.queries.template(declarationTView, tNode);\n embeddedTView.queries = declarationTView.queries.embeddedTView(tNode);\n }\n }\n if (flags) {\n tNode.flags |= flags;\n }\n setCurrentTNode(tNode, false);\n const comment = _locateOrCreateContainerAnchor(declarationTView, declarationLView, tNode, index);\n if (wasLastNodeCreated()) {\n appendChild(declarationTView, declarationLView, comment, tNode);\n }\n attachPatchData(comment, declarationLView);\n const lContainer = createLContainer(comment, declarationLView, comment, tNode);\n declarationLView[index + HEADER_OFFSET] = lContainer;\n addToEndOfViewTree(declarationLView, lContainer);\n // If hydration is enabled, looks up dehydrated views in the DOM\n // using hydration annotation info and stores those views on LContainer.\n // In client-only mode, this function is a noop.\n populateDehydratedViewsInLContainer(lContainer, tNode, declarationLView);\n}\n/**\n * Declares a new template that can have directives on its host node.\n *\n * @param declarationLView LView in which the template was declared.\n * @param declarationTView TView in which the template wa declared.\n * @param index The index of the container in the data array\n * @param templateFn Inline template\n * @param decls The number of nodes, local refs, and pipes for this template\n * @param vars The number of bindings for this template\n * @param tagName The name of the container element, if applicable\n * @param attrsIndex Index of template attributes in the `consts` array.\n * @param localRefs Index of the local references in the `consts` array.\n * @param localRefExtractor A function which extracts local-refs values from the template.\n * Defaults to the current element associated with the local-ref.\n */\nfunction declareDirectiveHostTemplate(declarationLView, declarationTView, index, templateFn, decls, vars, tagName, attrs, flags, localRefsIndex, localRefExtractor) {\n const adjustedIndex = index + HEADER_OFFSET;\n let tNode;\n if (declarationTView.firstCreatePass) {\n // TODO(pk): refactor getOrCreateTNode to have the \"create\" only version\n tNode = getOrCreateTNode(declarationTView, adjustedIndex, 4 /* TNodeType.Container */, tagName || null, attrs || null);\n if (getBindingsEnabled()) {\n resolveDirectives(declarationTView, declarationLView, tNode, getConstant(declarationTView.consts, localRefsIndex), findDirectiveDefMatches);\n }\n registerPostOrderHooks(declarationTView, tNode);\n }\n else {\n tNode = declarationTView.data[adjustedIndex];\n }\n templateCreate(tNode, declarationLView, declarationTView, index, templateFn, decls, vars, flags);\n if (isDirectiveHost(tNode)) {\n createDirectivesInstances(declarationTView, declarationLView, tNode);\n }\n if (localRefsIndex != null) {\n saveResolvedLocalsInData(declarationLView, tNode, localRefExtractor);\n }\n return tNode;\n}\n/**\n * Declares a new template that *cannot& have directives on its host node.\n *\n * @param declarationLView LView in which the template was declared.\n * @param declarationTView TView in which the template wa declared.\n * @param index The index of the container in the data array\n * @param templateFn Inline template\n * @param decls The number of nodes, local refs, and pipes for this template\n * @param vars The number of bindings for this template\n * @param tagName The name of the container element, if applicable\n * @param attrsIndex Index of template attributes in the `consts` array.\n * @param localRefs Index of the local references in the `consts` array.\n * @param localRefExtractor A function which extracts local-refs values from the template.\n * Defaults to the current element associated with the local-ref.\n */\nfunction declareNoDirectiveHostTemplate(declarationLView, declarationTView, index, templateFn, decls, vars, tagName, attrs, flags, localRefsIndex, localRefExtractor) {\n const adjustedIndex = index + HEADER_OFFSET;\n let tNode;\n if (declarationTView.firstCreatePass) {\n tNode = getOrCreateTNode(declarationTView, adjustedIndex, 4 /* TNodeType.Container */, tagName || null, attrs || null);\n if (localRefsIndex != null) {\n const refs = getConstant(declarationTView.consts, localRefsIndex);\n tNode.localNames = [];\n for (let i = 0; i < refs.length; i += 2) {\n // Always -1 since DOM-only instructions can only refer to the native node.\n tNode.localNames.push(refs[i], -1);\n }\n }\n }\n else {\n tNode = declarationTView.data[adjustedIndex];\n }\n templateCreate(tNode, declarationLView, declarationTView, index, templateFn, decls, vars, flags);\n if (localRefsIndex != null) {\n saveResolvedLocalsInData(declarationLView, tNode, localRefExtractor);\n }\n return tNode;\n}\n/**\n * Creates an LContainer for an ng-template (dynamically-inserted view), e.g.\n *\n * <ng-template #foo>\n * <div></div>\n * </ng-template>\n *\n * @param index The index of the container in the data array\n * @param templateFn Inline template\n * @param decls The number of nodes, local refs, and pipes for this template\n * @param vars The number of bindings for this template\n * @param tagName The name of the container element, if applicable\n * @param attrsIndex Index of template attributes in the `consts` array.\n * @param localRefs Index of the local references in the `consts` array.\n * @param localRefExtractor A function which extracts local-refs values from the template.\n * Defaults to the current element associated with the local-ref.\n *\n * @codeGenApi\n */\nfunction ɵɵtemplate(index, templateFn, decls, vars, tagName, attrsIndex, localRefsIndex, localRefExtractor) {\n const lView = getLView();\n const tView = getTView();\n const attrs = getConstant(tView.consts, attrsIndex);\n declareDirectiveHostTemplate(lView, tView, index, templateFn, decls, vars, tagName, attrs, undefined, localRefsIndex, localRefExtractor);\n return ɵɵtemplate;\n}\n/**\n * Creates an LContainer for an ng-template that cannot have directives.\n *\n * @param index The index of the container in the data array\n * @param templateFn Inline template\n * @param decls The number of nodes, local refs, and pipes for this template\n * @param vars The number of bindings for this template\n * @param tagName The name of the container element, if applicable\n * @param attrsIndex Index of template attributes in the `consts` array.\n * @param localRefs Index of the local references in the `consts` array.\n * @param localRefExtractor A function which extracts local-refs values from the template.\n * Defaults to the current element associated with the local-ref.\n *\n * @codeGenApi\n */\nfunction ɵɵdomTemplate(index, templateFn, decls, vars, tagName, attrsIndex, localRefsIndex, localRefExtractor) {\n const lView = getLView();\n const tView = getTView();\n const attrs = getConstant(tView.consts, attrsIndex);\n declareNoDirectiveHostTemplate(lView, tView, index, templateFn, decls, vars, tagName, attrs, undefined, localRefsIndex, localRefExtractor);\n return ɵɵdomTemplate;\n}\nlet _locateOrCreateContainerAnchor = createContainerAnchorImpl;\n/**\n * Regular creation mode for LContainers and their anchor (comment) nodes.\n */\nfunction createContainerAnchorImpl(tView, lView, tNode, index) {\n lastNodeWasCreated(true);\n return lView[RENDERER].createComment(ngDevMode ? 'container' : '');\n}\n/**\n * Enables hydration code path (to lookup existing elements in DOM)\n * in addition to the regular creation mode for LContainers and their\n * anchor (comment) nodes.\n */\nfunction locateOrCreateContainerAnchorImpl(tView, lView, tNode, index) {\n const isNodeCreationMode = !canHydrateNode(lView, tNode);\n lastNodeWasCreated(isNodeCreationMode);\n const ssrId = lView[HYDRATION]?.data[TEMPLATES]?.[index] ?? null;\n // Apply `ssrId` value to the underlying TView if it was not previously set.\n //\n // There might be situations when the same component is present in a template\n // multiple times and some instances are opted-out of using hydration via\n // `ngSkipHydration` attribute. In this scenario, at the time a TView is created,\n // the `ssrId` might be `null` (if the first component is opted-out of hydration).\n // The code below makes sure that the `ssrId` is applied to the TView if it's still\n // `null` and verifies we never try to override it with a different value.\n if (ssrId !== null && tNode.tView !== null) {\n if (tNode.tView.ssrId === null) {\n tNode.tView.ssrId = ssrId;\n }\n else {\n ngDevMode &&\n assertEqual(tNode.tView.ssrId, ssrId, 'Unexpected value of the `ssrId` for this TView');\n }\n }\n // Regular creation mode.\n if (isNodeCreationMode) {\n return createContainerAnchorImpl(tView, lView);\n }\n const hydrationInfo = lView[HYDRATION];\n // Hydration mode, looking up existing elements in DOM.\n const currentRNode = locateNextRNode(hydrationInfo, tView, lView, tNode);\n ngDevMode && validateNodeExists(currentRNode, lView, tNode);\n setSegmentHead(hydrationInfo, index, currentRNode);\n const viewContainerSize = calcSerializedContainerSize(hydrationInfo, index);\n const comment = siblingAfter(viewContainerSize, currentRNode);\n if (ngDevMode) {\n validateMatchingNode(comment, Node.COMMENT_NODE, null, lView, tNode);\n markRNodeAsClaimedByHydration(comment);\n }\n return comment;\n}\nfunction enableLocateOrCreateContainerAnchorImpl() {\n _locateOrCreateContainerAnchor = locateOrCreateContainerAnchorImpl;\n}\n\n/**\n * Describes the state of defer block dependency loading.\n */\nvar DeferDependenciesLoadingState;\n(function (DeferDependenciesLoadingState) {\n /** Initial state, dependency loading is not yet triggered */\n DeferDependenciesLoadingState[DeferDependenciesLoadingState[\"NOT_STARTED\"] = 0] = \"NOT_STARTED\";\n /** Dependency loading is in progress */\n DeferDependenciesLoadingState[DeferDependenciesLoadingState[\"IN_PROGRESS\"] = 1] = \"IN_PROGRESS\";\n /** Dependency loading has completed successfully */\n DeferDependenciesLoadingState[DeferDependenciesLoadingState[\"COMPLETE\"] = 2] = \"COMPLETE\";\n /** Dependency loading has failed */\n DeferDependenciesLoadingState[DeferDependenciesLoadingState[\"FAILED\"] = 3] = \"FAILED\";\n})(DeferDependenciesLoadingState || (DeferDependenciesLoadingState = {}));\n/** Slot index where `minimum` parameter value is stored. */\nconst MINIMUM_SLOT = 0;\n/** Slot index where `after` parameter value is stored. */\nconst LOADING_AFTER_SLOT = 1;\n/**\n * Describes the current state of this defer block instance.\n *\n * @publicApi\n */\nvar DeferBlockState;\n(function (DeferBlockState) {\n /** The placeholder block content is rendered */\n DeferBlockState[DeferBlockState[\"Placeholder\"] = 0] = \"Placeholder\";\n /** The loading block content is rendered */\n DeferBlockState[DeferBlockState[\"Loading\"] = 1] = \"Loading\";\n /** The main content block content is rendered */\n DeferBlockState[DeferBlockState[\"Complete\"] = 2] = \"Complete\";\n /** The error block content is rendered */\n DeferBlockState[DeferBlockState[\"Error\"] = 3] = \"Error\";\n})(DeferBlockState || (DeferBlockState = {}));\n/**\n * Describes the initial state of this defer block instance.\n *\n * Note: this state is internal only and *must* be represented\n * with a number lower than any value in the `DeferBlockState` enum.\n */\nvar DeferBlockInternalState;\n(function (DeferBlockInternalState) {\n /** Initial state. Nothing is rendered yet. */\n DeferBlockInternalState[DeferBlockInternalState[\"Initial\"] = -1] = \"Initial\";\n})(DeferBlockInternalState || (DeferBlockInternalState = {}));\nconst NEXT_DEFER_BLOCK_STATE = 0;\n// Note: it's *important* to keep the state in this slot, because this slot\n// is used by runtime logic to differentiate between LViews, LContainers and\n// other types (see `isLView` and `isLContainer` functions). In case of defer\n// blocks, this slot would always be a number.\nconst DEFER_BLOCK_STATE = 1;\nconst STATE_IS_FROZEN_UNTIL = 2;\nconst LOADING_AFTER_CLEANUP_FN = 3;\nconst TRIGGER_CLEANUP_FNS = 4;\nconst PREFETCH_TRIGGER_CLEANUP_FNS = 5;\nconst SSR_UNIQUE_ID = 6;\nconst SSR_BLOCK_STATE = 7;\nconst ON_COMPLETE_FNS = 8;\nconst HYDRATE_TRIGGER_CLEANUP_FNS = 9;\n/**\n * Options for configuring defer blocks behavior.\n * @publicApi\n */\nvar DeferBlockBehavior;\n(function (DeferBlockBehavior) {\n /**\n * Manual triggering mode for defer blocks. Provides control over when defer blocks render\n * and which state they render.\n */\n DeferBlockBehavior[DeferBlockBehavior[\"Manual\"] = 0] = \"Manual\";\n /**\n * Playthrough mode for defer blocks. This mode behaves like defer blocks would in a browser.\n * This is the default behavior in test environments.\n */\n DeferBlockBehavior[DeferBlockBehavior[\"Playthrough\"] = 1] = \"Playthrough\";\n})(DeferBlockBehavior || (DeferBlockBehavior = {}));\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 * Registers a cleanup function associated with a prefetching trigger\n * or a regular trigger of a defer block.\n */\nfunction storeTriggerCleanupFn(type, lDetails, cleanupFn) {\n const key = getCleanupFnKeyByType(type);\n if (lDetails[key] === null) {\n lDetails[key] = [];\n }\n lDetails[key].push(cleanupFn);\n}\n/**\n * Invokes registered cleanup functions either for prefetch or for regular triggers.\n */\nfunction invokeTriggerCleanupFns(type, lDetails) {\n const key = getCleanupFnKeyByType(type);\n const cleanupFns = lDetails[key];\n if (cleanupFns !== null) {\n for (const cleanupFn of cleanupFns) {\n cleanupFn();\n }\n lDetails[key] = null;\n }\n}\n/**\n * Invokes registered cleanup functions for prefetch, hydrate, and regular triggers.\n */\nfunction invokeAllTriggerCleanupFns(lDetails) {\n invokeTriggerCleanupFns(1 /* TriggerType.Prefetch */, lDetails);\n invokeTriggerCleanupFns(0 /* TriggerType.Regular */, lDetails);\n invokeTriggerCleanupFns(2 /* TriggerType.Hydrate */, lDetails);\n}\nfunction getCleanupFnKeyByType(type) {\n let key = TRIGGER_CLEANUP_FNS;\n if (type === 1 /* TriggerType.Prefetch */) {\n key = PREFETCH_TRIGGER_CLEANUP_FNS;\n }\n else if (type === 2 /* TriggerType.Hydrate */) {\n key = HYDRATE_TRIGGER_CLEANUP_FNS;\n }\n return key;\n}\n\n/** Actions that are supported by the tracing framework. */\nvar TracingAction;\n(function (TracingAction) {\n TracingAction[TracingAction[\"CHANGE_DETECTION\"] = 0] = \"CHANGE_DETECTION\";\n TracingAction[TracingAction[\"AFTER_NEXT_RENDER\"] = 1] = \"AFTER_NEXT_RENDER\";\n})(TracingAction || (TracingAction = {}));\n/**\n * Injection token for a `TracingService`, optionally provided.\n */\nconst TracingService = new InjectionToken(ngDevMode ? 'TracingService' : '');\n\nconst SCHEDULE_IN_ROOT_ZONE_DEFAULT = false;\n\nclass EventEmitter_ extends Subject {\n // tslint:disable-next-line:require-internal-with-underscore\n __isAsync;\n destroyRef = undefined;\n pendingTasks = undefined;\n constructor(isAsync = false) {\n super();\n this.__isAsync = isAsync;\n // Attempt to retrieve a `DestroyRef` and `PendingTasks` optionally.\n // For backwards compatibility reasons, this cannot be required.\n if (isInInjectionContext()) {\n // `DestroyRef` is optional because it is not available in all contexts.\n // But it is useful to properly complete the `EventEmitter` if used with `outputToObservable`\n // when the component/directive is destroyed. (See `outputToObservable` for more details.)\n this.destroyRef = inject(DestroyRef, { optional: true }) ?? undefined;\n this.pendingTasks = inject(PendingTasksInternal, { optional: true }) ?? undefined;\n }\n }\n emit(value) {\n const prevConsumer = setActiveConsumer(null);\n try {\n super.next(value);\n }\n finally {\n setActiveConsumer(prevConsumer);\n }\n }\n subscribe(observerOrNext, error, complete) {\n let nextFn = observerOrNext;\n let errorFn = error || (() => null);\n let completeFn = complete;\n if (observerOrNext && typeof observerOrNext === 'object') {\n const observer = observerOrNext;\n nextFn = observer.next?.bind(observer);\n errorFn = observer.error?.bind(observer);\n completeFn = observer.complete?.bind(observer);\n }\n if (this.__isAsync) {\n errorFn = this.wrapInTimeout(errorFn);\n if (nextFn) {\n nextFn = this.wrapInTimeout(nextFn);\n }\n if (completeFn) {\n completeFn = this.wrapInTimeout(completeFn);\n }\n }\n const sink = super.subscribe({ next: nextFn, error: errorFn, complete: completeFn });\n if (observerOrNext instanceof Subscription) {\n observerOrNext.add(sink);\n }\n return sink;\n }\n wrapInTimeout(fn) {\n return (value) => {\n const taskId = this.pendingTasks?.add();\n setTimeout(() => {\n try {\n fn(value);\n }\n finally {\n if (taskId !== undefined) {\n this.pendingTasks?.remove(taskId);\n }\n }\n });\n };\n }\n}\n/**\n * @publicApi\n */\nconst EventEmitter = EventEmitter_;\n\n/**\n * Gets a scheduling function that runs the callback after the first of setTimeout and\n * requestAnimationFrame resolves.\n *\n * - `requestAnimationFrame` ensures that change detection runs ahead of a browser repaint.\n * This ensures that the create and update passes of a change detection always happen\n * in the same frame.\n * - When the browser is resource-starved, `rAF` can execute _before_ a `setTimeout` because\n * rendering is a very high priority process. This means that `setTimeout` cannot guarantee\n * same-frame create and update pass, when `setTimeout` is used to schedule the update phase.\n * - While `rAF` gives us the desirable same-frame updates, it has two limitations that\n * prevent it from being used alone. First, it does not run in background tabs, which would\n * prevent Angular from initializing an application when opened in a new tab (for example).\n * Second, repeated calls to requestAnimationFrame will execute at the refresh rate of the\n * hardware (~16ms for a 60Hz display). This would cause significant slowdown of tests that\n * are written with several updates and asserts in the form of \"update; await stable; assert;\".\n * - Both `setTimeout` and `rAF` are able to \"coalesce\" several events from a single user\n * interaction into a single change detection. Importantly, this reduces view tree traversals when\n * compared to an alternative timing mechanism like `queueMicrotask`, where change detection would\n * then be interleaves between each event.\n *\n * By running change detection after the first of `setTimeout` and `rAF` to execute, we get the\n * best of both worlds.\n *\n * @returns a function to cancel the scheduled callback\n */\nfunction scheduleCallbackWithRafRace(callback) {\n let timeoutId;\n let animationFrameId;\n function cleanup() {\n callback = noop;\n try {\n if (animationFrameId !== undefined && typeof cancelAnimationFrame === 'function') {\n cancelAnimationFrame(animationFrameId);\n }\n if (timeoutId !== undefined) {\n clearTimeout(timeoutId);\n }\n }\n catch {\n // Clearing/canceling can fail in tests due to the timing of functions being patched and unpatched\n // Just ignore the errors - we protect ourselves from this issue by also making the callback a no-op.\n }\n }\n timeoutId = setTimeout(() => {\n callback();\n cleanup();\n });\n if (typeof requestAnimationFrame === 'function') {\n animationFrameId = requestAnimationFrame(() => {\n callback();\n cleanup();\n });\n }\n return () => cleanup();\n}\nfunction scheduleCallbackWithMicrotask(callback) {\n queueMicrotask(() => callback());\n return () => {\n callback = noop;\n };\n}\n\nclass AsyncStackTaggingZoneSpec {\n createTask;\n constructor(namePrefix, consoleAsyncStackTaggingImpl = console) {\n this.name = 'asyncStackTagging for ' + namePrefix;\n this.createTask = consoleAsyncStackTaggingImpl?.createTask ?? (() => null);\n }\n // ZoneSpec implementation below.\n name;\n onScheduleTask(delegate, _current, target, task) {\n task.consoleTask = this.createTask(`Zone - ${task.source || task.type}`);\n return delegate.scheduleTask(target, task);\n }\n onInvokeTask(delegate, _currentZone, targetZone, task, applyThis, applyArgs) {\n let ret;\n if (task.consoleTask) {\n ret = task.consoleTask.run(() => delegate.invokeTask(targetZone, task, applyThis, applyArgs));\n }\n else {\n ret = delegate.invokeTask(targetZone, task, applyThis, applyArgs);\n }\n return ret;\n }\n}\n\nconst isAngularZoneProperty = 'isAngularZone';\nconst angularZoneInstanceIdProperty = isAngularZoneProperty + '_ID';\nlet ngZoneInstanceId = 0;\n/**\n * An injectable service for executing work inside or outside of the Angular zone.\n *\n * The most common use of this service is to optimize performance when starting a work consisting of\n * one or more asynchronous tasks that don't require UI updates or error handling to be handled by\n * Angular. Such tasks can be kicked off via {@link #runOutsideAngular} and if needed, these tasks\n * can reenter the Angular zone via {@link #run}.\n *\n * <!-- TODO: add/fix links to:\n * - docs explaining zones and the use of zones in Angular and change-detection\n * - link to runOutsideAngular/run (throughout this file!)\n * -->\n *\n * @usageNotes\n * ### Example\n *\n * ```ts\n * import {Component, NgZone} from '@angular/core';\n *\n * @Component({\n * selector: 'ng-zone-demo',\n * template: `\n * <h2>Demo: NgZone</h2>\n *\n * <p>Progress: {{progress}}%</p>\n * @if(progress >= 100) {\n * <p>Done processing {{label}} of Angular zone!</p>\n * }\n *\n * <button (click)=\"processWithinAngularZone()\">Process within Angular zone</button>\n * <button (click)=\"processOutsideOfAngularZone()\">Process outside of Angular zone</button>\n * `,\n * })\n * export class NgZoneDemo {\n * progress: number = 0;\n * label: string;\n *\n * constructor(private _ngZone: NgZone) {}\n *\n * // Loop inside the Angular zone\n * // so the UI DOES refresh after each setTimeout cycle\n * processWithinAngularZone() {\n * this.label = 'inside';\n * this.progress = 0;\n * this._increaseProgress(() => console.log('Inside Done!'));\n * }\n *\n * // Loop outside of the Angular zone\n * // so the UI DOES NOT refresh after each setTimeout cycle\n * processOutsideOfAngularZone() {\n * this.label = 'outside';\n * this.progress = 0;\n * this._ngZone.runOutsideAngular(() => {\n * this._increaseProgress(() => {\n * // reenter the Angular zone and display done\n * this._ngZone.run(() => { console.log('Outside Done!'); });\n * });\n * });\n * }\n *\n * _increaseProgress(doneCallback: () => void) {\n * this.progress += 1;\n * console.log(`Current progress: ${this.progress}%`);\n *\n * if (this.progress < 100) {\n * window.setTimeout(() => this._increaseProgress(doneCallback), 10);\n * } else {\n * doneCallback();\n * }\n * }\n * }\n * ```\n *\n * @publicApi\n */\nclass NgZone {\n hasPendingMacrotasks = false;\n hasPendingMicrotasks = false;\n /**\n * Whether there are no outstanding microtasks or macrotasks.\n */\n isStable = true;\n /**\n * Notifies when code enters Angular Zone. This gets fired first on VM Turn.\n */\n onUnstable = new EventEmitter(false);\n /**\n * Notifies when there is no more microtasks enqueued in the current VM Turn.\n * This is a hint for Angular to do change detection, which may enqueue more microtasks.\n * For this reason this event can fire multiple times per VM Turn.\n */\n onMicrotaskEmpty = new EventEmitter(false);\n /**\n * Notifies when the last `onMicrotaskEmpty` has run and there are no more microtasks, which\n * implies we are about to relinquish VM turn.\n * This event gets called just once.\n */\n onStable = new EventEmitter(false);\n /**\n * Notifies that an error has been delivered.\n */\n onError = new EventEmitter(false);\n constructor(options) {\n const { enableLongStackTrace = false, shouldCoalesceEventChangeDetection = false, shouldCoalesceRunChangeDetection = false, scheduleInRootZone = SCHEDULE_IN_ROOT_ZONE_DEFAULT, } = options;\n if (typeof Zone == 'undefined') {\n throw new RuntimeError(908 /* RuntimeErrorCode.MISSING_ZONEJS */, ngDevMode && `In this configuration Angular requires Zone.js`);\n }\n Zone.assertZonePatched();\n const self = this;\n self._nesting = 0;\n self._outer = self._inner = Zone.current;\n // AsyncStackTaggingZoneSpec provides `linked stack traces` to show\n // where the async operation is scheduled. For more details, refer\n // to this article, https://developer.chrome.com/blog/devtools-better-angular-debugging/\n // And we only import this AsyncStackTaggingZoneSpec in development mode,\n // in the production mode, the AsyncStackTaggingZoneSpec will be tree shaken away.\n if (ngDevMode) {\n self._inner = self._inner.fork(new AsyncStackTaggingZoneSpec('Angular'));\n }\n if (Zone['TaskTrackingZoneSpec']) {\n self._inner = self._inner.fork(new Zone['TaskTrackingZoneSpec']());\n }\n if (enableLongStackTrace && Zone['longStackTraceZoneSpec']) {\n self._inner = self._inner.fork(Zone['longStackTraceZoneSpec']);\n }\n // if shouldCoalesceRunChangeDetection is true, all tasks including event tasks will be\n // coalesced, so shouldCoalesceEventChangeDetection option is not necessary and can be skipped.\n self.shouldCoalesceEventChangeDetection =\n !shouldCoalesceRunChangeDetection && shouldCoalesceEventChangeDetection;\n self.shouldCoalesceRunChangeDetection = shouldCoalesceRunChangeDetection;\n self.callbackScheduled = false;\n self.scheduleInRootZone = scheduleInRootZone;\n forkInnerZoneWithAngularBehavior(self);\n }\n /**\n This method checks whether the method call happens within an Angular Zone instance.\n */\n static isInAngularZone() {\n // Zone needs to be checked, because this method might be called even when NoopNgZone is used.\n return typeof Zone !== 'undefined' && Zone.current.get(isAngularZoneProperty) === true;\n }\n /**\n Assures that the method is called within the Angular Zone, otherwise throws an error.\n */\n static assertInAngularZone() {\n if (!NgZone.isInAngularZone()) {\n throw new RuntimeError(909 /* RuntimeErrorCode.UNEXPECTED_ZONE_STATE */, ngDevMode && 'Expected to be in Angular Zone, but it is not!');\n }\n }\n /**\n Assures that the method is called outside of the Angular Zone, otherwise throws an error.\n */\n static assertNotInAngularZone() {\n if (NgZone.isInAngularZone()) {\n throw new RuntimeError(909 /* RuntimeErrorCode.UNEXPECTED_ZONE_STATE */, ngDevMode && 'Expected to not be in Angular Zone, but it is!');\n }\n }\n /**\n * Executes the `fn` function synchronously within the Angular zone and returns value returned by\n * the function.\n *\n * Running functions via `run` allows you to reenter Angular zone from a task that was executed\n * outside of the Angular zone (typically started via {@link #runOutsideAngular}).\n *\n * Any future tasks or microtasks scheduled from within this function will continue executing from\n * within the Angular zone.\n *\n * If a synchronous error happens it will be rethrown and not reported via `onError`.\n */\n run(fn, applyThis, applyArgs) {\n return this._inner.run(fn, applyThis, applyArgs);\n }\n /**\n * Executes the `fn` function synchronously within the Angular zone as a task and returns value\n * returned by the function.\n *\n * Running functions via `runTask` allows you to reenter Angular zone from a task that was executed\n * outside of the Angular zone (typically started via {@link #runOutsideAngular}).\n *\n * Any future tasks or microtasks scheduled from within this function will continue executing from\n * within the Angular zone.\n *\n * If a synchronous error happens it will be rethrown and not reported via `onError`.\n */\n runTask(fn, applyThis, applyArgs, name) {\n const zone = this._inner;\n const task = zone.scheduleEventTask('NgZoneEvent: ' + name, fn, EMPTY_PAYLOAD, noop, noop);\n try {\n return zone.runTask(task, applyThis, applyArgs);\n }\n finally {\n zone.cancelTask(task);\n }\n }\n /**\n * Same as `run`, except that synchronous errors are caught and forwarded via `onError` and not\n * rethrown.\n */\n runGuarded(fn, applyThis, applyArgs) {\n return this._inner.runGuarded(fn, applyThis, applyArgs);\n }\n /**\n * Executes the `fn` function synchronously in Angular's parent zone and returns value returned by\n * the function.\n *\n * Running functions via {@link #runOutsideAngular} allows you to escape Angular's zone and do\n * work that\n * doesn't trigger Angular change-detection or is subject to Angular's error handling.\n *\n * Any future tasks or microtasks scheduled from within this function will continue executing from\n * outside of the Angular zone.\n *\n * Use {@link #run} to reenter the Angular zone and do work that updates the application model.\n */\n runOutsideAngular(fn) {\n return this._outer.run(fn);\n }\n}\nconst EMPTY_PAYLOAD = {};\nfunction checkStable(zone) {\n // TODO: @JiaLiPassion, should check zone.isCheckStableRunning to prevent\n // re-entry. The case is:\n //\n // @Component({...})\n // export class AppComponent {\n // constructor(private ngZone: NgZone) {\n // this.ngZone.onStable.subscribe(() => {\n // this.ngZone.run(() => console.log('stable'););\n // });\n // }\n //\n // The onStable subscriber run another function inside ngZone\n // which causes `checkStable()` re-entry.\n // But this fix causes some issues in g3, so this fix will be\n // launched in another PR.\n if (zone._nesting == 0 && !zone.hasPendingMicrotasks && !zone.isStable) {\n try {\n zone._nesting++;\n zone.onMicrotaskEmpty.emit(null);\n }\n finally {\n zone._nesting--;\n if (!zone.hasPendingMicrotasks) {\n try {\n zone.runOutsideAngular(() => zone.onStable.emit(null));\n }\n finally {\n zone.isStable = true;\n }\n }\n }\n }\n}\nfunction delayChangeDetectionForEvents(zone) {\n /**\n * We also need to check _nesting here\n * Consider the following case with shouldCoalesceRunChangeDetection = true\n *\n * ngZone.run(() => {});\n * ngZone.run(() => {});\n *\n * We want the two `ngZone.run()` only trigger one change detection\n * when shouldCoalesceRunChangeDetection is true.\n * And because in this case, change detection run in async way(requestAnimationFrame),\n * so we also need to check the _nesting here to prevent multiple\n * change detections.\n */\n if (zone.isCheckStableRunning || zone.callbackScheduled) {\n return;\n }\n zone.callbackScheduled = true;\n function scheduleCheckStable() {\n scheduleCallbackWithRafRace(() => {\n zone.callbackScheduled = false;\n updateMicroTaskStatus(zone);\n zone.isCheckStableRunning = true;\n checkStable(zone);\n zone.isCheckStableRunning = false;\n });\n }\n if (zone.scheduleInRootZone) {\n Zone.root.run(() => {\n scheduleCheckStable();\n });\n }\n else {\n zone._outer.run(() => {\n scheduleCheckStable();\n });\n }\n updateMicroTaskStatus(zone);\n}\nfunction forkInnerZoneWithAngularBehavior(zone) {\n const delayChangeDetectionForEventsDelegate = () => {\n delayChangeDetectionForEvents(zone);\n };\n const instanceId = ngZoneInstanceId++;\n zone._inner = zone._inner.fork({\n name: 'angular',\n properties: {\n [isAngularZoneProperty]: true,\n [angularZoneInstanceIdProperty]: instanceId,\n [angularZoneInstanceIdProperty + instanceId]: true,\n },\n onInvokeTask: (delegate, current, target, task, applyThis, applyArgs) => {\n // Prevent triggering change detection when the flag is detected.\n if (shouldBeIgnoredByZone(applyArgs)) {\n return delegate.invokeTask(target, task, applyThis, applyArgs);\n }\n try {\n onEnter(zone);\n return delegate.invokeTask(target, task, applyThis, applyArgs);\n }\n finally {\n if ((zone.shouldCoalesceEventChangeDetection && task.type === 'eventTask') ||\n zone.shouldCoalesceRunChangeDetection) {\n delayChangeDetectionForEventsDelegate();\n }\n onLeave(zone);\n }\n },\n onInvoke: (delegate, current, target, callback, applyThis, applyArgs, source) => {\n try {\n onEnter(zone);\n return delegate.invoke(target, callback, applyThis, applyArgs, source);\n }\n finally {\n if (zone.shouldCoalesceRunChangeDetection &&\n // Do not delay change detection when the task is the scheduler's tick.\n // We need to synchronously trigger the stability logic so that the\n // zone-based scheduler can prevent a duplicate ApplicationRef.tick\n // by first checking if the scheduler tick is running. This does seem a bit roundabout,\n // but we _do_ still want to trigger all the correct events when we exit the zone.run\n // (`onMicrotaskEmpty` and `onStable` _should_ emit; developers can have code which\n // relies on these events happening after change detection runs).\n // Note: `zone.callbackScheduled` is already in delayChangeDetectionForEventsDelegate\n // but is added here as well to prevent reads of applyArgs when not necessary\n !zone.callbackScheduled &&\n !isSchedulerTick(applyArgs)) {\n delayChangeDetectionForEventsDelegate();\n }\n onLeave(zone);\n }\n },\n onHasTask: (delegate, current, target, hasTaskState) => {\n delegate.hasTask(target, hasTaskState);\n if (current === target) {\n // We are only interested in hasTask events which originate from our zone\n // (A child hasTask event is not interesting to us)\n if (hasTaskState.change == 'microTask') {\n zone._hasPendingMicrotasks = hasTaskState.microTask;\n updateMicroTaskStatus(zone);\n checkStable(zone);\n }\n else if (hasTaskState.change == 'macroTask') {\n zone.hasPendingMacrotasks = hasTaskState.macroTask;\n }\n }\n },\n onHandleError: (delegate, current, target, error) => {\n delegate.handleError(target, error);\n zone.runOutsideAngular(() => zone.onError.emit(error));\n return false;\n },\n });\n}\nfunction updateMicroTaskStatus(zone) {\n if (zone._hasPendingMicrotasks ||\n ((zone.shouldCoalesceEventChangeDetection || zone.shouldCoalesceRunChangeDetection) &&\n zone.callbackScheduled === true)) {\n zone.hasPendingMicrotasks = true;\n }\n else {\n zone.hasPendingMicrotasks = false;\n }\n}\nfunction onEnter(zone) {\n zone._nesting++;\n if (zone.isStable) {\n zone.isStable = false;\n zone.onUnstable.emit(null);\n }\n}\nfunction onLeave(zone) {\n zone._nesting--;\n checkStable(zone);\n}\n/**\n * Provides a noop implementation of `NgZone` which does nothing. This zone requires explicit calls\n * to framework to perform rendering.\n */\nclass NoopNgZone {\n hasPendingMicrotasks = false;\n hasPendingMacrotasks = false;\n isStable = true;\n onUnstable = new EventEmitter();\n onMicrotaskEmpty = new EventEmitter();\n onStable = new EventEmitter();\n onError = new EventEmitter();\n run(fn, applyThis, applyArgs) {\n return fn.apply(applyThis, applyArgs);\n }\n runGuarded(fn, applyThis, applyArgs) {\n return fn.apply(applyThis, applyArgs);\n }\n runOutsideAngular(fn) {\n return fn();\n }\n runTask(fn, applyThis, applyArgs, name) {\n return fn.apply(applyThis, applyArgs);\n }\n}\nfunction shouldBeIgnoredByZone(applyArgs) {\n return hasApplyArgsData(applyArgs, '__ignore_ng_zone__');\n}\nfunction isSchedulerTick(applyArgs) {\n return hasApplyArgsData(applyArgs, '__scheduler_tick__');\n}\nfunction hasApplyArgsData(applyArgs, key) {\n if (!Array.isArray(applyArgs)) {\n return false;\n }\n // We should only ever get 1 arg passed through to invokeTask.\n // Short circuit here incase that behavior changes.\n if (applyArgs.length !== 1) {\n return false;\n }\n return applyArgs[0]?.data?.[key] === true;\n}\nfunction getNgZone(ngZoneToUse = 'zone.js', options) {\n if (ngZoneToUse === 'noop') {\n return new NoopNgZone();\n }\n if (ngZoneToUse === 'zone.js') {\n return new NgZone(options);\n }\n return ngZoneToUse;\n}\n\nclass AfterRenderManager {\n impl = null;\n execute() {\n this.impl?.execute();\n }\n /** @nocollapse */\n static ɵprov = /** @pureOrBreakMyCode */ /* @__PURE__ */ __defineInjectable({\n token: AfterRenderManager,\n providedIn: 'root',\n factory: () => new AfterRenderManager(),\n });\n}\nconst AFTER_RENDER_PHASES = /* @__PURE__ **/ (() => [\n 0 /* AfterRenderPhase.EarlyRead */,\n 1 /* AfterRenderPhase.Write */,\n 2 /* AfterRenderPhase.MixedReadWrite */,\n 3 /* AfterRenderPhase.Read */,\n])();\nclass AfterRenderImpl {\n ngZone = inject(NgZone);\n scheduler = inject(ChangeDetectionScheduler);\n errorHandler = inject(ErrorHandler, { optional: true });\n /** Current set of active sequences. */\n sequences = new Set();\n /** Tracks registrations made during the current set of executions. */\n deferredRegistrations = new Set();\n /** Whether the `AfterRenderManager` is currently executing hooks. */\n executing = false;\n constructor() {\n // Inject the tracing service to make sure it's initialized.\n inject(TracingService, { optional: true });\n }\n /**\n * Run the sequence of phases of hooks, once through. As a result of executing some hooks, more\n * might be scheduled.\n */\n execute() {\n const hasSequencesToExecute = this.sequences.size > 0;\n if (hasSequencesToExecute) {\n profiler(16 /* ProfilerEvent.AfterRenderHooksStart */);\n }\n this.executing = true;\n for (const phase of AFTER_RENDER_PHASES) {\n for (const sequence of this.sequences) {\n if (sequence.erroredOrDestroyed || !sequence.hooks[phase]) {\n continue;\n }\n try {\n sequence.pipelinedValue = this.ngZone.runOutsideAngular(() => this.maybeTrace(() => {\n const hookFn = sequence.hooks[phase];\n const value = hookFn(sequence.pipelinedValue);\n return value;\n }, sequence.snapshot));\n }\n catch (err) {\n sequence.erroredOrDestroyed = true;\n this.errorHandler?.handleError(err);\n }\n }\n }\n this.executing = false;\n // Cleanup step to reset sequence state and also collect one-shot sequences for removal.\n for (const sequence of this.sequences) {\n sequence.afterRun();\n if (sequence.once) {\n this.sequences.delete(sequence);\n // Destroy the sequence so its on destroy callbacks can be cleaned up\n // immediately, instead of waiting until the injector is destroyed.\n sequence.destroy();\n }\n }\n for (const sequence of this.deferredRegistrations) {\n this.sequences.add(sequence);\n }\n if (this.deferredRegistrations.size > 0) {\n this.scheduler.notify(7 /* NotificationSource.RenderHook */);\n }\n this.deferredRegistrations.clear();\n if (hasSequencesToExecute) {\n profiler(17 /* ProfilerEvent.AfterRenderHooksEnd */);\n }\n }\n register(sequence) {\n const { view } = sequence;\n if (view !== undefined) {\n // Delay adding it to the manager, add it to the view instead.\n (view[AFTER_RENDER_SEQUENCES_TO_ADD] ??= []).push(sequence);\n // Mark the view for traversal to ensure we eventually schedule the afterNextRender.\n markAncestorsForTraversal(view);\n view[FLAGS] |= 8192 /* LViewFlags.HasChildViewsToRefresh */;\n }\n else if (!this.executing) {\n this.addSequence(sequence);\n }\n else {\n this.deferredRegistrations.add(sequence);\n }\n }\n addSequence(sequence) {\n this.sequences.add(sequence);\n // Trigger an `ApplicationRef.tick()` if one is not already pending/running, because we have a\n // new render hook that needs to run.\n this.scheduler.notify(7 /* NotificationSource.RenderHook */);\n }\n unregister(sequence) {\n if (this.executing && this.sequences.has(sequence)) {\n // We can't remove an `AfterRenderSequence` in the middle of iteration.\n // Instead, mark it as destroyed so it doesn't run any more, and mark it as one-shot so it'll\n // be removed at the end of the current execution.\n sequence.erroredOrDestroyed = true;\n sequence.pipelinedValue = undefined;\n sequence.once = true;\n }\n else {\n // It's safe to directly remove this sequence.\n this.sequences.delete(sequence);\n this.deferredRegistrations.delete(sequence);\n }\n }\n maybeTrace(fn, snapshot) {\n // Only trace the execution if the snapshot is defined.\n return snapshot ? snapshot.run(TracingAction.AFTER_NEXT_RENDER, fn) : fn();\n }\n /** @nocollapse */\n static ɵprov = /** @pureOrBreakMyCode */ /* @__PURE__ */ __defineInjectable({\n token: AfterRenderImpl,\n providedIn: 'root',\n factory: () => new AfterRenderImpl(),\n });\n}\nclass AfterRenderSequence {\n impl;\n hooks;\n view;\n once;\n snapshot;\n /**\n * Whether this sequence errored or was destroyed during this execution, and hooks should no\n * longer run for it.\n */\n erroredOrDestroyed = false;\n /**\n * The value returned by the last hook execution (if any), ready to be pipelined into the next\n * one.\n */\n pipelinedValue = undefined;\n unregisterOnDestroy;\n constructor(impl, hooks, view, once, destroyRef, snapshot = null) {\n this.impl = impl;\n this.hooks = hooks;\n this.view = view;\n this.once = once;\n this.snapshot = snapshot;\n this.unregisterOnDestroy = destroyRef?.onDestroy(() => this.destroy());\n }\n afterRun() {\n this.erroredOrDestroyed = false;\n this.pipelinedValue = undefined;\n // Clear the tracing snapshot after the initial run. This snapshot only\n // associates the initial run of the hook with the context that created it.\n // Follow-up runs are independent of that initial context and have different\n // triggers.\n this.snapshot?.dispose();\n this.snapshot = null;\n }\n destroy() {\n this.impl.unregister(this);\n this.unregisterOnDestroy?.();\n const scheduled = this.view?.[AFTER_RENDER_SEQUENCES_TO_ADD];\n if (scheduled) {\n this.view[AFTER_RENDER_SEQUENCES_TO_ADD] = scheduled.filter((s) => s !== this);\n }\n }\n}\n\nfunction afterEveryRender(callbackOrSpec, options) {\n ngDevMode &&\n assertNotInReactiveContext(afterEveryRender, 'Call `afterEveryRender` outside of a reactive context. For example, schedule the render ' +\n 'callback inside the component constructor`.');\n if (ngDevMode && !options?.injector) {\n assertInInjectionContext(afterEveryRender);\n }\n const injector = options?.injector ?? inject(Injector);\n if (typeof ngServerMode !== 'undefined' && ngServerMode) {\n return NOOP_AFTER_RENDER_REF;\n }\n performanceMarkFeature('NgAfterRender');\n return afterEveryRenderImpl(callbackOrSpec, injector, options, /* once */ false);\n}\nfunction afterNextRender(callbackOrSpec, options) {\n if (ngDevMode && !options?.injector) {\n assertInInjectionContext(afterNextRender);\n }\n const injector = options?.injector ?? inject(Injector);\n if (typeof ngServerMode !== 'undefined' && ngServerMode) {\n return NOOP_AFTER_RENDER_REF;\n }\n performanceMarkFeature('NgAfterNextRender');\n return afterEveryRenderImpl(callbackOrSpec, injector, options, /* once */ true);\n}\nfunction getHooks(callbackOrSpec) {\n if (callbackOrSpec instanceof Function) {\n return [undefined, undefined, /* MixedReadWrite */ callbackOrSpec, undefined];\n }\n else {\n return [\n callbackOrSpec.earlyRead,\n callbackOrSpec.write,\n callbackOrSpec.mixedReadWrite,\n callbackOrSpec.read,\n ];\n }\n}\n/**\n * Shared implementation for `afterEveryRender` and `afterNextRender`.\n */\nfunction afterEveryRenderImpl(callbackOrSpec, injector, options, once) {\n const manager = injector.get(AfterRenderManager);\n // Lazily initialize the handler implementation, if necessary. This is so that it can be\n // tree-shaken if `afterEveryRender` and `afterNextRender` aren't used.\n manager.impl ??= injector.get(AfterRenderImpl);\n const tracing = injector.get(TracingService, null, { optional: true });\n const destroyRef = options?.manualCleanup !== true ? injector.get(DestroyRef) : null;\n const viewContext = injector.get(ViewContext, null, { optional: true });\n const sequence = new AfterRenderSequence(manager.impl, getHooks(callbackOrSpec), viewContext?.view, once, destroyRef, tracing?.snapshot(null));\n manager.impl.register(sequence);\n return sequence;\n}\n/** `AfterRenderRef` that does nothing. */\nconst NOOP_AFTER_RENDER_REF = {\n destroy() { },\n};\n\n/**\n * Calculates a data slot index for defer block info (either static or\n * instance-specific), given an index of a defer instruction.\n */\nfunction getDeferBlockDataIndex(deferBlockIndex) {\n // Instance state is located at the *next* position\n // after the defer block slot in an LView or TView.data.\n return deferBlockIndex + 1;\n}\n/** Retrieves a defer block state from an LView, given a TNode that represents a block. */\nfunction getLDeferBlockDetails(lView, tNode) {\n const tView = lView[TVIEW];\n const slotIndex = getDeferBlockDataIndex(tNode.index);\n ngDevMode && assertIndexInDeclRange(tView, slotIndex);\n return lView[slotIndex];\n}\n/** Stores a defer block instance state in LView. */\nfunction setLDeferBlockDetails(lView, deferBlockIndex, lDetails) {\n const tView = lView[TVIEW];\n const slotIndex = getDeferBlockDataIndex(deferBlockIndex);\n ngDevMode && assertIndexInDeclRange(tView, slotIndex);\n lView[slotIndex] = lDetails;\n}\n/** Retrieves static info about a defer block, given a TView and a TNode that represents a block. */\nfunction getTDeferBlockDetails(tView, tNode) {\n const slotIndex = getDeferBlockDataIndex(tNode.index);\n ngDevMode && assertIndexInDeclRange(tView, slotIndex);\n return tView.data[slotIndex];\n}\n/** Stores a defer block static info in `TView.data`. */\nfunction setTDeferBlockDetails(tView, deferBlockIndex, deferBlockConfig) {\n const slotIndex = getDeferBlockDataIndex(deferBlockIndex);\n ngDevMode && assertIndexInDeclRange(tView, slotIndex);\n tView.data[slotIndex] = deferBlockConfig;\n}\nfunction getTemplateIndexForState(newState, hostLView, tNode) {\n const tView = hostLView[TVIEW];\n const tDetails = getTDeferBlockDetails(tView, tNode);\n switch (newState) {\n case DeferBlockState.Complete:\n return tDetails.primaryTmplIndex;\n case DeferBlockState.Loading:\n return tDetails.loadingTmplIndex;\n case DeferBlockState.Error:\n return tDetails.errorTmplIndex;\n case DeferBlockState.Placeholder:\n return tDetails.placeholderTmplIndex;\n default:\n ngDevMode && throwError(`Unexpected defer block state: ${newState}`);\n return null;\n }\n}\n/**\n * Returns a minimum amount of time that a given state should be rendered for,\n * taking into account `minimum` parameter value. If the `minimum` value is\n * not specified - returns `null`.\n */\nfunction getMinimumDurationForState(tDetails, currentState) {\n if (currentState === DeferBlockState.Placeholder) {\n return tDetails.placeholderBlockConfig?.[MINIMUM_SLOT] ?? null;\n }\n else if (currentState === DeferBlockState.Loading) {\n return tDetails.loadingBlockConfig?.[MINIMUM_SLOT] ?? null;\n }\n return null;\n}\n/** Retrieves the value of the `after` parameter on the @loading block. */\nfunction getLoadingBlockAfter(tDetails) {\n return tDetails.loadingBlockConfig?.[LOADING_AFTER_SLOT] ?? null;\n}\n/**\n * Adds downloaded dependencies into a directive or a pipe registry,\n * making sure that a dependency doesn't yet exist in the registry.\n */\nfunction addDepsToRegistry(currentDeps, newDeps) {\n if (!currentDeps || currentDeps.length === 0) {\n return newDeps;\n }\n const currentDepSet = new Set(currentDeps);\n for (const dep of newDeps) {\n currentDepSet.add(dep);\n }\n // If `currentDeps` is the same length, there were no new deps and can\n // return the original array.\n return currentDeps.length === currentDepSet.size ? currentDeps : Array.from(currentDepSet);\n}\n/** Retrieves a TNode that represents main content of a defer block. */\nfunction getPrimaryBlockTNode(tView, tDetails) {\n const adjustedIndex = tDetails.primaryTmplIndex + HEADER_OFFSET;\n return getTNode(tView, adjustedIndex);\n}\n/**\n * Asserts whether all dependencies for a defer block are loaded.\n * Always run this function (in dev mode) before rendering a defer\n * block in completed state.\n */\nfunction assertDeferredDependenciesLoaded(tDetails) {\n assertEqual(tDetails.loadingState, DeferDependenciesLoadingState.COMPLETE, 'Expecting all deferred dependencies to be loaded.');\n}\n/**\n * Determines if a given value matches the expected structure of a defer block\n *\n * We can safely rely on the primaryTmplIndex because every defer block requires\n * that a primary template exists. All the other template options are optional.\n */\nfunction isTDeferBlockDetails(value) {\n return (value !== null &&\n typeof value === 'object' &&\n typeof value.primaryTmplIndex === 'number');\n}\n/**\n * Whether a given TNode represents a defer block.\n */\nfunction isDeferBlock(tView, tNode) {\n let tDetails = null;\n const slotIndex = getDeferBlockDataIndex(tNode.index);\n // Check if a slot index is in the reasonable range.\n // Note: we do `-1` on the right border, since defer block details are stored\n // in the `n+1` slot, see `getDeferBlockDataIndex` for more info.\n if (HEADER_OFFSET < slotIndex && slotIndex < tView.bindingStartIndex) {\n tDetails = getTDeferBlockDetails(tView, tNode);\n }\n return !!tDetails && isTDeferBlockDetails(tDetails);\n}\n/**\n * Tracks debugging information about a trigger.\n * @param tView TView in which the trigger is declared.\n * @param tNode TNode on which the trigger is declared.\n * @param textRepresentation Text representation of the trigger to be used for debugging purposes.\n */\nfunction trackTriggerForDebugging(tView, tNode, textRepresentation) {\n const tDetails = getTDeferBlockDetails(tView, tNode);\n tDetails.debug ??= {};\n tDetails.debug.triggers ??= new Set();\n tDetails.debug.triggers.add(textRepresentation);\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/**\n * Wrapper for onViewport trigger with angular specific Injector for resolving NgZone instance\n * and creating an IntersectionObserver which can run outside of Angular zone.\n * @param trigger Element that is the trigger.\n * @param callback Callback to be invoked when the trigger comes into the viewport.\n * @param injector Injector that can be used by the trigger to resolve DI tokens.\n */\nfunction onViewportWrapper(trigger, callback, injector) {\n const ngZone = injector.get(NgZone);\n return onViewport(trigger, () => ngZone.run(callback), () => ngZone.runOutsideAngular(() => createIntersectionObserver()));\n}\n/**\n * Helper function to get the LView in which a deferred block's trigger is rendered.\n * @param deferredHostLView LView in which the deferred block is defined.\n * @param deferredTNode TNode defining the deferred block.\n * @param walkUpTimes Number of times to go up in the view hierarchy to find the trigger's view.\n * A negative value means that the trigger is inside the block's placeholder, while an undefined\n * value means that the trigger is in the same LView as the deferred block.\n */\nfunction getTriggerLView(deferredHostLView, deferredTNode, walkUpTimes) {\n // The trigger is in the same view, we don't need to traverse.\n if (walkUpTimes == null) {\n return deferredHostLView;\n }\n // A positive value or zero means that the trigger is in a parent view.\n if (walkUpTimes >= 0) {\n return walkUpViews(walkUpTimes, deferredHostLView);\n }\n // If the value is negative, it means that the trigger is inside the placeholder.\n const deferredContainer = deferredHostLView[deferredTNode.index];\n ngDevMode && assertLContainer(deferredContainer);\n const triggerLView = deferredContainer[CONTAINER_HEADER_OFFSET] ?? null;\n // We need to null check, because the placeholder might not have been rendered yet.\n if (ngDevMode && triggerLView !== null) {\n const lDetails = getLDeferBlockDetails(deferredHostLView, deferredTNode);\n const renderedState = lDetails[DEFER_BLOCK_STATE];\n assertEqual(renderedState, DeferBlockState.Placeholder, 'Expected a placeholder to be rendered in this defer block.');\n assertLView(triggerLView);\n }\n return triggerLView;\n}\n/**\n * Gets the element that a deferred block's trigger is pointing to.\n * @param triggerLView LView in which the trigger is defined.\n * @param triggerIndex Index at which the trigger element should've been rendered.\n */\nfunction getTriggerElement(triggerLView, triggerIndex) {\n const element = getNativeByIndex(HEADER_OFFSET + triggerIndex, triggerLView);\n ngDevMode && assertElement(element);\n return element;\n}\n/**\n * Registers a DOM-node based trigger.\n * @param initialLView LView in which the defer block is rendered.\n * @param tNode TNode representing the defer block.\n * @param triggerIndex Index at which to find the trigger element.\n * @param walkUpTimes Number of times to go up/down in the view hierarchy to find the trigger.\n * @param registerFn Function that will register the DOM events.\n * @param callback Callback to be invoked when the trigger receives the event that should render\n * the deferred block.\n * @param type Trigger type to distinguish between regular and prefetch triggers.\n */\nfunction registerDomTrigger(initialLView, tNode, triggerIndex, walkUpTimes, registerFn, callback, type) {\n const injector = initialLView[INJECTOR];\n const zone = injector.get(NgZone);\n let poll;\n function pollDomTrigger() {\n // If the initial view was destroyed, we don't need to do anything.\n if (isDestroyed(initialLView)) {\n poll.destroy();\n return;\n }\n const lDetails = getLDeferBlockDetails(initialLView, tNode);\n const renderedState = lDetails[DEFER_BLOCK_STATE];\n // If the block was loaded before the trigger was resolved, we don't need to do anything.\n if (renderedState !== DeferBlockInternalState.Initial &&\n renderedState !== DeferBlockState.Placeholder) {\n poll.destroy();\n return;\n }\n const triggerLView = getTriggerLView(initialLView, tNode, walkUpTimes);\n // Keep polling until we resolve the trigger's LView.\n if (!triggerLView) {\n // Keep polling.\n return;\n }\n poll.destroy();\n // It's possible that the trigger's view was destroyed before we resolved the trigger element.\n if (isDestroyed(triggerLView)) {\n return;\n }\n const element = getTriggerElement(triggerLView, triggerIndex);\n const cleanup = registerFn(element, () => {\n // `pollDomTrigger` runs outside the zone (because of `afterNextRender`) and registers its\n // listeners outside the zone, so we jump back into the zone prior to running the callback.\n zone.run(() => {\n if (initialLView !== triggerLView) {\n removeLViewOnDestroy(triggerLView, cleanup);\n }\n callback();\n });\n }, injector);\n // The trigger and deferred block might be in different LViews.\n // For the main LView the cleanup would happen as a part of\n // `storeTriggerCleanupFn` logic. For trigger LView we register\n // a cleanup function there to remove event handlers in case an\n // LView gets destroyed before a trigger is invoked.\n if (initialLView !== triggerLView) {\n storeLViewOnDestroy(triggerLView, cleanup);\n }\n storeTriggerCleanupFn(type, lDetails, cleanup);\n }\n // Begin polling for the trigger.\n poll = afterEveryRender({ read: pollDomTrigger }, { injector });\n}\n\n/**\n * Helper function to schedule a callback to be invoked when a browser becomes idle.\n *\n * @param callback A function to be invoked when a browser becomes idle.\n * @param injector injector for the app\n */\nfunction onIdle(callback, injector) {\n const scheduler = injector.get(IdleScheduler);\n const cleanupFn = () => scheduler.remove(callback);\n scheduler.add(callback);\n return cleanupFn;\n}\n/**\n * Use shims for the `requestIdleCallback` and `cancelIdleCallback` functions for\n * environments where those functions are not available (e.g. Node.js and Safari).\n *\n * Note: we wrap the `requestIdleCallback` call into a function, so that it can be\n * overridden/mocked in test environment and picked up by the runtime code.\n */\nconst _requestIdleCallback = () => typeof requestIdleCallback !== 'undefined' ? requestIdleCallback : setTimeout;\nconst _cancelIdleCallback = () => typeof requestIdleCallback !== 'undefined' ? cancelIdleCallback : clearTimeout;\n/**\n * Helper service to schedule `requestIdleCallback`s for batches of defer blocks,\n * to avoid calling `requestIdleCallback` for each defer block (e.g. if\n * defer blocks are defined inside a for loop).\n */\nclass IdleScheduler {\n // Indicates whether current callbacks are being invoked.\n executingCallbacks = false;\n // Currently scheduled idle callback id.\n idleId = null;\n // Set of callbacks to be invoked next.\n current = new Set();\n // Set of callbacks collected while invoking current set of callbacks.\n // Those callbacks are scheduled for the next idle period.\n deferred = new Set();\n ngZone = inject(NgZone);\n requestIdleCallbackFn = _requestIdleCallback().bind(globalThis);\n cancelIdleCallbackFn = _cancelIdleCallback().bind(globalThis);\n add(callback) {\n const target = this.executingCallbacks ? this.deferred : this.current;\n target.add(callback);\n if (this.idleId === null) {\n this.scheduleIdleCallback();\n }\n }\n remove(callback) {\n const { current, deferred } = this;\n current.delete(callback);\n deferred.delete(callback);\n // If the last callback was removed and there is a pending\n // idle callback - cancel it.\n if (current.size === 0 && deferred.size === 0) {\n this.cancelIdleCallback();\n }\n }\n scheduleIdleCallback() {\n const callback = () => {\n this.cancelIdleCallback();\n this.executingCallbacks = true;\n for (const callback of this.current) {\n callback();\n }\n this.current.clear();\n this.executingCallbacks = false;\n // If there are any callbacks added during an invocation\n // of the current ones - make them \"current\" and schedule\n // a new idle callback.\n if (this.deferred.size > 0) {\n for (const callback of this.deferred) {\n this.current.add(callback);\n }\n this.deferred.clear();\n this.scheduleIdleCallback();\n }\n };\n // Ensure that the callback runs in the NgZone since\n // the `requestIdleCallback` is not currently patched by Zone.js.\n this.idleId = this.requestIdleCallbackFn(() => this.ngZone.run(callback));\n }\n cancelIdleCallback() {\n if (this.idleId !== null) {\n this.cancelIdleCallbackFn(this.idleId);\n this.idleId = null;\n }\n }\n ngOnDestroy() {\n this.cancelIdleCallback();\n this.current.clear();\n this.deferred.clear();\n }\n /** @nocollapse */\n static ɵprov = /** @pureOrBreakMyCode */ /* @__PURE__ */ __defineInjectable({\n token: IdleScheduler,\n providedIn: 'root',\n factory: () => new IdleScheduler(),\n });\n}\n\n/**\n * Returns a function that captures a provided delay.\n * Invoking the returned function schedules a trigger.\n */\nfunction onTimer(delay) {\n return (callback, injector) => scheduleTimerTrigger(delay, callback, injector);\n}\n/**\n * Schedules a callback to be invoked after a given timeout.\n *\n * @param delay A number of ms to wait until firing a callback.\n * @param callback A function to be invoked after a timeout.\n * @param injector injector for the app.\n */\nfunction scheduleTimerTrigger(delay, callback, injector) {\n const scheduler = injector.get(TimerScheduler);\n const ngZone = injector.get(NgZone);\n const cleanupFn = () => scheduler.remove(callback);\n scheduler.add(delay, callback, ngZone);\n return cleanupFn;\n}\n/**\n * Helper service to schedule `setTimeout`s for batches of defer blocks,\n * to avoid calling `setTimeout` for each defer block (e.g. if defer blocks\n * are created inside a for loop).\n */\nclass TimerScheduler {\n // Indicates whether current callbacks are being invoked.\n executingCallbacks = false;\n // Currently scheduled `setTimeout` id.\n timeoutId = null;\n // When currently scheduled timer would fire.\n invokeTimerAt = null;\n // List of callbacks to be invoked.\n // For each callback we also store a timestamp on when the callback\n // should be invoked. We store timestamps and callback functions\n // in a flat array to avoid creating new objects for each entry.\n // [timestamp1, callback1, timestamp2, callback2, ...]\n current = [];\n // List of callbacks collected while invoking current set of callbacks.\n // Those callbacks are added to the \"current\" queue at the end of\n // the current callback invocation. The shape of this list is the same\n // as the shape of the `current` list.\n deferred = [];\n add(delay, callback, ngZone) {\n const target = this.executingCallbacks ? this.deferred : this.current;\n this.addToQueue(target, Date.now() + delay, callback);\n this.scheduleTimer(ngZone);\n }\n remove(callback) {\n const { current, deferred } = this;\n const callbackIndex = this.removeFromQueue(current, callback);\n if (callbackIndex === -1) {\n // Try cleaning up deferred queue only in case\n // we didn't find a callback in the \"current\" queue.\n this.removeFromQueue(deferred, callback);\n }\n // If the last callback was removed and there is a pending timeout - cancel it.\n if (current.length === 0 && deferred.length === 0) {\n this.clearTimeout();\n }\n }\n addToQueue(target, invokeAt, callback) {\n let insertAtIndex = target.length;\n for (let i = 0; i < target.length; i += 2) {\n const invokeQueuedCallbackAt = target[i];\n if (invokeQueuedCallbackAt > invokeAt) {\n // We've reached a first timer that is scheduled\n // for a later time than what we are trying to insert.\n // This is the location at which we need to insert,\n // no need to iterate further.\n insertAtIndex = i;\n break;\n }\n }\n arrayInsert2(target, insertAtIndex, invokeAt, callback);\n }\n removeFromQueue(target, callback) {\n let index = -1;\n for (let i = 0; i < target.length; i += 2) {\n const queuedCallback = target[i + 1];\n if (queuedCallback === callback) {\n index = i;\n break;\n }\n }\n if (index > -1) {\n // Remove 2 elements: a timestamp slot and\n // the following slot with a callback function.\n arraySplice(target, index, 2);\n }\n return index;\n }\n scheduleTimer(ngZone) {\n const callback = () => {\n this.clearTimeout();\n this.executingCallbacks = true;\n // Clone the current state of the queue, since it might be altered\n // as we invoke callbacks.\n const current = [...this.current];\n // Invoke callbacks that were scheduled to run before the current time.\n const now = Date.now();\n for (let i = 0; i < current.length; i += 2) {\n const invokeAt = current[i];\n const callback = current[i + 1];\n if (invokeAt <= now) {\n callback();\n }\n else {\n // We've reached a timer that should not be invoked yet.\n break;\n }\n }\n // The state of the queue might've changed after callbacks invocation,\n // run the cleanup logic based on the *current* state of the queue.\n let lastCallbackIndex = -1;\n for (let i = 0; i < this.current.length; i += 2) {\n const invokeAt = this.current[i];\n if (invokeAt <= now) {\n // Add +1 to account for a callback function that\n // goes after the timestamp in events array.\n lastCallbackIndex = i + 1;\n }\n else {\n // We've reached a timer that should not be invoked yet.\n break;\n }\n }\n if (lastCallbackIndex >= 0) {\n arraySplice(this.current, 0, lastCallbackIndex + 1);\n }\n this.executingCallbacks = false;\n // If there are any callbacks added during an invocation\n // of the current ones - move them over to the \"current\"\n // queue.\n if (this.deferred.length > 0) {\n for (let i = 0; i < this.deferred.length; i += 2) {\n const invokeAt = this.deferred[i];\n const callback = this.deferred[i + 1];\n this.addToQueue(this.current, invokeAt, callback);\n }\n this.deferred.length = 0;\n }\n this.scheduleTimer(ngZone);\n };\n // Avoid running timer callbacks more than once per\n // average frame duration. This is needed for better\n // batching and to avoid kicking off excessive change\n // detection cycles.\n const FRAME_DURATION_MS = 16; // 1000ms / 60fps\n if (this.current.length > 0) {\n const now = Date.now();\n // First element in the queue points at the timestamp\n // of the first (earliest) event.\n const invokeAt = this.current[0];\n if (this.timeoutId === null ||\n // Reschedule a timer in case a queue contains an item with\n // an earlier timestamp and the delta is more than an average\n // frame duration.\n (this.invokeTimerAt && this.invokeTimerAt - invokeAt > FRAME_DURATION_MS)) {\n // There was a timeout already, but an earlier event was added\n // into the queue. In this case we drop an old timer and setup\n // a new one with an updated (smaller) timeout.\n this.clearTimeout();\n const timeout = Math.max(invokeAt - now, FRAME_DURATION_MS);\n this.invokeTimerAt = invokeAt;\n this.timeoutId = ngZone.runOutsideAngular(() => {\n return setTimeout(() => ngZone.run(callback), timeout);\n });\n }\n }\n }\n clearTimeout() {\n if (this.timeoutId !== null) {\n clearTimeout(this.timeoutId);\n this.timeoutId = null;\n }\n }\n ngOnDestroy() {\n this.clearTimeout();\n this.current.length = 0;\n this.deferred.length = 0;\n }\n /** @nocollapse */\n static ɵprov = /** @pureOrBreakMyCode */ /* @__PURE__ */ __defineInjectable({\n token: TimerScheduler,\n providedIn: 'root',\n factory: () => new TimerScheduler(),\n });\n}\n\n/**\n * A service used by the framework to create and cache injector instances.\n *\n * This service is used to create a single injector instance for each defer\n * block definition, to avoid creating an injector for each defer block instance\n * of a certain type.\n */\nclass CachedInjectorService {\n cachedInjectors = new Map();\n getOrCreateInjector(key, parentInjector, providers, debugName) {\n if (!this.cachedInjectors.has(key)) {\n const injector = providers.length > 0\n ? createEnvironmentInjector(providers, parentInjector, debugName)\n : null;\n this.cachedInjectors.set(key, injector);\n }\n return this.cachedInjectors.get(key);\n }\n ngOnDestroy() {\n try {\n for (const injector of this.cachedInjectors.values()) {\n if (injector !== null) {\n injector.destroy();\n }\n }\n }\n finally {\n this.cachedInjectors.clear();\n }\n }\n /** @nocollapse */\n static ɵprov = /** @pureOrBreakMyCode */ /* @__PURE__ */ __defineInjectable({\n token: CachedInjectorService,\n providedIn: 'environment',\n factory: () => new CachedInjectorService(),\n });\n}\n\n/**\n * **INTERNAL**, avoid referencing it in application code.\n * *\n * Injector token that allows to provide `DeferBlockDependencyInterceptor` class\n * implementation.\n *\n * This token is only injected in devMode\n */\nconst DEFER_BLOCK_DEPENDENCY_INTERCEPTOR = \n/* @__PURE__ */ new InjectionToken('DEFER_BLOCK_DEPENDENCY_INTERCEPTOR');\n/**\n * **INTERNAL**, token used for configuring defer block behavior.\n */\nconst DEFER_BLOCK_CONFIG = new InjectionToken(ngDevMode ? 'DEFER_BLOCK_CONFIG' : '');\n/**\n * Checks whether there is a cached injector associated with a given defer block\n * declaration and returns if it exists. If there is no cached injector present -\n * creates a new injector and stores in the cache.\n */\nfunction getOrCreateEnvironmentInjector(parentInjector, tDetails, providers) {\n return parentInjector\n .get(CachedInjectorService)\n .getOrCreateInjector(tDetails, parentInjector, providers, ngDevMode ? 'DeferBlock Injector' : '');\n}\n/** Injector Helpers */\n/**\n * Creates a new injector, which contains providers collected from dependencies (NgModules) of\n * defer-loaded components. This function detects different types of parent injectors and creates\n * a new injector based on that.\n */\nfunction createDeferBlockInjector(parentInjector, tDetails, providers) {\n // Check if the parent injector is an instance of a `ChainedInjector`.\n //\n // In this case, we retain the shape of the injector and use a newly created\n // `EnvironmentInjector` as a parent in the `ChainedInjector`. That is needed to\n // make sure that the primary injector gets consulted first (since it's typically\n // a NodeInjector) and `EnvironmentInjector` tree is consulted after that.\n if (parentInjector instanceof ChainedInjector) {\n const origInjector = parentInjector.injector;\n // Guaranteed to be an environment injector\n const parentEnvInjector = parentInjector.parentInjector;\n const envInjector = getOrCreateEnvironmentInjector(parentEnvInjector, tDetails, providers);\n return new ChainedInjector(origInjector, envInjector);\n }\n const parentEnvInjector = parentInjector.get(EnvironmentInjector);\n // If the `parentInjector` is *not* an `EnvironmentInjector` - we need to create\n // a new `ChainedInjector` with the following setup:\n //\n // - the provided `parentInjector` becomes a primary injector\n // - an existing (real) `EnvironmentInjector` becomes a parent injector for\n // a newly-created one, which contains extra providers\n //\n // So the final order in which injectors would be consulted in this case would look like this:\n //\n // 1. Provided `parentInjector`\n // 2. Newly-created `EnvironmentInjector` with extra providers\n // 3. `EnvironmentInjector` from the `parentInjector`\n if (parentEnvInjector !== parentInjector) {\n const envInjector = getOrCreateEnvironmentInjector(parentEnvInjector, tDetails, providers);\n return new ChainedInjector(parentInjector, envInjector);\n }\n // The `parentInjector` is an instance of an `EnvironmentInjector`.\n // No need for special handling, we can use `parentInjector` as a\n // parent injector directly.\n return getOrCreateEnvironmentInjector(parentInjector, tDetails, providers);\n}\n/** Rendering Helpers */\n/**\n * Transitions a defer block to the new state. Updates the necessary\n * data structures and renders corresponding block.\n *\n * @param newState New state that should be applied to the defer block.\n * @param tNode TNode that represents a defer block.\n * @param lContainer Represents an instance of a defer block.\n * @param skipTimerScheduling Indicates that `@loading` and `@placeholder` block\n * should be rendered immediately, even if they have `after` or `minimum` config\n * options setup. This flag to needed for testing APIs to transition defer block\n * between states via `DeferFixture.render` method.\n */\nfunction renderDeferBlockState(newState, tNode, lContainer, skipTimerScheduling = false) {\n const hostLView = lContainer[PARENT];\n const hostTView = hostLView[TVIEW];\n // Check if this view is not destroyed. Since the loading process was async,\n // the view might end up being destroyed by the time rendering happens.\n if (isDestroyed(hostLView))\n return;\n // Make sure this TNode belongs to TView that represents host LView.\n ngDevMode && assertTNodeForLView(tNode, hostLView);\n const lDetails = getLDeferBlockDetails(hostLView, tNode);\n ngDevMode && assertDefined(lDetails, 'Expected a defer block state defined');\n const currentState = lDetails[DEFER_BLOCK_STATE];\n const ssrState = lDetails[SSR_BLOCK_STATE];\n if (ssrState !== null && newState < ssrState) {\n return; // trying to render a previous state, exit\n }\n if (isValidStateChange(currentState, newState) &&\n isValidStateChange(lDetails[NEXT_DEFER_BLOCK_STATE] ?? -1, newState)) {\n const tDetails = getTDeferBlockDetails(hostTView, tNode);\n // Skips scheduling on the server since it can delay the server response.\n const needsScheduling = !skipTimerScheduling &&\n (typeof ngServerMode === 'undefined' || !ngServerMode) &&\n (getLoadingBlockAfter(tDetails) !== null ||\n getMinimumDurationForState(tDetails, DeferBlockState.Loading) !== null ||\n getMinimumDurationForState(tDetails, DeferBlockState.Placeholder));\n if (ngDevMode && needsScheduling) {\n assertDefined(applyDeferBlockStateWithSchedulingImpl, 'Expected scheduling function to be defined');\n }\n const applyStateFn = needsScheduling\n ? applyDeferBlockStateWithSchedulingImpl\n : applyDeferBlockState;\n try {\n applyStateFn(newState, lDetails, lContainer, tNode, hostLView);\n }\n catch (error) {\n handleUncaughtError(hostLView, error);\n }\n }\n}\nfunction findMatchingDehydratedViewForDeferBlock(lContainer, lDetails) {\n const dehydratedViewIx = lContainer[DEHYDRATED_VIEWS]?.findIndex((view) => view.data[DEFER_BLOCK_STATE$1] === lDetails[DEFER_BLOCK_STATE]) ?? -1;\n const dehydratedView = dehydratedViewIx > -1 ? lContainer[DEHYDRATED_VIEWS][dehydratedViewIx] : null;\n return { dehydratedView, dehydratedViewIx };\n}\n/**\n * Applies changes to the DOM to reflect a given state.\n */\nfunction applyDeferBlockState(newState, lDetails, lContainer, tNode, hostLView) {\n profiler(20 /* ProfilerEvent.DeferBlockStateStart */);\n const stateTmplIndex = getTemplateIndexForState(newState, hostLView, tNode);\n if (stateTmplIndex !== null) {\n lDetails[DEFER_BLOCK_STATE] = newState;\n const hostTView = hostLView[TVIEW];\n const adjustedIndex = stateTmplIndex + HEADER_OFFSET;\n // The TNode that represents a template that will activated in the defer block\n const activeBlockTNode = getTNode(hostTView, adjustedIndex);\n // There is only 1 view that can be present in an LContainer that\n // represents a defer block, so always refer to the first one.\n const viewIndex = 0;\n removeLViewFromLContainer(lContainer, viewIndex);\n let injector;\n if (newState === DeferBlockState.Complete) {\n // When we render a defer block in completed state, there might be\n // newly loaded standalone components used within the block, which may\n // import NgModules with providers. In order to make those providers\n // available for components declared in that NgModule, we create an instance\n // of an environment injector to host those providers and pass this injector\n // to the logic that creates a view.\n const tDetails = getTDeferBlockDetails(hostTView, tNode);\n const providers = tDetails.providers;\n if (providers && providers.length > 0) {\n injector = createDeferBlockInjector(hostLView[INJECTOR], tDetails, providers);\n }\n }\n const { dehydratedView, dehydratedViewIx } = findMatchingDehydratedViewForDeferBlock(lContainer, lDetails);\n const embeddedLView = createAndRenderEmbeddedLView(hostLView, activeBlockTNode, null, {\n injector,\n dehydratedView,\n });\n addLViewToLContainer(lContainer, embeddedLView, viewIndex, shouldAddViewToDom(activeBlockTNode, dehydratedView));\n markViewDirty(embeddedLView, 2 /* NotificationSource.DeferBlockStateUpdate */);\n if (dehydratedViewIx > -1) {\n // Erase dehydrated view info in a given LContainer, so that the view is not\n // removed later by post-hydration cleanup process (which iterates over all\n // dehydrated views in component tree). This clears only the dehydrated view\n // that was found for this render, which in most cases will be the only view.\n // In the case that there was control flow that changed, there may be either\n // more than one or the views would not match up due to the server rendered\n // content being a different branch of the control flow.\n lContainer[DEHYDRATED_VIEWS]?.splice(dehydratedViewIx, 1);\n }\n if ((newState === DeferBlockState.Complete || newState === DeferBlockState.Error) &&\n Array.isArray(lDetails[ON_COMPLETE_FNS])) {\n for (const callback of lDetails[ON_COMPLETE_FNS]) {\n callback();\n }\n lDetails[ON_COMPLETE_FNS] = null;\n }\n }\n profiler(21 /* ProfilerEvent.DeferBlockStateEnd */);\n}\n/**\n * Extends the `applyDeferBlockState` with timer-based scheduling.\n * This function becomes available on a page if there are defer blocks\n * that use `after` or `minimum` parameters in the `@loading` or\n * `@placeholder` blocks.\n */\nfunction applyDeferBlockStateWithScheduling(newState, lDetails, lContainer, tNode, hostLView) {\n const now = Date.now();\n const hostTView = hostLView[TVIEW];\n const tDetails = getTDeferBlockDetails(hostTView, tNode);\n if (lDetails[STATE_IS_FROZEN_UNTIL] === null || lDetails[STATE_IS_FROZEN_UNTIL] <= now) {\n lDetails[STATE_IS_FROZEN_UNTIL] = null;\n const loadingAfter = getLoadingBlockAfter(tDetails);\n const inLoadingAfterPhase = lDetails[LOADING_AFTER_CLEANUP_FN] !== null;\n if (newState === DeferBlockState.Loading && loadingAfter !== null && !inLoadingAfterPhase) {\n // Trying to render loading, but it has an `after` config,\n // so schedule an update action after a timeout.\n lDetails[NEXT_DEFER_BLOCK_STATE] = newState;\n const cleanupFn = scheduleDeferBlockUpdate(loadingAfter, lDetails, tNode, lContainer, hostLView);\n lDetails[LOADING_AFTER_CLEANUP_FN] = cleanupFn;\n }\n else {\n // If we transition to a complete or an error state and there is a pending\n // operation to render loading after a timeout - invoke a cleanup operation,\n // which stops the timer.\n if (newState > DeferBlockState.Loading && inLoadingAfterPhase) {\n lDetails[LOADING_AFTER_CLEANUP_FN]();\n lDetails[LOADING_AFTER_CLEANUP_FN] = null;\n lDetails[NEXT_DEFER_BLOCK_STATE] = null;\n }\n applyDeferBlockState(newState, lDetails, lContainer, tNode, hostLView);\n const duration = getMinimumDurationForState(tDetails, newState);\n if (duration !== null) {\n lDetails[STATE_IS_FROZEN_UNTIL] = now + duration;\n scheduleDeferBlockUpdate(duration, lDetails, tNode, lContainer, hostLView);\n }\n }\n }\n else {\n // We are still rendering the previous state.\n // Update the `NEXT_DEFER_BLOCK_STATE`, which would be\n // picked up once it's time to transition to the next state.\n lDetails[NEXT_DEFER_BLOCK_STATE] = newState;\n }\n}\n/**\n * Schedules an update operation after a specified timeout.\n */\nfunction scheduleDeferBlockUpdate(timeout, lDetails, tNode, lContainer, hostLView) {\n const callback = () => {\n const nextState = lDetails[NEXT_DEFER_BLOCK_STATE];\n lDetails[STATE_IS_FROZEN_UNTIL] = null;\n lDetails[NEXT_DEFER_BLOCK_STATE] = null;\n if (nextState !== null) {\n renderDeferBlockState(nextState, tNode, lContainer);\n }\n };\n return scheduleTimerTrigger(timeout, callback, hostLView[INJECTOR]);\n}\n/**\n * Checks whether we can transition to the next state.\n *\n * We transition to the next state if the previous state was represented\n * with a number that is less than the next state. For example, if the current\n * state is \"loading\" (represented as `1`), we should not show a placeholder\n * (represented as `0`), but we can show a completed state (represented as `2`)\n * or an error state (represented as `3`).\n */\nfunction isValidStateChange(currentState, newState) {\n return currentState < newState;\n}\n/** Utility function to render placeholder content (if present) */\nfunction renderPlaceholder(lView, tNode) {\n const lContainer = lView[tNode.index];\n ngDevMode && assertLContainer(lContainer);\n renderDeferBlockState(DeferBlockState.Placeholder, tNode, lContainer);\n}\n/**\n * Subscribes to the \"loading\" Promise and renders corresponding defer sub-block,\n * based on the loading results.\n *\n * @param lContainer Represents an instance of a defer block.\n * @param tNode Represents defer block info shared across all instances.\n */\nfunction renderDeferStateAfterResourceLoading(tDetails, tNode, lContainer) {\n ngDevMode &&\n assertDefined(tDetails.loadingPromise, 'Expected loading Promise to exist on this defer block');\n tDetails.loadingPromise.then(() => {\n if (tDetails.loadingState === DeferDependenciesLoadingState.COMPLETE) {\n ngDevMode && assertDeferredDependenciesLoaded(tDetails);\n // Everything is loaded, show the primary block content\n renderDeferBlockState(DeferBlockState.Complete, tNode, lContainer);\n }\n else if (tDetails.loadingState === DeferDependenciesLoadingState.FAILED) {\n renderDeferBlockState(DeferBlockState.Error, tNode, lContainer);\n }\n });\n}\n/**\n * Reference to the timer-based scheduler implementation of defer block state\n * rendering method. It's used to make timer-based scheduling tree-shakable.\n * If `minimum` or `after` parameters are used, compiler generates an extra\n * argument for the `ɵɵdefer` instruction, which references a timer-based\n * implementation.\n */\nlet applyDeferBlockStateWithSchedulingImpl = null;\n/**\n * Enables timer-related scheduling if `after` or `minimum` parameters are setup\n * on the `@loading` or `@placeholder` blocks.\n */\nfunction ɵɵdeferEnableTimerScheduling(tView, tDetails, placeholderConfigIndex, loadingConfigIndex) {\n const tViewConsts = tView.consts;\n if (placeholderConfigIndex != null) {\n tDetails.placeholderBlockConfig = getConstant(tViewConsts, placeholderConfigIndex);\n }\n if (loadingConfigIndex != null) {\n tDetails.loadingBlockConfig = getConstant(tViewConsts, loadingConfigIndex);\n }\n // Enable implementation that supports timer-based scheduling.\n if (applyDeferBlockStateWithSchedulingImpl === null) {\n applyDeferBlockStateWithSchedulingImpl = applyDeferBlockStateWithScheduling;\n }\n}\n\n/**\n * The name of a field that Angular monkey-patches onto a component\n * class to store a function that loads defer-loadable dependencies\n * and applies metadata to a class.\n */\nconst ASYNC_COMPONENT_METADATA_FN = '__ngAsyncComponentMetadataFn__';\n/**\n * If a given component has unresolved async metadata - returns a reference\n * to a function that applies component metadata after resolving defer-loadable\n * dependencies. Otherwise - this function returns `null`.\n */\nfunction getAsyncClassMetadataFn(type) {\n const componentClass = type; // cast to `any`, so that we can read a monkey-patched field\n return componentClass[ASYNC_COMPONENT_METADATA_FN] ?? null;\n}\n/**\n * Handles the process of applying metadata info to a component class in case\n * component template has defer blocks (thus some dependencies became deferrable).\n *\n * @param type Component class where metadata should be added\n * @param dependencyLoaderFn Function that loads dependencies\n * @param metadataSetterFn Function that forms a scope in which the `setClassMetadata` is invoked\n */\nfunction setClassMetadataAsync(type, dependencyLoaderFn, metadataSetterFn) {\n const componentClass = type; // cast to `any`, so that we can monkey-patch it\n componentClass[ASYNC_COMPONENT_METADATA_FN] = () => Promise.all(dependencyLoaderFn()).then((dependencies) => {\n metadataSetterFn(...dependencies);\n // Metadata is now set, reset field value to indicate that this component\n // can by used/compiled synchronously.\n componentClass[ASYNC_COMPONENT_METADATA_FN] = null;\n return dependencies;\n });\n return componentClass[ASYNC_COMPONENT_METADATA_FN];\n}\n/**\n * Adds decorator, constructor, and property metadata to a given type via static metadata fields\n * on the type.\n *\n * These metadata fields can later be read with Angular's `ReflectionCapabilities` API.\n *\n * Calls to `setClassMetadata` can be guarded by ngDevMode, resulting in the metadata assignments\n * being tree-shaken away during production builds.\n */\nfunction setClassMetadata(type, decorators, ctorParameters, propDecorators) {\n return noSideEffects(() => {\n const clazz = type;\n if (decorators !== null) {\n if (clazz.hasOwnProperty('decorators') && clazz.decorators !== undefined) {\n clazz.decorators.push(...decorators);\n }\n else {\n clazz.decorators = decorators;\n }\n }\n if (ctorParameters !== null) {\n // Rather than merging, clobber the existing parameters. If other projects exist which\n // use tsickle-style annotations and reflect over them in the same way, this could\n // cause issues, but that is vanishingly unlikely.\n clazz.ctorParameters = ctorParameters;\n }\n if (propDecorators !== null) {\n // The property decorator objects are merged as it is possible different fields have\n // different decorator types. Decorators on individual fields are not merged, as it's\n // also incredibly unlikely that a field will be decorated both with an Angular\n // decorator and a non-Angular decorator that's also been downleveled.\n if (clazz.hasOwnProperty('propDecorators') && clazz.propDecorators !== undefined) {\n clazz.propDecorators = { ...clazz.propDecorators, ...propDecorators };\n }\n else {\n clazz.propDecorators = propDecorators;\n }\n }\n });\n}\n\nclass Console {\n log(message) {\n // tslint:disable-next-line:no-console\n console.log(message);\n }\n // Note: for reporting errors use `DOM.logError()` as it is platform specific\n warn(message) {\n console.warn(message);\n }\n static ɵfac = function Console_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || Console)(); };\n static ɵprov = /*@__PURE__*/ __defineInjectable({ token: Console, factory: Console.ɵfac, providedIn: 'platform' });\n}\n(() => { (typeof ngDevMode === \"undefined\" || ngDevMode) && setClassMetadata(Console, [{\n type: Injectable,\n args: [{ providedIn: 'platform' }]\n }], null, null); })();\n\n/**\n * These are the data structures that our framework injector profiler will fill with data in order\n * to support DI debugging APIs.\n *\n * resolverToTokenToDependencies: Maps an injector to a Map of tokens to an Array of\n * dependencies. Injector -> Token -> Dependencies This is used to support the\n * getDependenciesFromInjectable API, which takes in an injector and a token and returns it's\n * dependencies.\n *\n * resolverToProviders: Maps a DI resolver (an Injector or a TNode) to the providers configured\n * within it This is used to support the getInjectorProviders API, which takes in an injector and\n * returns the providers that it was configured with. Note that for the element injector case we\n * use the TNode instead of the LView as the DI resolver. This is because the registration of\n * providers happens only once per type of TNode. If an injector is created with an identical TNode,\n * the providers for that injector will not be reconfigured.\n *\n * standaloneInjectorToComponent: Maps the injector of a standalone component to the standalone\n * component that it is associated with. Used in the getInjectorProviders API, specificially in the\n * discovery of import paths for each provider. This is necessary because the imports array of a\n * standalone component is processed and configured in its standalone injector, but exists within\n * the component's definition. Because getInjectorProviders takes in an injector, if that injector\n * is the injector of a standalone component, we need to be able to discover the place where the\n * imports array is located (the component) in order to flatten the imports array within it to\n * discover all of it's providers.\n *\n *\n * All of these data structures are instantiated with WeakMaps. This will ensure that the presence\n * of any object in the keys of these maps does not prevent the garbage collector from collecting\n * those objects. Because of this property of WeakMaps, these data structures will never be the\n * source of a memory leak.\n *\n * An example of this advantage: When components are destroyed, we don't need to do\n * any additional work to remove that component from our mappings.\n *\n */\nclass DIDebugData {\n resolverToTokenToDependencies = new WeakMap();\n resolverToProviders = new WeakMap();\n resolverToEffects = new WeakMap();\n standaloneInjectorToComponent = new WeakMap();\n reset() {\n this.resolverToTokenToDependencies = new WeakMap();\n this.resolverToProviders = new WeakMap();\n this.standaloneInjectorToComponent = new WeakMap();\n }\n}\nlet frameworkDIDebugData = new DIDebugData();\nfunction getFrameworkDIDebugData() {\n return frameworkDIDebugData;\n}\n/**\n * Initalize default handling of injector events. This handling parses events\n * as they are emitted and constructs the data structures necessary to support\n * some of debug APIs.\n *\n * See handleInjectEvent, handleCreateEvent and handleProviderConfiguredEvent\n * for descriptions of each handler\n *\n * Supported APIs:\n * - getDependenciesFromInjectable\n * - getInjectorProviders\n */\nfunction setupFrameworkInjectorProfiler() {\n frameworkDIDebugData.reset();\n setInjectorProfiler(injectorProfilerEventHandler);\n}\nfunction injectorProfilerEventHandler(injectorProfilerEvent) {\n const { context, type } = injectorProfilerEvent;\n if (type === 0 /* InjectorProfilerEventType.Inject */) {\n handleInjectEvent(context, injectorProfilerEvent.service);\n }\n else if (type === 1 /* InjectorProfilerEventType.InstanceCreatedByInjector */) {\n handleInstanceCreatedByInjectorEvent(context, injectorProfilerEvent.instance);\n }\n else if (type === 2 /* InjectorProfilerEventType.ProviderConfigured */) {\n handleProviderConfiguredEvent(context, injectorProfilerEvent.providerRecord);\n }\n else if (type === 3 /* InjectorProfilerEventType.EffectCreated */) {\n handleEffectCreatedEvent(context, injectorProfilerEvent.effect);\n }\n}\nfunction handleEffectCreatedEvent(context, effect) {\n const diResolver = getDIResolver(context.injector);\n if (diResolver === null) {\n throwError('An EffectCreated event must be run within an injection context.');\n }\n const { resolverToEffects } = frameworkDIDebugData;\n if (!resolverToEffects.has(diResolver)) {\n resolverToEffects.set(diResolver, []);\n }\n resolverToEffects.get(diResolver).push(effect);\n}\n/**\n *\n * Stores the injected service in frameworkDIDebugData.resolverToTokenToDependencies\n * based on it's injector and token.\n *\n * @param context InjectorProfilerContext the injection context that this event occurred in.\n * @param data InjectedService the service associated with this inject event.\n *\n */\nfunction handleInjectEvent(context, data) {\n const diResolver = getDIResolver(context.injector);\n if (diResolver === null) {\n throwError('An Inject event must be run within an injection context.');\n }\n const diResolverToInstantiatedToken = frameworkDIDebugData.resolverToTokenToDependencies;\n if (!diResolverToInstantiatedToken.has(diResolver)) {\n diResolverToInstantiatedToken.set(diResolver, new WeakMap());\n }\n // if token is a primitive type, ignore this event. We do this because we cannot keep track of\n // non-primitive tokens in WeakMaps since they are not garbage collectable.\n if (!canBeHeldWeakly(context.token)) {\n return;\n }\n const instantiatedTokenToDependencies = diResolverToInstantiatedToken.get(diResolver);\n if (!instantiatedTokenToDependencies.has(context.token)) {\n instantiatedTokenToDependencies.set(context.token, []);\n }\n const { token, value, flags } = data;\n assertDefined(context.token, 'Injector profiler context token is undefined.');\n const dependencies = instantiatedTokenToDependencies.get(context.token);\n assertDefined(dependencies, 'Could not resolve dependencies for token.');\n if (context.injector instanceof NodeInjector) {\n dependencies.push({ token, value, flags, injectedIn: getNodeInjectorContext(context.injector) });\n }\n else {\n dependencies.push({ token, value, flags });\n }\n}\n/**\n *\n * Returns the LView and TNode associated with a NodeInjector. Returns undefined if the injector\n * is not a NodeInjector.\n *\n * @param injector\n * @returns {lView: LView, tNode: TNode}|undefined\n */\nfunction getNodeInjectorContext(injector) {\n if (!(injector instanceof NodeInjector)) {\n throwError('getNodeInjectorContext must be called with a NodeInjector');\n }\n const lView = getNodeInjectorLView(injector);\n const tNode = getNodeInjectorTNode(injector);\n if (tNode === null) {\n return;\n }\n assertTNodeForLView(tNode, lView);\n return { lView, tNode };\n}\n/**\n *\n * If the created instance is an instance of a standalone component, maps the injector to that\n * standalone component in frameworkDIDebugData.standaloneInjectorToComponent\n *\n * @param context InjectorProfilerContext the injection context that this event occurred in.\n * @param data InjectorCreatedInstance an object containing the instance that was just created\n *\n */\nfunction handleInstanceCreatedByInjectorEvent(context, data) {\n const { value } = data;\n // It might happen that a DI token is requested but there is no corresponding value.\n // The InstanceCreatedByInjectorEvent will be still emitted in this case (to mirror the InjectorToCreateInstanceEvent) but we don't want to do any particular processing for those situations.\n if (data.value == null) {\n return;\n }\n if (getDIResolver(context.injector) === null) {\n throwError('An InjectorCreatedInstance event must be run within an injection context.');\n }\n // if our value is an instance of a standalone component, map the injector of that standalone\n // component to the component class. Otherwise, this event is a noop.\n let standaloneComponent = undefined;\n if (typeof value === 'object') {\n standaloneComponent = value?.constructor;\n }\n // We want to also cover if `standaloneComponent === null` in addition to `undefined`\n if (standaloneComponent == undefined || !isStandaloneComponent(standaloneComponent)) {\n return;\n }\n const environmentInjector = context.injector.get(EnvironmentInjector, null, { optional: true });\n // Standalone components should have an environment injector. If one cannot be\n // found we may be in a test case for low level functionality that did not explicitly\n // setup this injector. In those cases, we simply ignore this event.\n if (environmentInjector === null) {\n return;\n }\n const { standaloneInjectorToComponent } = frameworkDIDebugData;\n // If our injector has already been mapped, as is the case\n // when a standalone component imports another standalone component,\n // we consider the original component (the component doing the importing)\n // as the component connected to our injector.\n if (standaloneInjectorToComponent.has(environmentInjector)) {\n return;\n }\n // If our injector hasn't been mapped, then we map it to the standalone component\n standaloneInjectorToComponent.set(environmentInjector, standaloneComponent);\n}\nfunction isStandaloneComponent(value) {\n const def = getComponentDef(value);\n return !!def?.standalone;\n}\n/**\n *\n * Stores the emitted ProviderRecords from the InjectorProfilerEventType.ProviderConfigured\n * event in frameworkDIDebugData.resolverToProviders\n *\n * @param context InjectorProfilerContext the injection context that this event occurred in.\n * @param data ProviderRecord an object containing the instance that was just created\n *\n */\nfunction handleProviderConfiguredEvent(context, data) {\n const { resolverToProviders } = frameworkDIDebugData;\n let diResolver;\n if (context?.injector instanceof NodeInjector) {\n diResolver = getNodeInjectorTNode(context.injector);\n }\n else {\n diResolver = context.injector;\n }\n if (diResolver === null) {\n throwError('A ProviderConfigured event must be run within an injection context.');\n }\n if (!resolverToProviders.has(diResolver)) {\n resolverToProviders.set(diResolver, []);\n }\n resolverToProviders.get(diResolver).push(data);\n}\nfunction getDIResolver(injector) {\n let diResolver = null;\n if (injector === undefined) {\n return diResolver;\n }\n // We use the LView as the diResolver for NodeInjectors because they\n // do not persist anywhere in the framework. They are simply wrappers around an LView and a TNode\n // that do persist. Because of this, we rely on the LView of the NodeInjector in order to use\n // as a concrete key to represent this injector. If we get the same LView back later, we know\n // we're looking at the same injector.\n if (injector instanceof NodeInjector) {\n diResolver = getNodeInjectorLView(injector);\n }\n // Other injectors can be used a keys for a map because their instances\n // persist\n else {\n diResolver = injector;\n }\n return diResolver;\n}\n// inspired by\n// https://tc39.es/ecma262/multipage/executable-code-and-execution-contexts.html#sec-canbeheldweakly\nfunction canBeHeldWeakly(value) {\n // we check for value !== null here because typeof null === 'object\n return (value !== null &&\n (typeof value === 'object' || typeof value === 'function' || typeof value === 'symbol'));\n}\n\n/**\n * Marks a component for check (in case of OnPush components) and synchronously\n * performs change detection on the application this component belongs to.\n *\n * @param component Component to {@link /api/core/ChangeDetectorRef#markForCheck mark for check}\n *\n * @publicApi\n */\nfunction applyChanges(component) {\n ngDevMode && assertDefined(component, 'component');\n markViewDirty(getComponentViewByInstance(component), 3 /* NotificationSource.DebugApplyChanges */);\n getRootComponents(component).forEach((rootComponent) => detectChanges(rootComponent));\n}\n/**\n * Synchronously perform change detection on a component (and possibly its sub-components).\n *\n * This function triggers change detection in a synchronous way on a component.\n *\n * @param component The component which the change detection should be performed on.\n */\nfunction detectChanges(component) {\n const view = getComponentViewByInstance(component);\n view[FLAGS] |= 1024 /* LViewFlags.RefreshView */;\n detectChangesInternal(view);\n}\n\n/**\n * Retrieves all defer blocks in a given LView.\n *\n * @param lView lView with defer blocks\n * @param deferBlocks defer block aggregator array\n */\nfunction getDeferBlocks$1(lView, deferBlocks) {\n const tView = lView[TVIEW];\n for (let i = HEADER_OFFSET; i < tView.bindingStartIndex; i++) {\n if (isLContainer(lView[i])) {\n const lContainer = lView[i];\n // An LContainer may represent an instance of a defer block, in which case\n // we store it as a result. Otherwise, keep iterating over LContainer views and\n // look for defer blocks.\n const isLast = i === tView.bindingStartIndex - 1;\n if (!isLast) {\n const tNode = tView.data[i];\n const tDetails = getTDeferBlockDetails(tView, tNode);\n if (isTDeferBlockDetails(tDetails)) {\n deferBlocks.push({ lContainer, lView, tNode, tDetails });\n // This LContainer represents a defer block, so we exit\n // this iteration and don't inspect views in this LContainer.\n continue;\n }\n }\n // The host can be an `LView` if this is the container\n // for a component that injects `ViewContainerRef`.\n if (isLView(lContainer[HOST])) {\n getDeferBlocks$1(lContainer[HOST], deferBlocks);\n }\n for (let j = CONTAINER_HEADER_OFFSET; j < lContainer.length; j++) {\n getDeferBlocks$1(lContainer[j], deferBlocks);\n }\n }\n else if (isLView(lView[i])) {\n // This is a component, enter the `getDeferBlocks` recursively.\n getDeferBlocks$1(lView[i], deferBlocks);\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.dev/license\n */\n/**\n * Gets all of the `@defer` blocks that are present inside the specified DOM node.\n * @param node Node in which to look for `@defer` blocks.\n *\n * @publicApi\n */\nfunction getDeferBlocks(node) {\n const results = [];\n const lView = getLContext(node)?.lView;\n if (lView) {\n findDeferBlocks(node, lView, results);\n }\n return results;\n}\n/**\n * Finds all the `@defer` blocks inside a specific node and view.\n * @param node Node in which to search for blocks.\n * @param lView View within the node in which to search for blocks.\n * @param results Array to which to add blocks once they're found.\n */\nfunction findDeferBlocks(node, lView, results) {\n const viewInjector = lView[INJECTOR];\n const registry = viewInjector.get(DEHYDRATED_BLOCK_REGISTRY, null, { optional: true });\n const blocks = [];\n getDeferBlocks$1(lView, blocks);\n const transferState = viewInjector.get(TransferState);\n const deferBlockParents = transferState.get(NGH_DEFER_BLOCKS_KEY, {});\n for (const details of blocks) {\n const native = getNativeByTNode(details.tNode, details.lView);\n const lDetails = getLDeferBlockDetails(details.lView, details.tNode);\n // The LView from `getLContext` might be the view the element is placed in.\n // Filter out defer blocks that aren't inside the specified root node.\n if (!node.contains(native)) {\n continue;\n }\n const tDetails = details.tDetails;\n const renderedLView = getRendererLView(details);\n const rootNodes = [];\n const hydrationState = inferHydrationState(tDetails, lDetails, registry);\n if (renderedLView !== null) {\n collectNativeNodes(renderedLView[TVIEW], renderedLView, renderedLView[TVIEW].firstChild, rootNodes);\n }\n else if (hydrationState === 'dehydrated') {\n // We'll find the number of root nodes in the transfer state and\n // collect that number of elements that precede the defer block comment node.\n const deferId = lDetails[SSR_UNIQUE_ID];\n const deferData = deferBlockParents[deferId];\n const numberOfRootNodes = deferData[NUM_ROOT_NODES];\n let collectedNodeCount = 0;\n const deferBlockCommentNode = details.lContainer[NATIVE];\n let currentNode = deferBlockCommentNode.previousSibling;\n while (collectedNodeCount < numberOfRootNodes && currentNode) {\n rootNodes.unshift(currentNode);\n currentNode = currentNode.previousSibling;\n collectedNodeCount++;\n }\n }\n const data = {\n state: stringifyState(lDetails[DEFER_BLOCK_STATE]),\n incrementalHydrationState: hydrationState,\n hasErrorBlock: tDetails.errorTmplIndex !== null,\n loadingBlock: {\n exists: tDetails.loadingTmplIndex !== null,\n minimumTime: tDetails.loadingBlockConfig?.[MINIMUM_SLOT] ?? null,\n afterTime: tDetails.loadingBlockConfig?.[LOADING_AFTER_SLOT] ?? null,\n },\n placeholderBlock: {\n exists: tDetails.placeholderTmplIndex !== null,\n minimumTime: tDetails.placeholderBlockConfig?.[MINIMUM_SLOT] ?? null,\n },\n triggers: tDetails.debug?.triggers ? Array.from(tDetails.debug.triggers).sort() : [],\n rootNodes,\n };\n results.push(data);\n // `getDeferBlocks` does not resolve nested defer blocks so we have to recurse manually.\n if (renderedLView !== null) {\n findDeferBlocks(node, renderedLView, results);\n }\n }\n}\n/**\n * Turns the `DeferBlockState` into a string which is more readable than the enum form.\n *\n * @param lDetails Information about the\n * @returns\n */\nfunction stringifyState(state) {\n switch (state) {\n case DeferBlockState.Complete:\n return 'complete';\n case DeferBlockState.Loading:\n return 'loading';\n case DeferBlockState.Placeholder:\n return 'placeholder';\n case DeferBlockState.Error:\n return 'error';\n case DeferBlockInternalState.Initial:\n return 'initial';\n default:\n throw new Error(`Unrecognized state ${state}`);\n }\n}\n/**\n * Infers the hydration state of a specific defer block.\n * @param tDetails Static defer block information.\n * @param lDetails Instance defer block information.\n * @param registry Registry coordinating the hydration of defer blocks.\n */\nfunction inferHydrationState(tDetails, lDetails, registry) {\n if (registry === null ||\n lDetails[SSR_UNIQUE_ID] === null ||\n tDetails.hydrateTriggers === null ||\n tDetails.hydrateTriggers.has(7 /* DeferBlockTrigger.Never */)) {\n return 'not-configured';\n }\n return registry.has(lDetails[SSR_UNIQUE_ID]) ? 'dehydrated' : 'hydrated';\n}\n/**\n * Gets the current LView that is rendered out in a defer block.\n * @param details Instance information about the block.\n */\nfunction getRendererLView(details) {\n // Defer block containers can only ever contain one view.\n // If they're empty, it means that nothing is rendered.\n if (details.lContainer.length <= CONTAINER_HEADER_OFFSET) {\n return null;\n }\n const lView = details.lContainer[CONTAINER_HEADER_OFFSET];\n ngDevMode && assertLView(lView);\n return lView;\n}\n\n/**\n * Discovers the dependencies of an injectable instance. Provides DI information about each\n * dependency that the injectable was instantiated with, including where they were provided from.\n *\n * @param injector An injector instance\n * @param token a DI token that was constructed by the given injector instance\n * @returns an object that contains the created instance of token as well as all of the dependencies\n * that it was instantiated with OR undefined if the token was not created within the given\n * injector.\n */\nfunction getDependenciesFromInjectable(injector, token) {\n // First we check to see if the token given maps to an actual instance in the injector given.\n // We use `self: true` because we only want to look at the injector we were given.\n // We use `optional: true` because it's possible that the token we were given was never\n // constructed by the injector we were given.\n const instance = injector.get(token, null, { self: true, optional: true });\n if (instance === null) {\n throw new Error(`Unable to determine instance of ${token} in given injector`);\n }\n const unformattedDependencies = getDependenciesForTokenInInjector(token, injector);\n const resolutionPath = getInjectorResolutionPath(injector);\n const dependencies = unformattedDependencies.map((dep) => {\n // injectedIn contains private fields, so we omit it from the response\n const formattedDependency = {\n value: dep.value,\n };\n // convert injection flags to booleans\n const flags = dep.flags;\n formattedDependency.flags = {\n optional: (8 /* InternalInjectFlags.Optional */ & flags) === 8 /* InternalInjectFlags.Optional */,\n host: (1 /* InternalInjectFlags.Host */ & flags) === 1 /* InternalInjectFlags.Host */,\n self: (2 /* InternalInjectFlags.Self */ & flags) === 2 /* InternalInjectFlags.Self */,\n skipSelf: (4 /* InternalInjectFlags.SkipSelf */ & flags) === 4 /* InternalInjectFlags.SkipSelf */,\n };\n // find the injector that provided the dependency\n for (let i = 0; i < resolutionPath.length; i++) {\n const injectorToCheck = resolutionPath[i];\n // if skipSelf is true we skip the first injector\n if (i === 0 && formattedDependency.flags.skipSelf) {\n continue;\n }\n // host only applies to NodeInjectors\n if (formattedDependency.flags.host && injectorToCheck instanceof EnvironmentInjector) {\n break;\n }\n const instance = injectorToCheck.get(dep.token, null, {\n self: true,\n optional: true,\n });\n if (instance !== null) {\n // if host flag is true we double check that we can get the service from the first element\n // in the resolution path by using the host flag. This is done to make sure that we've found\n // the correct providing injector, and not a node injector that is connected to our path via\n // a router outlet.\n if (formattedDependency.flags.host) {\n const firstInjector = resolutionPath[0];\n const lookupFromFirstInjector = firstInjector.get(dep.token, null, {\n ...formattedDependency.flags,\n optional: true,\n });\n if (lookupFromFirstInjector !== null) {\n formattedDependency.providedIn = injectorToCheck;\n }\n break;\n }\n formattedDependency.providedIn = injectorToCheck;\n break;\n }\n // if self is true we stop after the first injector\n if (i === 0 && formattedDependency.flags.self) {\n break;\n }\n }\n if (dep.token)\n formattedDependency.token = dep.token;\n return formattedDependency;\n });\n return { instance, dependencies };\n}\nfunction getDependenciesForTokenInInjector(token, injector) {\n const { resolverToTokenToDependencies } = getFrameworkDIDebugData();\n if (!(injector instanceof NodeInjector)) {\n return resolverToTokenToDependencies.get(injector)?.get?.(token) ?? [];\n }\n const lView = getNodeInjectorLView(injector);\n const tokenDependencyMap = resolverToTokenToDependencies.get(lView);\n const dependencies = tokenDependencyMap?.get(token) ?? [];\n // In the NodeInjector case, all injections for every node are stored in the same lView.\n // We use the injectedIn field of the dependency to filter out the dependencies that\n // do not come from the same node as the instance we're looking at.\n return dependencies.filter((dependency) => {\n const dependencyNode = dependency.injectedIn?.tNode;\n if (dependencyNode === undefined) {\n return false;\n }\n const instanceNode = getNodeInjectorTNode(injector);\n assertTNode(dependencyNode);\n assertTNode(instanceNode);\n return dependencyNode === instanceNode;\n });\n}\n/**\n * Gets the class associated with an injector that contains a provider `imports` array in it's\n * definition\n *\n * For Module Injectors this returns the NgModule constructor.\n *\n * For Standalone injectors this returns the standalone component constructor.\n *\n * @param injector Injector an injector instance\n * @returns the constructor where the `imports` array that configures this injector is located\n */\nfunction getProviderImportsContainer(injector) {\n const { standaloneInjectorToComponent } = getFrameworkDIDebugData();\n // standalone components configure providers through a component def, so we have to\n // use the standalone component associated with this injector if Injector represents\n // a standalone components EnvironmentInjector\n if (standaloneInjectorToComponent.has(injector)) {\n return standaloneInjectorToComponent.get(injector);\n }\n // Module injectors configure providers through their NgModule def, so we use the\n // injector to lookup its NgModuleRef and through that grab its instance\n const defTypeRef = injector.get(NgModuleRef$1, null, { self: true, optional: true });\n // If we can't find an associated imports container, return null.\n // This could be the case if this function is called with an R3Injector that does not represent\n // a standalone component or NgModule.\n if (defTypeRef === null) {\n return null;\n }\n // In standalone applications, the root environment injector created by bootstrapApplication\n // may have no associated \"instance\".\n if (defTypeRef.instance === null) {\n return null;\n }\n return defTypeRef.instance.constructor;\n}\n/**\n * Gets the providers configured on a NodeInjector\n *\n * @param injector A NodeInjector instance\n * @returns ProviderRecord[] an array of objects representing the providers configured on this\n * injector\n */\nfunction getNodeInjectorProviders(injector) {\n const diResolver = getNodeInjectorTNode(injector);\n const { resolverToProviders } = getFrameworkDIDebugData();\n return resolverToProviders.get(diResolver) ?? [];\n}\n/**\n * Gets a mapping of providers configured on an injector to their import paths\n *\n * ModuleA -> imports ModuleB\n * ModuleB -> imports ModuleC\n * ModuleB -> provides MyServiceA\n * ModuleC -> provides MyServiceB\n *\n * getProviderImportPaths(ModuleA)\n * > Map(2) {\n * MyServiceA => [ModuleA, ModuleB]\n * MyServiceB => [ModuleA, ModuleB, ModuleC]\n * }\n *\n * @param providerImportsContainer constructor of class that contains an `imports` array in it's\n * definition\n * @returns A Map object that maps providers to an array of constructors representing it's import\n * path\n *\n */\nfunction getProviderImportPaths(providerImportsContainer) {\n const providerToPath = new Map();\n const visitedContainers = new Set();\n const visitor = walkProviderTreeToDiscoverImportPaths(providerToPath, visitedContainers);\n walkProviderTree(providerImportsContainer, visitor, [], new Set());\n return providerToPath;\n}\n/**\n *\n * Higher order function that returns a visitor for WalkProviderTree\n *\n * Takes in a Map and Set to keep track of the providers and containers\n * visited, so that we can discover the import paths of these providers\n * during the traversal.\n *\n * This visitor takes advantage of the fact that walkProviderTree performs a\n * postorder traversal of the provider tree for the passed in container. Because postorder\n * traversal recursively processes subtrees from leaf nodes until the traversal reaches the root,\n * we write a visitor that constructs provider import paths in reverse.\n *\n *\n * We use the visitedContainers set defined outside this visitor\n * because we want to run some logic only once for\n * each container in the tree. That logic can be described as:\n *\n *\n * 1. for each discovered_provider and discovered_path in the incomplete provider paths we've\n * already discovered\n * 2. get the first container in discovered_path\n * 3. if that first container is in the imports array of the container we're visiting\n * Then the container we're visiting is also in the import path of discovered_provider, so we\n * unshift discovered_path with the container we're currently visiting\n *\n *\n * Example Run:\n * ```\n * ┌──────────┐\n * │containerA│\n * ┌─imports-─┤ ├──imports─┐\n * │ │ provA │ │\n * │ │ provB │ │\n * │ └──────────┘ │\n * │ │\n * ┌▼─────────┐ ┌────────▼─┐\n * │containerB│ │containerC│\n * │ │ │ │\n * │ provD │ │ provF │\n * │ provE │ │ provG │\n * └──────────┘ └──────────┘\n * ```\n *\n * Each step of the traversal,\n *\n * ```\n * visitor(provD, containerB)\n * providerToPath === Map { provD => [containerB] }\n * visitedContainers === Set { containerB }\n *\n * visitor(provE, containerB)\n * providerToPath === Map { provD => [containerB], provE => [containerB] }\n * visitedContainers === Set { containerB }\n *\n * visitor(provF, containerC)\n * providerToPath === Map { provD => [containerB], provE => [containerB], provF => [containerC] }\n * visitedContainers === Set { containerB, containerC }\n *\n * visitor(provG, containerC)\n * providerToPath === Map {\n * provD => [containerB], provE => [containerB], provF => [containerC], provG => [containerC]\n * }\n * visitedContainers === Set { containerB, containerC }\n *\n * visitor(provA, containerA)\n * providerToPath === Map {\n * provD => [containerA, containerB],\n * provE => [containerA, containerB],\n * provF => [containerA, containerC],\n * provG => [containerA, containerC],\n * provA => [containerA]\n * }\n * visitedContainers === Set { containerB, containerC, containerA }\n *\n * visitor(provB, containerA)\n * providerToPath === Map {\n * provD => [containerA, containerB],\n * provE => [containerA, containerB],\n * provF => [containerA, containerC],\n * provG => [containerA, containerC],\n * provA => [containerA]\n * provB => [containerA]\n * }\n * visitedContainers === Set { containerB, containerC, containerA }\n * ```\n *\n * @param providerToPath Map map of providers to paths that this function fills\n * @param visitedContainers Set a set to keep track of the containers we've already visited\n * @return function(provider SingleProvider, container: Type<unknown> | InjectorType<unknown>) =>\n * void\n */\nfunction walkProviderTreeToDiscoverImportPaths(providerToPath, visitedContainers) {\n return (provider, container) => {\n // If the provider is not already in the providerToPath map,\n // add an entry with the provider as the key and an array containing the current container as\n // the value\n if (!providerToPath.has(provider)) {\n providerToPath.set(provider, [container]);\n }\n // This block will run exactly once for each container in the import tree.\n // This is where we run the logic to check the imports array of the current\n // container to see if it's the next container in the path for our currently\n // discovered providers.\n if (!visitedContainers.has(container)) {\n // Iterate through the providers we've already seen\n for (const prov of providerToPath.keys()) {\n const existingImportPath = providerToPath.get(prov);\n let containerDef = getInjectorDef(container);\n if (!containerDef) {\n const ngModule = container.ngModule;\n containerDef = getInjectorDef(ngModule);\n }\n if (!containerDef) {\n return;\n }\n const lastContainerAddedToPath = existingImportPath[0];\n let isNextStepInPath = false;\n deepForEach(containerDef.imports, (moduleImport) => {\n if (isNextStepInPath) {\n return;\n }\n isNextStepInPath =\n moduleImport.ngModule === lastContainerAddedToPath ||\n moduleImport === lastContainerAddedToPath;\n if (isNextStepInPath) {\n providerToPath.get(prov)?.unshift(container);\n }\n });\n }\n }\n visitedContainers.add(container);\n };\n}\n/**\n * Gets the providers configured on an EnvironmentInjector\n *\n * @param injector EnvironmentInjector\n * @returns an array of objects representing the providers of the given injector\n */\nfunction getEnvironmentInjectorProviders(injector) {\n const providerRecordsWithoutImportPaths = getFrameworkDIDebugData().resolverToProviders.get(injector) ?? [];\n // platform injector has no provider imports container so can we skip trying to\n // find import paths\n if (isPlatformInjector(injector)) {\n return providerRecordsWithoutImportPaths;\n }\n const providerImportsContainer = getProviderImportsContainer(injector);\n if (providerImportsContainer === null) {\n // We assume that if an environment injector exists without an associated provider imports\n // container, it was created without such a container. Some examples cases where this could\n // happen:\n // - The root injector of a standalone application\n // - A router injector created by using the providers array in a lazy loaded route\n // - A manually created injector that is attached to the injector tree\n // Since each of these cases has no provider container, there is no concept of import paths,\n // so we can simply return the provider records.\n return providerRecordsWithoutImportPaths;\n }\n const providerToPath = getProviderImportPaths(providerImportsContainer);\n const providerRecords = [];\n for (const providerRecord of providerRecordsWithoutImportPaths) {\n const provider = providerRecord.provider;\n // Ignore these special providers for now until we have a cleaner way of\n // determing when they are provided by the framework vs provided by the user.\n const token = provider.provide;\n if (token === ENVIRONMENT_INITIALIZER || token === INJECTOR_DEF_TYPES) {\n continue;\n }\n let importPath = providerToPath.get(provider) ?? [];\n const def = getComponentDef(providerImportsContainer);\n const isStandaloneComponent = !!def?.standalone;\n // We prepend the component constructor in the standalone case\n // because walkProviderTree does not visit this constructor during it's traversal\n if (isStandaloneComponent) {\n importPath = [providerImportsContainer, ...importPath];\n }\n providerRecords.push({ ...providerRecord, importPath });\n }\n return providerRecords;\n}\nfunction isPlatformInjector(injector) {\n return injector instanceof R3Injector && injector.scopes.has('platform');\n}\n/**\n * Gets the providers configured on an injector.\n *\n * @param injector the injector to lookup the providers of\n * @returns ProviderRecord[] an array of objects representing the providers of the given injector\n */\nfunction getInjectorProviders(injector) {\n if (injector instanceof NodeInjector) {\n return getNodeInjectorProviders(injector);\n }\n else if (injector instanceof EnvironmentInjector) {\n return getEnvironmentInjectorProviders(injector);\n }\n throwError('getInjectorProviders only supports NodeInjector and EnvironmentInjector');\n}\n/**\n *\n * Given an injector, this function will return\n * an object containing the type and source of the injector.\n *\n * | | type | source |\n * |--------------|-------------|-------------------------------------------------------------|\n * | NodeInjector | element | DOM element that created this injector |\n * | R3Injector | environment | `injector.source` |\n * | NullInjector | null | null |\n *\n * @param injector the Injector to get metadata for\n * @returns an object containing the type and source of the given injector. If the injector metadata\n * cannot be determined, returns null.\n */\nfunction getInjectorMetadata(injector) {\n if (injector instanceof NodeInjector) {\n const lView = getNodeInjectorLView(injector);\n const tNode = getNodeInjectorTNode(injector);\n assertTNodeForLView(tNode, lView);\n return { type: 'element', source: getNativeByTNode(tNode, lView) };\n }\n if (injector instanceof R3Injector) {\n return { type: 'environment', source: injector.source ?? null };\n }\n if (injector instanceof NullInjector) {\n return { type: 'null', source: null };\n }\n return null;\n}\nfunction getInjectorResolutionPath(injector) {\n const resolutionPath = [injector];\n getInjectorResolutionPathHelper(injector, resolutionPath);\n return resolutionPath;\n}\nfunction getInjectorResolutionPathHelper(injector, resolutionPath) {\n const parent = getInjectorParent(injector);\n // if getInjectorParent can't find a parent, then we've either reached the end\n // of the path, or we need to move from the Element Injector tree to the\n // module injector tree using the first injector in our path as the connection point.\n if (parent === null) {\n if (injector instanceof NodeInjector) {\n const firstInjector = resolutionPath[0];\n if (firstInjector instanceof NodeInjector) {\n const moduleInjector = getModuleInjectorOfNodeInjector(firstInjector);\n if (moduleInjector === null) {\n throwError('NodeInjector must have some connection to the module injector tree');\n }\n resolutionPath.push(moduleInjector);\n getInjectorResolutionPathHelper(moduleInjector, resolutionPath);\n }\n return resolutionPath;\n }\n }\n else {\n resolutionPath.push(parent);\n getInjectorResolutionPathHelper(parent, resolutionPath);\n }\n return resolutionPath;\n}\n/**\n * Gets the parent of an injector.\n *\n * This function is not able to make the jump from the Element Injector Tree to the Module\n * injector tree. This is because the \"parent\" (the next step in the reoslution path)\n * of a root NodeInjector is dependent on which NodeInjector ancestor initiated\n * the DI lookup. See getInjectorResolutionPath for a function that can make this jump.\n *\n * In the below diagram:\n * ```ts\n * getInjectorParent(NodeInjectorB)\n * > NodeInjectorA\n * getInjectorParent(NodeInjectorA) // or getInjectorParent(getInjectorParent(NodeInjectorB))\n * > null // cannot jump to ModuleInjector tree\n * ```\n *\n * ```\n * ┌───────┐ ┌───────────────────┐\n * ┌───────────┤ModuleA├───Injector────►│EnvironmentInjector│\n * │ └───┬───┘ └───────────────────┘\n * │ │\n * │ bootstraps\n * │ │\n * │ │\n * │ ┌────▼─────┐ ┌─────────────┐\n * declares │ComponentA├────Injector────►│NodeInjectorA│\n * │ └────┬─────┘ └─────▲───────┘\n * │ │ │\n * │ renders parent\n * │ │ │\n * │ ┌────▼─────┐ ┌─────┴───────┐\n * └─────────►│ComponentB├────Injector────►│NodeInjectorB│\n * └──────────┘ └─────────────┘\n *```\n *\n * @param injector an Injector to get the parent of\n * @returns Injector the parent of the given injector\n */\nfunction getInjectorParent(injector) {\n if (injector instanceof R3Injector) {\n return injector.parent;\n }\n let tNode;\n let lView;\n if (injector instanceof NodeInjector) {\n tNode = getNodeInjectorTNode(injector);\n lView = getNodeInjectorLView(injector);\n }\n else if (injector instanceof NullInjector) {\n return null;\n }\n else if (injector instanceof ChainedInjector) {\n return injector.parentInjector;\n }\n else {\n throwError('getInjectorParent only support injectors of type R3Injector, NodeInjector, NullInjector');\n }\n const parentLocation = getParentInjectorLocation(tNode, lView);\n if (hasParentInjector(parentLocation)) {\n const parentInjectorIndex = getParentInjectorIndex(parentLocation);\n const parentLView = getParentInjectorView(parentLocation, lView);\n const parentTView = parentLView[TVIEW];\n const parentTNode = parentTView.data[parentInjectorIndex + 8 /* NodeInjectorOffset.TNODE */];\n return new NodeInjector(parentTNode, parentLView);\n }\n else {\n const chainedInjector = lView[INJECTOR];\n // Case where chainedInjector.injector is an OutletInjector and chainedInjector.injector.parent\n // is a NodeInjector.\n // todo(aleksanderbodurri): ideally nothing in packages/core should deal\n // directly with router concerns. Refactor this so that we can make the jump from\n // NodeInjector -> OutletInjector -> NodeInjector\n // without explicitly relying on types contracts from packages/router\n const injectorParent = chainedInjector.injector?.parent;\n if (injectorParent instanceof NodeInjector) {\n return injectorParent;\n }\n }\n return null;\n}\n/**\n * Gets the module injector of a NodeInjector.\n *\n * @param injector NodeInjector to get module injector of\n * @returns Injector representing module injector of the given NodeInjector\n */\nfunction getModuleInjectorOfNodeInjector(injector) {\n let lView;\n if (injector instanceof NodeInjector) {\n lView = getNodeInjectorLView(injector);\n }\n else {\n throwError('getModuleInjectorOfNodeInjector must be called with a NodeInjector');\n }\n const inj = lView[INJECTOR];\n const moduleInjector = inj instanceof ChainedInjector ? inj.parentInjector : inj.parent;\n if (!moduleInjector) {\n throwError('NodeInjector must have some connection to the module injector tree');\n }\n return moduleInjector;\n}\n\nfunction isComputedNode(node) {\n return node.kind === 'computed';\n}\nfunction isTemplateEffectNode(node) {\n return node.kind === 'template';\n}\nfunction isSignalNode(node) {\n return node.kind === 'signal';\n}\n/**\n *\n * @param injector\n * @returns Template consumer of given NodeInjector\n */\nfunction getTemplateConsumer(injector) {\n const tNode = getNodeInjectorTNode(injector);\n assertTNode(tNode);\n const lView = getNodeInjectorLView(injector);\n assertLView(lView);\n const templateLView = lView[tNode.index];\n if (isLView(templateLView)) {\n return templateLView[REACTIVE_TEMPLATE_CONSUMER] ?? null;\n }\n return null;\n}\nconst signalDebugMap = new WeakMap();\nlet counter$1 = 0;\nfunction getNodesAndEdgesFromSignalMap(signalMap) {\n const nodes = Array.from(signalMap.keys());\n const debugSignalGraphNodes = [];\n const edges = [];\n for (const [consumer, producers] of signalMap.entries()) {\n const consumerIndex = nodes.indexOf(consumer);\n let id = signalDebugMap.get(consumer);\n if (!id) {\n counter$1++;\n id = counter$1.toString();\n signalDebugMap.set(consumer, id);\n }\n // collect node\n if (isComputedNode(consumer)) {\n debugSignalGraphNodes.push({\n label: consumer.debugName,\n value: consumer.value,\n kind: consumer.kind,\n epoch: consumer.version,\n debuggableFn: consumer.computation,\n id,\n });\n }\n else if (isSignalNode(consumer)) {\n debugSignalGraphNodes.push({\n label: consumer.debugName,\n value: consumer.value,\n kind: consumer.kind,\n epoch: consumer.version,\n id,\n });\n }\n else if (isTemplateEffectNode(consumer)) {\n debugSignalGraphNodes.push({\n label: consumer.debugName ?? consumer.lView?.[HOST]?.tagName?.toLowerCase?.(),\n kind: consumer.kind,\n epoch: consumer.version,\n id,\n });\n }\n else {\n debugSignalGraphNodes.push({\n label: consumer.debugName,\n kind: consumer.kind,\n epoch: consumer.version,\n id,\n });\n }\n // collect edges for node\n for (const producer of producers) {\n edges.push({ consumer: consumerIndex, producer: nodes.indexOf(producer) });\n }\n }\n return { nodes: debugSignalGraphNodes, edges };\n}\nfunction extractEffectsFromInjector(injector) {\n let diResolver = injector;\n if (injector instanceof NodeInjector) {\n const lView = getNodeInjectorLView(injector);\n diResolver = lView;\n }\n const resolverToEffects = getFrameworkDIDebugData().resolverToEffects;\n const effects = resolverToEffects.get(diResolver) ?? [];\n return effects.map((effect) => effect[SIGNAL]);\n}\nfunction extractSignalNodesAndEdgesFromRoots(nodes, signalDependenciesMap = new Map()) {\n for (const node of nodes) {\n if (signalDependenciesMap.has(node)) {\n continue;\n }\n const producerNodes = [];\n for (let link = node.producers; link !== undefined; link = link.nextProducer) {\n const producer = link.producer;\n producerNodes.push(producer);\n }\n signalDependenciesMap.set(node, producerNodes);\n extractSignalNodesAndEdgesFromRoots(producerNodes, signalDependenciesMap);\n }\n return signalDependenciesMap;\n}\n/**\n * Returns a debug representation of the signal graph for the given injector.\n *\n * Currently only supports element injectors. Starts by discovering the consumer nodes\n * and then traverses their producer nodes to build the signal graph.\n *\n * @param injector The injector to get the signal graph for.\n * @returns A debug representation of the signal graph.\n * @throws If the injector is an environment injector.\n */\nfunction getSignalGraph(injector) {\n let templateConsumer = null;\n if (!(injector instanceof NodeInjector) && !(injector instanceof R3Injector)) {\n return throwError('getSignalGraph must be called with a NodeInjector or R3Injector');\n }\n if (injector instanceof NodeInjector) {\n templateConsumer = getTemplateConsumer(injector);\n }\n const nonTemplateEffectNodes = extractEffectsFromInjector(injector);\n const signalNodes = templateConsumer\n ? [templateConsumer, ...nonTemplateEffectNodes]\n : nonTemplateEffectNodes;\n const signalDependenciesMap = extractSignalNodesAndEdgesFromRoots(signalNodes);\n return getNodesAndEdgesFromSignalMap(signalDependenciesMap);\n}\n\nlet changeDetectionRuns = 0;\nlet changeDetectionSyncRuns = 0;\nlet counter = 0;\nconst eventsStack = [];\nfunction measureStart(startEvent) {\n eventsStack.push([startEvent, counter]);\n console.timeStamp('Event_' + startEvent + '_' + counter++);\n}\nfunction measureEnd(startEvent, entryName, color) {\n const top = eventsStack.pop();\n assertDefined(top, 'Profiling error: could not find start event entry ' + startEvent);\n assertEqual(top[0], startEvent, `Profiling error: expected to see ${startEvent} event but got ${top[0]}`);\n console.timeStamp(entryName, 'Event_' + top[0] + '_' + top[1], undefined, '\\u{1F170}\\uFE0F Angular', undefined, color);\n}\nconst chromeDevToolsInjectorProfiler = (event) => {\n const eventType = event.type;\n if (eventType === 4 /* InjectorProfilerEventType.InjectorToCreateInstanceEvent */) {\n measureStart(100 /* ProfilerDIEvent.InjectorToCreateInstanceEvent */);\n }\n else if (eventType === 1 /* InjectorProfilerEventType.InstanceCreatedByInjector */) {\n const token = event.context.token;\n measureEnd(100 /* ProfilerDIEvent.InjectorToCreateInstanceEvent */, getProviderTokenMeasureName(token), 'tertiary-dark');\n }\n};\nconst devToolsProfiler = (event, instance, eventFn) => {\n switch (event) {\n case 8 /* ProfilerEvent.BootstrapApplicationStart */:\n case 10 /* ProfilerEvent.BootstrapComponentStart */:\n case 12 /* ProfilerEvent.ChangeDetectionStart */:\n case 14 /* ProfilerEvent.ChangeDetectionSyncStart */:\n case 16 /* ProfilerEvent.AfterRenderHooksStart */:\n case 18 /* ProfilerEvent.ComponentStart */:\n case 20 /* ProfilerEvent.DeferBlockStateStart */:\n case 22 /* ProfilerEvent.DynamicComponentStart */:\n case 0 /* ProfilerEvent.TemplateCreateStart */:\n case 4 /* ProfilerEvent.LifecycleHookStart */:\n case 2 /* ProfilerEvent.TemplateUpdateStart */:\n case 24 /* ProfilerEvent.HostBindingsUpdateStart */:\n case 6 /* ProfilerEvent.OutputStart */: {\n measureStart(event);\n break;\n }\n case 9 /* ProfilerEvent.BootstrapApplicationEnd */: {\n measureEnd(8 /* ProfilerEvent.BootstrapApplicationStart */, 'Bootstrap application', 'primary-dark');\n break;\n }\n case 11 /* ProfilerEvent.BootstrapComponentEnd */: {\n measureEnd(10 /* ProfilerEvent.BootstrapComponentStart */, 'Bootstrap component', 'primary-dark');\n break;\n }\n case 13 /* ProfilerEvent.ChangeDetectionEnd */: {\n changeDetectionSyncRuns = 0;\n measureEnd(12 /* ProfilerEvent.ChangeDetectionStart */, 'Change detection ' + changeDetectionRuns++, 'primary-dark');\n break;\n }\n case 15 /* ProfilerEvent.ChangeDetectionSyncEnd */: {\n measureEnd(14 /* ProfilerEvent.ChangeDetectionSyncStart */, 'Synchronization ' + changeDetectionSyncRuns++, 'primary');\n break;\n }\n case 17 /* ProfilerEvent.AfterRenderHooksEnd */: {\n measureEnd(16 /* ProfilerEvent.AfterRenderHooksStart */, 'After render hooks', 'primary');\n break;\n }\n case 19 /* ProfilerEvent.ComponentEnd */: {\n const typeName = getComponentMeasureName(instance);\n measureEnd(18 /* ProfilerEvent.ComponentStart */, typeName, 'primary-light');\n break;\n }\n case 21 /* ProfilerEvent.DeferBlockStateEnd */: {\n measureEnd(20 /* ProfilerEvent.DeferBlockStateStart */, 'Defer block', 'primary-dark');\n break;\n }\n case 23 /* ProfilerEvent.DynamicComponentEnd */: {\n measureEnd(22 /* ProfilerEvent.DynamicComponentStart */, 'Dynamic component creation', 'primary-dark');\n break;\n }\n case 3 /* ProfilerEvent.TemplateUpdateEnd */: {\n measureEnd(2 /* ProfilerEvent.TemplateUpdateStart */, stringifyForError(eventFn) + ' (update)', 'secondary-dark');\n break;\n }\n case 1 /* ProfilerEvent.TemplateCreateEnd */: {\n measureEnd(0 /* ProfilerEvent.TemplateCreateStart */, stringifyForError(eventFn) + ' (create)', 'secondary');\n break;\n }\n case 25 /* ProfilerEvent.HostBindingsUpdateEnd */: {\n measureEnd(24 /* ProfilerEvent.HostBindingsUpdateStart */, 'HostBindings', 'secondary-dark');\n break;\n }\n case 5 /* ProfilerEvent.LifecycleHookEnd */: {\n const typeName = getComponentMeasureName(instance);\n measureEnd(4 /* ProfilerEvent.LifecycleHookStart */, `${typeName}:${stringifyForError(eventFn)}`, 'tertiary');\n break;\n }\n case 7 /* ProfilerEvent.OutputEnd */: {\n measureEnd(6 /* ProfilerEvent.OutputStart */, stringifyForError(eventFn), 'tertiary-light');\n break;\n }\n default: {\n throw new Error('Unexpected profiling event type: ' + event);\n }\n }\n};\nfunction getComponentMeasureName(instance) {\n return instance.constructor.name;\n}\nfunction getProviderTokenMeasureName(token) {\n if (isTypeProvider(token)) {\n return token.name;\n }\n else if (token.provide != null) {\n return getProviderTokenMeasureName(token.provide);\n }\n return token.toString();\n}\n/**\n * Start listening to the Angular's internal performance-related events and route those to the Chrome DevTools performance panel.\n * This enables Angular-specific data visualization when recording a performance profile directly in the Chrome DevTools.\n *\n * Note: integration is enabled in the development mode only, this operation is noop in the production mode.\n *\n * @experimental\n *\n * @returns a function that can be invoked to stop sending profiling data.\n */\nfunction enableProfiling() {\n performanceMarkFeature('Chrome DevTools profiling');\n if (typeof ngDevMode !== 'undefined' && ngDevMode) {\n const removeInjectorProfiler = setInjectorProfiler(chromeDevToolsInjectorProfiler);\n const removeProfiler = setProfiler(devToolsProfiler);\n return () => {\n removeInjectorProfiler();\n removeProfiler();\n };\n }\n return () => { };\n}\n\n/// <reference path=\"../../../../goog.d.ts\" />\n/**\n * This file introduces series of globally accessible debug tools\n * to allow for the Angular debugging story to function.\n *\n * To see this in action run the following command:\n *\n * bazel run //packages/core/test/bundling/todo:devserver\n *\n * Then load `localhost:5432` and start using the console tools.\n */\n/**\n * This value reflects the property on the window where the dev\n * tools are patched (window.ng).\n * */\nconst GLOBAL_PUBLISH_EXPANDO_KEY = 'ng';\nconst globalUtilsFunctions = {\n /**\n * Warning: functions that start with `ɵ` are considered *INTERNAL* and should not be relied upon\n * in application's code. The contract of those functions might be changed in any release and/or a\n * function can be removed completely.\n */\n 'ɵgetDependenciesFromInjectable': getDependenciesFromInjectable,\n 'ɵgetInjectorProviders': getInjectorProviders,\n 'ɵgetInjectorResolutionPath': getInjectorResolutionPath,\n 'ɵgetInjectorMetadata': getInjectorMetadata,\n 'ɵsetProfiler': setProfiler,\n 'ɵgetSignalGraph': getSignalGraph,\n 'ɵgetDeferBlocks': getDeferBlocks,\n 'getDirectiveMetadata': getDirectiveMetadata$1,\n 'getComponent': getComponent,\n 'getContext': getContext,\n 'getListeners': getListeners,\n 'getOwningComponent': getOwningComponent,\n 'getHostElement': getHostElement,\n 'getInjector': getInjector,\n 'getRootComponents': getRootComponents,\n 'getDirectives': getDirectives,\n 'applyChanges': applyChanges,\n 'isSignal': isSignal,\n 'enableProfiling': enableProfiling,\n};\nlet _published = false;\n/**\n * Publishes a collection of default debug tools onto`window.ng`.\n *\n * These functions are available globally when Angular is in development\n * mode and are automatically stripped away from prod mode is on.\n */\nfunction publishDefaultGlobalUtils$1() {\n if (!_published) {\n _published = true;\n if (typeof window !== 'undefined') {\n // Only configure the injector profiler when running in the browser.\n setupFrameworkInjectorProfiler();\n }\n for (const [methodName, method] of Object.entries(globalUtilsFunctions)) {\n publishGlobalUtil(methodName, method);\n }\n }\n}\n/**\n * Publishes the given function to `window.ng` so that it can be\n * used from the browser console when an application is not in production.\n */\nfunction publishGlobalUtil(name, fn) {\n publishUtil(name, fn);\n}\n/**\n * Publishes the given function to `window.ng` from package other than @angular/core\n * So that it can be used from the browser console when an application is not in production.\n */\nfunction publishExternalGlobalUtil(name, fn) {\n publishUtil(name, fn);\n}\nfunction publishUtil(name, fn) {\n if (typeof COMPILED === 'undefined' || !COMPILED) {\n // Note: we can't export `ng` when using closure enhanced optimization as:\n // - closure declares globals itself for minified names, which sometimes clobber our `ng` global\n // - we can't declare a closure extern as the namespace `ng` is already used within Google\n // for typings for AngularJS (via `goog.provide('ng....')`).\n const w = _global;\n ngDevMode && assertDefined(fn, 'function not defined');\n w[GLOBAL_PUBLISH_EXPANDO_KEY] ??= {};\n w[GLOBAL_PUBLISH_EXPANDO_KEY][name] = fn;\n }\n}\n\n/**\n * Internal injection token that can used to access an instance of a Testability class.\n *\n * This token acts as a bridge between the core bootstrap code and the `Testability` class. This is\n * needed to ensure that there are no direct references to the `Testability` class, so it can be\n * tree-shaken away (if not referenced). For the environments/setups when the `Testability` class\n * should be available, this token is used to add a provider that references the `Testability`\n * class. Otherwise, only this token is retained in a bundle, but the `Testability` class is not.\n */\nconst TESTABILITY = new InjectionToken('');\n/**\n * Internal injection token to retrieve Testability getter class instance.\n */\nconst TESTABILITY_GETTER = new InjectionToken('');\n/**\n * The Testability service provides testing hooks that can be accessed from\n * the browser.\n *\n * Angular applications bootstrapped using an NgModule (via `@NgModule.bootstrap` field) will also\n * instantiate Testability by default (in both development and production modes).\n *\n * For applications bootstrapped using the `bootstrapApplication` function, Testability is not\n * included by default. You can include it into your applications by getting the list of necessary\n * providers using the `provideProtractorTestingSupport()` function and adding them into the\n * `options.providers` array. Example:\n *\n * ```ts\n * import {provideProtractorTestingSupport} from '@angular/platform-browser';\n *\n * await bootstrapApplication(RootComponent, providers: [provideProtractorTestingSupport()]);\n * ```\n *\n * @publicApi\n */\nclass Testability {\n _ngZone;\n registry;\n _isZoneStable = true;\n _callbacks = [];\n _taskTrackingZone = null;\n _destroyRef;\n constructor(_ngZone, registry, testabilityGetter) {\n this._ngZone = _ngZone;\n this.registry = registry;\n // Attempt to retrieve a `DestroyRef` optionally.\n // For backwards compatibility reasons, this cannot be required.\n if (isInInjectionContext()) {\n this._destroyRef = inject(DestroyRef, { optional: true }) ?? undefined;\n }\n // If there was no Testability logic registered in the global scope\n // before, register the current testability getter as a global one.\n if (!_testabilityGetter) {\n setTestabilityGetter(testabilityGetter);\n testabilityGetter.addToWindow(registry);\n }\n this._watchAngularEvents();\n _ngZone.run(() => {\n this._taskTrackingZone =\n typeof Zone == 'undefined' ? null : Zone.current.get('TaskTrackingZone');\n });\n }\n _watchAngularEvents() {\n const onUnstableSubscription = this._ngZone.onUnstable.subscribe({\n next: () => {\n this._isZoneStable = false;\n },\n });\n const onStableSubscription = this._ngZone.runOutsideAngular(() => this._ngZone.onStable.subscribe({\n next: () => {\n NgZone.assertNotInAngularZone();\n queueMicrotask(() => {\n this._isZoneStable = true;\n this._runCallbacksIfReady();\n });\n },\n }));\n this._destroyRef?.onDestroy(() => {\n onUnstableSubscription.unsubscribe();\n onStableSubscription.unsubscribe();\n });\n }\n /**\n * Whether an associated application is stable\n */\n isStable() {\n return this._isZoneStable && !this._ngZone.hasPendingMacrotasks;\n }\n _runCallbacksIfReady() {\n if (this.isStable()) {\n // Schedules the call backs in a new frame so that it is always async.\n queueMicrotask(() => {\n while (this._callbacks.length !== 0) {\n let cb = this._callbacks.pop();\n clearTimeout(cb.timeoutId);\n cb.doneCb();\n }\n });\n }\n else {\n // Still not stable, send updates.\n let pending = this.getPendingTasks();\n this._callbacks = this._callbacks.filter((cb) => {\n if (cb.updateCb && cb.updateCb(pending)) {\n clearTimeout(cb.timeoutId);\n return false;\n }\n return true;\n });\n }\n }\n getPendingTasks() {\n if (!this._taskTrackingZone) {\n return [];\n }\n // Copy the tasks data so that we don't leak tasks.\n return this._taskTrackingZone.macroTasks.map((t) => {\n return {\n source: t.source,\n // From TaskTrackingZone:\n // https://github.com/angular/zone.js/blob/master/lib/zone-spec/task-tracking.ts#L40\n creationLocation: t.creationLocation,\n data: t.data,\n };\n });\n }\n addCallback(cb, timeout, updateCb) {\n let timeoutId = -1;\n if (timeout && timeout > 0) {\n timeoutId = setTimeout(() => {\n this._callbacks = this._callbacks.filter((cb) => cb.timeoutId !== timeoutId);\n cb();\n }, timeout);\n }\n this._callbacks.push({ doneCb: cb, timeoutId: timeoutId, updateCb: updateCb });\n }\n /**\n * Wait for the application to be stable with a timeout. If the timeout is reached before that\n * happens, the callback receives a list of the macro tasks that were pending, otherwise null.\n *\n * @param doneCb The callback to invoke when Angular is stable or the timeout expires\n * whichever comes first.\n * @param timeout Optional. The maximum time to wait for Angular to become stable. If not\n * specified, whenStable() will wait forever.\n * @param updateCb Optional. If specified, this callback will be invoked whenever the set of\n * pending macrotasks changes. If this callback returns true doneCb will not be invoked\n * and no further updates will be issued.\n */\n whenStable(doneCb, timeout, updateCb) {\n if (updateCb && !this._taskTrackingZone) {\n throw new Error('Task tracking zone is required when passing an update callback to ' +\n 'whenStable(). Is \"zone.js/plugins/task-tracking\" loaded?');\n }\n this.addCallback(doneCb, timeout, updateCb);\n this._runCallbacksIfReady();\n }\n /**\n * Registers an application with a testability hook so that it can be tracked.\n * @param token token of application, root element\n *\n * @internal\n */\n registerApplication(token) {\n this.registry.registerApplication(token, this);\n }\n /**\n * Unregisters an application.\n * @param token token of application, root element\n *\n * @internal\n */\n unregisterApplication(token) {\n this.registry.unregisterApplication(token);\n }\n /**\n * Find providers by name\n * @param using The root element to search from\n * @param provider The name of binding variable\n * @param exactMatch Whether using exactMatch\n */\n findProviders(using, provider, exactMatch) {\n // TODO(juliemr): implement.\n return [];\n }\n static ɵfac = function Testability_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || Testability)(__inject(NgZone), __inject(TestabilityRegistry), __inject(TESTABILITY_GETTER)); };\n static ɵprov = /*@__PURE__*/ __defineInjectable({ token: Testability, factory: Testability.ɵfac });\n}\n(() => { (typeof ngDevMode === \"undefined\" || ngDevMode) && setClassMetadata(Testability, [{\n type: Injectable\n }], () => [{ type: NgZone }, { type: TestabilityRegistry }, { type: undefined, decorators: [{\n type: Inject,\n args: [TESTABILITY_GETTER]\n }] }], null); })();\n/**\n * A global registry of {@link Testability} instances for specific elements.\n * @publicApi\n */\nclass TestabilityRegistry {\n /** @internal */\n _applications = new Map();\n /**\n * Registers an application with a testability hook so that it can be tracked\n * @param token token of application, root element\n * @param testability Testability hook\n */\n registerApplication(token, testability) {\n this._applications.set(token, testability);\n }\n /**\n * Unregisters an application.\n * @param token token of application, root element\n */\n unregisterApplication(token) {\n this._applications.delete(token);\n }\n /**\n * Unregisters all applications\n */\n unregisterAllApplications() {\n this._applications.clear();\n }\n /**\n * Get a testability hook associated with the application\n * @param elem root element\n */\n getTestability(elem) {\n return this._applications.get(elem) || null;\n }\n /**\n * Get all registered testabilities\n */\n getAllTestabilities() {\n return Array.from(this._applications.values());\n }\n /**\n * Get all registered applications(root elements)\n */\n getAllRootElements() {\n return Array.from(this._applications.keys());\n }\n /**\n * Find testability of a node in the Tree\n * @param elem node\n * @param findInAncestors whether finding testability in ancestors if testability was not found in\n * current node\n */\n findTestabilityInTree(elem, findInAncestors = true) {\n return _testabilityGetter?.findTestabilityInTree(this, elem, findInAncestors) ?? null;\n }\n static ɵfac = function TestabilityRegistry_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TestabilityRegistry)(); };\n static ɵprov = /*@__PURE__*/ __defineInjectable({ token: TestabilityRegistry, factory: TestabilityRegistry.ɵfac, providedIn: 'platform' });\n}\n(() => { (typeof ngDevMode === \"undefined\" || ngDevMode) && setClassMetadata(TestabilityRegistry, [{\n type: Injectable,\n args: [{ providedIn: 'platform' }]\n }], null, null); })();\n/**\n * Set the {@link GetTestability} implementation used by the Angular testing framework.\n * @publicApi\n */\nfunction setTestabilityGetter(getter) {\n _testabilityGetter = getter;\n}\nlet _testabilityGetter;\n\n/**\n * Determine if the argument is shaped like a Promise\n */\nfunction isPromise(obj) {\n // allow any Promise/A+ compliant thenable.\n // It's up to the caller to ensure that obj.then conforms to the spec\n return !!obj && typeof obj.then === 'function';\n}\n/**\n * Determine if the argument is a Subscribable\n */\nfunction isSubscribable(obj) {\n return !!obj && typeof obj.subscribe === 'function';\n}\n\n/**\n * A DI token that you can use to provide\n * one or more initialization functions.\n *\n * The provided functions are injected at application startup and executed during\n * app initialization. If any of these functions returns a Promise or an Observable, initialization\n * does not complete until the Promise is resolved or the Observable is completed.\n *\n * You can, for example, create a factory function that loads language data\n * or an external configuration, and provide that function to the `APP_INITIALIZER` token.\n * The function is executed during the application bootstrap process,\n * and the needed data is available on startup.\n *\n * Note that the provided initializer is run in the injection context.\n *\n * @deprecated from v19.0.0, use provideAppInitializer instead\n *\n * @see {@link ApplicationInitStatus}\n * @see {@link provideAppInitializer}\n *\n * @usageNotes\n *\n * The following example illustrates how to configure a multi-provider using `APP_INITIALIZER` token\n * and a function returning a promise.\n * ### Example with NgModule-based application\n * ```ts\n * function initializeApp(): Promise<any> {\n * const http = inject(HttpClient);\n * return firstValueFrom(\n * http\n * .get(\"https://someUrl.com/api/user\")\n * .pipe(tap(user => { ... }))\n * );\n * }\n *\n * @NgModule({\n * imports: [BrowserModule],\n * declarations: [AppComponent],\n * bootstrap: [AppComponent],\n * providers: [{\n * provide: APP_INITIALIZER,\n * useValue: initializeApp,\n * multi: true,\n * }]\n * })\n * export class AppModule {}\n * ```\n *\n * ### Example with standalone application\n * ```ts\n * function initializeApp() {\n * const http = inject(HttpClient);\n * return firstValueFrom(\n * http\n * .get(\"https://someUrl.com/api/user\")\n * .pipe(tap(user => { ... }))\n * );\n * }\n *\n * bootstrapApplication(App, {\n * providers: [\n * provideHttpClient(),\n * {\n * provide: APP_INITIALIZER,\n * useValue: initializeApp,\n * multi: true,\n * },\n * ],\n * });\n\n * ```\n *\n *\n * It's also possible to configure a multi-provider using `APP_INITIALIZER` token and a function\n * returning an observable, see an example below. Note: the `HttpClient` in this example is used for\n * demo purposes to illustrate how the factory function can work with other providers available\n * through DI.\n *\n * ### Example with NgModule-based application\n * ```ts\n * function initializeApp() {\n * const http = inject(HttpClient);\n * return firstValueFrom(\n * http\n * .get(\"https://someUrl.com/api/user\")\n * .pipe(tap(user => { ... }))\n * );\n * }\n *\n * @NgModule({\n * imports: [BrowserModule, HttpClientModule],\n * declarations: [AppComponent],\n * bootstrap: [AppComponent],\n * providers: [{\n * provide: APP_INITIALIZER,\n * useValue: initializeApp,\n * multi: true,\n * }]\n * })\n * export class AppModule {}\n * ```\n *\n * ### Example with standalone application\n * ```ts\n * function initializeApp() {\n * const http = inject(HttpClient);\n * return firstValueFrom(\n * http\n * .get(\"https://someUrl.com/api/user\")\n * .pipe(tap(user => { ... }))\n * );\n * }\n *\n * bootstrapApplication(App, {\n * providers: [\n * provideHttpClient(),\n * {\n * provide: APP_INITIALIZER,\n * useValue: initializeApp,\n * multi: true,\n * },\n * ],\n * });\n * ```\n *\n * @publicApi\n */\nconst APP_INITIALIZER = new InjectionToken(ngDevMode ? 'Application Initializer' : '');\n/**\n * @description\n * The provided function is injected at application startup and executed during\n * app initialization. If the function returns a Promise or an Observable, initialization\n * does not complete until the Promise is resolved or the Observable is completed.\n *\n * You can, for example, create a function that loads language data\n * or an external configuration, and provide that function using `provideAppInitializer()`.\n * The function is executed during the application bootstrap process,\n * and the needed data is available on startup.\n *\n * Note that the provided initializer is run in the injection context.\n *\n * Previously, this was achieved using the `APP_INITIALIZER` token which is now deprecated.\n *\n * @see {@link APP_INITIALIZER}\n *\n * @usageNotes\n * The following example illustrates how to configure an initialization function using\n * `provideAppInitializer()`\n * ```ts\n * bootstrapApplication(App, {\n * providers: [\n * provideAppInitializer(() => {\n * const http = inject(HttpClient);\n * return firstValueFrom(\n * http\n * .get(\"https://someUrl.com/api/user\")\n * .pipe(tap(user => { ... }))\n * );\n * }),\n * provideHttpClient(),\n * ],\n * });\n * ```\n *\n * @publicApi\n */\nfunction provideAppInitializer(initializerFn) {\n return makeEnvironmentProviders([\n {\n provide: APP_INITIALIZER,\n multi: true,\n useValue: initializerFn,\n },\n ]);\n}\n/**\n * A class that reflects the state of running {@link APP_INITIALIZER} functions.\n *\n * @publicApi\n */\nclass ApplicationInitStatus {\n // Using non null assertion, these fields are defined below\n // within the `new Promise` callback (synchronously).\n resolve;\n reject;\n initialized = false;\n done = false;\n donePromise = new Promise((res, rej) => {\n this.resolve = res;\n this.reject = rej;\n });\n appInits = inject(APP_INITIALIZER, { optional: true }) ?? [];\n injector = inject(Injector);\n constructor() {\n if ((typeof ngDevMode === 'undefined' || ngDevMode) && !Array.isArray(this.appInits)) {\n throw new RuntimeError(-209 /* RuntimeErrorCode.INVALID_MULTI_PROVIDER */, 'Unexpected type of the `APP_INITIALIZER` token value ' +\n `(expected an array, but got ${typeof this.appInits}). ` +\n 'Please check that the `APP_INITIALIZER` token is configured as a ' +\n '`multi: true` provider.');\n }\n }\n /** @internal */\n runInitializers() {\n if (this.initialized) {\n return;\n }\n const asyncInitPromises = [];\n for (const appInits of this.appInits) {\n const initResult = runInInjectionContext(this.injector, appInits);\n if (isPromise(initResult)) {\n asyncInitPromises.push(initResult);\n }\n else if (isSubscribable(initResult)) {\n const observableAsPromise = new Promise((resolve, reject) => {\n initResult.subscribe({ complete: resolve, error: reject });\n });\n asyncInitPromises.push(observableAsPromise);\n }\n }\n const complete = () => {\n // @ts-expect-error overwriting a readonly\n this.done = true;\n this.resolve();\n };\n Promise.all(asyncInitPromises)\n .then(() => {\n complete();\n })\n .catch((e) => {\n this.reject(e);\n });\n if (asyncInitPromises.length === 0) {\n complete();\n }\n this.initialized = true;\n }\n static ɵfac = function ApplicationInitStatus_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ApplicationInitStatus)(); };\n static ɵprov = /*@__PURE__*/ __defineInjectable({ token: ApplicationInitStatus, factory: ApplicationInitStatus.ɵfac, providedIn: 'root' });\n}\n(() => { (typeof ngDevMode === \"undefined\" || ngDevMode) && setClassMetadata(ApplicationInitStatus, [{\n type: Injectable,\n args: [{ providedIn: 'root' }]\n }], () => [], null); })();\n\n/**\n * A DI token that provides a set of callbacks to\n * be called for every component that is bootstrapped.\n *\n * Each callback must take a `ComponentRef` instance and return nothing.\n *\n * `(componentRef: ComponentRef) => void`\n *\n * @publicApi\n */\nconst APP_BOOTSTRAP_LISTENER = new InjectionToken(ngDevMode ? 'appBootstrapListener' : '');\nfunction publishDefaultGlobalUtils() {\n ngDevMode && publishDefaultGlobalUtils$1();\n}\n/**\n * Sets the error for an invalid write to a signal to be an Angular `RuntimeError`.\n */\nfunction publishSignalConfiguration() {\n setThrowInvalidWriteToSignalError(() => {\n let errorMessage = '';\n if (ngDevMode) {\n const activeConsumer = getActiveConsumer();\n errorMessage =\n activeConsumer && isReactiveLViewConsumer(activeConsumer)\n ? 'Writing to signals is not allowed while Angular renders the template (eg. interpolations)'\n : 'Writing to signals is not allowed in a `computed`';\n }\n throw new RuntimeError(600 /* RuntimeErrorCode.SIGNAL_WRITE_FROM_ILLEGAL_CONTEXT */, errorMessage);\n });\n}\nfunction isBoundToModule(cf) {\n return cf.isBoundToModule;\n}\n/**\n * A token for third-party components that can register themselves with NgProbe.\n *\n * @deprecated\n * @publicApi\n */\nclass NgProbeToken {\n name;\n token;\n constructor(name, token) {\n this.name = name;\n this.token = token;\n }\n}\n/** Maximum number of times ApplicationRef will refresh all attached views in a single tick. */\nconst MAXIMUM_REFRESH_RERUNS = 10;\nfunction optionsReducer(dst, objs) {\n if (Array.isArray(objs)) {\n return objs.reduce(optionsReducer, dst);\n }\n return { ...dst, ...objs };\n}\n/**\n * A reference to an Angular application running on a page.\n *\n * @usageNotes\n * ### isStable examples and caveats\n *\n * Note two important points about `isStable`, demonstrated in the examples below:\n * - the application will never be stable if you start any kind\n * of recurrent asynchronous task when the application starts\n * (for example for a polling process, started with a `setInterval`, a `setTimeout`\n * or using RxJS operators like `interval`);\n * - the `isStable` Observable runs outside of the Angular zone.\n *\n * Let's imagine that you start a recurrent task\n * (here incrementing a counter, using RxJS `interval`),\n * and at the same time subscribe to `isStable`.\n *\n * ```ts\n * constructor(appRef: ApplicationRef) {\n * appRef.isStable.pipe(\n * filter(stable => stable)\n * ).subscribe(() => console.log('App is stable now');\n * interval(1000).subscribe(counter => console.log(counter));\n * }\n * ```\n * In this example, `isStable` will never emit `true`,\n * and the trace \"App is stable now\" will never get logged.\n *\n * If you want to execute something when the app is stable,\n * you have to wait for the application to be stable\n * before starting your polling process.\n *\n * ```ts\n * constructor(appRef: ApplicationRef) {\n * appRef.isStable.pipe(\n * first(stable => stable),\n * tap(stable => console.log('App is stable now')),\n * switchMap(() => interval(1000))\n * ).subscribe(counter => console.log(counter));\n * }\n * ```\n * In this example, the trace \"App is stable now\" will be logged\n * and then the counter starts incrementing every second.\n *\n * Note also that this Observable runs outside of the Angular zone,\n * which means that the code in the subscription\n * to this Observable will not trigger the change detection.\n *\n * Let's imagine that instead of logging the counter value,\n * you update a field of your component\n * and display it in its template.\n *\n * ```ts\n * constructor(appRef: ApplicationRef) {\n * appRef.isStable.pipe(\n * first(stable => stable),\n * switchMap(() => interval(1000))\n * ).subscribe(counter => this.value = counter);\n * }\n * ```\n * As the `isStable` Observable runs outside the zone,\n * the `value` field will be updated properly,\n * but the template will not be refreshed!\n *\n * You'll have to manually trigger the change detection to update the template.\n *\n * ```ts\n * constructor(appRef: ApplicationRef, cd: ChangeDetectorRef) {\n * appRef.isStable.pipe(\n * first(stable => stable),\n * switchMap(() => interval(1000))\n * ).subscribe(counter => {\n * this.value = counter;\n * cd.detectChanges();\n * });\n * }\n * ```\n *\n * Or make the subscription callback run inside the zone.\n *\n * ```ts\n * constructor(appRef: ApplicationRef, zone: NgZone) {\n * appRef.isStable.pipe(\n * first(stable => stable),\n * switchMap(() => interval(1000))\n * ).subscribe(counter => zone.run(() => this.value = counter));\n * }\n * ```\n *\n * @publicApi\n */\nclass ApplicationRef {\n /** @internal */\n _runningTick = false;\n _destroyed = false;\n _destroyListeners = [];\n /** @internal */\n _views = [];\n internalErrorHandler = inject(INTERNAL_APPLICATION_ERROR_HANDLER);\n afterRenderManager = inject(AfterRenderManager);\n zonelessEnabled = inject(ZONELESS_ENABLED);\n rootEffectScheduler = inject(EffectScheduler);\n /**\n * Current dirty state of the application across a number of dimensions (views, afterRender hooks,\n * etc).\n *\n * A flag set here means that `tick()` will attempt to resolve the dirtiness when executed.\n *\n * @internal\n */\n dirtyFlags = 0 /* ApplicationRefDirtyFlags.None */;\n /**\n * Most recent snapshot from the `TracingService`, if any.\n *\n * This snapshot attempts to capture the context when `tick()` was first\n * scheduled. It then runs wrapped in this context.\n *\n * @internal\n */\n tracingSnapshot = null;\n // Needed for ComponentFixture temporarily during migration of autoDetect behavior\n // Eventually the hostView of the fixture should just attach to ApplicationRef.\n allTestViews = new Set();\n autoDetectTestViews = new Set();\n includeAllTestViews = false;\n /** @internal */\n afterTick = new Subject();\n /** @internal */\n get allViews() {\n return [\n ...(this.includeAllTestViews ? this.allTestViews : this.autoDetectTestViews).keys(),\n ...this._views,\n ];\n }\n /**\n * Indicates whether this instance was destroyed.\n */\n get destroyed() {\n return this._destroyed;\n }\n /**\n * Get a list of component types registered to this application.\n * This list is populated even before the component is created.\n */\n componentTypes = [];\n /**\n * Get a list of components registered to this application.\n */\n components = [];\n internalPendingTask = inject(PendingTasksInternal);\n /**\n * Returns an Observable that indicates when the application is stable or unstable.\n */\n get isStable() {\n // This is a getter because it might be invoked after the application has been destroyed.\n return this.internalPendingTask.hasPendingTasksObservable.pipe(map((pending) => !pending));\n }\n constructor() {\n // Inject the tracing service to initialize it.\n inject(TracingService, { optional: true });\n }\n /**\n * @returns A promise that resolves when the application becomes stable\n */\n whenStable() {\n let subscription;\n return new Promise((resolve) => {\n subscription = this.isStable.subscribe({\n next: (stable) => {\n if (stable) {\n resolve();\n }\n },\n });\n }).finally(() => {\n subscription.unsubscribe();\n });\n }\n _injector = inject(EnvironmentInjector);\n _rendererFactory = null;\n /**\n * The `EnvironmentInjector` used to create this application.\n */\n get injector() {\n return this._injector;\n }\n /**\n * Bootstrap a component onto the element identified by its selector or, optionally, to a\n * specified element.\n *\n * @usageNotes\n * ### Bootstrap process\n *\n * When bootstrapping a component, Angular mounts it onto a target DOM element\n * and kicks off automatic change detection. The target DOM element can be\n * provided using the `rootSelectorOrNode` argument.\n *\n * If the target DOM element is not provided, Angular tries to find one on a page\n * using the `selector` of the component that is being bootstrapped\n * (first matched element is used).\n *\n * ### Example\n *\n * Generally, we define the component to bootstrap in the `bootstrap` array of `NgModule`,\n * but it requires us to know the component while writing the application code.\n *\n * Imagine a situation where we have to wait for an API call to decide about the component to\n * bootstrap. We can use the `ngDoBootstrap` hook of the `NgModule` and call this method to\n * dynamically bootstrap a component.\n *\n * {@example core/ts/platform/platform.ts region='componentSelector'}\n *\n * Optionally, a component can be mounted onto a DOM element that does not match the\n * selector of the bootstrapped component.\n *\n * In the following example, we are providing a CSS selector to match the target element.\n *\n * {@example core/ts/platform/platform.ts region='cssSelector'}\n *\n * While in this example, we are providing reference to a DOM node.\n *\n * {@example core/ts/platform/platform.ts region='domNode'}\n */\n bootstrap(componentOrFactory, rootSelectorOrNode) {\n return this.bootstrapImpl(componentOrFactory, rootSelectorOrNode);\n }\n bootstrapImpl(componentOrFactory, rootSelectorOrNode, injector = Injector.NULL) {\n const ngZone = this._injector.get(NgZone);\n return ngZone.run(() => {\n profiler(10 /* ProfilerEvent.BootstrapComponentStart */);\n (typeof ngDevMode === 'undefined' || ngDevMode) && warnIfDestroyed(this._destroyed);\n const isComponentFactory = componentOrFactory instanceof ComponentFactory$1;\n const initStatus = this._injector.get(ApplicationInitStatus);\n if (!initStatus.done) {\n let errorMessage = '';\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n const standalone = !isComponentFactory && isStandalone(componentOrFactory);\n errorMessage =\n 'Cannot bootstrap as there are still asynchronous initializers running.' +\n (standalone\n ? ''\n : ' Bootstrap components in the `ngDoBootstrap` method of the root module.');\n }\n throw new RuntimeError(405 /* RuntimeErrorCode.ASYNC_INITIALIZERS_STILL_RUNNING */, errorMessage);\n }\n let componentFactory;\n if (isComponentFactory) {\n componentFactory = componentOrFactory;\n }\n else {\n const resolver = this._injector.get(ComponentFactoryResolver$1);\n componentFactory = resolver.resolveComponentFactory(componentOrFactory);\n }\n this.componentTypes.push(componentFactory.componentType);\n // Create a factory associated with the current module if it's not bound to some other\n const ngModule = isBoundToModule(componentFactory)\n ? undefined\n : this._injector.get(NgModuleRef$1);\n const selectorOrNode = rootSelectorOrNode || componentFactory.selector;\n const compRef = componentFactory.create(injector, [], selectorOrNode, ngModule);\n const nativeElement = compRef.location.nativeElement;\n const testability = compRef.injector.get(TESTABILITY, null);\n testability?.registerApplication(nativeElement);\n compRef.onDestroy(() => {\n this.detachView(compRef.hostView);\n remove(this.components, compRef);\n testability?.unregisterApplication(nativeElement);\n });\n this._loadComponent(compRef);\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n const _console = this._injector.get(Console);\n _console.log(`Angular is running in development mode.`);\n }\n profiler(11 /* ProfilerEvent.BootstrapComponentEnd */, compRef);\n return compRef;\n });\n }\n /**\n * Invoke this method to explicitly process change detection and its side-effects.\n *\n * In development mode, `tick()` also performs a second change detection cycle to ensure that no\n * further changes are detected. If additional changes are picked up during this second cycle,\n * bindings in the app have side-effects that cannot be resolved in a single change detection\n * pass.\n * In this case, Angular throws an error, since an Angular application can only have one change\n * detection pass during which all change detection must complete.\n */\n tick() {\n if (!this.zonelessEnabled) {\n this.dirtyFlags |= 1 /* ApplicationRefDirtyFlags.ViewTreeGlobal */;\n }\n this._tick();\n }\n /** @internal */\n _tick() {\n profiler(12 /* ProfilerEvent.ChangeDetectionStart */);\n if (this.tracingSnapshot !== null) {\n // Ensure we always run `tickImpl()` in the context of the most recent snapshot,\n // if one exists. Snapshots may be reference counted by the implementation so\n // we want to ensure that if we request a snapshot that we use it.\n this.tracingSnapshot.run(TracingAction.CHANGE_DETECTION, this.tickImpl);\n }\n else {\n this.tickImpl();\n }\n }\n tickImpl = () => {\n (typeof ngDevMode === 'undefined' || ngDevMode) && warnIfDestroyed(this._destroyed);\n if (this._runningTick) {\n throw new RuntimeError(101 /* RuntimeErrorCode.RECURSIVE_APPLICATION_REF_TICK */, ngDevMode && 'ApplicationRef.tick is called recursively');\n }\n const prevConsumer = setActiveConsumer(null);\n try {\n this._runningTick = true;\n this.synchronize();\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n for (let view of this.allViews) {\n view.checkNoChanges();\n }\n }\n }\n finally {\n this._runningTick = false;\n this.tracingSnapshot?.dispose();\n this.tracingSnapshot = null;\n setActiveConsumer(prevConsumer);\n this.afterTick.next();\n profiler(13 /* ProfilerEvent.ChangeDetectionEnd */);\n }\n };\n /**\n * Performs the core work of synchronizing the application state with the UI, resolving any\n * pending dirtiness (potentially in a loop).\n */\n synchronize() {\n if (this._rendererFactory === null && !this._injector.destroyed) {\n this._rendererFactory = this._injector.get(RendererFactory2, null, { optional: true });\n }\n let runs = 0;\n while (this.dirtyFlags !== 0 /* ApplicationRefDirtyFlags.None */ && runs++ < MAXIMUM_REFRESH_RERUNS) {\n profiler(14 /* ProfilerEvent.ChangeDetectionSyncStart */);\n this.synchronizeOnce();\n profiler(15 /* ProfilerEvent.ChangeDetectionSyncEnd */);\n }\n if ((typeof ngDevMode === 'undefined' || ngDevMode) && runs >= MAXIMUM_REFRESH_RERUNS) {\n throw new RuntimeError(103 /* RuntimeErrorCode.INFINITE_CHANGE_DETECTION */, ngDevMode &&\n 'Infinite change detection while refreshing application views. ' +\n 'Ensure views are not calling `markForCheck` on every template execution or ' +\n 'that afterRender hooks always mark views for check.');\n }\n }\n /**\n * Perform a single synchronization pass.\n */\n synchronizeOnce() {\n // First, process any dirty root effects.\n if (this.dirtyFlags & 16 /* ApplicationRefDirtyFlags.RootEffects */) {\n this.dirtyFlags &= ~16 /* ApplicationRefDirtyFlags.RootEffects */;\n this.rootEffectScheduler.flush();\n }\n // First check dirty views, if there are any.\n let ranDetectChanges = false;\n if (this.dirtyFlags & 7 /* ApplicationRefDirtyFlags.ViewTreeAny */) {\n // Change detection on views starts in targeted mode (only check components if they're\n // marked as dirty) unless global checking is specifically requested via APIs like\n // `ApplicationRef.tick()` and the `NgZone` integration.\n const useGlobalCheck = Boolean(this.dirtyFlags & 1 /* ApplicationRefDirtyFlags.ViewTreeGlobal */);\n // Clear the view-related dirty flags.\n this.dirtyFlags &= ~7 /* ApplicationRefDirtyFlags.ViewTreeAny */;\n // Set the AfterRender bit, as we're checking views and will need to run afterRender hooks.\n this.dirtyFlags |= 8 /* ApplicationRefDirtyFlags.AfterRender */;\n // Check all potentially dirty views.\n for (let { _lView } of this.allViews) {\n // When re-checking, only check views which actually need it.\n if (!useGlobalCheck && !requiresRefreshOrTraversal(_lView)) {\n continue;\n }\n const mode = useGlobalCheck && !this.zonelessEnabled\n ? // Global mode includes `CheckAlways` views.\n 0 /* ChangeDetectionMode.Global */\n : // Only refresh views with the `RefreshView` flag or views is a changed signal\n 1 /* ChangeDetectionMode.Targeted */;\n detectChangesInternal(_lView, mode);\n ranDetectChanges = true;\n }\n // If `markForCheck()` was called during view checking, it will have set the `ViewTreeCheck`\n // flag. We clear the flag here because, for backwards compatibility, `markForCheck()`\n // during view checking doesn't cause the view to be re-checked.\n this.dirtyFlags &= ~4 /* ApplicationRefDirtyFlags.ViewTreeCheck */;\n // Check if any views are still dirty after checking and we need to loop back.\n this.syncDirtyFlagsWithViews();\n if (this.dirtyFlags &\n (7 /* ApplicationRefDirtyFlags.ViewTreeAny */ | 16 /* ApplicationRefDirtyFlags.RootEffects */)) {\n // If any views or effects are still dirty after checking, loop back before running render\n // hooks.\n return;\n }\n }\n if (!ranDetectChanges) {\n // If we skipped refreshing views above, there might still be unflushed animations\n // because we never called `detectChangesInternal` on the views.\n this._rendererFactory?.begin?.();\n this._rendererFactory?.end?.();\n }\n // Even if there were no dirty views, afterRender hooks might still be dirty.\n if (this.dirtyFlags & 8 /* ApplicationRefDirtyFlags.AfterRender */) {\n this.dirtyFlags &= ~8 /* ApplicationRefDirtyFlags.AfterRender */;\n this.afterRenderManager.execute();\n // afterRender hooks might influence dirty flags.\n }\n this.syncDirtyFlagsWithViews();\n }\n /**\n * Checks `allViews` for views which require refresh/traversal, and updates `dirtyFlags`\n * accordingly, with two potential behaviors:\n *\n * 1. If any of our views require updating, then this adds the `ViewTreeTraversal` dirty flag.\n * This _should_ be a no-op, since the scheduler should've added the flag at the same time the\n * view was marked as needing updating.\n *\n * TODO(alxhub): figure out if this behavior is still needed for edge cases.\n *\n * 2. If none of our views require updating, then clear the view-related `dirtyFlag`s. This\n * happens when the scheduler is notified of a view becoming dirty, but the view itself isn't\n * reachable through traversal from our roots (e.g. it's detached from the CD tree).\n */\n syncDirtyFlagsWithViews() {\n if (this.allViews.some(({ _lView }) => requiresRefreshOrTraversal(_lView))) {\n // If after running all afterRender callbacks new views are dirty, ensure we loop back.\n this.dirtyFlags |= 2 /* ApplicationRefDirtyFlags.ViewTreeTraversal */;\n return;\n }\n else {\n // Even though this flag may be set, none of _our_ views require traversal, and so the\n // `ApplicationRef` doesn't require any repeated checking.\n this.dirtyFlags &= ~7 /* ApplicationRefDirtyFlags.ViewTreeAny */;\n }\n }\n /**\n * Attaches a view so that it will be dirty checked.\n * The view will be automatically detached when it is destroyed.\n * This will throw if the view is already attached to a ViewContainer.\n */\n attachView(viewRef) {\n (typeof ngDevMode === 'undefined' || ngDevMode) && warnIfDestroyed(this._destroyed);\n const view = viewRef;\n this._views.push(view);\n view.attachToAppRef(this);\n }\n /**\n * Detaches a view from dirty checking again.\n */\n detachView(viewRef) {\n (typeof ngDevMode === 'undefined' || ngDevMode) && warnIfDestroyed(this._destroyed);\n const view = viewRef;\n remove(this._views, view);\n view.detachFromAppRef();\n }\n _loadComponent(componentRef) {\n this.attachView(componentRef.hostView);\n try {\n this.tick();\n }\n catch (e) {\n this.internalErrorHandler(e);\n }\n this.components.push(componentRef);\n // Get the listeners lazily to prevent DI cycles.\n const listeners = this._injector.get(APP_BOOTSTRAP_LISTENER, []);\n if (ngDevMode && !Array.isArray(listeners)) {\n throw new RuntimeError(-209 /* RuntimeErrorCode.INVALID_MULTI_PROVIDER */, 'Unexpected type of the `APP_BOOTSTRAP_LISTENER` token value ' +\n `(expected an array, but got ${typeof listeners}). ` +\n 'Please check that the `APP_BOOTSTRAP_LISTENER` token is configured as a ' +\n '`multi: true` provider.');\n }\n listeners.forEach((listener) => listener(componentRef));\n }\n /** @internal */\n ngOnDestroy() {\n if (this._destroyed)\n return;\n try {\n // Call all the lifecycle hooks.\n this._destroyListeners.forEach((listener) => listener());\n // Destroy all registered views.\n this._views.slice().forEach((view) => view.destroy());\n }\n finally {\n // Indicate that this instance is destroyed.\n this._destroyed = true;\n // Release all references.\n this._views = [];\n this._destroyListeners = [];\n }\n }\n /**\n * Registers a listener to be called when an instance is destroyed.\n *\n * @param callback A callback function to add as a listener.\n * @returns A function which unregisters a listener.\n */\n onDestroy(callback) {\n (typeof ngDevMode === 'undefined' || ngDevMode) && warnIfDestroyed(this._destroyed);\n this._destroyListeners.push(callback);\n return () => remove(this._destroyListeners, callback);\n }\n /**\n * Destroys an Angular application represented by this `ApplicationRef`. Calling this function\n * will destroy the associated environment injectors as well as all the bootstrapped components\n * with their views.\n */\n destroy() {\n if (this._destroyed) {\n throw new RuntimeError(406 /* RuntimeErrorCode.APPLICATION_REF_ALREADY_DESTROYED */, ngDevMode && 'This instance of the `ApplicationRef` has already been destroyed.');\n }\n const injector = this._injector;\n // Check that this injector instance supports destroy operation.\n if (injector.destroy && !injector.destroyed) {\n // Destroying an underlying injector will trigger the `ngOnDestroy` lifecycle\n // hook, which invokes the remaining cleanup actions.\n injector.destroy();\n }\n }\n /**\n * Returns the number of attached views.\n */\n get viewCount() {\n return this._views.length;\n }\n static ɵfac = function ApplicationRef_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ApplicationRef)(); };\n static ɵprov = /*@__PURE__*/ __defineInjectable({ token: ApplicationRef, factory: ApplicationRef.ɵfac, providedIn: 'root' });\n}\n(() => { (typeof ngDevMode === \"undefined\" || ngDevMode) && setClassMetadata(ApplicationRef, [{\n type: Injectable,\n args: [{ providedIn: 'root' }]\n }], () => [], null); })();\nfunction warnIfDestroyed(destroyed) {\n if (destroyed) {\n console.warn(formatRuntimeError(406 /* RuntimeErrorCode.APPLICATION_REF_ALREADY_DESTROYED */, 'This instance of the `ApplicationRef` has already been destroyed.'));\n }\n}\nfunction remove(list, el) {\n const index = list.indexOf(el);\n if (index > -1) {\n list.splice(index, 1);\n }\n}\n\n/**\n * Schedules triggering of a defer block for `on idle` and `on timer` conditions.\n */\nfunction scheduleDelayedTrigger(scheduleFn) {\n const lView = getLView();\n const tNode = getCurrentTNode();\n renderPlaceholder(lView, tNode);\n // Exit early to avoid invoking `scheduleFn`, which would\n // add `setTimeout` call and potentially delay serialization\n // on the server unnecessarily.\n if (!shouldTriggerDeferBlock(0 /* TriggerType.Regular */, lView))\n return;\n const injector = lView[INJECTOR];\n const lDetails = getLDeferBlockDetails(lView, tNode);\n const cleanupFn = scheduleFn(() => triggerDeferBlock(0 /* TriggerType.Regular */, lView, tNode), injector);\n storeTriggerCleanupFn(0 /* TriggerType.Regular */, lDetails, cleanupFn);\n}\n/**\n * Schedules prefetching for `on idle` and `on timer` triggers.\n *\n * @param scheduleFn A function that does the scheduling.\n */\nfunction scheduleDelayedPrefetching(scheduleFn, trigger) {\n if (typeof ngServerMode !== 'undefined' && ngServerMode)\n return;\n const lView = getLView();\n const injector = lView[INJECTOR];\n // Only trigger the scheduled trigger on the browser\n // since we don't want to delay the server response.\n const tNode = getCurrentTNode();\n const tView = lView[TVIEW];\n const tDetails = getTDeferBlockDetails(tView, tNode);\n if (tDetails.loadingState === DeferDependenciesLoadingState.NOT_STARTED) {\n const lDetails = getLDeferBlockDetails(lView, tNode);\n const prefetch = () => triggerPrefetching(tDetails, lView, tNode);\n const cleanupFn = scheduleFn(prefetch, injector);\n storeTriggerCleanupFn(1 /* TriggerType.Prefetch */, lDetails, cleanupFn);\n }\n}\n/**\n * Schedules hydration triggering of a defer block for `on idle` and `on timer` conditions.\n */\nfunction scheduleDelayedHydrating(scheduleFn, lView, tNode) {\n if (typeof ngServerMode !== 'undefined' && ngServerMode)\n return;\n // Only trigger the scheduled trigger on the browser\n // since we don't want to delay the server response.\n const injector = lView[INJECTOR];\n const lDetails = getLDeferBlockDetails(lView, tNode);\n const ssrUniqueId = lDetails[SSR_UNIQUE_ID];\n ngDevMode && assertSsrIdDefined(ssrUniqueId);\n const cleanupFn = scheduleFn(() => triggerHydrationFromBlockName(injector, ssrUniqueId), injector);\n storeTriggerCleanupFn(2 /* TriggerType.Hydrate */, lDetails, cleanupFn);\n}\n/**\n * Trigger prefetching of dependencies for a defer block.\n *\n * @param tDetails Static information about this defer block.\n * @param lView LView of a host view.\n * @param tNode TNode that represents a defer block.\n */\nfunction triggerPrefetching(tDetails, lView, tNode) {\n triggerResourceLoading(tDetails, lView, tNode);\n}\n/**\n * Trigger loading of defer block dependencies if the process hasn't started yet.\n *\n * @param tDetails Static information about this defer block.\n * @param lView LView of a host view.\n */\nfunction triggerResourceLoading(tDetails, lView, tNode) {\n const injector = lView[INJECTOR];\n const tView = lView[TVIEW];\n if (tDetails.loadingState !== DeferDependenciesLoadingState.NOT_STARTED) {\n // If the loading status is different from initial one, it means that\n // the loading of dependencies is in progress and there is nothing to do\n // in this function. All details can be obtained from the `tDetails` object.\n return tDetails.loadingPromise ?? Promise.resolve();\n }\n const lDetails = getLDeferBlockDetails(lView, tNode);\n const primaryBlockTNode = getPrimaryBlockTNode(tView, tDetails);\n // Switch from NOT_STARTED -> IN_PROGRESS state.\n tDetails.loadingState = DeferDependenciesLoadingState.IN_PROGRESS;\n // Prefetching is triggered, cleanup all registered prefetch triggers.\n invokeTriggerCleanupFns(1 /* TriggerType.Prefetch */, lDetails);\n let dependenciesFn = tDetails.dependencyResolverFn;\n if (ngDevMode) {\n // Check if dependency function interceptor is configured.\n const deferDependencyInterceptor = injector.get(DEFER_BLOCK_DEPENDENCY_INTERCEPTOR, null, {\n optional: true,\n });\n if (deferDependencyInterceptor) {\n dependenciesFn = deferDependencyInterceptor.intercept(dependenciesFn);\n }\n }\n // Indicate that an application is not stable and has a pending task.\n const removeTask = injector.get(PendingTasks).add();\n // The `dependenciesFn` might be `null` when all dependencies within\n // a given defer block were eagerly referenced elsewhere in a file,\n // thus no dynamic `import()`s were produced.\n if (!dependenciesFn) {\n tDetails.loadingPromise = Promise.resolve().then(() => {\n tDetails.loadingPromise = null;\n tDetails.loadingState = DeferDependenciesLoadingState.COMPLETE;\n removeTask();\n });\n return tDetails.loadingPromise;\n }\n // Start downloading of defer block dependencies.\n tDetails.loadingPromise = Promise.allSettled(dependenciesFn()).then((results) => {\n let failed = false;\n const directiveDefs = [];\n const pipeDefs = [];\n for (const result of results) {\n if (result.status === 'fulfilled') {\n const dependency = result.value;\n const directiveDef = getComponentDef(dependency) || getDirectiveDef(dependency);\n if (directiveDef) {\n directiveDefs.push(directiveDef);\n }\n else {\n const pipeDef = getPipeDef$1(dependency);\n if (pipeDef) {\n pipeDefs.push(pipeDef);\n }\n }\n }\n else {\n failed = true;\n break;\n }\n }\n if (failed) {\n tDetails.loadingState = DeferDependenciesLoadingState.FAILED;\n if (tDetails.errorTmplIndex === null) {\n const templateLocation = ngDevMode ? getTemplateLocationDetails(lView) : '';\n const error = new RuntimeError(-750 /* RuntimeErrorCode.DEFER_LOADING_FAILED */, ngDevMode &&\n 'Loading dependencies for `@defer` block failed, ' +\n `but no \\`@error\\` block was configured${templateLocation}. ` +\n 'Consider using the `@error` block to render an error state.');\n handleUncaughtError(lView, error);\n }\n }\n else {\n tDetails.loadingState = DeferDependenciesLoadingState.COMPLETE;\n // Update directive and pipe registries to add newly downloaded dependencies.\n const primaryBlockTView = primaryBlockTNode.tView;\n if (directiveDefs.length > 0) {\n primaryBlockTView.directiveRegistry = addDepsToRegistry(primaryBlockTView.directiveRegistry, directiveDefs);\n // Extract providers from all NgModules imported by standalone components\n // used within this defer block.\n const directiveTypes = directiveDefs.map((def) => def.type);\n const providers = internalImportProvidersFrom(false, ...directiveTypes);\n tDetails.providers = providers;\n }\n if (pipeDefs.length > 0) {\n primaryBlockTView.pipeRegistry = addDepsToRegistry(primaryBlockTView.pipeRegistry, pipeDefs);\n }\n }\n });\n return tDetails.loadingPromise.finally(() => {\n // Loading is completed, we no longer need the loading Promise\n // and a pending task should also be removed.\n tDetails.loadingPromise = null;\n removeTask();\n });\n}\n/**\n * Defines whether we should proceed with triggering a given defer block.\n */\nfunction shouldTriggerDeferBlock(triggerType, lView) {\n // prevents triggering regular triggers when on the server.\n if (triggerType === 0 /* TriggerType.Regular */ && typeof ngServerMode !== 'undefined' && ngServerMode) {\n return false;\n }\n // prevents triggering in the case of a test run with manual defer block configuration.\n const injector = lView[INJECTOR];\n const config = injector.get(DEFER_BLOCK_CONFIG, null, { optional: true });\n if (config?.behavior === DeferBlockBehavior.Manual) {\n return false;\n }\n return true;\n}\n/**\n * Attempts to trigger loading of defer block dependencies.\n * If the block is already in a loading, completed or an error state -\n * no additional actions are taken.\n */\nfunction triggerDeferBlock(triggerType, lView, tNode) {\n const tView = lView[TVIEW];\n const lContainer = lView[tNode.index];\n ngDevMode && assertLContainer(lContainer);\n if (!shouldTriggerDeferBlock(triggerType, lView))\n return;\n const lDetails = getLDeferBlockDetails(lView, tNode);\n const tDetails = getTDeferBlockDetails(tView, tNode);\n // Defer block is triggered, cleanup all registered trigger functions.\n invokeAllTriggerCleanupFns(lDetails);\n switch (tDetails.loadingState) {\n case DeferDependenciesLoadingState.NOT_STARTED:\n renderDeferBlockState(DeferBlockState.Loading, tNode, lContainer);\n triggerResourceLoading(tDetails, lView, tNode);\n // The `loadingState` might have changed to \"loading\".\n if (tDetails.loadingState ===\n DeferDependenciesLoadingState.IN_PROGRESS) {\n renderDeferStateAfterResourceLoading(tDetails, tNode, lContainer);\n }\n break;\n case DeferDependenciesLoadingState.IN_PROGRESS:\n renderDeferBlockState(DeferBlockState.Loading, tNode, lContainer);\n renderDeferStateAfterResourceLoading(tDetails, tNode, lContainer);\n break;\n case DeferDependenciesLoadingState.COMPLETE:\n ngDevMode && assertDeferredDependenciesLoaded(tDetails);\n renderDeferBlockState(DeferBlockState.Complete, tNode, lContainer);\n break;\n case DeferDependenciesLoadingState.FAILED:\n renderDeferBlockState(DeferBlockState.Error, tNode, lContainer);\n break;\n default:\n if (ngDevMode) {\n throwError('Unknown defer block state');\n }\n }\n}\n/**\n * The core mechanism for incremental hydration. This triggers or\n * queues hydration for all the blocks in the tree that need to be hydrated\n * and keeps track of all those blocks that were hydrated along the way.\n *\n * Note: the `replayQueuedEventsFn` is only provided when hydration is invoked\n * as a result of an event replay (via JsAction). When hydration is invoked from\n * an instruction set (e.g. `deferOnImmediate`) - there is no need to replay any\n * events.\n */\nasync function triggerHydrationFromBlockName(injector, blockName, replayQueuedEventsFn) {\n const dehydratedBlockRegistry = injector.get(DEHYDRATED_BLOCK_REGISTRY);\n const blocksBeingHydrated = dehydratedBlockRegistry.hydrating;\n // Make sure we don't hydrate/trigger the same thing multiple times\n if (blocksBeingHydrated.has(blockName)) {\n return;\n }\n // Trigger resource loading and hydration for the blocks in the queue in the order of highest block\n // to lowest block. Once a block has finished resource loading, after next render fires after hydration\n // finishes. The new block will have its defer instruction called and will be in the registry.\n // Due to timing related to potential nested control flow, this has to be scheduled after the next render.\n const { parentBlockPromise, hydrationQueue } = getParentBlockHydrationQueue(blockName, injector);\n if (hydrationQueue.length === 0)\n return;\n // It's possible that the hydrationQueue topmost item is actually in the process of hydrating and has\n // a promise already. In that case, we don't want to destroy that promise and queue it again.\n if (parentBlockPromise !== null) {\n hydrationQueue.shift();\n }\n // The hydrating map in the registry prevents re-triggering hydration for a block that's already in\n // the hydration queue. Here we generate promises for each of the blocks about to be hydrated\n populateHydratingStateForQueue(dehydratedBlockRegistry, hydrationQueue);\n // We await this after populating the hydration state so we can prevent re-triggering hydration for\n // the same blocks while this promise is being awaited.\n if (parentBlockPromise !== null) {\n await parentBlockPromise;\n }\n const topmostParentBlock = hydrationQueue[0];\n if (dehydratedBlockRegistry.has(topmostParentBlock)) {\n // the topmost parent block is already in the registry and we can proceed\n // with hydration.\n await triggerHydrationForBlockQueue(injector, hydrationQueue, replayQueuedEventsFn);\n }\n else {\n // the topmost parent block is not yet in the registry, which may mean\n // a lazy loaded route, a control flow branch was taken, a route has\n // been navigated, etc. So we need to queue up the hydration process\n // so that it can be finished after the top block has had its defer\n // instruction executed.\n dehydratedBlockRegistry.awaitParentBlock(topmostParentBlock, async () => await triggerHydrationForBlockQueue(injector, hydrationQueue, replayQueuedEventsFn));\n }\n}\n/**\n * The core mechanism for incremental hydration. This triggers\n * hydration for all the blocks in the tree that need to be hydrated\n * and keeps track of all those blocks that were hydrated along the way.\n *\n * Note: the `replayQueuedEventsFn` is only provided when hydration is invoked\n * as a result of an event replay (via JsAction). When hydration is invoked from\n * an instruction set (e.g. `deferOnImmediate`) - there is no need to replay any\n * events.\n */\nasync function triggerHydrationForBlockQueue(injector, hydrationQueue, replayQueuedEventsFn) {\n const dehydratedBlockRegistry = injector.get(DEHYDRATED_BLOCK_REGISTRY);\n const blocksBeingHydrated = dehydratedBlockRegistry.hydrating;\n // Indicate that we have some pending async work.\n const pendingTasks = injector.get(PendingTasksInternal);\n const taskId = pendingTasks.add();\n // Actually do the triggering and hydration of the queue of blocks\n for (let blockQueueIdx = 0; blockQueueIdx < hydrationQueue.length; blockQueueIdx++) {\n const dehydratedBlockId = hydrationQueue[blockQueueIdx];\n const dehydratedDeferBlock = dehydratedBlockRegistry.get(dehydratedBlockId);\n if (dehydratedDeferBlock != null) {\n // trigger the block resources and await next render for hydration. This should result\n // in the next block ɵɵdefer instruction being called and that block being added to the dehydrated registry.\n await triggerResourceLoadingForHydration(dehydratedDeferBlock);\n await nextRender(injector);\n // if the content has changed since server rendering, we need to check for the expected block\n // being in the registry or if errors occurred. In that case, we need to clean up the remaining expected\n // content that won't be rendered or fetched.\n if (deferBlockHasErrored(dehydratedDeferBlock)) {\n // Either the expected block has not yet had its ɵɵdefer instruction called or the block errored out when fetching\n // resources. In the former case, either we're hydrating too soon or the client and server differ. In both cases,\n // we need to clean up child content and promises.\n removeDehydratedViewList(dehydratedDeferBlock);\n cleanupRemainingHydrationQueue(hydrationQueue.slice(blockQueueIdx), dehydratedBlockRegistry);\n break;\n }\n // The defer block has not errored and we've finished fetching resources and rendering.\n // At this point it is safe to resolve the hydration promise.\n blocksBeingHydrated.get(dehydratedBlockId).resolve();\n }\n else {\n // The expected block has not yet had its ɵɵdefer instruction called. This is likely due to content changing between\n // client and server. We need to clean up the dehydrated DOM in the container since it no longer is valid.\n cleanupParentContainer(blockQueueIdx, hydrationQueue, dehydratedBlockRegistry);\n cleanupRemainingHydrationQueue(hydrationQueue.slice(blockQueueIdx), dehydratedBlockRegistry);\n break;\n }\n }\n const lastBlockName = hydrationQueue[hydrationQueue.length - 1];\n // Await hydration completion for the last block.\n await blocksBeingHydrated.get(lastBlockName)?.promise;\n // All async work is done, remove the taskId from the registry.\n pendingTasks.remove(taskId);\n // Replay any queued events, if any exist and the replay operation was requested.\n if (replayQueuedEventsFn) {\n replayQueuedEventsFn(hydrationQueue);\n }\n // Cleanup after hydration of all affected defer blocks.\n cleanupHydratedDeferBlocks(dehydratedBlockRegistry.get(lastBlockName), hydrationQueue, dehydratedBlockRegistry, injector.get(ApplicationRef));\n}\nfunction deferBlockHasErrored(deferBlock) {\n return (getLDeferBlockDetails(deferBlock.lView, deferBlock.tNode)[DEFER_BLOCK_STATE] ===\n DeferBlockState.Error);\n}\n/**\n * Clean up the parent container of a block where content changed between server and client.\n * The parent of a block going through `triggerHydrationFromBlockName` will contain the\n * dehydrated content that needs to be cleaned up. So we have to do the clean up from that location\n * in the tree.\n */\nfunction cleanupParentContainer(currentBlockIdx, hydrationQueue, dehydratedBlockRegistry) {\n // If a parent block exists, it's in the hydration queue in front of the current block.\n const parentDeferBlockIdx = currentBlockIdx - 1;\n const parentDeferBlock = parentDeferBlockIdx > -1\n ? dehydratedBlockRegistry.get(hydrationQueue[parentDeferBlockIdx])\n : null;\n if (parentDeferBlock) {\n cleanupLContainer(parentDeferBlock.lContainer);\n }\n}\nfunction cleanupRemainingHydrationQueue(hydrationQueue, dehydratedBlockRegistry) {\n const blocksBeingHydrated = dehydratedBlockRegistry.hydrating;\n for (const dehydratedBlockId in hydrationQueue) {\n blocksBeingHydrated.get(dehydratedBlockId)?.reject();\n }\n dehydratedBlockRegistry.cleanup(hydrationQueue);\n}\n/**\n * Generates a new promise for every defer block in the hydrating queue\n */\nfunction populateHydratingStateForQueue(registry, queue) {\n for (let blockId of queue) {\n registry.hydrating.set(blockId, Promise.withResolvers());\n }\n}\n// Waits for the next render cycle to complete\nfunction nextRender(injector) {\n return new Promise((resolveFn) => afterNextRender(resolveFn, { injector }));\n}\nasync function triggerResourceLoadingForHydration(dehydratedBlock) {\n const { tNode, lView } = dehydratedBlock;\n const lDetails = getLDeferBlockDetails(lView, tNode);\n return new Promise((resolve) => {\n onDeferBlockCompletion(lDetails, resolve);\n triggerDeferBlock(2 /* TriggerType.Hydrate */, lView, tNode);\n });\n}\n/**\n * Registers cleanup functions for a defer block when the block has finished\n * fetching and rendering\n */\nfunction onDeferBlockCompletion(lDetails, callback) {\n if (!Array.isArray(lDetails[ON_COMPLETE_FNS])) {\n lDetails[ON_COMPLETE_FNS] = [];\n }\n lDetails[ON_COMPLETE_FNS].push(callback);\n}\n/**\n * Determines whether specific trigger types should be attached during an instruction firing\n * to ensure the proper triggers for a given type are used.\n */\nfunction shouldAttachTrigger(triggerType, lView, tNode) {\n if (triggerType === 0 /* TriggerType.Regular */) {\n return shouldAttachRegularTrigger(lView, tNode);\n }\n else if (triggerType === 2 /* TriggerType.Hydrate */) {\n return !shouldAttachRegularTrigger(lView, tNode);\n }\n // TriggerType.Prefetch is active only on the client\n return !(typeof ngServerMode !== 'undefined' && ngServerMode);\n}\n/** Whether a given defer block has `hydrate` triggers. */\nfunction hasHydrateTriggers(flags) {\n return (flags != null &&\n (flags & 1 /* TDeferDetailsFlags.HasHydrateTriggers */) === 1 /* TDeferDetailsFlags.HasHydrateTriggers */);\n}\n/**\n * Defines whether a regular trigger logic (e.g. \"on viewport\") should be attached\n * to a defer block. This function defines a condition, which mutually excludes\n * `deferOn*` and `deferHydrateOn*` triggers, to make sure only one of the trigger\n * types is active for a block with the current state.\n */\nfunction shouldAttachRegularTrigger(lView, tNode) {\n const injector = lView[INJECTOR];\n const tDetails = getTDeferBlockDetails(lView[TVIEW], tNode);\n const incrementalHydrationEnabled = isIncrementalHydrationEnabled(injector);\n const _hasHydrateTriggers = hasHydrateTriggers(tDetails.flags);\n // On the server:\n if (typeof ngServerMode !== 'undefined' && ngServerMode) {\n // Regular triggers are activated on the server when:\n // - Either Incremental Hydration is *not* enabled\n // - Or Incremental Hydration is enabled, but a given block doesn't have \"hydrate\" triggers\n return !incrementalHydrationEnabled || !_hasHydrateTriggers;\n }\n // On the client:\n const lDetails = getLDeferBlockDetails(lView, tNode);\n const wasServerSideRendered = lDetails[SSR_UNIQUE_ID] !== null;\n if (_hasHydrateTriggers && wasServerSideRendered && incrementalHydrationEnabled) {\n return false;\n }\n return true;\n}\n/**\n * Retrives a Defer Block's list of hydration triggers\n */\nfunction getHydrateTriggers(tView, tNode) {\n const tDetails = getTDeferBlockDetails(tView, tNode);\n return (tDetails.hydrateTriggers ??= new Map());\n}\n/**\n * Loops through all defer block summaries and ensures all the blocks triggers are\n * properly initialized\n */\nfunction processAndInitTriggers(injector, blockData, nodes) {\n const idleElements = [];\n const timerElements = [];\n const viewportElements = [];\n const immediateElements = [];\n for (let [blockId, blockSummary] of blockData) {\n const commentNode = nodes.get(blockId);\n if (commentNode !== undefined) {\n const numRootNodes = blockSummary.data[NUM_ROOT_NODES];\n let currentNode = commentNode;\n for (let i = 0; i < numRootNodes; i++) {\n currentNode = currentNode.previousSibling;\n if (currentNode.nodeType !== Node.ELEMENT_NODE) {\n continue;\n }\n const elementTrigger = { el: currentNode, blockName: blockId };\n // hydrate\n if (blockSummary.hydrate.idle) {\n idleElements.push(elementTrigger);\n }\n if (blockSummary.hydrate.immediate) {\n immediateElements.push(elementTrigger);\n }\n if (blockSummary.hydrate.timer !== null) {\n elementTrigger.delay = blockSummary.hydrate.timer;\n timerElements.push(elementTrigger);\n }\n if (blockSummary.hydrate.viewport) {\n viewportElements.push(elementTrigger);\n }\n }\n }\n }\n setIdleTriggers(injector, idleElements);\n setImmediateTriggers(injector, immediateElements);\n setViewportTriggers(injector, viewportElements);\n setTimerTriggers(injector, timerElements);\n}\nfunction setIdleTriggers(injector, elementTriggers) {\n for (const elementTrigger of elementTriggers) {\n const registry = injector.get(DEHYDRATED_BLOCK_REGISTRY);\n const onInvoke = () => triggerHydrationFromBlockName(injector, elementTrigger.blockName);\n const cleanupFn = onIdle(onInvoke, injector);\n registry.addCleanupFn(elementTrigger.blockName, cleanupFn);\n }\n}\nfunction setViewportTriggers(injector, elementTriggers) {\n if (elementTriggers.length > 0) {\n const registry = injector.get(DEHYDRATED_BLOCK_REGISTRY);\n for (let elementTrigger of elementTriggers) {\n const cleanupFn = onViewportWrapper(elementTrigger.el, () => triggerHydrationFromBlockName(injector, elementTrigger.blockName), injector);\n registry.addCleanupFn(elementTrigger.blockName, cleanupFn);\n }\n }\n}\nfunction setTimerTriggers(injector, elementTriggers) {\n for (const elementTrigger of elementTriggers) {\n const registry = injector.get(DEHYDRATED_BLOCK_REGISTRY);\n const onInvoke = () => triggerHydrationFromBlockName(injector, elementTrigger.blockName);\n const timerFn = onTimer(elementTrigger.delay);\n const cleanupFn = timerFn(onInvoke, injector);\n registry.addCleanupFn(elementTrigger.blockName, cleanupFn);\n }\n}\nfunction setImmediateTriggers(injector, elementTriggers) {\n for (const elementTrigger of elementTriggers) {\n // Note: we intentionally avoid awaiting each call and instead kick off\n // the hydration process simultaneously for all defer blocks with this trigger;\n triggerHydrationFromBlockName(injector, elementTrigger.blockName);\n }\n}\n\n/**\n * Indicates whether we've already produced a warning,\n * prevents the logic from producing it multiple times.\n */\nlet _hmrWarningProduced = false;\n/**\n * Logs a message into the console to indicate that `@defer` block\n * dependencies are loaded eagerly when the HMR mode is enabled.\n */\nfunction logHmrWarning(injector) {\n if (!_hmrWarningProduced) {\n _hmrWarningProduced = true;\n const console = injector.get(Console);\n // tslint:disable-next-line:no-console\n console.log(formatRuntimeError(-751 /* RuntimeErrorCode.DEFER_IN_HMR_MODE */, 'Angular has detected that this application contains `@defer` blocks ' +\n 'and the hot module replacement (HMR) mode is enabled. All `@defer` ' +\n 'block dependencies will be loaded eagerly.'));\n }\n}\n/**\n * Creates runtime data structures for defer blocks.\n *\n * @param index Index of the `defer` instruction.\n * @param primaryTmplIndex Index of the template with the primary block content.\n * @param dependencyResolverFn Function that contains dependencies for this defer block.\n * @param loadingTmplIndex Index of the template with the loading block content.\n * @param placeholderTmplIndex Index of the template with the placeholder block content.\n * @param errorTmplIndex Index of the template with the error block content.\n * @param loadingConfigIndex Index in the constants array of the configuration of the loading.\n * block.\n * @param placeholderConfigIndex Index in the constants array of the configuration of the\n * placeholder block.\n * @param enableTimerScheduling Function that enables timer-related scheduling if `after`\n * or `minimum` parameters are setup on the `@loading` or `@placeholder` blocks.\n * @param flags A set of flags to define a particular behavior (e.g. to indicate that\n * hydrate triggers are present and regular triggers should be deactivated\n * in certain scenarios).\n *\n * @codeGenApi\n */\nfunction ɵɵdefer(index, primaryTmplIndex, dependencyResolverFn, loadingTmplIndex, placeholderTmplIndex, errorTmplIndex, loadingConfigIndex, placeholderConfigIndex, enableTimerScheduling, flags) {\n const lView = getLView();\n const tView = getTView();\n const adjustedIndex = index + HEADER_OFFSET;\n const tNode = declareNoDirectiveHostTemplate(lView, tView, index, null, 0, 0);\n const injector = lView[INJECTOR];\n if (tView.firstCreatePass) {\n performanceMarkFeature('NgDefer');\n if (ngDevMode) {\n if (typeof ngHmrMode !== 'undefined' && ngHmrMode) {\n logHmrWarning(injector);\n }\n if (hasHydrateTriggers(flags)) {\n assertIncrementalHydrationIsConfigured(injector);\n }\n }\n const tDetails = {\n primaryTmplIndex,\n loadingTmplIndex: loadingTmplIndex ?? null,\n placeholderTmplIndex: placeholderTmplIndex ?? null,\n errorTmplIndex: errorTmplIndex ?? null,\n placeholderBlockConfig: null,\n loadingBlockConfig: null,\n dependencyResolverFn: dependencyResolverFn ?? null,\n loadingState: DeferDependenciesLoadingState.NOT_STARTED,\n loadingPromise: null,\n providers: null,\n hydrateTriggers: null,\n debug: null,\n flags: flags ?? 0 /* TDeferDetailsFlags.Default */,\n };\n enableTimerScheduling?.(tView, tDetails, placeholderConfigIndex, loadingConfigIndex);\n setTDeferBlockDetails(tView, adjustedIndex, tDetails);\n }\n const lContainer = lView[adjustedIndex];\n // If hydration is enabled, looks up dehydrated views in the DOM\n // using hydration annotation info and stores those views on LContainer.\n // In client-only mode, this function is a noop.\n populateDehydratedViewsInLContainer(lContainer, tNode, lView);\n let ssrBlockState = null;\n let ssrUniqueId = null;\n if (lContainer[DEHYDRATED_VIEWS]?.length > 0) {\n const info = lContainer[DEHYDRATED_VIEWS][0].data;\n ssrUniqueId = info[DEFER_BLOCK_ID] ?? null;\n ssrBlockState = info[DEFER_BLOCK_STATE$1];\n }\n // Init instance-specific defer details and store it.\n const lDetails = [\n null, // NEXT_DEFER_BLOCK_STATE\n DeferBlockInternalState.Initial, // DEFER_BLOCK_STATE\n null, // STATE_IS_FROZEN_UNTIL\n null, // LOADING_AFTER_CLEANUP_FN\n null, // TRIGGER_CLEANUP_FNS\n null, // PREFETCH_TRIGGER_CLEANUP_FNS\n ssrUniqueId, // SSR_UNIQUE_ID\n ssrBlockState, // SSR_BLOCK_STATE\n null, // ON_COMPLETE_FNS\n null, // HYDRATE_TRIGGER_CLEANUP_FNS\n ];\n setLDeferBlockDetails(lView, adjustedIndex, lDetails);\n let registry = null;\n if (ssrUniqueId !== null) {\n // Store this defer block in the registry, to have an access to\n // internal data structures from hydration runtime code.\n registry = injector.get(DEHYDRATED_BLOCK_REGISTRY);\n registry.add(ssrUniqueId, { lView, tNode, lContainer });\n }\n const onLViewDestroy = () => {\n invokeAllTriggerCleanupFns(lDetails);\n if (ssrUniqueId !== null) {\n registry?.cleanup([ssrUniqueId]);\n }\n };\n // When defer block is triggered - unsubscribe from LView destroy cleanup.\n storeTriggerCleanupFn(0 /* TriggerType.Regular */, lDetails, () => removeLViewOnDestroy(lView, onLViewDestroy));\n storeLViewOnDestroy(lView, onLViewDestroy);\n}\n/**\n * Loads defer block dependencies when a trigger value becomes truthy.\n * @codeGenApi\n */\nfunction ɵɵdeferWhen(rawValue) {\n const lView = getLView();\n const tNode = getSelectedTNode();\n if (ngDevMode) {\n trackTriggerForDebugging(lView[TVIEW], tNode, 'when <expression>');\n }\n if (!shouldAttachTrigger(0 /* TriggerType.Regular */, lView, tNode))\n return;\n const bindingIndex = nextBindingIndex();\n if (bindingUpdated(lView, bindingIndex, rawValue)) {\n const prevConsumer = setActiveConsumer(null);\n try {\n const value = Boolean(rawValue); // handle truthy or falsy values\n const lDetails = getLDeferBlockDetails(lView, tNode);\n const renderedState = lDetails[DEFER_BLOCK_STATE];\n if (value === false && renderedState === DeferBlockInternalState.Initial) {\n // If nothing is rendered yet, render a placeholder (if defined).\n renderPlaceholder(lView, tNode);\n }\n else if (value === true &&\n (renderedState === DeferBlockInternalState.Initial ||\n renderedState === DeferBlockState.Placeholder)) {\n triggerDeferBlock(0 /* TriggerType.Regular */, lView, tNode);\n }\n }\n finally {\n setActiveConsumer(prevConsumer);\n }\n }\n}\n/**\n * Prefetches the deferred content when a value becomes truthy.\n * @codeGenApi\n */\nfunction ɵɵdeferPrefetchWhen(rawValue) {\n const lView = getLView();\n const tNode = getSelectedTNode();\n if (ngDevMode) {\n trackTriggerForDebugging(lView[TVIEW], tNode, 'prefetch when <expression>');\n }\n if (!shouldAttachTrigger(1 /* TriggerType.Prefetch */, lView, tNode))\n return;\n const bindingIndex = nextBindingIndex();\n if (bindingUpdated(lView, bindingIndex, rawValue)) {\n const prevConsumer = setActiveConsumer(null);\n try {\n const value = Boolean(rawValue); // handle truthy or falsy values\n const tView = lView[TVIEW];\n const tNode = getSelectedTNode();\n const tDetails = getTDeferBlockDetails(tView, tNode);\n if (value === true && tDetails.loadingState === DeferDependenciesLoadingState.NOT_STARTED) {\n // If loading has not been started yet, trigger it now.\n triggerPrefetching(tDetails, lView, tNode);\n }\n }\n finally {\n setActiveConsumer(prevConsumer);\n }\n }\n}\n/**\n * Hydrates the deferred content when a value becomes truthy.\n * @codeGenApi\n */\nfunction ɵɵdeferHydrateWhen(rawValue) {\n const lView = getLView();\n const tNode = getSelectedTNode();\n if (ngDevMode) {\n trackTriggerForDebugging(lView[TVIEW], tNode, 'hydrate when <expression>');\n }\n if (!shouldAttachTrigger(2 /* TriggerType.Hydrate */, lView, tNode))\n return;\n // TODO(incremental-hydration): audit all defer instructions to reduce unnecessary work by\n // moving function calls inside their relevant control flow blocks\n const bindingIndex = nextBindingIndex();\n const tView = getTView();\n const hydrateTriggers = getHydrateTriggers(tView, tNode);\n hydrateTriggers.set(6 /* DeferBlockTrigger.When */, null);\n if (bindingUpdated(lView, bindingIndex, rawValue)) {\n if (typeof ngServerMode !== 'undefined' && ngServerMode) {\n // We are on the server and SSR for defer blocks is enabled.\n triggerDeferBlock(2 /* TriggerType.Hydrate */, lView, tNode);\n }\n else {\n const injector = lView[INJECTOR];\n const prevConsumer = setActiveConsumer(null);\n try {\n const value = Boolean(rawValue); // handle truthy or falsy values\n if (value === true) {\n // The `when` condition has changed to `true`, trigger defer block loading\n // if the block is either in initial (nothing is rendered) or a placeholder\n // state.\n const lDetails = getLDeferBlockDetails(lView, tNode);\n const ssrUniqueId = lDetails[SSR_UNIQUE_ID];\n ngDevMode && assertSsrIdDefined(ssrUniqueId);\n triggerHydrationFromBlockName(injector, ssrUniqueId);\n }\n }\n finally {\n setActiveConsumer(prevConsumer);\n }\n }\n }\n}\n/**\n * Specifies that hydration never occurs.\n * @codeGenApi\n */\nfunction ɵɵdeferHydrateNever() {\n const lView = getLView();\n const tNode = getCurrentTNode();\n if (ngDevMode) {\n trackTriggerForDebugging(lView[TVIEW], tNode, 'hydrate never');\n }\n if (!shouldAttachTrigger(2 /* TriggerType.Hydrate */, lView, tNode))\n return;\n const hydrateTriggers = getHydrateTriggers(getTView(), tNode);\n hydrateTriggers.set(7 /* DeferBlockTrigger.Never */, null);\n if (typeof ngServerMode !== 'undefined' && ngServerMode) {\n // We are on the server and SSR for defer blocks is enabled.\n triggerDeferBlock(2 /* TriggerType.Hydrate */, lView, tNode);\n }\n}\n/**\n * Sets up logic to handle the `on idle` deferred trigger.\n * @codeGenApi\n */\nfunction ɵɵdeferOnIdle() {\n const lView = getLView();\n const tNode = getCurrentTNode();\n if (ngDevMode) {\n trackTriggerForDebugging(lView[TVIEW], tNode, 'on idle');\n }\n if (!shouldAttachTrigger(0 /* TriggerType.Regular */, lView, tNode))\n return;\n scheduleDelayedTrigger(onIdle);\n}\n/**\n * Sets up logic to handle the `prefetch on idle` deferred trigger.\n * @codeGenApi\n */\nfunction ɵɵdeferPrefetchOnIdle() {\n const lView = getLView();\n const tNode = getCurrentTNode();\n if (ngDevMode) {\n trackTriggerForDebugging(lView[TVIEW], tNode, 'prefetch on idle');\n }\n if (!shouldAttachTrigger(1 /* TriggerType.Prefetch */, lView, tNode))\n return;\n scheduleDelayedPrefetching(onIdle);\n}\n/**\n * Sets up logic to handle the `on idle` deferred trigger.\n * @codeGenApi\n */\nfunction ɵɵdeferHydrateOnIdle() {\n const lView = getLView();\n const tNode = getCurrentTNode();\n if (ngDevMode) {\n trackTriggerForDebugging(lView[TVIEW], tNode, 'hydrate on idle');\n }\n if (!shouldAttachTrigger(2 /* TriggerType.Hydrate */, lView, tNode))\n return;\n const hydrateTriggers = getHydrateTriggers(getTView(), tNode);\n hydrateTriggers.set(0 /* DeferBlockTrigger.Idle */, null);\n if (typeof ngServerMode !== 'undefined' && ngServerMode) {\n // We are on the server and SSR for defer blocks is enabled.\n triggerDeferBlock(2 /* TriggerType.Hydrate */, lView, tNode);\n }\n else {\n scheduleDelayedHydrating(onIdle, lView, tNode);\n }\n}\n/**\n * Sets up logic to handle the `on immediate` deferred trigger.\n * @codeGenApi\n */\nfunction ɵɵdeferOnImmediate() {\n const lView = getLView();\n const tNode = getCurrentTNode();\n if (ngDevMode) {\n trackTriggerForDebugging(lView[TVIEW], tNode, 'on immediate');\n }\n if (!shouldAttachTrigger(0 /* TriggerType.Regular */, lView, tNode))\n return;\n // Render placeholder block only if loading template is not present and we're on\n // the client to avoid content flickering, since it would be immediately replaced\n // by the loading block.\n const tDetails = getTDeferBlockDetails(lView[TVIEW], tNode);\n if (tDetails.loadingTmplIndex === null) {\n renderPlaceholder(lView, tNode);\n }\n triggerDeferBlock(0 /* TriggerType.Regular */, lView, tNode);\n}\n/**\n * Sets up logic to handle the `prefetch on immediate` deferred trigger.\n * @codeGenApi\n */\nfunction ɵɵdeferPrefetchOnImmediate() {\n const lView = getLView();\n const tNode = getCurrentTNode();\n if (ngDevMode) {\n trackTriggerForDebugging(lView[TVIEW], tNode, 'prefetch on immediate');\n }\n if (!shouldAttachTrigger(1 /* TriggerType.Prefetch */, lView, tNode))\n return;\n const tView = lView[TVIEW];\n const tDetails = getTDeferBlockDetails(tView, tNode);\n if (tDetails.loadingState === DeferDependenciesLoadingState.NOT_STARTED) {\n triggerResourceLoading(tDetails, lView, tNode);\n }\n}\n/**\n * Sets up logic to handle the `on immediate` hydrate trigger.\n * @codeGenApi\n */\nfunction ɵɵdeferHydrateOnImmediate() {\n const lView = getLView();\n const tNode = getCurrentTNode();\n if (ngDevMode) {\n trackTriggerForDebugging(lView[TVIEW], tNode, 'hydrate on immediate');\n }\n if (!shouldAttachTrigger(2 /* TriggerType.Hydrate */, lView, tNode))\n return;\n const hydrateTriggers = getHydrateTriggers(getTView(), tNode);\n hydrateTriggers.set(1 /* DeferBlockTrigger.Immediate */, null);\n if (typeof ngServerMode !== 'undefined' && ngServerMode) {\n triggerDeferBlock(2 /* TriggerType.Hydrate */, lView, tNode);\n }\n else {\n const injector = lView[INJECTOR];\n const lDetails = getLDeferBlockDetails(lView, tNode);\n const ssrUniqueId = lDetails[SSR_UNIQUE_ID];\n ngDevMode && assertSsrIdDefined(ssrUniqueId);\n triggerHydrationFromBlockName(injector, ssrUniqueId);\n }\n}\n/**\n * Creates runtime data structures for the `on timer` deferred trigger.\n * @param delay Amount of time to wait before loading the content.\n * @codeGenApi\n */\nfunction ɵɵdeferOnTimer(delay) {\n const lView = getLView();\n const tNode = getCurrentTNode();\n if (ngDevMode) {\n trackTriggerForDebugging(lView[TVIEW], tNode, `on timer(${delay}ms)`);\n }\n if (!shouldAttachTrigger(0 /* TriggerType.Regular */, lView, tNode))\n return;\n scheduleDelayedTrigger(onTimer(delay));\n}\n/**\n * Creates runtime data structures for the `prefetch on timer` deferred trigger.\n * @param delay Amount of time to wait before prefetching the content.\n * @codeGenApi\n */\nfunction ɵɵdeferPrefetchOnTimer(delay) {\n const lView = getLView();\n const tNode = getCurrentTNode();\n if (ngDevMode) {\n trackTriggerForDebugging(lView[TVIEW], tNode, `prefetch on timer(${delay}ms)`);\n }\n if (!shouldAttachTrigger(1 /* TriggerType.Prefetch */, lView, tNode))\n return;\n scheduleDelayedPrefetching(onTimer(delay));\n}\n/**\n * Creates runtime data structures for the `on timer` hydrate trigger.\n * @param delay Amount of time to wait before loading the content.\n * @codeGenApi\n */\nfunction ɵɵdeferHydrateOnTimer(delay) {\n const lView = getLView();\n const tNode = getCurrentTNode();\n if (ngDevMode) {\n trackTriggerForDebugging(lView[TVIEW], tNode, `hydrate on timer(${delay}ms)`);\n }\n if (!shouldAttachTrigger(2 /* TriggerType.Hydrate */, lView, tNode))\n return;\n const hydrateTriggers = getHydrateTriggers(getTView(), tNode);\n hydrateTriggers.set(5 /* DeferBlockTrigger.Timer */, { delay });\n if (typeof ngServerMode !== 'undefined' && ngServerMode) {\n // We are on the server and SSR for defer blocks is enabled.\n triggerDeferBlock(2 /* TriggerType.Hydrate */, lView, tNode);\n }\n else {\n scheduleDelayedHydrating(onTimer(delay), lView, tNode);\n }\n}\n/**\n * Creates runtime data structures for the `on hover` deferred trigger.\n * @param triggerIndex Index at which to find the trigger element.\n * @param walkUpTimes Number of times to walk up/down the tree hierarchy to find the trigger.\n * @codeGenApi\n */\nfunction ɵɵdeferOnHover(triggerIndex, walkUpTimes) {\n const lView = getLView();\n const tNode = getCurrentTNode();\n if (ngDevMode) {\n trackTriggerForDebugging(lView[TVIEW], tNode, `on hover${walkUpTimes === -1 ? '' : '(<target>)'}`);\n }\n if (!shouldAttachTrigger(0 /* TriggerType.Regular */, lView, tNode))\n return;\n renderPlaceholder(lView, tNode);\n // Avoid adding event listeners when this instruction is invoked on the server.\n if (!(typeof ngServerMode !== 'undefined' && ngServerMode)) {\n registerDomTrigger(lView, tNode, triggerIndex, walkUpTimes, onHover, () => triggerDeferBlock(0 /* TriggerType.Regular */, lView, tNode), 0 /* TriggerType.Regular */);\n }\n}\n/**\n * Creates runtime data structures for the `prefetch on hover` deferred trigger.\n * @param triggerIndex Index at which to find the trigger element.\n * @param walkUpTimes Number of times to walk up/down the tree hierarchy to find the trigger.\n * @codeGenApi\n */\nfunction ɵɵdeferPrefetchOnHover(triggerIndex, walkUpTimes) {\n const lView = getLView();\n const tNode = getCurrentTNode();\n if (ngDevMode) {\n trackTriggerForDebugging(lView[TVIEW], tNode, `prefetch on hover${walkUpTimes === -1 ? '' : '(<target>)'}`);\n }\n if (!shouldAttachTrigger(1 /* TriggerType.Prefetch */, lView, tNode))\n return;\n const tView = lView[TVIEW];\n const tDetails = getTDeferBlockDetails(tView, tNode);\n if (tDetails.loadingState === DeferDependenciesLoadingState.NOT_STARTED) {\n registerDomTrigger(lView, tNode, triggerIndex, walkUpTimes, onHover, () => triggerPrefetching(tDetails, lView, tNode), 1 /* TriggerType.Prefetch */);\n }\n}\n/**\n * Creates runtime data structures for the `on hover` hydrate trigger.\n * @codeGenApi\n */\nfunction ɵɵdeferHydrateOnHover() {\n const lView = getLView();\n const tNode = getCurrentTNode();\n if (ngDevMode) {\n trackTriggerForDebugging(lView[TVIEW], tNode, 'hydrate on hover');\n }\n if (!shouldAttachTrigger(2 /* TriggerType.Hydrate */, lView, tNode))\n return;\n const hydrateTriggers = getHydrateTriggers(getTView(), tNode);\n hydrateTriggers.set(4 /* DeferBlockTrigger.Hover */, null);\n if (typeof ngServerMode !== 'undefined' && ngServerMode) {\n // We are on the server and SSR for defer blocks is enabled.\n triggerDeferBlock(2 /* TriggerType.Hydrate */, lView, tNode);\n }\n // The actual triggering of hydration on hover is handled by JSAction in\n // event_replay.ts.\n}\n/**\n * Creates runtime data structures for the `on interaction` deferred trigger.\n * @param triggerIndex Index at which to find the trigger element.\n * @param walkUpTimes Number of times to walk up/down the tree hierarchy to find the trigger.\n * @codeGenApi\n */\nfunction ɵɵdeferOnInteraction(triggerIndex, walkUpTimes) {\n const lView = getLView();\n const tNode = getCurrentTNode();\n if (ngDevMode) {\n trackTriggerForDebugging(lView[TVIEW], tNode, `on interaction${walkUpTimes === -1 ? '' : '(<target>)'}`);\n }\n if (!shouldAttachTrigger(0 /* TriggerType.Regular */, lView, tNode))\n return;\n renderPlaceholder(lView, tNode);\n // Avoid adding event listeners when this instruction is invoked on the server.\n if (!(typeof ngServerMode !== 'undefined' && ngServerMode)) {\n registerDomTrigger(lView, tNode, triggerIndex, walkUpTimes, onInteraction, () => triggerDeferBlock(0 /* TriggerType.Regular */, lView, tNode), 0 /* TriggerType.Regular */);\n }\n}\n/**\n * Creates runtime data structures for the `prefetch on interaction` deferred trigger.\n * @param triggerIndex Index at which to find the trigger element.\n * @param walkUpTimes Number of times to walk up/down the tree hierarchy to find the trigger.\n * @codeGenApi\n */\nfunction ɵɵdeferPrefetchOnInteraction(triggerIndex, walkUpTimes) {\n const lView = getLView();\n const tNode = getCurrentTNode();\n if (ngDevMode) {\n trackTriggerForDebugging(lView[TVIEW], tNode, `prefetch on interaction${walkUpTimes === -1 ? '' : '(<target>)'}`);\n }\n if (!shouldAttachTrigger(1 /* TriggerType.Prefetch */, lView, tNode))\n return;\n const tView = lView[TVIEW];\n const tDetails = getTDeferBlockDetails(tView, tNode);\n if (tDetails.loadingState === DeferDependenciesLoadingState.NOT_STARTED) {\n registerDomTrigger(lView, tNode, triggerIndex, walkUpTimes, onInteraction, () => triggerPrefetching(tDetails, lView, tNode), 1 /* TriggerType.Prefetch */);\n }\n}\n/**\n * Creates runtime data structures for the `on interaction` hydrate trigger.\n * @codeGenApi\n */\nfunction ɵɵdeferHydrateOnInteraction() {\n const lView = getLView();\n const tNode = getCurrentTNode();\n if (ngDevMode) {\n trackTriggerForDebugging(lView[TVIEW], tNode, 'hydrate on interaction');\n }\n if (!shouldAttachTrigger(2 /* TriggerType.Hydrate */, lView, tNode))\n return;\n const hydrateTriggers = getHydrateTriggers(getTView(), tNode);\n hydrateTriggers.set(3 /* DeferBlockTrigger.Interaction */, null);\n if (typeof ngServerMode !== 'undefined' && ngServerMode) {\n // We are on the server and SSR for defer blocks is enabled.\n triggerDeferBlock(2 /* TriggerType.Hydrate */, lView, tNode);\n }\n // The actual triggering of hydration on interaction is handled by JSAction in\n // event_replay.ts.\n}\n/**\n * Creates runtime data structures for the `on viewport` deferred trigger.\n * @param triggerIndex Index at which to find the trigger element.\n * @param walkUpTimes Number of times to walk up/down the tree hierarchy to find the trigger.\n * @codeGenApi\n */\nfunction ɵɵdeferOnViewport(triggerIndex, walkUpTimes) {\n const lView = getLView();\n const tNode = getCurrentTNode();\n if (ngDevMode) {\n trackTriggerForDebugging(lView[TVIEW], tNode, `on viewport${walkUpTimes === -1 ? '' : '(<target>)'}`);\n }\n if (!shouldAttachTrigger(0 /* TriggerType.Regular */, lView, tNode))\n return;\n renderPlaceholder(lView, tNode);\n // Avoid adding event listeners when this instruction is invoked on the server.\n if (!(typeof ngServerMode !== 'undefined' && ngServerMode)) {\n registerDomTrigger(lView, tNode, triggerIndex, walkUpTimes, onViewportWrapper, () => triggerDeferBlock(0 /* TriggerType.Regular */, lView, tNode), 0 /* TriggerType.Regular */);\n }\n}\n/**\n * Creates runtime data structures for the `prefetch on viewport` deferred trigger.\n * @param triggerIndex Index at which to find the trigger element.\n * @param walkUpTimes Number of times to walk up/down the tree hierarchy to find the trigger.\n * @codeGenApi\n */\nfunction ɵɵdeferPrefetchOnViewport(triggerIndex, walkUpTimes) {\n const lView = getLView();\n const tNode = getCurrentTNode();\n if (ngDevMode) {\n trackTriggerForDebugging(lView[TVIEW], tNode, `prefetch on viewport${walkUpTimes === -1 ? '' : '(<target>)'}`);\n }\n if (!shouldAttachTrigger(1 /* TriggerType.Prefetch */, lView, tNode))\n return;\n const tView = lView[TVIEW];\n const tDetails = getTDeferBlockDetails(tView, tNode);\n if (tDetails.loadingState === DeferDependenciesLoadingState.NOT_STARTED) {\n registerDomTrigger(lView, tNode, triggerIndex, walkUpTimes, onViewportWrapper, () => triggerPrefetching(tDetails, lView, tNode), 1 /* TriggerType.Prefetch */);\n }\n}\n/**\n * Creates runtime data structures for the `on viewport` hydrate trigger.\n * @codeGenApi\n */\nfunction ɵɵdeferHydrateOnViewport() {\n const lView = getLView();\n const tNode = getCurrentTNode();\n if (ngDevMode) {\n trackTriggerForDebugging(lView[TVIEW], tNode, 'hydrate on viewport');\n }\n if (!shouldAttachTrigger(2 /* TriggerType.Hydrate */, lView, tNode))\n return;\n const hydrateTriggers = getHydrateTriggers(getTView(), tNode);\n hydrateTriggers.set(2 /* DeferBlockTrigger.Viewport */, null);\n if (typeof ngServerMode !== 'undefined' && ngServerMode) {\n // We are on the server and SSR for defer blocks is enabled.\n triggerDeferBlock(2 /* TriggerType.Hydrate */, lView, tNode);\n }\n // The actual triggering of hydration on viewport happens in triggering.ts,\n // since these instructions won't exist for dehydrated content.\n}\n\n/**\n * Updates the value of or removes a bound attribute on an Element.\n *\n * Used in the case of `[attr.title]=\"value\"`\n *\n * @param name name The name of the attribute.\n * @param value value The attribute is removed when value is `null` or `undefined`.\n * Otherwise the attribute value is set to the stringified value.\n * @param sanitizer An optional function used to sanitize the value.\n * @param namespace Optional namespace to use when setting the attribute.\n *\n * @codeGenApi\n */\nfunction ɵɵattribute(name, value, sanitizer, namespace) {\n const lView = getLView();\n const bindingIndex = nextBindingIndex();\n if (bindingUpdated(lView, bindingIndex, value)) {\n const tView = getTView();\n const tNode = getSelectedTNode();\n elementAttributeInternal(tNode, lView, name, value, sanitizer, namespace);\n ngDevMode && storePropertyBindingMetadata(tView.data, tNode, 'attr.' + name, bindingIndex);\n }\n return ɵɵattribute;\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/**\n * Instruction that returns the component instance in which the current instruction is executing.\n * This is a constant-time version of `nextContent` for the case where we know that we need the\n * component instance specifically, rather than the context of a particular template.\n *\n * @codeGenApi\n */\nfunction ɵɵcomponentInstance() {\n const instance = getLView()[DECLARATION_COMPONENT_VIEW][CONTEXT];\n ngDevMode && assertDefined(instance, 'Expected component instance to be defined');\n return instance;\n}\n\n/**\n * A type representing the live collection to be reconciled with any new (incoming) collection. This\n * is an adapter class that makes it possible to work with different internal data structures,\n * regardless of the actual values of the incoming collection.\n */\nclass LiveCollection {\n destroy(item) {\n // noop by default\n }\n updateValue(index, value) {\n // noop by default\n }\n // operations below could be implemented on top of the operations defined so far, but having\n // them explicitly allow clear expression of intent and potentially more performant\n // implementations\n swap(index1, index2) {\n const startIdx = Math.min(index1, index2);\n const endIdx = Math.max(index1, index2);\n const endItem = this.detach(endIdx);\n if (endIdx - startIdx > 1) {\n const startItem = this.detach(startIdx);\n this.attach(startIdx, endItem);\n this.attach(endIdx, startItem);\n }\n else {\n this.attach(startIdx, endItem);\n }\n }\n move(prevIndex, newIdx) {\n this.attach(newIdx, this.detach(prevIndex));\n }\n}\nfunction valuesMatching(liveIdx, liveValue, newIdx, newValue, trackBy) {\n if (liveIdx === newIdx && Object.is(liveValue, newValue)) {\n // matching and no value identity to update\n return 1;\n }\n else if (Object.is(trackBy(liveIdx, liveValue), trackBy(newIdx, newValue))) {\n // matching but requires value identity update\n return -1;\n }\n return 0;\n}\nfunction recordDuplicateKeys(keyToIdx, key, idx) {\n const idxSoFar = keyToIdx.get(key);\n if (idxSoFar !== undefined) {\n idxSoFar.add(idx);\n }\n else {\n keyToIdx.set(key, new Set([idx]));\n }\n}\n/**\n * The live collection reconciliation algorithm that perform various in-place operations, so it\n * reflects the content of the new (incoming) collection.\n *\n * The reconciliation algorithm has 2 code paths:\n * - \"fast\" path that don't require any memory allocation;\n * - \"slow\" path that requires additional memory allocation for intermediate data structures used to\n * collect additional information about the live collection.\n * It might happen that the algorithm switches between the two modes in question in a single\n * reconciliation path - generally it tries to stay on the \"fast\" path as much as possible.\n *\n * The overall complexity of the algorithm is O(n + m) for speed and O(n) for memory (where n is the\n * length of the live collection and m is the length of the incoming collection). Given the problem\n * at hand the complexity / performance constraints makes it impossible to perform the absolute\n * minimum of operation to reconcile the 2 collections. The algorithm makes different tradeoffs to\n * stay within reasonable performance bounds and may apply sub-optimal number of operations in\n * certain situations.\n *\n * @param liveCollection the current, live collection;\n * @param newCollection the new, incoming collection;\n * @param trackByFn key generation function that determines equality between items in the life and\n * incoming collection;\n */\nfunction reconcile(liveCollection, newCollection, trackByFn) {\n let detachedItems = undefined;\n let liveKeysInTheFuture = undefined;\n let liveStartIdx = 0;\n let liveEndIdx = liveCollection.length - 1;\n const duplicateKeys = ngDevMode ? new Map() : undefined;\n if (Array.isArray(newCollection)) {\n let newEndIdx = newCollection.length - 1;\n while (liveStartIdx <= liveEndIdx && liveStartIdx <= newEndIdx) {\n // compare from the beginning\n const liveStartValue = liveCollection.at(liveStartIdx);\n const newStartValue = newCollection[liveStartIdx];\n if (ngDevMode) {\n recordDuplicateKeys(duplicateKeys, trackByFn(liveStartIdx, newStartValue), liveStartIdx);\n }\n const isStartMatching = valuesMatching(liveStartIdx, liveStartValue, liveStartIdx, newStartValue, trackByFn);\n if (isStartMatching !== 0) {\n if (isStartMatching < 0) {\n liveCollection.updateValue(liveStartIdx, newStartValue);\n }\n liveStartIdx++;\n continue;\n }\n // compare from the end\n // TODO(perf): do _all_ the matching from the end\n const liveEndValue = liveCollection.at(liveEndIdx);\n const newEndValue = newCollection[newEndIdx];\n if (ngDevMode) {\n recordDuplicateKeys(duplicateKeys, trackByFn(newEndIdx, newEndValue), newEndIdx);\n }\n const isEndMatching = valuesMatching(liveEndIdx, liveEndValue, newEndIdx, newEndValue, trackByFn);\n if (isEndMatching !== 0) {\n if (isEndMatching < 0) {\n liveCollection.updateValue(liveEndIdx, newEndValue);\n }\n liveEndIdx--;\n newEndIdx--;\n continue;\n }\n // Detect swap and moves:\n const liveStartKey = trackByFn(liveStartIdx, liveStartValue);\n const liveEndKey = trackByFn(liveEndIdx, liveEndValue);\n const newStartKey = trackByFn(liveStartIdx, newStartValue);\n if (Object.is(newStartKey, liveEndKey)) {\n const newEndKey = trackByFn(newEndIdx, newEndValue);\n // detect swap on both ends;\n if (Object.is(newEndKey, liveStartKey)) {\n liveCollection.swap(liveStartIdx, liveEndIdx);\n liveCollection.updateValue(liveEndIdx, newEndValue);\n newEndIdx--;\n liveEndIdx--;\n }\n else {\n // the new item is the same as the live item with the end pointer - this is a move forward\n // to an earlier index;\n liveCollection.move(liveEndIdx, liveStartIdx);\n }\n liveCollection.updateValue(liveStartIdx, newStartValue);\n liveStartIdx++;\n continue;\n }\n // Fallback to the slow path: we need to learn more about the content of the live and new\n // collections.\n detachedItems ??= new UniqueValueMultiKeyMap();\n liveKeysInTheFuture ??= initLiveItemsInTheFuture(liveCollection, liveStartIdx, liveEndIdx, trackByFn);\n // Check if I'm inserting a previously detached item: if so, attach it here\n if (attachPreviouslyDetached(liveCollection, detachedItems, liveStartIdx, newStartKey)) {\n liveCollection.updateValue(liveStartIdx, newStartValue);\n liveStartIdx++;\n liveEndIdx++;\n }\n else if (!liveKeysInTheFuture.has(newStartKey)) {\n // Check if we seen a new item that doesn't exist in the old collection and must be INSERTED\n const newItem = liveCollection.create(liveStartIdx, newCollection[liveStartIdx]);\n liveCollection.attach(liveStartIdx, newItem);\n liveStartIdx++;\n liveEndIdx++;\n }\n else {\n // We know that the new item exists later on in old collection but we don't know its index\n // and as the consequence can't move it (don't know where to find it). Detach the old item,\n // hoping that it unlocks the fast path again.\n detachedItems.set(liveStartKey, liveCollection.detach(liveStartIdx));\n liveEndIdx--;\n }\n }\n // Final cleanup steps:\n // - more items in the new collection => insert\n while (liveStartIdx <= newEndIdx) {\n createOrAttach(liveCollection, detachedItems, trackByFn, liveStartIdx, newCollection[liveStartIdx]);\n liveStartIdx++;\n }\n }\n else if (newCollection != null) {\n // iterable - immediately fallback to the slow path\n const newCollectionIterator = newCollection[Symbol.iterator]();\n let newIterationResult = newCollectionIterator.next();\n while (!newIterationResult.done && liveStartIdx <= liveEndIdx) {\n const liveValue = liveCollection.at(liveStartIdx);\n const newValue = newIterationResult.value;\n if (ngDevMode) {\n recordDuplicateKeys(duplicateKeys, trackByFn(liveStartIdx, newValue), liveStartIdx);\n }\n const isStartMatching = valuesMatching(liveStartIdx, liveValue, liveStartIdx, newValue, trackByFn);\n if (isStartMatching !== 0) {\n // found a match - move on, but update value\n if (isStartMatching < 0) {\n liveCollection.updateValue(liveStartIdx, newValue);\n }\n liveStartIdx++;\n newIterationResult = newCollectionIterator.next();\n }\n else {\n detachedItems ??= new UniqueValueMultiKeyMap();\n liveKeysInTheFuture ??= initLiveItemsInTheFuture(liveCollection, liveStartIdx, liveEndIdx, trackByFn);\n // Check if I'm inserting a previously detached item: if so, attach it here\n const newKey = trackByFn(liveStartIdx, newValue);\n if (attachPreviouslyDetached(liveCollection, detachedItems, liveStartIdx, newKey)) {\n liveCollection.updateValue(liveStartIdx, newValue);\n liveStartIdx++;\n liveEndIdx++;\n newIterationResult = newCollectionIterator.next();\n }\n else if (!liveKeysInTheFuture.has(newKey)) {\n liveCollection.attach(liveStartIdx, liveCollection.create(liveStartIdx, newValue));\n liveStartIdx++;\n liveEndIdx++;\n newIterationResult = newCollectionIterator.next();\n }\n else {\n // it is a move forward - detach the current item without advancing in collections\n const liveKey = trackByFn(liveStartIdx, liveValue);\n detachedItems.set(liveKey, liveCollection.detach(liveStartIdx));\n liveEndIdx--;\n }\n }\n }\n // this is a new item as we run out of the items in the old collection - create or attach a\n // previously detached one\n while (!newIterationResult.done) {\n createOrAttach(liveCollection, detachedItems, trackByFn, liveCollection.length, newIterationResult.value);\n newIterationResult = newCollectionIterator.next();\n }\n }\n // Cleanups common to the array and iterable:\n // - more items in the live collection => delete starting from the end;\n while (liveStartIdx <= liveEndIdx) {\n liveCollection.destroy(liveCollection.detach(liveEndIdx--));\n }\n // - destroy items that were detached but never attached again.\n detachedItems?.forEach((item) => {\n liveCollection.destroy(item);\n });\n // report duplicate keys (dev mode only)\n if (ngDevMode) {\n let duplicatedKeysMsg = [];\n for (const [key, idxSet] of duplicateKeys) {\n if (idxSet.size > 1) {\n const idx = [...idxSet].sort((a, b) => a - b);\n for (let i = 1; i < idx.length; i++) {\n duplicatedKeysMsg.push(`key \"${stringifyForError(key)}\" at index \"${idx[i - 1]}\" and \"${idx[i]}\"`);\n }\n }\n }\n if (duplicatedKeysMsg.length > 0) {\n const message = formatRuntimeError(-955 /* RuntimeErrorCode.LOOP_TRACK_DUPLICATE_KEYS */, 'The provided track expression resulted in duplicated keys for a given collection. ' +\n 'Adjust the tracking expression such that it uniquely identifies all the items in the collection. ' +\n 'Duplicated keys were: \\n' +\n duplicatedKeysMsg.join(', \\n') +\n '.');\n console.warn(message);\n }\n }\n}\nfunction attachPreviouslyDetached(prevCollection, detachedItems, index, key) {\n if (detachedItems !== undefined && detachedItems.has(key)) {\n prevCollection.attach(index, detachedItems.get(key));\n detachedItems.delete(key);\n return true;\n }\n return false;\n}\nfunction createOrAttach(liveCollection, detachedItems, trackByFn, index, value) {\n if (!attachPreviouslyDetached(liveCollection, detachedItems, index, trackByFn(index, value))) {\n const newItem = liveCollection.create(index, value);\n liveCollection.attach(index, newItem);\n }\n else {\n liveCollection.updateValue(index, value);\n }\n}\nfunction initLiveItemsInTheFuture(liveCollection, start, end, trackByFn) {\n const keys = new Set();\n for (let i = start; i <= end; i++) {\n keys.add(trackByFn(i, liveCollection.at(i)));\n }\n return keys;\n}\n/**\n * A specific, partial implementation of the Map interface with the following characteristics:\n * - allows multiple values for a given key;\n * - maintain FIFO order for multiple values corresponding to a given key;\n * - assumes that all values are unique.\n *\n * The implementation aims at having the minimal overhead for cases where keys are _not_ duplicated\n * (the most common case in the list reconciliation algorithm). To achieve this, the first value for\n * a given key is stored in a regular map. Then, when more values are set for a given key, we\n * maintain a form of linked list in a separate map. To maintain this linked list we assume that all\n * values (in the entire collection) are unique.\n */\nclass UniqueValueMultiKeyMap {\n // A map from a key to the first value corresponding to this key.\n kvMap = new Map();\n // A map that acts as a linked list of values - each value maps to the next value in this \"linked\n // list\" (this only works if values are unique). Allocated lazily to avoid memory consumption when\n // there are no duplicated values.\n _vMap = undefined;\n has(key) {\n return this.kvMap.has(key);\n }\n delete(key) {\n if (!this.has(key))\n return false;\n const value = this.kvMap.get(key);\n if (this._vMap !== undefined && this._vMap.has(value)) {\n this.kvMap.set(key, this._vMap.get(value));\n this._vMap.delete(value);\n }\n else {\n this.kvMap.delete(key);\n }\n return true;\n }\n get(key) {\n return this.kvMap.get(key);\n }\n set(key, value) {\n if (this.kvMap.has(key)) {\n let prevValue = this.kvMap.get(key);\n // Note: we don't use `assertNotSame`, because the value needs to be stringified even if\n // there is no error which can freeze the browser for large values (see #58509).\n if (ngDevMode && prevValue === value) {\n throw new Error(`Detected a duplicated value ${value} for the key ${key}`);\n }\n if (this._vMap === undefined) {\n this._vMap = new Map();\n }\n const vMap = this._vMap;\n while (vMap.has(prevValue)) {\n prevValue = vMap.get(prevValue);\n }\n vMap.set(prevValue, value);\n }\n else {\n this.kvMap.set(key, value);\n }\n }\n forEach(cb) {\n for (let [key, value] of this.kvMap) {\n cb(value, key);\n if (this._vMap !== undefined) {\n const vMap = this._vMap;\n while (vMap.has(value)) {\n value = vMap.get(value);\n cb(value, key);\n }\n }\n }\n }\n}\n\n/**\n * Creates an LContainer for an ng-template representing a root node\n * of control flow (@if, @switch). We use this to explicitly set\n * flags on the TNode created to identify which nodes are in control\n * flow or starting control flow for hydration identification and\n * cleanup timing.\n *\n * @param index The index of the container in the data array\n * @param templateFn Inline template\n * @param decls The number of nodes, local refs, and pipes for this template\n * @param vars The number of bindings for this template\n * @param tagName The name of the container element, if applicable\n * @param attrsIndex Index of template attributes in the `consts` array.\n * @param localRefs Index of the local references in the `consts` array.\n * @param localRefExtractor A function which extracts local-refs values from the template.\n * Defaults to the current element associated with the local-ref.\n * @codeGenApi\n */\nfunction ɵɵconditionalCreate(index, templateFn, decls, vars, tagName, attrsIndex, localRefsIndex, localRefExtractor) {\n performanceMarkFeature('NgControlFlow');\n const lView = getLView();\n const tView = getTView();\n const attrs = getConstant(tView.consts, attrsIndex);\n declareNoDirectiveHostTemplate(lView, tView, index, templateFn, decls, vars, tagName, attrs, 256 /* TNodeFlags.isControlFlowStart */, localRefsIndex, localRefExtractor);\n return ɵɵconditionalBranchCreate;\n}\n/**\n * Creates an LContainer for an ng-template representing a branch\n * of control flow (@else, @case, @default). We use this to explicitly\n * set flags on the TNode created to identify which nodes are in\n * control flow or starting control flow for hydration identification\n * and cleanup timing.\n *\n * @param index The index of the container in the data array\n * @param templateFn Inline template\n * @param decls The number of nodes, local refs, and pipes for this template\n * @param vars The number of bindings for this template\n * @param tagName The name of the container element, if applicable\n * @param attrsIndex Index of template attributes in the `consts` array.\n * @param localRefs Index of the local references in the `consts` array.\n * @param localRefExtractor A function which extracts local-refs values from the template.\n * Defaults to the current element associated with the local-ref.\n * @codeGenApi\n */\nfunction ɵɵconditionalBranchCreate(index, templateFn, decls, vars, tagName, attrsIndex, localRefsIndex, localRefExtractor) {\n performanceMarkFeature('NgControlFlow');\n const lView = getLView();\n const tView = getTView();\n const attrs = getConstant(tView.consts, attrsIndex);\n declareNoDirectiveHostTemplate(lView, tView, index, templateFn, decls, vars, tagName, attrs, 512 /* TNodeFlags.isInControlFlow */, localRefsIndex, localRefExtractor);\n return ɵɵconditionalBranchCreate;\n}\n/**\n * The conditional instruction represents the basic building block on the runtime side to support\n * built-in \"if\" and \"switch\". On the high level this instruction is responsible for adding and\n * removing views selected by a conditional expression.\n *\n * @param matchingTemplateIndex Index of a template TNode representing a conditional view to be\n * inserted; -1 represents a special case when there is no view to insert.\n * @param contextValue Value that should be exposed as the context of the conditional.\n * @codeGenApi\n */\nfunction ɵɵconditional(matchingTemplateIndex, contextValue) {\n performanceMarkFeature('NgControlFlow');\n const hostLView = getLView();\n const bindingIndex = nextBindingIndex();\n const prevMatchingTemplateIndex = hostLView[bindingIndex] !== NO_CHANGE ? hostLView[bindingIndex] : -1;\n const prevContainer = prevMatchingTemplateIndex !== -1\n ? getLContainer(hostLView, HEADER_OFFSET + prevMatchingTemplateIndex)\n : undefined;\n const viewInContainerIdx = 0;\n if (bindingUpdated(hostLView, bindingIndex, matchingTemplateIndex)) {\n const prevConsumer = setActiveConsumer(null);\n try {\n // The index of the view to show changed - remove the previously displayed one\n // (it is a noop if there are no active views in a container).\n if (prevContainer !== undefined) {\n removeLViewFromLContainer(prevContainer, viewInContainerIdx);\n }\n // Index -1 is a special case where none of the conditions evaluates to\n // a truthy value and as the consequence we've got no view to show.\n if (matchingTemplateIndex !== -1) {\n const nextLContainerIndex = HEADER_OFFSET + matchingTemplateIndex;\n const nextContainer = getLContainer(hostLView, nextLContainerIndex);\n const templateTNode = getExistingTNode(hostLView[TVIEW], nextLContainerIndex);\n const dehydratedView = findAndReconcileMatchingDehydratedViews(nextContainer, templateTNode, hostLView);\n const embeddedLView = createAndRenderEmbeddedLView(hostLView, templateTNode, contextValue, {\n dehydratedView,\n });\n addLViewToLContainer(nextContainer, embeddedLView, viewInContainerIdx, shouldAddViewToDom(templateTNode, dehydratedView));\n }\n }\n finally {\n setActiveConsumer(prevConsumer);\n }\n }\n else if (prevContainer !== undefined) {\n // We might keep displaying the same template but the actual value of the expression could have\n // changed - re-bind in context.\n const lView = getLViewFromLContainer(prevContainer, viewInContainerIdx);\n if (lView !== undefined) {\n lView[CONTEXT] = contextValue;\n }\n }\n}\nclass RepeaterContext {\n lContainer;\n $implicit;\n $index;\n constructor(lContainer, $implicit, $index) {\n this.lContainer = lContainer;\n this.$implicit = $implicit;\n this.$index = $index;\n }\n get $count() {\n return this.lContainer.length - CONTAINER_HEADER_OFFSET;\n }\n}\n/**\n * A built-in trackBy function used for situations where users specified collection index as a\n * tracking expression. Having this function body in the runtime avoids unnecessary code generation.\n *\n * @param index\n * @returns\n */\nfunction ɵɵrepeaterTrackByIndex(index) {\n return index;\n}\n/**\n * A built-in trackBy function used for situations where users specified collection item reference\n * as a tracking expression. Having this function body in the runtime avoids unnecessary code\n * generation.\n *\n * @param index\n * @returns\n */\nfunction ɵɵrepeaterTrackByIdentity(_, value) {\n return value;\n}\nclass RepeaterMetadata {\n hasEmptyBlock;\n trackByFn;\n liveCollection;\n constructor(hasEmptyBlock, trackByFn, liveCollection) {\n this.hasEmptyBlock = hasEmptyBlock;\n this.trackByFn = trackByFn;\n this.liveCollection = liveCollection;\n }\n}\n/**\n * The repeaterCreate instruction runs in the creation part of the template pass and initializes\n * internal data structures required by the update pass of the built-in repeater logic. Repeater\n * metadata are allocated in the data part of LView with the following layout:\n * - LView[HEADER_OFFSET + index] - metadata\n * - LView[HEADER_OFFSET + index + 1] - reference to a template function rendering an item\n * - LView[HEADER_OFFSET + index + 2] - optional reference to a template function rendering an empty\n * block\n *\n * @param index Index at which to store the metadata of the repeater.\n * @param templateFn Reference to the template of the main repeater block.\n * @param decls The number of nodes, local refs, and pipes for the main block.\n * @param vars The number of bindings for the main block.\n * @param tagName The name of the container element, if applicable\n * @param attrsIndex Index of template attributes in the `consts` array.\n * @param trackByFn Reference to the tracking function.\n * @param trackByUsesComponentInstance Whether the tracking function has any references to the\n * component instance. If it doesn't, we can avoid rebinding it.\n * @param emptyTemplateFn Reference to the template function of the empty block.\n * @param emptyDecls The number of nodes, local refs, and pipes for the empty block.\n * @param emptyVars The number of bindings for the empty block.\n * @param emptyTagName The name of the empty block container element, if applicable\n * @param emptyAttrsIndex Index of the empty block template attributes in the `consts` array.\n *\n * @codeGenApi\n */\nfunction ɵɵrepeaterCreate(index, templateFn, decls, vars, tagName, attrsIndex, trackByFn, trackByUsesComponentInstance, emptyTemplateFn, emptyDecls, emptyVars, emptyTagName, emptyAttrsIndex) {\n performanceMarkFeature('NgControlFlow');\n ngDevMode &&\n assertFunction(trackByFn, `A track expression must be a function, was ${typeof trackByFn} instead.`);\n const lView = getLView();\n const tView = getTView();\n const hasEmptyBlock = emptyTemplateFn !== undefined;\n const hostLView = getLView();\n const boundTrackBy = trackByUsesComponentInstance\n ? // We only want to bind when necessary, because it produces a\n // new function. For pure functions it's not necessary.\n trackByFn.bind(hostLView[DECLARATION_COMPONENT_VIEW][CONTEXT])\n : trackByFn;\n const metadata = new RepeaterMetadata(hasEmptyBlock, boundTrackBy);\n hostLView[HEADER_OFFSET + index] = metadata;\n declareNoDirectiveHostTemplate(lView, tView, index + 1, templateFn, decls, vars, tagName, getConstant(tView.consts, attrsIndex), 256 /* TNodeFlags.isControlFlowStart */);\n if (hasEmptyBlock) {\n ngDevMode &&\n assertDefined(emptyDecls, 'Missing number of declarations for the empty repeater block.');\n ngDevMode &&\n assertDefined(emptyVars, 'Missing number of bindings for the empty repeater block.');\n declareNoDirectiveHostTemplate(lView, tView, index + 2, emptyTemplateFn, emptyDecls, emptyVars, emptyTagName, getConstant(tView.consts, emptyAttrsIndex), 512 /* TNodeFlags.isInControlFlow */);\n }\n}\nfunction isViewExpensiveToRecreate(lView) {\n // assumption: anything more than a text node with a binding is considered \"expensive\"\n return lView.length - HEADER_OFFSET > 2;\n}\nclass OperationsCounter {\n created = 0;\n destroyed = 0;\n reset() {\n this.created = 0;\n this.destroyed = 0;\n }\n recordCreate() {\n this.created++;\n }\n recordDestroy() {\n this.destroyed++;\n }\n /**\n * A method indicating if the entire collection was re-created as part of the reconciliation pass.\n * Used to warn developers about the usage of a tracking function that might result in excessive\n * amount of view creation / destroy operations.\n *\n * @returns boolean value indicating if a live collection was re-created\n */\n wasReCreated(collectionLen) {\n return collectionLen > 0 && this.created === this.destroyed && this.created === collectionLen;\n }\n}\nclass LiveCollectionLContainerImpl extends LiveCollection {\n lContainer;\n hostLView;\n templateTNode;\n operationsCounter = ngDevMode ? new OperationsCounter() : undefined;\n /**\n Property indicating if indexes in the repeater context need to be updated following the live\n collection changes. Index updates are necessary if and only if views are inserted / removed in\n the middle of LContainer. Adds and removals at the end don't require index updates.\n */\n needsIndexUpdate = false;\n constructor(lContainer, hostLView, templateTNode) {\n super();\n this.lContainer = lContainer;\n this.hostLView = hostLView;\n this.templateTNode = templateTNode;\n }\n get length() {\n return this.lContainer.length - CONTAINER_HEADER_OFFSET;\n }\n at(index) {\n return this.getLView(index)[CONTEXT].$implicit;\n }\n attach(index, lView) {\n const dehydratedView = lView[HYDRATION];\n this.needsIndexUpdate ||= index !== this.length;\n addLViewToLContainer(this.lContainer, lView, index, shouldAddViewToDom(this.templateTNode, dehydratedView));\n }\n detach(index) {\n this.needsIndexUpdate ||= index !== this.length - 1;\n return detachExistingView(this.lContainer, index);\n }\n create(index, value) {\n const dehydratedView = findMatchingDehydratedView(this.lContainer, this.templateTNode.tView.ssrId);\n const embeddedLView = createAndRenderEmbeddedLView(this.hostLView, this.templateTNode, new RepeaterContext(this.lContainer, value, index), { dehydratedView });\n this.operationsCounter?.recordCreate();\n return embeddedLView;\n }\n destroy(lView) {\n destroyLView(lView[TVIEW], lView);\n this.operationsCounter?.recordDestroy();\n }\n updateValue(index, value) {\n this.getLView(index)[CONTEXT].$implicit = value;\n }\n reset() {\n this.needsIndexUpdate = false;\n this.operationsCounter?.reset();\n }\n updateIndexes() {\n if (this.needsIndexUpdate) {\n for (let i = 0; i < this.length; i++) {\n this.getLView(i)[CONTEXT].$index = i;\n }\n }\n }\n getLView(index) {\n return getExistingLViewFromLContainer(this.lContainer, index);\n }\n}\n/**\n * The repeater instruction does update-time diffing of a provided collection (against the\n * collection seen previously) and maps changes in the collection to views structure (by adding,\n * removing or moving views as needed).\n * @param collection - the collection instance to be checked for changes\n * @codeGenApi\n */\nfunction ɵɵrepeater(collection) {\n const prevConsumer = setActiveConsumer(null);\n const metadataSlotIdx = getSelectedIndex();\n try {\n const hostLView = getLView();\n const hostTView = hostLView[TVIEW];\n const metadata = hostLView[metadataSlotIdx];\n const containerIndex = metadataSlotIdx + 1;\n const lContainer = getLContainer(hostLView, containerIndex);\n if (metadata.liveCollection === undefined) {\n const itemTemplateTNode = getExistingTNode(hostTView, containerIndex);\n metadata.liveCollection = new LiveCollectionLContainerImpl(lContainer, hostLView, itemTemplateTNode);\n }\n else {\n metadata.liveCollection.reset();\n }\n const liveCollection = metadata.liveCollection;\n reconcile(liveCollection, collection, metadata.trackByFn);\n // Warn developers about situations where the entire collection was re-created as part of the\n // reconciliation pass. Note that this warning might be \"overreacting\" and report cases where\n // the collection re-creation is the intended behavior. Still, the assumption is that most of\n // the time it is undesired.\n if (ngDevMode &&\n metadata.trackByFn === ɵɵrepeaterTrackByIdentity &&\n liveCollection.operationsCounter?.wasReCreated(liveCollection.length) &&\n isViewExpensiveToRecreate(getExistingLViewFromLContainer(lContainer, 0))) {\n const message = formatRuntimeError(-956 /* RuntimeErrorCode.LOOP_TRACK_RECREATE */, `The configured tracking expression (track by identity) caused re-creation of the entire collection of size ${liveCollection.length}. ` +\n 'This is an expensive operation requiring destruction and subsequent creation of DOM nodes, directives, components etc. ' +\n 'Please review the \"track expression\" and make sure that it uniquely identifies items in a collection.');\n console.warn(message);\n }\n // moves in the container might caused context's index to get out of order, re-adjust if needed\n liveCollection.updateIndexes();\n // handle empty blocks\n if (metadata.hasEmptyBlock) {\n const bindingIndex = nextBindingIndex();\n const isCollectionEmpty = liveCollection.length === 0;\n if (bindingUpdated(hostLView, bindingIndex, isCollectionEmpty)) {\n const emptyTemplateIndex = metadataSlotIdx + 2;\n const lContainerForEmpty = getLContainer(hostLView, emptyTemplateIndex);\n if (isCollectionEmpty) {\n const emptyTemplateTNode = getExistingTNode(hostTView, emptyTemplateIndex);\n const dehydratedView = findAndReconcileMatchingDehydratedViews(lContainerForEmpty, emptyTemplateTNode, hostLView);\n const embeddedLView = createAndRenderEmbeddedLView(hostLView, emptyTemplateTNode, undefined, { dehydratedView });\n addLViewToLContainer(lContainerForEmpty, embeddedLView, 0, shouldAddViewToDom(emptyTemplateTNode, dehydratedView));\n }\n else {\n // we know that an ssrId was generated for the empty template, but\n // we were unable to match it to a dehydrated view earlier, which\n // means that we may have changed branches between server and client.\n // We'll need to find and remove the stale empty template view.\n if (hostTView.firstUpdatePass) {\n removeDehydratedViews(lContainerForEmpty);\n }\n removeLViewFromLContainer(lContainerForEmpty, 0);\n }\n }\n }\n }\n finally {\n setActiveConsumer(prevConsumer);\n }\n}\nfunction getLContainer(lView, index) {\n const lContainer = lView[index];\n ngDevMode && assertLContainer(lContainer);\n return lContainer;\n}\nfunction detachExistingView(lContainer, index) {\n const existingLView = detachView(lContainer, index);\n ngDevMode && assertLView(existingLView);\n return existingLView;\n}\nfunction getExistingLViewFromLContainer(lContainer, index) {\n const existingLView = getLViewFromLContainer(lContainer, index);\n ngDevMode && assertLView(existingLView);\n return existingLView;\n}\nfunction getExistingTNode(tView, index) {\n const tNode = getTNode(tView, index);\n ngDevMode && assertTNode(tNode);\n return tNode;\n}\n\n/**\n * Update a property on a selected element.\n *\n * Operates on the element selected by index via the {@link select} instruction.\n *\n * If the property name also exists as an input property on one of the element's directives,\n * the component property will be set instead of the element property. This check must\n * be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled\n *\n * @param propName Name of property. Because it is going to DOM, this is not subject to\n * renaming as part of minification.\n * @param value New value to write.\n * @param sanitizer An optional function used to sanitize the value.\n * @returns This function returns itself so that it may be chained\n * (e.g. `property('name', ctx.name)('title', ctx.title)`)\n *\n * @codeGenApi\n */\nfunction ɵɵproperty(propName, value, sanitizer) {\n const lView = getLView();\n const bindingIndex = nextBindingIndex();\n if (bindingUpdated(lView, bindingIndex, value)) {\n const tView = getTView();\n const tNode = getSelectedTNode();\n setPropertyAndInputs(tNode, lView, propName, value, lView[RENDERER], sanitizer);\n ngDevMode && storePropertyBindingMetadata(tView.data, tNode, propName, bindingIndex);\n }\n return ɵɵproperty;\n}\n/**\n * Given `<div style=\"...\" my-dir>` and `MyDir` with `@Input('style')` we need to write to\n * directive input.\n */\nfunction setDirectiveInputsWhichShadowsStyling(tView, tNode, lView, value, isClassBased) {\n // We support both 'class' and `className` hence the fallback.\n setAllInputsForProperty(tNode, tView, lView, isClassBased ? 'class' : 'style', value);\n}\n\n/**\n * Create DOM element. The instruction must later be followed by `elementEnd()` call.\n *\n * @param index Index of the element in the LView array\n * @param name Name of the DOM Node\n * @param attrsIndex Index of the element's attributes in the `consts` array.\n * @param localRefsIndex Index of the element's local references in the `consts` array.\n * @returns This function returns itself so that it may be chained.\n *\n * Attributes and localRefs are passed as an array of strings where elements with an even index\n * hold an attribute name and elements with an odd index hold an attribute value, ex.:\n * ['id', 'warning5', 'class', 'alert']\n *\n * @codeGenApi\n */\nfunction ɵɵelementStart(index, name, attrsIndex, localRefsIndex) {\n const lView = getLView();\n ngDevMode && assertTNodeCreationIndex(lView, index);\n const tView = lView[TVIEW];\n const adjustedIndex = index + HEADER_OFFSET;\n const tNode = tView.firstCreatePass\n ? directiveHostFirstCreatePass(adjustedIndex, lView, 2 /* TNodeType.Element */, name, findDirectiveDefMatches, getBindingsEnabled(), attrsIndex, localRefsIndex)\n : tView.data[adjustedIndex];\n elementLikeStartShared(tNode, lView, index, name, _locateOrCreateElementNode);\n if (isDirectiveHost(tNode)) {\n const tView = lView[TVIEW];\n createDirectivesInstances(tView, lView, tNode);\n executeContentQueries(tView, tNode, lView);\n }\n if (localRefsIndex != null) {\n saveResolvedLocalsInData(lView, tNode);\n }\n if (ngDevMode && lView[TVIEW].firstCreatePass) {\n validateElementIsKnown(lView, tNode);\n }\n return ɵɵelementStart;\n}\n/**\n * Mark the end of the element.\n * @returns This function returns itself so that it may be chained.\n *\n * @codeGenApi\n */\nfunction ɵɵelementEnd() {\n const tView = getTView();\n const initialTNode = getCurrentTNode();\n ngDevMode && assertDefined(initialTNode, 'No parent node to close.');\n const currentTNode = elementLikeEndShared(initialTNode);\n ngDevMode && assertTNodeType(currentTNode, 3 /* TNodeType.AnyRNode */);\n if (tView.firstCreatePass) {\n directiveHostEndFirstCreatePass(tView, currentTNode);\n }\n if (isSkipHydrationRootTNode(currentTNode)) {\n leaveSkipHydrationBlock();\n }\n decreaseElementDepthCount();\n if (currentTNode.classesWithoutHost != null && hasClassInput(currentTNode)) {\n setDirectiveInputsWhichShadowsStyling(tView, currentTNode, getLView(), currentTNode.classesWithoutHost, true);\n }\n if (currentTNode.stylesWithoutHost != null && hasStyleInput(currentTNode)) {\n setDirectiveInputsWhichShadowsStyling(tView, currentTNode, getLView(), currentTNode.stylesWithoutHost, false);\n }\n return ɵɵelementEnd;\n}\n/**\n * Creates an empty element using {@link elementStart} and {@link elementEnd}\n *\n * @param index Index of the element in the data array\n * @param name Name of the DOM Node\n * @param attrsIndex Index of the element's attributes in the `consts` array.\n * @param localRefsIndex Index of the element's local references in the `consts` array.\n * @returns This function returns itself so that it may be chained.\n *\n * @codeGenApi\n */\nfunction ɵɵelement(index, name, attrsIndex, localRefsIndex) {\n ɵɵelementStart(index, name, attrsIndex, localRefsIndex);\n ɵɵelementEnd();\n return ɵɵelement;\n}\n/**\n * Create DOM element that cannot have any directives.\n *\n * @param index Index of the element in the LView array\n * @param name Name of the DOM Node\n * @param attrsIndex Index of the element's attributes in the `consts` array.\n * @param localRefsIndex Index of the element's local references in the `consts` array.\n * @returns This function returns itself so that it may be chained.\n *\n * @codeGenApi\n */\nfunction ɵɵdomElementStart(index, name, attrsIndex, localRefsIndex) {\n const lView = getLView();\n ngDevMode && assertTNodeCreationIndex(lView, index);\n const tView = lView[TVIEW];\n const adjustedIndex = index + HEADER_OFFSET;\n const tNode = tView.firstCreatePass\n ? domOnlyFirstCreatePass(adjustedIndex, tView, 2 /* TNodeType.Element */, name, attrsIndex, localRefsIndex)\n : tView.data[adjustedIndex];\n elementLikeStartShared(tNode, lView, index, name, _locateOrCreateElementNode);\n if (localRefsIndex != null) {\n saveResolvedLocalsInData(lView, tNode);\n }\n if (ngDevMode && lView[TVIEW].firstCreatePass) {\n validateElementIsKnown(lView, tNode);\n }\n return ɵɵdomElementStart;\n}\n/**\n * Mark the end of the directiveless element.\n * @returns This function returns itself so that it may be chained.\n *\n * @codeGenApi\n */\nfunction ɵɵdomElementEnd() {\n const initialTNode = getCurrentTNode();\n ngDevMode && assertDefined(initialTNode, 'No parent node to close.');\n const currentTNode = elementLikeEndShared(initialTNode);\n ngDevMode && assertTNodeType(currentTNode, 3 /* TNodeType.AnyRNode */);\n if (isSkipHydrationRootTNode(currentTNode)) {\n leaveSkipHydrationBlock();\n }\n decreaseElementDepthCount();\n return ɵɵdomElementEnd;\n}\n/**\n * Creates an empty element using {@link domElementStart} and {@link domElementEnd}\n *\n * @param index Index of the element in the data array\n * @param name Name of the DOM Node\n * @param attrsIndex Index of the element's attributes in the `consts` array.\n * @param localRefsIndex Index of the element's local references in the `consts` array.\n * @returns This function returns itself so that it may be chained.\n *\n * @codeGenApi\n */\nfunction ɵɵdomElement(index, name, attrsIndex, localRefsIndex) {\n ɵɵdomElementStart(index, name, attrsIndex, localRefsIndex);\n ɵɵdomElementEnd();\n return ɵɵdomElement;\n}\nlet _locateOrCreateElementNode = (tView, lView, tNode, name, index) => {\n lastNodeWasCreated(true);\n return createElementNode(lView[RENDERER], name, getNamespace());\n};\n/**\n * Enables hydration code path (to lookup existing elements in DOM)\n * in addition to the regular creation mode of element nodes.\n */\nfunction locateOrCreateElementNodeImpl(tView, lView, tNode, name, index) {\n const isNodeCreationMode = !canHydrateNode(lView, tNode);\n lastNodeWasCreated(isNodeCreationMode);\n // Regular creation mode.\n if (isNodeCreationMode) {\n return createElementNode(lView[RENDERER], name, getNamespace());\n }\n // Hydration mode, looking up an existing element in DOM.\n const hydrationInfo = lView[HYDRATION];\n const native = locateNextRNode(hydrationInfo, tView, lView, tNode);\n ngDevMode && validateMatchingNode(native, Node.ELEMENT_NODE, name, lView, tNode);\n ngDevMode && markRNodeAsClaimedByHydration(native);\n // This element might also be an anchor of a view container.\n if (getSerializedContainerViews(hydrationInfo, index)) {\n // Important note: this element acts as an anchor, but it's **not** a part\n // of the embedded view, so we start the segment **after** this element, taking\n // a reference to the next sibling. For example, the following template:\n // `<div #vcrTarget>` is represented in the DOM as `<div></div>...<!--container-->`,\n // so while processing a `<div>` instruction, point to the next sibling as a\n // start of a segment.\n ngDevMode && validateNodeExists(native.nextSibling, lView, tNode);\n setSegmentHead(hydrationInfo, index, native.nextSibling);\n }\n // Checks if the skip hydration attribute is present during hydration so we know to\n // skip attempting to hydrate this block. We check both TNode and RElement for an\n // attribute: the RElement case is needed for i18n cases, when we add it to host\n // elements during the annotation phase (after all internal data structures are setup).\n if (hydrationInfo &&\n (hasSkipHydrationAttrOnTNode(tNode) || hasSkipHydrationAttrOnRElement(native))) {\n if (isComponentHost(tNode)) {\n enterSkipHydrationBlock(tNode);\n // Since this isn't hydratable, we need to empty the node\n // so there's no duplicate content after render\n clearElementContents(native);\n ngDevMode && markRNodeAsSkippedByHydration(native);\n }\n else if (ngDevMode) {\n // If this is not a component host, throw an error.\n // Hydration can be skipped on per-component basis only.\n throw invalidSkipHydrationHost(native);\n }\n }\n return native;\n}\nfunction enableLocateOrCreateElementNodeImpl() {\n _locateOrCreateElementNode = locateOrCreateElementNodeImpl;\n}\n\n/**\n * Creates a logical container for other nodes (<ng-container>) backed by a comment node in the DOM.\n * The instruction must later be followed by `elementContainerEnd()` call.\n *\n * @param index Index of the element in the LView array\n * @param attrsIndex Index of the container attributes in the `consts` array.\n * @param localRefsIndex Index of the container's local references in the `consts` array.\n * @returns This function returns itself so that it may be chained.\n *\n * Even if this instruction accepts a set of attributes no actual attribute values are propagated to\n * the DOM (as a comment node can't have attributes). Attributes are here only for directive\n * matching purposes and setting initial inputs of directives.\n *\n * @codeGenApi\n */\nfunction ɵɵelementContainerStart(index, attrsIndex, localRefsIndex) {\n const lView = getLView();\n ngDevMode && assertTNodeCreationIndex(lView, index);\n const tView = lView[TVIEW];\n const adjustedIndex = index + HEADER_OFFSET;\n const tNode = tView.firstCreatePass\n ? directiveHostFirstCreatePass(adjustedIndex, lView, 8 /* TNodeType.ElementContainer */, 'ng-container', findDirectiveDefMatches, getBindingsEnabled(), attrsIndex, localRefsIndex)\n : tView.data[adjustedIndex];\n elementLikeStartShared(tNode, lView, index, 'ng-container', _locateOrCreateElementContainerNode);\n if (isDirectiveHost(tNode)) {\n const tView = lView[TVIEW];\n createDirectivesInstances(tView, lView, tNode);\n executeContentQueries(tView, tNode, lView);\n }\n if (localRefsIndex != null) {\n saveResolvedLocalsInData(lView, tNode);\n }\n return ɵɵelementContainerStart;\n}\n/**\n * Mark the end of the <ng-container>.\n * @returns This function returns itself so that it may be chained.\n *\n * @codeGenApi\n */\nfunction ɵɵelementContainerEnd() {\n const tView = getTView();\n const initialTNode = getCurrentTNode();\n ngDevMode && assertDefined(initialTNode, 'No parent node to close.');\n const currentTNode = elementLikeEndShared(initialTNode);\n if (tView.firstCreatePass) {\n directiveHostEndFirstCreatePass(tView, currentTNode);\n }\n ngDevMode && assertTNodeType(currentTNode, 8 /* TNodeType.ElementContainer */);\n return ɵɵelementContainerEnd;\n}\n/**\n * Creates an empty logical container using {@link elementContainerStart}\n * and {@link elementContainerEnd}\n *\n * @param index Index of the element in the LView array\n * @param attrsIndex Index of the container attributes in the `consts` array.\n * @param localRefsIndex Index of the container's local references in the `consts` array.\n * @returns This function returns itself so that it may be chained.\n *\n * @codeGenApi\n */\nfunction ɵɵelementContainer(index, attrsIndex, localRefsIndex) {\n ɵɵelementContainerStart(index, attrsIndex, localRefsIndex);\n ɵɵelementContainerEnd();\n return ɵɵelementContainer;\n}\n/**\n * Creates a DOM-only logical container for other nodes (<ng-container>) backed by a comment node\n * in the DOM. The host node will *not* match any directives.\n *\n * @param index Index of the element in the LView array\n * @param attrsIndex Index of the container attributes in the `consts` array.\n * @param localRefsIndex Index of the container's local references in the `consts` array.\n * @returns This function returns itself so that it may be chained.\n *\n * @codeGenApi\n */\nfunction ɵɵdomElementContainerStart(index, attrsIndex, localRefsIndex) {\n const lView = getLView();\n ngDevMode && assertTNodeCreationIndex(lView, index);\n const tView = lView[TVIEW];\n const adjustedIndex = index + HEADER_OFFSET;\n const tNode = tView.firstCreatePass\n ? domOnlyFirstCreatePass(adjustedIndex, tView, 8 /* TNodeType.ElementContainer */, 'ng-container', attrsIndex, localRefsIndex)\n : tView.data[adjustedIndex];\n elementLikeStartShared(tNode, lView, index, 'ng-container', _locateOrCreateElementContainerNode);\n if (localRefsIndex != null) {\n saveResolvedLocalsInData(lView, tNode);\n }\n return ɵɵdomElementContainerStart;\n}\n/**\n * Mark the end of a directiveless <ng-container>.\n * @returns This function returns itself so that it may be chained.\n *\n * @codeGenApi\n */\nfunction ɵɵdomElementContainerEnd() {\n const initialTNode = getCurrentTNode();\n ngDevMode && assertDefined(initialTNode, 'No parent node to close.');\n const currentTNode = elementLikeEndShared(initialTNode);\n ngDevMode && assertTNodeType(currentTNode, 8 /* TNodeType.ElementContainer */);\n return ɵɵelementContainerEnd;\n}\n/**\n * Creates an empty logical container using {@link domElementContainerStart}\n * and {@link domElementContainerEnd}\n *\n * @param index Index of the element in the LView array\n * @param attrsIndex Index of the container attributes in the `consts` array.\n * @param localRefsIndex Index of the container's local references in the `consts` array.\n * @returns This function returns itself so that it may be chained.\n *\n * @codeGenApi\n */\nfunction ɵɵdomElementContainer(index, attrsIndex, localRefsIndex) {\n ɵɵdomElementContainerStart(index, attrsIndex, localRefsIndex);\n ɵɵdomElementContainerEnd();\n return ɵɵdomElementContainer;\n}\nlet _locateOrCreateElementContainerNode = (tView, lView, tNode, commentText, index) => {\n lastNodeWasCreated(true);\n return createCommentNode(lView[RENDERER], ngDevMode ? commentText : '');\n};\n/**\n * Enables hydration code path (to lookup existing elements in DOM)\n * in addition to the regular creation mode of comment nodes that\n * represent <ng-container>'s anchor.\n */\nfunction locateOrCreateElementContainerNode(tView, lView, tNode, commentText, index) {\n let comment;\n const isNodeCreationMode = !canHydrateNode(lView, tNode);\n lastNodeWasCreated(isNodeCreationMode);\n // Regular creation mode.\n if (isNodeCreationMode) {\n return createCommentNode(lView[RENDERER], ngDevMode ? commentText : '');\n }\n // Hydration mode, looking up existing elements in DOM.\n const hydrationInfo = lView[HYDRATION];\n const currentRNode = locateNextRNode(hydrationInfo, tView, lView, tNode);\n ngDevMode && validateNodeExists(currentRNode, lView, tNode);\n const ngContainerSize = getNgContainerSize(hydrationInfo, index);\n ngDevMode &&\n assertNumber(ngContainerSize, 'Unexpected state: hydrating an <ng-container>, ' + 'but no hydration info is available.');\n setSegmentHead(hydrationInfo, index, currentRNode);\n comment = siblingAfter(ngContainerSize, currentRNode);\n if (ngDevMode) {\n validateMatchingNode(comment, Node.COMMENT_NODE, null, lView, tNode);\n markRNodeAsClaimedByHydration(comment);\n }\n return comment;\n}\nfunction enableLocateOrCreateElementContainerNodeImpl() {\n _locateOrCreateElementContainerNode = locateOrCreateElementContainerNode;\n}\n\n/**\n * Returns the current OpaqueViewState instance.\n *\n * Used in conjunction with the restoreView() instruction to save a snapshot\n * of the current view and restore it when listeners are invoked. This allows\n * walking the declaration view tree in listeners to get vars from parent views.\n *\n * @codeGenApi\n */\nfunction ɵɵgetCurrentView() {\n return getLView();\n}\n\n/**\n * Update a DOM property on an element.\n *\n * @param propName Name of property..\n * @param value New value to write.\n * @param sanitizer An optional function used to sanitize the value.\n * @returns This function returns itself so that it may be chained\n * (e.g. `domProperty('name', ctx.name)('title', ctx.title)`)\n *\n * @codeGenApi\n */\nfunction ɵɵdomProperty(propName, value, sanitizer) {\n const lView = getLView();\n const bindingIndex = nextBindingIndex();\n if (bindingUpdated(lView, bindingIndex, value)) {\n const tView = getTView();\n const tNode = getSelectedTNode();\n setDomProperty(tNode, lView, propName, value, lView[RENDERER], sanitizer);\n ngDevMode && storePropertyBindingMetadata(tView.data, tNode, propName, bindingIndex);\n }\n return ɵɵdomProperty;\n}\n// TODO(crisbeto): try to fold this into `domProperty`. Main difference is the renderer.\n/**\n * Updates a synthetic host binding (e.g. `[@foo]`) on a component or directive.\n *\n * This instruction is for compatibility purposes and is designed to ensure that a\n * synthetic host binding (e.g. `@HostBinding('@foo')`) properly gets rendered in\n * the component's renderer. Normally all host bindings are evaluated with the parent\n * component's renderer, but, in the case of animation @triggers, they need to be\n * evaluated with the sub component's renderer (because that's where the animation\n * triggers are defined).\n *\n * Do not use this instruction as a replacement for `elementProperty`. This instruction\n * only exists to ensure compatibility with the ViewEngine's host binding behavior.\n *\n * @param index The index of the element to update in the data array\n * @param propName Name of property. Because it is going to DOM, this is not subject to\n * renaming as part of minification.\n * @param value New value to write.\n * @param sanitizer An optional function used to sanitize the value.\n *\n * @codeGenApi\n */\nfunction ɵɵsyntheticHostProperty(propName, value, sanitizer) {\n const lView = getLView();\n const bindingIndex = nextBindingIndex();\n if (bindingUpdated(lView, bindingIndex, value)) {\n const tView = getTView();\n const tNode = getSelectedTNode();\n const currentDef = getCurrentDirectiveDef(tView.data);\n const renderer = loadComponentRenderer(currentDef, tNode, lView);\n setDomProperty(tNode, lView, propName, value, renderer, sanitizer);\n ngDevMode && storePropertyBindingMetadata(tView.data, tNode, propName, bindingIndex);\n }\n return ɵɵsyntheticHostProperty;\n}\n\n// THIS CODE IS GENERATED - DO NOT MODIFY.\nconst u = undefined;\nfunction plural(val) {\n const i = Math.floor(Math.abs(val)), v = val.toString().replace(/^[^.]*\\.?/, '').length;\n if (i === 1 && v === 0)\n return 1;\n return 5;\n}\nvar localeEn = [\"en\", [[\"a\", \"p\"], [\"AM\", \"PM\"], u], [[\"AM\", \"PM\"], u, u], [[\"S\", \"M\", \"T\", \"W\", \"T\", \"F\", \"S\"], [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], [\"Su\", \"Mo\", \"Tu\", \"We\", \"Th\", \"Fr\", \"Sa\"]], u, [[\"J\", \"F\", \"M\", \"A\", \"M\", \"J\", \"J\", \"A\", \"S\", \"O\", \"N\", \"D\"], [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"]], u, [[\"B\", \"A\"], [\"BC\", \"AD\"], [\"Before Christ\", \"Anno Domini\"]], 0, [6, 0], [\"M/d/yy\", \"MMM d, y\", \"MMMM d, y\", \"EEEE, MMMM d, y\"], [\"h:mm a\", \"h:mm:ss a\", \"h:mm:ss a z\", \"h:mm:ss a zzzz\"], [\"{1}, {0}\", u, \"{1} 'at' {0}\", u], [\".\", \",\", \";\", \"%\", \"+\", \"-\", \"E\", \"×\", \"‰\", \"∞\", \"NaN\", \":\"], [\"#,##0.###\", \"#,##0%\", \"¤#,##0.00\", \"#E0\"], \"USD\", \"$\", \"US Dollar\", {}, \"ltr\", plural];\n\n/**\n * This const is used to store the locale data registered with `registerLocaleData`\n */\nlet LOCALE_DATA = {};\n/**\n * Register locale data to be used internally by Angular. See the\n * [\"I18n guide\"](guide/i18n/format-data-locale) to know how to import additional locale\n * data.\n *\n * The signature `registerLocaleData(data: any, extraData?: any)` is deprecated since v5.1\n */\nfunction registerLocaleData(data, localeId, extraData) {\n if (typeof localeId !== 'string') {\n extraData = localeId;\n localeId = data[LocaleDataIndex.LocaleId];\n }\n localeId = localeId.toLowerCase().replace(/_/g, '-');\n LOCALE_DATA[localeId] = data;\n if (extraData) {\n LOCALE_DATA[localeId][LocaleDataIndex.ExtraData] = extraData;\n }\n}\n/**\n * Finds the locale data for a given locale.\n *\n * @param locale The locale code.\n * @returns The locale data.\n * @see [Internationalization (i18n) Guide](https://angular.io/guide/i18n)\n */\nfunction findLocaleData(locale) {\n const normalizedLocale = normalizeLocale(locale);\n let match = getLocaleData(normalizedLocale);\n if (match) {\n return match;\n }\n // let's try to find a parent locale\n const parentLocale = normalizedLocale.split('-')[0];\n match = getLocaleData(parentLocale);\n if (match) {\n return match;\n }\n if (parentLocale === 'en') {\n return localeEn;\n }\n throw new RuntimeError(701 /* RuntimeErrorCode.MISSING_LOCALE_DATA */, ngDevMode && `Missing locale data for the locale \"${locale}\".`);\n}\n/**\n * Retrieves the default currency code for the given locale.\n *\n * The default is defined as the first currency which is still in use.\n *\n * @param locale The code of the locale whose currency code we want.\n * @returns The code of the default currency for the given locale.\n *\n */\nfunction getLocaleCurrencyCode(locale) {\n const data = findLocaleData(locale);\n return data[LocaleDataIndex.CurrencyCode] || null;\n}\n/**\n * Retrieves the plural function used by ICU expressions to determine the plural case to use\n * for a given locale.\n * @param locale A locale code for the locale format rules to use.\n * @returns The plural function for the locale.\n * @see {@link NgPlural}\n * @see [Internationalization (i18n) Guide](guide/i18n)\n */\nfunction getLocalePluralCase(locale) {\n const data = findLocaleData(locale);\n return data[LocaleDataIndex.PluralCase];\n}\n/**\n * Helper function to get the given `normalizedLocale` from `LOCALE_DATA`\n * or from the global `ng.common.locale`.\n */\nfunction getLocaleData(normalizedLocale) {\n if (!(normalizedLocale in LOCALE_DATA)) {\n LOCALE_DATA[normalizedLocale] =\n _global.ng &&\n _global.ng.common &&\n _global.ng.common.locales &&\n _global.ng.common.locales[normalizedLocale];\n }\n return LOCALE_DATA[normalizedLocale];\n}\n/**\n * Helper function to remove all the locale data from `LOCALE_DATA`.\n */\nfunction unregisterAllLocaleData() {\n LOCALE_DATA = {};\n}\n/**\n * Index of each type of locale data from the locale data array\n */\nvar LocaleDataIndex;\n(function (LocaleDataIndex) {\n LocaleDataIndex[LocaleDataIndex[\"LocaleId\"] = 0] = \"LocaleId\";\n LocaleDataIndex[LocaleDataIndex[\"DayPeriodsFormat\"] = 1] = \"DayPeriodsFormat\";\n LocaleDataIndex[LocaleDataIndex[\"DayPeriodsStandalone\"] = 2] = \"DayPeriodsStandalone\";\n LocaleDataIndex[LocaleDataIndex[\"DaysFormat\"] = 3] = \"DaysFormat\";\n LocaleDataIndex[LocaleDataIndex[\"DaysStandalone\"] = 4] = \"DaysStandalone\";\n LocaleDataIndex[LocaleDataIndex[\"MonthsFormat\"] = 5] = \"MonthsFormat\";\n LocaleDataIndex[LocaleDataIndex[\"MonthsStandalone\"] = 6] = \"MonthsStandalone\";\n LocaleDataIndex[LocaleDataIndex[\"Eras\"] = 7] = \"Eras\";\n LocaleDataIndex[LocaleDataIndex[\"FirstDayOfWeek\"] = 8] = \"FirstDayOfWeek\";\n LocaleDataIndex[LocaleDataIndex[\"WeekendRange\"] = 9] = \"WeekendRange\";\n LocaleDataIndex[LocaleDataIndex[\"DateFormat\"] = 10] = \"DateFormat\";\n LocaleDataIndex[LocaleDataIndex[\"TimeFormat\"] = 11] = \"TimeFormat\";\n LocaleDataIndex[LocaleDataIndex[\"DateTimeFormat\"] = 12] = \"DateTimeFormat\";\n LocaleDataIndex[LocaleDataIndex[\"NumberSymbols\"] = 13] = \"NumberSymbols\";\n LocaleDataIndex[LocaleDataIndex[\"NumberFormats\"] = 14] = \"NumberFormats\";\n LocaleDataIndex[LocaleDataIndex[\"CurrencyCode\"] = 15] = \"CurrencyCode\";\n LocaleDataIndex[LocaleDataIndex[\"CurrencySymbol\"] = 16] = \"CurrencySymbol\";\n LocaleDataIndex[LocaleDataIndex[\"CurrencyName\"] = 17] = \"CurrencyName\";\n LocaleDataIndex[LocaleDataIndex[\"Currencies\"] = 18] = \"Currencies\";\n LocaleDataIndex[LocaleDataIndex[\"Directionality\"] = 19] = \"Directionality\";\n LocaleDataIndex[LocaleDataIndex[\"PluralCase\"] = 20] = \"PluralCase\";\n LocaleDataIndex[LocaleDataIndex[\"ExtraData\"] = 21] = \"ExtraData\";\n})(LocaleDataIndex || (LocaleDataIndex = {}));\n/**\n * Returns the canonical form of a locale name - lowercase with `_` replaced with `-`.\n */\nfunction normalizeLocale(locale) {\n return locale.toLowerCase().replace(/_/g, '-');\n}\n\nconst pluralMapping = ['zero', 'one', 'two', 'few', 'many'];\n/**\n * Returns the plural case based on the locale\n */\nfunction getPluralCase(value, locale) {\n const plural = getLocalePluralCase(locale)(parseInt(value, 10));\n const result = pluralMapping[plural];\n return result !== undefined ? result : 'other';\n}\n/**\n * The locale id that the application is using by default (for translations and ICU expressions).\n */\nconst DEFAULT_LOCALE_ID = 'en-US';\n/**\n * USD currency code that the application uses by default for CurrencyPipe when no\n * DEFAULT_CURRENCY_CODE is provided.\n */\nconst USD_CURRENCY_CODE = 'USD';\n\n/**\n * Marks that the next string is an element name.\n *\n * See `I18nMutateOpCodes` documentation.\n */\nconst ELEMENT_MARKER = {\n marker: 'element',\n};\n/**\n * Marks that the next string is comment text need for ICU.\n *\n * See `I18nMutateOpCodes` documentation.\n */\nconst ICU_MARKER = {\n marker: 'ICU',\n};\n/**\n * See `I18nCreateOpCodes`\n */\nvar I18nCreateOpCode;\n(function (I18nCreateOpCode) {\n /**\n * Number of bits to shift index so that it can be combined with the `APPEND_EAGERLY` and\n * `COMMENT`.\n */\n I18nCreateOpCode[I18nCreateOpCode[\"SHIFT\"] = 2] = \"SHIFT\";\n /**\n * Should the node be appended to parent immediately after creation.\n */\n I18nCreateOpCode[I18nCreateOpCode[\"APPEND_EAGERLY\"] = 1] = \"APPEND_EAGERLY\";\n /**\n * If set the node should be comment (rather than a text) node.\n */\n I18nCreateOpCode[I18nCreateOpCode[\"COMMENT\"] = 2] = \"COMMENT\";\n})(I18nCreateOpCode || (I18nCreateOpCode = {}));\n\n/**\n * The locale id that the application is currently using (for translations and ICU expressions).\n * This is the ivy version of `LOCALE_ID` that was defined as an injection token for the view engine\n * but is now defined as a global value.\n */\nlet LOCALE_ID$1 = DEFAULT_LOCALE_ID;\n/**\n * Sets the locale id that will be used for translations and ICU expressions.\n * This is the ivy version of `LOCALE_ID` that was defined as an injection token for the view engine\n * but is now defined as a global value.\n *\n * @param localeId\n */\nfunction setLocaleId(localeId) {\n ngDevMode && assertDefined(localeId, `Expected localeId to be defined`);\n if (typeof localeId === 'string') {\n LOCALE_ID$1 = localeId.toLowerCase().replace(/_/g, '-');\n }\n}\n/**\n * Gets the locale id that will be used for translations and ICU expressions.\n * This is the ivy version of `LOCALE_ID` that was defined as an injection token for the view engine\n * but is now defined as a global value.\n */\nfunction getLocaleId() {\n return LOCALE_ID$1;\n}\n\n/**\n * Keep track of which input bindings in `ɵɵi18nExp` have changed.\n *\n * This is used to efficiently update expressions in i18n only when the corresponding input has\n * changed.\n *\n * 1) Each bit represents which of the `ɵɵi18nExp` has changed.\n * 2) There are 32 bits allowed in JS.\n * 3) Bit 32 is special as it is shared for all changes past 32. (In other words if you have more\n * than 32 `ɵɵi18nExp` then all changes past 32nd `ɵɵi18nExp` will be mapped to same bit. This means\n * that we may end up changing more than we need to. But i18n expressions with 32 bindings is rare\n * so in practice it should not be an issue.)\n */\nlet changeMask = 0b0;\n/**\n * Keeps track of which bit needs to be updated in `changeMask`\n *\n * This value gets incremented on every call to `ɵɵi18nExp`\n */\nlet changeMaskCounter = 0;\n/**\n * Keep track of which input bindings in `ɵɵi18nExp` have changed.\n *\n * `setMaskBit` gets invoked by each call to `ɵɵi18nExp`.\n *\n * @param hasChange did `ɵɵi18nExp` detect a change.\n */\nfunction setMaskBit(hasChange) {\n if (hasChange) {\n changeMask = changeMask | (1 << Math.min(changeMaskCounter, 31));\n }\n changeMaskCounter++;\n}\nfunction applyI18n(tView, lView, index) {\n if (changeMaskCounter > 0) {\n ngDevMode && assertDefined(tView, `tView should be defined`);\n const tI18n = tView.data[index];\n // When `index` points to an `ɵɵi18nAttributes` then we have an array otherwise `TI18n`\n const updateOpCodes = Array.isArray(tI18n)\n ? tI18n\n : tI18n.update;\n const bindingsStartIndex = getBindingIndex() - changeMaskCounter - 1;\n applyUpdateOpCodes(tView, lView, updateOpCodes, bindingsStartIndex, changeMask);\n }\n // Reset changeMask & maskBit to default for the next update cycle\n changeMask = 0b0;\n changeMaskCounter = 0;\n}\nfunction createNodeWithoutHydration(lView, textOrName, nodeType) {\n const renderer = lView[RENDERER];\n switch (nodeType) {\n case Node.COMMENT_NODE:\n return createCommentNode(renderer, textOrName);\n case Node.TEXT_NODE:\n return createTextNode(renderer, textOrName);\n case Node.ELEMENT_NODE:\n return createElementNode(renderer, textOrName, null);\n }\n}\nlet _locateOrCreateNode = (lView, index, textOrName, nodeType) => {\n lastNodeWasCreated(true);\n return createNodeWithoutHydration(lView, textOrName, nodeType);\n};\nfunction locateOrCreateNodeImpl(lView, index, textOrName, nodeType) {\n const hydrationInfo = lView[HYDRATION];\n const noOffsetIndex = index - HEADER_OFFSET;\n const isNodeCreationMode = !isI18nHydrationSupportEnabled() ||\n !hydrationInfo ||\n isInSkipHydrationBlock$1() ||\n isDisconnectedNode$1(hydrationInfo, noOffsetIndex);\n lastNodeWasCreated(isNodeCreationMode);\n if (isNodeCreationMode) {\n return createNodeWithoutHydration(lView, textOrName, nodeType);\n }\n const native = locateI18nRNodeByIndex(hydrationInfo, noOffsetIndex);\n // TODO: Improve error handling\n //\n // Other hydration paths use validateMatchingNode() in order to provide\n // detailed information in development mode about the expected DOM.\n // However, not every node in an i18n block has a TNode. Instead, we\n // need to be able to use the AST to generate a similar message.\n ngDevMode && assertDefined(native, 'expected native element');\n ngDevMode && assertEqual(native.nodeType, nodeType, 'expected matching nodeType');\n ngDevMode &&\n nodeType === Node.ELEMENT_NODE &&\n assertEqual(native.tagName.toLowerCase(), textOrName.toLowerCase(), 'expecting matching tagName');\n ngDevMode && markRNodeAsClaimedByHydration(native);\n return native;\n}\nfunction enableLocateOrCreateI18nNodeImpl() {\n _locateOrCreateNode = locateOrCreateNodeImpl;\n}\n/**\n * Apply `I18nCreateOpCodes` op-codes as stored in `TI18n.create`.\n *\n * Creates text (and comment) nodes which are internationalized.\n *\n * @param lView Current lView\n * @param createOpCodes Set of op-codes to apply\n * @param parentRNode Parent node (so that direct children can be added eagerly) or `null` if it is\n * a root node.\n * @param insertInFrontOf DOM node that should be used as an anchor.\n */\nfunction applyCreateOpCodes(lView, createOpCodes, parentRNode, insertInFrontOf) {\n const renderer = lView[RENDERER];\n for (let i = 0; i < createOpCodes.length; i++) {\n const opCode = createOpCodes[i++];\n const text = createOpCodes[i];\n const isComment = (opCode & I18nCreateOpCode.COMMENT) === I18nCreateOpCode.COMMENT;\n const appendNow = (opCode & I18nCreateOpCode.APPEND_EAGERLY) === I18nCreateOpCode.APPEND_EAGERLY;\n const index = opCode >>> I18nCreateOpCode.SHIFT;\n let rNode = lView[index];\n let lastNodeWasCreated = false;\n if (rNode === null) {\n // We only create new DOM nodes if they don't already exist: If ICU switches case back to a\n // case which was already instantiated, no need to create new DOM nodes.\n rNode = lView[index] = _locateOrCreateNode(lView, index, text, isComment ? Node.COMMENT_NODE : Node.TEXT_NODE);\n lastNodeWasCreated = wasLastNodeCreated();\n }\n if (appendNow && parentRNode !== null && lastNodeWasCreated) {\n nativeInsertBefore(renderer, parentRNode, rNode, insertInFrontOf, false);\n }\n }\n}\n/**\n * Apply `I18nMutateOpCodes` OpCodes.\n *\n * @param tView Current `TView`\n * @param mutableOpCodes Mutable OpCodes to process\n * @param lView Current `LView`\n * @param anchorRNode place where the i18n node should be inserted.\n */\nfunction applyMutableOpCodes(tView, mutableOpCodes, lView, anchorRNode) {\n ngDevMode && assertDomNode(anchorRNode);\n const renderer = lView[RENDERER];\n // `rootIdx` represents the node into which all inserts happen.\n let rootIdx = null;\n // `rootRNode` represents the real node into which we insert. This can be different from\n // `lView[rootIdx]` if we have projection.\n // - null we don't have a parent (as can be the case in when we are inserting into a root of\n // LView which has no parent.)\n // - `RElement` The element representing the root after taking projection into account.\n let rootRNode;\n for (let i = 0; i < mutableOpCodes.length; i++) {\n const opCode = mutableOpCodes[i];\n if (typeof opCode == 'string') {\n const textNodeIndex = mutableOpCodes[++i];\n if (lView[textNodeIndex] === null) {\n ngDevMode && assertIndexInRange(lView, textNodeIndex);\n lView[textNodeIndex] = _locateOrCreateNode(lView, textNodeIndex, opCode, Node.TEXT_NODE);\n }\n }\n else if (typeof opCode == 'number') {\n switch (opCode & 1 /* IcuCreateOpCode.MASK_INSTRUCTION */) {\n case 0 /* IcuCreateOpCode.AppendChild */:\n const parentIdx = getParentFromIcuCreateOpCode(opCode);\n if (rootIdx === null) {\n // The first operation should save the `rootIdx` because the first operation\n // must insert into the root. (Only subsequent operations can insert into a dynamic\n // parent)\n rootIdx = parentIdx;\n rootRNode = renderer.parentNode(anchorRNode);\n }\n let insertInFrontOf;\n let parentRNode;\n if (parentIdx === rootIdx) {\n insertInFrontOf = anchorRNode;\n parentRNode = rootRNode;\n }\n else {\n insertInFrontOf = null;\n parentRNode = unwrapRNode(lView[parentIdx]);\n }\n // FIXME(misko): Refactor with `processI18nText`\n if (parentRNode !== null) {\n // This can happen if the `LView` we are adding to is not attached to a parent `LView`.\n // In such a case there is no \"root\" we can attach to. This is fine, as we still need to\n // create the elements. When the `LView` gets later added to a parent these \"root\" nodes\n // get picked up and added.\n ngDevMode && assertDomNode(parentRNode);\n const refIdx = getRefFromIcuCreateOpCode(opCode);\n ngDevMode && assertGreaterThan(refIdx, HEADER_OFFSET, 'Missing ref');\n // `unwrapRNode` is not needed here as all of these point to RNodes as part of the i18n\n // which can't have components.\n const child = lView[refIdx];\n ngDevMode && assertDomNode(child);\n nativeInsertBefore(renderer, parentRNode, child, insertInFrontOf, false);\n const tIcu = getTIcu(tView, refIdx);\n if (tIcu !== null && typeof tIcu === 'object') {\n // If we just added a comment node which has ICU then that ICU may have already been\n // rendered and therefore we need to re-add it here.\n ngDevMode && assertTIcu(tIcu);\n const caseIndex = getCurrentICUCaseIndex(tIcu, lView);\n if (caseIndex !== null) {\n applyMutableOpCodes(tView, tIcu.create[caseIndex], lView, lView[tIcu.anchorIdx]);\n }\n }\n }\n break;\n case 1 /* IcuCreateOpCode.Attr */:\n const elementNodeIndex = opCode >>> 1 /* IcuCreateOpCode.SHIFT_REF */;\n const attrName = mutableOpCodes[++i];\n const attrValue = mutableOpCodes[++i];\n // This code is used for ICU expressions only, since we don't support\n // directives/components in ICUs, we don't need to worry about inputs here\n setElementAttribute(renderer, getNativeByIndex(elementNodeIndex, lView), null, null, attrName, attrValue, null);\n break;\n default:\n if (ngDevMode) {\n throw new RuntimeError(700 /* RuntimeErrorCode.INVALID_I18N_STRUCTURE */, `Unable to determine the type of mutate operation for \"${opCode}\"`);\n }\n }\n }\n else {\n switch (opCode) {\n case ICU_MARKER:\n const commentValue = mutableOpCodes[++i];\n const commentNodeIndex = mutableOpCodes[++i];\n if (lView[commentNodeIndex] === null) {\n ngDevMode &&\n assertEqual(typeof commentValue, 'string', `Expected \"${commentValue}\" to be a comment node value`);\n ngDevMode && assertIndexInExpandoRange(lView, commentNodeIndex);\n const commentRNode = (lView[commentNodeIndex] = _locateOrCreateNode(lView, commentNodeIndex, commentValue, Node.COMMENT_NODE));\n // FIXME(misko): Attaching patch data is only needed for the root (Also add tests)\n attachPatchData(commentRNode, lView);\n }\n break;\n case ELEMENT_MARKER:\n const tagName = mutableOpCodes[++i];\n const elementNodeIndex = mutableOpCodes[++i];\n if (lView[elementNodeIndex] === null) {\n ngDevMode &&\n assertEqual(typeof tagName, 'string', `Expected \"${tagName}\" to be an element node tag name`);\n ngDevMode && assertIndexInExpandoRange(lView, elementNodeIndex);\n const elementRNode = (lView[elementNodeIndex] = _locateOrCreateNode(lView, elementNodeIndex, tagName, Node.ELEMENT_NODE));\n // FIXME(misko): Attaching patch data is only needed for the root (Also add tests)\n attachPatchData(elementRNode, lView);\n }\n break;\n default:\n ngDevMode &&\n throwError(`Unable to determine the type of mutate operation for \"${opCode}\"`);\n }\n }\n }\n}\n/**\n * Apply `I18nUpdateOpCodes` OpCodes\n *\n * @param tView Current `TView`\n * @param lView Current `LView`\n * @param updateOpCodes OpCodes to process\n * @param bindingsStartIndex Location of the first `ɵɵi18nApply`\n * @param changeMask Each bit corresponds to a `ɵɵi18nExp` (Counting backwards from\n * `bindingsStartIndex`)\n */\nfunction applyUpdateOpCodes(tView, lView, updateOpCodes, bindingsStartIndex, changeMask) {\n for (let i = 0; i < updateOpCodes.length; i++) {\n // bit code to check if we should apply the next update\n const checkBit = updateOpCodes[i];\n // Number of opCodes to skip until next set of update codes\n const skipCodes = updateOpCodes[++i];\n if (checkBit & changeMask) {\n // The value has been updated since last checked\n let value = '';\n for (let j = i + 1; j <= i + skipCodes; j++) {\n const opCode = updateOpCodes[j];\n if (typeof opCode == 'string') {\n value += opCode;\n }\n else if (typeof opCode == 'number') {\n if (opCode < 0) {\n // Negative opCode represent `i18nExp` values offset.\n value += renderStringify(lView[bindingsStartIndex - opCode]);\n }\n else {\n const nodeIndex = opCode >>> 2 /* I18nUpdateOpCode.SHIFT_REF */;\n switch (opCode & 3 /* I18nUpdateOpCode.MASK_OPCODE */) {\n case 1 /* I18nUpdateOpCode.Attr */:\n const propName = updateOpCodes[++j];\n const sanitizeFn = updateOpCodes[++j];\n const tNodeOrTagName = tView.data[nodeIndex];\n ngDevMode && assertDefined(tNodeOrTagName, 'Experting TNode or string');\n if (typeof tNodeOrTagName === 'string') {\n // IF we don't have a `TNode`, then we are an element in ICU (as ICU content does\n // not have TNode), in which case we know that there are no directives, and hence\n // we use attribute setting.\n setElementAttribute(lView[RENDERER], lView[nodeIndex], null, tNodeOrTagName, propName, value, sanitizeFn);\n }\n else {\n setPropertyAndInputs(tNodeOrTagName, lView, propName, value, lView[RENDERER], sanitizeFn);\n }\n break;\n case 0 /* I18nUpdateOpCode.Text */:\n const rText = lView[nodeIndex];\n rText !== null && updateTextNode(lView[RENDERER], rText, value);\n break;\n case 2 /* I18nUpdateOpCode.IcuSwitch */:\n applyIcuSwitchCase(tView, getTIcu(tView, nodeIndex), lView, value);\n break;\n case 3 /* I18nUpdateOpCode.IcuUpdate */:\n applyIcuUpdateCase(tView, getTIcu(tView, nodeIndex), bindingsStartIndex, lView);\n break;\n }\n }\n }\n }\n }\n else {\n const opCode = updateOpCodes[i + 1];\n if (opCode > 0 && (opCode & 3 /* I18nUpdateOpCode.MASK_OPCODE */) === 3 /* I18nUpdateOpCode.IcuUpdate */) {\n // Special case for the `icuUpdateCase`. It could be that the mask did not match, but\n // we still need to execute `icuUpdateCase` because the case has changed recently due to\n // previous `icuSwitchCase` instruction. (`icuSwitchCase` and `icuUpdateCase` always come in\n // pairs.)\n const nodeIndex = opCode >>> 2 /* I18nUpdateOpCode.SHIFT_REF */;\n const tIcu = getTIcu(tView, nodeIndex);\n const currentIndex = lView[tIcu.currentCaseLViewIndex];\n if (currentIndex < 0) {\n applyIcuUpdateCase(tView, tIcu, bindingsStartIndex, lView);\n }\n }\n }\n i += skipCodes;\n }\n}\n/**\n * Apply OpCodes associated with updating an existing ICU.\n *\n * @param tView Current `TView`\n * @param tIcu Current `TIcu`\n * @param bindingsStartIndex Location of the first `ɵɵi18nApply`\n * @param lView Current `LView`\n */\nfunction applyIcuUpdateCase(tView, tIcu, bindingsStartIndex, lView) {\n ngDevMode && assertIndexInRange(lView, tIcu.currentCaseLViewIndex);\n let activeCaseIndex = lView[tIcu.currentCaseLViewIndex];\n if (activeCaseIndex !== null) {\n let mask = changeMask;\n if (activeCaseIndex < 0) {\n // Clear the flag.\n // Negative number means that the ICU was freshly created and we need to force the update.\n activeCaseIndex = lView[tIcu.currentCaseLViewIndex] = ~activeCaseIndex;\n // -1 is same as all bits on, which simulates creation since it marks all bits dirty\n mask = -1;\n }\n applyUpdateOpCodes(tView, lView, tIcu.update[activeCaseIndex], bindingsStartIndex, mask);\n }\n}\n/**\n * Apply OpCodes associated with switching a case on ICU.\n *\n * This involves tearing down existing case and than building up a new case.\n *\n * @param tView Current `TView`\n * @param tIcu Current `TIcu`\n * @param lView Current `LView`\n * @param value Value of the case to update to.\n */\nfunction applyIcuSwitchCase(tView, tIcu, lView, value) {\n // Rebuild a new case for this ICU\n const caseIndex = getCaseIndex(tIcu, value);\n let activeCaseIndex = getCurrentICUCaseIndex(tIcu, lView);\n if (activeCaseIndex !== caseIndex) {\n applyIcuSwitchCaseRemove(tView, tIcu, lView);\n lView[tIcu.currentCaseLViewIndex] = caseIndex === null ? null : ~caseIndex;\n if (caseIndex !== null) {\n // Add the nodes for the new case\n const anchorRNode = lView[tIcu.anchorIdx];\n if (anchorRNode) {\n ngDevMode && assertDomNode(anchorRNode);\n applyMutableOpCodes(tView, tIcu.create[caseIndex], lView, anchorRNode);\n }\n claimDehydratedIcuCase(lView, tIcu.anchorIdx, caseIndex);\n }\n }\n}\n/**\n * Apply OpCodes associated with tearing ICU case.\n *\n * This involves tearing down existing case and than building up a new case.\n *\n * @param tView Current `TView`\n * @param tIcu Current `TIcu`\n * @param lView Current `LView`\n */\nfunction applyIcuSwitchCaseRemove(tView, tIcu, lView) {\n let activeCaseIndex = getCurrentICUCaseIndex(tIcu, lView);\n if (activeCaseIndex !== null) {\n const removeCodes = tIcu.remove[activeCaseIndex];\n for (let i = 0; i < removeCodes.length; i++) {\n const nodeOrIcuIndex = removeCodes[i];\n if (nodeOrIcuIndex > 0) {\n // Positive numbers are `RNode`s.\n const rNode = getNativeByIndex(nodeOrIcuIndex, lView);\n rNode !== null && nativeRemoveNode(lView[RENDERER], rNode);\n }\n else {\n // Negative numbers are ICUs\n applyIcuSwitchCaseRemove(tView, getTIcu(tView, ~nodeOrIcuIndex), lView);\n }\n }\n }\n}\n/**\n * Returns the index of the current case of an ICU expression depending on the main binding value\n *\n * @param icuExpression\n * @param bindingValue The value of the main binding used by this ICU expression\n */\nfunction getCaseIndex(icuExpression, bindingValue) {\n let index = icuExpression.cases.indexOf(bindingValue);\n if (index === -1) {\n switch (icuExpression.type) {\n case 1 /* IcuType.plural */: {\n const resolvedCase = getPluralCase(bindingValue, getLocaleId());\n index = icuExpression.cases.indexOf(resolvedCase);\n if (index === -1 && resolvedCase !== 'other') {\n index = icuExpression.cases.indexOf('other');\n }\n break;\n }\n case 0 /* IcuType.select */: {\n index = icuExpression.cases.indexOf('other');\n break;\n }\n }\n }\n return index === -1 ? null : index;\n}\n\n/**\n * Converts `I18nCreateOpCodes` array into a human readable format.\n *\n * This function is attached to the `I18nCreateOpCodes.debug` property if `ngDevMode` is enabled.\n * This function provides a human readable view of the opcodes. This is useful when debugging the\n * application as well as writing more readable tests.\n *\n * @param this `I18nCreateOpCodes` if attached as a method.\n * @param opcodes `I18nCreateOpCodes` if invoked as a function.\n */\nfunction i18nCreateOpCodesToString(opcodes) {\n const createOpCodes = opcodes || (Array.isArray(this) ? this : []);\n let lines = [];\n for (let i = 0; i < createOpCodes.length; i++) {\n const opCode = createOpCodes[i++];\n const text = createOpCodes[i];\n const isComment = (opCode & I18nCreateOpCode.COMMENT) === I18nCreateOpCode.COMMENT;\n const appendNow = (opCode & I18nCreateOpCode.APPEND_EAGERLY) === I18nCreateOpCode.APPEND_EAGERLY;\n const index = opCode >>> I18nCreateOpCode.SHIFT;\n lines.push(`lView[${index}] = document.${isComment ? 'createComment' : 'createText'}(${JSON.stringify(text)});`);\n if (appendNow) {\n lines.push(`parent.appendChild(lView[${index}]);`);\n }\n }\n return lines;\n}\n/**\n * Converts `I18nUpdateOpCodes` array into a human readable format.\n *\n * This function is attached to the `I18nUpdateOpCodes.debug` property if `ngDevMode` is enabled.\n * This function provides a human readable view of the opcodes. This is useful when debugging the\n * application as well as writing more readable tests.\n *\n * @param this `I18nUpdateOpCodes` if attached as a method.\n * @param opcodes `I18nUpdateOpCodes` if invoked as a function.\n */\nfunction i18nUpdateOpCodesToString(opcodes) {\n const parser = new OpCodeParser(opcodes || (Array.isArray(this) ? this : []));\n let lines = [];\n function consumeOpCode(value) {\n const ref = value >>> 2 /* I18nUpdateOpCode.SHIFT_REF */;\n const opCode = value & 3 /* I18nUpdateOpCode.MASK_OPCODE */;\n switch (opCode) {\n case 0 /* I18nUpdateOpCode.Text */:\n return `(lView[${ref}] as Text).textContent = $$$`;\n case 1 /* I18nUpdateOpCode.Attr */:\n const attrName = parser.consumeString();\n const sanitizationFn = parser.consumeFunction();\n const value = sanitizationFn ? `(${sanitizationFn})($$$)` : '$$$';\n return `(lView[${ref}] as Element).setAttribute('${attrName}', ${value})`;\n case 2 /* I18nUpdateOpCode.IcuSwitch */:\n return `icuSwitchCase(${ref}, $$$)`;\n case 3 /* I18nUpdateOpCode.IcuUpdate */:\n return `icuUpdateCase(${ref})`;\n }\n throw new Error('unexpected OpCode');\n }\n while (parser.hasMore()) {\n let mask = parser.consumeNumber();\n let size = parser.consumeNumber();\n const end = parser.i + size;\n const statements = [];\n let statement = '';\n while (parser.i < end) {\n let value = parser.consumeNumberOrString();\n if (typeof value === 'string') {\n statement += value;\n }\n else if (value < 0) {\n // Negative numbers are ref indexes\n // Here `i` refers to current binding index. It is to signify that the value is relative,\n // rather than absolute.\n statement += '${lView[i' + value + ']}';\n }\n else {\n // Positive numbers are operations.\n const opCodeText = consumeOpCode(value);\n statements.push(opCodeText.replace('$$$', '`' + statement + '`') + ';');\n statement = '';\n }\n }\n lines.push(`if (mask & 0b${mask.toString(2)}) { ${statements.join(' ')} }`);\n }\n return lines;\n}\n/**\n * Converts `I18nCreateOpCodes` array into a human readable format.\n *\n * This function is attached to the `I18nCreateOpCodes.debug` if `ngDevMode` is enabled. This\n * function provides a human readable view of the opcodes. This is useful when debugging the\n * application as well as writing more readable tests.\n *\n * @param this `I18nCreateOpCodes` if attached as a method.\n * @param opcodes `I18nCreateOpCodes` if invoked as a function.\n */\nfunction icuCreateOpCodesToString(opcodes) {\n const parser = new OpCodeParser(opcodes || (Array.isArray(this) ? this : []));\n let lines = [];\n function consumeOpCode(opCode) {\n const parent = getParentFromIcuCreateOpCode(opCode);\n const ref = getRefFromIcuCreateOpCode(opCode);\n switch (getInstructionFromIcuCreateOpCode(opCode)) {\n case 0 /* IcuCreateOpCode.AppendChild */:\n return `(lView[${parent}] as Element).appendChild(lView[${lastRef}])`;\n case 1 /* IcuCreateOpCode.Attr */:\n return `(lView[${ref}] as Element).setAttribute(\"${parser.consumeString()}\", \"${parser.consumeString()}\")`;\n }\n throw new Error('Unexpected OpCode: ' + getInstructionFromIcuCreateOpCode(opCode));\n }\n let lastRef = -1;\n while (parser.hasMore()) {\n let value = parser.consumeNumberStringOrMarker();\n if (value === ICU_MARKER) {\n const text = parser.consumeString();\n lastRef = parser.consumeNumber();\n lines.push(`lView[${lastRef}] = document.createComment(\"${text}\")`);\n }\n else if (value === ELEMENT_MARKER) {\n const text = parser.consumeString();\n lastRef = parser.consumeNumber();\n lines.push(`lView[${lastRef}] = document.createElement(\"${text}\")`);\n }\n else if (typeof value === 'string') {\n lastRef = parser.consumeNumber();\n lines.push(`lView[${lastRef}] = document.createTextNode(\"${value}\")`);\n }\n else if (typeof value === 'number') {\n const line = consumeOpCode(value);\n line && lines.push(line);\n }\n else {\n throw new Error('Unexpected value');\n }\n }\n return lines;\n}\n/**\n * Converts `I18nRemoveOpCodes` array into a human readable format.\n *\n * This function is attached to the `I18nRemoveOpCodes.debug` if `ngDevMode` is enabled. This\n * function provides a human readable view of the opcodes. This is useful when debugging the\n * application as well as writing more readable tests.\n *\n * @param this `I18nRemoveOpCodes` if attached as a method.\n * @param opcodes `I18nRemoveOpCodes` if invoked as a function.\n */\nfunction i18nRemoveOpCodesToString(opcodes) {\n const removeCodes = opcodes || (Array.isArray(this) ? this : []);\n let lines = [];\n for (let i = 0; i < removeCodes.length; i++) {\n const nodeOrIcuIndex = removeCodes[i];\n if (nodeOrIcuIndex > 0) {\n // Positive numbers are `RNode`s.\n lines.push(`remove(lView[${nodeOrIcuIndex}])`);\n }\n else {\n // Negative numbers are ICUs\n lines.push(`removeNestedICU(${~nodeOrIcuIndex})`);\n }\n }\n return lines;\n}\nclass OpCodeParser {\n i = 0;\n codes;\n constructor(codes) {\n this.codes = codes;\n }\n hasMore() {\n return this.i < this.codes.length;\n }\n consumeNumber() {\n let value = this.codes[this.i++];\n assertNumber(value, 'expecting number in OpCode');\n return value;\n }\n consumeString() {\n let value = this.codes[this.i++];\n assertString(value, 'expecting string in OpCode');\n return value;\n }\n consumeFunction() {\n let value = this.codes[this.i++];\n if (value === null || typeof value === 'function') {\n return value;\n }\n throw new Error('expecting function in OpCode');\n }\n consumeNumberOrString() {\n let value = this.codes[this.i++];\n if (typeof value === 'string') {\n return value;\n }\n assertNumber(value, 'expecting number or string in OpCode');\n return value;\n }\n consumeNumberStringOrMarker() {\n let value = this.codes[this.i++];\n if (typeof value === 'string' ||\n typeof value === 'number' ||\n value == ICU_MARKER ||\n value == ELEMENT_MARKER) {\n return value;\n }\n assertNumber(value, 'expecting number, string, ICU_MARKER or ELEMENT_MARKER in OpCode');\n return value;\n }\n}\n\nconst BINDING_REGEXP = /<2F>(\\d+):?\\d*<2A>/gi;\nconst ICU_REGEXP = /({\\s*<2A>\\d+:?\\d*<2A>\\s*,\\s*\\S{6}\\s*,[\\s\\S]*})/gi;\nconst NESTED_ICU = /<2F>(\\d+)<29>/;\nconst ICU_BLOCK_REGEXP = /^\\s*(<28>\\d+:?\\d*<2A>)\\s*,\\s*(select|plural)\\s*,/;\nconst MARKER = `<60>`;\nconst SUBTEMPLATE_REGEXP = /<2F>\\/?\\*(\\d+:\\d+)<29>/gi;\nconst PH_REGEXP = /<2F>(\\/?[#*]\\d+):?\\d*<2A>/gi;\n/**\n * Angular uses the special entity &ngsp; as a placeholder for non-removable space.\n * It's replaced by the 0xE500 PUA (Private Use Areas) unicode character and later on replaced by a\n * space.\n * We are re-implementing the same idea since translations might contain this special character.\n */\nconst NGSP_UNICODE_REGEXP = /\\uE500/g;\nfunction replaceNgsp(value) {\n return value.replace(NGSP_UNICODE_REGEXP, ' ');\n}\n/**\n * Patch a `debug` property getter on top of the existing object.\n *\n * NOTE: always call this method with `ngDevMode && attachDebugObject(...)`\n *\n * @param obj Object to patch\n * @param debugGetter Getter returning a value to patch\n */\nfunction attachDebugGetter(obj, debugGetter) {\n if (ngDevMode) {\n Object.defineProperty(obj, 'debug', { get: debugGetter, enumerable: false });\n }\n else {\n throw new Error('This method should be guarded with `ngDevMode` so that it can be tree shaken in production!');\n }\n}\n/**\n * Create dynamic nodes from i18n translation block.\n *\n * - Text nodes are created synchronously\n * - TNodes are linked into tree lazily\n *\n * @param tView Current `TView`\n * @parentTNodeIndex index to the parent TNode of this i18n block\n * @param lView Current `LView`\n * @param index Index of `ɵɵi18nStart` instruction.\n * @param message Message to translate.\n * @param subTemplateIndex Index into the sub template of message translation. (ie in case of\n * `ngIf`) (-1 otherwise)\n */\nfunction i18nStartFirstCreatePass(tView, parentTNodeIndex, lView, index, message, subTemplateIndex) {\n const rootTNode = getCurrentParentTNode();\n const createOpCodes = [];\n const updateOpCodes = [];\n const existingTNodeStack = [[]];\n const astStack = [[]];\n if (ngDevMode) {\n attachDebugGetter(createOpCodes, i18nCreateOpCodesToString);\n attachDebugGetter(updateOpCodes, i18nUpdateOpCodesToString);\n }\n message = getTranslationForTemplate(message, subTemplateIndex);\n const msgParts = replaceNgsp(message).split(PH_REGEXP);\n for (let i = 0; i < msgParts.length; i++) {\n let value = msgParts[i];\n if ((i & 1) === 0) {\n // Even indexes are text (including bindings & ICU expressions)\n const parts = i18nParseTextIntoPartsAndICU(value);\n for (let j = 0; j < parts.length; j++) {\n let part = parts[j];\n if ((j & 1) === 0) {\n // `j` is odd therefore `part` is string\n const text = part;\n ngDevMode && assertString(text, 'Parsed ICU part should be string');\n if (text !== '') {\n i18nStartFirstCreatePassProcessTextNode(astStack[0], tView, rootTNode, existingTNodeStack[0], createOpCodes, updateOpCodes, lView, text);\n }\n }\n else {\n // `j` is Even therefor `part` is an `ICUExpression`\n const icuExpression = part;\n // Verify that ICU expression has the right shape. Translations might contain invalid\n // constructions (while original messages were correct), so ICU parsing at runtime may\n // not succeed (thus `icuExpression` remains a string).\n // Note: we intentionally retain the error here by not using `ngDevMode`, because\n // the value can change based on the locale and users aren't guaranteed to hit\n // an invalid string while they're developing.\n if (typeof icuExpression !== 'object') {\n throw new Error(`Unable to parse ICU expression in \"${message}\" message.`);\n }\n const icuContainerTNode = createTNodeAndAddOpCode(tView, rootTNode, existingTNodeStack[0], lView, createOpCodes, ngDevMode ? `ICU ${index}:${icuExpression.mainBinding}` : '', true);\n const icuNodeIndex = icuContainerTNode.index;\n ngDevMode &&\n assertGreaterThanOrEqual(icuNodeIndex, HEADER_OFFSET, 'Index must be in absolute LView offset');\n icuStart(astStack[0], tView, lView, updateOpCodes, parentTNodeIndex, icuExpression, icuNodeIndex);\n }\n }\n }\n else {\n // Odd indexes are placeholders (elements and sub-templates)\n // At this point value is something like: '/#1:2' (originally coming from '<27>/#1:2<>')\n const isClosing = value.charCodeAt(0) === 47 /* CharCode.SLASH */;\n const type = value.charCodeAt(isClosing ? 1 : 0);\n ngDevMode && assertOneOf(type, 42 /* CharCode.STAR */, 35 /* CharCode.HASH */);\n const index = HEADER_OFFSET + Number.parseInt(value.substring(isClosing ? 2 : 1));\n if (isClosing) {\n existingTNodeStack.shift();\n astStack.shift();\n setCurrentTNode(getCurrentParentTNode(), false);\n }\n else {\n const tNode = createTNodePlaceholder(tView, existingTNodeStack[0], index);\n existingTNodeStack.unshift([]);\n setCurrentTNode(tNode, true);\n const placeholderNode = {\n kind: 2 /* I18nNodeKind.PLACEHOLDER */,\n index,\n children: [],\n type: type === 35 /* CharCode.HASH */ ? 0 /* I18nPlaceholderType.ELEMENT */ : 1 /* I18nPlaceholderType.SUBTEMPLATE */,\n };\n astStack[0].push(placeholderNode);\n astStack.unshift(placeholderNode.children);\n }\n }\n }\n tView.data[index] = {\n create: createOpCodes,\n update: updateOpCodes,\n ast: astStack[0],\n parentTNodeIndex,\n };\n}\n/**\n * Allocate space in i18n Range add create OpCode instruction to create a text or comment node.\n *\n * @param tView Current `TView` needed to allocate space in i18n range.\n * @param rootTNode Root `TNode` of the i18n block. This node determines if the new TNode will be\n * added as part of the `i18nStart` instruction or as part of the `TNode.insertBeforeIndex`.\n * @param existingTNodes internal state for `addTNodeAndUpdateInsertBeforeIndex`.\n * @param lView Current `LView` needed to allocate space in i18n range.\n * @param createOpCodes Array storing `I18nCreateOpCodes` where new opCodes will be added.\n * @param text Text to be added when the `Text` or `Comment` node will be created.\n * @param isICU true if a `Comment` node for ICU (instead of `Text`) node should be created.\n */\nfunction createTNodeAndAddOpCode(tView, rootTNode, existingTNodes, lView, createOpCodes, text, isICU) {\n const i18nNodeIdx = allocExpando(tView, lView, 1, null);\n let opCode = i18nNodeIdx << I18nCreateOpCode.SHIFT;\n let parentTNode = getCurrentParentTNode();\n if (rootTNode === parentTNode) {\n // FIXME(misko): A null `parentTNode` should represent when we fall of the `LView` boundary.\n // (there is no parent), but in some circumstances (because we are inconsistent about how we set\n // `previousOrParentTNode`) it could point to `rootTNode` So this is a work around.\n parentTNode = null;\n }\n if (parentTNode === null) {\n // If we don't have a parent that means that we can eagerly add nodes.\n // If we have a parent than these nodes can't be added now (as the parent has not been created\n // yet) and instead the `parentTNode` is responsible for adding it. See\n // `TNode.insertBeforeIndex`\n opCode |= I18nCreateOpCode.APPEND_EAGERLY;\n }\n if (isICU) {\n opCode |= I18nCreateOpCode.COMMENT;\n ensureIcuContainerVisitorLoaded(loadIcuContainerVisitor);\n }\n createOpCodes.push(opCode, text === null ? '' : text);\n // We store `{{?}}` so that when looking at debug `TNodeType.template` we can see where the\n // bindings are.\n const tNode = createTNodeAtIndex(tView, i18nNodeIdx, isICU ? 32 /* TNodeType.Icu */ : 1 /* TNodeType.Text */, text === null ? (ngDevMode ? '{{?}}' : '') : text, null);\n addTNodeAndUpdateInsertBeforeIndex(existingTNodes, tNode);\n const tNodeIdx = tNode.index;\n setCurrentTNode(tNode, false /* Text nodes are self closing */);\n if (parentTNode !== null && rootTNode !== parentTNode) {\n // We are a child of deeper node (rather than a direct child of `i18nStart` instruction.)\n // We have to make sure to add ourselves to the parent.\n setTNodeInsertBeforeIndex(parentTNode, tNodeIdx);\n }\n return tNode;\n}\n/**\n * Processes text node in i18n block.\n *\n * Text nodes can have:\n * - Create instruction in `createOpCodes` for creating the text node.\n * - Allocate spec for text node in i18n range of `LView`\n * - If contains binding:\n * - bindings => allocate space in i18n range of `LView` to store the binding value.\n * - populate `updateOpCodes` with update instructions.\n *\n * @param tView Current `TView`\n * @param rootTNode Root `TNode` of the i18n block. This node determines if the new TNode will\n * be added as part of the `i18nStart` instruction or as part of the\n * `TNode.insertBeforeIndex`.\n * @param existingTNodes internal state for `addTNodeAndUpdateInsertBeforeIndex`.\n * @param createOpCodes Location where the creation OpCodes will be stored.\n * @param lView Current `LView`\n * @param text The translated text (which may contain binding)\n */\nfunction i18nStartFirstCreatePassProcessTextNode(ast, tView, rootTNode, existingTNodes, createOpCodes, updateOpCodes, lView, text) {\n const hasBinding = text.match(BINDING_REGEXP);\n const tNode = createTNodeAndAddOpCode(tView, rootTNode, existingTNodes, lView, createOpCodes, hasBinding ? null : text, false);\n const index = tNode.index;\n if (hasBinding) {\n generateBindingUpdateOpCodes(updateOpCodes, text, index, null, 0, null);\n }\n ast.push({ kind: 0 /* I18nNodeKind.TEXT */, index });\n}\n/**\n * See `i18nAttributes` above.\n */\nfunction i18nAttributesFirstPass(tView, index, values) {\n const previousElement = getCurrentTNode();\n const previousElementIndex = previousElement.index;\n const updateOpCodes = [];\n if (ngDevMode) {\n attachDebugGetter(updateOpCodes, i18nUpdateOpCodesToString);\n }\n if (tView.firstCreatePass && tView.data[index] === null) {\n for (let i = 0; i < values.length; i += 2) {\n const attrName = values[i];\n const message = values[i + 1];\n if (message !== '') {\n // Check if attribute value contains an ICU and throw an error if that's the case.\n // ICUs in element attributes are not supported.\n // Note: we intentionally retain the error here by not using `ngDevMode`, because\n // the `value` can change based on the locale and users aren't guaranteed to hit\n // an invalid string while they're developing.\n if (ICU_REGEXP.test(message)) {\n throw new Error(`ICU expressions are not supported in attributes. Message: \"${message}\".`);\n }\n // i18n attributes that hit this code path are guaranteed to have bindings, because\n // the compiler treats static i18n attributes as regular attribute bindings.\n // Since this may not be the first i18n attribute on this element we need to pass in how\n // many previous bindings there have already been.\n generateBindingUpdateOpCodes(updateOpCodes, message, previousElementIndex, attrName, countBindings(updateOpCodes), null);\n }\n }\n tView.data[index] = updateOpCodes;\n }\n}\n/**\n * Generate the OpCodes to update the bindings of a string.\n *\n * @param updateOpCodes Place where the update opcodes will be stored.\n * @param str The string containing the bindings.\n * @param destinationNode Index of the destination node which will receive the binding.\n * @param attrName Name of the attribute, if the string belongs to an attribute.\n * @param sanitizeFn Sanitization function used to sanitize the string after update, if necessary.\n * @param bindingStart The lView index of the next expression that can be bound via an opCode.\n * @returns The mask value for these bindings\n */\nfunction generateBindingUpdateOpCodes(updateOpCodes, str, destinationNode, attrName, bindingStart, sanitizeFn) {\n ngDevMode &&\n assertGreaterThanOrEqual(destinationNode, HEADER_OFFSET, 'Index must be in absolute LView offset');\n const maskIndex = updateOpCodes.length; // Location of mask\n const sizeIndex = maskIndex + 1; // location of size for skipping\n updateOpCodes.push(null, null); // Alloc space for mask and size\n const startIndex = maskIndex + 2; // location of first allocation.\n if (ngDevMode) {\n attachDebugGetter(updateOpCodes, i18nUpdateOpCodesToString);\n }\n const textParts = str.split(BINDING_REGEXP);\n let mask = 0;\n for (let j = 0; j < textParts.length; j++) {\n const textValue = textParts[j];\n if (j & 1) {\n // Odd indexes are bindings\n const bindingIndex = bindingStart + parseInt(textValue, 10);\n updateOpCodes.push(-1 - bindingIndex);\n mask = mask | toMaskBit(bindingIndex);\n }\n else if (textValue !== '') {\n // Even indexes are text\n updateOpCodes.push(textValue);\n }\n }\n updateOpCodes.push((destinationNode << 2 /* I18nUpdateOpCode.SHIFT_REF */) |\n (attrName ? 1 /* I18nUpdateOpCode.Attr */ : 0 /* I18nUpdateOpCode.Text */));\n if (attrName) {\n updateOpCodes.push(attrName, sanitizeFn);\n }\n updateOpCodes[maskIndex] = mask;\n updateOpCodes[sizeIndex] = updateOpCodes.length - startIndex;\n return mask;\n}\n/**\n * Count the number of bindings in the given `opCodes`.\n *\n * It could be possible to speed this up, by passing the number of bindings found back from\n * `generateBindingUpdateOpCodes()` to `i18nAttributesFirstPass()` but this would then require more\n * complexity in the code and/or transient objects to be created.\n *\n * Since this function is only called once when the template is instantiated, is trivial in the\n * first instance (since `opCodes` will be an empty array), and it is not common for elements to\n * contain multiple i18n bound attributes, it seems like this is a reasonable compromise.\n */\nfunction countBindings(opCodes) {\n let count = 0;\n for (let i = 0; i < opCodes.length; i++) {\n const opCode = opCodes[i];\n // Bindings are negative numbers.\n if (typeof opCode === 'number' && opCode < 0) {\n count++;\n }\n }\n return count;\n}\n/**\n * Convert binding index to mask bit.\n *\n * Each index represents a single bit on the bit-mask. Because bit-mask only has 32 bits, we make\n * the 32nd bit share all masks for all bindings higher than 32. Since it is extremely rare to\n * have more than 32 bindings this will be hit very rarely. The downside of hitting this corner\n * case is that we will execute binding code more often than necessary. (penalty of performance)\n */\nfunction toMaskBit(bindingIndex) {\n return 1 << Math.min(bindingIndex, 31);\n}\n/**\n * Removes everything inside the sub-templates of a message.\n */\nfunction removeInnerTemplateTranslation(message) {\n let match;\n let res = '';\n let index = 0;\n let inTemplate = false;\n let tagMatched;\n while ((match = SUBTEMPLATE_REGEXP.exec(message)) !== null) {\n if (!inTemplate) {\n res += message.substring(index, match.index + match[0].length);\n tagMatched = match[1];\n inTemplate = true;\n }\n else {\n if (match[0] === `${MARKER}/*${tagMatched}${MARKER}`) {\n index = match.index;\n inTemplate = false;\n }\n }\n }\n ngDevMode &&\n assertEqual(inTemplate, false, `Tag mismatch: unable to find the end of the sub-template in the translation \"${message}\"`);\n res += message.slice(index);\n return res;\n}\n/**\n * Extracts a part of a message and removes the rest.\n *\n * This method is used for extracting a part of the message associated with a template. A\n * translated message can span multiple templates.\n *\n * Example:\n * ```html\n * <div i18n>Translate <span *ngIf>me</span>!</div>\n * ```\n *\n * @param message The message to crop\n * @param subTemplateIndex Index of the sub-template to extract. If undefined it returns the\n * external template and removes all sub-templates.\n */\nfunction getTranslationForTemplate(message, subTemplateIndex) {\n if (isRootTemplateMessage(subTemplateIndex)) {\n // We want the root template message, ignore all sub-templates\n return removeInnerTemplateTranslation(message);\n }\n else {\n // We want a specific sub-template\n const start = message.indexOf(`:${subTemplateIndex}${MARKER}`) + 2 + subTemplateIndex.toString().length;\n const end = message.search(new RegExp(`${MARKER}\\\\/\\\\*\\\\d+:${subTemplateIndex}${MARKER}`));\n return removeInnerTemplateTranslation(message.substring(start, end));\n }\n}\n/**\n * Generate the OpCodes for ICU expressions.\n *\n * @param icuExpression\n * @param index Index where the anchor is stored and an optional `TIcuContainerNode`\n * - `lView[anchorIdx]` points to a `Comment` node representing the anchor for the ICU.\n * - `tView.data[anchorIdx]` points to the `TIcuContainerNode` if ICU is root (`null` otherwise)\n */\nfunction icuStart(ast, tView, lView, updateOpCodes, parentIdx, icuExpression, anchorIdx) {\n ngDevMode && assertDefined(icuExpression, 'ICU expression must be defined');\n let bindingMask = 0;\n const tIcu = {\n type: icuExpression.type,\n currentCaseLViewIndex: allocExpando(tView, lView, 1, null),\n anchorIdx,\n cases: [],\n create: [],\n remove: [],\n update: [],\n };\n addUpdateIcuSwitch(updateOpCodes, icuExpression, anchorIdx);\n setTIcu(tView, anchorIdx, tIcu);\n const values = icuExpression.values;\n const cases = [];\n for (let i = 0; i < values.length; i++) {\n // Each value is an array of strings & other ICU expressions\n const valueArr = values[i];\n const nestedIcus = [];\n for (let j = 0; j < valueArr.length; j++) {\n const value = valueArr[j];\n if (typeof value !== 'string') {\n // It is an nested ICU expression\n const icuIndex = nestedIcus.push(value) - 1;\n // Replace nested ICU expression by a comment node\n valueArr[j] = `<!--<2D>${icuIndex}<7D>-->`;\n }\n }\n const caseAst = [];\n cases.push(caseAst);\n bindingMask =\n parseIcuCase(caseAst, tView, tIcu, lView, updateOpCodes, parentIdx, icuExpression.cases[i], valueArr.join(''), nestedIcus) | bindingMask;\n }\n if (bindingMask) {\n addUpdateIcuUpdate(updateOpCodes, bindingMask, anchorIdx);\n }\n ast.push({\n kind: 3 /* I18nNodeKind.ICU */,\n index: anchorIdx,\n cases,\n currentCaseLViewIndex: tIcu.currentCaseLViewIndex,\n });\n}\n/**\n * Parses text containing an ICU expression and produces a JSON object for it.\n * Original code from closure library, modified for Angular.\n *\n * @param pattern Text containing an ICU expression that needs to be parsed.\n *\n */\nfunction parseICUBlock(pattern) {\n const cases = [];\n const values = [];\n let icuType = 1 /* IcuType.plural */;\n let mainBinding = 0;\n pattern = pattern.replace(ICU_BLOCK_REGEXP, function (str, binding, type) {\n if (type === 'select') {\n icuType = 0 /* IcuType.select */;\n }\n else {\n icuType = 1 /* IcuType.plural */;\n }\n mainBinding = parseInt(binding.slice(1), 10);\n return '';\n });\n const parts = i18nParseTextIntoPartsAndICU(pattern);\n // Looking for (key block)+ sequence. One of the keys has to be \"other\".\n for (let pos = 0; pos < parts.length;) {\n let key = parts[pos++].trim();\n if (icuType === 1 /* IcuType.plural */) {\n // Key can be \"=x\", we just want \"x\"\n key = key.replace(/\\s*(?:=)?(\\w+)\\s*/, '$1');\n }\n if (key.length) {\n cases.push(key);\n }\n const blocks = i18nParseTextIntoPartsAndICU(parts[pos++]);\n if (cases.length > values.length) {\n values.push(blocks);\n }\n }\n // TODO(ocombe): support ICU expressions in attributes, see #21615\n return { type: icuType, mainBinding: mainBinding, cases, values };\n}\n/**\n * Breaks pattern into strings and top level {...} blocks.\n * Can be used to break a message into text and ICU expressions, or to break an ICU expression\n * into keys and cases. Original code from closure library, modified for Angular.\n *\n * @param pattern (sub)Pattern to be broken.\n * @returns An `Array<string|IcuExpression>` where:\n * - odd positions: `string` => text between ICU expressions\n * - even positions: `ICUExpression` => ICU expression parsed into `ICUExpression` record.\n */\nfunction i18nParseTextIntoPartsAndICU(pattern) {\n if (!pattern) {\n return [];\n }\n let prevPos = 0;\n const braceStack = [];\n const results = [];\n const braces = /[{}]/g;\n // lastIndex doesn't get set to 0 so we have to.\n braces.lastIndex = 0;\n let match;\n while ((match = braces.exec(pattern))) {\n const pos = match.index;\n if (match[0] == '}') {\n braceStack.pop();\n if (braceStack.length == 0) {\n // End of the block.\n const block = pattern.substring(prevPos, pos);\n if (ICU_BLOCK_REGEXP.test(block)) {\n results.push(parseICUBlock(block));\n }\n else {\n results.push(block);\n }\n prevPos = pos + 1;\n }\n }\n else {\n if (braceStack.length == 0) {\n const substring = pattern.substring(prevPos, pos);\n results.push(substring);\n prevPos = pos + 1;\n }\n braceStack.push('{');\n }\n }\n const substring = pattern.substring(prevPos);\n results.push(substring);\n return results;\n}\n/**\n * Parses a node, its children and its siblings, and generates the mutate & update OpCodes.\n *\n */\nfunction parseIcuCase(ast, tView, tIcu, lView, updateOpCodes, parentIdx, caseName, unsafeCaseHtml, nestedIcus) {\n const create = [];\n const remove = [];\n const update = [];\n if (ngDevMode) {\n attachDebugGetter(create, icuCreateOpCodesToString);\n attachDebugGetter(remove, i18nRemoveOpCodesToString);\n attachDebugGetter(update, i18nUpdateOpCodesToString);\n }\n tIcu.cases.push(caseName);\n tIcu.create.push(create);\n tIcu.remove.push(remove);\n tIcu.update.push(update);\n const inertBodyHelper = getInertBodyHelper(getDocument());\n const inertBodyElement = inertBodyHelper.getInertBodyElement(unsafeCaseHtml);\n ngDevMode && assertDefined(inertBodyElement, 'Unable to generate inert body element');\n const inertRootNode = getTemplateContent(inertBodyElement) || inertBodyElement;\n if (inertRootNode) {\n return walkIcuTree(ast, tView, tIcu, lView, updateOpCodes, create, remove, update, inertRootNode, parentIdx, nestedIcus, 0);\n }\n else {\n return 0;\n }\n}\nfunction walkIcuTree(ast, tView, tIcu, lView, sharedUpdateOpCodes, create, remove, update, parentNode, parentIdx, nestedIcus, depth) {\n let bindingMask = 0;\n let currentNode = parentNode.firstChild;\n while (currentNode) {\n const newIndex = allocExpando(tView, lView, 1, null);\n switch (currentNode.nodeType) {\n case Node.ELEMENT_NODE:\n const element = currentNode;\n const tagName = element.tagName.toLowerCase();\n if (VALID_ELEMENTS.hasOwnProperty(tagName)) {\n addCreateNodeAndAppend(create, ELEMENT_MARKER, tagName, parentIdx, newIndex);\n tView.data[newIndex] = tagName;\n const elAttrs = element.attributes;\n for (let i = 0; i < elAttrs.length; i++) {\n const attr = elAttrs.item(i);\n const lowerAttrName = attr.name.toLowerCase();\n const hasBinding = !!attr.value.match(BINDING_REGEXP);\n // we assume the input string is safe, unless it's using a binding\n if (hasBinding) {\n if (VALID_ATTRS.hasOwnProperty(lowerAttrName)) {\n if (URI_ATTRS[lowerAttrName]) {\n generateBindingUpdateOpCodes(update, attr.value, newIndex, attr.name, 0, _sanitizeUrl);\n }\n else {\n generateBindingUpdateOpCodes(update, attr.value, newIndex, attr.name, 0, null);\n }\n }\n else {\n ngDevMode &&\n console.warn(`WARNING: ignoring unsafe attribute value ` +\n `${lowerAttrName} on element ${tagName} ` +\n `(see ${XSS_SECURITY_URL})`);\n }\n }\n else {\n addCreateAttribute(create, newIndex, attr);\n }\n }\n const elementNode = {\n kind: 1 /* I18nNodeKind.ELEMENT */,\n index: newIndex,\n children: [],\n };\n ast.push(elementNode);\n // Parse the children of this node (if any)\n bindingMask =\n walkIcuTree(elementNode.children, tView, tIcu, lView, sharedUpdateOpCodes, create, remove, update, currentNode, newIndex, nestedIcus, depth + 1) | bindingMask;\n addRemoveNode(remove, newIndex, depth);\n }\n break;\n case Node.TEXT_NODE:\n const value = currentNode.textContent || '';\n const hasBinding = value.match(BINDING_REGEXP);\n addCreateNodeAndAppend(create, null, hasBinding ? '' : value, parentIdx, newIndex);\n addRemoveNode(remove, newIndex, depth);\n if (hasBinding) {\n bindingMask =\n generateBindingUpdateOpCodes(update, value, newIndex, null, 0, null) | bindingMask;\n }\n ast.push({\n kind: 0 /* I18nNodeKind.TEXT */,\n index: newIndex,\n });\n break;\n case Node.COMMENT_NODE:\n // Check if the comment node is a placeholder for a nested ICU\n const isNestedIcu = NESTED_ICU.exec(currentNode.textContent || '');\n if (isNestedIcu) {\n const nestedIcuIndex = parseInt(isNestedIcu[1], 10);\n const icuExpression = nestedIcus[nestedIcuIndex];\n // Create the comment node that will anchor the ICU expression\n addCreateNodeAndAppend(create, ICU_MARKER, ngDevMode ? `nested ICU ${nestedIcuIndex}` : '', parentIdx, newIndex);\n icuStart(ast, tView, lView, sharedUpdateOpCodes, parentIdx, icuExpression, newIndex);\n addRemoveNestedIcu(remove, newIndex, depth);\n }\n break;\n }\n currentNode = currentNode.nextSibling;\n }\n return bindingMask;\n}\nfunction addRemoveNode(remove, index, depth) {\n if (depth === 0) {\n remove.push(index);\n }\n}\nfunction addRemoveNestedIcu(remove, index, depth) {\n if (depth === 0) {\n remove.push(~index); // remove ICU at `index`\n remove.push(index); // remove ICU comment at `index`\n }\n}\nfunction addUpdateIcuSwitch(update, icuExpression, index) {\n update.push(toMaskBit(icuExpression.mainBinding), 2, -1 - icuExpression.mainBinding, (index << 2 /* I18nUpdateOpCode.SHIFT_REF */) | 2 /* I18nUpdateOpCode.IcuSwitch */);\n}\nfunction addUpdateIcuUpdate(update, bindingMask, index) {\n update.push(bindingMask, 1, (index << 2 /* I18nUpdateOpCode.SHIFT_REF */) | 3 /* I18nUpdateOpCode.IcuUpdate */);\n}\nfunction addCreateNodeAndAppend(create, marker, text, appendToParentIdx, createAtIdx) {\n if (marker !== null) {\n create.push(marker);\n }\n create.push(text, createAtIdx, icuCreateOpCode(0 /* IcuCreateOpCode.AppendChild */, appendToParentIdx, createAtIdx));\n}\nfunction addCreateAttribute(create, newIndex, attr) {\n create.push((newIndex << 1 /* IcuCreateOpCode.SHIFT_REF */) | 1 /* IcuCreateOpCode.Attr */, attr.name, attr.value);\n}\n\n// i18nPostprocess consts\nconst ROOT_TEMPLATE_ID = 0;\nconst PP_MULTI_VALUE_PLACEHOLDERS_REGEXP = /\\[(<28>.+?<3F>?)\\]/;\nconst PP_PLACEHOLDERS_REGEXP = /\\[(<28>.+?<3F>?)\\]|(<28>\\/?\\*\\d+:\\d+<2B>)/g;\nconst PP_ICU_VARS_REGEXP = /({\\s*)(VAR_(PLURAL|SELECT)(_\\d+)?)(\\s*,)/g;\nconst PP_ICU_PLACEHOLDERS_REGEXP = /{([A-Z0-9_]+)}/g;\nconst PP_ICUS_REGEXP = /<2F>I18N_EXP_(ICU(_\\d+)?)<29>/g;\nconst PP_CLOSE_TEMPLATE_REGEXP = /\\/\\*/;\nconst PP_TEMPLATE_ID_REGEXP = /\\d+\\:(\\d+)/;\n/**\n * Handles message string post-processing for internationalization.\n *\n * Handles message string post-processing by transforming it from intermediate\n * format (that might contain some markers that we need to replace) to the final\n * form, consumable by i18nStart instruction. Post processing steps include:\n *\n * 1. Resolve all multi-value cases (like [<5B>*1:1<><31>#2:1<>|<7C>#4:1<>|<7C>5<EFBFBD>])\n * 2. Replace all ICU vars (like \"VAR_PLURAL\")\n * 3. Replace all placeholders used inside ICUs in a form of {PLACEHOLDER}\n * 4. Replace all ICU references with corresponding values (like <20>ICU_EXP_ICU_1<5F>)\n * in case multiple ICUs have the same placeholder name\n *\n * @param message Raw translation string for post processing\n * @param replacements Set of replacements that should be applied\n *\n * @returns Transformed string that can be consumed by i18nStart instruction\n *\n * @codeGenApi\n */\nfunction i18nPostprocess(message, replacements = {}) {\n /**\n * Step 1: resolve all multi-value placeholders like [<5B>#5<>|<7C>*1:1<><31>#2:1<>|<7C>#4:1<>]\n *\n * Note: due to the way we process nested templates (BFS), multi-value placeholders are typically\n * grouped by templates, for example: [<5B>#5<>|<7C>#6<>|<7C>#1:1<>|<7C>#3:2<>] where <20>#5<> and <20>#6<> belong to root\n * template, <20>#1:1<> belong to nested template with index 1 and <20>#1:2<> - nested template with index\n * 3. However in real templates the order might be different: i.e. <20>#1:1<> and/or <20>#3:2<> may go in\n * front of <20>#6<>. The post processing step restores the right order by keeping track of the\n * template id stack and looks for placeholders that belong to the currently active template.\n */\n let result = message;\n if (PP_MULTI_VALUE_PLACEHOLDERS_REGEXP.test(message)) {\n const matches = {};\n const templateIdsStack = [ROOT_TEMPLATE_ID];\n result = result.replace(PP_PLACEHOLDERS_REGEXP, (m, phs, tmpl) => {\n const content = phs || tmpl;\n const placeholders = matches[content] || [];\n if (!placeholders.length) {\n content.split('|').forEach((placeholder) => {\n const match = placeholder.match(PP_TEMPLATE_ID_REGEXP);\n const templateId = match ? parseInt(match[1], 10) : ROOT_TEMPLATE_ID;\n const isCloseTemplateTag = PP_CLOSE_TEMPLATE_REGEXP.test(placeholder);\n placeholders.push([templateId, isCloseTemplateTag, placeholder]);\n });\n matches[content] = placeholders;\n }\n if (!placeholders.length) {\n throw new Error(`i18n postprocess: unmatched placeholder - ${content}`);\n }\n const currentTemplateId = templateIdsStack[templateIdsStack.length - 1];\n let idx = 0;\n // find placeholder index that matches current template id\n for (let i = 0; i < placeholders.length; i++) {\n if (placeholders[i][0] === currentTemplateId) {\n idx = i;\n break;\n }\n }\n // update template id stack based on the current tag extracted\n const [templateId, isCloseTemplateTag, placeholder] = placeholders[idx];\n if (isCloseTemplateTag) {\n templateIdsStack.pop();\n }\n else if (currentTemplateId !== templateId) {\n templateIdsStack.push(templateId);\n }\n // remove processed tag from the list\n placeholders.splice(idx, 1);\n return placeholder;\n });\n }\n // return current result if no replacements specified\n if (!Object.keys(replacements).length) {\n return result;\n }\n /**\n * Step 2: replace all ICU vars (like \"VAR_PLURAL\")\n */\n result = result.replace(PP_ICU_VARS_REGEXP, (match, start, key, _type, _idx, end) => {\n return replacements.hasOwnProperty(key) ? `${start}${replacements[key]}${end}` : match;\n });\n /**\n * Step 3: replace all placeholders used inside ICUs in a form of {PLACEHOLDER}\n */\n result = result.replace(PP_ICU_PLACEHOLDERS_REGEXP, (match, key) => {\n return replacements.hasOwnProperty(key) ? replacements[key] : match;\n });\n /**\n * Step 4: replace all ICU references with corresponding values (like <20>ICU_EXP_ICU_1<5F>) in case\n * multiple ICUs have the same placeholder name\n */\n result = result.replace(PP_ICUS_REGEXP, (match, key) => {\n if (replacements.hasOwnProperty(key)) {\n const list = replacements[key];\n if (!list.length) {\n throw new Error(`i18n postprocess: unmatched ICU - ${match} with key: ${key}`);\n }\n return list.shift();\n }\n return match;\n });\n return result;\n}\n\n/**\n * Marks a block of text as translatable.\n *\n * The instructions `i18nStart` and `i18nEnd` mark the translation block in the template.\n * The translation `message` is the value which is locale specific. The translation string may\n * contain placeholders which associate inner elements and sub-templates within the translation.\n *\n * The translation `message` placeholders are:\n * - `<60>{index}(:{block})<29>`: *Binding Placeholder*: Marks a location where an expression will be\n * interpolated into. The placeholder `index` points to the expression binding index. An optional\n * `block` that matches the sub-template in which it was declared.\n * - `<60>#{index}(:{block})<29>`/`<60>/#{index}(:{block})<29>`: *Element Placeholder*: Marks the beginning\n * and end of DOM element that were embedded in the original translation block. The placeholder\n * `index` points to the element index in the template instructions set. An optional `block` that\n * matches the sub-template in which it was declared.\n * - `<60>*{index}:{block}<7D>`/`<60>/*{index}:{block}<7D>`: *Sub-template Placeholder*: Sub-templates must be\n * split up and translated separately in each angular template function. The `index` points to the\n * `template` instruction index. A `block` that matches the sub-template in which it was declared.\n *\n * @param index A unique index of the translation in the static block.\n * @param messageIndex An index of the translation message from the `def.consts` array.\n * @param subTemplateIndex Optional sub-template index in the `message`.\n *\n * @codeGenApi\n */\nfunction ɵɵi18nStart(index, messageIndex, subTemplateIndex = -1) {\n const tView = getTView();\n const lView = getLView();\n const adjustedIndex = HEADER_OFFSET + index;\n ngDevMode && assertDefined(tView, `tView should be defined`);\n const message = getConstant(tView.consts, messageIndex);\n const parentTNode = getCurrentParentTNode();\n if (tView.firstCreatePass) {\n i18nStartFirstCreatePass(tView, parentTNode === null ? 0 : parentTNode.index, lView, adjustedIndex, message, subTemplateIndex);\n }\n // Set a flag that this LView has i18n blocks.\n // The flag is later used to determine whether this component should\n // be hydrated (currently hydration is not supported for i18n blocks).\n if (tView.type === 2 /* TViewType.Embedded */) {\n // Annotate host component's LView (not embedded view's LView),\n // since hydration can be skipped on per-component basis only.\n const componentLView = lView[DECLARATION_COMPONENT_VIEW];\n componentLView[FLAGS] |= 32 /* LViewFlags.HasI18n */;\n }\n else {\n lView[FLAGS] |= 32 /* LViewFlags.HasI18n */;\n }\n const tI18n = tView.data[adjustedIndex];\n const sameViewParentTNode = parentTNode === lView[T_HOST] ? null : parentTNode;\n const parentRNode = getClosestRElement(tView, sameViewParentTNode, lView);\n // If `parentTNode` is an `ElementContainer` than it has `<!--ng-container--->`.\n // When we do inserts we have to make sure to insert in front of `<!--ng-container--->`.\n const insertInFrontOf = parentTNode && parentTNode.type & 8 /* TNodeType.ElementContainer */ ? lView[parentTNode.index] : null;\n prepareI18nBlockForHydration(lView, adjustedIndex, parentTNode, subTemplateIndex);\n applyCreateOpCodes(lView, tI18n.create, parentRNode, insertInFrontOf);\n setInI18nBlock(true);\n}\n/**\n * Translates a translation block marked by `i18nStart` and `i18nEnd`. It inserts the text/ICU nodes\n * into the render tree, moves the placeholder nodes and removes the deleted nodes.\n *\n * @codeGenApi\n */\nfunction ɵɵi18nEnd() {\n setInI18nBlock(false);\n}\n/**\n *\n * Use this instruction to create a translation block that doesn't contain any placeholder.\n * It calls both {@link i18nStart} and {@link i18nEnd} in one instruction.\n *\n * The translation `message` is the value which is locale specific. The translation string may\n * contain placeholders which associate inner elements and sub-templates within the translation.\n *\n * The translation `message` placeholders are:\n * - `<60>{index}(:{block})<29>`: *Binding Placeholder*: Marks a location where an expression will be\n * interpolated into. The placeholder `index` points to the expression binding index. An optional\n * `block` that matches the sub-template in which it was declared.\n * - `<60>#{index}(:{block})<29>`/`<60>/#{index}(:{block})<29>`: *Element Placeholder*: Marks the beginning\n * and end of DOM element that were embedded in the original translation block. The placeholder\n * `index` points to the element index in the template instructions set. An optional `block` that\n * matches the sub-template in which it was declared.\n * - `<60>*{index}:{block}<7D>`/`<60>/*{index}:{block}<7D>`: *Sub-template Placeholder*: Sub-templates must be\n * split up and translated separately in each angular template function. The `index` points to the\n * `template` instruction index. A `block` that matches the sub-template in which it was declared.\n *\n * @param index A unique index of the translation in the static block.\n * @param messageIndex An index of the translation message from the `def.consts` array.\n * @param subTemplateIndex Optional sub-template index in the `message`.\n *\n * @codeGenApi\n */\nfunction ɵɵi18n(index, messageIndex, subTemplateIndex) {\n ɵɵi18nStart(index, messageIndex, subTemplateIndex);\n ɵɵi18nEnd();\n}\n/**\n * Marks a list of attributes as translatable.\n *\n * @param index A unique index in the static block\n * @param values\n *\n * @codeGenApi\n */\nfunction ɵɵi18nAttributes(index, attrsIndex) {\n const tView = getTView();\n ngDevMode && assertDefined(tView, `tView should be defined`);\n const attrs = getConstant(tView.consts, attrsIndex);\n i18nAttributesFirstPass(tView, index + HEADER_OFFSET, attrs);\n}\n/**\n * Stores the values of the bindings during each update cycle in order to determine if we need to\n * update the translated nodes.\n *\n * @param value The binding's value\n * @returns This function returns itself so that it may be chained\n * (e.g. `i18nExp(ctx.name)(ctx.title)`)\n *\n * @codeGenApi\n */\nfunction ɵɵi18nExp(value) {\n const lView = getLView();\n setMaskBit(bindingUpdated(lView, nextBindingIndex(), value));\n return ɵɵi18nExp;\n}\n/**\n * Updates a translation block or an i18n attribute when the bindings have changed.\n *\n * @param index Index of either {@link i18nStart} (translation block) or {@link i18nAttributes}\n * (i18n attribute) on which it should update the content.\n *\n * @codeGenApi\n */\nfunction ɵɵi18nApply(index) {\n applyI18n(getTView(), getLView(), index + HEADER_OFFSET);\n}\n/**\n * Handles message string post-processing for internationalization.\n *\n * Handles message string post-processing by transforming it from intermediate\n * format (that might contain some markers that we need to replace) to the final\n * form, consumable by i18nStart instruction. Post processing steps include:\n *\n * 1. Resolve all multi-value cases (like [<5B>*1:1<><31>#2:1<>|<7C>#4:1<>|<7C>5<EFBFBD>])\n * 2. Replace all ICU vars (like \"VAR_PLURAL\")\n * 3. Replace all placeholders used inside ICUs in a form of {PLACEHOLDER}\n * 4. Replace all ICU references with corresponding values (like <20>ICU_EXP_ICU_1<5F>)\n * in case multiple ICUs have the same placeholder name\n *\n * @param message Raw translation string for post processing\n * @param replacements Set of replacements that should be applied\n *\n * @returns Transformed string that can be consumed by i18nStart instruction\n *\n * @codeGenApi\n */\nfunction ɵɵi18nPostprocess(message, replacements = {}) {\n return i18nPostprocess(message, replacements);\n}\n\n/**\n * Adds an event listener to the current node.\n *\n * If an output exists on one of the node's directives, it also subscribes to the output\n * and saves the subscription for later cleanup.\n *\n * @param eventName Name of the event\n * @param listenerFn The function to be called when event emits\n * @param eventTargetResolver Function that returns global target information in case this listener\n * should be attached to a global object like window, document or body\n *\n * @codeGenApi\n */\nfunction ɵɵlistener(eventName, listenerFn, eventTargetResolver) {\n const lView = getLView();\n const tView = getTView();\n const tNode = getCurrentTNode();\n listenerInternal(tView, lView, lView[RENDERER], tNode, eventName, listenerFn, eventTargetResolver);\n return ɵɵlistener;\n}\n/**\n * Registers a synthetic host listener (e.g. `(@foo.start)`) on a component or directive.\n *\n * This instruction is for compatibility purposes and is designed to ensure that a\n * synthetic host listener (e.g. `@HostListener('@foo.start')`) properly gets rendered\n * in the component's renderer. Normally all host listeners are evaluated with the\n * parent component's renderer, but, in the case of animation @triggers, they need\n * to be evaluated with the sub component's renderer (because that's where the\n * animation triggers are defined).\n *\n * Do not use this instruction as a replacement for `listener`. This instruction\n * only exists to ensure compatibility with the ViewEngine's host binding behavior.\n *\n * @param eventName Name of the event\n * @param listenerFn The function to be called when event emits\n * @param useCapture Whether or not to use capture in event listener\n * @param eventTargetResolver Function that returns global target information in case this listener\n * should be attached to a global object like window, document or body\n *\n * @codeGenApi\n */\nfunction ɵɵsyntheticHostListener(eventName, listenerFn) {\n const tNode = getCurrentTNode();\n const lView = getLView();\n const tView = getTView();\n const currentDef = getCurrentDirectiveDef(tView.data);\n const renderer = loadComponentRenderer(currentDef, tNode, lView);\n listenerInternal(tView, lView, renderer, tNode, eventName, listenerFn);\n return ɵɵsyntheticHostListener;\n}\n/**\n * Adds a listener for a DOM event on the current node.\n *\n * @param eventName Name of the event\n * @param listenerFn The function to be called when event emits\n * @param eventTargetResolver Function that returns global target information in case this listener\n * should be attached to a global object like window, document or body\n *\n * @codeGenApi\n */\nfunction ɵɵdomListener(eventName, listenerFn, eventTargetResolver) {\n const lView = getLView();\n const tView = getTView();\n const tNode = getCurrentTNode();\n if (tNode.type & 3 /* TNodeType.AnyRNode */ || eventTargetResolver) {\n listenToDomEvent(tNode, tView, lView, eventTargetResolver, lView[RENDERER], eventName, listenerFn, wrapListener(tNode, lView, listenerFn));\n }\n return ɵɵdomListener;\n}\nfunction listenerInternal(tView, lView, renderer, tNode, eventName, listenerFn, eventTargetResolver) {\n ngDevMode && assertTNodeType(tNode, 3 /* TNodeType.AnyRNode */ | 12 /* TNodeType.AnyContainer */);\n let processOutputs = true;\n let wrappedListener = null;\n // Adding a native event listener is applicable when:\n // - The corresponding TNode represents a DOM element.\n // - The event target has a resolver (usually resulting in a global object,\n // such as `window` or `document`).\n if (tNode.type & 3 /* TNodeType.AnyRNode */ || eventTargetResolver) {\n wrappedListener ??= wrapListener(tNode, lView, listenerFn);\n const hasCoalescedDomEvent = listenToDomEvent(tNode, tView, lView, eventTargetResolver, renderer, eventName, listenerFn, wrappedListener);\n // Context: https://github.com/angular/angular/pull/30144\n if (hasCoalescedDomEvent) {\n processOutputs = false;\n }\n }\n if (processOutputs) {\n const outputConfig = tNode.outputs?.[eventName];\n const hostDirectiveOutputConfig = tNode.hostDirectiveOutputs?.[eventName];\n if (hostDirectiveOutputConfig && hostDirectiveOutputConfig.length) {\n for (let i = 0; i < hostDirectiveOutputConfig.length; i += 2) {\n const index = hostDirectiveOutputConfig[i];\n const lookupName = hostDirectiveOutputConfig[i + 1];\n wrappedListener ??= wrapListener(tNode, lView, listenerFn);\n listenToOutput(tNode, lView, index, lookupName, eventName, wrappedListener);\n }\n }\n if (outputConfig && outputConfig.length) {\n for (const index of outputConfig) {\n wrappedListener ??= wrapListener(tNode, lView, listenerFn);\n listenToOutput(tNode, lView, index, eventName, eventName, wrappedListener);\n }\n }\n }\n}\n\n/**\n * Retrieves a context at the level specified and saves it as the global, contextViewData.\n * Will get the next level up if level is not specified.\n *\n * This is used to save contexts of parent views so they can be bound in embedded views, or\n * in conjunction with reference() to bind a ref from a parent view.\n *\n * @param level The relative level of the view from which to grab context compared to contextVewData\n * @returns context\n *\n * @codeGenApi\n */\nfunction ɵɵnextContext(level = 1) {\n return nextContextImpl(level);\n}\n\n/**\n * Checks a given node against matching projection slots and returns the\n * determined slot index. Returns \"null\" if no slot matched the given node.\n *\n * This function takes into account the parsed ngProjectAs selector from the\n * node's attributes. If present, it will check whether the ngProjectAs selector\n * matches any of the projection slot selectors.\n */\nfunction matchingProjectionSlotIndex(tNode, projectionSlots) {\n let wildcardNgContentIndex = null;\n const ngProjectAsAttrVal = getProjectAsAttrValue(tNode);\n for (let i = 0; i < projectionSlots.length; i++) {\n const slotValue = projectionSlots[i];\n // The last wildcard projection slot should match all nodes which aren't matching\n // any selector. This is necessary to be backwards compatible with view engine.\n if (slotValue === '*') {\n wildcardNgContentIndex = i;\n continue;\n }\n // If we ran into an `ngProjectAs` attribute, we should match its parsed selector\n // to the list of selectors, otherwise we fall back to matching against the node.\n if (ngProjectAsAttrVal === null\n ? isNodeMatchingSelectorList(tNode, slotValue, /* isProjectionMode */ true)\n : isSelectorInSelectorList(ngProjectAsAttrVal, slotValue)) {\n return i; // first matching selector \"captures\" a given node\n }\n }\n return wildcardNgContentIndex;\n}\n/**\n * Instruction to distribute projectable nodes among <ng-content> occurrences in a given template.\n * It takes all the selectors from the entire component's template and decides where\n * each projected node belongs (it re-distributes nodes among \"buckets\" where each \"bucket\" is\n * backed by a selector).\n *\n * This function requires CSS selectors to be provided in 2 forms: parsed (by a compiler) and text,\n * un-parsed form.\n *\n * The parsed form is needed for efficient matching of a node against a given CSS selector.\n * The un-parsed, textual form is needed for support of the ngProjectAs attribute.\n *\n * Having a CSS selector in 2 different formats is not ideal, but alternatives have even more\n * drawbacks:\n * - having only a textual form would require runtime parsing of CSS selectors;\n * - we can't have only a parsed as we can't re-construct textual form from it (as entered by a\n * template author).\n *\n * @param projectionSlots? A collection of projection slots. A projection slot can be based\n * on a parsed CSS selectors or set to the wildcard selector (\"*\") in order to match\n * all nodes which do not match any selector. If not specified, a single wildcard\n * selector projection slot will be defined.\n *\n * @codeGenApi\n */\nfunction ɵɵprojectionDef(projectionSlots) {\n const componentNode = getLView()[DECLARATION_COMPONENT_VIEW][T_HOST];\n if (!componentNode.projection) {\n // If no explicit projection slots are defined, fall back to a single\n // projection slot with the wildcard selector.\n const numProjectionSlots = projectionSlots ? projectionSlots.length : 1;\n const projectionHeads = (componentNode.projection = newArray(numProjectionSlots, null));\n const tails = projectionHeads.slice();\n let componentChild = componentNode.child;\n while (componentChild !== null) {\n // Do not project let declarations so they don't occupy a slot.\n if (componentChild.type !== 128 /* TNodeType.LetDeclaration */) {\n const slotIndex = projectionSlots\n ? matchingProjectionSlotIndex(componentChild, projectionSlots)\n : 0;\n if (slotIndex !== null) {\n if (tails[slotIndex]) {\n tails[slotIndex].projectionNext = componentChild;\n }\n else {\n projectionHeads[slotIndex] = componentChild;\n }\n tails[slotIndex] = componentChild;\n }\n }\n componentChild = componentChild.next;\n }\n }\n}\n/**\n * Inserts previously re-distributed projected nodes. This instruction must be preceded by a call\n * to the projectionDef instruction.\n *\n * @param nodeIndex Index of the projection node.\n * @param selectorIndex Index of the slot selector.\n * - 0 when the selector is `*` (or unspecified as this is the default value),\n * - 1 based index of the selector from the {@link projectionDef}\n * @param attrs Static attributes set on the `ng-content` node.\n * @param fallbackTemplateFn Template function with fallback content.\n * Will be rendered if the slot is empty at runtime.\n * @param fallbackDecls Number of declarations in the fallback template.\n * @param fallbackVars Number of variables in the fallback template.\n *\n * @codeGenApi\n */\nfunction ɵɵprojection(nodeIndex, selectorIndex = 0, attrs, fallbackTemplateFn, fallbackDecls, fallbackVars) {\n const lView = getLView();\n const tView = getTView();\n const fallbackIndex = fallbackTemplateFn ? nodeIndex + 1 : null;\n // Fallback content needs to be declared no matter whether the slot is empty since different\n // instances of the component may or may not insert it. Also it needs to be declare *before*\n // the projection node in order to work correctly with hydration.\n if (fallbackIndex !== null) {\n declareNoDirectiveHostTemplate(lView, tView, fallbackIndex, fallbackTemplateFn, fallbackDecls, fallbackVars, null, attrs);\n }\n const tProjectionNode = getOrCreateTNode(tView, HEADER_OFFSET + nodeIndex, 16 /* TNodeType.Projection */, null, attrs || null);\n // We can't use viewData[HOST_NODE] because projection nodes can be nested in embedded views.\n if (tProjectionNode.projection === null) {\n tProjectionNode.projection = selectorIndex;\n }\n // `<ng-content>` has no content. Even if there's fallback\n // content, the fallback is shown next to it.\n setCurrentTNodeAsNotParent();\n const hydrationInfo = lView[HYDRATION];\n const isNodeCreationMode = !hydrationInfo || isInSkipHydrationBlock$1();\n const componentHostNode = lView[DECLARATION_COMPONENT_VIEW][T_HOST];\n const isEmpty = componentHostNode.projection[tProjectionNode.projection] === null;\n if (isEmpty && fallbackIndex !== null) {\n insertFallbackContent(lView, tView, fallbackIndex);\n }\n else if (isNodeCreationMode && !isDetachedByI18n(tProjectionNode)) {\n // re-distribution of projectable nodes is stored on a component's view level\n applyProjection(tView, lView, tProjectionNode);\n }\n}\n/** Inserts the fallback content of a projection slot. Assumes there's no projected content. */\nfunction insertFallbackContent(lView, tView, fallbackIndex) {\n const adjustedIndex = HEADER_OFFSET + fallbackIndex;\n const fallbackTNode = tView.data[adjustedIndex];\n const fallbackLContainer = lView[adjustedIndex];\n ngDevMode && assertTNode(fallbackTNode);\n ngDevMode && assertLContainer(fallbackLContainer);\n const dehydratedView = findMatchingDehydratedView(fallbackLContainer, fallbackTNode.tView.ssrId);\n const fallbackLView = createAndRenderEmbeddedLView(lView, fallbackTNode, undefined, {\n dehydratedView,\n });\n addLViewToLContainer(fallbackLContainer, fallbackLView, 0, shouldAddViewToDom(fallbackTNode, dehydratedView));\n}\n\n/**\n * Registers a QueryList, associated with a content query, for later refresh (part of a view\n * refresh).\n *\n * @param directiveIndex Current directive index\n * @param predicate The type for which the query will search\n * @param flags Flags associated with the query\n * @param read What to save in the query\n * @returns QueryList<T>\n *\n * @codeGenApi\n */\nfunction ɵɵcontentQuery(directiveIndex, predicate, flags, read) {\n createContentQuery(directiveIndex, predicate, flags, read);\n}\n/**\n * Creates a new view query by initializing internal data structures.\n *\n * @param predicate The type for which the query will search\n * @param flags Flags associated with the query\n * @param read What to save in the query\n *\n * @codeGenApi\n */\nfunction ɵɵviewQuery(predicate, flags, read) {\n createViewQuery(predicate, flags, read);\n}\n/**\n * Refreshes a query by combining matches from all active views and removing matches from deleted\n * views.\n *\n * @returns `true` if a query got dirty during change detection or if this is a static query\n * resolving in creation mode, `false` otherwise.\n *\n * @codeGenApi\n */\nfunction ɵɵqueryRefresh(queryList) {\n const lView = getLView();\n const tView = getTView();\n const queryIndex = getCurrentQueryIndex();\n setCurrentQueryIndex(queryIndex + 1);\n const tQuery = getTQuery(tView, queryIndex);\n if (queryList.dirty &&\n isCreationMode(lView) ===\n ((tQuery.metadata.flags & 2 /* QueryFlags.isStatic */) === 2 /* QueryFlags.isStatic */)) {\n if (tQuery.matches === null) {\n queryList.reset([]);\n }\n else {\n const result = getQueryResults(lView, queryIndex);\n queryList.reset(result, unwrapElementRef);\n queryList.notifyOnChanges();\n }\n return true;\n }\n return false;\n}\n/**\n * Loads a QueryList corresponding to the current view or content query.\n *\n * @codeGenApi\n */\nfunction ɵɵloadQuery() {\n return loadQueryInternal(getLView(), getCurrentQueryIndex());\n}\n\n/**\n * Creates a new content query and binds it to a signal created by an authoring function.\n *\n * @param directiveIndex Current directive index\n * @param target The target signal to which the query should be bound\n * @param predicate The type for which the query will search\n * @param flags Flags associated with the query\n * @param read What to save in the query\n *\n * @codeGenApi\n */\nfunction ɵɵcontentQuerySignal(directiveIndex, target, predicate, flags, read) {\n bindQueryToSignal(target, createContentQuery(directiveIndex, predicate, flags, read));\n}\n/**\n * Creates a new view query by initializing internal data structures and binding a new query to the\n * target signal.\n *\n * @param target The target signal to assign the query results to.\n * @param predicate The type or label that should match a given query\n * @param flags Flags associated with the query\n * @param read What to save in the query\n *\n * @codeGenApi\n */\nfunction ɵɵviewQuerySignal(target, predicate, flags, read) {\n bindQueryToSignal(target, createViewQuery(predicate, flags, read));\n}\n/**\n * Advances the current query index by a specified offset.\n *\n * Adjusting the current query index is necessary in cases where a given directive has a mix of\n * zone-based and signal-based queries. The signal-based queries don't require tracking of the\n * current index (those are refreshed on demand and not during change detection) so this instruction\n * is only necessary for backward-compatibility.\n *\n * @param index offset to apply to the current query index (defaults to 1)\n *\n * @codeGenApi\n */\nfunction ɵɵqueryAdvance(indexOffset = 1) {\n setCurrentQueryIndex(getCurrentQueryIndex() + indexOffset);\n}\n\n/**\n * Retrieves a local reference from the current contextViewData.\n *\n * If the reference to retrieve is in a parent view, this instruction is used in conjunction\n * with a nextContext() call, which walks up the tree and updates the contextViewData instance.\n *\n * @param index The index of the local ref in contextViewData.\n *\n * @codeGenApi\n */\nfunction ɵɵreference(index) {\n const contextLView = getContextLView();\n return load(contextLView, HEADER_OFFSET + index);\n}\n\nfunction toTStylingRange(prev, next) {\n ngDevMode && assertNumberInRange(prev, 0, 32767 /* StylingRange.UNSIGNED_MASK */);\n ngDevMode && assertNumberInRange(next, 0, 32767 /* StylingRange.UNSIGNED_MASK */);\n return ((prev << 17 /* StylingRange.PREV_SHIFT */) | (next << 2 /* StylingRange.NEXT_SHIFT */));\n}\nfunction getTStylingRangePrev(tStylingRange) {\n ngDevMode && assertNumber(tStylingRange, 'expected number');\n return (tStylingRange >> 17 /* StylingRange.PREV_SHIFT */) & 32767 /* StylingRange.UNSIGNED_MASK */;\n}\nfunction getTStylingRangePrevDuplicate(tStylingRange) {\n ngDevMode && assertNumber(tStylingRange, 'expected number');\n return (tStylingRange & 2 /* StylingRange.PREV_DUPLICATE */) == 2 /* StylingRange.PREV_DUPLICATE */;\n}\nfunction setTStylingRangePrev(tStylingRange, previous) {\n ngDevMode && assertNumber(tStylingRange, 'expected number');\n ngDevMode && assertNumberInRange(previous, 0, 32767 /* StylingRange.UNSIGNED_MASK */);\n return ((tStylingRange & ~4294836224 /* StylingRange.PREV_MASK */) |\n (previous << 17 /* StylingRange.PREV_SHIFT */));\n}\nfunction setTStylingRangePrevDuplicate(tStylingRange) {\n ngDevMode && assertNumber(tStylingRange, 'expected number');\n return (tStylingRange | 2 /* StylingRange.PREV_DUPLICATE */);\n}\nfunction getTStylingRangeNext(tStylingRange) {\n ngDevMode && assertNumber(tStylingRange, 'expected number');\n return (tStylingRange & 131068 /* StylingRange.NEXT_MASK */) >> 2 /* StylingRange.NEXT_SHIFT */;\n}\nfunction setTStylingRangeNext(tStylingRange, next) {\n ngDevMode && assertNumber(tStylingRange, 'expected number');\n ngDevMode && assertNumberInRange(next, 0, 32767 /* StylingRange.UNSIGNED_MASK */);\n return ((tStylingRange & ~131068 /* StylingRange.NEXT_MASK */) | //\n (next << 2 /* StylingRange.NEXT_SHIFT */));\n}\nfunction getTStylingRangeNextDuplicate(tStylingRange) {\n ngDevMode && assertNumber(tStylingRange, 'expected number');\n return (tStylingRange & 1 /* StylingRange.NEXT_DUPLICATE */) === 1 /* StylingRange.NEXT_DUPLICATE */;\n}\nfunction setTStylingRangeNextDuplicate(tStylingRange) {\n ngDevMode && assertNumber(tStylingRange, 'expected number');\n return (tStylingRange | 1 /* StylingRange.NEXT_DUPLICATE */);\n}\n\n/**\n * Insert new `tStyleValue` at `TData` and link existing style bindings such that we maintain linked\n * list of styles and compute the duplicate flag.\n *\n * Note: this function is executed during `firstUpdatePass` only to populate the `TView.data`.\n *\n * The function works by keeping track of `tStylingRange` which contains two pointers pointing to\n * the head/tail of the template portion of the styles.\n * - if `isHost === false` (we are template) then insertion is at tail of `TStylingRange`\n * - if `isHost === true` (we are host binding) then insertion is at head of `TStylingRange`\n *\n * @param tData The `TData` to insert into.\n * @param tNode `TNode` associated with the styling element.\n * @param tStylingKey See `TStylingKey`.\n * @param index location of where `tStyleValue` should be stored (and linked into list.)\n * @param isHostBinding `true` if the insertion is for a `hostBinding`. (insertion is in front of\n * template.)\n * @param isClassBinding True if the associated `tStylingKey` as a `class` styling.\n * `tNode.classBindings` should be used (or `tNode.styleBindings` otherwise.)\n */\nfunction insertTStylingBinding(tData, tNode, tStylingKeyWithStatic, index, isHostBinding, isClassBinding) {\n ngDevMode && assertFirstUpdatePass(getTView());\n let tBindings = isClassBinding ? tNode.classBindings : tNode.styleBindings;\n let tmplHead = getTStylingRangePrev(tBindings);\n let tmplTail = getTStylingRangeNext(tBindings);\n tData[index] = tStylingKeyWithStatic;\n let isKeyDuplicateOfStatic = false;\n let tStylingKey;\n if (Array.isArray(tStylingKeyWithStatic)) {\n // We are case when the `TStylingKey` contains static fields as well.\n const staticKeyValueArray = tStylingKeyWithStatic;\n tStylingKey = staticKeyValueArray[1]; // unwrap.\n // We need to check if our key is present in the static so that we can mark it as duplicate.\n if (tStylingKey === null ||\n keyValueArrayIndexOf(staticKeyValueArray, tStylingKey) > 0) {\n // tStylingKey is present in the statics, need to mark it as duplicate.\n isKeyDuplicateOfStatic = true;\n }\n }\n else {\n tStylingKey = tStylingKeyWithStatic;\n }\n if (isHostBinding) {\n // We are inserting host bindings\n // If we don't have template bindings then `tail` is 0.\n const hasTemplateBindings = tmplTail !== 0;\n // This is important to know because that means that the `head` can't point to the first\n // template bindings (there are none.) Instead the head points to the tail of the template.\n if (hasTemplateBindings) {\n // template head's \"prev\" will point to last host binding or to 0 if no host bindings yet\n const previousNode = getTStylingRangePrev(tData[tmplHead + 1]);\n tData[index + 1] = toTStylingRange(previousNode, tmplHead);\n // if a host binding has already been registered, we need to update the next of that host\n // binding to point to this one\n if (previousNode !== 0) {\n // We need to update the template-tail value to point to us.\n tData[previousNode + 1] = setTStylingRangeNext(tData[previousNode + 1], index);\n }\n // The \"previous\" of the template binding head should point to this host binding\n tData[tmplHead + 1] = setTStylingRangePrev(tData[tmplHead + 1], index);\n }\n else {\n tData[index + 1] = toTStylingRange(tmplHead, 0);\n // if a host binding has already been registered, we need to update the next of that host\n // binding to point to this one\n if (tmplHead !== 0) {\n // We need to update the template-tail value to point to us.\n tData[tmplHead + 1] = setTStylingRangeNext(tData[tmplHead + 1], index);\n }\n // if we don't have template, the head points to template-tail, and needs to be advanced.\n tmplHead = index;\n }\n }\n else {\n // We are inserting in template section.\n // We need to set this binding's \"previous\" to the current template tail\n tData[index + 1] = toTStylingRange(tmplTail, 0);\n ngDevMode &&\n assertEqual(tmplHead !== 0 && tmplTail === 0, false, 'Adding template bindings after hostBindings is not allowed.');\n if (tmplHead === 0) {\n tmplHead = index;\n }\n else {\n // We need to update the previous value \"next\" to point to this binding\n tData[tmplTail + 1] = setTStylingRangeNext(tData[tmplTail + 1], index);\n }\n tmplTail = index;\n }\n // Now we need to update / compute the duplicates.\n // Starting with our location search towards head (least priority)\n if (isKeyDuplicateOfStatic) {\n tData[index + 1] = setTStylingRangePrevDuplicate(tData[index + 1]);\n }\n markDuplicates(tData, tStylingKey, index, true);\n markDuplicates(tData, tStylingKey, index, false);\n markDuplicateOfResidualStyling(tNode, tStylingKey, tData, index, isClassBinding);\n tBindings = toTStylingRange(tmplHead, tmplTail);\n if (isClassBinding) {\n tNode.classBindings = tBindings;\n }\n else {\n tNode.styleBindings = tBindings;\n }\n}\n/**\n * Look into the residual styling to see if the current `tStylingKey` is duplicate of residual.\n *\n * @param tNode `TNode` where the residual is stored.\n * @param tStylingKey `TStylingKey` to store.\n * @param tData `TData` associated with the current `LView`.\n * @param index location of where `tStyleValue` should be stored (and linked into list.)\n * @param isClassBinding True if the associated `tStylingKey` as a `class` styling.\n * `tNode.classBindings` should be used (or `tNode.styleBindings` otherwise.)\n */\nfunction markDuplicateOfResidualStyling(tNode, tStylingKey, tData, index, isClassBinding) {\n const residual = isClassBinding ? tNode.residualClasses : tNode.residualStyles;\n if (residual != null /* or undefined */ &&\n typeof tStylingKey == 'string' &&\n keyValueArrayIndexOf(residual, tStylingKey) >= 0) {\n // We have duplicate in the residual so mark ourselves as duplicate.\n tData[index + 1] = setTStylingRangeNextDuplicate(tData[index + 1]);\n }\n}\n/**\n * Marks `TStyleValue`s as duplicates if another style binding in the list has the same\n * `TStyleValue`.\n *\n * NOTE: this function is intended to be called twice once with `isPrevDir` set to `true` and once\n * with it set to `false` to search both the previous as well as next items in the list.\n *\n * No duplicate case\n * ```\n * [style.color]\n * [style.width.px] <<- index\n * [style.height.px]\n * ```\n *\n * In the above case adding `[style.width.px]` to the existing `[style.color]` produces no\n * duplicates because `width` is not found in any other part of the linked list.\n *\n * Duplicate case\n * ```\n * [style.color]\n * [style.width.em]\n * [style.width.px] <<- index\n * ```\n * In the above case adding `[style.width.px]` will produce a duplicate with `[style.width.em]`\n * because `width` is found in the chain.\n *\n * Map case 1\n * ```\n * [style.width.px]\n * [style.color]\n * [style] <<- index\n * ```\n * In the above case adding `[style]` will produce a duplicate with any other bindings because\n * `[style]` is a Map and as such is fully dynamic and could produce `color` or `width`.\n *\n * Map case 2\n * ```\n * [style]\n * [style.width.px]\n * [style.color] <<- index\n * ```\n * In the above case adding `[style.color]` will produce a duplicate because there is already a\n * `[style]` binding which is a Map and as such is fully dynamic and could produce `color` or\n * `width`.\n *\n * NOTE: Once `[style]` (Map) is added into the system all things are mapped as duplicates.\n * NOTE: We use `style` as example, but same logic is applied to `class`es as well.\n *\n * @param tData `TData` where the linked list is stored.\n * @param tStylingKey `TStylingKeyPrimitive` which contains the value to compare to other keys in\n * the linked list.\n * @param index Starting location in the linked list to search from\n * @param isPrevDir Direction.\n * - `true` for previous (lower priority);\n * - `false` for next (higher priority).\n */\nfunction markDuplicates(tData, tStylingKey, index, isPrevDir) {\n const tStylingAtIndex = tData[index + 1];\n const isMap = tStylingKey === null;\n let cursor = isPrevDir\n ? getTStylingRangePrev(tStylingAtIndex)\n : getTStylingRangeNext(tStylingAtIndex);\n let foundDuplicate = false;\n // We keep iterating as long as we have a cursor\n // AND either:\n // - we found what we are looking for, OR\n // - we are a map in which case we have to continue searching even after we find what we were\n // looking for since we are a wild card and everything needs to be flipped to duplicate.\n while (cursor !== 0 && (foundDuplicate === false || isMap)) {\n ngDevMode && assertIndexInRange(tData, cursor);\n const tStylingValueAtCursor = tData[cursor];\n const tStyleRangeAtCursor = tData[cursor + 1];\n if (isStylingMatch(tStylingValueAtCursor, tStylingKey)) {\n foundDuplicate = true;\n tData[cursor + 1] = isPrevDir\n ? setTStylingRangeNextDuplicate(tStyleRangeAtCursor)\n : setTStylingRangePrevDuplicate(tStyleRangeAtCursor);\n }\n cursor = isPrevDir\n ? getTStylingRangePrev(tStyleRangeAtCursor)\n : getTStylingRangeNext(tStyleRangeAtCursor);\n }\n if (foundDuplicate) {\n // if we found a duplicate, than mark ourselves.\n tData[index + 1] = isPrevDir\n ? setTStylingRangePrevDuplicate(tStylingAtIndex)\n : setTStylingRangeNextDuplicate(tStylingAtIndex);\n }\n}\n/**\n * Determines if two `TStylingKey`s are a match.\n *\n * When computing whether a binding contains a duplicate, we need to compare if the instruction\n * `TStylingKey` has a match.\n *\n * Here are examples of `TStylingKey`s which match given `tStylingKeyCursor` is:\n * - `color`\n * - `color` // Match another color\n * - `null` // That means that `tStylingKey` is a `classMap`/`styleMap` instruction\n * - `['', 'color', 'other', true]` // wrapped `color` so match\n * - `['', null, 'other', true]` // wrapped `null` so match\n * - `['', 'width', 'color', 'value']` // wrapped static value contains a match on `'color'`\n * - `null` // `tStylingKeyCursor` always match as it is `classMap`/`styleMap` instruction\n *\n * @param tStylingKeyCursor\n * @param tStylingKey\n */\nfunction isStylingMatch(tStylingKeyCursor, tStylingKey) {\n ngDevMode &&\n assertNotEqual(Array.isArray(tStylingKey), true, \"Expected that 'tStylingKey' has been unwrapped\");\n if (tStylingKeyCursor === null || // If the cursor is `null` it means that we have map at that\n // location so we must assume that we have a match.\n tStylingKey == null || // If `tStylingKey` is `null` then it is a map therefor assume that it\n // contains a match.\n (Array.isArray(tStylingKeyCursor) ? tStylingKeyCursor[1] : tStylingKeyCursor) === tStylingKey // If the keys match explicitly than we are a match.\n ) {\n return true;\n }\n else if (Array.isArray(tStylingKeyCursor) && typeof tStylingKey === 'string') {\n // if we did not find a match, but `tStylingKeyCursor` is `KeyValueArray` that means cursor has\n // statics and we need to check those as well.\n return keyValueArrayIndexOf(tStylingKeyCursor, tStylingKey) >= 0; // see if we are matching the key\n }\n return false;\n}\n\n// Global state of the parser. (This makes parser non-reentrant, but that is not an issue)\nconst parserState = {\n textEnd: 0,\n key: 0,\n keyEnd: 0,\n value: 0,\n valueEnd: 0,\n};\n/**\n * Retrieves the last parsed `key` of style.\n * @param text the text to substring the key from.\n */\nfunction getLastParsedKey(text) {\n return text.substring(parserState.key, parserState.keyEnd);\n}\n/**\n * Retrieves the last parsed `value` of style.\n * @param text the text to substring the key from.\n */\nfunction getLastParsedValue(text) {\n return text.substring(parserState.value, parserState.valueEnd);\n}\n/**\n * Initializes `className` string for parsing and parses the first token.\n *\n * This function is intended to be used in this format:\n * ```ts\n * for (let i = parseClassName(text); i >= 0; i = parseClassNameNext(text, i)) {\n * const key = getLastParsedKey();\n * ...\n * }\n * ```\n * @param text `className` to parse\n * @returns index where the next invocation of `parseClassNameNext` should resume.\n */\nfunction parseClassName(text) {\n resetParserState(text);\n return parseClassNameNext(text, consumeWhitespace(text, 0, parserState.textEnd));\n}\n/**\n * Parses next `className` token.\n *\n * This function is intended to be used in this format:\n * ```ts\n * for (let i = parseClassName(text); i >= 0; i = parseClassNameNext(text, i)) {\n * const key = getLastParsedKey();\n * ...\n * }\n * ```\n *\n * @param text `className` to parse\n * @param index where the parsing should resume.\n * @returns index where the next invocation of `parseClassNameNext` should resume.\n */\nfunction parseClassNameNext(text, index) {\n const end = parserState.textEnd;\n if (end === index) {\n return -1;\n }\n index = parserState.keyEnd = consumeClassToken(text, (parserState.key = index), end);\n return consumeWhitespace(text, index, end);\n}\n/**\n * Initializes `cssText` string for parsing and parses the first key/values.\n *\n * This function is intended to be used in this format:\n * ```ts\n * for (let i = parseStyle(text); i >= 0; i = parseStyleNext(text, i))) {\n * const key = getLastParsedKey();\n * const value = getLastParsedValue();\n * ...\n * }\n * ```\n * @param text `cssText` to parse\n * @returns index where the next invocation of `parseStyleNext` should resume.\n */\nfunction parseStyle(text) {\n resetParserState(text);\n return parseStyleNext(text, consumeWhitespace(text, 0, parserState.textEnd));\n}\n/**\n * Parses the next `cssText` key/values.\n *\n * This function is intended to be used in this format:\n * ```ts\n * for (let i = parseStyle(text); i >= 0; i = parseStyleNext(text, i))) {\n * const key = getLastParsedKey();\n * const value = getLastParsedValue();\n * ...\n * }\n *\n * @param text `cssText` to parse\n * @param index where the parsing should resume.\n * @returns index where the next invocation of `parseStyleNext` should resume.\n */\nfunction parseStyleNext(text, startIndex) {\n const end = parserState.textEnd;\n let index = (parserState.key = consumeWhitespace(text, startIndex, end));\n if (end === index) {\n // we reached an end so just quit\n return -1;\n }\n index = parserState.keyEnd = consumeStyleKey(text, index, end);\n index = consumeSeparator(text, index, end, 58 /* CharCode.COLON */);\n index = parserState.value = consumeWhitespace(text, index, end);\n index = parserState.valueEnd = consumeStyleValue(text, index, end);\n return consumeSeparator(text, index, end, 59 /* CharCode.SEMI_COLON */);\n}\n/**\n * Reset the global state of the styling parser.\n * @param text The styling text to parse.\n */\nfunction resetParserState(text) {\n parserState.key = 0;\n parserState.keyEnd = 0;\n parserState.value = 0;\n parserState.valueEnd = 0;\n parserState.textEnd = text.length;\n}\n/**\n * Returns index of next non-whitespace character.\n *\n * @param text Text to scan\n * @param startIndex Starting index of character where the scan should start.\n * @param endIndex Ending index of character where the scan should end.\n * @returns Index of next non-whitespace character (May be the same as `start` if no whitespace at\n * that location.)\n */\nfunction consumeWhitespace(text, startIndex, endIndex) {\n while (startIndex < endIndex && text.charCodeAt(startIndex) <= 32 /* CharCode.SPACE */) {\n startIndex++;\n }\n return startIndex;\n}\n/**\n * Returns index of last char in class token.\n *\n * @param text Text to scan\n * @param startIndex Starting index of character where the scan should start.\n * @param endIndex Ending index of character where the scan should end.\n * @returns Index after last char in class token.\n */\nfunction consumeClassToken(text, startIndex, endIndex) {\n while (startIndex < endIndex && text.charCodeAt(startIndex) > 32 /* CharCode.SPACE */) {\n startIndex++;\n }\n return startIndex;\n}\n/**\n * Consumes all of the characters belonging to style key and token.\n *\n * @param text Text to scan\n * @param startIndex Starting index of character where the scan should start.\n * @param endIndex Ending index of character where the scan should end.\n * @returns Index after last style key character.\n */\nfunction consumeStyleKey(text, startIndex, endIndex) {\n let ch;\n while (startIndex < endIndex &&\n ((ch = text.charCodeAt(startIndex)) === 45 /* CharCode.DASH */ ||\n ch === 95 /* CharCode.UNDERSCORE */ ||\n ((ch & -33 /* CharCode.UPPER_CASE */) >= 65 /* CharCode.A */ && (ch & -33 /* CharCode.UPPER_CASE */) <= 90 /* CharCode.Z */) ||\n (ch >= 48 /* CharCode.ZERO */ && ch <= 57 /* CharCode.NINE */))) {\n startIndex++;\n }\n return startIndex;\n}\n/**\n * Consumes all whitespace and the separator `:` after the style key.\n *\n * @param text Text to scan\n * @param startIndex Starting index of character where the scan should start.\n * @param endIndex Ending index of character where the scan should end.\n * @returns Index after separator and surrounding whitespace.\n */\nfunction consumeSeparator(text, startIndex, endIndex, separator) {\n startIndex = consumeWhitespace(text, startIndex, endIndex);\n if (startIndex < endIndex) {\n if (ngDevMode && text.charCodeAt(startIndex) !== separator) {\n malformedStyleError(text, String.fromCharCode(separator), startIndex);\n }\n startIndex++;\n }\n return startIndex;\n}\n/**\n * Consumes style value honoring `url()` and `\"\"` text.\n *\n * @param text Text to scan\n * @param startIndex Starting index of character where the scan should start.\n * @param endIndex Ending index of character where the scan should end.\n * @returns Index after last style value character.\n */\nfunction consumeStyleValue(text, startIndex, endIndex) {\n let ch1 = -1; // 1st previous character\n let ch2 = -1; // 2nd previous character\n let ch3 = -1; // 3rd previous character\n let i = startIndex;\n let lastChIndex = i;\n while (i < endIndex) {\n const ch = text.charCodeAt(i++);\n if (ch === 59 /* CharCode.SEMI_COLON */) {\n return lastChIndex;\n }\n else if (ch === 34 /* CharCode.DOUBLE_QUOTE */ || ch === 39 /* CharCode.SINGLE_QUOTE */) {\n lastChIndex = i = consumeQuotedText(text, ch, i, endIndex);\n }\n else if (startIndex === i - 4 && // We have seen only 4 characters so far \"URL(\" (Ignore \"foo_URL()\")\n ch3 === 85 /* CharCode.U */ &&\n ch2 === 82 /* CharCode.R */ &&\n ch1 === 76 /* CharCode.L */ &&\n ch === 40 /* CharCode.OPEN_PAREN */) {\n lastChIndex = i = consumeQuotedText(text, 41 /* CharCode.CLOSE_PAREN */, i, endIndex);\n }\n else if (ch > 32 /* CharCode.SPACE */) {\n // if we have a non-whitespace character then capture its location\n lastChIndex = i;\n }\n ch3 = ch2;\n ch2 = ch1;\n ch1 = ch & -33 /* CharCode.UPPER_CASE */;\n }\n return lastChIndex;\n}\n/**\n * Consumes all of the quoted characters.\n *\n * @param text Text to scan\n * @param quoteCharCode CharCode of either `\"` or `'` quote or `)` for `url(...)`.\n * @param startIndex Starting index of character where the scan should start.\n * @param endIndex Ending index of character where the scan should end.\n * @returns Index after quoted characters.\n */\nfunction consumeQuotedText(text, quoteCharCode, startIndex, endIndex) {\n let ch1 = -1; // 1st previous character\n let index = startIndex;\n while (index < endIndex) {\n const ch = text.charCodeAt(index++);\n if (ch == quoteCharCode && ch1 !== 92 /* CharCode.BACK_SLASH */) {\n return index;\n }\n if (ch == 92 /* CharCode.BACK_SLASH */ && ch1 === 92 /* CharCode.BACK_SLASH */) {\n // two back slashes cancel each other out. For example `\"\\\\\"` should properly end the\n // quotation. (It should not assume that the last `\"` is escaped.)\n ch1 = 0;\n }\n else {\n ch1 = ch;\n }\n }\n throw ngDevMode\n ? malformedStyleError(text, String.fromCharCode(quoteCharCode), endIndex)\n : new Error();\n}\nfunction malformedStyleError(text, expecting, index) {\n ngDevMode && assertEqual(typeof text === 'string', true, 'String expected here');\n throw throwError(`Malformed style at location ${index} in string '` +\n text.substring(0, index) +\n '[>>' +\n text.substring(index, index + 1) +\n '<<]' +\n text.slice(index + 1) +\n `'. Expecting '${expecting}'.`);\n}\n\n/**\n * Update a style binding on an element with the provided value.\n *\n * If the style value is falsy then it will be removed from the element\n * (or assigned a different value depending if there are any styles placed\n * on the element with `styleMap` or any static styles that are\n * present from when the element was created with `styling`).\n *\n * Note that the styling element is updated as part of `stylingApply`.\n *\n * @param prop A valid CSS property.\n * @param value New value to write (`null` or an empty string to remove).\n * @param suffix Optional suffix. Used with scalar values to add unit such as `px`.\n *\n * Note that this will apply the provided style value to the host element if this function is called\n * within a host binding function.\n *\n * @codeGenApi\n */\nfunction ɵɵstyleProp(prop, value, suffix) {\n checkStylingProperty(prop, value, suffix, false);\n return ɵɵstyleProp;\n}\n/**\n * Update a class binding on an element with the provided value.\n *\n * This instruction is meant to handle the `[class.foo]=\"exp\"` case and,\n * therefore, the class binding itself must already be allocated using\n * `styling` within the creation block.\n *\n * @param prop A valid CSS class (only one).\n * @param value A true/false value which will turn the class on or off.\n *\n * Note that this will apply the provided class value to the host element if this function\n * is called within a host binding function.\n *\n * @codeGenApi\n */\nfunction ɵɵclassProp(className, value) {\n checkStylingProperty(className, value, null, true);\n return ɵɵclassProp;\n}\n/**\n * Update style bindings using an object literal on an element.\n *\n * This instruction is meant to apply styling via the `[style]=\"exp\"` template bindings.\n * When styles are applied to the element they will then be updated with respect to\n * any styles/classes set via `styleProp`. If any styles are set to falsy\n * then they will be removed from the element.\n *\n * Note that the styling instruction will not be applied until `stylingApply` is called.\n *\n * @param styles A key/value style map of the styles that will be applied to the given element.\n * Any missing styles (that have already been applied to the element beforehand) will be\n * removed (unset) from the element's styling.\n *\n * Note that this will apply the provided styleMap value to the host element if this function\n * is called within a host binding.\n *\n * @codeGenApi\n */\nfunction ɵɵstyleMap(styles) {\n checkStylingMap(styleKeyValueArraySet, styleStringParser, styles, false);\n}\n/**\n * Parse text as style and add values to KeyValueArray.\n *\n * This code is pulled out to a separate function so that it can be tree shaken away if it is not\n * needed. It is only referenced from `ɵɵstyleMap`.\n *\n * @param keyValueArray KeyValueArray to add parsed values to.\n * @param text text to parse.\n */\nfunction styleStringParser(keyValueArray, text) {\n for (let i = parseStyle(text); i >= 0; i = parseStyleNext(text, i)) {\n styleKeyValueArraySet(keyValueArray, getLastParsedKey(text), getLastParsedValue(text));\n }\n}\n/**\n * Update class bindings using an object literal or class-string on an element.\n *\n * This instruction is meant to apply styling via the `[class]=\"exp\"` template bindings.\n * When classes are applied to the element they will then be updated with\n * respect to any styles/classes set via `classProp`. If any\n * classes are set to falsy then they will be removed from the element.\n *\n * Note that the styling instruction will not be applied until `stylingApply` is called.\n * Note that this will the provided classMap value to the host element if this function is called\n * within a host binding.\n *\n * @param classes A key/value map or string of CSS classes that will be added to the\n * given element. Any missing classes (that have already been applied to the element\n * beforehand) will be removed (unset) from the element's list of CSS classes.\n *\n * @codeGenApi\n */\nfunction ɵɵclassMap(classes) {\n checkStylingMap(classKeyValueArraySet, classStringParser, classes, true);\n}\n/**\n * Parse text as class and add values to KeyValueArray.\n *\n * This code is pulled out to a separate function so that it can be tree shaken away if it is not\n * needed. It is only referenced from `ɵɵclassMap`.\n *\n * @param keyValueArray KeyValueArray to add parsed values to.\n * @param text text to parse.\n */\nfunction classStringParser(keyValueArray, text) {\n for (let i = parseClassName(text); i >= 0; i = parseClassNameNext(text, i)) {\n keyValueArraySet(keyValueArray, getLastParsedKey(text), true);\n }\n}\n/**\n * Common code between `ɵɵclassProp` and `ɵɵstyleProp`.\n *\n * @param prop property name.\n * @param value binding value.\n * @param suffix suffix for the property (e.g. `em` or `px`)\n * @param isClassBased `true` if `class` change (`false` if `style`)\n */\nfunction checkStylingProperty(prop, value, suffix, isClassBased) {\n const lView = getLView();\n const tView = getTView();\n // Styling instructions use 2 slots per binding.\n // 1. one for the value / TStylingKey\n // 2. one for the intermittent-value / TStylingRange\n const bindingIndex = incrementBindingIndex(2);\n if (tView.firstUpdatePass) {\n stylingFirstUpdatePass(tView, prop, bindingIndex, isClassBased);\n }\n if (value !== NO_CHANGE && bindingUpdated(lView, bindingIndex, value)) {\n const tNode = tView.data[getSelectedIndex()];\n updateStyling(tView, tNode, lView, lView[RENDERER], prop, (lView[bindingIndex + 1] = normalizeSuffix(value, suffix)), isClassBased, bindingIndex);\n }\n}\n/**\n * Common code between `ɵɵclassMap` and `ɵɵstyleMap`.\n *\n * @param keyValueArraySet (See `keyValueArraySet` in \"util/array_utils\") Gets passed in as a\n * function so that `style` can be processed. This is done for tree shaking purposes.\n * @param stringParser Parser used to parse `value` if `string`. (Passed in as `style` and `class`\n * have different parsers.)\n * @param value bound value from application\n * @param isClassBased `true` if `class` change (`false` if `style`)\n */\nfunction checkStylingMap(keyValueArraySet, stringParser, value, isClassBased) {\n const tView = getTView();\n const bindingIndex = incrementBindingIndex(2);\n if (tView.firstUpdatePass) {\n stylingFirstUpdatePass(tView, null, bindingIndex, isClassBased);\n }\n const lView = getLView();\n if (value !== NO_CHANGE && bindingUpdated(lView, bindingIndex, value)) {\n // `getSelectedIndex()` should be here (rather than in instruction) so that it is guarded by the\n // if so as not to read unnecessarily.\n const tNode = tView.data[getSelectedIndex()];\n if (hasStylingInputShadow(tNode, isClassBased) && !isInHostBindings(tView, bindingIndex)) {\n if (ngDevMode) {\n // verify that if we are shadowing then `TData` is appropriately marked so that we skip\n // processing this binding in styling resolution.\n const tStylingKey = tView.data[bindingIndex];\n assertEqual(Array.isArray(tStylingKey) ? tStylingKey[1] : tStylingKey, false, \"Styling linked list shadow input should be marked as 'false'\");\n }\n // VE does not concatenate the static portion like we are doing here.\n // Instead VE just ignores the static completely if dynamic binding is present.\n // Because of locality we have already set the static portion because we don't know if there\n // is a dynamic portion until later. If we would ignore the static portion it would look like\n // the binding has removed it. This would confuse `[ngStyle]`/`[ngClass]` to do the wrong\n // thing as it would think that the static portion was removed. For this reason we\n // concatenate it so that `[ngStyle]`/`[ngClass]` can continue to work on changed.\n let staticPrefix = isClassBased ? tNode.classesWithoutHost : tNode.stylesWithoutHost;\n ngDevMode &&\n isClassBased === false &&\n staticPrefix !== null &&\n assertEqual(staticPrefix.endsWith(';'), true, \"Expecting static portion to end with ';'\");\n if (staticPrefix !== null) {\n // We want to make sure that falsy values of `value` become empty strings.\n value = concatStringsWithSpace(staticPrefix, value ? value : '');\n }\n // Given `<div [style] my-dir>` such that `my-dir` has `@Input('style')`.\n // This takes over the `[style]` binding. (Same for `[class]`)\n setDirectiveInputsWhichShadowsStyling(tView, tNode, lView, value, isClassBased);\n }\n else {\n updateStylingMap(tView, tNode, lView, lView[RENDERER], lView[bindingIndex + 1], (lView[bindingIndex + 1] = toStylingKeyValueArray(keyValueArraySet, stringParser, value)), isClassBased, bindingIndex);\n }\n }\n}\n/**\n * Determines when the binding is in `hostBindings` section\n *\n * @param tView Current `TView`\n * @param bindingIndex index of binding which we would like if it is in `hostBindings`\n */\nfunction isInHostBindings(tView, bindingIndex) {\n // All host bindings are placed after the expando section.\n return bindingIndex >= tView.expandoStartIndex;\n}\n/**\n * Collects the necessary information to insert the binding into a linked list of style bindings\n * using `insertTStylingBinding`.\n *\n * @param tView `TView` where the binding linked list will be stored.\n * @param tStylingKey Property/key of the binding.\n * @param bindingIndex Index of binding associated with the `prop`\n * @param isClassBased `true` if `class` change (`false` if `style`)\n */\nfunction stylingFirstUpdatePass(tView, tStylingKey, bindingIndex, isClassBased) {\n ngDevMode && assertFirstUpdatePass(tView);\n const tData = tView.data;\n if (tData[bindingIndex + 1] === null) {\n // The above check is necessary because we don't clear first update pass until first successful\n // (no exception) template execution. This prevents the styling instruction from double adding\n // itself to the list.\n // `getSelectedIndex()` should be here (rather than in instruction) so that it is guarded by the\n // if so as not to read unnecessarily.\n const tNode = tData[getSelectedIndex()];\n ngDevMode && assertDefined(tNode, 'TNode expected');\n const isHostBindings = isInHostBindings(tView, bindingIndex);\n if (hasStylingInputShadow(tNode, isClassBased) && tStylingKey === null && !isHostBindings) {\n // `tStylingKey === null` implies that we are either `[style]` or `[class]` binding.\n // If there is a directive which uses `@Input('style')` or `@Input('class')` than\n // we need to neutralize this binding since that directive is shadowing it.\n // We turn this into a noop by setting the key to `false`\n tStylingKey = false;\n }\n tStylingKey = wrapInStaticStylingKey(tData, tNode, tStylingKey, isClassBased);\n insertTStylingBinding(tData, tNode, tStylingKey, bindingIndex, isHostBindings, isClassBased);\n }\n}\n/**\n * Adds static styling information to the binding if applicable.\n *\n * The linked list of styles not only stores the list and keys, but also stores static styling\n * information on some of the keys. This function determines if the key should contain the styling\n * information and computes it.\n *\n * See `TStylingStatic` for more details.\n *\n * @param tData `TData` where the linked list is stored.\n * @param tNode `TNode` for which the styling is being computed.\n * @param stylingKey `TStylingKeyPrimitive` which may need to be wrapped into `TStylingKey`\n * @param isClassBased `true` if `class` (`false` if `style`)\n */\nfunction wrapInStaticStylingKey(tData, tNode, stylingKey, isClassBased) {\n const hostDirectiveDef = getCurrentDirectiveDef(tData);\n let residual = isClassBased ? tNode.residualClasses : tNode.residualStyles;\n if (hostDirectiveDef === null) {\n // We are in template node.\n // If template node already had styling instruction then it has already collected the static\n // styling and there is no need to collect them again. We know that we are the first styling\n // instruction because the `TNode.*Bindings` points to 0 (nothing has been inserted yet).\n const isFirstStylingInstructionInTemplate = (isClassBased ? tNode.classBindings : tNode.styleBindings) === 0;\n if (isFirstStylingInstructionInTemplate) {\n // It would be nice to be able to get the statics from `mergeAttrs`, however, at this point\n // they are already merged and it would not be possible to figure which property belongs where\n // in the priority.\n stylingKey = collectStylingFromDirectives(null, tData, tNode, stylingKey, isClassBased);\n stylingKey = collectStylingFromTAttrs(stylingKey, tNode.attrs, isClassBased);\n // We know that if we have styling binding in template we can't have residual.\n residual = null;\n }\n }\n else {\n // We are in host binding node and there was no binding instruction in template node.\n // This means that we need to compute the residual.\n const directiveStylingLast = tNode.directiveStylingLast;\n const isFirstStylingInstructionInHostBinding = directiveStylingLast === -1 || tData[directiveStylingLast] !== hostDirectiveDef;\n if (isFirstStylingInstructionInHostBinding) {\n stylingKey = collectStylingFromDirectives(hostDirectiveDef, tData, tNode, stylingKey, isClassBased);\n if (residual === null) {\n // - If `null` than either:\n // - Template styling instruction already ran and it has consumed the static\n // styling into its `TStylingKey` and so there is no need to update residual. Instead\n // we need to update the `TStylingKey` associated with the first template node\n // instruction. OR\n // - Some other styling instruction ran and determined that there are no residuals\n let templateStylingKey = getTemplateHeadTStylingKey(tData, tNode, isClassBased);\n if (templateStylingKey !== undefined && Array.isArray(templateStylingKey)) {\n // Only recompute if `templateStylingKey` had static values. (If no static value found\n // then there is nothing to do since this operation can only produce less static keys, not\n // more.)\n templateStylingKey = collectStylingFromDirectives(null, tData, tNode, templateStylingKey[1] /* unwrap previous statics */, isClassBased);\n templateStylingKey = collectStylingFromTAttrs(templateStylingKey, tNode.attrs, isClassBased);\n setTemplateHeadTStylingKey(tData, tNode, isClassBased, templateStylingKey);\n }\n }\n else {\n // We only need to recompute residual if it is not `null`.\n // - If existing residual (implies there was no template styling). This means that some of\n // the statics may have moved from the residual to the `stylingKey` and so we have to\n // recompute.\n // - If `undefined` this is the first time we are running.\n residual = collectResidual(tData, tNode, isClassBased);\n }\n }\n }\n if (residual !== undefined) {\n isClassBased ? (tNode.residualClasses = residual) : (tNode.residualStyles = residual);\n }\n return stylingKey;\n}\n/**\n * Retrieve the `TStylingKey` for the template styling instruction.\n *\n * This is needed since `hostBinding` styling instructions are inserted after the template\n * instruction. While the template instruction needs to update the residual in `TNode` the\n * `hostBinding` instructions need to update the `TStylingKey` of the template instruction because\n * the template instruction is downstream from the `hostBindings` instructions.\n *\n * @param tData `TData` where the linked list is stored.\n * @param tNode `TNode` for which the styling is being computed.\n * @param isClassBased `true` if `class` (`false` if `style`)\n * @return `TStylingKey` if found or `undefined` if not found.\n */\nfunction getTemplateHeadTStylingKey(tData, tNode, isClassBased) {\n const bindings = isClassBased ? tNode.classBindings : tNode.styleBindings;\n if (getTStylingRangeNext(bindings) === 0) {\n // There does not seem to be a styling instruction in the `template`.\n return undefined;\n }\n return tData[getTStylingRangePrev(bindings)];\n}\n/**\n * Update the `TStylingKey` of the first template instruction in `TNode`.\n *\n * Logically `hostBindings` styling instructions are of lower priority than that of the template.\n * However, they execute after the template styling instructions. This means that they get inserted\n * in front of the template styling instructions.\n *\n * If we have a template styling instruction and a new `hostBindings` styling instruction is\n * executed it means that it may need to steal static fields from the template instruction. This\n * method allows us to update the first template instruction `TStylingKey` with a new value.\n *\n * Assume:\n * ```angular-ts\n * <div my-dir style=\"color: red\" [style.color]=\"tmplExp\"></div>\n *\n * @Directive({\n * host: {\n * 'style': 'width: 100px',\n * '[style.color]': 'dirExp',\n * }\n * })\n * class MyDir {}\n * ```\n *\n * when `[style.color]=\"tmplExp\"` executes it creates this data structure.\n * ```ts\n * ['', 'color', 'color', 'red', 'width', '100px'],\n * ```\n *\n * The reason for this is that the template instruction does not know if there are styling\n * instructions and must assume that there are none and must collect all of the static styling.\n * (both\n * `color' and 'width`)\n *\n * When `'[style.color]': 'dirExp',` executes we need to insert a new data into the linked list.\n * ```ts\n * ['', 'color', 'width', '100px'], // newly inserted\n * ['', 'color', 'color', 'red', 'width', '100px'], // this is wrong\n * ```\n *\n * Notice that the template statics is now wrong as it incorrectly contains `width` so we need to\n * update it like so:\n * ```ts\n * ['', 'color', 'width', '100px'],\n * ['', 'color', 'color', 'red'], // UPDATE\n * ```\n *\n * @param tData `TData` where the linked list is stored.\n * @param tNode `TNode` for which the styling is being computed.\n * @param isClassBased `true` if `class` (`false` if `style`)\n * @param tStylingKey New `TStylingKey` which is replacing the old one.\n */\nfunction setTemplateHeadTStylingKey(tData, tNode, isClassBased, tStylingKey) {\n const bindings = isClassBased ? tNode.classBindings : tNode.styleBindings;\n ngDevMode &&\n assertNotEqual(getTStylingRangeNext(bindings), 0, 'Expecting to have at least one template styling binding.');\n tData[getTStylingRangePrev(bindings)] = tStylingKey;\n}\n/**\n * Collect all static values after the current `TNode.directiveStylingLast` index.\n *\n * Collect the remaining styling information which has not yet been collected by an existing\n * styling instruction.\n *\n * @param tData `TData` where the `DirectiveDefs` are stored.\n * @param tNode `TNode` which contains the directive range.\n * @param isClassBased `true` if `class` (`false` if `style`)\n */\nfunction collectResidual(tData, tNode, isClassBased) {\n let residual = undefined;\n const directiveEnd = tNode.directiveEnd;\n ngDevMode &&\n assertNotEqual(tNode.directiveStylingLast, -1, 'By the time this function gets called at least one hostBindings-node styling instruction must have executed.');\n // We add `1 + tNode.directiveStart` because we need to skip the current directive (as we are\n // collecting things after the last `hostBindings` directive which had a styling instruction.)\n for (let i = 1 + tNode.directiveStylingLast; i < directiveEnd; i++) {\n const attrs = tData[i].hostAttrs;\n residual = collectStylingFromTAttrs(residual, attrs, isClassBased);\n }\n return collectStylingFromTAttrs(residual, tNode.attrs, isClassBased);\n}\n/**\n * Collect the static styling information with lower priority than `hostDirectiveDef`.\n *\n * (This is opposite of residual styling.)\n *\n * @param hostDirectiveDef `DirectiveDef` for which we want to collect lower priority static\n * styling. (Or `null` if template styling)\n * @param tData `TData` where the linked list is stored.\n * @param tNode `TNode` for which the styling is being computed.\n * @param stylingKey Existing `TStylingKey` to update or wrap.\n * @param isClassBased `true` if `class` (`false` if `style`)\n */\nfunction collectStylingFromDirectives(hostDirectiveDef, tData, tNode, stylingKey, isClassBased) {\n // We need to loop because there can be directives which have `hostAttrs` but don't have\n // `hostBindings` so this loop catches up to the current directive..\n let currentDirective = null;\n const directiveEnd = tNode.directiveEnd;\n let directiveStylingLast = tNode.directiveStylingLast;\n if (directiveStylingLast === -1) {\n directiveStylingLast = tNode.directiveStart;\n }\n else {\n directiveStylingLast++;\n }\n while (directiveStylingLast < directiveEnd) {\n currentDirective = tData[directiveStylingLast];\n ngDevMode && assertDefined(currentDirective, 'expected to be defined');\n stylingKey = collectStylingFromTAttrs(stylingKey, currentDirective.hostAttrs, isClassBased);\n if (currentDirective === hostDirectiveDef)\n break;\n directiveStylingLast++;\n }\n if (hostDirectiveDef !== null) {\n // we only advance the styling cursor if we are collecting data from host bindings.\n // Template executes before host bindings and so if we would update the index,\n // host bindings would not get their statics.\n tNode.directiveStylingLast = directiveStylingLast;\n }\n return stylingKey;\n}\n/**\n * Convert `TAttrs` into `TStylingStatic`.\n *\n * @param stylingKey existing `TStylingKey` to update or wrap.\n * @param attrs `TAttributes` to process.\n * @param isClassBased `true` if `class` (`false` if `style`)\n */\nfunction collectStylingFromTAttrs(stylingKey, attrs, isClassBased) {\n const desiredMarker = isClassBased ? 1 /* AttributeMarker.Classes */ : 2 /* AttributeMarker.Styles */;\n let currentMarker = -1 /* AttributeMarker.ImplicitAttributes */;\n if (attrs !== null) {\n for (let i = 0; i < attrs.length; i++) {\n const item = attrs[i];\n if (typeof item === 'number') {\n currentMarker = item;\n }\n else {\n if (currentMarker === desiredMarker) {\n if (!Array.isArray(stylingKey)) {\n stylingKey = stylingKey === undefined ? [] : ['', stylingKey];\n }\n keyValueArraySet(stylingKey, item, isClassBased ? true : attrs[++i]);\n }\n }\n }\n }\n return stylingKey === undefined ? null : stylingKey;\n}\n/**\n * Convert user input to `KeyValueArray`.\n *\n * This function takes user input which could be `string`, Object literal, or iterable and converts\n * it into a consistent representation. The output of this is `KeyValueArray` (which is an array\n * where\n * even indexes contain keys and odd indexes contain values for those keys).\n *\n * The advantage of converting to `KeyValueArray` is that we can perform diff in an input\n * independent\n * way.\n * (ie we can compare `foo bar` to `['bar', 'baz'] and determine a set of changes which need to be\n * applied)\n *\n * The fact that `KeyValueArray` is sorted is very important because it allows us to compute the\n * difference in linear fashion without the need to allocate any additional data.\n *\n * For example if we kept this as a `Map` we would have to iterate over previous `Map` to determine\n * which values need to be deleted, over the new `Map` to determine additions, and we would have to\n * keep additional `Map` to keep track of duplicates or items which have not yet been visited.\n *\n * @param keyValueArraySet (See `keyValueArraySet` in \"util/array_utils\") Gets passed in as a\n * function so that `style` can be processed. This is done\n * for tree shaking purposes.\n * @param stringParser The parser is passed in so that it will be tree shakable. See\n * `styleStringParser` and `classStringParser`\n * @param value The value to parse/convert to `KeyValueArray`\n */\nfunction toStylingKeyValueArray(keyValueArraySet, stringParser, value) {\n if (value == null /*|| value === undefined */ || value === '')\n return EMPTY_ARRAY;\n const styleKeyValueArray = [];\n const unwrappedValue = unwrapSafeValue(value);\n if (Array.isArray(unwrappedValue)) {\n for (let i = 0; i < unwrappedValue.length; i++) {\n keyValueArraySet(styleKeyValueArray, unwrappedValue[i], true);\n }\n }\n else if (typeof unwrappedValue === 'object') {\n for (const key in unwrappedValue) {\n if (unwrappedValue.hasOwnProperty(key)) {\n keyValueArraySet(styleKeyValueArray, key, unwrappedValue[key]);\n }\n }\n }\n else if (typeof unwrappedValue === 'string') {\n stringParser(styleKeyValueArray, unwrappedValue);\n }\n else {\n ngDevMode &&\n throwError('Unsupported styling type: ' + typeof unwrappedValue + ' (' + unwrappedValue + ')');\n }\n return styleKeyValueArray;\n}\n/**\n * Set a `value` for a `key`.\n *\n * See: `keyValueArraySet` for details\n *\n * @param keyValueArray KeyValueArray to add to.\n * @param key Style key to add.\n * @param value The value to set.\n */\nfunction styleKeyValueArraySet(keyValueArray, key, value) {\n keyValueArraySet(keyValueArray, key, unwrapSafeValue(value));\n}\n/**\n * Class-binding-specific function for setting the `value` for a `key`.\n *\n * See: `keyValueArraySet` for details\n *\n * @param keyValueArray KeyValueArray to add to.\n * @param key Style key to add.\n * @param value The value to set.\n */\nfunction classKeyValueArraySet(keyValueArray, key, value) {\n // We use `classList.add` to eventually add the CSS classes to the DOM node. Any value passed into\n // `add` is stringified and added to the `class` attribute, e.g. even null, undefined or numbers\n // will be added. Stringify the key here so that our internal data structure matches the value in\n // the DOM. The only exceptions are empty strings and strings that contain spaces for which\n // the browser throws an error. We ignore such values, because the error is somewhat cryptic.\n const stringKey = String(key);\n if (stringKey !== '' && !stringKey.includes(' ')) {\n keyValueArraySet(keyValueArray, stringKey, value);\n }\n}\n/**\n * Update map based styling.\n *\n * Map based styling could be anything which contains more than one binding. For example `string`,\n * or object literal. Dealing with all of these types would complicate the logic so\n * instead this function expects that the complex input is first converted into normalized\n * `KeyValueArray`. The advantage of normalization is that we get the values sorted, which makes it\n * very cheap to compute deltas between the previous and current value.\n *\n * @param tView Associated `TView.data` contains the linked list of binding priorities.\n * @param tNode `TNode` where the binding is located.\n * @param lView `LView` contains the values associated with other styling binding at this `TNode`.\n * @param renderer Renderer to use if any updates.\n * @param oldKeyValueArray Previous value represented as `KeyValueArray`\n * @param newKeyValueArray Current value represented as `KeyValueArray`\n * @param isClassBased `true` if `class` (`false` if `style`)\n * @param bindingIndex Binding index of the binding.\n */\nfunction updateStylingMap(tView, tNode, lView, renderer, oldKeyValueArray, newKeyValueArray, isClassBased, bindingIndex) {\n if (oldKeyValueArray === NO_CHANGE) {\n // On first execution the oldKeyValueArray is NO_CHANGE => treat it as empty KeyValueArray.\n oldKeyValueArray = EMPTY_ARRAY;\n }\n let oldIndex = 0;\n let newIndex = 0;\n let oldKey = 0 < oldKeyValueArray.length ? oldKeyValueArray[0] : null;\n let newKey = 0 < newKeyValueArray.length ? newKeyValueArray[0] : null;\n while (oldKey !== null || newKey !== null) {\n ngDevMode && assertLessThan(oldIndex, 999, 'Are we stuck in infinite loop?');\n ngDevMode && assertLessThan(newIndex, 999, 'Are we stuck in infinite loop?');\n const oldValue = oldIndex < oldKeyValueArray.length ? oldKeyValueArray[oldIndex + 1] : undefined;\n const newValue = newIndex < newKeyValueArray.length ? newKeyValueArray[newIndex + 1] : undefined;\n let setKey = null;\n let setValue = undefined;\n if (oldKey === newKey) {\n // UPDATE: Keys are equal => new value is overwriting old value.\n oldIndex += 2;\n newIndex += 2;\n if (oldValue !== newValue) {\n setKey = newKey;\n setValue = newValue;\n }\n }\n else if (newKey === null || (oldKey !== null && oldKey < newKey)) {\n // DELETE: oldKey key is missing or we did not find the oldKey in the newValue\n // (because the keyValueArray is sorted and `newKey` is found later alphabetically).\n // `\"background\" < \"color\"` so we need to delete `\"background\"` because it is not found in the\n // new array.\n oldIndex += 2;\n setKey = oldKey;\n }\n else {\n // CREATE: newKey's is earlier alphabetically than oldKey's (or no oldKey) => we have new key.\n // `\"color\" > \"background\"` so we need to add `color` because it is in new array but not in\n // old array.\n ngDevMode && assertDefined(newKey, 'Expecting to have a valid key');\n newIndex += 2;\n setKey = newKey;\n setValue = newValue;\n }\n if (setKey !== null) {\n updateStyling(tView, tNode, lView, renderer, setKey, setValue, isClassBased, bindingIndex);\n }\n oldKey = oldIndex < oldKeyValueArray.length ? oldKeyValueArray[oldIndex] : null;\n newKey = newIndex < newKeyValueArray.length ? newKeyValueArray[newIndex] : null;\n }\n}\n/**\n * Update a simple (property name) styling.\n *\n * This function takes `prop` and updates the DOM to that value. The function takes the binding\n * value as well as binding priority into consideration to determine which value should be written\n * to DOM. (For example it may be determined that there is a higher priority overwrite which blocks\n * the DOM write, or if the value goes to `undefined` a lower priority overwrite may be consulted.)\n *\n * @param tView Associated `TView.data` contains the linked list of binding priorities.\n * @param tNode `TNode` where the binding is located.\n * @param lView `LView` contains the values associated with other styling binding at this `TNode`.\n * @param renderer Renderer to use if any updates.\n * @param prop Either style property name or a class name.\n * @param value Either style value for `prop` or `true`/`false` if `prop` is class.\n * @param isClassBased `true` if `class` (`false` if `style`)\n * @param bindingIndex Binding index of the binding.\n */\nfunction updateStyling(tView, tNode, lView, renderer, prop, value, isClassBased, bindingIndex) {\n if (!(tNode.type & 3 /* TNodeType.AnyRNode */)) {\n // It is possible to have styling on non-elements (such as ng-container).\n // This is rare, but it does happen. In such a case, just ignore the binding.\n return;\n }\n const tData = tView.data;\n const tRange = tData[bindingIndex + 1];\n const higherPriorityValue = getTStylingRangeNextDuplicate(tRange)\n ? findStylingValue(tData, tNode, lView, prop, getTStylingRangeNext(tRange), isClassBased)\n : undefined;\n if (!isStylingValuePresent(higherPriorityValue)) {\n // We don't have a next duplicate, or we did not find a duplicate value.\n if (!isStylingValuePresent(value)) {\n // We should delete current value or restore to lower priority value.\n if (getTStylingRangePrevDuplicate(tRange)) {\n // We have a possible prev duplicate, let's retrieve it.\n value = findStylingValue(tData, null, lView, prop, bindingIndex, isClassBased);\n }\n }\n const rNode = getNativeByIndex(getSelectedIndex(), lView);\n applyStyling(renderer, isClassBased, rNode, prop, value);\n }\n}\n/**\n * Search for styling value with higher priority which is overwriting current value, or a\n * value of lower priority to which we should fall back if the value is `undefined`.\n *\n * When value is being applied at a location, related values need to be consulted.\n * - If there is a higher priority binding, we should be using that one instead.\n * For example `<div [style]=\"{color:exp1}\" [style.color]=\"exp2\">` change to `exp1`\n * requires that we check `exp2` to see if it is set to value other than `undefined`.\n * - If there is a lower priority binding and we are changing to `undefined`\n * For example `<div [style]=\"{color:exp1}\" [style.color]=\"exp2\">` change to `exp2` to\n * `undefined` requires that we check `exp1` (and static values) and use that as new value.\n *\n * NOTE: The styling stores two values.\n * 1. The raw value which came from the application is stored at `index + 0` location. (This value\n * is used for dirty checking).\n * 2. The normalized value is stored at `index + 1`.\n *\n * @param tData `TData` used for traversing the priority.\n * @param tNode `TNode` to use for resolving static styling. Also controls search direction.\n * - `TNode` search next and quit as soon as `isStylingValuePresent(value)` is true.\n * If no value found consult `tNode.residualStyle`/`tNode.residualClass` for default value.\n * - `null` search prev and go all the way to end. Return last value where\n * `isStylingValuePresent(value)` is true.\n * @param lView `LView` used for retrieving the actual values.\n * @param prop Property which we are interested in.\n * @param index Starting index in the linked list of styling bindings where the search should start.\n * @param isClassBased `true` if `class` (`false` if `style`)\n */\nfunction findStylingValue(tData, tNode, lView, prop, index, isClassBased) {\n // `TNode` to use for resolving static styling. Also controls search direction.\n // - `TNode` search next and quit as soon as `isStylingValuePresent(value)` is true.\n // If no value found consult `tNode.residualStyle`/`tNode.residualClass` for default value.\n // - `null` search prev and go all the way to end. Return last value where\n // `isStylingValuePresent(value)` is true.\n const isPrevDirection = tNode === null;\n let value = undefined;\n while (index > 0) {\n const rawKey = tData[index];\n const containsStatics = Array.isArray(rawKey);\n // Unwrap the key if we contain static values.\n const key = containsStatics ? rawKey[1] : rawKey;\n const isStylingMap = key === null;\n let valueAtLViewIndex = lView[index + 1];\n if (valueAtLViewIndex === NO_CHANGE) {\n // In firstUpdatePass the styling instructions create a linked list of styling.\n // On subsequent passes it is possible for a styling instruction to try to read a binding\n // which\n // has not yet executed. In that case we will find `NO_CHANGE` and we should assume that\n // we have `undefined` (or empty array in case of styling-map instruction) instead. This\n // allows the resolution to apply the value (which may later be overwritten when the\n // binding actually executes.)\n valueAtLViewIndex = isStylingMap ? EMPTY_ARRAY : undefined;\n }\n let currentValue = isStylingMap\n ? keyValueArrayGet(valueAtLViewIndex, prop)\n : key === prop\n ? valueAtLViewIndex\n : undefined;\n if (containsStatics && !isStylingValuePresent(currentValue)) {\n currentValue = keyValueArrayGet(rawKey, prop);\n }\n if (isStylingValuePresent(currentValue)) {\n value = currentValue;\n if (isPrevDirection) {\n return value;\n }\n }\n const tRange = tData[index + 1];\n index = isPrevDirection ? getTStylingRangePrev(tRange) : getTStylingRangeNext(tRange);\n }\n if (tNode !== null) {\n // in case where we are going in next direction AND we did not find anything, we need to\n // consult residual styling\n let residual = isClassBased ? tNode.residualClasses : tNode.residualStyles;\n if (residual != null /** OR residual !=== undefined */) {\n value = keyValueArrayGet(residual, prop);\n }\n }\n return value;\n}\n/**\n * Determines if the binding value should be used (or if the value is 'undefined' and hence priority\n * resolution should be used.)\n *\n * @param value Binding style value.\n */\nfunction isStylingValuePresent(value) {\n // Currently only `undefined` value is considered non-binding. That is `undefined` says I don't\n // have an opinion as to what this binding should be and you should consult other bindings by\n // priority to determine the valid value.\n // This is extracted into a single function so that we have a single place to control this.\n return value !== undefined;\n}\n/**\n * Normalizes and/or adds a suffix to the value.\n *\n * If value is `null`/`undefined` no suffix is added\n * @param value\n * @param suffix\n */\nfunction normalizeSuffix(value, suffix) {\n if (value == null || value === '') ;\n else if (typeof suffix === 'string') {\n value = value + suffix;\n }\n else if (typeof value === 'object') {\n value = stringify(unwrapSafeValue(value));\n }\n return value;\n}\n/**\n * Tests if the `TNode` has input shadow.\n *\n * An input shadow is when a directive steals (shadows) the input by using `@Input('style')` or\n * `@Input('class')` as input.\n *\n * @param tNode `TNode` which we would like to see if it has shadow.\n * @param isClassBased `true` if `class` (`false` if `style`)\n */\nfunction hasStylingInputShadow(tNode, isClassBased) {\n return (tNode.flags & (isClassBased ? 8 /* TNodeFlags.hasClassInput */ : 16 /* TNodeFlags.hasStyleInput */)) !== 0;\n}\n\n/**\n * Create static text node\n *\n * @param index Index of the node in the data array\n * @param value Static string value to write.\n *\n * @codeGenApi\n */\nfunction ɵɵtext(index, value = '') {\n const lView = getLView();\n const tView = getTView();\n const adjustedIndex = index + HEADER_OFFSET;\n ngDevMode && assertTNodeCreationIndex(lView, index);\n const tNode = tView.firstCreatePass\n ? getOrCreateTNode(tView, adjustedIndex, 1 /* TNodeType.Text */, value, null)\n : tView.data[adjustedIndex];\n const textNative = _locateOrCreateTextNode(tView, lView, tNode, value, index);\n lView[adjustedIndex] = textNative;\n if (wasLastNodeCreated()) {\n appendChild(tView, lView, textNative, tNode);\n }\n // Text nodes are self closing.\n setCurrentTNode(tNode, false);\n}\nlet _locateOrCreateTextNode = (tView, lView, tNode, value, index) => {\n lastNodeWasCreated(true);\n return createTextNode(lView[RENDERER], value);\n};\n/**\n * Enables hydration code path (to lookup existing elements in DOM)\n * in addition to the regular creation mode of text nodes.\n */\nfunction locateOrCreateTextNodeImpl(tView, lView, tNode, value, index) {\n const isNodeCreationMode = !canHydrateNode(lView, tNode);\n lastNodeWasCreated(isNodeCreationMode);\n // Regular creation mode.\n if (isNodeCreationMode) {\n return createTextNode(lView[RENDERER], value);\n }\n // Hydration mode, looking up an existing element in DOM.\n const hydrationInfo = lView[HYDRATION];\n const textNative = locateNextRNode(hydrationInfo, tView, lView, tNode);\n ngDevMode && validateMatchingNode(textNative, Node.TEXT_NODE, null, lView, tNode);\n ngDevMode && markRNodeAsClaimedByHydration(textNative);\n return textNative;\n}\nfunction enableLocateOrCreateTextNodeImpl() {\n _locateOrCreateTextNode = locateOrCreateTextNodeImpl;\n}\n\n/**\n * Create interpolation bindings with a variable number of expressions.\n *\n * If there are 1 to 8 expressions `interpolation1()` to `interpolation8()` should be used instead.\n * Those are faster because there is no need to create an array of expressions and iterate over it.\n *\n * `values`:\n * - has static text at even indexes,\n * - has evaluated expressions at odd indexes.\n *\n * Returns the concatenated string when any of the arguments changes, `NO_CHANGE` otherwise.\n */\nfunction interpolationV(lView, values) {\n ngDevMode && assertLessThan(2, values.length, 'should have at least 3 values');\n let isBindingUpdated = false;\n let bindingIndex = getBindingIndex();\n for (let i = 1; i < values.length; i += 2) {\n // Check if bindings (odd indexes) have changed\n isBindingUpdated = bindingUpdated(lView, bindingIndex++, values[i]) || isBindingUpdated;\n }\n setBindingIndex(bindingIndex);\n if (!isBindingUpdated) {\n return NO_CHANGE;\n }\n // Build the updated content\n let content = values[0];\n for (let i = 1; i < values.length; i += 2) {\n // The condition is to prevent an out-of-bound read\n content += renderStringify(values[i]) + (i + 1 !== values.length ? values[i + 1] : '');\n }\n return content;\n}\n/**\n * Creates an interpolation binding with 1 expression.\n *\n * @param prefix static value used for concatenation only.\n * @param v0 value checked for change.\n * @param suffix static value used for concatenation only.\n */\nfunction interpolation1(lView, prefix, v0, suffix = '') {\n const different = bindingUpdated(lView, nextBindingIndex(), v0);\n return different ? prefix + renderStringify(v0) + suffix : NO_CHANGE;\n}\n/**\n * Creates an interpolation binding with 2 expressions.\n */\nfunction interpolation2(lView, prefix, v0, i0, v1, suffix = '') {\n const bindingIndex = getBindingIndex();\n const different = bindingUpdated2(lView, bindingIndex, v0, v1);\n incrementBindingIndex(2);\n return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + suffix : NO_CHANGE;\n}\n/**\n * Creates an interpolation binding with 3 expressions.\n */\nfunction interpolation3(lView, prefix, v0, i0, v1, i1, v2, suffix = '') {\n const bindingIndex = getBindingIndex();\n const different = bindingUpdated3(lView, bindingIndex, v0, v1, v2);\n incrementBindingIndex(3);\n return different\n ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 + renderStringify(v2) + suffix\n : NO_CHANGE;\n}\n/**\n * Create an interpolation binding with 4 expressions.\n */\nfunction interpolation4(lView, prefix, v0, i0, v1, i1, v2, i2, v3, suffix = '') {\n const bindingIndex = getBindingIndex();\n const different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);\n incrementBindingIndex(4);\n return different\n ? prefix +\n renderStringify(v0) +\n i0 +\n renderStringify(v1) +\n i1 +\n renderStringify(v2) +\n i2 +\n renderStringify(v3) +\n suffix\n : NO_CHANGE;\n}\n/**\n * Creates an interpolation binding with 5 expressions.\n */\nfunction interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix = '') {\n const bindingIndex = getBindingIndex();\n let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);\n different = bindingUpdated(lView, bindingIndex + 4, v4) || different;\n incrementBindingIndex(5);\n return different\n ? prefix +\n renderStringify(v0) +\n i0 +\n renderStringify(v1) +\n i1 +\n renderStringify(v2) +\n i2 +\n renderStringify(v3) +\n i3 +\n renderStringify(v4) +\n suffix\n : NO_CHANGE;\n}\n/**\n * Creates an interpolation binding with 6 expressions.\n */\nfunction interpolation6(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix = '') {\n const bindingIndex = getBindingIndex();\n let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);\n different = bindingUpdated2(lView, bindingIndex + 4, v4, v5) || different;\n incrementBindingIndex(6);\n return different\n ? prefix +\n renderStringify(v0) +\n i0 +\n renderStringify(v1) +\n i1 +\n renderStringify(v2) +\n i2 +\n renderStringify(v3) +\n i3 +\n renderStringify(v4) +\n i4 +\n renderStringify(v5) +\n suffix\n : NO_CHANGE;\n}\n/**\n * Creates an interpolation binding with 7 expressions.\n */\nfunction interpolation7(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix = '') {\n const bindingIndex = getBindingIndex();\n let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);\n different = bindingUpdated3(lView, bindingIndex + 4, v4, v5, v6) || different;\n incrementBindingIndex(7);\n return different\n ? prefix +\n renderStringify(v0) +\n i0 +\n renderStringify(v1) +\n i1 +\n renderStringify(v2) +\n i2 +\n renderStringify(v3) +\n i3 +\n renderStringify(v4) +\n i4 +\n renderStringify(v5) +\n i5 +\n renderStringify(v6) +\n suffix\n : NO_CHANGE;\n}\n/**\n * Creates an interpolation binding with 8 expressions.\n */\nfunction interpolation8(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix = '') {\n const bindingIndex = getBindingIndex();\n let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);\n different = bindingUpdated4(lView, bindingIndex + 4, v4, v5, v6, v7) || different;\n incrementBindingIndex(8);\n return different\n ? prefix +\n renderStringify(v0) +\n i0 +\n renderStringify(v1) +\n i1 +\n renderStringify(v2) +\n i2 +\n renderStringify(v3) +\n i3 +\n renderStringify(v4) +\n i4 +\n renderStringify(v5) +\n i5 +\n renderStringify(v6) +\n i6 +\n renderStringify(v7) +\n suffix\n : NO_CHANGE;\n}\n\n/**\n *\n * Update text content with a lone bound value\n *\n * Used when a text node has 1 interpolated value in it, an no additional text\n * surrounds that interpolated value:\n *\n * ```html\n * <div>{{v0}}</div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵtextInterpolate(v0);\n * ```\n * @returns itself, so that it may be chained.\n * @see textInterpolateV\n * @codeGenApi\n */\nfunction ɵɵtextInterpolate(v0) {\n ɵɵtextInterpolate1('', v0);\n return ɵɵtextInterpolate;\n}\n/**\n *\n * Update text content with single bound value surrounded by other text.\n *\n * Used when a text node has 1 interpolated value in it:\n *\n * ```html\n * <div>prefix{{v0}}suffix</div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵtextInterpolate1('prefix', v0, 'suffix');\n * ```\n * @returns itself, so that it may be chained.\n * @see textInterpolateV\n * @codeGenApi\n */\nfunction ɵɵtextInterpolate1(prefix, v0, suffix) {\n const lView = getLView();\n const interpolated = interpolation1(lView, prefix, v0, suffix);\n if (interpolated !== NO_CHANGE) {\n textBindingInternal(lView, getSelectedIndex(), interpolated);\n }\n return ɵɵtextInterpolate1;\n}\n/**\n *\n * Update text content with 2 bound values surrounded by other text.\n *\n * Used when a text node has 2 interpolated values in it:\n *\n * ```html\n * <div>prefix{{v0}}-{{v1}}suffix</div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵtextInterpolate2('prefix', v0, '-', v1, 'suffix');\n * ```\n * @returns itself, so that it may be chained.\n * @see textInterpolateV\n * @codeGenApi\n */\nfunction ɵɵtextInterpolate2(prefix, v0, i0, v1, suffix) {\n const lView = getLView();\n const interpolated = interpolation2(lView, prefix, v0, i0, v1, suffix);\n if (interpolated !== NO_CHANGE) {\n textBindingInternal(lView, getSelectedIndex(), interpolated);\n }\n return ɵɵtextInterpolate2;\n}\n/**\n *\n * Update text content with 3 bound values surrounded by other text.\n *\n * Used when a text node has 3 interpolated values in it:\n *\n * ```html\n * <div>prefix{{v0}}-{{v1}}-{{v2}}suffix</div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵtextInterpolate3(\n * 'prefix', v0, '-', v1, '-', v2, 'suffix');\n * ```\n * @returns itself, so that it may be chained.\n * @see textInterpolateV\n * @codeGenApi\n */\nfunction ɵɵtextInterpolate3(prefix, v0, i0, v1, i1, v2, suffix) {\n const lView = getLView();\n const interpolated = interpolation3(lView, prefix, v0, i0, v1, i1, v2, suffix);\n if (interpolated !== NO_CHANGE) {\n textBindingInternal(lView, getSelectedIndex(), interpolated);\n }\n return ɵɵtextInterpolate3;\n}\n/**\n *\n * Update text content with 4 bound values surrounded by other text.\n *\n * Used when a text node has 4 interpolated values in it:\n *\n * ```html\n * <div>prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}suffix</div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵtextInterpolate4(\n * 'prefix', v0, '-', v1, '-', v2, '-', v3, 'suffix');\n * ```\n * @returns itself, so that it may be chained.\n * @see ɵɵtextInterpolateV\n * @codeGenApi\n */\nfunction ɵɵtextInterpolate4(prefix, v0, i0, v1, i1, v2, i2, v3, suffix) {\n const lView = getLView();\n const interpolated = interpolation4(lView, prefix, v0, i0, v1, i1, v2, i2, v3, suffix);\n if (interpolated !== NO_CHANGE) {\n textBindingInternal(lView, getSelectedIndex(), interpolated);\n }\n return ɵɵtextInterpolate4;\n}\n/**\n *\n * Update text content with 5 bound values surrounded by other text.\n *\n * Used when a text node has 5 interpolated values in it:\n *\n * ```html\n * <div>prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}suffix</div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵtextInterpolate5(\n * 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, 'suffix');\n * ```\n * @returns itself, so that it may be chained.\n * @see textInterpolateV\n * @codeGenApi\n */\nfunction ɵɵtextInterpolate5(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix) {\n const lView = getLView();\n const interpolated = interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix);\n if (interpolated !== NO_CHANGE) {\n textBindingInternal(lView, getSelectedIndex(), interpolated);\n }\n return ɵɵtextInterpolate5;\n}\n/**\n *\n * Update text content with 6 bound values surrounded by other text.\n *\n * Used when a text node has 6 interpolated values in it:\n *\n * ```html\n * <div>prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}suffix</div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵtextInterpolate6(\n * 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, 'suffix');\n * ```\n *\n * @param i4 Static value used for concatenation only.\n * @param v5 Value checked for change. @returns itself, so that it may be chained.\n * @see textInterpolateV\n * @codeGenApi\n */\nfunction ɵɵtextInterpolate6(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix) {\n const lView = getLView();\n const interpolated = interpolation6(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix);\n if (interpolated !== NO_CHANGE) {\n textBindingInternal(lView, getSelectedIndex(), interpolated);\n }\n return ɵɵtextInterpolate6;\n}\n/**\n *\n * Update text content with 7 bound values surrounded by other text.\n *\n * Used when a text node has 7 interpolated values in it:\n *\n * ```html\n * <div>prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}suffix</div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵtextInterpolate7(\n * 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, 'suffix');\n * ```\n * @returns itself, so that it may be chained.\n * @see textInterpolateV\n * @codeGenApi\n */\nfunction ɵɵtextInterpolate7(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix) {\n const lView = getLView();\n const interpolated = interpolation7(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix);\n if (interpolated !== NO_CHANGE) {\n textBindingInternal(lView, getSelectedIndex(), interpolated);\n }\n return ɵɵtextInterpolate7;\n}\n/**\n *\n * Update text content with 8 bound values surrounded by other text.\n *\n * Used when a text node has 8 interpolated values in it:\n *\n * ```html\n * <div>prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}suffix</div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵtextInterpolate8(\n * 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, 'suffix');\n * ```\n * @returns itself, so that it may be chained.\n * @see textInterpolateV\n * @codeGenApi\n */\nfunction ɵɵtextInterpolate8(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix) {\n const lView = getLView();\n const interpolated = interpolation8(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix);\n if (interpolated !== NO_CHANGE) {\n textBindingInternal(lView, getSelectedIndex(), interpolated);\n }\n return ɵɵtextInterpolate8;\n}\n/**\n * Update text content with 9 or more bound values other surrounded by text.\n *\n * Used when the number of interpolated values exceeds 8.\n *\n * ```html\n * <div>prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}-{{v6}}-{{v7}}-{{v8}}-{{v9}}suffix</div>\n * ```\n *\n * Its compiled representation is:\n *\n * ```ts\n * ɵɵtextInterpolateV(\n * ['prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, '-', v6, '-', v7, '-', v9,\n * 'suffix']);\n * ```\n *.\n * @param values The collection of values and the strings in between those values, beginning with\n * a string prefix and ending with a string suffix.\n * (e.g. `['prefix', value0, '-', value1, '-', value2, ..., value99, 'suffix']`)\n *\n * @returns itself, so that it may be chained.\n * @codeGenApi\n */\nfunction ɵɵtextInterpolateV(values) {\n const lView = getLView();\n const interpolated = interpolationV(lView, values);\n if (interpolated !== NO_CHANGE) {\n textBindingInternal(lView, getSelectedIndex(), interpolated);\n }\n return ɵɵtextInterpolateV;\n}\n/**\n * Updates a text binding at a given index in a given LView.\n */\nfunction textBindingInternal(lView, index, value) {\n ngDevMode && assertString(value, 'Value should be a string');\n ngDevMode && assertNotSame(value, NO_CHANGE, 'value should not be NO_CHANGE');\n ngDevMode && assertIndexInRange(lView, index);\n const element = getNativeByIndex(index, lView);\n ngDevMode && assertDefined(element, 'native element should exist');\n updateTextNode(lView[RENDERER], element, value);\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/**\n * Update a two-way bound property on a selected element.\n *\n * Operates on the element selected by index via the {@link select} instruction.\n *\n * @param propName Name of property.\n * @param value New value to write.\n * @param sanitizer An optional function used to sanitize the value.\n * @returns This function returns itself so that it may be chained\n * (e.g. `twoWayProperty('name', ctx.name)('title', ctx.title)`)\n *\n * @codeGenApi\n */\nfunction ɵɵtwoWayProperty(propName, value, sanitizer) {\n // TODO(crisbeto): perf impact of re-evaluating this on each change detection?\n if (isWritableSignal(value)) {\n value = value();\n }\n const lView = getLView();\n const bindingIndex = nextBindingIndex();\n if (bindingUpdated(lView, bindingIndex, value)) {\n const tView = getTView();\n const tNode = getSelectedTNode();\n setPropertyAndInputs(tNode, lView, propName, value, lView[RENDERER], sanitizer);\n ngDevMode && storePropertyBindingMetadata(tView.data, tNode, propName, bindingIndex);\n }\n return ɵɵtwoWayProperty;\n}\n/**\n * Function used inside two-way listeners to conditionally set the value of the bound expression.\n *\n * @param target Field on which to set the value.\n * @param value Value to be set to the field.\n *\n * @codeGenApi\n */\nfunction ɵɵtwoWayBindingSet(target, value) {\n const canWrite = isWritableSignal(target);\n canWrite && target.set(value);\n return canWrite;\n}\n/**\n * Adds an event listener that updates a two-way binding to the current node.\n *\n * @param eventName Name of the event.\n * @param listenerFn The function to be called when event emits.\n *\n * @codeGenApi\n */\nfunction ɵɵtwoWayListener(eventName, listenerFn) {\n const lView = getLView();\n const tView = getTView();\n const tNode = getCurrentTNode();\n listenerInternal(tView, lView, lView[RENDERER], tNode, eventName, listenerFn);\n return ɵɵtwoWayListener;\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/** Object that indicates the value of a `@let` declaration that hasn't been initialized yet. */\nconst UNINITIALIZED_LET = {};\n/**\n * Declares an `@let` at a specific data slot. Returns itself to allow chaining.\n *\n * @param index Index at which to declare the `@let`.\n *\n * @codeGenApi\n */\nfunction ɵɵdeclareLet(index) {\n const tView = getTView();\n const lView = getLView();\n const adjustedIndex = index + HEADER_OFFSET;\n const tNode = getOrCreateTNode(tView, adjustedIndex, 128 /* TNodeType.LetDeclaration */, null, null);\n setCurrentTNode(tNode, false);\n store(tView, lView, adjustedIndex, UNINITIALIZED_LET);\n return ɵɵdeclareLet;\n}\n/**\n * Instruction that stores the value of a `@let` declaration on the current view.\n * Returns the value to allow usage inside variable initializers.\n *\n * @codeGenApi\n */\nfunction ɵɵstoreLet(value) {\n performanceMarkFeature('NgLet');\n const tView = getTView();\n const lView = getLView();\n const index = getSelectedIndex();\n store(tView, lView, index, value);\n return value;\n}\n/**\n * Retrieves the value of a `@let` declaration defined in a parent view.\n *\n * @param index Index of the declaration within the view.\n *\n * @codeGenApi\n */\nfunction ɵɵreadContextLet(index) {\n const contextLView = getContextLView();\n const value = load(contextLView, HEADER_OFFSET + index);\n if (value === UNINITIALIZED_LET) {\n throw new RuntimeError(314 /* RuntimeErrorCode.UNINITIALIZED_LET_ACCESS */, ngDevMode && 'Attempting to access a @let declaration whose value is not available yet');\n }\n return value;\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/**\n * Sets the location within the source template at which\n * each element in the current view was defined.\n *\n * @param index Index at which the DOM node was created.\n * @param templatePath Path to the template at which the node was defined.\n * @param locations Element locations to which to attach the source location.\n *\n * @codeGenApi\n */\nfunction ɵɵattachSourceLocations(templatePath, locations) {\n const tView = getTView();\n const lView = getLView();\n const renderer = lView[RENDERER];\n const attributeName = 'data-ng-source-location';\n for (const [index, offset, line, column] of locations) {\n const tNode = getTNode(tView, index + HEADER_OFFSET);\n // The compiler shouldn't generate the instruction for non-element nodes, but assert just in case.\n ngDevMode && assertTNodeType(tNode, 2 /* TNodeType.Element */);\n const node = getNativeByIndex(index + HEADER_OFFSET, lView);\n // Set the attribute directly in the DOM so it doesn't participate in directive matching.\n if (!node.hasAttribute(attributeName)) {\n const attributeValue = `${templatePath}@o:${offset},l:${line},c:${column}`;\n renderer.setAttribute(node, attributeName, attributeValue);\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.dev/license\n */\n/**\n * Interpolate a value with a single bound value and no prefixes or suffixes.\n *\n * @param v0 Value checked for change.\n * @returns Interpolated string or NO_CHANGE if none of the bound values have changed.\n * @codeGenApi\n */\nfunction ɵɵinterpolate(v0) {\n // Avoid calling into the `interpolate` functions since\n // we know that we don't have a prefix or suffix.\n return bindingUpdated(getLView(), nextBindingIndex(), v0) ? renderStringify(v0) : NO_CHANGE;\n}\n/**\n * Interpolate a value with a single bound value.\n *\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @returns Interpolated string or NO_CHANGE if none of the bound values have changed.\n * @codeGenApi\n */\nfunction ɵɵinterpolate1(prefix, v0, suffix = '') {\n return interpolation1(getLView(), prefix, v0, suffix);\n}\n/**\n * Interpolate a value with two bound values.\n *\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @returns Interpolated string or NO_CHANGE if none of the bound values have changed.\n * @codeGenApi\n */\nfunction ɵɵinterpolate2(prefix, v0, i0, v1, suffix = '') {\n return interpolation2(getLView(), prefix, v0, i0, v1, suffix);\n}\n/**\n * Interpolate a value with three bound values.\n *\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @returns Interpolated string or NO_CHANGE if none of the bound values have changed.\n * @codeGenApi\n */\nfunction ɵɵinterpolate3(prefix, v0, i0, v1, i1, v2, suffix = '') {\n return interpolation3(getLView(), prefix, v0, i0, v1, i1, v2, suffix);\n}\n/**\n * Interpolate a value with four bound values.\n *\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param i2 Static value used for concatenation only.\n * @param v3 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @returns Interpolated string or NO_CHANGE if none of the bound values have changed.\n * @codeGenApi\n */\nfunction ɵɵinterpolate4(prefix, v0, i0, v1, i1, v2, i2, v3, suffix = '') {\n return interpolation4(getLView(), prefix, v0, i0, v1, i1, v2, i2, v3, suffix);\n}\n/**\n * Interpolate a value with five bound values.\n *\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param i2 Static value used for concatenation only.\n * @param v3 Value checked for change.\n * @param i3 Static value used for concatenation only.\n * @param v4 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @returns Interpolated string or NO_CHANGE if none of the bound values have changed.\n * @codeGenApi\n */\nfunction ɵɵinterpolate5(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix = '') {\n return interpolation5(getLView(), prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix);\n}\n/**\n * Interpolate a value with six bound values.\n *\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param i2 Static value used for concatenation only.\n * @param v3 Value checked for change.\n * @param i3 Static value used for concatenation only.\n * @param v4 Value checked for change.\n * @param i4 Static value used for concatenation only.\n * @param v5 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @returns Interpolated string or NO_CHANGE if none of the bound values have changed.\n * @codeGenApi\n */\nfunction ɵɵinterpolate6(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix = '') {\n return interpolation6(getLView(), prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix);\n}\n/**\n * Interpolate a value with seven bound values.\n *\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param i2 Static value used for concatenation only.\n * @param v3 Value checked for change.\n * @param i3 Static value used for concatenation only.\n * @param v4 Value checked for change.\n * @param i4 Static value used for concatenation only.\n * @param v5 Value checked for change.\n * @param i5 Static value used for concatenation only.\n * @param v6 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @returns Interpolated string or NO_CHANGE if none of the bound values have changed.\n * @codeGenApi\n */\nfunction ɵɵinterpolate7(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix = '') {\n return interpolation7(getLView(), prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix);\n}\n/**\n * Interpolate a value with eight bound values.\n *\n * @param prefix Static value used for concatenation only.\n * @param v0 Value checked for change.\n * @param i0 Static value used for concatenation only.\n * @param v1 Value checked for change.\n * @param i1 Static value used for concatenation only.\n * @param v2 Value checked for change.\n * @param i2 Static value used for concatenation only.\n * @param v3 Value checked for change.\n * @param i3 Static value used for concatenation only.\n * @param v4 Value checked for change.\n * @param i4 Static value used for concatenation only.\n * @param v5 Value checked for change.\n * @param i5 Static value used for concatenation only.\n * @param v6 Value checked for change.\n * @param i6 Static value used for concatenation only.\n * @param v7 Value checked for change.\n * @param suffix Static value used for concatenation only.\n * @returns Interpolated string or NO_CHANGE if none of the bound values have changed.\n * @codeGenApi\n */\nfunction ɵɵinterpolate8(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix = '') {\n return interpolation8(getLView(), prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix);\n}\n/**\n * Interpolate a value with nine or more bound values.\n *\n * @param values The collection of values and the strings in-between those values, beginning with\n * a string prefix and ending with a string suffix.\n * (e.g. `['prefix', value0, '-', value1, '-', value2, ..., value99, 'suffix']`)\n * @returns Interpolated string or NO_CHANGE if none of the bound values have changed.\n * @codeGenApi\n */\nfunction ɵɵinterpolateV(values) {\n return interpolationV(getLView(), values);\n}\n\n/**\n * Resolves the providers which are defined in the DirectiveDef.\n *\n * When inserting the tokens and the factories in their respective arrays, we can assume that\n * this method is called first for the component (if any), and then for other directives on the same\n * node.\n * As a consequence,the providers are always processed in that order:\n * 1) The view providers of the component\n * 2) The providers of the component\n * 3) The providers of the other directives\n * This matches the structure of the injectables arrays of a view (for each node).\n * So the tokens and the factories can be pushed at the end of the arrays, except\n * in one case for multi providers.\n *\n * @param def the directive definition\n * @param providers: Array of `providers`.\n * @param viewProviders: Array of `viewProviders`.\n */\nfunction providersResolver(def, providers, viewProviders) {\n const tView = getTView();\n if (tView.firstCreatePass) {\n const isComponent = isComponentDef(def);\n // The list of view providers is processed first, and the flags are updated\n resolveProvider(viewProviders, tView.data, tView.blueprint, isComponent, true);\n // Then, the list of providers is processed, and the flags are updated\n resolveProvider(providers, tView.data, tView.blueprint, isComponent, false);\n }\n}\n/**\n * Resolves a provider and publishes it to the DI system.\n */\nfunction resolveProvider(provider, tInjectables, lInjectablesBlueprint, isComponent, isViewProvider) {\n provider = resolveForwardRef(provider);\n if (Array.isArray(provider)) {\n // Recursively call `resolveProvider`\n // Recursion is OK in this case because this code will not be in hot-path once we implement\n // cloning of the initial state.\n for (let i = 0; i < provider.length; i++) {\n resolveProvider(provider[i], tInjectables, lInjectablesBlueprint, isComponent, isViewProvider);\n }\n }\n else {\n const tView = getTView();\n const lView = getLView();\n const tNode = getCurrentTNode();\n let token = isTypeProvider(provider) ? provider : resolveForwardRef(provider.provide);\n const providerFactory = providerToFactory(provider);\n if (ngDevMode) {\n const injector = new NodeInjector(tNode, lView);\n runInInjectorProfilerContext(injector, token, () => {\n emitProviderConfiguredEvent(provider, isViewProvider);\n });\n }\n const beginIndex = tNode.providerIndexes & 1048575 /* TNodeProviderIndexes.ProvidersStartIndexMask */;\n const endIndex = tNode.directiveStart;\n const cptViewProvidersCount = tNode.providerIndexes >> 20 /* TNodeProviderIndexes.CptViewProvidersCountShift */;\n if (isTypeProvider(provider) || !provider.multi) {\n const factory = new NodeInjectorFactory(providerFactory, isViewProvider, ɵɵdirectiveInject, ngDevMode ? providerName(provider) : null);\n const existingFactoryIndex = indexOf(token, tInjectables, isViewProvider ? beginIndex : beginIndex + cptViewProvidersCount, endIndex);\n if (existingFactoryIndex === -1) {\n diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, lView), tView, token);\n registerDestroyHooksIfSupported(tView, provider, tInjectables.length);\n tInjectables.push(token);\n tNode.directiveStart++;\n tNode.directiveEnd++;\n if (isViewProvider) {\n tNode.providerIndexes += 1048576 /* TNodeProviderIndexes.CptViewProvidersCountShifter */;\n }\n lInjectablesBlueprint.push(factory);\n lView.push(factory);\n }\n else {\n lInjectablesBlueprint[existingFactoryIndex] = factory;\n lView[existingFactoryIndex] = factory;\n }\n }\n else {\n // Multi provider case:\n // We create a multi factory which is going to aggregate all the values.\n // Since the output of such a factory depends on content or view injection,\n // we create two of them, which are linked together.\n //\n // The first one (for view providers) is always in the first block of the injectables array,\n // and the second one (for providers) is always in the second block.\n // This is important because view providers have higher priority. When a multi token\n // is being looked up, the view providers should be found first.\n // Note that it is not possible to have a multi factory in the third block (directive block).\n //\n // The algorithm to process multi providers is as follows:\n // 1) If the multi provider comes from the `viewProviders` of the component:\n // a) If the special view providers factory doesn't exist, it is created and pushed.\n // b) Else, the multi provider is added to the existing multi factory.\n // 2) If the multi provider comes from the `providers` of the component or of another\n // directive:\n // a) If the multi factory doesn't exist, it is created and provider pushed into it.\n // It is also linked to the multi factory for view providers, if it exists.\n // b) Else, the multi provider is added to the existing multi factory.\n const existingProvidersFactoryIndex = indexOf(token, tInjectables, beginIndex + cptViewProvidersCount, endIndex);\n const existingViewProvidersFactoryIndex = indexOf(token, tInjectables, beginIndex, beginIndex + cptViewProvidersCount);\n const doesProvidersFactoryExist = existingProvidersFactoryIndex >= 0 && lInjectablesBlueprint[existingProvidersFactoryIndex];\n const doesViewProvidersFactoryExist = existingViewProvidersFactoryIndex >= 0 &&\n lInjectablesBlueprint[existingViewProvidersFactoryIndex];\n if ((isViewProvider && !doesViewProvidersFactoryExist) ||\n (!isViewProvider && !doesProvidersFactoryExist)) {\n // Cases 1.a and 2.a\n diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, lView), tView, token);\n const factory = multiFactory(isViewProvider ? multiViewProvidersFactoryResolver : multiProvidersFactoryResolver, lInjectablesBlueprint.length, isViewProvider, isComponent, providerFactory, provider);\n if (!isViewProvider && doesViewProvidersFactoryExist) {\n lInjectablesBlueprint[existingViewProvidersFactoryIndex].providerFactory = factory;\n }\n registerDestroyHooksIfSupported(tView, provider, tInjectables.length, 0);\n tInjectables.push(token);\n tNode.directiveStart++;\n tNode.directiveEnd++;\n if (isViewProvider) {\n tNode.providerIndexes += 1048576 /* TNodeProviderIndexes.CptViewProvidersCountShifter */;\n }\n lInjectablesBlueprint.push(factory);\n lView.push(factory);\n }\n else {\n // Cases 1.b and 2.b\n const indexInFactory = multiFactoryAdd(lInjectablesBlueprint[isViewProvider ? existingViewProvidersFactoryIndex : existingProvidersFactoryIndex], providerFactory, !isViewProvider && isComponent);\n registerDestroyHooksIfSupported(tView, provider, existingProvidersFactoryIndex > -1\n ? existingProvidersFactoryIndex\n : existingViewProvidersFactoryIndex, indexInFactory);\n }\n if (!isViewProvider && isComponent && doesViewProvidersFactoryExist) {\n lInjectablesBlueprint[existingViewProvidersFactoryIndex].componentProviders++;\n }\n }\n }\n}\n/**\n * Registers the `ngOnDestroy` hook of a provider, if the provider supports destroy hooks.\n * @param tView `TView` in which to register the hook.\n * @param provider Provider whose hook should be registered.\n * @param contextIndex Index under which to find the context for the hook when it's being invoked.\n * @param indexInFactory Only required for `multi` providers. Index of the provider in the multi\n * provider factory.\n */\nfunction registerDestroyHooksIfSupported(tView, provider, contextIndex, indexInFactory) {\n const providerIsTypeProvider = isTypeProvider(provider);\n const providerIsClassProvider = isClassProvider(provider);\n if (providerIsTypeProvider || providerIsClassProvider) {\n // Resolve forward references as `useClass` can hold a forward reference.\n const classToken = providerIsClassProvider ? resolveForwardRef(provider.useClass) : provider;\n const prototype = classToken.prototype;\n const ngOnDestroy = prototype.ngOnDestroy;\n if (ngOnDestroy) {\n const hooks = tView.destroyHooks || (tView.destroyHooks = []);\n if (!providerIsTypeProvider && provider.multi) {\n ngDevMode &&\n assertDefined(indexInFactory, 'indexInFactory when registering multi factory destroy hook');\n const existingCallbacksIndex = hooks.indexOf(contextIndex);\n if (existingCallbacksIndex === -1) {\n hooks.push(contextIndex, [indexInFactory, ngOnDestroy]);\n }\n else {\n hooks[existingCallbacksIndex + 1].push(indexInFactory, ngOnDestroy);\n }\n }\n else {\n hooks.push(contextIndex, ngOnDestroy);\n }\n }\n }\n}\n/**\n * Add a factory in a multi factory.\n * @returns Index at which the factory was inserted.\n */\nfunction multiFactoryAdd(multiFactory, factory, isComponentProvider) {\n if (isComponentProvider) {\n multiFactory.componentProviders++;\n }\n return multiFactory.multi.push(factory) - 1;\n}\n/**\n * Returns the index of item in the array, but only in the begin to end range.\n */\nfunction indexOf(item, arr, begin, end) {\n for (let i = begin; i < end; i++) {\n if (arr[i] === item)\n return i;\n }\n return -1;\n}\n/**\n * Use this with `multi` `providers`.\n */\nfunction multiProvidersFactoryResolver(_, flags, tData, lData, tNode) {\n return multiResolve(this.multi, []);\n}\n/**\n * Use this with `multi` `viewProviders`.\n *\n * This factory knows how to concatenate itself with the existing `multi` `providers`.\n */\nfunction multiViewProvidersFactoryResolver(_, _flags, _tData, lView, tNode) {\n const factories = this.multi;\n let result;\n if (this.providerFactory) {\n const componentCount = this.providerFactory.componentProviders;\n const multiProviders = getNodeInjectable(lView, lView[TVIEW], this.providerFactory.index, tNode);\n // Copy the section of the array which contains `multi` `providers` from the component\n result = multiProviders.slice(0, componentCount);\n // Insert the `viewProvider` instances.\n multiResolve(factories, result);\n // Copy the section of the array which contains `multi` `providers` from other directives\n for (let i = componentCount; i < multiProviders.length; i++) {\n result.push(multiProviders[i]);\n }\n }\n else {\n result = [];\n // Insert the `viewProvider` instances.\n multiResolve(factories, result);\n }\n return result;\n}\n/**\n * Maps an array of factories into an array of values.\n */\nfunction multiResolve(factories, result) {\n for (let i = 0; i < factories.length; i++) {\n const factory = factories[i];\n result.push(factory());\n }\n return result;\n}\n/**\n * Creates a multi factory.\n */\nfunction multiFactory(factoryFn, index, isViewProvider, isComponent, f, provider) {\n const factory = new NodeInjectorFactory(factoryFn, isViewProvider, ɵɵdirectiveInject, ngDevMode ? providerName(provider) : null);\n factory.multi = [];\n factory.index = index;\n factory.componentProviders = 0;\n multiFactoryAdd(factory, f, isComponent && !isViewProvider);\n return factory;\n}\nfunction providerName(provider) {\n if (Array.isArray(provider)) {\n return null;\n }\n if (isTypeProvider(provider)) {\n return provider.name;\n }\n else if (isClassProvider(provider)) {\n if (provider.provide instanceof InjectionToken) {\n return `('${provider.provide.toString()}':${provider.useClass.name})`;\n }\n return provider.useClass.name;\n }\n else if (provider.provide instanceof InjectionToken) {\n return provider.provide.toString();\n }\n else if (typeof provider.provide === 'string') {\n return provider.provide;\n }\n else {\n return null;\n }\n}\n\n/**\n * This feature resolves the providers of a directive (or component),\n * and publish them into the DI system, making it visible to others for injection.\n *\n * For example:\n * ```ts\n * class ComponentWithProviders {\n * constructor(private greeter: GreeterDE) {}\n *\n * static ɵcmp = defineComponent({\n * type: ComponentWithProviders,\n * selectors: [['component-with-providers']],\n * factory: () => new ComponentWithProviders(directiveInject(GreeterDE as any)),\n * decls: 1,\n * vars: 1,\n * template: function(fs: RenderFlags, ctx: ComponentWithProviders) {\n * if (fs & RenderFlags.Create) {\n * ɵɵtext(0);\n * }\n * if (fs & RenderFlags.Update) {\n * ɵɵtextInterpolate(ctx.greeter.greet());\n * }\n * },\n * features: [ɵɵProvidersFeature([GreeterDE])]\n * });\n * }\n * ```\n *\n * @param definition\n *\n * @codeGenApi\n */\nfunction ɵɵProvidersFeature(providers, viewProviders = []) {\n return (definition) => {\n definition.providersResolver = (def, processProvidersFn) => {\n return providersResolver(def, //\n processProvidersFn ? processProvidersFn(providers) : providers, //\n viewProviders);\n };\n };\n}\n\n/**\n * A feature that adds support for external runtime styles for a component.\n * An external runtime style is a URL to a CSS stylesheet that contains the styles\n * for a given component. For browsers, this URL will be used in an appended `link` element\n * when the component is rendered. This feature is typically used for Hot Module Replacement\n * (HMR) of component stylesheets by leveraging preexisting global stylesheet HMR available\n * in most development servers.\n *\n * @codeGenApi\n */\nfunction ɵɵExternalStylesFeature(styleUrls) {\n return (definition) => {\n if (styleUrls.length < 1) {\n return;\n }\n definition.getExternalStyles = (encapsulationId) => {\n // Add encapsulation ID search parameter `ngcomp` to support external style encapsulation as well as the encapsulation mode\n // for usage tracking.\n const urls = styleUrls.map((value) => value +\n '?ngcomp' +\n (encapsulationId ? '=' + encodeURIComponent(encapsulationId) : '') +\n '&e=' +\n definition.encapsulation);\n return urls;\n };\n };\n}\n\n/**\n * Generated next to NgModules to monkey-patch directive and pipe references onto a component's\n * definition, when generating a direct reference in the component file would otherwise create an\n * import cycle.\n *\n * See [this explanation](https://hackmd.io/Odw80D0pR6yfsOjg_7XCJg?view) for more details.\n *\n * @codeGenApi\n */\nfunction ɵɵsetComponentScope(type, directives, pipes) {\n const def = type.ɵcmp;\n def.directiveDefs = extractDefListOrFactory(directives, extractDirectiveDef);\n def.pipeDefs = extractDefListOrFactory(pipes, getPipeDef$1);\n}\n/**\n * Adds the module metadata that is necessary to compute the module's transitive scope to an\n * existing module definition.\n *\n * Scope metadata of modules is not used in production builds, so calls to this function can be\n * marked pure to tree-shake it from the bundle, allowing for all referenced declarations\n * to become eligible for tree-shaking as well.\n *\n * @codeGenApi\n */\nfunction ɵɵsetNgModuleScope(type, scope) {\n return noSideEffects(() => {\n const ngModuleDef = getNgModuleDefOrThrow(type);\n ngModuleDef.declarations = convertToTypeArray(scope.declarations || EMPTY_ARRAY);\n ngModuleDef.imports = convertToTypeArray(scope.imports || EMPTY_ARRAY);\n ngModuleDef.exports = convertToTypeArray(scope.exports || EMPTY_ARRAY);\n if (scope.bootstrap) {\n // This only happens in local compilation mode.\n ngModuleDef.bootstrap = convertToTypeArray(scope.bootstrap);\n }\n depsTracker.registerNgModule(type, scope);\n });\n}\nfunction convertToTypeArray(values) {\n if (typeof values === 'function') {\n return values;\n }\n const flattenValues = flatten(values);\n if (flattenValues.some(isForwardRef)) {\n return () => flattenValues.map(resolveForwardRef).map(maybeUnwrapModuleWithProviders);\n }\n else {\n return flattenValues.map(maybeUnwrapModuleWithProviders);\n }\n}\nfunction maybeUnwrapModuleWithProviders(value) {\n return isModuleWithProviders(value) ? value.ngModule : value;\n}\n\n/**\n * Bindings for pure functions are stored after regular bindings.\n *\n * |-------decls------|---------vars---------| |----- hostVars (dir1) ------|\n * ------------------------------------------------------------------------------------------\n * | nodes/refs/pipes | bindings | fn slots | injector | dir1 | host bindings | host slots |\n * ------------------------------------------------------------------------------------------\n * ^ ^\n * TView.bindingStartIndex TView.expandoStartIndex\n *\n * Pure function instructions are given an offset from the binding root. Adding the offset to the\n * binding root gives the first index where the bindings are stored. In component views, the binding\n * root is the bindingStartIndex. In host bindings, the binding root is the expandoStartIndex +\n * any directive instances + any hostVars in directives evaluated before it.\n *\n * See VIEW_DATA.md for more information about host binding resolution.\n */\n/**\n * If the value hasn't been saved, calls the pure function to store and return the\n * value. If it has been saved, returns the saved value.\n *\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn Function that returns a value\n * @param thisArg Optional calling context of pureFn\n * @returns value\n *\n * @codeGenApi\n */\nfunction ɵɵpureFunction0(slotOffset, pureFn, thisArg) {\n const bindingIndex = getBindingRoot() + slotOffset;\n const lView = getLView();\n return lView[bindingIndex] === NO_CHANGE\n ? updateBinding(lView, bindingIndex, thisArg ? pureFn.call(thisArg) : pureFn())\n : getBinding(lView, bindingIndex);\n}\n/**\n * If the value of the provided exp has changed, calls the pure function to return\n * an updated value. Or if the value has not changed, returns cached value.\n *\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn Function that returns an updated value\n * @param exp Updated expression value\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n *\n * @codeGenApi\n */\nfunction ɵɵpureFunction1(slotOffset, pureFn, exp, thisArg) {\n return pureFunction1Internal(getLView(), getBindingRoot(), slotOffset, pureFn, exp, thisArg);\n}\n/**\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn\n * @param exp1\n * @param exp2\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n *\n * @codeGenApi\n */\nfunction ɵɵpureFunction2(slotOffset, pureFn, exp1, exp2, thisArg) {\n return pureFunction2Internal(getLView(), getBindingRoot(), slotOffset, pureFn, exp1, exp2, thisArg);\n}\n/**\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn\n * @param exp1\n * @param exp2\n * @param exp3\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n *\n * @codeGenApi\n */\nfunction ɵɵpureFunction3(slotOffset, pureFn, exp1, exp2, exp3, thisArg) {\n return pureFunction3Internal(getLView(), getBindingRoot(), slotOffset, pureFn, exp1, exp2, exp3, thisArg);\n}\n/**\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn\n * @param exp1\n * @param exp2\n * @param exp3\n * @param exp4\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n *\n * @codeGenApi\n */\nfunction ɵɵpureFunction4(slotOffset, pureFn, exp1, exp2, exp3, exp4, thisArg) {\n return pureFunction4Internal(getLView(), getBindingRoot(), slotOffset, pureFn, exp1, exp2, exp3, exp4, thisArg);\n}\n/**\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn\n * @param exp1\n * @param exp2\n * @param exp3\n * @param exp4\n * @param exp5\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n *\n * @codeGenApi\n */\nfunction ɵɵpureFunction5(slotOffset, pureFn, exp1, exp2, exp3, exp4, exp5, thisArg) {\n const bindingIndex = getBindingRoot() + slotOffset;\n const lView = getLView();\n const different = bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4);\n return bindingUpdated(lView, bindingIndex + 4, exp5) || different\n ? updateBinding(lView, bindingIndex + 5, thisArg\n ? pureFn.call(thisArg, exp1, exp2, exp3, exp4, exp5)\n : pureFn(exp1, exp2, exp3, exp4, exp5))\n : getBinding(lView, bindingIndex + 5);\n}\n/**\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn\n * @param exp1\n * @param exp2\n * @param exp3\n * @param exp4\n * @param exp5\n * @param exp6\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n *\n * @codeGenApi\n */\nfunction ɵɵpureFunction6(slotOffset, pureFn, exp1, exp2, exp3, exp4, exp5, exp6, thisArg) {\n const bindingIndex = getBindingRoot() + slotOffset;\n const lView = getLView();\n const different = bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4);\n return bindingUpdated2(lView, bindingIndex + 4, exp5, exp6) || different\n ? updateBinding(lView, bindingIndex + 6, thisArg\n ? pureFn.call(thisArg, exp1, exp2, exp3, exp4, exp5, exp6)\n : pureFn(exp1, exp2, exp3, exp4, exp5, exp6))\n : getBinding(lView, bindingIndex + 6);\n}\n/**\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn\n * @param exp1\n * @param exp2\n * @param exp3\n * @param exp4\n * @param exp5\n * @param exp6\n * @param exp7\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n *\n * @codeGenApi\n */\nfunction ɵɵpureFunction7(slotOffset, pureFn, exp1, exp2, exp3, exp4, exp5, exp6, exp7, thisArg) {\n const bindingIndex = getBindingRoot() + slotOffset;\n const lView = getLView();\n let different = bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4);\n return bindingUpdated3(lView, bindingIndex + 4, exp5, exp6, exp7) || different\n ? updateBinding(lView, bindingIndex + 7, thisArg\n ? pureFn.call(thisArg, exp1, exp2, exp3, exp4, exp5, exp6, exp7)\n : pureFn(exp1, exp2, exp3, exp4, exp5, exp6, exp7))\n : getBinding(lView, bindingIndex + 7);\n}\n/**\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn\n * @param exp1\n * @param exp2\n * @param exp3\n * @param exp4\n * @param exp5\n * @param exp6\n * @param exp7\n * @param exp8\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n *\n * @codeGenApi\n */\nfunction ɵɵpureFunction8(slotOffset, pureFn, exp1, exp2, exp3, exp4, exp5, exp6, exp7, exp8, thisArg) {\n const bindingIndex = getBindingRoot() + slotOffset;\n const lView = getLView();\n const different = bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4);\n return bindingUpdated4(lView, bindingIndex + 4, exp5, exp6, exp7, exp8) || different\n ? updateBinding(lView, bindingIndex + 8, thisArg\n ? pureFn.call(thisArg, exp1, exp2, exp3, exp4, exp5, exp6, exp7, exp8)\n : pureFn(exp1, exp2, exp3, exp4, exp5, exp6, exp7, exp8))\n : getBinding(lView, bindingIndex + 8);\n}\n/**\n * pureFunction instruction that can support any number of bindings.\n *\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn A pure function that takes binding values and builds an object or array\n * containing those values.\n * @param exps An array of binding values\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n *\n * @codeGenApi\n */\nfunction ɵɵpureFunctionV(slotOffset, pureFn, exps, thisArg) {\n return pureFunctionVInternal(getLView(), getBindingRoot(), slotOffset, pureFn, exps, thisArg);\n}\n/**\n * Results of a pure function invocation are stored in LView in a dedicated slot that is initialized\n * to NO_CHANGE. In rare situations a pure pipe might throw an exception on the very first\n * invocation and not produce any valid results. In this case LView would keep holding the NO_CHANGE\n * value. The NO_CHANGE is not something that we can use in expressions / bindings thus we convert\n * it to `undefined`.\n */\nfunction getPureFunctionReturnValue(lView, returnValueIndex) {\n ngDevMode && assertIndexInRange(lView, returnValueIndex);\n const lastReturnValue = lView[returnValueIndex];\n return lastReturnValue === NO_CHANGE ? undefined : lastReturnValue;\n}\n/**\n * If the value of the provided exp has changed, calls the pure function to return\n * an updated value. Or if the value has not changed, returns cached value.\n *\n * @param lView LView in which the function is being executed.\n * @param bindingRoot Binding root index.\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn Function that returns an updated value\n * @param exp Updated expression value\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n */\nfunction pureFunction1Internal(lView, bindingRoot, slotOffset, pureFn, exp, thisArg) {\n const bindingIndex = bindingRoot + slotOffset;\n return bindingUpdated(lView, bindingIndex, exp)\n ? updateBinding(lView, bindingIndex + 1, thisArg ? pureFn.call(thisArg, exp) : pureFn(exp))\n : getPureFunctionReturnValue(lView, bindingIndex + 1);\n}\n/**\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param lView LView in which the function is being executed.\n * @param bindingRoot Binding root index.\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn\n * @param exp1\n * @param exp2\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n */\nfunction pureFunction2Internal(lView, bindingRoot, slotOffset, pureFn, exp1, exp2, thisArg) {\n const bindingIndex = bindingRoot + slotOffset;\n return bindingUpdated2(lView, bindingIndex, exp1, exp2)\n ? updateBinding(lView, bindingIndex + 2, thisArg ? pureFn.call(thisArg, exp1, exp2) : pureFn(exp1, exp2))\n : getPureFunctionReturnValue(lView, bindingIndex + 2);\n}\n/**\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param lView LView in which the function is being executed.\n * @param bindingRoot Binding root index.\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn\n * @param exp1\n * @param exp2\n * @param exp3\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n */\nfunction pureFunction3Internal(lView, bindingRoot, slotOffset, pureFn, exp1, exp2, exp3, thisArg) {\n const bindingIndex = bindingRoot + slotOffset;\n return bindingUpdated3(lView, bindingIndex, exp1, exp2, exp3)\n ? updateBinding(lView, bindingIndex + 3, thisArg ? pureFn.call(thisArg, exp1, exp2, exp3) : pureFn(exp1, exp2, exp3))\n : getPureFunctionReturnValue(lView, bindingIndex + 3);\n}\n/**\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param lView LView in which the function is being executed.\n * @param bindingRoot Binding root index.\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn\n * @param exp1\n * @param exp2\n * @param exp3\n * @param exp4\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n *\n */\nfunction pureFunction4Internal(lView, bindingRoot, slotOffset, pureFn, exp1, exp2, exp3, exp4, thisArg) {\n const bindingIndex = bindingRoot + slotOffset;\n return bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4)\n ? updateBinding(lView, bindingIndex + 4, thisArg ? pureFn.call(thisArg, exp1, exp2, exp3, exp4) : pureFn(exp1, exp2, exp3, exp4))\n : getPureFunctionReturnValue(lView, bindingIndex + 4);\n}\n/**\n * pureFunction instruction that can support any number of bindings.\n *\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param lView LView in which the function is being executed.\n * @param bindingRoot Binding root index.\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn A pure function that takes binding values and builds an object or array\n * containing those values.\n * @param exps An array of binding values\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n */\nfunction pureFunctionVInternal(lView, bindingRoot, slotOffset, pureFn, exps, thisArg) {\n let bindingIndex = bindingRoot + slotOffset;\n let different = false;\n for (let i = 0; i < exps.length; i++) {\n bindingUpdated(lView, bindingIndex++, exps[i]) && (different = true);\n }\n return different\n ? updateBinding(lView, bindingIndex, pureFn.apply(thisArg, exps))\n : getPureFunctionReturnValue(lView, bindingIndex);\n}\n\n/**\n * Create a pipe.\n *\n * @param index Pipe index where the pipe will be stored.\n * @param pipeName The name of the pipe\n * @returns T the instance of the pipe.\n *\n * @codeGenApi\n */\nfunction ɵɵpipe(index, pipeName) {\n const tView = getTView();\n let pipeDef;\n const adjustedIndex = index + HEADER_OFFSET;\n if (tView.firstCreatePass) {\n // The `getPipeDef` throws if a pipe with a given name is not found\n // (so we use non-null assertion below).\n pipeDef = getPipeDef(pipeName, tView.pipeRegistry);\n tView.data[adjustedIndex] = pipeDef;\n if (pipeDef.onDestroy) {\n (tView.destroyHooks ??= []).push(adjustedIndex, pipeDef.onDestroy);\n }\n }\n else {\n pipeDef = tView.data[adjustedIndex];\n }\n const pipeFactory = pipeDef.factory || (pipeDef.factory = getFactoryDef(pipeDef.type, true));\n let previousInjectorProfilerContext;\n if (ngDevMode) {\n previousInjectorProfilerContext = setInjectorProfilerContext({\n injector: new NodeInjector(getCurrentTNode(), getLView()),\n token: pipeDef.type,\n });\n }\n const previousInjectImplementation = setInjectImplementation(ɵɵdirectiveInject);\n try {\n // DI for pipes is supposed to behave like directives when placed on a component\n // host node, which means that we have to disable access to `viewProviders`.\n const previousIncludeViewProviders = setIncludeViewProviders(false);\n const pipeInstance = pipeFactory();\n setIncludeViewProviders(previousIncludeViewProviders);\n store(tView, getLView(), adjustedIndex, pipeInstance);\n return pipeInstance;\n }\n finally {\n // we have to restore the injector implementation in finally, just in case the creation of the\n // pipe throws an error.\n setInjectImplementation(previousInjectImplementation);\n ngDevMode && setInjectorProfilerContext(previousInjectorProfilerContext);\n }\n}\n/**\n * Searches the pipe registry for a pipe with the given name. If one is found,\n * returns the pipe. Otherwise, an error is thrown because the pipe cannot be resolved.\n *\n * @param name Name of pipe to resolve\n * @param registry Full list of available pipes\n * @returns Matching PipeDef\n */\nfunction getPipeDef(name, registry) {\n if (registry) {\n if (ngDevMode) {\n const pipes = registry.filter((pipe) => pipe.name === name);\n // TODO: Throw an error in the next major\n if (pipes.length > 1) {\n console.warn(formatRuntimeError(313 /* RuntimeErrorCode.MULTIPLE_MATCHING_PIPES */, getMultipleMatchingPipesMessage(name)));\n }\n }\n for (let i = registry.length - 1; i >= 0; i--) {\n const pipeDef = registry[i];\n if (name === pipeDef.name) {\n return pipeDef;\n }\n }\n }\n if (ngDevMode) {\n throw new RuntimeError(-302 /* RuntimeErrorCode.PIPE_NOT_FOUND */, getPipeNotFoundErrorMessage(name));\n }\n return;\n}\n/**\n * Generates a helpful error message for the user when multiple pipes match the name.\n *\n * @param name Name of the pipe\n * @returns The error message\n */\nfunction getMultipleMatchingPipesMessage(name) {\n const lView = getLView();\n const declarationLView = lView[DECLARATION_COMPONENT_VIEW];\n const context = declarationLView[CONTEXT];\n const hostIsStandalone = isHostComponentStandalone(lView);\n const componentInfoMessage = context ? ` in the '${context.constructor.name}' component` : '';\n const verifyMessage = `check ${hostIsStandalone ? \"'@Component.imports' of this component\" : 'the imports of this module'}`;\n const errorMessage = `Multiple pipes match the name \\`${name}\\`${componentInfoMessage}. ${verifyMessage}`;\n return errorMessage;\n}\n/**\n * Generates a helpful error message for the user when a pipe is not found.\n *\n * @param name Name of the missing pipe\n * @returns The error message\n */\nfunction getPipeNotFoundErrorMessage(name) {\n const lView = getLView();\n const declarationLView = lView[DECLARATION_COMPONENT_VIEW];\n const context = declarationLView[CONTEXT];\n const hostIsStandalone = isHostComponentStandalone(lView);\n const componentInfoMessage = context ? ` in the '${context.constructor.name}' component` : '';\n const verifyMessage = `Verify that it is ${hostIsStandalone\n ? \"included in the '@Component.imports' of this component\"\n : 'declared or imported in this module'}`;\n const errorMessage = `The pipe '${name}' could not be found${componentInfoMessage}. ${verifyMessage}`;\n return errorMessage;\n}\n/**\n * Invokes a pipe with 1 arguments.\n *\n * This instruction acts as a guard to {@link PipeTransform#transform} invoking\n * the pipe only when an input to the pipe changes.\n *\n * @param index Pipe index where the pipe was stored on creation.\n * @param offset the binding offset\n * @param v1 1st argument to {@link PipeTransform#transform}.\n *\n * @codeGenApi\n */\nfunction ɵɵpipeBind1(index, offset, v1) {\n const adjustedIndex = index + HEADER_OFFSET;\n const lView = getLView();\n const pipeInstance = load(lView, adjustedIndex);\n return isPure(lView, adjustedIndex)\n ? pureFunction1Internal(lView, getBindingRoot(), offset, pipeInstance.transform, v1, pipeInstance)\n : pipeInstance.transform(v1);\n}\n/**\n * Invokes a pipe with 2 arguments.\n *\n * This instruction acts as a guard to {@link PipeTransform#transform} invoking\n * the pipe only when an input to the pipe changes.\n *\n * @param index Pipe index where the pipe was stored on creation.\n * @param slotOffset the offset in the reserved slot space\n * @param v1 1st argument to {@link PipeTransform#transform}.\n * @param v2 2nd argument to {@link PipeTransform#transform}.\n *\n * @codeGenApi\n */\nfunction ɵɵpipeBind2(index, slotOffset, v1, v2) {\n const adjustedIndex = index + HEADER_OFFSET;\n const lView = getLView();\n const pipeInstance = load(lView, adjustedIndex);\n return isPure(lView, adjustedIndex)\n ? pureFunction2Internal(lView, getBindingRoot(), slotOffset, pipeInstance.transform, v1, v2, pipeInstance)\n : pipeInstance.transform(v1, v2);\n}\n/**\n * Invokes a pipe with 3 arguments.\n *\n * This instruction acts as a guard to {@link PipeTransform#transform} invoking\n * the pipe only when an input to the pipe changes.\n *\n * @param index Pipe index where the pipe was stored on creation.\n * @param slotOffset the offset in the reserved slot space\n * @param v1 1st argument to {@link PipeTransform#transform}.\n * @param v2 2nd argument to {@link PipeTransform#transform}.\n * @param v3 4rd argument to {@link PipeTransform#transform}.\n *\n * @codeGenApi\n */\nfunction ɵɵpipeBind3(index, slotOffset, v1, v2, v3) {\n const adjustedIndex = index + HEADER_OFFSET;\n const lView = getLView();\n const pipeInstance = load(lView, adjustedIndex);\n return isPure(lView, adjustedIndex)\n ? pureFunction3Internal(lView, getBindingRoot(), slotOffset, pipeInstance.transform, v1, v2, v3, pipeInstance)\n : pipeInstance.transform(v1, v2, v3);\n}\n/**\n * Invokes a pipe with 4 arguments.\n *\n * This instruction acts as a guard to {@link PipeTransform#transform} invoking\n * the pipe only when an input to the pipe changes.\n *\n * @param index Pipe index where the pipe was stored on creation.\n * @param slotOffset the offset in the reserved slot space\n * @param v1 1st argument to {@link PipeTransform#transform}.\n * @param v2 2nd argument to {@link PipeTransform#transform}.\n * @param v3 3rd argument to {@link PipeTransform#transform}.\n * @param v4 4th argument to {@link PipeTransform#transform}.\n *\n * @codeGenApi\n */\nfunction ɵɵpipeBind4(index, slotOffset, v1, v2, v3, v4) {\n const adjustedIndex = index + HEADER_OFFSET;\n const lView = getLView();\n const pipeInstance = load(lView, adjustedIndex);\n return isPure(lView, adjustedIndex)\n ? pureFunction4Internal(lView, getBindingRoot(), slotOffset, pipeInstance.transform, v1, v2, v3, v4, pipeInstance)\n : pipeInstance.transform(v1, v2, v3, v4);\n}\n/**\n * Invokes a pipe with variable number of arguments.\n *\n * This instruction acts as a guard to {@link PipeTransform#transform} invoking\n * the pipe only when an input to the pipe changes.\n *\n * @param index Pipe index where the pipe was stored on creation.\n * @param slotOffset the offset in the reserved slot space\n * @param values Array of arguments to pass to {@link PipeTransform#transform} method.\n *\n * @codeGenApi\n */\nfunction ɵɵpipeBindV(index, slotOffset, values) {\n const adjustedIndex = index + HEADER_OFFSET;\n const lView = getLView();\n const pipeInstance = load(lView, adjustedIndex);\n return isPure(lView, adjustedIndex)\n ? pureFunctionVInternal(lView, getBindingRoot(), slotOffset, pipeInstance.transform, values, pipeInstance)\n : pipeInstance.transform.apply(pipeInstance, values);\n}\nfunction isPure(lView, index) {\n return lView[TVIEW].data[index].pure;\n}\n\n/**\n * Retrieves `TemplateRef` instance from `Injector` when a local reference is placed on the\n * `<ng-template>` element.\n *\n * @codeGenApi\n */\nfunction ɵɵtemplateRefExtractor(tNode, lView) {\n return createTemplateRef(tNode, lView);\n}\n\nfunction ɵɵgetComponentDepsFactory(type, rawImports) {\n return () => {\n try {\n return depsTracker.getComponentDependencies(type, rawImports).dependencies;\n }\n catch (e) {\n console.error(`Computing dependencies in local compilation mode for the component \"${type.name}\" failed with the exception:`, e);\n throw e;\n }\n };\n}\n\n/**\n * Sets the debug info for an Angular class.\n *\n * This runtime is guarded by ngDevMode flag.\n */\nfunction ɵsetClassDebugInfo(type, debugInfo) {\n const def = getComponentDef(type);\n if (def !== null) {\n def.debugInfo = debugInfo;\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/**\n * Gets the URL from which the client will fetch a new version of a component's metadata so it\n * can be replaced during hot module reloading.\n * @param id Unique ID for the component, generated during compile time.\n * @param timestamp Time at which the request happened.\n * @param base Base URL against which to resolve relative paths.\n * @codeGenApi\n */\nfunction ɵɵgetReplaceMetadataURL(id, timestamp, base) {\n const url = `./@ng/component?c=${id}&t=${encodeURIComponent(timestamp)}`;\n return new URL(url, base).href;\n}\n/**\n * Replaces the metadata of a component type and re-renders all live instances of the component.\n * @param type Class whose metadata will be replaced.\n * @param applyMetadata Callback that will apply a new set of metadata on the `type` when invoked.\n * @param environment Syntehtic namespace imports that need to be passed along to the callback.\n * @param locals Local symbols from the source location that have to be exposed to the callback.\n * @param importMeta `import.meta` from the call site of the replacement function. Optional since\n * it isn't used internally.\n * @param id ID to the class being replaced. **Not** the same as the component definition ID.\n * Optional since the ID might not be available internally.\n * @codeGenApi\n */\nfunction ɵɵreplaceMetadata(type, applyMetadata, namespaces, locals, importMeta = null, id = null) {\n ngDevMode && assertComponentDef(type);\n const currentDef = getComponentDef(type);\n // The reason `applyMetadata` is a callback that is invoked (almost) immediately is because\n // the compiler usually produces more code than just the component definition, e.g. there\n // can be functions for embedded views, the variables for the constant pool and `setClassMetadata`\n // calls. The callback allows us to keep them isolate from the rest of the app and to invoke\n // them at the right time.\n applyMetadata.apply(null, [type, namespaces, ...locals]);\n const { newDef, oldDef } = mergeWithExistingDefinition(currentDef, getComponentDef(type));\n // TODO(crisbeto): the `applyMetadata` call above will replace the definition on the type.\n // Ideally we should adjust the compiler output so the metadata is returned, however that'll\n // require some internal changes. We re-add the metadata here manually.\n type[NG_COMP_DEF] = newDef;\n // If a `tView` hasn't been created yet, it means that this component hasn't been instantianted\n // before. In this case there's nothing left for us to do aside from patching it in.\n if (oldDef.tView) {\n const trackedViews = getTrackedLViews().values();\n for (const root of trackedViews) {\n // Note: we have the additional check, because `IsRoot` can also indicate\n // a component created through something like `createComponent`.\n if (isRootView(root) && root[PARENT] === null) {\n recreateMatchingLViews(importMeta, id, newDef, oldDef, root);\n }\n }\n }\n}\n/**\n * Merges two component definitions while preseving the original one in place.\n * @param currentDef Definition that should receive the new metadata.\n * @param newDef Source of the new metadata.\n */\nfunction mergeWithExistingDefinition(currentDef, newDef) {\n // Clone the current definition since we reference its original data further\n // down in the replacement process (e.g. when destroying the renderer).\n const clone = { ...currentDef };\n // Assign the new metadata in place while preserving the object literal. It's important to\n // Keep the object in place, because there can be references to it, for example in the\n // `directiveDefs` of another definition.\n const replacement = Object.assign(currentDef, newDef, {\n // We need to keep the existing directive and pipe defs, because they can get patched on\n // by a call to `setComponentScope` from a module file. That call won't make it into the\n // HMR replacement function, because it lives in an entirely different file.\n directiveDefs: clone.directiveDefs,\n pipeDefs: clone.pipeDefs,\n // Preserve the old `setInput` function, because it has some state.\n // This is fine, because the component instance is preserved as well.\n setInput: clone.setInput,\n // Externally this is redundant since we redeclare the definition using the original type.\n // Internally we may receive a definition with an alternate, but identical, type so we have\n // to ensure that the original one is preserved.\n type: clone.type,\n });\n ngDevMode && assertEqual(replacement, currentDef, 'Expected definition to be merged in place');\n return { newDef: replacement, oldDef: clone };\n}\n/**\n * Finds all LViews matching a specific component definition and recreates them.\n * @param importMeta `import.meta` information.\n * @param id HMR ID of the component.\n * @param oldDef Component definition to search for.\n * @param rootLView View from which to start the search.\n */\nfunction recreateMatchingLViews(importMeta, id, newDef, oldDef, rootLView) {\n ngDevMode &&\n assertDefined(oldDef.tView, 'Expected a component definition that has been instantiated at least once');\n const tView = rootLView[TVIEW];\n // Use `tView` to match the LView since `instanceof` can\n // produce false positives when using inheritance.\n if (tView === oldDef.tView) {\n ngDevMode && assertComponentDef(oldDef.type);\n recreateLView(importMeta, id, newDef, oldDef, rootLView);\n return;\n }\n for (let i = HEADER_OFFSET; i < tView.bindingStartIndex; i++) {\n const current = rootLView[i];\n if (isLContainer(current)) {\n // The host can be an LView if a component is injecting `ViewContainerRef`.\n if (isLView(current[HOST])) {\n recreateMatchingLViews(importMeta, id, newDef, oldDef, current[HOST]);\n }\n for (let j = CONTAINER_HEADER_OFFSET; j < current.length; j++) {\n recreateMatchingLViews(importMeta, id, newDef, oldDef, current[j]);\n }\n }\n else if (isLView(current)) {\n recreateMatchingLViews(importMeta, id, newDef, oldDef, current);\n }\n }\n}\n/**\n * Removes any cached renderers from the factory for the provided type.\n * This is currently used by the HMR logic to ensure Renderers are kept\n * synchronized with any definition metadata updates.\n * @param factory A RendererFactory2 instance.\n * @param def A ComponentDef instance.\n */\nfunction clearRendererCache(factory, def) {\n // Cast to read a private field.\n // NOTE: This must be kept synchronized with the renderer factory implementation in\n // platform-browser and platform-browser/animations.\n factory.componentReplaced?.(def.id);\n}\n/**\n * Recreates an LView in-place from a new component definition.\n * @param importMeta `import.meta` information.\n * @param id HMR ID for the component.\n * @param newDef Definition from which to recreate the view.\n * @param oldDef Previous component definition being swapped out.\n * @param lView View to be recreated.\n */\nfunction recreateLView(importMeta, id, newDef, oldDef, lView) {\n const instance = lView[CONTEXT];\n let host = lView[HOST];\n // In theory the parent can also be an LContainer, but it appears like that's\n // only the case for embedded views which we won't be replacing here.\n const parentLView = lView[PARENT];\n ngDevMode && assertLView(parentLView);\n const tNode = lView[T_HOST];\n ngDevMode && assertTNodeType(tNode, 2 /* TNodeType.Element */);\n ngDevMode && assertNotEqual(newDef, oldDef, 'Expected different component definition');\n const zone = lView[INJECTOR].get(NgZone, null);\n const recreate = () => {\n // If we're recreating a component with shadow DOM encapsulation, it will have attached a\n // shadow root. The browser will throw if we attempt to attach another one and there's no way\n // to detach it. Our only option is to make a clone only of the root node, replace the node\n // with the clone and use it for the newly-created LView.\n if (oldDef.encapsulation === ViewEncapsulation.ShadowDom) {\n const newHost = host.cloneNode(false);\n host.replaceWith(newHost);\n host = newHost;\n }\n // Recreate the TView since the template might've changed.\n const newTView = getOrCreateComponentTView(newDef);\n // Create a new LView from the new TView, but reusing the existing TNode and DOM node.\n const newLView = createLView(parentLView, newTView, instance, getInitialLViewFlagsFromDef(newDef), host, tNode, null, null, // The renderer will be created a bit further down once the old one is destroyed.\n null, null, null);\n // Detach the LView from its current place in the tree so we don't\n // start traversing any siblings and modifying their structure.\n replaceLViewInTree(parentLView, lView, newLView, tNode.index);\n // Destroy the detached LView.\n destroyLView(lView[TVIEW], lView);\n // Always force the creation of a new renderer to ensure state captured during construction\n // stays consistent with the new component definition by clearing any old ached factories.\n const rendererFactory = lView[ENVIRONMENT].rendererFactory;\n clearRendererCache(rendererFactory, oldDef);\n // Patch a brand-new renderer onto the new view only after the old\n // view is destroyed so that the runtime doesn't try to reuse it.\n newLView[RENDERER] = rendererFactory.createRenderer(host, newDef);\n // Remove the nodes associated with the destroyed LView. This removes the\n // descendants, but not the host which we want to stay in place.\n removeViewFromDOM(lView[TVIEW], lView);\n // Reset the content projection state of the TNode before the first render.\n // Note that this has to happen after the LView has been destroyed or we\n // risk some projected nodes not being removed correctly.\n resetProjectionState(tNode);\n // Creation pass for the new view.\n renderView(newTView, newLView, instance);\n // Update pass for the new view.\n refreshView(newTView, newLView, newTView.template, instance);\n };\n // The callback isn't guaranteed to be inside the Zone so we need to bring it in ourselves.\n if (zone === null) {\n executeWithInvalidateFallback(importMeta, id, recreate);\n }\n else {\n zone.run(() => executeWithInvalidateFallback(importMeta, id, recreate));\n }\n}\n/**\n * Runs an HMR-related function and falls back to\n * invalidating the HMR data if it throws an error.\n */\nfunction executeWithInvalidateFallback(importMeta, id, callback) {\n try {\n callback();\n }\n catch (e) {\n const error = e;\n // If we have all the necessary information and APIs to send off the invalidation\n // request, send it before rethrowing so the dev server can decide what to do.\n if (id !== null && error.message) {\n const toLog = error.message + (error.stack ? '\\n' + error.stack : '');\n importMeta?.hot?.send?.('angular:invalidate', { id, message: toLog, error: true });\n }\n // Throw the error in case the page doesn't get refreshed.\n throw e;\n }\n}\n/**\n * Replaces one LView in the tree with another one.\n * @param parentLView Parent of the LView being replaced.\n * @param oldLView LView being replaced.\n * @param newLView Replacement LView to be inserted.\n * @param index Index at which the LView should be inserted.\n */\nfunction replaceLViewInTree(parentLView, oldLView, newLView, index) {\n // Update the sibling whose `NEXT` pointer refers to the old view.\n for (let i = HEADER_OFFSET; i < parentLView[TVIEW].bindingStartIndex; i++) {\n const current = parentLView[i];\n if ((isLView(current) || isLContainer(current)) && current[NEXT] === oldLView) {\n current[NEXT] = newLView;\n break;\n }\n }\n // Set the new view as the head, if the old view was first.\n if (parentLView[CHILD_HEAD] === oldLView) {\n parentLView[CHILD_HEAD] = newLView;\n }\n // Set the new view as the tail, if the old view was last.\n if (parentLView[CHILD_TAIL] === oldLView) {\n parentLView[CHILD_TAIL] = newLView;\n }\n // Update the `NEXT` pointer to the same as the old view.\n newLView[NEXT] = oldLView[NEXT];\n // Clear out the `NEXT` of the old view.\n oldLView[NEXT] = null;\n // Insert the new LView at the correct index.\n parentLView[index] = newLView;\n}\n/**\n * Child nodes mutate the `projection` state of their parent node as they're being projected.\n * This function resets the `project` back to its initial state.\n * @param tNode\n */\nfunction resetProjectionState(tNode) {\n // The `projection` is mutated by child nodes as they're being projected. We need to\n // reset it to the initial state so projection works after the template is swapped out.\n if (tNode.projection !== null) {\n for (const current of tNode.projection) {\n if (isTNodeShape(current)) {\n // Reset `projectionNext` since it can affect the traversal order during projection.\n current.projectionNext = null;\n current.flags &= ~2 /* TNodeFlags.isProjected */;\n }\n }\n tNode.projection = null;\n }\n}\n\n/**\n * A mapping of the @angular/core API surface used in generated expressions to the actual symbols.\n *\n * This should be kept up to date with the public exports of @angular/core.\n */\nconst angularCoreEnv = (() => ({\n 'ɵɵattribute': ɵɵattribute,\n 'ɵɵdefineComponent': ɵɵdefineComponent,\n 'ɵɵdefineDirective': ɵɵdefineDirective,\n 'ɵɵdefineInjectable': __defineInjectable,\n 'ɵɵdefineInjector': __defineInjector,\n 'ɵɵdefineNgModule': ɵɵdefineNgModule,\n 'ɵɵdefinePipe': ɵɵdefinePipe,\n 'ɵɵdirectiveInject': ɵɵdirectiveInject,\n 'ɵɵgetInheritedFactory': ɵɵgetInheritedFactory,\n 'ɵɵinject': __inject,\n 'ɵɵinjectAttribute': ɵɵinjectAttribute,\n 'ɵɵinvalidFactory': ɵɵinvalidFactory,\n 'ɵɵinvalidFactoryDep': __invalidFactoryDep,\n 'ɵɵtemplateRefExtractor': ɵɵtemplateRefExtractor,\n 'ɵɵresetView': __resetView,\n 'ɵɵHostDirectivesFeature': ɵɵHostDirectivesFeature,\n 'ɵɵNgOnChangesFeature': ɵɵNgOnChangesFeature,\n 'ɵɵProvidersFeature': ɵɵProvidersFeature,\n 'ɵɵCopyDefinitionFeature': ɵɵCopyDefinitionFeature,\n 'ɵɵInheritDefinitionFeature': ɵɵInheritDefinitionFeature,\n 'ɵɵExternalStylesFeature': ɵɵExternalStylesFeature,\n 'ɵɵnextContext': ɵɵnextContext,\n 'ɵɵnamespaceHTML': __namespaceHTML,\n 'ɵɵnamespaceMathML': __namespaceMathML,\n 'ɵɵnamespaceSVG': __namespaceSVG,\n 'ɵɵenableBindings': __enableBindings,\n 'ɵɵdisableBindings': __disableBindings,\n 'ɵɵelementStart': ɵɵelementStart,\n 'ɵɵelementEnd': ɵɵelementEnd,\n 'ɵɵelement': ɵɵelement,\n 'ɵɵelementContainerStart': ɵɵelementContainerStart,\n 'ɵɵelementContainerEnd': ɵɵelementContainerEnd,\n 'ɵɵdomElement': ɵɵdomElement,\n 'ɵɵdomElementStart': ɵɵdomElementStart,\n 'ɵɵdomElementEnd': ɵɵdomElementEnd,\n 'ɵɵdomElementContainer': ɵɵdomElementContainer,\n 'ɵɵdomElementContainerStart': ɵɵdomElementContainerStart,\n 'ɵɵdomElementContainerEnd': ɵɵdomElementContainerEnd,\n 'ɵɵdomTemplate': ɵɵdomTemplate,\n 'ɵɵdomListener': ɵɵdomListener,\n 'ɵɵelementContainer': ɵɵelementContainer,\n 'ɵɵpureFunction0': ɵɵpureFunction0,\n 'ɵɵpureFunction1': ɵɵpureFunction1,\n 'ɵɵpureFunction2': ɵɵpureFunction2,\n 'ɵɵpureFunction3': ɵɵpureFunction3,\n 'ɵɵpureFunction4': ɵɵpureFunction4,\n 'ɵɵpureFunction5': ɵɵpureFunction5,\n 'ɵɵpureFunction6': ɵɵpureFunction6,\n 'ɵɵpureFunction7': ɵɵpureFunction7,\n 'ɵɵpureFunction8': ɵɵpureFunction8,\n 'ɵɵpureFunctionV': ɵɵpureFunctionV,\n 'ɵɵgetCurrentView': ɵɵgetCurrentView,\n 'ɵɵrestoreView': __restoreView,\n 'ɵɵlistener': ɵɵlistener,\n 'ɵɵprojection': ɵɵprojection,\n 'ɵɵsyntheticHostProperty': ɵɵsyntheticHostProperty,\n 'ɵɵsyntheticHostListener': ɵɵsyntheticHostListener,\n 'ɵɵpipeBind1': ɵɵpipeBind1,\n 'ɵɵpipeBind2': ɵɵpipeBind2,\n 'ɵɵpipeBind3': ɵɵpipeBind3,\n 'ɵɵpipeBind4': ɵɵpipeBind4,\n 'ɵɵpipeBindV': ɵɵpipeBindV,\n 'ɵɵprojectionDef': ɵɵprojectionDef,\n 'ɵɵdomProperty': ɵɵdomProperty,\n 'ɵɵproperty': ɵɵproperty,\n 'ɵɵpipe': ɵɵpipe,\n 'ɵɵqueryRefresh': ɵɵqueryRefresh,\n 'ɵɵqueryAdvance': ɵɵqueryAdvance,\n 'ɵɵviewQuery': ɵɵviewQuery,\n 'ɵɵviewQuerySignal': ɵɵviewQuerySignal,\n 'ɵɵloadQuery': ɵɵloadQuery,\n 'ɵɵcontentQuery': ɵɵcontentQuery,\n 'ɵɵcontentQuerySignal': ɵɵcontentQuerySignal,\n 'ɵɵreference': ɵɵreference,\n 'ɵɵclassMap': ɵɵclassMap,\n 'ɵɵstyleMap': ɵɵstyleMap,\n 'ɵɵstyleProp': ɵɵstyleProp,\n 'ɵɵclassProp': ɵɵclassProp,\n 'ɵɵadvance': ɵɵadvance,\n 'ɵɵtemplate': ɵɵtemplate,\n 'ɵɵconditional': ɵɵconditional,\n 'ɵɵconditionalCreate': ɵɵconditionalCreate,\n 'ɵɵconditionalBranchCreate': ɵɵconditionalBranchCreate,\n 'ɵɵdefer': ɵɵdefer,\n 'ɵɵdeferWhen': ɵɵdeferWhen,\n 'ɵɵdeferOnIdle': ɵɵdeferOnIdle,\n 'ɵɵdeferOnImmediate': ɵɵdeferOnImmediate,\n 'ɵɵdeferOnTimer': ɵɵdeferOnTimer,\n 'ɵɵdeferOnHover': ɵɵdeferOnHover,\n 'ɵɵdeferOnInteraction': ɵɵdeferOnInteraction,\n 'ɵɵdeferOnViewport': ɵɵdeferOnViewport,\n 'ɵɵdeferPrefetchWhen': ɵɵdeferPrefetchWhen,\n 'ɵɵdeferPrefetchOnIdle': ɵɵdeferPrefetchOnIdle,\n 'ɵɵdeferPrefetchOnImmediate': ɵɵdeferPrefetchOnImmediate,\n 'ɵɵdeferPrefetchOnTimer': ɵɵdeferPrefetchOnTimer,\n 'ɵɵdeferPrefetchOnHover': ɵɵdeferPrefetchOnHover,\n 'ɵɵdeferPrefetchOnInteraction': ɵɵdeferPrefetchOnInteraction,\n 'ɵɵdeferPrefetchOnViewport': ɵɵdeferPrefetchOnViewport,\n 'ɵɵdeferHydrateWhen': ɵɵdeferHydrateWhen,\n 'ɵɵdeferHydrateNever': ɵɵdeferHydrateNever,\n 'ɵɵdeferHydrateOnIdle': ɵɵdeferHydrateOnIdle,\n 'ɵɵdeferHydrateOnImmediate': ɵɵdeferHydrateOnImmediate,\n 'ɵɵdeferHydrateOnTimer': ɵɵdeferHydrateOnTimer,\n 'ɵɵdeferHydrateOnHover': ɵɵdeferHydrateOnHover,\n 'ɵɵdeferHydrateOnInteraction': ɵɵdeferHydrateOnInteraction,\n 'ɵɵdeferHydrateOnViewport': ɵɵdeferHydrateOnViewport,\n 'ɵɵdeferEnableTimerScheduling': ɵɵdeferEnableTimerScheduling,\n 'ɵɵrepeater': ɵɵrepeater,\n 'ɵɵrepeaterCreate': ɵɵrepeaterCreate,\n 'ɵɵrepeaterTrackByIndex': ɵɵrepeaterTrackByIndex,\n 'ɵɵrepeaterTrackByIdentity': ɵɵrepeaterTrackByIdentity,\n 'ɵɵcomponentInstance': ɵɵcomponentInstance,\n 'ɵɵtext': ɵɵtext,\n 'ɵɵtextInterpolate': ɵɵtextInterpolate,\n 'ɵɵtextInterpolate1': ɵɵtextInterpolate1,\n 'ɵɵtextInterpolate2': ɵɵtextInterpolate2,\n 'ɵɵtextInterpolate3': ɵɵtextInterpolate3,\n 'ɵɵtextInterpolate4': ɵɵtextInterpolate4,\n 'ɵɵtextInterpolate5': ɵɵtextInterpolate5,\n 'ɵɵtextInterpolate6': ɵɵtextInterpolate6,\n 'ɵɵtextInterpolate7': ɵɵtextInterpolate7,\n 'ɵɵtextInterpolate8': ɵɵtextInterpolate8,\n 'ɵɵtextInterpolateV': ɵɵtextInterpolateV,\n 'ɵɵi18n': ɵɵi18n,\n 'ɵɵi18nAttributes': ɵɵi18nAttributes,\n 'ɵɵi18nExp': ɵɵi18nExp,\n 'ɵɵi18nStart': ɵɵi18nStart,\n 'ɵɵi18nEnd': ɵɵi18nEnd,\n 'ɵɵi18nApply': ɵɵi18nApply,\n 'ɵɵi18nPostprocess': ɵɵi18nPostprocess,\n 'ɵɵresolveWindow': ɵɵresolveWindow,\n 'ɵɵresolveDocument': ɵɵresolveDocument,\n 'ɵɵresolveBody': ɵɵresolveBody,\n 'ɵɵsetComponentScope': ɵɵsetComponentScope,\n 'ɵɵsetNgModuleScope': ɵɵsetNgModuleScope,\n 'ɵɵregisterNgModuleType': registerNgModuleType,\n 'ɵɵgetComponentDepsFactory': ɵɵgetComponentDepsFactory,\n 'ɵsetClassDebugInfo': ɵsetClassDebugInfo,\n 'ɵɵdeclareLet': ɵɵdeclareLet,\n 'ɵɵstoreLet': ɵɵstoreLet,\n 'ɵɵreadContextLet': ɵɵreadContextLet,\n 'ɵɵattachSourceLocations': ɵɵattachSourceLocations,\n 'ɵɵinterpolate': ɵɵinterpolate,\n 'ɵɵinterpolate1': ɵɵinterpolate1,\n 'ɵɵinterpolate2': ɵɵinterpolate2,\n 'ɵɵinterpolate3': ɵɵinterpolate3,\n 'ɵɵinterpolate4': ɵɵinterpolate4,\n 'ɵɵinterpolate5': ɵɵinterpolate5,\n 'ɵɵinterpolate6': ɵɵinterpolate6,\n 'ɵɵinterpolate7': ɵɵinterpolate7,\n 'ɵɵinterpolate8': ɵɵinterpolate8,\n 'ɵɵinterpolateV': ɵɵinterpolateV,\n 'ɵɵsanitizeHtml': ɵɵsanitizeHtml,\n 'ɵɵsanitizeStyle': ɵɵsanitizeStyle,\n 'ɵɵsanitizeResourceUrl': ɵɵsanitizeResourceUrl,\n 'ɵɵsanitizeScript': ɵɵsanitizeScript,\n 'ɵɵsanitizeUrl': ɵɵsanitizeUrl,\n 'ɵɵsanitizeUrlOrResourceUrl': ɵɵsanitizeUrlOrResourceUrl,\n 'ɵɵtrustConstantHtml': ɵɵtrustConstantHtml,\n 'ɵɵtrustConstantResourceUrl': ɵɵtrustConstantResourceUrl,\n 'ɵɵvalidateIframeAttribute': ɵɵvalidateIframeAttribute,\n 'forwardRef': forwardRef,\n 'resolveForwardRef': resolveForwardRef,\n 'ɵɵtwoWayProperty': ɵɵtwoWayProperty,\n 'ɵɵtwoWayBindingSet': ɵɵtwoWayBindingSet,\n 'ɵɵtwoWayListener': ɵɵtwoWayListener,\n 'ɵɵreplaceMetadata': ɵɵreplaceMetadata,\n 'ɵɵgetReplaceMetadataURL': ɵɵgetReplaceMetadataURL,\n}))();\n\nlet jitOptions = null;\nfunction setJitOptions(options) {\n if (jitOptions !== null) {\n if (options.defaultEncapsulation !== jitOptions.defaultEncapsulation) {\n ngDevMode &&\n console.error('Provided value for `defaultEncapsulation` can not be changed once it has been set.');\n return;\n }\n if (options.preserveWhitespaces !== jitOptions.preserveWhitespaces) {\n ngDevMode &&\n console.error('Provided value for `preserveWhitespaces` can not be changed once it has been set.');\n return;\n }\n }\n jitOptions = options;\n}\nfunction getJitOptions() {\n return jitOptions;\n}\nfunction resetJitOptions() {\n jitOptions = null;\n}\n\nconst moduleQueue = [];\n/**\n * Enqueues moduleDef to be checked later to see if scope can be set on its\n * component declarations.\n */\nfunction enqueueModuleForDelayedScoping(moduleType, ngModule) {\n moduleQueue.push({ moduleType, ngModule });\n}\nlet flushingModuleQueue = false;\n/**\n * Loops over queued module definitions, if a given module definition has all of its\n * declarations resolved, it dequeues that module definition and sets the scope on\n * its declarations.\n */\nfunction flushModuleScopingQueueAsMuchAsPossible() {\n if (!flushingModuleQueue) {\n flushingModuleQueue = true;\n try {\n for (let i = moduleQueue.length - 1; i >= 0; i--) {\n const { moduleType, ngModule } = moduleQueue[i];\n if (ngModule.declarations && ngModule.declarations.every(isResolvedDeclaration)) {\n // dequeue\n moduleQueue.splice(i, 1);\n setScopeOnDeclaredComponents(moduleType, ngModule);\n }\n }\n }\n finally {\n flushingModuleQueue = false;\n }\n }\n}\n/**\n * Returns truthy if a declaration has resolved. If the declaration happens to be\n * an array of declarations, it will recurse to check each declaration in that array\n * (which may also be arrays).\n */\nfunction isResolvedDeclaration(declaration) {\n if (Array.isArray(declaration)) {\n return declaration.every(isResolvedDeclaration);\n }\n return !!resolveForwardRef(declaration);\n}\n/**\n * Compiles a module in JIT mode.\n *\n * This function automatically gets called when a class has a `@NgModule` decorator.\n */\nfunction compileNgModule(moduleType, ngModule = {}) {\n compileNgModuleDefs(moduleType, ngModule);\n if (ngModule.id !== undefined) {\n registerNgModuleType(moduleType, ngModule.id);\n }\n // Because we don't know if all declarations have resolved yet at the moment the\n // NgModule decorator is executing, we're enqueueing the setting of module scope\n // on its declarations to be run at a later time when all declarations for the module,\n // including forward refs, have resolved.\n enqueueModuleForDelayedScoping(moduleType, ngModule);\n}\n/**\n * Compiles and adds the `ɵmod`, `ɵfac` and `ɵinj` properties to the module class.\n *\n * It's possible to compile a module via this API which will allow duplicate declarations in its\n * root.\n */\nfunction compileNgModuleDefs(moduleType, ngModule, allowDuplicateDeclarationsInRoot = false) {\n ngDevMode && assertDefined(moduleType, 'Required value moduleType');\n ngDevMode && assertDefined(ngModule, 'Required value ngModule');\n const declarations = flatten(ngModule.declarations || EMPTY_ARRAY);\n let ngModuleDef = null;\n Object.defineProperty(moduleType, NG_MOD_DEF, {\n configurable: true,\n get: () => {\n if (ngModuleDef === null) {\n if (ngDevMode && ngModule.imports && ngModule.imports.indexOf(moduleType) > -1) {\n // We need to assert this immediately, because allowing it to continue will cause it to\n // go into an infinite loop before we've reached the point where we throw all the errors.\n throw new Error(`'${stringifyForError(moduleType)}' module can't import itself`);\n }\n const compiler = getCompilerFacade({\n usage: 0 /* JitCompilerUsage.Decorator */,\n kind: 'NgModule',\n type: moduleType,\n });\n ngModuleDef = compiler.compileNgModule(angularCoreEnv, `ng:///${moduleType.name}/ɵmod.js`, {\n type: moduleType,\n bootstrap: flatten(ngModule.bootstrap || EMPTY_ARRAY).map(resolveForwardRef),\n declarations: declarations.map(resolveForwardRef),\n imports: flatten(ngModule.imports || EMPTY_ARRAY)\n .map(resolveForwardRef)\n .map(expandModuleWithProviders),\n exports: flatten(ngModule.exports || EMPTY_ARRAY)\n .map(resolveForwardRef)\n .map(expandModuleWithProviders),\n schemas: ngModule.schemas ? flatten(ngModule.schemas) : null,\n id: ngModule.id || null,\n });\n // Set `schemas` on ngModuleDef to an empty array in JIT mode to indicate that runtime\n // should verify that there are no unknown elements in a template. In AOT mode, that check\n // happens at compile time and `schemas` information is not present on Component and Module\n // defs after compilation (so the check doesn't happen the second time at runtime).\n if (!ngModuleDef.schemas) {\n ngModuleDef.schemas = [];\n }\n }\n return ngModuleDef;\n },\n });\n let ngFactoryDef = null;\n Object.defineProperty(moduleType, NG_FACTORY_DEF, {\n get: () => {\n if (ngFactoryDef === null) {\n const compiler = getCompilerFacade({\n usage: 0 /* JitCompilerUsage.Decorator */,\n kind: 'NgModule',\n type: moduleType,\n });\n ngFactoryDef = compiler.compileFactory(angularCoreEnv, `ng:///${moduleType.name}/ɵfac.js`, {\n name: moduleType.name,\n type: moduleType,\n deps: reflectDependencies(moduleType),\n target: compiler.FactoryTarget.NgModule,\n typeArgumentCount: 0,\n });\n }\n return ngFactoryDef;\n },\n // Make the property configurable in dev mode to allow overriding in tests\n configurable: !!ngDevMode,\n });\n let ngInjectorDef = null;\n Object.defineProperty(moduleType, NG_INJ_DEF, {\n get: () => {\n if (ngInjectorDef === null) {\n ngDevMode && verifySemanticsOfNgModuleDef(moduleType, allowDuplicateDeclarationsInRoot);\n const meta = {\n name: moduleType.name,\n type: moduleType,\n providers: ngModule.providers || EMPTY_ARRAY,\n imports: [\n (ngModule.imports || EMPTY_ARRAY).map(resolveForwardRef),\n (ngModule.exports || EMPTY_ARRAY).map(resolveForwardRef),\n ],\n };\n const compiler = getCompilerFacade({\n usage: 0 /* JitCompilerUsage.Decorator */,\n kind: 'NgModule',\n type: moduleType,\n });\n ngInjectorDef = compiler.compileInjector(angularCoreEnv, `ng:///${moduleType.name}/ɵinj.js`, meta);\n }\n return ngInjectorDef;\n },\n // Make the property configurable in dev mode to allow overriding in tests\n configurable: !!ngDevMode,\n });\n}\nfunction generateStandaloneInDeclarationsError(type, location) {\n const prefix = `Unexpected \"${stringifyForError(type)}\" found in the \"declarations\" array of the`;\n const suffix = `\"${stringifyForError(type)}\" is marked as standalone and can't be declared ` +\n 'in any NgModule - did you intend to import it instead (by adding it to the \"imports\" array)?';\n return `${prefix} ${location}, ${suffix}`;\n}\nfunction verifySemanticsOfNgModuleDef(moduleType, allowDuplicateDeclarationsInRoot, importingModule) {\n if (verifiedNgModule.get(moduleType))\n return;\n // skip verifications of standalone components, directives, and pipes\n if (isStandalone(moduleType))\n return;\n verifiedNgModule.set(moduleType, true);\n moduleType = resolveForwardRef(moduleType);\n let ngModuleDef;\n if (importingModule) {\n ngModuleDef = getNgModuleDef(moduleType);\n if (!ngModuleDef) {\n throw new Error(`Unexpected value '${moduleType.name}' imported by the module '${importingModule.name}'. Please add an @NgModule annotation.`);\n }\n }\n else {\n ngModuleDef = getNgModuleDefOrThrow(moduleType);\n }\n const errors = [];\n const declarations = maybeUnwrapFn(ngModuleDef.declarations);\n const imports = maybeUnwrapFn(ngModuleDef.imports);\n flatten(imports)\n .map(unwrapModuleWithProvidersImports)\n .forEach((modOrStandaloneCmpt) => {\n verifySemanticsOfNgModuleImport(modOrStandaloneCmpt, moduleType);\n verifySemanticsOfNgModuleDef(modOrStandaloneCmpt, false, moduleType);\n });\n const exports = maybeUnwrapFn(ngModuleDef.exports);\n declarations.forEach(verifyDeclarationsHaveDefinitions);\n declarations.forEach(verifyDirectivesHaveSelector);\n declarations.forEach((declarationType) => verifyNotStandalone(declarationType, moduleType));\n const combinedDeclarations = [\n ...declarations.map(resolveForwardRef),\n ...flatten(imports.map(computeCombinedExports)).map(resolveForwardRef),\n ];\n exports.forEach(verifyExportsAreDeclaredOrReExported);\n declarations.forEach((decl) => verifyDeclarationIsUnique(decl, allowDuplicateDeclarationsInRoot));\n const ngModule = getAnnotation(moduleType, 'NgModule');\n if (ngModule) {\n ngModule.imports &&\n flatten(ngModule.imports)\n .map(unwrapModuleWithProvidersImports)\n .forEach((mod) => {\n verifySemanticsOfNgModuleImport(mod, moduleType);\n verifySemanticsOfNgModuleDef(mod, false, moduleType);\n });\n ngModule.bootstrap && deepForEach(ngModule.bootstrap, verifyCorrectBootstrapType);\n ngModule.bootstrap && deepForEach(ngModule.bootstrap, verifyComponentIsPartOfNgModule);\n }\n // Throw Error if any errors were detected.\n if (errors.length) {\n throw new Error(errors.join('\\n'));\n }\n ////////////////////////////////////////////////////////////////////////////////////////////////\n function verifyDeclarationsHaveDefinitions(type) {\n type = resolveForwardRef(type);\n const def = getComponentDef(type) || getDirectiveDef(type) || getPipeDef$1(type);\n if (!def) {\n errors.push(`Unexpected value '${stringifyForError(type)}' declared by the module '${stringifyForError(moduleType)}'. Please add a @Pipe/@Directive/@Component annotation.`);\n }\n }\n function verifyDirectivesHaveSelector(type) {\n type = resolveForwardRef(type);\n const def = getDirectiveDef(type);\n if (!getComponentDef(type) && def && def.selectors.length == 0) {\n errors.push(`Directive ${stringifyForError(type)} has no selector, please add it!`);\n }\n }\n function verifyNotStandalone(type, moduleType) {\n type = resolveForwardRef(type);\n const def = getComponentDef(type) || getDirectiveDef(type) || getPipeDef$1(type);\n if (def?.standalone) {\n const location = `\"${stringifyForError(moduleType)}\" NgModule`;\n errors.push(generateStandaloneInDeclarationsError(type, location));\n }\n }\n function verifyExportsAreDeclaredOrReExported(type) {\n type = resolveForwardRef(type);\n const kind = (getComponentDef(type) && 'component') ||\n (getDirectiveDef(type) && 'directive') ||\n (getPipeDef$1(type) && 'pipe');\n if (kind) {\n // only checked if we are declared as Component, Directive, or Pipe\n // Modules don't need to be declared or imported.\n if (combinedDeclarations.lastIndexOf(type) === -1) {\n // We are exporting something which we don't explicitly declare or import.\n errors.push(`Can't export ${kind} ${stringifyForError(type)} from ${stringifyForError(moduleType)} as it was neither declared nor imported!`);\n }\n }\n }\n function verifyDeclarationIsUnique(type, suppressErrors) {\n type = resolveForwardRef(type);\n const existingModule = ownerNgModule.get(type);\n if (existingModule && existingModule !== moduleType) {\n if (!suppressErrors) {\n const modules = [existingModule, moduleType].map(stringifyForError).sort();\n errors.push(`Type ${stringifyForError(type)} is part of the declarations of 2 modules: ${modules[0]} and ${modules[1]}! ` +\n `Please consider moving ${stringifyForError(type)} to a higher module that imports ${modules[0]} and ${modules[1]}. ` +\n `You can also create a new NgModule that exports and includes ${stringifyForError(type)} then import that NgModule in ${modules[0]} and ${modules[1]}.`);\n }\n }\n else {\n // Mark type as having owner.\n ownerNgModule.set(type, moduleType);\n }\n }\n function verifyComponentIsPartOfNgModule(type) {\n type = resolveForwardRef(type);\n const existingModule = ownerNgModule.get(type);\n if (!existingModule && !isStandalone(type)) {\n errors.push(`Component ${stringifyForError(type)} is not part of any NgModule or the module has not been imported into your module.`);\n }\n }\n function verifyCorrectBootstrapType(type) {\n type = resolveForwardRef(type);\n if (!getComponentDef(type)) {\n errors.push(`${stringifyForError(type)} cannot be used as an entry component.`);\n }\n if (isStandalone(type)) {\n // Note: this error should be the same as the\n // `NGMODULE_BOOTSTRAP_IS_STANDALONE` one in AOT compiler.\n errors.push(`The \\`${stringifyForError(type)}\\` class is a standalone component, which can ` +\n `not be used in the \\`@NgModule.bootstrap\\` array. Use the \\`bootstrapApplication\\` ` +\n `function for bootstrap instead.`);\n }\n }\n function verifySemanticsOfNgModuleImport(type, importingModule) {\n type = resolveForwardRef(type);\n const directiveDef = getComponentDef(type) || getDirectiveDef(type);\n if (directiveDef !== null && !directiveDef.standalone) {\n throw new Error(`Unexpected directive '${type.name}' imported by the module '${importingModule.name}'. Please add an @NgModule annotation.`);\n }\n const pipeDef = getPipeDef$1(type);\n if (pipeDef !== null && !pipeDef.standalone) {\n throw new Error(`Unexpected pipe '${type.name}' imported by the module '${importingModule.name}'. Please add an @NgModule annotation.`);\n }\n }\n}\nfunction unwrapModuleWithProvidersImports(typeOrWithProviders) {\n typeOrWithProviders = resolveForwardRef(typeOrWithProviders);\n return typeOrWithProviders.ngModule || typeOrWithProviders;\n}\nfunction getAnnotation(type, name) {\n let annotation = null;\n collect(type.__annotations__);\n collect(type.decorators);\n return annotation;\n function collect(annotations) {\n if (annotations) {\n annotations.forEach(readAnnotation);\n }\n }\n function readAnnotation(decorator) {\n if (!annotation) {\n const proto = Object.getPrototypeOf(decorator);\n if (proto.ngMetadataName == name) {\n annotation = decorator;\n }\n else if (decorator.type) {\n const proto = Object.getPrototypeOf(decorator.type);\n if (proto.ngMetadataName == name) {\n annotation = decorator.args[0];\n }\n }\n }\n }\n}\n/**\n * Keep track of compiled components. This is needed because in tests we often want to compile the\n * same component with more than one NgModule. This would cause an error unless we reset which\n * NgModule the component belongs to. We keep the list of compiled components here so that the\n * TestBed can reset it later.\n */\nlet ownerNgModule = new WeakMap();\nlet verifiedNgModule = new WeakMap();\nfunction resetCompiledComponents() {\n ownerNgModule = new WeakMap();\n verifiedNgModule = new WeakMap();\n moduleQueue.length = 0;\n GENERATED_COMP_IDS.clear();\n}\n/**\n * Computes the combined declarations of explicit declarations, as well as declarations inherited by\n * traversing the exports of imported modules.\n * @param type\n */\nfunction computeCombinedExports(type) {\n type = resolveForwardRef(type);\n const ngModuleDef = getNgModuleDef(type);\n // a standalone component, directive or pipe\n if (ngModuleDef === null) {\n return [type];\n }\n return flatten(maybeUnwrapFn(ngModuleDef.exports).map((type) => {\n const ngModuleDef = getNgModuleDef(type);\n if (ngModuleDef) {\n verifySemanticsOfNgModuleDef(type, false);\n return computeCombinedExports(type);\n }\n else {\n return type;\n }\n }));\n}\n/**\n * Some declared components may be compiled asynchronously, and thus may not have their\n * ɵcmp set yet. If this is the case, then a reference to the module is written into\n * the `ngSelectorScope` property of the declared type.\n */\nfunction setScopeOnDeclaredComponents(moduleType, ngModule) {\n const declarations = flatten(ngModule.declarations || EMPTY_ARRAY);\n const transitiveScopes = transitiveScopesFor(moduleType);\n declarations.forEach((declaration) => {\n declaration = resolveForwardRef(declaration);\n if (declaration.hasOwnProperty(NG_COMP_DEF)) {\n // A `ɵcmp` field exists - go ahead and patch the component directly.\n const component = declaration;\n const componentDef = getComponentDef(component);\n patchComponentDefWithScope(componentDef, transitiveScopes);\n }\n else if (!declaration.hasOwnProperty(NG_DIR_DEF) &&\n !declaration.hasOwnProperty(NG_PIPE_DEF)) {\n // Set `ngSelectorScope` for future reference when the component compilation finishes.\n declaration.ngSelectorScope = moduleType;\n }\n });\n}\n/**\n * Patch the definition of a component with directives and pipes from the compilation scope of\n * a given module.\n */\nfunction patchComponentDefWithScope(componentDef, transitiveScopes) {\n componentDef.directiveDefs = () => Array.from(transitiveScopes.compilation.directives)\n .map((dir) => dir.hasOwnProperty(NG_COMP_DEF) ? getComponentDef(dir) : getDirectiveDef(dir))\n .filter((def) => !!def);\n componentDef.pipeDefs = () => Array.from(transitiveScopes.compilation.pipes).map((pipe) => getPipeDef$1(pipe));\n componentDef.schemas = transitiveScopes.schemas;\n // Since we avoid Components/Directives/Pipes recompiling in case there are no overrides, we\n // may face a problem where previously compiled defs available to a given Component/Directive\n // are cached in TView and may become stale (in case any of these defs gets recompiled). In\n // order to avoid this problem, we force fresh TView to be created.\n componentDef.tView = null;\n}\n/**\n * Compute the pair of transitive scopes (compilation scope and exported scope) for a given type\n * (either a NgModule or a standalone component / directive / pipe).\n */\nfunction transitiveScopesFor(type) {\n if (isNgModule(type)) {\n const scope = depsTracker.getNgModuleScope(type);\n const def = getNgModuleDefOrThrow(type);\n return {\n schemas: def.schemas || null,\n ...scope,\n };\n }\n else if (isStandalone(type)) {\n const directiveDef = getComponentDef(type) || getDirectiveDef(type);\n if (directiveDef !== null) {\n return {\n schemas: null,\n compilation: {\n directives: new Set(),\n pipes: new Set(),\n },\n exported: {\n directives: new Set([type]),\n pipes: new Set(),\n },\n };\n }\n const pipeDef = getPipeDef$1(type);\n if (pipeDef !== null) {\n return {\n schemas: null,\n compilation: {\n directives: new Set(),\n pipes: new Set(),\n },\n exported: {\n directives: new Set(),\n pipes: new Set([type]),\n },\n };\n }\n }\n // TODO: change the error message to be more user-facing and take standalone into account\n throw new Error(`${type.name} does not have a module def (ɵmod property)`);\n}\nfunction expandModuleWithProviders(value) {\n if (isModuleWithProviders(value)) {\n return value.ngModule;\n }\n return value;\n}\n\n/**\n * Keep track of the compilation depth to avoid reentrancy issues during JIT compilation. This\n * matters in the following scenario:\n *\n * Consider a component 'A' that extends component 'B', both declared in module 'M'. During\n * the compilation of 'A' the definition of 'B' is requested to capture the inheritance chain,\n * potentially triggering compilation of 'B'. If this nested compilation were to trigger\n * `flushModuleScopingQueueAsMuchAsPossible` it may happen that module 'M' is still pending in the\n * queue, resulting in 'A' and 'B' to be patched with the NgModule scope. As the compilation of\n * 'A' is still in progress, this would introduce a circular dependency on its compilation. To avoid\n * this issue, the module scope queue is only flushed for compilations at the depth 0, to ensure\n * all compilations have finished.\n */\nlet compilationDepth = 0;\n/**\n * Compile an Angular component according to its decorator metadata, and patch the resulting\n * component def (ɵcmp) onto the component type.\n *\n * Compilation may be asynchronous (due to the need to resolve URLs for the component template or\n * other resources, for example). In the event that compilation is not immediate, `compileComponent`\n * will enqueue resource resolution into a global queue and will fail to return the `ɵcmp`\n * until the global queue has been resolved with a call to `resolveComponentResources`.\n */\nfunction compileComponent(type, metadata) {\n // Initialize ngDevMode. This must be the first statement in compileComponent.\n // See the `initNgDevMode` docstring for more information.\n (typeof ngDevMode === 'undefined' || ngDevMode) && initNgDevMode();\n let ngComponentDef = null;\n // Metadata may have resources which need to be resolved.\n maybeQueueResolutionOfComponentResources(type, metadata);\n // Note that we're using the same function as `Directive`, because that's only subset of metadata\n // that we need to create the ngFactoryDef. We're avoiding using the component metadata\n // because we'd have to resolve the asynchronous templates.\n addDirectiveFactoryDef(type, metadata);\n Object.defineProperty(type, NG_COMP_DEF, {\n get: () => {\n if (ngComponentDef === null) {\n const compiler = getCompilerFacade({\n usage: 0 /* JitCompilerUsage.Decorator */,\n kind: 'component',\n type: type,\n });\n if (componentNeedsResolution(metadata)) {\n const error = [`Component '${type.name}' is not resolved:`];\n if (metadata.templateUrl) {\n error.push(` - templateUrl: ${metadata.templateUrl}`);\n }\n if (metadata.styleUrls && metadata.styleUrls.length) {\n error.push(` - styleUrls: ${JSON.stringify(metadata.styleUrls)}`);\n }\n if (metadata.styleUrl) {\n error.push(` - styleUrl: ${metadata.styleUrl}`);\n }\n error.push(`Did you run and wait for 'resolveComponentResources()'?`);\n throw new Error(error.join('\\n'));\n }\n // This const was called `jitOptions` previously but had to be renamed to `options` because\n // of a bug with Terser that caused optimized JIT builds to throw a `ReferenceError`.\n // This bug was investigated in https://github.com/angular/angular-cli/issues/17264.\n // We should not rename it back until https://github.com/terser/terser/issues/615 is fixed.\n const options = getJitOptions();\n let preserveWhitespaces = metadata.preserveWhitespaces;\n if (preserveWhitespaces === undefined) {\n if (options !== null && options.preserveWhitespaces !== undefined) {\n preserveWhitespaces = options.preserveWhitespaces;\n }\n else {\n preserveWhitespaces = false;\n }\n }\n let encapsulation = metadata.encapsulation;\n if (encapsulation === undefined) {\n if (options !== null && options.defaultEncapsulation !== undefined) {\n encapsulation = options.defaultEncapsulation;\n }\n else {\n encapsulation = ViewEncapsulation.Emulated;\n }\n }\n const templateUrl = metadata.templateUrl || `ng:///${type.name}/template.html`;\n const baseMeta = directiveMetadata(type, metadata);\n const meta = {\n ...baseMeta,\n typeSourceSpan: compiler.createParseSourceSpan('Component', type.name, templateUrl),\n template: metadata.template || '',\n preserveWhitespaces,\n styles: typeof metadata.styles === 'string'\n ? [metadata.styles]\n : metadata.styles || EMPTY_ARRAY,\n animations: metadata.animations,\n // JIT components are always compiled against an empty set of `declarations`. Instead, the\n // `directiveDefs` and `pipeDefs` are updated at a later point:\n // * for NgModule-based components, they're set when the NgModule which declares the\n // component resolves in the module scoping queue\n // * for standalone components, they're set just below, after `compileComponent`.\n declarations: [],\n changeDetection: metadata.changeDetection,\n encapsulation,\n interpolation: metadata.interpolation,\n viewProviders: metadata.viewProviders || null,\n // We can't inspect whether any of the dependencies are actually directives, because they\n // get patched on after compilation. That's why in JIT mode we consider that any\n // dependency might be a directive dependency.\n hasDirectiveDependencies: !baseMeta.isStandalone || (metadata.imports != null && metadata.imports.length > 0),\n };\n compilationDepth++;\n try {\n if (meta.usesInheritance) {\n addDirectiveDefToUndecoratedParents(type);\n }\n ngComponentDef = compiler.compileComponent(angularCoreEnv, templateUrl, meta);\n if (meta.isStandalone) {\n // Patch the component definition for standalone components with `directiveDefs` and\n // `pipeDefs` functions which lazily compute the directives/pipes available in the\n // standalone component. Also set `dependencies` to the lazily resolved list of imports.\n const imports = flatten(metadata.imports || EMPTY_ARRAY);\n const { directiveDefs, pipeDefs } = getStandaloneDefFunctions(type, imports);\n ngComponentDef.directiveDefs = directiveDefs;\n ngComponentDef.pipeDefs = pipeDefs;\n ngComponentDef.dependencies = () => imports.map(resolveForwardRef);\n }\n }\n finally {\n // Ensure that the compilation depth is decremented even when the compilation failed.\n compilationDepth--;\n }\n if (compilationDepth === 0) {\n // When NgModule decorator executed, we enqueued the module definition such that\n // it would only dequeue and add itself as module scope to all of its declarations,\n // but only if if all of its declarations had resolved. This call runs the check\n // to see if any modules that are in the queue can be dequeued and add scope to\n // their declarations.\n flushModuleScopingQueueAsMuchAsPossible();\n }\n // If component compilation is async, then the @NgModule annotation which declares the\n // component may execute and set an ngSelectorScope property on the component type. This\n // allows the component to patch itself with directiveDefs from the module after it\n // finishes compiling.\n if (hasSelectorScope(type)) {\n const scopes = transitiveScopesFor(type.ngSelectorScope);\n patchComponentDefWithScope(ngComponentDef, scopes);\n }\n if (metadata.schemas) {\n if (meta.isStandalone) {\n ngComponentDef.schemas = metadata.schemas;\n }\n else {\n throw new Error(`The 'schemas' was specified for the ${stringifyForError(type)} but is only valid on a component that is standalone.`);\n }\n }\n else if (meta.isStandalone) {\n ngComponentDef.schemas = [];\n }\n }\n return ngComponentDef;\n },\n set: (def) => {\n ngComponentDef = def;\n },\n // Make the property configurable in dev mode to allow overriding in tests\n configurable: !!ngDevMode,\n });\n}\n/**\n * Build memoized `directiveDefs` and `pipeDefs` functions for the component definition of a\n * standalone component, which process `imports` and filter out directives and pipes. The use of\n * memoized functions here allows for the delayed resolution of any `forwardRef`s present in the\n * component's `imports`.\n */\nfunction getStandaloneDefFunctions(type, imports) {\n const directiveDefs = () => {\n if (ngDevMode) {\n for (const rawDep of imports) {\n verifyStandaloneImport(rawDep, type);\n }\n }\n if (!isComponent(type)) {\n return [];\n }\n const scope = depsTracker.getStandaloneComponentScope(type, imports);\n return [...scope.compilation.directives]\n .map((p) => (getComponentDef(p) || getDirectiveDef(p)))\n .filter((d) => d !== null);\n };\n const pipeDefs = () => {\n if (ngDevMode) {\n for (const rawDep of imports) {\n verifyStandaloneImport(rawDep, type);\n }\n }\n if (!isComponent(type)) {\n return [];\n }\n const scope = depsTracker.getStandaloneComponentScope(type, imports);\n return [...scope.compilation.pipes].map((p) => getPipeDef$1(p)).filter((d) => d !== null);\n };\n return {\n directiveDefs,\n pipeDefs,\n };\n}\nfunction hasSelectorScope(component) {\n return component.ngSelectorScope !== undefined;\n}\n/**\n * Compile an Angular directive according to its decorator metadata, and patch the resulting\n * directive def onto the component type.\n *\n * In the event that compilation is not immediate, `compileDirective` will return a `Promise` which\n * will resolve when compilation completes and the directive becomes usable.\n */\nfunction compileDirective(type, directive) {\n let ngDirectiveDef = null;\n addDirectiveFactoryDef(type, directive || {});\n Object.defineProperty(type, NG_DIR_DEF, {\n get: () => {\n if (ngDirectiveDef === null) {\n // `directive` can be null in the case of abstract directives as a base class\n // that use `@Directive()` with no selector. In that case, pass empty object to the\n // `directiveMetadata` function instead of null.\n const meta = getDirectiveMetadata(type, directive || {});\n const compiler = getCompilerFacade({\n usage: 0 /* JitCompilerUsage.Decorator */,\n kind: 'directive',\n type,\n });\n ngDirectiveDef = compiler.compileDirective(angularCoreEnv, meta.sourceMapUrl, meta.metadata);\n }\n return ngDirectiveDef;\n },\n // Make the property configurable in dev mode to allow overriding in tests\n configurable: !!ngDevMode,\n });\n}\nfunction getDirectiveMetadata(type, metadata) {\n const name = type && type.name;\n const sourceMapUrl = `ng:///${name}/ɵdir.js`;\n const compiler = getCompilerFacade({ usage: 0 /* JitCompilerUsage.Decorator */, kind: 'directive', type });\n const facade = directiveMetadata(type, metadata);\n facade.typeSourceSpan = compiler.createParseSourceSpan('Directive', name, sourceMapUrl);\n if (facade.usesInheritance) {\n addDirectiveDefToUndecoratedParents(type);\n }\n return { metadata: facade, sourceMapUrl };\n}\nfunction addDirectiveFactoryDef(type, metadata) {\n let ngFactoryDef = null;\n Object.defineProperty(type, NG_FACTORY_DEF, {\n get: () => {\n if (ngFactoryDef === null) {\n const meta = getDirectiveMetadata(type, metadata);\n const compiler = getCompilerFacade({\n usage: 0 /* JitCompilerUsage.Decorator */,\n kind: 'directive',\n type,\n });\n ngFactoryDef = compiler.compileFactory(angularCoreEnv, `ng:///${type.name}/ɵfac.js`, {\n name: meta.metadata.name,\n type: meta.metadata.type,\n typeArgumentCount: 0,\n deps: reflectDependencies(type),\n target: compiler.FactoryTarget.Directive,\n });\n }\n return ngFactoryDef;\n },\n // Make the property configurable in dev mode to allow overriding in tests\n configurable: !!ngDevMode,\n });\n}\nfunction extendsDirectlyFromObject(type) {\n return Object.getPrototypeOf(type.prototype) === Object.prototype;\n}\n/**\n * Extract the `R3DirectiveMetadata` for a particular directive (either a `Directive` or a\n * `Component`).\n */\nfunction directiveMetadata(type, metadata) {\n // Reflect inputs and outputs.\n const reflect = getReflect();\n const propMetadata = reflect.ownPropMetadata(type);\n return {\n name: type.name,\n type: type,\n selector: metadata.selector !== undefined ? metadata.selector : null,\n host: metadata.host || EMPTY_OBJ,\n propMetadata: propMetadata,\n inputs: metadata.inputs || EMPTY_ARRAY,\n outputs: metadata.outputs || EMPTY_ARRAY,\n queries: extractQueriesMetadata(type, propMetadata, isContentQuery),\n lifecycle: { usesOnChanges: reflect.hasLifecycleHook(type, 'ngOnChanges') },\n typeSourceSpan: null,\n usesInheritance: !extendsDirectlyFromObject(type),\n exportAs: extractExportAs(metadata.exportAs),\n providers: metadata.providers || null,\n viewQueries: extractQueriesMetadata(type, propMetadata, isViewQuery),\n isStandalone: metadata.standalone === undefined ? true : !!metadata.standalone,\n isSignal: !!metadata.signals,\n hostDirectives: metadata.hostDirectives?.map((directive) => typeof directive === 'function' ? { directive } : directive) || null,\n };\n}\n/**\n * Adds a directive definition to all parent classes of a type that don't have an Angular decorator.\n */\nfunction addDirectiveDefToUndecoratedParents(type) {\n const objPrototype = Object.prototype;\n let parent = Object.getPrototypeOf(type.prototype).constructor;\n // Go up the prototype until we hit `Object`.\n while (parent && parent !== objPrototype) {\n // Since inheritance works if the class was annotated already, we only need to add\n // the def if there are no annotations and the def hasn't been created already.\n if (!getDirectiveDef(parent) &&\n !getComponentDef(parent) &&\n shouldAddAbstractDirective(parent)) {\n compileDirective(parent, null);\n }\n parent = Object.getPrototypeOf(parent);\n }\n}\nfunction convertToR3QueryPredicate(selector) {\n return typeof selector === 'string' ? splitByComma(selector) : resolveForwardRef(selector);\n}\nfunction convertToR3QueryMetadata(propertyName, ann) {\n return {\n propertyName: propertyName,\n predicate: convertToR3QueryPredicate(ann.selector),\n descendants: ann.descendants,\n first: ann.first,\n read: ann.read ? ann.read : null,\n static: !!ann.static,\n emitDistinctChangesOnly: !!ann.emitDistinctChangesOnly,\n isSignal: !!ann.isSignal,\n };\n}\nfunction extractQueriesMetadata(type, propMetadata, isQueryAnn) {\n const queriesMeta = [];\n for (const field in propMetadata) {\n if (propMetadata.hasOwnProperty(field)) {\n const annotations = propMetadata[field];\n annotations.forEach((ann) => {\n if (isQueryAnn(ann)) {\n if (!ann.selector) {\n throw new Error(`Can't construct a query for the property \"${field}\" of ` +\n `\"${stringifyForError(type)}\" since the query selector wasn't defined.`);\n }\n if (annotations.some(isInputAnnotation)) {\n throw new Error(`Cannot combine @Input decorators with query decorators`);\n }\n queriesMeta.push(convertToR3QueryMetadata(field, ann));\n }\n });\n }\n }\n return queriesMeta;\n}\nfunction extractExportAs(exportAs) {\n return exportAs === undefined ? null : splitByComma(exportAs);\n}\nfunction isContentQuery(value) {\n const name = value.ngMetadataName;\n return name === 'ContentChild' || name === 'ContentChildren';\n}\nfunction isViewQuery(value) {\n const name = value.ngMetadataName;\n return name === 'ViewChild' || name === 'ViewChildren';\n}\nfunction isInputAnnotation(value) {\n return value.ngMetadataName === 'Input';\n}\nfunction splitByComma(value) {\n return value.split(',').map((piece) => piece.trim());\n}\nconst LIFECYCLE_HOOKS = [\n 'ngOnChanges',\n 'ngOnInit',\n 'ngOnDestroy',\n 'ngDoCheck',\n 'ngAfterViewInit',\n 'ngAfterViewChecked',\n 'ngAfterContentInit',\n 'ngAfterContentChecked',\n];\nfunction shouldAddAbstractDirective(type) {\n const reflect = getReflect();\n if (LIFECYCLE_HOOKS.some((hookName) => reflect.hasLifecycleHook(type, hookName))) {\n return true;\n }\n const propMetadata = reflect.propMetadata(type);\n for (const field in propMetadata) {\n const annotations = propMetadata[field];\n for (let i = 0; i < annotations.length; i++) {\n const current = annotations[i];\n const metadataName = current.ngMetadataName;\n if (isInputAnnotation(current) ||\n isContentQuery(current) ||\n isViewQuery(current) ||\n metadataName === 'Output' ||\n metadataName === 'HostBinding' ||\n metadataName === 'HostListener') {\n return true;\n }\n }\n }\n return false;\n}\n\nfunction compilePipe(type, meta) {\n let ngPipeDef = null;\n let ngFactoryDef = null;\n Object.defineProperty(type, NG_FACTORY_DEF, {\n get: () => {\n if (ngFactoryDef === null) {\n const metadata = getPipeMetadata(type, meta);\n const compiler = getCompilerFacade({\n usage: 0 /* JitCompilerUsage.Decorator */,\n kind: 'pipe',\n type: metadata.type,\n });\n ngFactoryDef = compiler.compileFactory(angularCoreEnv, `ng:///${metadata.name}/ɵfac.js`, {\n name: metadata.name,\n type: metadata.type,\n typeArgumentCount: 0,\n deps: reflectDependencies(type),\n target: compiler.FactoryTarget.Pipe,\n });\n }\n return ngFactoryDef;\n },\n // Make the property configurable in dev mode to allow overriding in tests\n configurable: !!ngDevMode,\n });\n Object.defineProperty(type, NG_PIPE_DEF, {\n get: () => {\n if (ngPipeDef === null) {\n const metadata = getPipeMetadata(type, meta);\n const compiler = getCompilerFacade({\n usage: 0 /* JitCompilerUsage.Decorator */,\n kind: 'pipe',\n type: metadata.type,\n });\n ngPipeDef = compiler.compilePipe(angularCoreEnv, `ng:///${metadata.name}/ɵpipe.js`, metadata);\n }\n return ngPipeDef;\n },\n // Make the property configurable in dev mode to allow overriding in tests\n configurable: !!ngDevMode,\n });\n}\nfunction getPipeMetadata(type, meta) {\n return {\n type: type,\n name: type.name,\n pipeName: meta.name,\n pure: meta.pure !== undefined ? meta.pure : true,\n isStandalone: meta.standalone === undefined ? true : !!meta.standalone,\n };\n}\n\n/**\n * Type of the Directive metadata.\n *\n * @publicApi\n */\nconst Directive = makeDecorator('Directive', (dir = {}) => dir, undefined, undefined, (type, meta) => compileDirective(type, meta));\n/**\n * Component decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nconst Component = makeDecorator('Component', (c = {}) => ({ changeDetection: ChangeDetectionStrategy.Default, ...c }), Directive, undefined, (type, meta) => compileComponent(type, meta));\n/**\n * @Annotation\n * @publicApi\n */\nconst Pipe = makeDecorator('Pipe', (p) => ({ pure: true, ...p }), undefined, undefined, (type, meta) => compilePipe(type, meta));\n/**\n * @Annotation\n * @publicApi\n */\nconst Input = makePropDecorator('Input', (arg) => {\n if (!arg) {\n return {};\n }\n return typeof arg === 'string' ? { alias: arg } : arg;\n});\n/**\n * @Annotation\n * @publicApi\n */\nconst Output = makePropDecorator('Output', (alias) => ({ alias }));\n/**\n * @Annotation\n * @publicApi\n */\nconst HostBinding = makePropDecorator('HostBinding', (hostPropertyName) => ({ hostPropertyName }));\n/**\n * @Annotation\n * @publicApi\n */\nconst HostListener = makePropDecorator('HostListener', (eventName, args) => ({ eventName, args }));\n\n/**\n * @Annotation\n */\nconst NgModule = makeDecorator('NgModule', (ngModule) => ngModule, undefined, undefined, \n/**\n * Decorator that marks the following class as an NgModule, and supplies\n * configuration metadata for it.\n *\n * * The `declarations` option configures the compiler\n * with information about what belongs to the NgModule.\n * * The `providers` options configures the NgModule's injector to provide\n * dependencies the NgModule members.\n * * The `imports` and `exports` options bring in members from other modules, and make\n * this module's members available to others.\n */\n(type, meta) => compileNgModule(type, meta));\n\n/**\n * Combination of NgModuleFactory and ComponentFactories.\n *\n * @publicApi\n *\n * @deprecated\n * Ivy JIT mode doesn't require accessing this symbol.\n */\nclass ModuleWithComponentFactories {\n ngModuleFactory;\n componentFactories;\n constructor(ngModuleFactory, componentFactories) {\n this.ngModuleFactory = ngModuleFactory;\n this.componentFactories = componentFactories;\n }\n}\n/**\n * Low-level service for running the angular compiler during runtime\n * to create {@link ComponentFactory}s, which\n * can later be used to create and render a Component instance.\n *\n * Each `@NgModule` provides an own `Compiler` to its injector,\n * that will use the directives/pipes of the ng module for compilation\n * of components.\n *\n * @publicApi\n *\n * @deprecated\n * Ivy JIT mode doesn't require accessing this symbol.\n */\nclass Compiler {\n /**\n * Compiles the given NgModule and all of its components. All templates of the components\n * have to be inlined.\n */\n compileModuleSync(moduleType) {\n return new NgModuleFactory(moduleType);\n }\n /**\n * Compiles the given NgModule and all of its components\n */\n compileModuleAsync(moduleType) {\n return Promise.resolve(this.compileModuleSync(moduleType));\n }\n /**\n * Same as {@link Compiler#compileModuleSync compileModuleSync} but also creates ComponentFactories for all components.\n */\n compileModuleAndAllComponentsSync(moduleType) {\n const ngModuleFactory = this.compileModuleSync(moduleType);\n const moduleDef = getNgModuleDef(moduleType);\n const componentFactories = maybeUnwrapFn(moduleDef.declarations).reduce((factories, declaration) => {\n const componentDef = getComponentDef(declaration);\n componentDef && factories.push(new ComponentFactory(componentDef));\n return factories;\n }, []);\n return new ModuleWithComponentFactories(ngModuleFactory, componentFactories);\n }\n /**\n * Same as {@link Compiler#compileModuleAsync compileModuleAsync} but also creates ComponentFactories for all components.\n */\n compileModuleAndAllComponentsAsync(moduleType) {\n return Promise.resolve(this.compileModuleAndAllComponentsSync(moduleType));\n }\n /**\n * Clears all caches.\n */\n clearCache() { }\n /**\n * Clears the cache for the given component/ngModule.\n */\n clearCacheFor(type) { }\n /**\n * Returns the id for a given NgModule, if one is defined and known to the compiler.\n */\n getModuleId(moduleType) {\n return undefined;\n }\n static ɵfac = function Compiler_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || Compiler)(); };\n static ɵprov = /*@__PURE__*/ __defineInjectable({ token: Compiler, factory: Compiler.ɵfac, providedIn: 'root' });\n}\n(() => { (typeof ngDevMode === \"undefined\" || ngDevMode) && setClassMetadata(Compiler, [{\n type: Injectable,\n args: [{ providedIn: 'root' }]\n }], null, null); })();\n/**\n * Token to provide CompilerOptions in the platform injector.\n *\n * @publicApi\n */\nconst COMPILER_OPTIONS = new InjectionToken(ngDevMode ? 'compilerOptions' : '');\n/**\n * A factory for creating a Compiler\n *\n * @publicApi\n *\n * @deprecated\n * Ivy JIT mode doesn't require accessing this symbol.\n */\nclass CompilerFactory {\n}\n\nclass NgZoneChangeDetectionScheduler {\n zone = inject(NgZone);\n changeDetectionScheduler = inject(ChangeDetectionScheduler);\n applicationRef = inject(ApplicationRef);\n applicationErrorHandler = inject(INTERNAL_APPLICATION_ERROR_HANDLER);\n _onMicrotaskEmptySubscription;\n initialize() {\n if (this._onMicrotaskEmptySubscription) {\n return;\n }\n this._onMicrotaskEmptySubscription = this.zone.onMicrotaskEmpty.subscribe({\n next: () => {\n // `onMicroTaskEmpty` can happen _during_ the zoneless scheduler change detection because\n // zone.run(() => {}) will result in `checkStable` at the end of the `zone.run` closure\n // and emit `onMicrotaskEmpty` synchronously if run coalsecing is false.\n if (this.changeDetectionScheduler.runningTick) {\n return;\n }\n this.zone.run(() => {\n try {\n this.applicationRef.dirtyFlags |= 1 /* ApplicationRefDirtyFlags.ViewTreeGlobal */;\n this.applicationRef._tick();\n }\n catch (e) {\n this.applicationErrorHandler(e);\n }\n });\n },\n });\n }\n ngOnDestroy() {\n this._onMicrotaskEmptySubscription?.unsubscribe();\n }\n static ɵfac = function NgZoneChangeDetectionScheduler_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || NgZoneChangeDetectionScheduler)(); };\n static ɵprov = /*@__PURE__*/ __defineInjectable({ token: NgZoneChangeDetectionScheduler, factory: NgZoneChangeDetectionScheduler.ɵfac, providedIn: 'root' });\n}\n(() => { (typeof ngDevMode === \"undefined\" || ngDevMode) && setClassMetadata(NgZoneChangeDetectionScheduler, [{\n type: Injectable,\n args: [{ providedIn: 'root' }]\n }], null, null); })();\n/**\n * Internal token used to verify that `provideZoneChangeDetection` is not used\n * with the bootstrapModule API.\n */\nconst PROVIDED_NG_ZONE = new InjectionToken(typeof ngDevMode === 'undefined' || ngDevMode ? 'provideZoneChangeDetection token' : '', { factory: () => false });\nfunction internalProvideZoneChangeDetection({ ngZoneFactory, ignoreChangesOutsideZone, scheduleInRootZone, }) {\n ngZoneFactory ??= () => new NgZone({ ...getNgZoneOptions(), scheduleInRootZone });\n return [\n { provide: NgZone, useFactory: ngZoneFactory },\n {\n provide: ENVIRONMENT_INITIALIZER,\n multi: true,\n useFactory: () => {\n const ngZoneChangeDetectionScheduler = inject(NgZoneChangeDetectionScheduler, {\n optional: true,\n });\n if ((typeof ngDevMode === 'undefined' || ngDevMode) &&\n ngZoneChangeDetectionScheduler === null) {\n throw new RuntimeError(402 /* RuntimeErrorCode.MISSING_REQUIRED_INJECTABLE_IN_BOOTSTRAP */, `A required Injectable was not found in the dependency injection tree. ` +\n 'If you are bootstrapping an NgModule, make sure that the `BrowserModule` is imported.');\n }\n return () => ngZoneChangeDetectionScheduler.initialize();\n },\n },\n {\n provide: ENVIRONMENT_INITIALIZER,\n multi: true,\n useFactory: () => {\n const service = inject(ZoneStablePendingTask);\n return () => {\n service.initialize();\n };\n },\n },\n // Always disable scheduler whenever explicitly disabled, even if another place called\n // `provideZoneChangeDetection` without the 'ignore' option.\n ignoreChangesOutsideZone === true ? { provide: ZONELESS_SCHEDULER_DISABLED, useValue: true } : [],\n {\n provide: SCHEDULE_IN_ROOT_ZONE,\n useValue: scheduleInRootZone ?? SCHEDULE_IN_ROOT_ZONE_DEFAULT,\n },\n {\n provide: INTERNAL_APPLICATION_ERROR_HANDLER,\n useFactory: () => {\n const zone = inject(NgZone);\n const injector = inject(EnvironmentInjector);\n let userErrorHandler;\n return (e) => {\n zone.runOutsideAngular(() => {\n if (injector.destroyed && !userErrorHandler) {\n setTimeout(() => {\n throw e;\n });\n }\n else {\n userErrorHandler ??= injector.get(ErrorHandler);\n userErrorHandler.handleError(e);\n }\n });\n };\n },\n },\n ];\n}\n/**\n * Provides `NgZone`-based change detection for the application bootstrapped using\n * `bootstrapApplication`.\n *\n * `NgZone` is already provided in applications by default. This provider allows you to configure\n * options like `eventCoalescing` in the `NgZone`.\n * This provider is not available for `platformBrowser().bootstrapModule`, which uses\n * `BootstrapOptions` instead.\n *\n * @usageNotes\n * ```ts\n * bootstrapApplication(MyApp, {providers: [\n * provideZoneChangeDetection({eventCoalescing: true}),\n * ]});\n * ```\n *\n * @publicApi\n * @see {@link /api/platform-browser/bootstrapApplication bootstrapApplication}\n * @see {@link NgZoneOptions}\n */\nfunction provideZoneChangeDetection(options) {\n const ignoreChangesOutsideZone = options?.ignoreChangesOutsideZone;\n const scheduleInRootZone = options?.scheduleInRootZone;\n const zoneProviders = internalProvideZoneChangeDetection({\n ngZoneFactory: () => {\n const ngZoneOptions = getNgZoneOptions(options);\n ngZoneOptions.scheduleInRootZone = scheduleInRootZone;\n if (ngZoneOptions.shouldCoalesceEventChangeDetection) {\n performanceMarkFeature('NgZone_CoalesceEvent');\n }\n return new NgZone(ngZoneOptions);\n },\n ignoreChangesOutsideZone,\n scheduleInRootZone,\n });\n return makeEnvironmentProviders([\n { provide: PROVIDED_NG_ZONE, useValue: true },\n { provide: ZONELESS_ENABLED, useValue: false },\n zoneProviders,\n ]);\n}\n// Transforms a set of `BootstrapOptions` (supported by the NgModule-based bootstrap APIs) ->\n// `NgZoneOptions` that are recognized by the NgZone constructor. Passing no options will result in\n// a set of default options returned.\nfunction getNgZoneOptions(options) {\n return {\n enableLongStackTrace: typeof ngDevMode === 'undefined' ? false : !!ngDevMode,\n shouldCoalesceEventChangeDetection: options?.eventCoalescing ?? false,\n shouldCoalesceRunChangeDetection: options?.runCoalescing ?? false,\n };\n}\nclass ZoneStablePendingTask {\n subscription = new Subscription();\n initialized = false;\n zone = inject(NgZone);\n pendingTasks = inject(PendingTasksInternal);\n initialize() {\n if (this.initialized) {\n return;\n }\n this.initialized = true;\n let task = null;\n if (!this.zone.isStable && !this.zone.hasPendingMacrotasks && !this.zone.hasPendingMicrotasks) {\n task = this.pendingTasks.add();\n }\n this.zone.runOutsideAngular(() => {\n this.subscription.add(this.zone.onStable.subscribe(() => {\n NgZone.assertNotInAngularZone();\n // Check whether there are no pending macro/micro tasks in the next tick\n // to allow for NgZone to update the state.\n queueMicrotask(() => {\n if (task !== null &&\n !this.zone.hasPendingMacrotasks &&\n !this.zone.hasPendingMicrotasks) {\n this.pendingTasks.remove(task);\n task = null;\n }\n });\n }));\n });\n this.subscription.add(this.zone.onUnstable.subscribe(() => {\n NgZone.assertInAngularZone();\n task ??= this.pendingTasks.add();\n }));\n }\n ngOnDestroy() {\n this.subscription.unsubscribe();\n }\n static ɵfac = function ZoneStablePendingTask_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ZoneStablePendingTask)(); };\n static ɵprov = /*@__PURE__*/ __defineInjectable({ token: ZoneStablePendingTask, factory: ZoneStablePendingTask.ɵfac, providedIn: 'root' });\n}\n(() => { (typeof ngDevMode === \"undefined\" || ngDevMode) && setClassMetadata(ZoneStablePendingTask, [{\n type: Injectable,\n args: [{ providedIn: 'root' }]\n }], null, null); })();\n\nconst CONSECUTIVE_MICROTASK_NOTIFICATION_LIMIT = 100;\nlet consecutiveMicrotaskNotifications = 0;\nlet stackFromLastFewNotifications = [];\nfunction trackMicrotaskNotificationForDebugging() {\n consecutiveMicrotaskNotifications++;\n if (CONSECUTIVE_MICROTASK_NOTIFICATION_LIMIT - consecutiveMicrotaskNotifications < 5) {\n const stack = new Error().stack;\n if (stack) {\n stackFromLastFewNotifications.push(stack);\n }\n }\n if (consecutiveMicrotaskNotifications === CONSECUTIVE_MICROTASK_NOTIFICATION_LIMIT) {\n throw new RuntimeError(103 /* RuntimeErrorCode.INFINITE_CHANGE_DETECTION */, 'Angular could not stabilize because there were endless change notifications within the browser event loop. ' +\n 'The stack from the last several notifications: \\n' +\n stackFromLastFewNotifications.join('\\n'));\n }\n}\nclass ChangeDetectionSchedulerImpl {\n applicationErrorHandler = inject(INTERNAL_APPLICATION_ERROR_HANDLER);\n appRef = inject(ApplicationRef);\n taskService = inject(PendingTasksInternal);\n ngZone = inject(NgZone);\n zonelessEnabled = inject(ZONELESS_ENABLED);\n tracing = inject(TracingService, { optional: true });\n disableScheduling = inject(ZONELESS_SCHEDULER_DISABLED, { optional: true }) ?? false;\n zoneIsDefined = typeof Zone !== 'undefined' && !!Zone.root.run;\n schedulerTickApplyArgs = [{ data: { '__scheduler_tick__': true } }];\n subscriptions = new Subscription();\n angularZoneId = this.zoneIsDefined\n ? this.ngZone._inner?.get(angularZoneInstanceIdProperty)\n : null;\n scheduleInRootZone = !this.zonelessEnabled &&\n this.zoneIsDefined &&\n (inject(SCHEDULE_IN_ROOT_ZONE, { optional: true }) ?? false);\n cancelScheduledCallback = null;\n useMicrotaskScheduler = false;\n runningTick = false;\n pendingRenderTaskId = null;\n constructor() {\n this.subscriptions.add(this.appRef.afterTick.subscribe(() => {\n // If the scheduler isn't running a tick but the application ticked, that means\n // someone called ApplicationRef.tick manually. In this case, we should cancel\n // any change detections that had been scheduled so we don't run an extra one.\n if (!this.runningTick) {\n this.cleanup();\n }\n }));\n this.subscriptions.add(this.ngZone.onUnstable.subscribe(() => {\n // If the zone becomes unstable when we're not running tick (this happens from the zone.run),\n // we should cancel any scheduled change detection here because at this point we\n // know that the zone will stabilize at some point and run change detection itself.\n if (!this.runningTick) {\n this.cleanup();\n }\n }));\n // TODO(atscott): These conditions will need to change when zoneless is the default\n // Instead, they should flip to checking if ZoneJS scheduling is provided\n this.disableScheduling ||=\n !this.zonelessEnabled &&\n // NoopNgZone without enabling zoneless means no scheduling whatsoever\n (this.ngZone instanceof NoopNgZone ||\n // The same goes for the lack of Zone without enabling zoneless scheduling\n !this.zoneIsDefined);\n }\n notify(source) {\n if (!this.zonelessEnabled && source === 5 /* NotificationSource.Listener */) {\n // When the notification comes from a listener, we skip the notification unless the\n // application has enabled zoneless. Ideally, listeners wouldn't notify the scheduler at all\n // automatically. We do not know that a developer made a change in the listener callback that\n // requires an `ApplicationRef.tick` (synchronize templates / run render hooks). We do this\n // only for an easier migration from OnPush components to zoneless. Because listeners are\n // usually executed inside the Angular zone and listeners automatically call `markViewDirty`,\n // developers never needed to manually use `ChangeDetectorRef.markForCheck` or some other API\n // to make listener callbacks work correctly with `OnPush` components.\n return;\n }\n let force = false;\n switch (source) {\n case 0 /* NotificationSource.MarkAncestorsForTraversal */: {\n this.appRef.dirtyFlags |= 2 /* ApplicationRefDirtyFlags.ViewTreeTraversal */;\n break;\n }\n case 3 /* NotificationSource.DebugApplyChanges */:\n case 2 /* NotificationSource.DeferBlockStateUpdate */:\n case 4 /* NotificationSource.MarkForCheck */:\n case 5 /* NotificationSource.Listener */:\n case 1 /* NotificationSource.SetInput */: {\n this.appRef.dirtyFlags |= 4 /* ApplicationRefDirtyFlags.ViewTreeCheck */;\n break;\n }\n case 6 /* NotificationSource.CustomElement */: {\n // We use `ViewTreeTraversal` to ensure we refresh the element even if this is triggered\n // during CD. In practice this is a no-op since the elements code also calls via a\n // `markForRefresh()` API which sends `NotificationSource.MarkAncestorsForTraversal` anyway.\n this.appRef.dirtyFlags |= 2 /* ApplicationRefDirtyFlags.ViewTreeTraversal */;\n force = true;\n break;\n }\n case 12 /* NotificationSource.RootEffect */: {\n this.appRef.dirtyFlags |= 16 /* ApplicationRefDirtyFlags.RootEffects */;\n // Root effects still force a CD, even if the scheduler is disabled. This ensures that\n // effects always run, even when triggered from outside the zone when the scheduler is\n // otherwise disabled.\n force = true;\n break;\n }\n case 13 /* NotificationSource.ViewEffect */: {\n // This is technically a no-op, since view effects will also send a\n // `MarkAncestorsForTraversal` notification. Still, we set this for logical consistency.\n this.appRef.dirtyFlags |= 2 /* ApplicationRefDirtyFlags.ViewTreeTraversal */;\n // View effects still force a CD, even if the scheduler is disabled. This ensures that\n // effects always run, even when triggered from outside the zone when the scheduler is\n // otherwise disabled.\n force = true;\n break;\n }\n case 11 /* NotificationSource.PendingTaskRemoved */: {\n // Removing a pending task via the public API forces a scheduled tick, ensuring that\n // stability is async and delayed until there was at least an opportunity to run\n // application synchronization. This prevents some footguns when working with the\n // public API for pending tasks where developers attempt to update application state\n // immediately after removing the last task.\n force = true;\n break;\n }\n case 9 /* NotificationSource.ViewDetachedFromDOM */:\n case 8 /* NotificationSource.ViewAttached */:\n case 7 /* NotificationSource.RenderHook */:\n case 10 /* NotificationSource.AsyncAnimationsLoaded */:\n default: {\n // These notifications only schedule a tick but do not change whether we should refresh\n // views. Instead, we only need to run render hooks unless another notification from the\n // other set is also received before `tick` happens.\n this.appRef.dirtyFlags |= 8 /* ApplicationRefDirtyFlags.AfterRender */;\n }\n }\n // If not already defined, attempt to capture a tracing snapshot of this\n // notification so that the resulting CD run can be attributed to the\n // context which produced the notification.\n this.appRef.tracingSnapshot = this.tracing?.snapshot(this.appRef.tracingSnapshot) ?? null;\n if (!this.shouldScheduleTick(force)) {\n return;\n }\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n if (this.useMicrotaskScheduler) {\n trackMicrotaskNotificationForDebugging();\n }\n else {\n consecutiveMicrotaskNotifications = 0;\n stackFromLastFewNotifications.length = 0;\n }\n }\n const scheduleCallback = this.useMicrotaskScheduler\n ? scheduleCallbackWithMicrotask\n : scheduleCallbackWithRafRace;\n this.pendingRenderTaskId = this.taskService.add();\n if (this.scheduleInRootZone) {\n this.cancelScheduledCallback = Zone.root.run(() => scheduleCallback(() => this.tick()));\n }\n else {\n this.cancelScheduledCallback = this.ngZone.runOutsideAngular(() => scheduleCallback(() => this.tick()));\n }\n }\n shouldScheduleTick(force) {\n if ((this.disableScheduling && !force) || this.appRef.destroyed) {\n return false;\n }\n // already scheduled or running\n if (this.pendingRenderTaskId !== null || this.runningTick || this.appRef._runningTick) {\n return false;\n }\n // If we're inside the zone don't bother with scheduler. Zone will stabilize\n // eventually and run change detection.\n if (!this.zonelessEnabled &&\n this.zoneIsDefined &&\n Zone.current.get(angularZoneInstanceIdProperty + this.angularZoneId)) {\n return false;\n }\n return true;\n }\n /**\n * Calls ApplicationRef._tick inside the `NgZone`.\n *\n * Calling `tick` directly runs change detection and cancels any change detection that had been\n * scheduled previously.\n *\n * @param shouldRefreshViews Passed directly to `ApplicationRef._tick` and skips straight to\n * render hooks when `false`.\n */\n tick() {\n // When ngZone.run below exits, onMicrotaskEmpty may emit if the zone is\n // stable. We want to prevent double ticking so we track whether the tick is\n // already running and skip it if so.\n if (this.runningTick || this.appRef.destroyed) {\n return;\n }\n // If we reach the tick and there is no work to be done in ApplicationRef.tick,\n // skip it altogether and clean up. There may be no work if, for example, the only\n // event that notified the scheduler was the removal of a pending task.\n if (this.appRef.dirtyFlags === 0 /* ApplicationRefDirtyFlags.None */) {\n this.cleanup();\n return;\n }\n // The scheduler used to pass \"whether to check views\" as a boolean flag instead of setting\n // fine-grained dirtiness flags, and global checking was always used on the first pass. This\n // created an interesting edge case: if a notification made a view dirty and then ticked via the\n // scheduler (and not the zone) a global check was still performed.\n //\n // Ideally, this would not be the case, and only zone-based ticks would do global passes.\n // However this is a breaking change and requires fixes in g3. Until this cleanup can be done,\n // we add the `ViewTreeGlobal` flag to request a global check if any views are dirty in a\n // scheduled tick (unless zoneless is enabled, in which case global checks aren't really a\n // thing).\n //\n // TODO(alxhub): clean up and remove this workaround as a breaking change.\n if (!this.zonelessEnabled && this.appRef.dirtyFlags & 7 /* ApplicationRefDirtyFlags.ViewTreeAny */) {\n this.appRef.dirtyFlags |= 1 /* ApplicationRefDirtyFlags.ViewTreeGlobal */;\n }\n const task = this.taskService.add();\n try {\n this.ngZone.run(() => {\n this.runningTick = true;\n this.appRef._tick();\n }, undefined, this.schedulerTickApplyArgs);\n }\n catch (e) {\n this.taskService.remove(task);\n this.applicationErrorHandler(e);\n }\n finally {\n this.cleanup();\n }\n // If we're notified of a change within 1 microtask of running change\n // detection, run another round in the same event loop. This allows code\n // which uses Promise.resolve (see NgModel) to avoid\n // ExpressionChanged...Error to still be reflected in a single browser\n // paint, even if that spans multiple rounds of change detection.\n this.useMicrotaskScheduler = true;\n scheduleCallbackWithMicrotask(() => {\n this.useMicrotaskScheduler = false;\n this.taskService.remove(task);\n });\n }\n ngOnDestroy() {\n this.subscriptions.unsubscribe();\n this.cleanup();\n }\n cleanup() {\n this.runningTick = false;\n this.cancelScheduledCallback?.();\n this.cancelScheduledCallback = null;\n // If this is the last task, the service will synchronously emit a stable\n // notification. If there is a subscriber that then acts in a way that\n // tries to notify the scheduler again, we need to be able to respond to\n // schedule a new change detection. Therefore, we should clear the task ID\n // before removing it from the pending tasks (or the tasks service should\n // not synchronously emit stable, similar to how Zone stableness only\n // happens if it's still stable after a microtask).\n if (this.pendingRenderTaskId !== null) {\n const taskId = this.pendingRenderTaskId;\n this.pendingRenderTaskId = null;\n this.taskService.remove(taskId);\n }\n }\n static ɵfac = function ChangeDetectionSchedulerImpl_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ChangeDetectionSchedulerImpl)(); };\n static ɵprov = /*@__PURE__*/ __defineInjectable({ token: ChangeDetectionSchedulerImpl, factory: ChangeDetectionSchedulerImpl.ɵfac, providedIn: 'root' });\n}\n(() => { (typeof ngDevMode === \"undefined\" || ngDevMode) && setClassMetadata(ChangeDetectionSchedulerImpl, [{\n type: Injectable,\n args: [{ providedIn: 'root' }]\n }], () => [], null); })();\n/**\n * Provides change detection without ZoneJS for the application bootstrapped using\n * `bootstrapApplication`.\n *\n * This function allows you to configure the application to not use the state/state changes of\n * ZoneJS to schedule change detection in the application. This will work when ZoneJS is not present\n * on the page at all or if it exists because something else is using it (either another Angular\n * application which uses ZoneJS for scheduling or some other library that relies on ZoneJS).\n *\n * This can also be added to the `TestBed` providers to configure the test environment to more\n * closely match production behavior. This will help give higher confidence that components are\n * compatible with zoneless change detection.\n *\n * ZoneJS uses browser events to trigger change detection. When using this provider, Angular will\n * instead use Angular APIs to schedule change detection. These APIs include:\n *\n * - `ChangeDetectorRef.markForCheck`\n * - `ComponentRef.setInput`\n * - updating a signal that is read in a template\n * - when bound host or template listeners are triggered\n * - attaching a view that was marked dirty by one of the above\n * - removing a view\n * - registering a render hook (templates are only refreshed if render hooks do one of the above)\n *\n * @usageNotes\n * ```ts\n * bootstrapApplication(MyApp, {providers: [\n * provideZonelessChangeDetection(),\n * ]});\n * ```\n *\n * This API is experimental. Neither the shape, nor the underlying behavior is stable and can change\n * in patch versions. There are known feature gaps and API ergonomic considerations. We will iterate\n * on the exact API based on the feedback and our understanding of the problem and solution space.\n *\n * @developerPreview 20.0\n * @see {@link /api/platform-browser/bootstrapApplication bootstrapApplication}\n */\nfunction provideZonelessChangeDetection() {\n performanceMarkFeature('NgZoneless');\n if ((typeof ngDevMode === 'undefined' || ngDevMode) && typeof Zone !== 'undefined' && Zone) {\n const message = formatRuntimeError(914 /* RuntimeErrorCode.UNEXPECTED_ZONEJS_PRESENT_IN_ZONELESS_MODE */, `The application is using zoneless change detection, but is still loading Zone.js. ` +\n `Consider removing Zone.js to get the full benefits of zoneless. ` +\n `In applications using the Angular CLI, Zone.js is typically included in the \"polyfills\" section of the angular.json file.`);\n console.warn(message);\n }\n return makeEnvironmentProviders([\n { provide: ChangeDetectionScheduler, useExisting: ChangeDetectionSchedulerImpl },\n { provide: NgZone, useClass: NoopNgZone },\n { provide: ZONELESS_ENABLED, useValue: true },\n { provide: SCHEDULE_IN_ROOT_ZONE, useValue: false },\n typeof ngDevMode === 'undefined' || ngDevMode\n ? [{ provide: PROVIDED_ZONELESS, useValue: true }]\n : [],\n ]);\n}\n\n/// <reference path=\"../../../goog.d.ts\" />\n/**\n * Work out the locale from the potential global properties.\n *\n * * Closure Compiler: use `goog.LOCALE`.\n * * Ivy enabled: use `$localize.locale`\n */\nfunction getGlobalLocale() {\n if (typeof ngI18nClosureMode !== 'undefined' &&\n ngI18nClosureMode &&\n typeof goog !== 'undefined' &&\n goog.LOCALE !== 'en') {\n // * The default `goog.LOCALE` value is `en`, while Angular used `en-US`.\n // * In order to preserve backwards compatibility, we use Angular default value over\n // Closure Compiler's one.\n return goog.LOCALE;\n }\n else {\n // KEEP `typeof $localize !== 'undefined' && $localize.locale` IN SYNC WITH THE LOCALIZE\n // COMPILE-TIME INLINER.\n //\n // * During compile time inlining of translations the expression will be replaced\n // with a string literal that is the current locale. Other forms of this expression are not\n // guaranteed to be replaced.\n //\n // * During runtime translation evaluation, the developer is required to set `$localize.locale`\n // if required, or just to provide their own `LOCALE_ID` provider.\n return (typeof $localize !== 'undefined' && $localize.locale) || DEFAULT_LOCALE_ID;\n }\n}\n/**\n * Provide this token to set the locale of your application.\n * It is used for i18n extraction, by i18n pipes (DatePipe, I18nPluralPipe, CurrencyPipe,\n * DecimalPipe and PercentPipe) and by ICU expressions.\n *\n * See the [i18n guide](guide/i18n/locale-id) for more information.\n *\n * @usageNotes\n * ### Example\n * In standalone apps:\n * ```ts\n * import { LOCALE_ID, ApplicationConfig } from '@angular/core';\n * import { AppModule } from './app/app.module';\n *\n * const appConfig: ApplicationConfig = {\n * providers: [{provide: LOCALE_ID, useValue: 'en-US' }]\n * };\n * ```\n *\n * In module based apps:\n * ```ts\n * import { LOCALE_ID } from '@angular/core';\n * import { platformBrowser } from '@angular/platform-browser';\n * import { AppModule } from './app/app.module';\n *\n * platformBrowser().bootstrapModule(AppModule, {\n * providers: [{provide: LOCALE_ID, useValue: 'en-US' }]\n * });\n * ```\n *\n * @publicApi\n */\nconst LOCALE_ID = new InjectionToken(ngDevMode ? 'LocaleId' : '', {\n providedIn: 'root',\n factory: () => inject(LOCALE_ID, { optional: true, skipSelf: true }) || getGlobalLocale(),\n});\n/**\n * Provide this token to set the default currency code your application uses for\n * CurrencyPipe when there is no currency code passed into it. This is only used by\n * CurrencyPipe and has no relation to locale currency. Defaults to USD if not configured.\n *\n * See the [i18n guide](guide/i18n/locale-id) for more information.\n *\n * <div class=\"docs-alert docs-alert-helpful\">\n *\n * The default currency code is currently always `USD`.\n *\n * If you need the previous behavior then set it by creating a `DEFAULT_CURRENCY_CODE` provider in\n * your application `NgModule`:\n *\n * ```ts\n * {provide: DEFAULT_CURRENCY_CODE, useValue: 'USD'}\n * ```\n *\n * </div>\n *\n * @usageNotes\n * ### Example\n * In standalone apps:\n * ```ts\n * import { LOCALE_ID, ApplicationConfig } from '@angular/core';\n *\n * const appConfig: ApplicationConfig = {\n * providers: [{provide: DEFAULT_CURRENCY_CODE, useValue: 'EUR' }]\n * };\n * ```\n *\n * In module based apps:\n * ```ts\n * import { platformBrowser } from '@angular/platform-browser';\n * import { AppModule } from './app/app.module';\n *\n * platformBrowser().bootstrapModule(AppModule, {\n * providers: [{provide: DEFAULT_CURRENCY_CODE, useValue: 'EUR' }]\n * });\n * ```\n *\n * @publicApi\n */\nconst DEFAULT_CURRENCY_CODE = new InjectionToken(ngDevMode ? 'DefaultCurrencyCode' : '', {\n providedIn: 'root',\n factory: () => USD_CURRENCY_CODE,\n});\n/**\n * Use this token at bootstrap to provide the content of your translation file (`xtb`,\n * `xlf` or `xlf2`) when you want to translate your application in another language.\n *\n * See the [i18n guide](guide/i18n/merge) for more information.\n *\n * @usageNotes\n * ### Example\n * In standalone apps:\n * ```ts\n * import { LOCALE_ID, ApplicationConfig } from '@angular/core';\n *\n * const appConfig: ApplicationConfig = {\n * providers: [{provide: TRANSLATIONS, useValue: translations }]\n * };\n * ```\n *\n * In module based apps:\n * ```ts\n * import { TRANSLATIONS } from '@angular/core';\n * import { platformBrowser } from '@angular/platform-browser';\n * import { AppModule } from './app/app.module';\n *\n * // content of your translation file\n * const translations = '....';\n *\n * platformBrowser().bootstrapModule(AppModule, {\n * providers: [{provide: TRANSLATIONS, useValue: translations }]\n * });\n * ```\n *\n * @publicApi\n */\nconst TRANSLATIONS = new InjectionToken(ngDevMode ? 'Translations' : '');\n/**\n * Provide this token at bootstrap to set the format of your {@link TRANSLATIONS}: `xtb`,\n * `xlf` or `xlf2`.\n *\n * See the [i18n guide](guide/i18n/merge) for more information.\n *\n * @usageNotes\n * ### Example\n * In standalone apps:\n * ```ts\n * import { LOCALE_ID, ApplicationConfig } from '@angular/core';\n *\n * const appConfig: ApplicationConfig = {\n * providers: [{provide: TRANSLATIONS_FORMAT, useValue: 'xlf' }]\n * };\n * ```\n *\n * In module based apps: *\n * ```ts\n * import { TRANSLATIONS_FORMAT } from '@angular/core';\n * import { platformBrowser } from '@angular/platform-browser';\n * import { AppModule } from './app/app.module';\n *\n * platformBrowser().bootstrapModule(AppModule, {\n * providers: [{provide: TRANSLATIONS_FORMAT, useValue: 'xlf' }]\n * });\n * ```\n *\n * @publicApi\n */\nconst TRANSLATIONS_FORMAT = new InjectionToken(ngDevMode ? 'TranslationsFormat' : '');\n/**\n * Use this enum at bootstrap as an option of `bootstrapModule` to define the strategy\n * that the compiler should use in case of missing translations:\n * - Error: throw if you have missing translations.\n * - Warning (default): show a warning in the console and/or shell.\n * - Ignore: do nothing.\n *\n * See the [i18n guide](guide/i18n/merge#report-missing-translations) for more information.\n *\n * @usageNotes\n * ### Example\n * ```ts\n * import { MissingTranslationStrategy } from '@angular/core';\n * import { platformBrowser } from '@angular/platform-browser';\n * import { AppModule } from './app/app.module';\n *\n * platformBrowser().bootstrapModule(AppModule, {\n * missingTranslation: MissingTranslationStrategy.Error\n * });\n * ```\n *\n * @publicApi\n */\nvar MissingTranslationStrategy;\n(function (MissingTranslationStrategy) {\n MissingTranslationStrategy[MissingTranslationStrategy[\"Error\"] = 0] = \"Error\";\n MissingTranslationStrategy[MissingTranslationStrategy[\"Warning\"] = 1] = \"Warning\";\n MissingTranslationStrategy[MissingTranslationStrategy[\"Ignore\"] = 2] = \"Ignore\";\n})(MissingTranslationStrategy || (MissingTranslationStrategy = {}));\n\n/**\n * @publicApi\n */\nclass DebugEventListener {\n name;\n callback;\n constructor(name, callback) {\n this.name = name;\n this.callback = callback;\n }\n}\n/**\n * @publicApi\n */\nfunction asNativeElements(debugEls) {\n return debugEls.map((el) => el.nativeElement);\n}\n/**\n * @publicApi\n */\nclass DebugNode {\n /**\n * The underlying DOM node.\n */\n nativeNode;\n constructor(nativeNode) {\n this.nativeNode = nativeNode;\n }\n /**\n * The `DebugElement` parent. Will be `null` if this is the root element.\n */\n get parent() {\n const parent = this.nativeNode.parentNode;\n return parent ? new DebugElement(parent) : null;\n }\n /**\n * The host dependency injector. For example, the root element's component instance injector.\n */\n get injector() {\n return getInjector(this.nativeNode);\n }\n /**\n * The element's own component instance, if it has one.\n */\n get componentInstance() {\n const nativeElement = this.nativeNode;\n return (nativeElement && (getComponent(nativeElement) || getOwningComponent(nativeElement)));\n }\n /**\n * An object that provides parent context for this element. Often an ancestor component instance\n * that governs this element.\n *\n * When an element is repeated within *ngFor, the context is an `NgForOf` whose `$implicit`\n * property is the value of the row instance value. For example, the `hero` in `*ngFor=\"let hero\n * of heroes\"`.\n */\n get context() {\n return getComponent(this.nativeNode) || getContext(this.nativeNode);\n }\n /**\n * The callbacks attached to the component's @Output properties and/or the element's event\n * properties.\n */\n get listeners() {\n return getListeners(this.nativeNode).filter((listener) => listener.type === 'dom');\n }\n /**\n * Dictionary of objects associated with template local variables (e.g. #foo), keyed by the local\n * variable name.\n */\n get references() {\n return getLocalRefs(this.nativeNode);\n }\n /**\n * This component's injector lookup tokens. Includes the component itself plus the tokens that the\n * component lists in its providers metadata.\n */\n get providerTokens() {\n return getInjectionTokens(this.nativeNode);\n }\n}\n/**\n * @publicApi\n *\n * @see [Component testing scenarios](guide/testing/components-scenarios)\n * @see [Basics of testing components](guide/testing/components-basics)\n * @see [Testing utility APIs](guide/testing/utility-apis)\n */\nclass DebugElement extends DebugNode {\n constructor(nativeNode) {\n ngDevMode && assertDomNode(nativeNode);\n super(nativeNode);\n }\n /**\n * The underlying DOM element at the root of the component.\n */\n get nativeElement() {\n return this.nativeNode.nodeType == Node.ELEMENT_NODE ? this.nativeNode : null;\n }\n /**\n * The element tag name, if it is an element.\n */\n get name() {\n const context = getLContext(this.nativeNode);\n const lView = context ? context.lView : null;\n if (lView !== null) {\n const tData = lView[TVIEW].data;\n const tNode = tData[context.nodeIndex];\n return tNode.value;\n }\n else {\n return this.nativeNode.nodeName;\n }\n }\n /**\n * Gets a map of property names to property values for an element.\n *\n * This map includes:\n * - Regular property bindings (e.g. `[id]=\"id\"`)\n * - Host property bindings (e.g. `host: { '[id]': \"id\" }`)\n * - Interpolated property bindings (e.g. `id=\"{{ value }}\")\n *\n * It does not include:\n * - input property bindings (e.g. `[myCustomInput]=\"value\"`)\n * - attribute bindings (e.g. `[attr.role]=\"menu\"`)\n */\n get properties() {\n const context = getLContext(this.nativeNode);\n const lView = context ? context.lView : null;\n if (lView === null) {\n return {};\n }\n const tData = lView[TVIEW].data;\n const tNode = tData[context.nodeIndex];\n const properties = {};\n // Collect properties from the DOM.\n copyDomProperties(this.nativeElement, properties);\n // Collect properties from the bindings. This is needed for animation renderer which has\n // synthetic properties which don't get reflected into the DOM.\n collectPropertyBindings(properties, tNode, lView, tData);\n return properties;\n }\n /**\n * A map of attribute names to attribute values for an element.\n */\n // TODO: replace null by undefined in the return type\n get attributes() {\n const attributes = {};\n const element = this.nativeElement;\n if (!element) {\n return attributes;\n }\n const context = getLContext(element);\n const lView = context ? context.lView : null;\n if (lView === null) {\n return {};\n }\n const tNodeAttrs = lView[TVIEW].data[context.nodeIndex].attrs;\n const lowercaseTNodeAttrs = [];\n // For debug nodes we take the element's attribute directly from the DOM since it allows us\n // to account for ones that weren't set via bindings (e.g. ViewEngine keeps track of the ones\n // that are set through `Renderer2`). The problem is that the browser will lowercase all names,\n // however since we have the attributes already on the TNode, we can preserve the case by going\n // through them once, adding them to the `attributes` map and putting their lower-cased name\n // into an array. Afterwards when we're going through the native DOM attributes, we can check\n // whether we haven't run into an attribute already through the TNode.\n if (tNodeAttrs) {\n let i = 0;\n while (i < tNodeAttrs.length) {\n const attrName = tNodeAttrs[i];\n // Stop as soon as we hit a marker. We only care about the regular attributes. Everything\n // else will be handled below when we read the final attributes off the DOM.\n if (typeof attrName !== 'string')\n break;\n const attrValue = tNodeAttrs[i + 1];\n attributes[attrName] = attrValue;\n lowercaseTNodeAttrs.push(attrName.toLowerCase());\n i += 2;\n }\n }\n for (const attr of element.attributes) {\n // Make sure that we don't assign the same attribute both in its\n // case-sensitive form and the lower-cased one from the browser.\n if (!lowercaseTNodeAttrs.includes(attr.name)) {\n attributes[attr.name] = attr.value;\n }\n }\n return attributes;\n }\n /**\n * The inline styles of the DOM element.\n */\n // TODO: replace null by undefined in the return type\n get styles() {\n const element = this.nativeElement;\n return (element?.style ?? {});\n }\n /**\n * A map containing the class names on the element as keys.\n *\n * This map is derived from the `className` property of the DOM element.\n *\n * Note: The values of this object will always be `true`. The class key will not appear in the KV\n * object if it does not exist on the element.\n *\n * @see [Element.className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className)\n */\n get classes() {\n const result = {};\n const element = this.nativeElement;\n // SVG elements return an `SVGAnimatedString` instead of a plain string for the `className`.\n const className = element.className;\n const classes = typeof className !== 'string' ? className.baseVal.split(' ') : className.split(' ');\n classes.forEach((value) => (result[value] = true));\n return result;\n }\n /**\n * The `childNodes` of the DOM element as a `DebugNode` array.\n *\n * @see [Node.childNodes](https://developer.mozilla.org/en-US/docs/Web/API/Node/childNodes)\n */\n get childNodes() {\n const childNodes = this.nativeNode.childNodes;\n const children = [];\n for (let i = 0; i < childNodes.length; i++) {\n const element = childNodes[i];\n children.push(getDebugNode(element));\n }\n return children;\n }\n /**\n * The immediate `DebugElement` children. Walk the tree by descending through `children`.\n */\n get children() {\n const nativeElement = this.nativeElement;\n if (!nativeElement)\n return [];\n const childNodes = nativeElement.children;\n const children = [];\n for (let i = 0; i < childNodes.length; i++) {\n const element = childNodes[i];\n children.push(getDebugNode(element));\n }\n return children;\n }\n /**\n * @returns the first `DebugElement` that matches the predicate at any depth in the subtree.\n */\n query(predicate) {\n const results = this.queryAll(predicate);\n return results[0] || null;\n }\n /**\n * @returns All `DebugElement` matches for the predicate at any depth in the subtree.\n */\n queryAll(predicate) {\n const matches = [];\n _queryAll(this, predicate, matches, true);\n return matches;\n }\n /**\n * @returns All `DebugNode` matches for the predicate at any depth in the subtree.\n */\n queryAllNodes(predicate) {\n const matches = [];\n _queryAll(this, predicate, matches, false);\n return matches;\n }\n /**\n * Triggers the event by its name if there is a corresponding listener in the element's\n * `listeners` collection.\n *\n * If the event lacks a listener or there's some other problem, consider\n * calling `nativeElement.dispatchEvent(eventObject)`.\n *\n * @param eventName The name of the event to trigger\n * @param eventObj The _event object_ expected by the handler\n *\n * @see [Testing components scenarios](guide/testing/components-scenarios#trigger-event-handler)\n */\n triggerEventHandler(eventName, eventObj) {\n const node = this.nativeNode;\n const invokedListeners = [];\n this.listeners.forEach((listener) => {\n if (listener.name === eventName) {\n const callback = listener.callback;\n callback.call(node, eventObj);\n invokedListeners.push(callback);\n }\n });\n // We need to check whether `eventListeners` exists, because it's something\n // that Zone.js only adds to `EventTarget` in browser environments.\n if (typeof node.eventListeners === 'function') {\n // Note that in Ivy we wrap event listeners with a call to `event.preventDefault` in some\n // cases. We use '__ngUnwrap__' as a special token that gives us access to the actual event\n // listener.\n node.eventListeners(eventName).forEach((listener) => {\n // In order to ensure that we can detect the special __ngUnwrap__ token described above, we\n // use `toString` on the listener and see if it contains the token. We use this approach to\n // ensure that it still worked with compiled code since it cannot remove or rename string\n // literals. We also considered using a special function name (i.e. if(listener.name ===\n // special)) but that was more cumbersome and we were also concerned the compiled code could\n // strip the name, turning the condition in to (\"\" === \"\") and always returning true.\n if (listener.toString().indexOf('__ngUnwrap__') !== -1) {\n const unwrappedListener = listener('__ngUnwrap__');\n return (invokedListeners.indexOf(unwrappedListener) === -1 &&\n unwrappedListener.call(node, eventObj));\n }\n });\n }\n }\n}\nfunction copyDomProperties(element, properties) {\n if (element) {\n // Skip own properties (as those are patched)\n let obj = Object.getPrototypeOf(element);\n const NodePrototype = Node.prototype;\n while (obj !== null && obj !== NodePrototype) {\n const descriptors = Object.getOwnPropertyDescriptors(obj);\n for (let key in descriptors) {\n if (!key.startsWith('__') && !key.startsWith('on')) {\n // don't include properties starting with `__` and `on`.\n // `__` are patched values which should not be included.\n // `on` are listeners which also should not be included.\n const value = element[key];\n if (isPrimitiveValue(value)) {\n properties[key] = value;\n }\n }\n }\n obj = Object.getPrototypeOf(obj);\n }\n }\n}\nfunction isPrimitiveValue(value) {\n return (typeof value === 'string' ||\n typeof value === 'boolean' ||\n typeof value === 'number' ||\n value === null);\n}\nfunction _queryAll(parentElement, predicate, matches, elementsOnly) {\n const context = getLContext(parentElement.nativeNode);\n const lView = context ? context.lView : null;\n if (lView !== null) {\n const parentTNode = lView[TVIEW].data[context.nodeIndex];\n _queryNodeChildren(parentTNode, lView, predicate, matches, elementsOnly, parentElement.nativeNode);\n }\n else {\n // If the context is null, then `parentElement` was either created with Renderer2 or native DOM\n // APIs.\n _queryNativeNodeDescendants(parentElement.nativeNode, predicate, matches, elementsOnly);\n }\n}\n/**\n * Recursively match the current TNode against the predicate, and goes on with the next ones.\n *\n * @param tNode the current TNode\n * @param lView the LView of this TNode\n * @param predicate the predicate to match\n * @param matches the list of positive matches\n * @param elementsOnly whether only elements should be searched\n * @param rootNativeNode the root native node on which predicate should not be matched\n */\nfunction _queryNodeChildren(tNode, lView, predicate, matches, elementsOnly, rootNativeNode) {\n ngDevMode && assertTNodeForLView(tNode, lView);\n const nativeNode = getNativeByTNodeOrNull(tNode, lView);\n // For each type of TNode, specific logic is executed.\n if (tNode.type & (3 /* TNodeType.AnyRNode */ | 8 /* TNodeType.ElementContainer */)) {\n // Case 1: the TNode is an element\n // The native node has to be checked.\n _addQueryMatch(nativeNode, predicate, matches, elementsOnly, rootNativeNode);\n if (isComponentHost(tNode)) {\n // If the element is the host of a component, then all nodes in its view have to be processed.\n // Note: the component's content (tNode.child) will be processed from the insertion points.\n const componentView = getComponentLViewByIndex(tNode.index, lView);\n if (componentView && componentView[TVIEW].firstChild) {\n _queryNodeChildren(componentView[TVIEW].firstChild, componentView, predicate, matches, elementsOnly, rootNativeNode);\n }\n }\n else {\n if (tNode.child) {\n // Otherwise, its children have to be processed.\n _queryNodeChildren(tNode.child, lView, predicate, matches, elementsOnly, rootNativeNode);\n }\n // We also have to query the DOM directly in order to catch elements inserted through\n // Renderer2. Note that this is __not__ optimal, because we're walking similar trees multiple\n // times. ViewEngine could do it more efficiently, because all the insertions go through\n // Renderer2, however that's not the case in Ivy. This approach is being used because:\n // 1. Matching the ViewEngine behavior would mean potentially introducing a dependency\n // from `Renderer2` to Ivy which could bring Ivy code into ViewEngine.\n // 2. It allows us to capture nodes that were inserted directly via the DOM.\n nativeNode && _queryNativeNodeDescendants(nativeNode, predicate, matches, elementsOnly);\n }\n // In all cases, if a dynamic container exists for this node, each view inside it has to be\n // processed.\n const nodeOrContainer = lView[tNode.index];\n if (isLContainer(nodeOrContainer)) {\n _queryNodeChildrenInContainer(nodeOrContainer, predicate, matches, elementsOnly, rootNativeNode);\n }\n }\n else if (tNode.type & 4 /* TNodeType.Container */) {\n // Case 2: the TNode is a container\n // The native node has to be checked.\n const lContainer = lView[tNode.index];\n _addQueryMatch(lContainer[NATIVE], predicate, matches, elementsOnly, rootNativeNode);\n // Each view inside the container has to be processed.\n _queryNodeChildrenInContainer(lContainer, predicate, matches, elementsOnly, rootNativeNode);\n }\n else if (tNode.type & 16 /* TNodeType.Projection */) {\n // Case 3: the TNode is a projection insertion point (i.e. a <ng-content>).\n // The nodes projected at this location all need to be processed.\n const componentView = lView[DECLARATION_COMPONENT_VIEW];\n const componentHost = componentView[T_HOST];\n const head = componentHost.projection[tNode.projection];\n if (Array.isArray(head)) {\n for (let nativeNode of head) {\n _addQueryMatch(nativeNode, predicate, matches, elementsOnly, rootNativeNode);\n }\n }\n else if (head) {\n const nextLView = componentView[PARENT];\n const nextTNode = nextLView[TVIEW].data[head.index];\n _queryNodeChildren(nextTNode, nextLView, predicate, matches, elementsOnly, rootNativeNode);\n }\n }\n else if (tNode.child) {\n // Case 4: the TNode is a view.\n _queryNodeChildren(tNode.child, lView, predicate, matches, elementsOnly, rootNativeNode);\n }\n // We don't want to go to the next sibling of the root node.\n if (rootNativeNode !== nativeNode) {\n // To determine the next node to be processed, we need to use the next or the projectionNext\n // link, depending on whether the current node has been projected.\n const nextTNode = tNode.flags & 2 /* TNodeFlags.isProjected */ ? tNode.projectionNext : tNode.next;\n if (nextTNode) {\n _queryNodeChildren(nextTNode, lView, predicate, matches, elementsOnly, rootNativeNode);\n }\n }\n}\n/**\n * Process all TNodes in a given container.\n *\n * @param lContainer the container to be processed\n * @param predicate the predicate to match\n * @param matches the list of positive matches\n * @param elementsOnly whether only elements should be searched\n * @param rootNativeNode the root native node on which predicate should not be matched\n */\nfunction _queryNodeChildrenInContainer(lContainer, predicate, matches, elementsOnly, rootNativeNode) {\n for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {\n const childView = lContainer[i];\n const firstChild = childView[TVIEW].firstChild;\n if (firstChild) {\n _queryNodeChildren(firstChild, childView, predicate, matches, elementsOnly, rootNativeNode);\n }\n }\n}\n/**\n * Match the current native node against the predicate.\n *\n * @param nativeNode the current native node\n * @param predicate the predicate to match\n * @param matches the list of positive matches\n * @param elementsOnly whether only elements should be searched\n * @param rootNativeNode the root native node on which predicate should not be matched\n */\nfunction _addQueryMatch(nativeNode, predicate, matches, elementsOnly, rootNativeNode) {\n if (rootNativeNode !== nativeNode) {\n const debugNode = getDebugNode(nativeNode);\n if (!debugNode) {\n return;\n }\n // Type of the \"predicate and \"matches\" array are set based on the value of\n // the \"elementsOnly\" parameter. TypeScript is not able to properly infer these\n // types with generics, so we manually cast the parameters accordingly.\n if (elementsOnly &&\n debugNode instanceof DebugElement &&\n predicate(debugNode) &&\n matches.indexOf(debugNode) === -1) {\n matches.push(debugNode);\n }\n else if (!elementsOnly &&\n predicate(debugNode) &&\n matches.indexOf(debugNode) === -1) {\n matches.push(debugNode);\n }\n }\n}\n/**\n * Match all the descendants of a DOM node against a predicate.\n *\n * @param nativeNode the current native node\n * @param predicate the predicate to match\n * @param matches the list where matches are stored\n * @param elementsOnly whether only elements should be searched\n */\nfunction _queryNativeNodeDescendants(parentNode, predicate, matches, elementsOnly) {\n const nodes = parentNode.childNodes;\n const length = nodes.length;\n for (let i = 0; i < length; i++) {\n const node = nodes[i];\n const debugNode = getDebugNode(node);\n if (debugNode) {\n if (elementsOnly &&\n debugNode instanceof DebugElement &&\n predicate(debugNode) &&\n matches.indexOf(debugNode) === -1) {\n matches.push(debugNode);\n }\n else if (!elementsOnly &&\n predicate(debugNode) &&\n matches.indexOf(debugNode) === -1) {\n matches.push(debugNode);\n }\n _queryNativeNodeDescendants(node, predicate, matches, elementsOnly);\n }\n }\n}\n/**\n * Iterates through the property bindings for a given node and generates\n * a map of property names to values. This map only contains property bindings\n * defined in templates, not in host bindings.\n */\nfunction collectPropertyBindings(properties, tNode, lView, tData) {\n let bindingIndexes = tNode.propertyBindings;\n if (bindingIndexes !== null) {\n for (let i = 0; i < bindingIndexes.length; i++) {\n const bindingIndex = bindingIndexes[i];\n const propMetadata = tData[bindingIndex];\n const metadataParts = propMetadata.split(INTERPOLATION_DELIMITER);\n const propertyName = metadataParts[0];\n if (metadataParts.length > 1) {\n let value = metadataParts[1];\n for (let j = 1; j < metadataParts.length - 1; j++) {\n value += renderStringify(lView[bindingIndex + j - 1]) + metadataParts[j + 1];\n }\n properties[propertyName] = value;\n }\n else {\n properties[propertyName] = lView[bindingIndex];\n }\n }\n }\n}\nconst NG_DEBUG_PROPERTY = '__ng_debug__';\n/**\n * @publicApi\n */\nfunction getDebugNode(nativeNode) {\n if (nativeNode instanceof Node) {\n if (!nativeNode.hasOwnProperty(NG_DEBUG_PROPERTY)) {\n nativeNode[NG_DEBUG_PROPERTY] =\n nativeNode.nodeType == Node.ELEMENT_NODE\n ? new DebugElement(nativeNode)\n : new DebugNode(nativeNode);\n }\n return nativeNode[NG_DEBUG_PROPERTY];\n }\n return null;\n}\n\nexport { AFTER_RENDER_PHASES, ANIMATION_MODULE_TYPE, APP_BOOTSTRAP_LISTENER, APP_ID, APP_INITIALIZER, AcxChangeDetectionStrategy, AcxViewEncapsulation, AfterRenderImpl, AfterRenderManager, AfterRenderSequence, ApplicationInitStatus, ApplicationRef, Attribute, COMPILER_OPTIONS, CONTAINERS, CSP_NONCE, CUSTOM_ELEMENTS_SCHEMA, ChangeDetectionSchedulerImpl, ChangeDetectionStrategy, Compiler, CompilerFactory, Component, ComponentFactory, ComponentFactory$1, ComponentFactoryResolver$1 as ComponentFactoryResolver, ComponentRef$1 as ComponentRef, ComponentRef as ComponentRef$1, Console, DEFAULT_CURRENCY_CODE, DEFAULT_LOCALE_ID, DEFER_BLOCK_CONFIG, DEFER_BLOCK_DEPENDENCY_INTERCEPTOR, DEFER_BLOCK_ID, DEFER_BLOCK_SSR_ID_ATTRIBUTE, DEFER_BLOCK_STATE$1 as DEFER_BLOCK_STATE, DEFER_BLOCK_STATE as DEFER_BLOCK_STATE$1, DEFER_HYDRATE_TRIGGERS, DEFER_PARENT_BLOCK_ID, DEHYDRATED_BLOCK_REGISTRY, DISCONNECTED_NODES, DebugElement, DebugEventListener, DebugNode, DeferBlockBehavior, DeferBlockState, DehydratedBlockRegistry, Directive, ELEMENT_CONTAINERS, EVENT_REPLAY_ENABLED_DEFAULT, ElementRef, EnvironmentNgModuleRefAdapter, EventEmitter, Framework, Host, HostBinding, HostListener, HydrationStatus, I18N_DATA, IMAGE_CONFIG, IMAGE_CONFIG_DEFAULTS, IS_EVENT_REPLAY_ENABLED, IS_HYDRATION_DOM_REUSE_ENABLED, IS_I18N_HYDRATION_ENABLED, IS_INCREMENTAL_HYDRATION_ENABLED, Inject, Injectable, Input, JSACTION_BLOCK_ELEMENT_MAP, JSACTION_EVENT_CONTRACT, LContext, LOCALE_ID, LocaleDataIndex, MULTIPLIER, MissingTranslationStrategy, ModuleWithComponentFactories, NGH_ATTR_NAME, NGH_DATA_KEY, NGH_DEFER_BLOCKS_KEY, NODES, NOOP_AFTER_RENDER_REF, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR, NO_CHANGE, NO_ERRORS_SCHEMA, NUM_ROOT_NODES, NgModule, NgModuleFactory, NgModuleFactory$1, NgModuleRef, NgModuleRef$1, NgProbeToken, NgZone, NoopNgZone, Optional, Output, PACKAGE_ROOT_URL, PLATFORM_ID, PLATFORM_INITIALIZER, PRESERVE_HOST_CONTENT, PROVIDED_NG_ZONE, Pipe, QueryList, ReflectionCapabilities, Renderer2, RendererFactory2, RendererStyleFlags2, SKIP_HYDRATION_ATTR_NAME, SSR_CONTENT_INTEGRITY_MARKER, Sanitizer, SecurityContext, Self, SimpleChange, SkipSelf, TEMPLATES, TEMPLATE_ID, TESTABILITY, TESTABILITY_GETTER, TRANSLATIONS, TRANSLATIONS_FORMAT, TemplateRef, Testability, TestabilityRegistry, TimerScheduler, TracingAction, TracingService, TransferState, Type, UseExhaustiveCheckNoChanges, ViewContainerRef, ViewEncapsulation, ViewRef, _sanitizeHtml, _sanitizeUrl, afterEveryRender, afterNextRender, allowSanitizationBypassAndThrow, angularCoreEnv, appendDeferBlocksToJSActionMap, asNativeElements, assertComponentDef, assertStandaloneComponentType, bypassSanitizationTrustHtml, bypassSanitizationTrustResourceUrl, bypassSanitizationTrustScript, bypassSanitizationTrustStyle, bypassSanitizationTrustUrl, calcPathForNode, checkNoChangesInternal, cleanupDehydratedViews, clearResolutionOfComponentResourcesQueue, collectNativeNodes, collectNativeNodesInLContainer, compileComponent, compileDirective, compileNgModule, compileNgModuleDefs, compilePipe, convertHydrateTriggersToJsAction, countBlocksSkippedByHydration, createEnvironmentInjector, createMultiResultQuerySignalFn, createNgModule, createNgModuleRef, createNgModuleRefWithProviders, createSingleResultOptionalQuerySignalFn, createSingleResultRequiredQuerySignalFn, depsTracker, devModeEqual, enableApplyRootElementTransformImpl, enableClaimDehydratedIcuCaseImpl, enableFindMatchingDehydratedViewImpl, enableLocateOrCreateContainerAnchorImpl, enableLocateOrCreateContainerRefImpl, enableLocateOrCreateElementContainerNodeImpl, enableLocateOrCreateElementNodeImpl, enableLocateOrCreateI18nNodeImpl, enableLocateOrCreateTextNodeImpl, enablePrepareI18nBlockForHydrationImpl, enableProfiling, enableRetrieveDeferBlockDataImpl, enableRetrieveHydrationInfoImpl, enableStashEventListenerImpl, findLocaleData, flushModuleScopingQueueAsMuchAsPossible, gatherDeferBlocksCommentNodes, generateStandaloneInDeclarationsError, getAsyncClassMetadataFn, getCompilerFacade, getDebugNode, getDeferBlocks$1 as getDeferBlocks, getDirectives, getDocument, getHostElement, getLContext, getLDeferBlockDetails, getLNodeForHydration, getLocaleCurrencyCode, getLocalePluralCase, getNgZone, getNgZoneOptions, getOrComputeI18nChildren, getRegisteredNgModuleType, getSanitizationBypassType, getTDeferBlockDetails, inputBinding, internalProvideZoneChangeDetection, invokeListeners, isBoundToModule, isComponentDefPendingResolution, isComponentResourceResolutionQueueEmpty, isDeferBlock, isDetachedByI18n, isDisconnectedNode, isI18nHydrationEnabled, isI18nHydrationSupportEnabled, isInSkipHydrationBlock, isIncrementalHydrationEnabled, isInternalHydrationTransferStateKey, isJsObject, isLetDeclaration, isListLikeIterable, isNgModule, isPromise, isSubscribable, isTNodeShape, isViewDirty, iterateListLike, makePropDecorator, makeStateKey, markForRefresh, noSideEffects, optionsReducer, outputBinding, patchComponentDefWithScope, performanceMarkFeature, processAndInitTriggers, processBlockData, processTextNodeBeforeSerialization, profiler, provideAppInitializer, provideNgReflectAttributes, provideZoneChangeDetection, provideZonelessChangeDetection, publishDefaultGlobalUtils, publishExternalGlobalUtil, publishSignalConfiguration, readHydrationInfo, readPatchedLView, registerLocaleData, registerNgModuleType, remove, removeListeners, renderDeferBlockState, resetCompiledComponents, resetJitOptions, resolveComponentResources, restoreComponentResolutionQueue, retrieveTransferredState, setAllowDuplicateNgModuleIdsForTest, setClassMetadata, setClassMetadataAsync, setDocument, setIsI18nHydrationSupportEnabled, setJSActionAttributes, setJitOptions, setLocaleId, setStashFn, setTestabilityGetter, sharedMapFunction, sharedStashFunction, transitiveScopesFor, triggerHydrationFromBlockName, triggerResourceLoading, trySerializeI18nBlock, twoWayBinding, unregisterAllLocaleData, unsupportedProjectionOfDomNodes, unwrapSafeValue, validateMatchingNode, validateNodeExists, verifySsrContentsIntegrity, ɵgetUnknownElementStrictMode, ɵgetUnknownPropertyStrictMode, ɵsetClassDebugInfo, ɵsetUnknownElementStrictMode, ɵsetUnknownPropertyStrictMode, ɵɵCopyDefinitionFeature, ɵɵExternalStylesFeature, ɵɵHostDirectivesFeature, ɵɵInheritDefinitionFeature, ɵɵNgOnChangesFeature, ɵɵProvidersFeature, ɵɵadvance, ɵɵattachSourceLocations, ɵɵattribute, ɵɵclassMap, ɵɵclassProp, ɵɵcomponentInstance, ɵɵconditional, ɵɵconditionalBranchCreate, ɵɵconditionalCreate, ɵɵcontentQuery, ɵɵcontentQuerySignal, ɵɵdeclareLet, ɵɵdefer, ɵɵdeferEnableTimerScheduling, ɵɵdeferHydrateNever, ɵɵdeferHydrateOnHover, ɵɵdeferHydrateOnIdle, ɵɵdeferHydrateOnImmediate, ɵɵdeferHydrateOnInteraction, ɵɵdeferHydrateOnTimer, ɵɵdeferHydrateOnViewport, ɵɵdeferHydrateWhen, ɵɵdeferOnHover, ɵɵdeferOnIdle, ɵɵdeferOnImmediate, ɵɵdeferOnInteraction, ɵɵdeferOnTimer, ɵɵdeferOnViewport, ɵɵdeferPrefetchOnHover, ɵɵdeferPrefetchOnIdle, ɵɵdeferPrefetchOnImmediate, ɵɵdeferPrefetchOnInteraction, ɵɵdeferPrefetchOnTimer, ɵɵdeferPrefetchOnViewport, ɵɵdeferPrefetchWhen, ɵɵdeferWhen, ɵɵdefineComponent, ɵɵdefineDirective, ɵɵdefineNgModule, ɵɵdefinePipe, ɵɵdirectiveInject, ɵɵdomElement, ɵɵdomElementContainer, ɵɵdomElementContainerEnd, ɵɵdomElementContainerStart, ɵɵdomElementEnd, ɵɵdomElementStart, ɵɵdomListener, ɵɵdomProperty, ɵɵdomTemplate, ɵɵelement, ɵɵelementContainer, ɵɵelementContainerEnd, ɵɵelementContainerStart, ɵɵelementEnd, ɵɵelementStart, ɵɵgetComponentDepsFactory, ɵɵgetCurrentView, ɵɵgetInheritedFactory, ɵɵgetReplaceMetadataURL, ɵɵi18n, ɵɵi18nApply, ɵɵi18nAttributes, ɵɵi18nEnd, ɵɵi18nExp, ɵɵi18nPostprocess, ɵɵi18nStart, ɵɵinjectAttribute, ɵɵinterpolate, ɵɵinterpolate1, ɵɵinterpolate2, ɵɵinterpolate3, ɵɵinterpolate4, ɵɵinterpolate5, ɵɵinterpolate6, ɵɵinterpolate7, ɵɵinterpolate8, ɵɵinterpolateV, ɵɵinvalidFactory, ɵɵlistener, ɵɵloadQuery, ɵɵnextContext, ɵɵpipe, ɵɵpipeBind1, ɵɵpipeBind2, ɵɵpipeBind3, ɵɵpipeBind4, ɵɵpipeBindV, ɵɵprojection, ɵɵprojectionDef, ɵɵproperty, ɵɵpureFunction0, ɵɵpureFunction1, ɵɵpureFunction2, ɵɵpureFunction3, ɵɵpureFunction4, ɵɵpureFunction5, ɵɵpureFunction6, ɵɵpureFunction7, ɵɵpureFunction8, ɵɵpureFunctionV, ɵɵqueryAdvance, ɵɵqueryRefresh, ɵɵreadContextLet, ɵɵreference, ɵɵrepeater, ɵɵrepeaterCreate, ɵɵrepeaterTrackByIdentity, ɵɵrepeaterTrackByIndex, ɵɵreplaceMetadata, ɵɵresolveBody, ɵɵresolveDocument, ɵɵresolveWindow, ɵɵsanitizeHtml, ɵɵsanitizeResourceUrl, ɵɵsanitizeScript, ɵɵsanitizeStyle, ɵɵsanitizeUrl, ɵɵsanitizeUrlOrResourceUrl, ɵɵsetComponentScope, ɵɵsetNgModuleScope, ɵɵstoreLet, ɵɵstyleMap, ɵɵstyleProp, ɵɵsyntheticHostListener, ɵɵsyntheticHostProperty, ɵɵtemplate, ɵɵtemplateRefExtractor, ɵɵtext, ɵɵtextInterpolate, ɵɵtextInterpolate1, ɵɵtextInterpolate2, ɵɵtextInterpolate3, ɵɵtextInterpolate4, ɵɵtextInterpolate5, ɵɵtextInterpolate6, ɵɵtextInterpolate7, ɵɵtextInterpolate8, ɵɵtextInterpolate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AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,mBAAmB,CAAC;EACtBjI,OAAO;EACP7E,IAAI;EACJ;AACJ;AACA;EACI+M,UAAU;EACV;AACJ;AACA;AACA;EACIC,SAAS,GAAG,KAAK;EACjB;AACJ;AACA;EACIC,mBAAmB;EACnB;AACJ;AACA;EACIC,KAAK;EACL;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACIC,kBAAkB;EAClB;AACJ;AACA;AACA;EACInL,KAAK;EACL;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACIoL,eAAe;EACf1K,WAAWA;EACX;AACJ;AACA;EACImC,OAAO;EACP;AACJ;AACA;EACIwI,cAAc,EAAEC,oBAAoB;EACpC;EACAtN,IAAI,EAAE;IACF,IAAI,CAAC6E,OAAO,GAAGA,OAAO;IACtB,IAAI,CAAC7E,IAAI,GAAGA,IAAI;IAChBuD,SAAS,IAAIzU,aAAa,CAAC+V,OAAO,EAAE,uBAAuB,CAAC;IAC5DtB,SAAS,IAAI7U,WAAW,CAAC,OAAOmW,OAAO,EAAE,UAAU,EAAE,4BAA4B,CAAC;IAClF,IAAI,CAACoI,mBAAmB,GAAGI,cAAc;IACzC,IAA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C;MACJ;MACA,IAAI,CAAC26C,wBAAwB,GAAG,KAAK;IACzC;IACAhP,YAAY,CAAC,IAAI,CAACn4B,MAAM,CAAC5kB,KAAK,CAAC,EAAE,IAAI,CAAC4kB,MAAM,CAAC;EACjD;EACAunC,SAASA,CAACn6B,QAAQ,EAAE;IAChB5rB,mBAAmB,CAAC,IAAI,CAACwe,MAAM,EAAEoN,QAAQ,CAAC;EAC9C;EACA;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACIo6B,YAAYA,CAAA,EAAG;IACX1B,aAAa,CAAC,IAAI,CAACmB,mBAAmB,IAAI,IAAI,CAACjnC,MAAM,EAAE,CAAC,CAAC,qCAAqC,CAAC;EACnG;EACA;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACIynC,MAAMA,CAAA,EAAG;IACL,IAAI,CAACznC,MAAM,CAAC/mB,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC;EAC/B;EACA;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACIyuD,QAAQA,CAAA,EAAG;IACPnmD,oCAAoC,C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AMC,6BAA6B,GAAGD,qBAAqB,GAAG,KAAK;AACnE,IAAIE,gBAAgB,GAAG,CAAC;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,MAAM,CAAC;EACTC,oBAAoB,GAAG,KAAK;EAC5BC,oBAAoB,GAAG,KAAK;EAC5B;AACJ;AACA;EACIC,QAAQ,GAAG,IAAI;EACf;AACJ;AACA;EACIC,UAAU,GAAG,IAAIjC,YAAY,CAAC,KAAK,CAAC;EACpC;AACJ;AACA;AACA;AACA;EACIkC,gBAAgB,GAAG,IAAIlC,YAAY,CAAC,KAAK,CAAC;EAC1C;AACJ;AACA;AACA;AACA;EACImC,QAAQ,GAAG,IAAInC,YAAY,CAAC,KAAK,CAAC;EAClC;AACJ;AACA;EACIoC,OAAO,GAAG,IAAIpC,YAAY,CAAC,KAAK,CAAC;EACjCluE,WAAWA,CAACs0C,OAAO,EAAE;IACjB,MAAM;MAAEi8B,oBAAoB,GAAG,KAAK;MAAEC,kCAAkC,GAAG,KAAK;MAAEC,gCAAgC,GAAG,KAAK;MAAEC,kBAAkB,GAAGxD;IAA+B,CAAC,GAAG54B,OAAO;IAC3L,IAAI,OAAOsC,IAAI,IAAI,WAAW,EAAE;MAC5B,MAAM,IAAIloD,YAAY,CAAC,GAAG,CAAC,uCAAuCmS,SAAS,IAAI,gDAAgD,CAAC;IACpI;IACA+1C,IAAI,CAAC+5B,iBAAiB,CAAC,CAAC;IACxB,MAAMl8D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BAAwB,EAAE;EACtD,MAAMC,cAAc,GAAG,IAAIhpE,GAAG,CAAC,CAAC;EAChC,MAAMipE,iBAAiB,GAAG,IAAIx8D,GAAG,CAAC,CAAC;EACnC,MAAMy8D,OAAO,GAAGC,qCAAqC,CAACH,cAAc,EAAEC,iBAAiB,CAAC;EACxFlqF,gBAAgB,CAACgqF,wBAAwB,EAAEG,OAAO,EAAE,EAAE,EAAE,IAAIz8D,GAAG,CAAC,CAAC,CAAC;EAClE,OAAOu8D,cAAc;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASG,qCAAqCA,CAACH,cAAc,EAAEC,iBAAiB,EAAE;EAC9E,OAAO,CAACG,QAAQ,EAAEnlE,SAAS,KAAK;IAC5B;IACA;IACA;IACA,IAAI,CAAC+kE,cAAc,CAACz7D,GAAG,CAAC67D,QAAQ,CAAC,EAAE;MAC/BJ,cAAc,CAAC5oE,GAAG,CAACgpE,QAAQ,EAAE,CAACnlE,SAAS,CAAC,CAAC;IAC7C;IACA;IACA;IACA;IACA;IACA,IAAI,CAACglE,iBAAiB,CAAC17D,GAAG,CAACtJ,SAAS,CAAC,EAAE;MACnC;MACA,KAAK,MAAMolE,IAAI,IAAIL,cAAc,CAAC3+E,IAAI,CAAC,CAAC,EAAE;QACtC,MAAMi/E,kBAAkB,GAAG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AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMq0B,eAAe,GAAG,IAAIr6F,cAAc,CAAC4Q,SAAS,GAAG,yBAAyB,GAAG,EAAE,CAAC;AACtF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS0pF,qBAAqBA,CAACC,aAAa,EAAE;EAC1C,OAAO75F,wBAAwB,CAAC,CAC5B;IACI8kB,OAAO,EAAE60E,eAAe;IACxB9/E,KAAK,EAAE,IAAI;IACXmL,QAAQ,EAAE60E;EACd,CAAC,CACJ,CAAC;AACN;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,qBAAqB,CAAC;EACxB;EACA;EACAC,OAAO;EACPC,MAAM;EACNC,WAAW,GAAG,KAAK;EACnBj4B,IAAI,GAAG,KAAK;EACZk4B,WAAW,GAAG,IAAIvoB,OAAO,CAAC,CAAC1hD,GAAG,EAAEkqE,GAAG,KAAK;IACpC,IAAI,CAACJ,OAAO,GAAG9pE,GAAG;IAClB,IAAI,CAAC+pE,MAAM,GAAGG,GAAG;EACrB,CAAC,CAAC;EACFC,QAAQ,GAAG76F,MAAM,CAACo6F,eAAe,EAAE;IAAE91E,QAAQ,EAAE;EAAK,CAAC,CAAC,IAAI,EAAE;EAC5DlC,QAAQ,GAAGp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IACrB,IAAIl8B,SAAS,EAAE;MACX,MAAM4qF,cAAc,GAAGpvF,iBAAiB,CAAC,CAAC;MAC1C0gC,YAAY,GACR0uD,cAAc,IAAIl1C,uBAAuB,CAACk1C,cAAc,CAAC,GACnD,2FAA2F,GAC3F,mDAAmD;IACjE;IACA,MAAM,IAAI/8F,YAAY,CAAC,GAAG,CAAC,0DAA0DquC,YAAY,CAAC;EACtG,CAAC,CAAC;AACN;AACA,SAASk7B,eAAeA,CAACyzB,EAAE,EAAE;EACzB,OAAOA,EAAE,CAACzzB,eAAe;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM0zB,YAAY,CAAC;EACfruF,IAAI;EACJ8C,KAAK;EACLJ,WAAWA,CAAC1C,IAAI,EAAE8C,KAAK,EAAE;IACrB,IAAI,CAAC9C,IAAI,GAAGA,IAAI;IAChB,IAAI,CAAC8C,KAAK,GAAGA,KAAK;EACtB;AACJ;AACA;AACA,MAAMwrF,sBAAsB,GAAG,EAAE;AACjC,SAASC,cAAcA,CAACp/E,GAAG,EAAEq/E,IAAI,EAAE;EAC/B,IAAI3gF,KAAK,CAACC,OAAO,CAAC0gF,IAAI,CAAC,EAAE;IACrB,OAAOA,IAAI,CAACp0E,MAAM,CAACm0E,cAAc,EAAEp/E,GAAG,CAAC;EAC3C;EACA,OAAO;IAAE,GAAGA,GAAG;IAAE,GAAGq/E;EAAK,CAAC;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A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,SAAS,GACvC,CAAC;IAAE4U,OAAO,EAAE5Z,iBAAiB;IAAE8Z,QAAQ,EAAE;EAAK,CAAC,CAAC,GAChD,EAAE,CACX,CAAC;AACN;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS81G,eAAeA,CAAA,EAAG;EACvB,IAAI,OAAOC,iBAAiB,KAAK,WAAW,IACxCA,iBAAiB,IACjB,OAAOC,IAAI,KAAK,WAAW,IAC3BA,IAAI,CAACC,MAAM,KAAK,IAAI,EAAE;IACtB;IACA;IACA;IACA,OAAOD,IAAI,CAACC,MAAM;EACtB,CAAC,MACI;IACD;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA,OAAQ,OAAOC,SAAS,KAAK,WAAW,IAAIA,SAAS,CAAC9sB,MAAM,IAAKe,iBAAiB;EACtF;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMgsB,SAAS,GAAG,IAAI77H,cAAc,CAAC4Q,SAAS,GAAG,UAAU,GAAG,EAAE,EAAE;EAC9DuV,UAAU,EAAE,MAAM;EAClBjU,OAAO,EAAEA,CAAA,KAAMjS,MAAM,CAAC47H,SAAS,EAAE;IAAEt3G,QAAQ,EAAE,IAAI;IAAEE,QAAQ,EAAE;EAAK,CAAC,CAAC,IAAI+2G,eAAe,CAAC;AAC5F,CAAC,CAAC;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMM,qBAAqB,GAAG,IAAI97H,cAAc,CAAC4Q,SAAS,GAAG,qBA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