{"version":3,"file":"core.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/authoring/input/input_signal_node.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/authoring/input/input_signal.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/compiler/compiler_facade_interface.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/di/host_attribute_token.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/di/host_tag_name_token.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/authoring/output/output.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/authoring/input/input.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/authoring/queries.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/authoring/model/model_signal.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/authoring/model/model.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/metadata/di.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/version.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/application/application_ngmodule_factory_compiler.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/image_performance_warning.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/platform/platform_destroy_listeners.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/platform/bootstrap.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/platform/platform_ref.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/platform/platform.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/change_detection/scheduling/exhaustive_check_no_changes.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/change_detection/provide_check_no_changes_config.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/util/is_dev_mode.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/linker/ng_module_factory_loader.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/change_detection/change_detector_ref.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/linker/view_ref.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/change_detection/differs/default_iterable_differ.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/change_detection/differs/default_keyvalue_differ.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/change_detection/differs/iterable_differs.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/change_detection/differs/keyvalue_differs.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/change_detection/change_detection.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/platform/platform_core_providers.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/application/application_module.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/application/create_application.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/hydration/event_replay.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/hydration/annotate.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/hydration/api.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/util/coercion.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/profiler.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/internal/get_closest_component_name.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/jit/partial.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/reactivity/after_render_effect.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/component.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/application/application_config.ts","../../../../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/application/platform_tokens.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {SIGNAL_NODE, SignalNode, signalSetFn} from '../../../primitives/signals';\n\nexport const REQUIRED_UNSET_VALUE: unique symbol = /* @__PURE__ */ Symbol('InputSignalNode#UNSET');\n\n/**\n * Reactive node type for an input signal. An input signal extends a signal.\n * There are special properties to enable transforms and required inputs.\n */\nexport interface InputSignalNode extends SignalNode {\n /**\n * User-configured transform that will run whenever a new value is applied\n * to the input signal node.\n */\n transformFn: ((value: TransformT) => T) | undefined;\n\n /**\n * Applies a new value to the input signal. Expects transforms to be run\n * manually before.\n *\n * This function is called by the framework runtime code whenever a binding\n * changes. The value can in practice be anything at runtime, but for typing\n * purposes we assume it's a valid `T` value. Type-checking will enforce that.\n */\n applyValueToInputSignal(node: InputSignalNode, value: T): void;\n\n /**\n * A debug name for the input signal. Used in Angular DevTools to identify the signal.\n */\n debugName?: string;\n}\n\n// Note: Using an IIFE here to ensure that the spread assignment is not considered\n// a side-effect, ending up preserving `COMPUTED_NODE` and `REACTIVE_NODE`.\n// TODO: remove when https://github.com/evanw/esbuild/issues/3392 is resolved.\nexport const INPUT_SIGNAL_NODE: InputSignalNode = /* @__PURE__ */ (() => {\n return {\n ...SIGNAL_NODE,\n transformFn: undefined,\n\n applyValueToInputSignal(node: InputSignalNode, value: T) {\n signalSetFn(node, value);\n },\n };\n})();\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {producerAccessed, SIGNAL} from '../../../primitives/signals';\n\nimport {RuntimeError, RuntimeErrorCode} from '../../errors';\nimport {Signal} from '../../render3/reactivity/api';\n\nimport {INPUT_SIGNAL_NODE, InputSignalNode, REQUIRED_UNSET_VALUE} from './input_signal_node';\n\n/**\n * @publicAPI\n *\n * Options for signal inputs.\n */\nexport interface InputOptions {\n /** Optional public name for the input. By default, the class field name is used. */\n alias?: string;\n /**\n * Optional transform that runs whenever a new value is bound. Can be used to\n * transform the input value before the input is updated.\n *\n * The transform function can widen the type of the input. For example, consider\n * an input for `disabled`. In practice, as the component author, you want to only\n * deal with a boolean, but users may want to bind a string if they just use the\n * attribute form to bind to the input via ``. A transform can then\n * handle such string values and convert them to `boolean`. See: {@link booleanAttribute}.\n */\n transform?: (v: TransformT) => T;\n\n /**\n * A debug name for the input signal. Used in Angular DevTools to identify the signal.\n */\n debugName?: string;\n}\n\n/**\n * Signal input options without the transform option.\n *\n * @publicApi 19.0\n */\nexport type InputOptionsWithoutTransform =\n // Note: We still keep a notion of `transform` for auto-completion.\n Omit, 'transform'> & {transform?: undefined};\n/**\n * Signal input options with the transform option required.\n *\n * @publicAPI\n */\nexport type InputOptionsWithTransform = Required<\n Pick, 'transform'>\n> &\n InputOptions;\n\nexport const ɵINPUT_SIGNAL_BRAND_READ_TYPE: unique symbol = /* @__PURE__ */ Symbol();\nexport const ɵINPUT_SIGNAL_BRAND_WRITE_TYPE: unique symbol = /* @__PURE__ */ Symbol();\n\n/**\n * `InputSignalWithTransform` represents a special `Signal` for a\n * directive/component input with a `transform` function.\n *\n * Signal inputs with transforms capture an extra generic for their transform write\n * type. Transforms can expand the accepted bound values for an input while ensuring\n * value retrievals of the signal input are still matching the generic input type.\n *\n * ```ts\n * class MyDir {\n * disabled = input(false, {\n * transform: (v: string|boolean) => convertToBoolean(v),\n * }); // InputSignalWithTransform\n *\n * click() {\n * this.disabled() // always returns a `boolean`.\n * }\n * }\n * ```\n *\n * @see {@link InputSignal} for additional information.\n *\n * @publicApi 19.0\n */\nexport interface InputSignalWithTransform extends Signal {\n [SIGNAL]: InputSignalNode;\n [ɵINPUT_SIGNAL_BRAND_READ_TYPE]: T;\n [ɵINPUT_SIGNAL_BRAND_WRITE_TYPE]: TransformT;\n}\n\n/**\n * `InputSignal` represents a special `Signal` for a directive/component input.\n *\n * An input signal is similar to a non-writable signal except that it also\n * carries additional type-information for transforms, and that Angular internally\n * updates the signal whenever a new value is bound.\n *\n * @see {@link InputOptionsWithTransform} for inputs with transforms.\n *\n * @publicApi 19.0\n */\nexport interface InputSignal extends InputSignalWithTransform {}\n\n/**\n * Creates an input signal.\n *\n * @param initialValue The initial value.\n * Can be set to {@link REQUIRED_UNSET_VALUE} for required inputs.\n * @param options Additional options for the input. e.g. a transform, or an alias.\n */\nexport function createInputSignal(\n initialValue: T,\n options?: InputOptions,\n): InputSignalWithTransform {\n const node: InputSignalNode = Object.create(INPUT_SIGNAL_NODE);\n\n node.value = initialValue;\n\n // Perf note: Always set `transformFn` here to ensure that `node` always\n // has the same v8 class shape, allowing monomorphic reads on input signals.\n node.transformFn = options?.transform;\n\n function inputValueFn() {\n // Record that someone looked at this signal.\n producerAccessed(node);\n\n if (node.value === REQUIRED_UNSET_VALUE) {\n let message: string | null = null;\n if (ngDevMode) {\n const name = options?.debugName ?? options?.alias;\n message = `Input${name ? ` \"${name}\"` : ''} is required but no value is available yet.`;\n }\n throw new RuntimeError(RuntimeErrorCode.REQUIRED_INPUT_NO_VALUE, message);\n }\n\n return node.value;\n }\n\n (inputValueFn as any)[SIGNAL] = node;\n\n if (ngDevMode) {\n inputValueFn.toString = () => `[Input Signal: ${inputValueFn()}]`;\n node.debugName = options?.debugName;\n }\n\n return inputValueFn as InputSignalWithTransform;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\n/**\n * A set of interfaces which are shared between `@angular/core` and `@angular/compiler` to allow\n * for late binding of `@angular/compiler` for JIT purposes.\n *\n * This file has two copies. Please ensure that they are in sync:\n * - packages/compiler/src/compiler_facade_interface.ts (main)\n * - packages/core/src/compiler/compiler_facade_interface.ts (replica)\n *\n * Please ensure that the two files are in sync using this command:\n * ```shell\n * cp packages/compiler/src/compiler_facade_interface.ts \\\n * packages/core/src/compiler/compiler_facade_interface.ts\n * ```\n */\n\nexport interface ExportedCompilerFacade {\n ɵcompilerFacade: CompilerFacade;\n}\n\nexport interface CompilerFacade {\n compilePipe(\n angularCoreEnv: CoreEnvironment,\n sourceMapUrl: string,\n meta: R3PipeMetadataFacade,\n ): any;\n compilePipeDeclaration(\n angularCoreEnv: CoreEnvironment,\n sourceMapUrl: string,\n declaration: R3DeclarePipeFacade,\n ): any;\n compileInjectable(\n angularCoreEnv: CoreEnvironment,\n sourceMapUrl: string,\n meta: R3InjectableMetadataFacade,\n ): any;\n compileInjectableDeclaration(\n angularCoreEnv: CoreEnvironment,\n sourceMapUrl: string,\n meta: R3DeclareInjectableFacade,\n ): any;\n compileInjector(\n angularCoreEnv: CoreEnvironment,\n sourceMapUrl: string,\n meta: R3InjectorMetadataFacade,\n ): any;\n compileInjectorDeclaration(\n angularCoreEnv: CoreEnvironment,\n sourceMapUrl: string,\n declaration: R3DeclareInjectorFacade,\n ): any;\n compileNgModule(\n angularCoreEnv: CoreEnvironment,\n sourceMapUrl: string,\n meta: R3NgModuleMetadataFacade,\n ): any;\n compileNgModuleDeclaration(\n angularCoreEnv: CoreEnvironment,\n sourceMapUrl: string,\n declaration: R3DeclareNgModuleFacade,\n ): any;\n compileDirective(\n angularCoreEnv: CoreEnvironment,\n sourceMapUrl: string,\n meta: R3DirectiveMetadataFacade,\n ): any;\n compileDirectiveDeclaration(\n angularCoreEnv: CoreEnvironment,\n sourceMapUrl: string,\n declaration: R3DeclareDirectiveFacade,\n ): any;\n compileComponent(\n angularCoreEnv: CoreEnvironment,\n sourceMapUrl: string,\n meta: R3ComponentMetadataFacade,\n ): any;\n compileComponentDeclaration(\n angularCoreEnv: CoreEnvironment,\n sourceMapUrl: string,\n declaration: R3DeclareComponentFacade,\n ): any;\n compileFactory(\n angularCoreEnv: CoreEnvironment,\n sourceMapUrl: string,\n meta: R3FactoryDefMetadataFacade,\n ): any;\n compileFactoryDeclaration(\n angularCoreEnv: CoreEnvironment,\n sourceMapUrl: string,\n meta: R3DeclareFactoryFacade,\n ): any;\n\n createParseSourceSpan(kind: string, typeName: string, sourceUrl: string): ParseSourceSpan;\n\n FactoryTarget: typeof FactoryTarget;\n // Note that we do not use `{new(): ResourceLoader}` here because\n // the resource loader class is abstract and not constructable.\n ResourceLoader: Function & {prototype: ResourceLoader};\n}\n\nexport interface CoreEnvironment {\n [name: string]: unknown;\n}\n\nexport type ResourceLoader = {\n get(url: string): Promise | string;\n};\n\nexport type Provider = unknown;\nexport type Type = Function;\nexport type OpaqueValue = unknown;\n\nexport enum FactoryTarget {\n Directive = 0,\n Component = 1,\n Injectable = 2,\n Pipe = 3,\n NgModule = 4,\n}\n\nexport interface R3DependencyMetadataFacade {\n token: OpaqueValue;\n attribute: string | null;\n host: boolean;\n optional: boolean;\n self: boolean;\n skipSelf: boolean;\n}\n\nexport interface R3DeclareDependencyMetadataFacade {\n token: OpaqueValue;\n attribute?: boolean;\n host?: boolean;\n optional?: boolean;\n self?: boolean;\n skipSelf?: boolean;\n}\n\nexport interface R3PipeMetadataFacade {\n name: string;\n type: Type;\n pipeName: string;\n pure: boolean;\n isStandalone: boolean;\n}\n\nexport interface R3InjectableMetadataFacade {\n name: string;\n type: Type;\n typeArgumentCount: number;\n providedIn?: Type | 'root' | 'platform' | 'any' | null;\n useClass?: OpaqueValue;\n useFactory?: OpaqueValue;\n useExisting?: OpaqueValue;\n useValue?: OpaqueValue;\n deps?: R3DependencyMetadataFacade[];\n}\n\nexport interface R3NgModuleMetadataFacade {\n type: Type;\n bootstrap: Function[];\n declarations: Function[];\n imports: Function[];\n exports: Function[];\n schemas: {name: string}[] | null;\n id: string | null;\n}\n\nexport interface R3InjectorMetadataFacade {\n name: string;\n type: Type;\n providers: Provider[];\n imports: OpaqueValue[];\n}\n\nexport interface R3HostDirectiveMetadataFacade {\n directive: Type;\n inputs?: string[];\n outputs?: string[];\n}\n\nexport interface R3DirectiveMetadataFacade {\n name: string;\n type: Type;\n typeSourceSpan: ParseSourceSpan;\n selector: string | null;\n queries: R3QueryMetadataFacade[];\n host: {[key: string]: string};\n propMetadata: {[key: string]: OpaqueValue[]};\n lifecycle: {usesOnChanges: boolean};\n inputs: (string | {name: string; alias?: string; required?: boolean})[];\n outputs: string[];\n usesInheritance: boolean;\n exportAs: string[] | null;\n providers: Provider[] | null;\n viewQueries: R3QueryMetadataFacade[];\n isStandalone: boolean;\n isSignal: boolean;\n hostDirectives: R3HostDirectiveMetadataFacade[] | null;\n}\n\nexport interface R3ComponentMetadataFacade extends R3DirectiveMetadataFacade {\n template: string;\n preserveWhitespaces: boolean;\n animations: OpaqueValue[] | undefined;\n declarations: R3TemplateDependencyFacade[];\n styles: string[];\n encapsulation: ViewEncapsulation;\n viewProviders: Provider[] | null;\n interpolation?: [string, string];\n changeDetection?: ChangeDetectionStrategy;\n}\n\n// TODO(legacy-partial-output-inputs): Remove in v18.\n// https://github.com/angular/angular/blob/d4b423690210872b5c32a322a6090beda30b05a3/packages/core/src/compiler/compiler_facade_interface.ts#L197-L199\nexport type LegacyInputPartialMapping =\n | string\n | [bindingPropertyName: string, classPropertyName: string, transformFunction?: Function];\n\nexport interface R3DeclareDirectiveFacade {\n selector?: string;\n type: Type;\n version: string;\n inputs?: {\n [fieldName: string]:\n | {\n classPropertyName: string;\n publicName: string;\n isSignal: boolean;\n isRequired: boolean;\n transformFunction: Function | null;\n }\n | LegacyInputPartialMapping;\n };\n outputs?: {[classPropertyName: string]: string};\n host?: {\n attributes?: {[key: string]: OpaqueValue};\n listeners?: {[key: string]: string};\n properties?: {[key: string]: string};\n classAttribute?: string;\n styleAttribute?: string;\n };\n queries?: R3DeclareQueryMetadataFacade[];\n viewQueries?: R3DeclareQueryMetadataFacade[];\n providers?: OpaqueValue;\n exportAs?: string[];\n usesInheritance?: boolean;\n usesOnChanges?: boolean;\n isStandalone?: boolean;\n hostDirectives?: R3HostDirectiveMetadataFacade[] | null;\n isSignal?: boolean;\n}\n\nexport interface R3DeclareComponentFacade extends R3DeclareDirectiveFacade {\n template: string;\n isInline?: boolean;\n styles?: string[];\n\n // Post-standalone libraries use a unified dependencies field.\n dependencies?: R3DeclareTemplateDependencyFacade[];\n\n // Pre-standalone libraries have separate component/directive/pipe fields:\n components?: R3DeclareDirectiveDependencyFacade[];\n directives?: R3DeclareDirectiveDependencyFacade[];\n pipes?: {[pipeName: string]: OpaqueValue | (() => OpaqueValue)};\n\n deferBlockDependencies?: (() => Promise | null)[];\n viewProviders?: OpaqueValue;\n animations?: OpaqueValue;\n changeDetection?: ChangeDetectionStrategy;\n encapsulation?: ViewEncapsulation;\n interpolation?: [string, string];\n preserveWhitespaces?: boolean;\n}\n\nexport type R3DeclareTemplateDependencyFacade = {\n kind: string;\n} & (\n | R3DeclareDirectiveDependencyFacade\n | R3DeclarePipeDependencyFacade\n | R3DeclareNgModuleDependencyFacade\n);\n\nexport interface R3DeclareDirectiveDependencyFacade {\n kind?: 'directive' | 'component';\n selector: string;\n type: OpaqueValue | (() => OpaqueValue);\n inputs?: string[];\n outputs?: string[];\n exportAs?: string[];\n}\n\nexport interface R3DeclarePipeDependencyFacade {\n kind?: 'pipe';\n name: string;\n type: OpaqueValue | (() => OpaqueValue);\n}\n\nexport interface R3DeclareNgModuleDependencyFacade {\n kind: 'ngmodule';\n type: OpaqueValue | (() => OpaqueValue);\n}\n\nexport enum R3TemplateDependencyKind {\n Directive = 0,\n Pipe = 1,\n NgModule = 2,\n}\n\nexport interface R3TemplateDependencyFacade {\n kind: R3TemplateDependencyKind;\n type: OpaqueValue | (() => OpaqueValue);\n}\nexport interface R3FactoryDefMetadataFacade {\n name: string;\n type: Type;\n typeArgumentCount: number;\n deps: R3DependencyMetadataFacade[] | null;\n target: FactoryTarget;\n}\n\nexport interface R3DeclareFactoryFacade {\n type: Type;\n deps: R3DeclareDependencyMetadataFacade[] | 'invalid' | null;\n target: FactoryTarget;\n}\n\nexport interface R3DeclareInjectableFacade {\n type: Type;\n providedIn?: Type | 'root' | 'platform' | 'any' | null;\n useClass?: OpaqueValue;\n useFactory?: OpaqueValue;\n useExisting?: OpaqueValue;\n useValue?: OpaqueValue;\n deps?: R3DeclareDependencyMetadataFacade[];\n}\n\nexport enum ViewEncapsulation {\n Emulated = 0,\n // Historically the 1 value was for `Native` encapsulation which has been removed as of v11.\n None = 2,\n ShadowDom = 3,\n}\n\nexport type ChangeDetectionStrategy = number;\n\nexport interface R3QueryMetadataFacade {\n propertyName: string;\n first: boolean;\n predicate: OpaqueValue | string[];\n descendants: boolean;\n emitDistinctChangesOnly: boolean;\n read: OpaqueValue | null;\n static: boolean;\n isSignal: boolean;\n}\n\nexport interface R3DeclareQueryMetadataFacade {\n propertyName: string;\n first?: boolean;\n predicate: OpaqueValue | string[];\n descendants?: boolean;\n read?: OpaqueValue;\n static?: boolean;\n emitDistinctChangesOnly?: boolean;\n isSignal?: boolean;\n}\n\nexport interface R3DeclareInjectorFacade {\n type: Type;\n imports?: OpaqueValue[];\n providers?: OpaqueValue[];\n}\n\nexport interface R3DeclareNgModuleFacade {\n type: Type;\n bootstrap?: OpaqueValue[] | (() => OpaqueValue[]);\n declarations?: OpaqueValue[] | (() => OpaqueValue[]);\n imports?: OpaqueValue[] | (() => OpaqueValue[]);\n exports?: OpaqueValue[] | (() => OpaqueValue[]);\n schemas?: OpaqueValue[];\n id?: OpaqueValue;\n}\n\nexport interface R3DeclarePipeFacade {\n type: Type;\n name: string;\n version: string;\n pure?: boolean;\n isStandalone?: boolean;\n}\n\nexport interface ParseSourceSpan {\n start: any;\n end: any;\n details: any;\n fullStart: any;\n}\n","/*!\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {ɵɵinjectAttribute} from '../render3/instructions/di_attr';\n\n/**\n * Creates a token that can be used to inject static attributes of the host node.\n *\n * @usageNotes\n * ### Injecting an attribute that is known to exist\n * ```ts\n * @Directive()\n * class MyDir {\n * attr: string = inject(new HostAttributeToken('some-attr'));\n * }\n * ```\n *\n * ### Optionally injecting an attribute\n * ```ts\n * @Directive()\n * class MyDir {\n * attr: string | null = inject(new HostAttributeToken('some-attr'), {optional: true});\n * }\n * ```\n * @publicApi\n */\nexport class HostAttributeToken {\n constructor(private attributeName: string) {}\n\n /** @internal */\n __NG_ELEMENT_ID__ = () => ɵɵinjectAttribute(this.attributeName);\n\n toString(): string {\n return `HostAttributeToken ${this.attributeName}`;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {RuntimeError, RuntimeErrorCode} from '../errors';\nimport {TNode, TNodeType} from '../render3/interfaces/node';\nimport {getCurrentTNode} from '../render3/state';\n\nimport {InjectionToken} from './injection_token';\nimport {InternalInjectFlags} from './interface/injector';\n\n/**\n * A token that can be used to inject the tag name of the host node.\n *\n * @usageNotes\n * ### Injecting a tag name that is known to exist\n * ```ts\n * @Directive()\n * class MyDir {\n * tagName: string = inject(HOST_TAG_NAME);\n * }\n * ```\n *\n * ### Optionally injecting a tag name\n * ```ts\n * @Directive()\n * class MyDir {\n * tagName: string | null = inject(HOST_TAG_NAME, {optional: true});\n * }\n * ```\n * @publicApi\n */\nexport const HOST_TAG_NAME = new InjectionToken(ngDevMode ? 'HOST_TAG_NAME' : '');\n\n// HOST_TAG_NAME should be resolved at the current node, similar to e.g. ElementRef,\n// so we manually specify __NG_ELEMENT_ID__ here, instead of using a factory.\n// tslint:disable-next-line:no-toplevel-property-access\n(HOST_TAG_NAME as any).__NG_ELEMENT_ID__ = (flags: InternalInjectFlags) => {\n const tNode = getCurrentTNode();\n if (tNode === null) {\n throw new RuntimeError(\n RuntimeErrorCode.INVALID_INJECTION_TOKEN,\n ngDevMode &&\n 'HOST_TAG_NAME can only be injected in directives and components ' +\n 'during construction time (in a class constructor or as a class field initializer)',\n );\n }\n if (tNode.type & TNodeType.Element) {\n return tNode.value;\n }\n if (flags & InternalInjectFlags.Optional) {\n return null;\n }\n throw new RuntimeError(\n RuntimeErrorCode.INVALID_INJECTION_TOKEN,\n ngDevMode &&\n `HOST_TAG_NAME was used on ${getDevModeNodeName(\n tNode,\n )} which doesn't have an underlying element in the DOM. ` +\n `This is invalid, and so the dependency should be marked as optional.`,\n );\n};\n\nfunction getDevModeNodeName(tNode: TNode) {\n if (tNode.type & TNodeType.ElementContainer) {\n return 'an ';\n } else if (tNode.type & TNodeType.Container) {\n return 'an ';\n } else if (tNode.type & TNodeType.LetDeclaration) {\n return 'an @let declaration';\n } else {\n return 'a node';\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {assertInInjectionContext} from '../../di';\n\nimport {OutputEmitterRef} from './output_emitter_ref';\n\n/**\n * Options for declaring an output.\n *\n * @publicApi 19.0\n */\nexport interface OutputOptions {\n alias?: string;\n}\n\n/**\n * The `output` function allows declaration of Angular outputs in\n * directives and components.\n *\n * You can use outputs to emit values to parent directives and component.\n * Parents can subscribe to changes via:\n *\n * - template event bindings. For example, `(myOutput)=\"doSomething($event)\"`\n * - programmatic subscription by using `OutputRef#subscribe`.\n *\n * @usageNotes\n *\n * To use `output()`, import the function from `@angular/core`.\n *\n * ```ts\n * import {output} from '@angular/core';\n * ```\n *\n * Inside your component, introduce a new class member and initialize\n * it with a call to `output`.\n *\n * ```ts\n * @Directive({\n * ...\n * })\n * export class MyDir {\n * nameChange = output(); // OutputEmitterRef\n * onClick = output(); // OutputEmitterRef\n * }\n * ```\n *\n * You can emit values to consumers of your directive, by using\n * the `emit` method from `OutputEmitterRef`.\n *\n * ```ts\n * updateName(newName: string): void {\n * this.nameChange.emit(newName);\n * }\n * ```\n * @initializerApiFunction {\"showTypesInSignaturePreview\": true}\n * @publicApi 19.0\n */\nexport function output(opts?: OutputOptions): OutputEmitterRef {\n ngDevMode && assertInInjectionContext(output);\n return new OutputEmitterRef();\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {assertInInjectionContext} from '../../di';\n\nimport {\n createInputSignal,\n InputOptions,\n InputOptionsWithoutTransform,\n InputOptionsWithTransform,\n InputSignal,\n InputSignalWithTransform,\n} from './input_signal';\nimport {REQUIRED_UNSET_VALUE} from './input_signal_node';\n\nexport function inputFunction(\n initialValue?: ReadT,\n opts?: InputOptions,\n): InputSignalWithTransform {\n ngDevMode && assertInInjectionContext(input);\n return createInputSignal(initialValue, opts);\n}\n\nexport function inputRequiredFunction(\n opts?: InputOptions,\n): InputSignalWithTransform {\n ngDevMode && assertInInjectionContext(input);\n return createInputSignal(REQUIRED_UNSET_VALUE as never, opts);\n}\n\n/**\n * The `input` function allows declaration of inputs in directives and\n * components.\n *\n * The function exposes an API for also declaring required inputs via the\n * `input.required` function.\n *\n * @publicAPI\n * @docsPrivate Ignored because `input` is the canonical API entry.\n */\nexport interface InputFunction {\n /**\n * Initializes an input of type `T` with an initial value of `undefined`.\n * Angular will implicitly use `undefined` as initial value.\n */\n (): InputSignal;\n /** Declares an input of type `T` with an explicit initial value. */\n (initialValue: T, opts?: InputOptionsWithoutTransform): InputSignal;\n /** Declares an input of type `T|undefined` without an initial value, but with input options */\n (initialValue: undefined, opts: InputOptionsWithoutTransform): InputSignal;\n /**\n * Declares an input of type `T` with an initial value and a transform\n * function.\n *\n * The input accepts values of type `TransformT` and the given\n * transform function will transform the value to type `T`.\n */\n (\n initialValue: T,\n opts: InputOptionsWithTransform,\n ): InputSignalWithTransform;\n /**\n * Declares an input of type `T|undefined` without an initial value and with a transform\n * function.\n *\n * The input accepts values of type `TransformT` and the given\n * transform function will transform the value to type `T|undefined`.\n */ (\n initialValue: undefined,\n opts: InputOptionsWithTransform,\n ): InputSignalWithTransform;\n\n /**\n * Initializes a required input.\n *\n * Consumers of your directive/component need to bind to this\n * input. If unset, a compile time error will be reported.\n *\n * @publicAPI\n */\n required: {\n /** Declares a required input of type `T`. */\n (opts?: InputOptionsWithoutTransform): InputSignal;\n /**\n * Declares a required input of type `T` with a transform function.\n *\n * The input accepts values of type `TransformT` and the given\n * transform function will transform the value to type `T`.\n */\n (\n opts: InputOptionsWithTransform,\n ): InputSignalWithTransform;\n };\n}\n\n/**\n * The `input` function allows declaration of Angular inputs in directives\n * and components.\n *\n * There are two variants of inputs that can be declared:\n *\n * 1. **Optional inputs** with an initial value.\n * 2. **Required inputs** that consumers need to set.\n *\n * By default, the `input` function will declare optional inputs that\n * always have an initial value. Required inputs can be declared\n * using the `input.required()` function.\n *\n * Inputs are signals. The values of an input are exposed as a `Signal`.\n * The signal always holds the latest value of the input that is bound\n * from the parent.\n *\n * @usageNotes\n * To use signal-based inputs, import `input` from `@angular/core`.\n *\n * ```ts\n * import {input} from '@angular/core`;\n * ```\n *\n * Inside your component, introduce a new class member and initialize\n * it with a call to `input` or `input.required`.\n *\n * ```ts\n * @Component({\n * ...\n * })\n * export class UserProfileComponent {\n * firstName = input(); // Signal\n * lastName = input.required(); // Signal\n * age = input(0) // Signal\n * }\n * ```\n *\n * Inside your component template, you can display values of the inputs\n * by calling the signal.\n *\n * ```html\n * {{firstName()}}\n * ```\n *\n * @publicAPI\n * @initializerApiFunction\n */\nexport const input: InputFunction = (() => {\n // Note: This may be considered a side-effect, but nothing will depend on\n // this assignment, unless this `input` constant export is accessed. It's a\n // self-contained side effect that is local to the user facing`input` export.\n (inputFunction as any).required = inputRequiredFunction;\n return inputFunction as typeof inputFunction & {required: typeof inputRequiredFunction};\n})();\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {assertInInjectionContext} from '../di';\nimport {ProviderToken} from '../di/provider_token';\nimport {\n createMultiResultQuerySignalFn,\n createSingleResultOptionalQuerySignalFn,\n createSingleResultRequiredQuerySignalFn,\n} from '../render3/queries/query_reactive';\nimport {Signal} from '../render3/reactivity/api';\n\nfunction viewChildFn(\n locator: ProviderToken | string,\n opts?: {read?: ProviderToken; debugName?: string},\n): Signal {\n ngDevMode && assertInInjectionContext(viewChild);\n return createSingleResultOptionalQuerySignalFn(opts);\n}\n\nfunction viewChildRequiredFn(\n locator: ProviderToken | string,\n opts?: {read?: ProviderToken; debugName?: string},\n): Signal {\n ngDevMode && assertInInjectionContext(viewChild);\n return createSingleResultRequiredQuerySignalFn(opts);\n}\n\n/**\n * Type of the `viewChild` function. The viewChild function creates a singular view query.\n *\n * It is a special function that also provides access to required query results via the `.required`\n * property.\n *\n * @publicApi\n * @docsPrivate Ignored because `viewChild` is the canonical API entry.\n */\nexport interface ViewChildFunction {\n /**\n * Initializes a view child query. Consider using `viewChild.required` for queries that should\n * always match.\n *\n * @publicAPI\n */\n\n (\n locator: ProviderToken | string,\n opts: {\n read: ProviderToken;\n debugName?: string;\n },\n ): Signal;\n\n (\n locator: ProviderToken | string,\n opts?: {\n debugName?: string;\n },\n ): Signal;\n\n /**\n * Initializes a view child query that is expected to always match an element.\n *\n * @publicAPI\n */\n required: {\n (\n locator: ProviderToken | string,\n opts?: {\n debugName?: string;\n },\n ): Signal;\n\n (\n locator: ProviderToken | string,\n opts: {\n read: ProviderToken;\n debugName?: string;\n },\n ): Signal;\n };\n}\n\n/**\n * Initializes a view child query.\n *\n * Consider using `viewChild.required` for queries that should always match.\n *\n * @usageNotes\n * Create a child query in your component by declaring a\n * class field and initializing it with the `viewChild()` function.\n *\n * ```angular-ts\n * @Component({template: '
'})\n * export class TestComponent {\n * divEl = viewChild('el'); // Signal\n * divElRequired = viewChild.required('el'); // Signal\n * cmp = viewChild(MyComponent); // Signal\n * cmpRequired = viewChild.required(MyComponent); // Signal\n * }\n * ```\n *\n * @publicApi 19.0\n * @initializerApiFunction\n */\nexport const viewChild: ViewChildFunction = (() => {\n // Note: This may be considered a side-effect, but nothing will depend on\n // this assignment, unless this `viewChild` constant export is accessed. It's a\n // self-contained side effect that is local to the user facing `viewChild` export.\n (viewChildFn as any).required = viewChildRequiredFn;\n return viewChildFn as typeof viewChildFn & {required: typeof viewChildRequiredFn};\n})();\n\nexport function viewChildren(\n locator: ProviderToken | string,\n opts?: {debugName?: string},\n): Signal>;\nexport function viewChildren(\n locator: ProviderToken | string,\n opts: {\n read: ProviderToken;\n debugName?: string;\n },\n): Signal>;\n\n/**\n * Initializes a view children query.\n *\n * Query results are represented as a signal of a read-only collection containing all matched\n * elements.\n *\n * @usageNotes\n * Create a children query in your component by declaring a\n * class field and initializing it with the `viewChildren()` function.\n *\n * ```ts\n * @Component({...})\n * export class TestComponent {\n * divEls = viewChildren('el'); // Signal>\n * }\n * ```\n *\n * @initializerApiFunction\n * @publicApi 19.0\n */\nexport function viewChildren(\n locator: ProviderToken | string,\n opts?: {\n read?: ProviderToken;\n debugName?: string;\n },\n): Signal> {\n ngDevMode && assertInInjectionContext(viewChildren);\n return createMultiResultQuerySignalFn(opts);\n}\n\nexport function contentChildFn(\n locator: ProviderToken | string,\n opts?: {\n descendants?: boolean;\n read?: ProviderToken;\n debugName?: string;\n },\n): Signal {\n ngDevMode && assertInInjectionContext(contentChild);\n return createSingleResultOptionalQuerySignalFn(opts);\n}\n\nfunction contentChildRequiredFn(\n locator: ProviderToken | string,\n opts?: {\n descendants?: boolean;\n read?: ProviderToken;\n debugName?: string;\n },\n): Signal {\n ngDevMode && assertInInjectionContext(contentChildren);\n return createSingleResultRequiredQuerySignalFn(opts);\n}\n\n/**\n * Type of the `contentChild` function.\n *\n * The contentChild function creates a singular content query. It is a special function that also\n * provides access to required query results via the `.required` property.\n *\n * @publicApi 19.0\n * @docsPrivate Ignored because `contentChild` is the canonical API entry.\n */\nexport interface ContentChildFunction {\n /**\n * Initializes a content child query.\n *\n * Consider using `contentChild.required` for queries that should always match.\n * @publicAPI\n */\n (\n locator: ProviderToken | string,\n opts?: {\n descendants?: boolean;\n read?: undefined;\n debugName?: string;\n },\n ): Signal;\n\n (\n locator: ProviderToken | string,\n opts: {\n descendants?: boolean;\n read: ProviderToken;\n debugName?: string;\n },\n ): Signal;\n\n /**\n * Initializes a content child query that is always expected to match.\n */\n required: {\n (\n locator: ProviderToken | string,\n opts?: {\n descendants?: boolean;\n read?: undefined;\n debugName?: string;\n },\n ): Signal;\n\n (\n locator: ProviderToken | string,\n opts: {\n descendants?: boolean;\n read: ProviderToken;\n debugName?: string;\n },\n ): Signal;\n };\n}\n\n/**\n * Initializes a content child query. Consider using `contentChild.required` for queries that should\n * always match.\n *\n * @usageNotes\n * Create a child query in your component by declaring a\n * class field and initializing it with the `contentChild()` function.\n *\n * ```ts\n * @Component({...})\n * export class TestComponent {\n * headerEl = contentChild('h'); // Signal\n * headerElElRequired = contentChild.required('h'); // Signal\n * header = contentChild(MyHeader); // Signal\n * headerRequired = contentChild.required(MyHeader); // Signal\n * }\n * ```\n *\n * Note: By default `descendants` is `true` which means the query will traverse all descendants in the same template.\n *\n * @initializerApiFunction\n * @publicApi 19.0\n */\nexport const contentChild: ContentChildFunction = (() => {\n // Note: This may be considered a side-effect, but nothing will depend on\n // this assignment, unless this `viewChild` constant export is accessed. It's a\n // self-contained side effect that is local to the user facing `viewChild` export.\n (contentChildFn as any).required = contentChildRequiredFn;\n return contentChildFn as typeof contentChildFn & {required: typeof contentChildRequiredFn};\n})();\n\nexport function contentChildren(\n locator: ProviderToken | string,\n opts?: {\n descendants?: boolean;\n read?: undefined;\n debugName?: string;\n },\n): Signal>;\nexport function contentChildren(\n locator: ProviderToken | string,\n opts: {\n descendants?: boolean;\n read: ProviderToken;\n debugName?: string;\n },\n): Signal>;\n\n/**\n * Initializes a content children query.\n *\n * Query results are represented as a signal of a read-only collection containing all matched\n * elements.\n *\n * @usageNotes\n * Create a children query in your component by declaring a\n * class field and initializing it with the `contentChildren()` function.\n *\n * ```ts\n * @Component({...})\n * export class TestComponent {\n * headerEl = contentChildren('h'); // Signal>\n * }\n * ```\n *\n * Note: By default `descendants` is `false` which means the query will not traverse all descendants in the same template.\n *\n * @initializerApiFunction\n * @publicApi 19.0\n */\nexport function contentChildren(\n locator: ProviderToken | string,\n opts?: {\n descendants?: boolean;\n read?: ProviderToken;\n debugName?: string;\n },\n): Signal> {\n return createMultiResultQuerySignalFn(opts);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {producerAccessed, SIGNAL, signalSetFn} from '../../../primitives/signals';\n\nimport {RuntimeError, RuntimeErrorCode} from '../../errors';\nimport {Signal} from '../../render3/reactivity/api';\nimport {\n signalAsReadonlyFn,\n WritableSignal,\n ɵWRITABLE_SIGNAL,\n} from '../../render3/reactivity/signal';\nimport {\n InputSignal,\n ɵINPUT_SIGNAL_BRAND_READ_TYPE,\n ɵINPUT_SIGNAL_BRAND_WRITE_TYPE,\n} from '../input/input_signal';\nimport {INPUT_SIGNAL_NODE, InputSignalNode, REQUIRED_UNSET_VALUE} from '../input/input_signal_node';\nimport {OutputEmitterRef} from '../output/output_emitter_ref';\nimport {OutputRef} from '../output/output_ref';\n\n/**\n * @publicAPI\n *\n * Options for model signals.\n */\nexport interface ModelOptions {\n /**\n * Optional public name of the input side of the model. The output side will have the same\n * name as the input, but suffixed with `Change`. By default, the class field name is used.\n */\n alias?: string;\n\n /**\n * A debug name for the model signal. Used in Angular DevTools to identify the signal.\n */\n debugName?: string;\n}\n\n/**\n * `ModelSignal` represents a special `Signal` for a directive/component model field.\n *\n * A model signal is a writeable signal that can be exposed as an output.\n * Whenever its value is updated, it emits to the output.\n *\n * @publicAPI\n */\nexport interface ModelSignal extends WritableSignal, InputSignal, OutputRef {\n [SIGNAL]: InputSignalNode;\n}\n\n/**\n * Creates a model signal.\n *\n * @param initialValue The initial value.\n * Can be set to {@link REQUIRED_UNSET_VALUE} for required model signals.\n * @param options Additional options for the model.\n */\nexport function createModelSignal(initialValue: T, opts?: ModelOptions): ModelSignal {\n const node: InputSignalNode = Object.create(INPUT_SIGNAL_NODE);\n const emitterRef = new OutputEmitterRef();\n\n node.value = initialValue;\n\n function getter(): T {\n producerAccessed(node);\n assertModelSet(node.value);\n return node.value;\n }\n\n getter[SIGNAL] = node;\n getter.asReadonly = signalAsReadonlyFn.bind(getter as any) as () => Signal;\n\n // TODO: Should we throw an error when updating a destroyed model?\n getter.set = (newValue: T) => {\n if (!node.equal(node.value, newValue)) {\n signalSetFn(node, newValue);\n emitterRef.emit(newValue);\n }\n };\n\n getter.update = (updateFn: (value: T) => T) => {\n assertModelSet(node.value);\n getter.set(updateFn(node.value));\n };\n\n getter.subscribe = emitterRef.subscribe.bind(emitterRef);\n getter.destroyRef = emitterRef.destroyRef;\n\n if (ngDevMode) {\n getter.toString = () => `[Model Signal: ${getter()}]`;\n node.debugName = opts?.debugName;\n }\n\n return getter as typeof getter &\n Pick<\n ModelSignal,\n | typeof ɵINPUT_SIGNAL_BRAND_READ_TYPE\n | typeof ɵINPUT_SIGNAL_BRAND_WRITE_TYPE\n | typeof ɵWRITABLE_SIGNAL\n >;\n}\n\n/** Asserts that a model's value is set. */\nfunction assertModelSet(value: unknown): void {\n if (value === REQUIRED_UNSET_VALUE) {\n throw new RuntimeError(\n RuntimeErrorCode.REQUIRED_MODEL_NO_VALUE,\n ngDevMode && 'Model is required but no value is available yet.',\n );\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {assertInInjectionContext} from '../../di';\nimport {REQUIRED_UNSET_VALUE} from '../input/input_signal_node';\n\nimport {createModelSignal, ModelOptions, ModelSignal} from './model_signal';\n\nexport function modelFunction(\n initialValue?: T,\n opts?: ModelOptions,\n): ModelSignal {\n ngDevMode && assertInInjectionContext(model);\n\n return createModelSignal(initialValue, opts);\n}\n\nexport function modelRequiredFunction(opts?: ModelOptions): ModelSignal {\n ngDevMode && assertInInjectionContext(model);\n\n return createModelSignal(REQUIRED_UNSET_VALUE as T, opts);\n}\n\n/**\n * `model` declares a writeable signal that is exposed as an input/output pair on the containing\n * directive. The input name is taken either from the class member or from the `alias` option.\n * The output name is generated by taking the input name and appending `Change`.\n *\n * The function exposes an API for also declaring required models via the\n * `model.required` function.\n *\n * @publicAPI\n * @docsPrivate Ignored because `model` is the canonical API entry.\n */\nexport interface ModelFunction {\n /**\n * Initializes a model of type `T` with an initial value of `undefined`.\n * Angular will implicitly use `undefined` as initial value.\n */\n (): ModelSignal;\n /** Initializes a model of type `T` with the given initial value. */\n (initialValue: T, opts?: ModelOptions): ModelSignal;\n\n required: {\n /**\n * Initializes a required model.\n *\n * Users of your directive/component need to bind to the input side of the model.\n * If unset, a compile time error will be reported.\n */\n (opts?: ModelOptions): ModelSignal;\n };\n}\n\n/**\n * `model` declares a writeable signal that is exposed as an input/output\n * pair on the containing directive.\n *\n * The input name is taken either from the class member or from the `alias` option.\n * The output name is generated by taking the input name and appending `Change`.\n *\n * @usageNotes\n *\n * To use `model()`, import the function from `@angular/core`.\n *\n * ```ts\n * import {model} from '@angular/core`;\n * ```\n *\n * Inside your component, introduce a new class member and initialize\n * it with a call to `model` or `model.required`.\n *\n * ```ts\n * @Directive({\n * ...\n * })\n * export class MyDir {\n * firstName = model(); // ModelSignal\n * lastName = model.required(); // ModelSignal\n * age = model(0); // ModelSignal\n * }\n * ```\n *\n * Inside your component template, you can display the value of a `model`\n * by calling the signal.\n *\n * ```html\n * {{firstName()}}\n * ```\n *\n * Updating the `model` is equivalent to updating a writable signal.\n *\n * ```ts\n * updateName(newFirstName: string): void {\n * this.firstName.set(newFirstName);\n * }\n * ```\n *\n * @publicApi 19.0\n * @initializerApiFunction\n */\nexport const model: ModelFunction = (() => {\n // Note: This may be considered a side-effect, but nothing will depend on\n // this assignment, unless this `model` constant export is accessed. It's a\n // self-contained side effect that is local to the user facing `model` export.\n (modelFunction as any).required = modelRequiredFunction;\n return modelFunction as typeof modelFunction & {required: typeof modelRequiredFunction};\n})();\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {ProviderToken} from '../di/provider_token';\nimport {makePropDecorator} from '../util/decorators';\n\n/**\n * Type of the `Attribute` decorator / constructor function.\n *\n * @publicApi\n */\nexport interface AttributeDecorator {\n /**\n * Specifies that a constant attribute value should be injected.\n *\n * The directive can inject constant string literals of host element attributes.\n *\n * @usageNotes\n *\n * Suppose we have an `` element and want to know its `type`.\n *\n * ```html\n * \n * ```\n *\n * A decorator can inject string literal `text` as in the following example.\n *\n * {@example core/ts/metadata/metadata.ts region='attributeMetadata'}\n *\n * @publicApi\n */\n (name: string): any;\n new (name: string): Attribute;\n}\n\n/**\n * Type of the Attribute metadata.\n *\n * @publicApi\n */\nexport interface Attribute {\n /**\n * The name of the attribute to be injected into the constructor.\n */\n attributeName?: string;\n}\n\n/**\n * Type of the Query metadata.\n *\n * @publicApi\n */\nexport interface Query {\n descendants: boolean;\n emitDistinctChangesOnly: boolean;\n first: boolean;\n read: any;\n isViewQuery: boolean;\n selector: any;\n static?: boolean;\n\n /**\n * @internal\n *\n * Whether the query is a signal query.\n *\n * This option exists for JIT compatibility. Users are not expected to use this.\n * Angular needs a way to capture queries from classes so that the internal query\n * functions can be generated. This needs to happen before the component is instantiated.\n * Due to this, for JIT compilation, signal queries need an additional decorator\n * declaring the query. Angular provides a TS transformer to automatically handle this\n * for JIT usage (e.g. in tests).\n */\n isSignal?: boolean;\n}\n\n// Stores the default value of `emitDistinctChangesOnly` when the `emitDistinctChangesOnly` is not\n// explicitly set.\nexport const emitDistinctChangesOnlyDefaultValue = true;\n\n/**\n * Base class for query metadata.\n *\n * @see {@link ContentChildren}\n * @see {@link ContentChild}\n * @see {@link ViewChildren}\n * @see {@link ViewChild}\n *\n * @publicApi\n */\nexport abstract class Query {}\n\n/**\n * Type of the ContentChildren decorator / constructor function.\n *\n * @see {@link ContentChildren}\n * @publicApi\n */\nexport interface ContentChildrenDecorator {\n /**\n * @description\n * Property decorator that configures a content query.\n *\n * Use to get the `QueryList` of elements or directives from the content DOM.\n * Any time a child element is added, removed, or moved, the query list will be\n * updated, and the changes observable of the query list will emit a new value.\n *\n * Content queries are set before the `ngAfterContentInit` callback is called.\n *\n * Does not retrieve elements or directives that are in other components' templates,\n * since a component's template is always a black box to its ancestors.\n *\n * **Metadata Properties**:\n *\n * * **selector** - The directive type or the name used for querying.\n * * **descendants** - If `true` include all descendants of the element. If `false` then only\n * query direct children of the element.\n * * **emitDistinctChangesOnly** - The ` QueryList#changes` observable will emit new values only\n * if the QueryList result has changed. When `false` the `changes` observable might emit even\n * if the QueryList has not changed.\n * ** Note: *** This config option is **deprecated**, it will be permanently set to `true` and\n * removed in future versions of Angular.\n * * **read** - Used to read a different token from the queried elements.\n *\n * The following selectors are supported.\n * * Any class with the `@Component` or `@Directive` decorator\n * * A template reference variable as a string (e.g. query ``\n * with `@ContentChildren('cmp')`)\n * * Any provider defined in the child component tree of the current component (e.g.\n * `@ContentChildren(SomeService) someService: SomeService`)\n * * Any provider defined through a string token (e.g. `@ContentChildren('someToken')\n * someTokenVal: any`)\n * * A `TemplateRef` (e.g. query `` with\n * `@ContentChildren(TemplateRef) template;`)\n *\n * In addition, multiple string selectors can be separated with a comma (e.g.\n * `@ContentChildren('cmp1,cmp2')`)\n *\n * The following values are supported by `read`:\n * * Any class with the `@Component` or `@Directive` decorator\n * * Any provider defined on the injector of the component that is matched by the `selector` of\n * this query\n * * Any provider defined through a string token (e.g. `{provide: 'token', useValue: 'val'}`)\n * * `TemplateRef`, `ElementRef`, and `ViewContainerRef`\n *\n * @usageNotes\n *\n * Here is a simple demonstration of how the `ContentChildren` decorator can be used.\n *\n * {@example core/di/ts/contentChildren/content_children_howto.ts region='HowTo'}\n *\n * ### Tab-pane example\n *\n * Here is a slightly more realistic example that shows how `ContentChildren` decorators\n * can be used to implement a tab pane component.\n *\n * {@example core/di/ts/contentChildren/content_children_example.ts region='Component'}\n *\n * @Annotation\n */\n (\n selector: ProviderToken | Function | string,\n opts?: {\n descendants?: boolean;\n emitDistinctChangesOnly?: boolean;\n read?: any;\n },\n ): any;\n new (\n selector: ProviderToken | Function | string,\n opts?: {descendants?: boolean; emitDistinctChangesOnly?: boolean; read?: any},\n ): Query;\n}\n\n/**\n * Type of the ContentChildren metadata.\n *\n *\n * @Annotation\n * @publicApi\n */\nexport type ContentChildren = Query;\n\n/**\n * ContentChildren decorator and metadata.\n *\n *\n * @Annotation\n * @publicApi\n */\nexport const ContentChildren: ContentChildrenDecorator = makePropDecorator(\n 'ContentChildren',\n (selector?: any, opts: any = {}) => ({\n selector,\n first: false,\n isViewQuery: false,\n descendants: false,\n emitDistinctChangesOnly: emitDistinctChangesOnlyDefaultValue,\n ...opts,\n }),\n Query,\n);\n\n/**\n * Type of the ContentChild decorator / constructor function.\n *\n * @publicApi\n */\nexport interface ContentChildDecorator {\n /**\n * @description\n * Property decorator that configures a content query.\n *\n * Use to get the first element or the directive matching the selector from the content DOM.\n * If the content DOM changes, and a new child matches the selector,\n * the property will be updated.\n *\n * Does not retrieve elements or directives that are in other components' templates,\n * since a component's template is always a black box to its ancestors.\n *\n * **Metadata Properties**:\n *\n * * **selector** - The directive type or the name used for querying.\n * * **descendants** - If `true` (default) include all descendants of the element. If `false` then\n * only query direct children of the element.\n * * **read** - Used to read a different token from the queried element.\n * * **static** - True to resolve query results before change detection runs,\n * false to resolve after change detection. Defaults to false.\n *\n * The following selectors are supported.\n * * Any class with the `@Component` or `@Directive` decorator\n * * A template reference variable as a string (e.g. query ``\n * with `@ContentChild('cmp')`)\n * * Any provider defined in the child component tree of the current component (e.g.\n * `@ContentChild(SomeService) someService: SomeService`)\n * * Any provider defined through a string token (e.g. `@ContentChild('someToken') someTokenVal:\n * any`)\n * * A `TemplateRef` (e.g. query `` with `@ContentChild(TemplateRef)\n * template;`)\n *\n * The following values are supported by `read`:\n * * Any class with the `@Component` or `@Directive` decorator\n * * Any provider defined on the injector of the component that is matched by the `selector` of\n * this query\n * * Any provider defined through a string token (e.g. `{provide: 'token', useValue: 'val'}`)\n * * `TemplateRef`, `ElementRef`, and `ViewContainerRef`\n *\n * Difference between dynamic and static queries:\n *\n * | Queries | Details |\n * |:--- |:--- |\n * | Dynamic queries \\(`static: false`\\) | The query resolves before the `ngAfterContentInit()`\n * callback is called. The result will be updated for changes to your view, such as changes to\n * `ngIf` and `ngFor` blocks. | | Static queries \\(`static: true`\\) | The query resolves once\n * the view has been created, but before change detection runs (before the `ngOnInit()` callback\n * is called). The result, though, will never be updated to reflect changes to your view, such as\n * changes to `ngIf` and `ngFor` blocks. |\n *\n * @usageNotes\n *\n * {@example core/di/ts/contentChild/content_child_howto.ts region='HowTo'}\n *\n * ### Example\n *\n * {@example core/di/ts/contentChild/content_child_example.ts region='Component'}\n *\n * @Annotation\n */\n (\n selector: ProviderToken | Function | string,\n opts?: {descendants?: boolean; read?: any; static?: boolean},\n ): any;\n new (\n selector: ProviderToken | Function | string,\n opts?: {descendants?: boolean; read?: any; static?: boolean},\n ): ContentChild;\n}\n\n/**\n * Type of the ContentChild metadata.\n *\n * @publicApi\n */\nexport type ContentChild = Query;\n\n/**\n * ContentChild decorator and metadata.\n *\n *\n * @Annotation\n *\n * @publicApi\n */\nexport const ContentChild: ContentChildDecorator = makePropDecorator(\n 'ContentChild',\n (selector?: any, opts: any = {}) => ({\n selector,\n first: true,\n isViewQuery: false,\n descendants: true,\n ...opts,\n }),\n Query,\n);\n\n/**\n * Type of the ViewChildren decorator / constructor function.\n *\n * @see {@link ViewChildren}\n *\n * @publicApi\n */\nexport interface ViewChildrenDecorator {\n /**\n * @description\n * Property decorator that configures a view query.\n *\n * Use to get the `QueryList` of elements or directives from the view DOM.\n * Any time a child element is added, removed, or moved, the query list will be updated,\n * and the changes observable of the query list will emit a new value.\n *\n * View queries are set before the `ngAfterViewInit` callback is called.\n *\n * **Metadata Properties**:\n *\n * * **selector** - The directive type or the name used for querying.\n * * **read** - Used to read a different token from the queried elements.\n * * **emitDistinctChangesOnly** - The ` QueryList#changes` observable will emit new values only\n * if the QueryList result has changed. When `false` the `changes` observable might emit even\n * if the QueryList has not changed.\n * ** Note: *** This config option is **deprecated**, it will be permanently set to `true` and\n * removed in future versions of Angular.\n *\n * The following selectors are supported.\n * * Any class with the `@Component` or `@Directive` decorator\n * * A template reference variable as a string (e.g. query ``\n * with `@ViewChildren('cmp')`)\n * * Any provider defined in the child component tree of the current component (e.g.\n * `@ViewChildren(SomeService) someService!: SomeService`)\n * * Any provider defined through a string token (e.g. `@ViewChildren('someToken')\n * someTokenVal!: any`)\n * * A `TemplateRef` (e.g. query `` with `@ViewChildren(TemplateRef)\n * template;`)\n *\n * In addition, multiple string selectors can be separated with a comma (e.g.\n * `@ViewChildren('cmp1,cmp2')`)\n *\n * The following values are supported by `read`:\n * * Any class with the `@Component` or `@Directive` decorator\n * * Any provider defined on the injector of the component that is matched by the `selector` of\n * this query\n * * Any provider defined through a string token (e.g. `{provide: 'token', useValue: 'val'}`)\n * * `TemplateRef`, `ElementRef`, and `ViewContainerRef`\n *\n * @usageNotes\n *\n * {@example core/di/ts/viewChildren/view_children_howto.ts region='HowTo'}\n *\n * ### Another example\n *\n * {@example core/di/ts/viewChildren/view_children_example.ts region='Component'}\n *\n * @Annotation\n */\n (\n selector: ProviderToken | Function | string,\n opts?: {read?: any; emitDistinctChangesOnly?: boolean},\n ): any;\n new (\n selector: ProviderToken | Function | string,\n opts?: {read?: any; emitDistinctChangesOnly?: boolean},\n ): ViewChildren;\n}\n\n/**\n * Type of the ViewChildren metadata.\n *\n * @publicApi\n */\nexport type ViewChildren = Query;\n\n/**\n * ViewChildren decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nexport const ViewChildren: ViewChildrenDecorator = makePropDecorator(\n 'ViewChildren',\n (selector?: any, opts: any = {}) => ({\n selector,\n first: false,\n isViewQuery: true,\n descendants: true,\n emitDistinctChangesOnly: emitDistinctChangesOnlyDefaultValue,\n ...opts,\n }),\n Query,\n);\n\n/**\n * Type of the ViewChild decorator / constructor function.\n *\n * @see {@link ViewChild}\n * @publicApi\n */\nexport interface ViewChildDecorator {\n /**\n * @description\n * Property decorator that configures a view query.\n * The change detector looks for the first element or the directive matching the selector\n * in the view DOM. If the view DOM changes, and a new child matches the selector,\n * the property is updated.\n *\n * **Metadata Properties**:\n *\n * * **selector** - The directive type or the name used for querying.\n * * **read** - Used to read a different token from the queried elements.\n * * **static** - `true` to resolve query results before change detection runs,\n * `false` to resolve after change detection. Defaults to `false`.\n *\n *\n * The following selectors are supported.\n * * Any class with the `@Component` or `@Directive` decorator\n * * A template reference variable as a string (e.g. query ``\n * with `@ViewChild('cmp')`)\n * * Any provider defined in the child component tree of the current component (e.g.\n * `@ViewChild(SomeService) someService: SomeService`)\n * * Any provider defined through a string token (e.g. `@ViewChild('someToken') someTokenVal:\n * any`)\n * * A `TemplateRef` (e.g. query `` with `@ViewChild(TemplateRef)\n * template;`)\n *\n * The following values are supported by `read`:\n * * Any class with the `@Component` or `@Directive` decorator\n * * Any provider defined on the injector of the component that is matched by the `selector` of\n * this query\n * * Any provider defined through a string token (e.g. `{provide: 'token', useValue: 'val'}`)\n * * `TemplateRef`, `ElementRef`, and `ViewContainerRef`\n *\n * Difference between dynamic and static queries:\n * * Dynamic queries \\(`static: false`\\) - The query resolves before the `ngAfterViewInit()`\n * callback is called. The result will be updated for changes to your view, such as changes to\n * `ngIf` and `ngFor` blocks.\n * * Static queries \\(`static: true`\\) - The query resolves once\n * the view has been created, but before change detection runs (before the `ngOnInit()` callback\n * is called). The result, though, will never be updated to reflect changes to your view, such as\n * changes to `ngIf` and `ngFor` blocks.\n *\n * @usageNotes\n *\n * ### Example 1\n *\n * {@example core/di/ts/viewChild/view_child_example.ts region='Component'}\n *\n * ### Example 2\n *\n * {@example core/di/ts/viewChild/view_child_howto.ts region='HowTo'}\n *\n * @Annotation\n */\n (\n selector: ProviderToken | Function | string,\n opts?: {read?: any; static?: boolean},\n ): any;\n new (\n selector: ProviderToken | Function | string,\n opts?: {read?: any; static?: boolean},\n ): ViewChild;\n}\n\n/**\n * Type of the ViewChild metadata.\n *\n * @publicApi\n */\nexport type ViewChild = Query;\n\n/**\n * ViewChild decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nexport const ViewChild: ViewChildDecorator = makePropDecorator(\n 'ViewChild',\n (selector: any, opts: any) => ({\n selector,\n first: true,\n isViewQuery: true,\n descendants: true,\n ...opts,\n }),\n Query,\n);\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\n/**\n * @description Represents the version of Angular\n *\n * @publicApi\n */\nexport class Version {\n public readonly major: string;\n public readonly minor: string;\n public readonly patch: string;\n\n constructor(public full: string) {\n const parts = full.split('.');\n this.major = parts[0];\n this.minor = parts[1];\n this.patch = parts.slice(2).join('.');\n }\n}\n\n/**\n * @publicApi\n */\nexport const VERSION = new Version('20.0.0');\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {getCompilerFacade, JitCompilerUsage} from '../compiler/compiler_facade';\nimport {Injector} from '../di/injector';\nimport {Type} from '../interface/type';\nimport {COMPILER_OPTIONS, CompilerOptions} from '../linker/compiler';\nimport {NgModuleFactory} from '../linker/ng_module_factory';\nimport {\n isComponentResourceResolutionQueueEmpty,\n resolveComponentResources,\n} from '../metadata/resource_loading';\nimport {assertNgModuleType} from '../render3/assert';\nimport {setJitOptions} from '../render3/jit/jit_options';\nimport {NgModuleFactory as R3NgModuleFactory} from '../render3/ng_module_ref';\n\nexport function compileNgModuleFactory(\n injector: Injector,\n options: CompilerOptions,\n moduleType: Type,\n): Promise> {\n ngDevMode && assertNgModuleType(moduleType);\n\n const moduleFactory = new R3NgModuleFactory(moduleType);\n\n // All of the logic below is irrelevant for AOT-compiled code.\n if (typeof ngJitMode !== 'undefined' && !ngJitMode) {\n return Promise.resolve(moduleFactory);\n }\n\n const compilerOptions = injector.get(COMPILER_OPTIONS, []).concat(options);\n\n // Configure the compiler to use the provided options. This call may fail when multiple modules\n // are bootstrapped with incompatible options, as a component can only be compiled according to\n // a single set of options.\n setJitOptions({\n defaultEncapsulation: _lastDefined(compilerOptions.map((opts) => opts.defaultEncapsulation)),\n preserveWhitespaces: _lastDefined(compilerOptions.map((opts) => opts.preserveWhitespaces)),\n });\n\n if (isComponentResourceResolutionQueueEmpty()) {\n return Promise.resolve(moduleFactory);\n }\n\n const compilerProviders = compilerOptions.flatMap((option) => option.providers ?? []);\n\n // In case there are no compiler providers, we just return the module factory as\n // there won't be any resource loader. This can happen with Ivy, because AOT compiled\n // modules can be still passed through \"bootstrapModule\". In that case we shouldn't\n // unnecessarily require the JIT compiler.\n if (compilerProviders.length === 0) {\n return Promise.resolve(moduleFactory);\n }\n\n const compiler = getCompilerFacade({\n usage: JitCompilerUsage.Decorator,\n kind: 'NgModule',\n type: moduleType,\n });\n const compilerInjector = Injector.create({providers: compilerProviders});\n const resourceLoader = compilerInjector.get(compiler.ResourceLoader);\n // The resource loader can also return a string while the \"resolveComponentResources\"\n // always expects a promise. Therefore we need to wrap the returned value in a promise.\n return resolveComponentResources((url) => Promise.resolve(resourceLoader.get(url))).then(\n () => moduleFactory,\n );\n}\n\nfunction _lastDefined(args: T[]): T | undefined {\n for (let i = args.length - 1; i >= 0; i--) {\n if (args[i] !== undefined) {\n return args[i];\n }\n }\n return undefined;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {IMAGE_CONFIG, ImageConfig} from './application/application_tokens';\nimport {Injectable} from './di';\nimport {inject} from './di/injector_compatibility';\nimport {formatRuntimeError, RuntimeErrorCode} from './errors';\nimport {OnDestroy} from './interface/lifecycle_hooks';\nimport {getDocument} from './render3/interfaces/document';\n\n// A delay in milliseconds before the scan is run after onLoad, to avoid any\n// potential race conditions with other LCP-related functions. This delay\n// happens outside of the main JavaScript execution and will only effect the timing\n// on when the warning becomes visible in the console.\nconst SCAN_DELAY = 200;\n\nconst OVERSIZED_IMAGE_TOLERANCE = 1200;\n\n@Injectable({providedIn: 'root'})\nexport class ImagePerformanceWarning implements OnDestroy {\n // Map of full image URLs -> original `ngSrc` values.\n private window: Window | null = null;\n private observer: PerformanceObserver | null = null;\n private options: ImageConfig = inject(IMAGE_CONFIG);\n private lcpImageUrl?: string;\n\n public start() {\n if (\n (typeof ngServerMode !== 'undefined' && ngServerMode) ||\n typeof PerformanceObserver === 'undefined' ||\n (this.options?.disableImageSizeWarning && this.options?.disableImageLazyLoadWarning)\n ) {\n return;\n }\n this.observer = this.initPerformanceObserver();\n const doc = getDocument();\n const win = doc.defaultView;\n if (win) {\n this.window = win;\n // Wait to avoid race conditions where LCP image triggers\n // load event before it's recorded by the performance observer\n const waitToScan = () => {\n setTimeout(this.scanImages.bind(this), SCAN_DELAY);\n };\n const setup = () => {\n // Consider the case when the application is created and destroyed multiple times.\n // Typically, applications are created instantly once the page is loaded, and the\n // `window.load` listener is always triggered. However, the `window.load` event will never\n // be fired if the page is loaded, and the application is created later. Checking for\n // `readyState` is the easiest way to determine whether the page has been loaded or not.\n if (doc.readyState === 'complete') {\n waitToScan();\n } else {\n this.window?.addEventListener('load', waitToScan, {once: true});\n }\n };\n // Angular doesn't have to run change detection whenever any asynchronous tasks are invoked in\n // the scope of this functionality.\n if (typeof Zone !== 'undefined') {\n Zone.root.run(() => setup());\n } else {\n setup();\n }\n }\n }\n\n ngOnDestroy() {\n this.observer?.disconnect();\n }\n\n private initPerformanceObserver(): PerformanceObserver | null {\n if (typeof PerformanceObserver === 'undefined') {\n return null;\n }\n const observer = new PerformanceObserver((entryList) => {\n const entries = entryList.getEntries();\n if (entries.length === 0) return;\n // We use the latest entry produced by the `PerformanceObserver` as the best\n // signal on which element is actually an LCP one. As an example, the first image to load on\n // a page, by virtue of being the only thing on the page so far, is often a LCP candidate\n // and gets reported by PerformanceObserver, but isn't necessarily the LCP element.\n const lcpElement = entries[entries.length - 1];\n\n // Cast to `any` due to missing `element` on the `LargestContentfulPaint` type of entry.\n // See https://developer.mozilla.org/en-US/docs/Web/API/LargestContentfulPaint\n const imgSrc = (lcpElement as any).element?.src ?? '';\n\n // Exclude `data:` and `blob:` URLs, since they are fetched resources.\n if (imgSrc.startsWith('data:') || imgSrc.startsWith('blob:')) return;\n this.lcpImageUrl = imgSrc;\n });\n observer.observe({type: 'largest-contentful-paint', buffered: true});\n return observer;\n }\n\n private scanImages(): void {\n const images = getDocument().querySelectorAll('img');\n let lcpElementFound,\n lcpElementLoadedCorrectly = false;\n images.forEach((image) => {\n if (!this.options?.disableImageSizeWarning) {\n // Image elements using the NgOptimizedImage directive are excluded,\n // as that directive has its own version of this check.\n if (!image.getAttribute('ng-img') && this.isOversized(image)) {\n logOversizedImageWarning(image.src);\n }\n }\n if (!this.options?.disableImageLazyLoadWarning && this.lcpImageUrl) {\n if (image.src === this.lcpImageUrl) {\n lcpElementFound = true;\n if (image.loading !== 'lazy' || image.getAttribute('ng-img')) {\n // This variable is set to true and never goes back to false to account\n // for the case where multiple images have the same src url, and some\n // have lazy loading while others don't.\n // Also ignore NgOptimizedImage because there's a different warning for that.\n lcpElementLoadedCorrectly = true;\n }\n }\n }\n });\n if (\n lcpElementFound &&\n !lcpElementLoadedCorrectly &&\n this.lcpImageUrl &&\n !this.options?.disableImageLazyLoadWarning\n ) {\n logLazyLCPWarning(this.lcpImageUrl);\n }\n }\n\n private isOversized(image: HTMLImageElement): boolean {\n if (!this.window) {\n return false;\n }\n\n // The `isOversized` check may not be applicable or may require adjustments\n // for several types of image formats or scenarios. Currently, we specify only\n // `svg`, but this may also include `gif` since their quality isn’t tied to\n // dimensions in the same way as raster images.\n const nonOversizedImageExtentions = [\n // SVG images are vector-based, which means they can scale\n // to any size without losing quality.\n '.svg',\n ];\n\n // Convert it to lowercase because this may have uppercase\n // extensions, such as `IMAGE.SVG`.\n // We fallback to an empty string because `src` may be `undefined`\n // if it is explicitly set to `null` by some third-party code\n // (e.g., `image.src = null`).\n const imageSource = (image.src || '').toLowerCase();\n\n if (nonOversizedImageExtentions.some((extension) => imageSource.endsWith(extension))) {\n return false;\n }\n\n const computedStyle = this.window.getComputedStyle(image);\n let renderedWidth = parseFloat(computedStyle.getPropertyValue('width'));\n let renderedHeight = parseFloat(computedStyle.getPropertyValue('height'));\n const boxSizing = computedStyle.getPropertyValue('box-sizing');\n const objectFit = computedStyle.getPropertyValue('object-fit');\n\n if (objectFit === `cover`) {\n // Object fit cover may indicate a use case such as a sprite sheet where\n // this warning does not apply.\n return false;\n }\n\n if (boxSizing === 'border-box') {\n // If the image `box-sizing` is set to `border-box`, we adjust the rendered\n // dimensions by subtracting padding values.\n const paddingTop = computedStyle.getPropertyValue('padding-top');\n const paddingRight = computedStyle.getPropertyValue('padding-right');\n const paddingBottom = computedStyle.getPropertyValue('padding-bottom');\n const paddingLeft = computedStyle.getPropertyValue('padding-left');\n renderedWidth -= parseFloat(paddingRight) + parseFloat(paddingLeft);\n renderedHeight -= parseFloat(paddingTop) + parseFloat(paddingBottom);\n }\n\n const intrinsicWidth = image.naturalWidth;\n const intrinsicHeight = image.naturalHeight;\n\n const recommendedWidth = this.window.devicePixelRatio * renderedWidth;\n const recommendedHeight = this.window.devicePixelRatio * renderedHeight;\n const oversizedWidth = intrinsicWidth - recommendedWidth >= OVERSIZED_IMAGE_TOLERANCE;\n const oversizedHeight = intrinsicHeight - recommendedHeight >= OVERSIZED_IMAGE_TOLERANCE;\n return oversizedWidth || oversizedHeight;\n }\n}\n\nfunction logLazyLCPWarning(src: string) {\n console.warn(\n formatRuntimeError(\n RuntimeErrorCode.IMAGE_PERFORMANCE_WARNING,\n `An image with src ${src} is the Largest Contentful Paint (LCP) element ` +\n `but was given a \"loading\" value of \"lazy\", which can negatively impact ` +\n `application loading performance. This warning can be addressed by ` +\n `changing the loading value of the LCP image to \"eager\", or by using the ` +\n `NgOptimizedImage directive's prioritization utilities. For more ` +\n `information about addressing or disabling this warning, see ` +\n `https://angular.dev/errors/NG0913`,\n ),\n );\n}\n\nfunction logOversizedImageWarning(src: string) {\n console.warn(\n formatRuntimeError(\n RuntimeErrorCode.IMAGE_PERFORMANCE_WARNING,\n `An image with src ${src} has intrinsic file dimensions much larger than its ` +\n `rendered size. This can negatively impact application loading performance. ` +\n `For more information about addressing or disabling this warning, see ` +\n `https://angular.dev/errors/NG0913`,\n ),\n );\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {InjectionToken} from '../di';\n\n/**\n * Internal token that allows to register extra callbacks that should be invoked during the\n * `PlatformRef.destroy` operation. This token is needed to avoid a direct reference to the\n * `PlatformRef` class (i.e. register the callback via `PlatformRef.onDestroy`), thus making the\n * entire class tree-shakeable.\n */\nexport const PLATFORM_DESTROY_LISTENERS = new InjectionToken>(\n ngDevMode ? 'PlatformDestroyListeners' : '',\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 */\nimport {Subscription} from 'rxjs';\n\nimport {PROVIDED_NG_ZONE} from '../change_detection/scheduling/ng_zone_scheduling';\nimport {R3Injector} from '../di/r3_injector';\nimport {INTERNAL_APPLICATION_ERROR_HANDLER} from '../error_handler';\nimport {RuntimeError, RuntimeErrorCode} from '../errors';\nimport {DEFAULT_LOCALE_ID} from '../i18n/localization';\nimport {LOCALE_ID} from '../i18n/tokens';\nimport {ImagePerformanceWarning} from '../image_performance_warning';\nimport {Type} from '../interface/type';\nimport {PLATFORM_DESTROY_LISTENERS} from './platform_destroy_listeners';\nimport {setLocaleId} from '../render3/i18n/i18n_locale_id';\nimport {NgZone} from '../zone/ng_zone';\n\nimport {ApplicationInitStatus} from '../application/application_init';\nimport {ApplicationRef, remove} from '../application/application_ref';\nimport {PROVIDED_ZONELESS} from '../change_detection/scheduling/zoneless_scheduling';\nimport {InjectionToken, Injector} from '../di';\nimport {InternalNgModuleRef, NgModuleRef} from '../linker/ng_module_factory';\nimport {stringify} from '../util/stringify';\nimport {isPromise} from '../util/lang';\n\n/**\n * InjectionToken to control root component bootstrap behavior.\n *\n * This token is primarily used in Angular's server-side rendering (SSR) scenarios,\n * particularly by the `@angular/ssr` package, to manage whether the root component\n * should be bootstrapped during the application initialization process.\n *\n * ## Purpose:\n * During SSR route extraction, setting this token to `false` prevents Angular from\n * bootstrapping the root component. This avoids unnecessary component rendering,\n * enabling route extraction without requiring additional APIs or triggering\n * component logic.\n *\n * ## Behavior:\n * - **`false`**: Prevents the root component from being bootstrapped.\n * - **`true`** (default): Proceeds with the normal root component bootstrap process.\n *\n * This mechanism ensures SSR can efficiently separate route extraction logic\n * from component rendering.\n */\nexport const ENABLE_ROOT_COMPONENT_BOOTSTRAP = new InjectionToken(\n ngDevMode ? 'ENABLE_ROOT_COMPONENT_BOOTSTRAP' : '',\n);\n\nexport interface BootstrapConfig {\n platformInjector: Injector;\n}\n\nexport interface ModuleBootstrapConfig extends BootstrapConfig {\n moduleRef: InternalNgModuleRef;\n allPlatformModules: NgModuleRef[];\n}\n\nexport interface ApplicationBootstrapConfig extends BootstrapConfig {\n r3Injector: R3Injector;\n rootComponent: Type | undefined;\n}\n\nfunction isApplicationBootstrapConfig(\n config: ApplicationBootstrapConfig | ModuleBootstrapConfig,\n): config is ApplicationBootstrapConfig {\n return !(config as ModuleBootstrapConfig).moduleRef;\n}\n\nexport function bootstrap(\n moduleBootstrapConfig: ModuleBootstrapConfig,\n): Promise>;\nexport function bootstrap(\n applicationBootstrapConfig: ApplicationBootstrapConfig,\n): Promise;\nexport function bootstrap(\n config: ModuleBootstrapConfig | ApplicationBootstrapConfig,\n): Promise | Promise> {\n const envInjector = isApplicationBootstrapConfig(config)\n ? config.r3Injector\n : config.moduleRef.injector;\n const ngZone = envInjector.get(NgZone);\n return ngZone.run(() => {\n if (isApplicationBootstrapConfig(config)) {\n config.r3Injector.resolveInjectorInitializers();\n } else {\n config.moduleRef.resolveInjectorInitializers();\n }\n const exceptionHandler = envInjector.get(INTERNAL_APPLICATION_ERROR_HANDLER);\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n if (envInjector.get(PROVIDED_ZONELESS) && envInjector.get(PROVIDED_NG_ZONE)) {\n throw new RuntimeError(\n RuntimeErrorCode.PROVIDED_BOTH_ZONE_AND_ZONELESS,\n 'Invalid change detection configuration: ' +\n 'provideZoneChangeDetection and provideZonelessChangeDetection cannot be used together.',\n );\n }\n }\n\n let onErrorSubscription: Subscription;\n ngZone.runOutsideAngular(() => {\n onErrorSubscription = ngZone.onError.subscribe({\n next: exceptionHandler,\n });\n });\n\n // If the whole platform is destroyed, invoke the `destroy` method\n // for all bootstrapped applications as well.\n if (isApplicationBootstrapConfig(config)) {\n const destroyListener = () => envInjector.destroy();\n const onPlatformDestroyListeners = config.platformInjector.get(PLATFORM_DESTROY_LISTENERS);\n onPlatformDestroyListeners.add(destroyListener);\n\n envInjector.onDestroy(() => {\n onErrorSubscription.unsubscribe();\n onPlatformDestroyListeners.delete(destroyListener);\n });\n } else {\n const destroyListener = () => config.moduleRef.destroy();\n const onPlatformDestroyListeners = config.platformInjector.get(PLATFORM_DESTROY_LISTENERS);\n onPlatformDestroyListeners.add(destroyListener);\n\n config.moduleRef.onDestroy(() => {\n remove(config.allPlatformModules, config.moduleRef);\n onErrorSubscription.unsubscribe();\n onPlatformDestroyListeners.delete(destroyListener);\n });\n }\n\n return _callAndReportToErrorHandler(exceptionHandler, ngZone, () => {\n const initStatus = envInjector.get(ApplicationInitStatus);\n initStatus.runInitializers();\n\n return initStatus.donePromise.then(() => {\n // If the `LOCALE_ID` provider is defined at bootstrap then we set the value for ivy\n const localeId = envInjector.get(LOCALE_ID, DEFAULT_LOCALE_ID);\n setLocaleId(localeId || DEFAULT_LOCALE_ID);\n\n const enableRootComponentBoostrap = envInjector.get(ENABLE_ROOT_COMPONENT_BOOTSTRAP, true);\n if (!enableRootComponentBoostrap) {\n if (isApplicationBootstrapConfig(config)) {\n return envInjector.get(ApplicationRef);\n }\n\n config.allPlatformModules.push(config.moduleRef);\n return config.moduleRef;\n }\n\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n const imagePerformanceService = envInjector.get(ImagePerformanceWarning);\n imagePerformanceService.start();\n }\n\n if (isApplicationBootstrapConfig(config)) {\n const appRef = envInjector.get(ApplicationRef);\n if (config.rootComponent !== undefined) {\n appRef.bootstrap(config.rootComponent);\n }\n return appRef;\n } else {\n moduleBootstrapImpl?.(config.moduleRef, config.allPlatformModules);\n return config.moduleRef;\n }\n });\n });\n });\n}\n\n/**\n * Having a separate symbol for the module boostrap implementation allows us to\n * tree shake the module based boostrap implementation in standalone apps.\n */\nlet moduleBootstrapImpl: undefined | typeof _moduleDoBootstrap;\n\n/**\n * Set the implementation of the module based bootstrap.\n */\nexport function setModuleBootstrapImpl() {\n moduleBootstrapImpl = _moduleDoBootstrap;\n}\n\nfunction _moduleDoBootstrap(\n moduleRef: InternalNgModuleRef,\n allPlatformModules: NgModuleRef[],\n): void {\n const appRef = moduleRef.injector.get(ApplicationRef);\n if (moduleRef._bootstrapComponents.length > 0) {\n moduleRef._bootstrapComponents.forEach((f) => appRef.bootstrap(f));\n } else if (moduleRef.instance.ngDoBootstrap) {\n moduleRef.instance.ngDoBootstrap(appRef);\n } else {\n throw new RuntimeError(\n RuntimeErrorCode.BOOTSTRAP_COMPONENTS_NOT_FOUND,\n ngDevMode &&\n `The module ${stringify(moduleRef.instance.constructor)} was bootstrapped, ` +\n `but it does not declare \"@NgModule.bootstrap\" components nor a \"ngDoBootstrap\" method. ` +\n `Please define one of these.`,\n );\n }\n allPlatformModules.push(moduleRef);\n}\n\nfunction _callAndReportToErrorHandler(\n errorHandler: (e: unknown) => void,\n ngZone: NgZone,\n callback: () => any,\n): any {\n try {\n const result = callback();\n if (isPromise(result)) {\n return result.catch((e: any) => {\n ngZone.runOutsideAngular(() => errorHandler(e));\n // rethrow as the exception handler might not do it\n throw e;\n });\n }\n\n return result;\n } catch (e) {\n ngZone.runOutsideAngular(() => errorHandler(e));\n // rethrow as the exception handler might not do it\n throw e;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {compileNgModuleFactory} from '../application/application_ngmodule_factory_compiler';\nimport {BootstrapOptions, optionsReducer} from '../application/application_ref';\nimport {\n getNgZoneOptions,\n internalProvideZoneChangeDetection,\n} from '../change_detection/scheduling/ng_zone_scheduling';\nimport {ChangeDetectionScheduler} from '../change_detection/scheduling/zoneless_scheduling';\nimport {ChangeDetectionSchedulerImpl} from '../change_detection/scheduling/zoneless_scheduling_impl';\nimport {Injectable, Injector} from '../di';\nimport {errorHandlerEnvironmentInitializer} from '../error_handler';\nimport {RuntimeError, RuntimeErrorCode} from '../errors';\nimport {Type} from '../interface/type';\nimport {CompilerOptions} from '../linker';\nimport {NgModuleFactory, NgModuleRef} from '../linker/ng_module_factory';\nimport {createNgModuleRefWithProviders} from '../render3/ng_module_ref';\nimport {getNgZone} from '../zone/ng_zone';\nimport {bootstrap, setModuleBootstrapImpl} from './bootstrap';\nimport {PLATFORM_DESTROY_LISTENERS} from './platform_destroy_listeners';\n\n/**\n * The Angular platform is the entry point for Angular on a web page.\n * Each page has exactly one platform. Services (such as reflection) which are common\n * to every Angular application running on the page are bound in its scope.\n * A page's platform is initialized implicitly when a platform is created using a platform\n * factory such as `PlatformBrowser`, or explicitly by calling the `createPlatform()` function.\n *\n * @publicApi\n */\n@Injectable({providedIn: 'platform'})\nexport class PlatformRef {\n private _modules: NgModuleRef[] = [];\n private _destroyListeners: Array<() => void> = [];\n private _destroyed: boolean = false;\n\n /** @internal */\n constructor(private _injector: Injector) {}\n\n /**\n * Creates an instance of an `@NgModule` for the given platform.\n *\n * @deprecated Passing NgModule factories as the `PlatformRef.bootstrapModuleFactory` function\n * argument is deprecated. Use the `PlatformRef.bootstrapModule` API instead.\n */\n bootstrapModuleFactory(\n moduleFactory: NgModuleFactory,\n options?: BootstrapOptions,\n ): Promise> {\n const scheduleInRootZone = (options as any)?.scheduleInRootZone;\n const ngZoneFactory = () =>\n getNgZone(options?.ngZone, {\n ...getNgZoneOptions({\n eventCoalescing: options?.ngZoneEventCoalescing,\n runCoalescing: options?.ngZoneRunCoalescing,\n }),\n scheduleInRootZone,\n });\n const ignoreChangesOutsideZone = options?.ignoreChangesOutsideZone;\n const allAppProviders = [\n internalProvideZoneChangeDetection({\n ngZoneFactory,\n ignoreChangesOutsideZone,\n }),\n {provide: ChangeDetectionScheduler, useExisting: ChangeDetectionSchedulerImpl},\n errorHandlerEnvironmentInitializer,\n ];\n const moduleRef = createNgModuleRefWithProviders(\n moduleFactory.moduleType,\n this.injector,\n allAppProviders,\n );\n\n setModuleBootstrapImpl();\n return bootstrap({\n moduleRef,\n allPlatformModules: this._modules,\n platformInjector: this.injector,\n });\n }\n\n /**\n * Creates an instance of an `@NgModule` for a given platform.\n *\n * @usageNotes\n * ### Simple Example\n *\n * ```ts\n * @NgModule({\n * imports: [BrowserModule]\n * })\n * class MyModule {}\n *\n * let moduleRef = platformBrowser().bootstrapModule(MyModule);\n * ```\n *\n */\n bootstrapModule(\n moduleType: Type,\n compilerOptions:\n | (CompilerOptions & BootstrapOptions)\n | Array = [],\n ): Promise> {\n const options = optionsReducer({}, compilerOptions);\n setModuleBootstrapImpl();\n return compileNgModuleFactory(this.injector, options, moduleType).then((moduleFactory) =>\n this.bootstrapModuleFactory(moduleFactory, options),\n );\n }\n\n /**\n * Registers a listener to be called when the platform is destroyed.\n */\n onDestroy(callback: () => void): void {\n this._destroyListeners.push(callback);\n }\n\n /**\n * Retrieves the platform {@link Injector}, which is the parent injector for\n * every Angular application on the page and provides singleton providers.\n */\n get injector(): Injector {\n return this._injector;\n }\n\n /**\n * Destroys the current Angular platform and all Angular applications on the page.\n * Destroys all modules and listeners registered with the platform.\n */\n destroy() {\n if (this._destroyed) {\n throw new RuntimeError(\n RuntimeErrorCode.PLATFORM_ALREADY_DESTROYED,\n ngDevMode && 'The platform has already been destroyed!',\n );\n }\n this._modules.slice().forEach((module) => module.destroy());\n this._destroyListeners.forEach((listener) => listener());\n\n const destroyListeners = this._injector.get(PLATFORM_DESTROY_LISTENERS, null);\n if (destroyListeners) {\n destroyListeners.forEach((listener) => listener());\n destroyListeners.clear();\n }\n\n this._destroyed = true;\n }\n\n /**\n * Indicates whether this instance was destroyed.\n */\n get destroyed() {\n return this._destroyed;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n publishDefaultGlobalUtils,\n publishSignalConfiguration,\n} from '../application/application_ref';\nimport {PLATFORM_INITIALIZER} from '../application/application_tokens';\nimport {\n EnvironmentProviders,\n InjectionToken,\n Injector,\n makeEnvironmentProviders,\n runInInjectionContext,\n StaticProvider,\n} from '../di';\nimport {INJECTOR_SCOPE} from '../di/scope';\nimport {RuntimeError, RuntimeErrorCode} from '../errors';\n\nimport {PlatformRef} from './platform_ref';\nimport {PLATFORM_DESTROY_LISTENERS} from './platform_destroy_listeners';\n\nlet _platformInjector: Injector | null = null;\n\n/**\n * Internal token to indicate whether having multiple bootstrapped platform should be allowed (only\n * one bootstrapped platform is allowed by default). This token helps to support SSR scenarios.\n */\nexport const ALLOW_MULTIPLE_PLATFORMS = new InjectionToken(\n ngDevMode ? 'AllowMultipleToken' : '',\n);\n\n/**\n * Creates a platform.\n * Platforms must be created on launch using this function.\n *\n * @publicApi\n */\nexport function createPlatform(injector: Injector): PlatformRef {\n if (_platformInjector && !_platformInjector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {\n throw new RuntimeError(\n RuntimeErrorCode.MULTIPLE_PLATFORMS,\n ngDevMode && 'There can be only one platform. Destroy the previous one to create a new one.',\n );\n }\n publishDefaultGlobalUtils();\n publishSignalConfiguration();\n _platformInjector = injector;\n const platform = injector.get(PlatformRef);\n runPlatformInitializers(injector);\n return platform;\n}\n\n/**\n * Creates a factory for a platform. Can be used to provide or override `Providers` specific to\n * your application's runtime needs, such as `PLATFORM_INITIALIZER` and `PLATFORM_ID`.\n * @param parentPlatformFactory Another platform factory to modify. Allows you to compose factories\n * to build up configurations that might be required by different libraries or parts of the\n * application.\n * @param name Identifies the new platform factory.\n * @param providers A set of dependency providers for platforms created with the new factory.\n *\n * @publicApi\n */\nexport function createPlatformFactory(\n parentPlatformFactory: ((extraProviders?: StaticProvider[]) => PlatformRef) | null,\n name: string,\n providers: StaticProvider[] = [],\n): (extraProviders?: StaticProvider[]) => PlatformRef {\n const desc = `Platform: ${name}`;\n const marker = new InjectionToken(desc);\n return (extraProviders: StaticProvider[] = []) => {\n let platform = getPlatform();\n if (!platform || platform.injector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {\n const platformProviders: StaticProvider[] = [\n ...providers,\n ...extraProviders,\n {provide: marker, useValue: true},\n ];\n if (parentPlatformFactory) {\n parentPlatformFactory(platformProviders);\n } else {\n createPlatform(createPlatformInjector(platformProviders, desc));\n }\n }\n return assertPlatform(marker);\n };\n}\n\n/**\n * Helper function to create an instance of a platform injector (that maintains the 'platform'\n * scope).\n */\nfunction createPlatformInjector(providers: StaticProvider[] = [], name?: string): Injector {\n return Injector.create({\n name,\n providers: [\n {provide: INJECTOR_SCOPE, useValue: 'platform'},\n {provide: PLATFORM_DESTROY_LISTENERS, useValue: new Set([() => (_platformInjector = null)])},\n ...providers,\n ],\n });\n}\n\n/**\n * Checks that there is currently a platform that contains the given token as a provider.\n *\n * @publicApi\n */\nexport function assertPlatform(requiredToken: any): PlatformRef {\n const platform = getPlatform();\n\n if (!platform) {\n throw new RuntimeError(RuntimeErrorCode.PLATFORM_NOT_FOUND, ngDevMode && 'No platform exists!');\n }\n\n if (\n (typeof ngDevMode === 'undefined' || ngDevMode) &&\n !platform.injector.get(requiredToken, null)\n ) {\n throw new RuntimeError(\n RuntimeErrorCode.MULTIPLE_PLATFORMS,\n 'A platform with a different configuration has been created. Please destroy it first.',\n );\n }\n\n return platform;\n}\n\n/**\n * Returns the current platform.\n *\n * @publicApi\n */\nexport function getPlatform(): PlatformRef | null {\n return _platformInjector?.get(PlatformRef) ?? null;\n}\n\n/**\n * Destroys the current Angular platform and all Angular applications on the page.\n * Destroys all modules and listeners registered with the platform.\n *\n * @publicApi\n */\nexport function destroyPlatform(): void {\n getPlatform()?.destroy();\n}\n\n/**\n * The goal of this function is to bootstrap a platform injector,\n * but avoid referencing `PlatformRef` class.\n * This function is needed for bootstrapping a Standalone Component.\n */\nexport function createOrReusePlatformInjector(providers: StaticProvider[] = []): Injector {\n // If a platform injector already exists, it means that the platform\n // is already bootstrapped and no additional actions are required.\n if (_platformInjector) return _platformInjector;\n\n publishDefaultGlobalUtils();\n // Otherwise, setup a new platform injector and run platform initializers.\n const injector = createPlatformInjector(providers);\n _platformInjector = injector;\n publishSignalConfiguration();\n runPlatformInitializers(injector);\n return injector;\n}\n\n/**\n * @description\n * This function is used to provide initialization functions that will be executed upon\n * initialization of the platform injector.\n *\n * Note that the provided initializer is run in the injection context.\n *\n * Previously, this was achieved using the `PLATFORM_INITIALIZER` token which is now deprecated.\n *\n * @see {@link PLATFORM_INITIALIZER}\n *\n * @publicApi\n */\nexport function providePlatformInitializer(initializerFn: () => void): EnvironmentProviders {\n return makeEnvironmentProviders([\n {\n provide: PLATFORM_INITIALIZER,\n useValue: initializerFn,\n multi: true,\n },\n ]);\n}\n\nfunction runPlatformInitializers(injector: Injector): void {\n const inits = injector.get(PLATFORM_INITIALIZER, null);\n runInInjectionContext(injector, () => {\n inits?.forEach((init) => init());\n });\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {ApplicationRef} from '../../application/application_ref';\nimport {ChangeDetectionSchedulerImpl} from './zoneless_scheduling_impl';\nimport {inject} from '../../di/injector_compatibility';\nimport {provideEnvironmentInitializer} from '../../di/provider_collection';\nimport {NgZone} from '../../zone/ng_zone';\n\nimport {ErrorHandler} from '../../error_handler';\nimport {checkNoChangesInternal} from '../../render3/instructions/change_detection';\n\nexport function exhaustiveCheckNoChangesInterval(interval: number) {\n return provideEnvironmentInitializer(() => {\n const applicationRef = inject(ApplicationRef);\n const errorHandler = inject(ErrorHandler);\n const scheduler = inject(ChangeDetectionSchedulerImpl);\n const ngZone = inject(NgZone);\n\n function scheduleCheckNoChanges() {\n ngZone.runOutsideAngular(() => {\n setTimeout(() => {\n if (applicationRef.destroyed) {\n return;\n }\n if (scheduler.pendingRenderTaskId || scheduler.runningTick) {\n scheduleCheckNoChanges();\n return;\n }\n\n for (const view of applicationRef.allViews) {\n try {\n checkNoChangesInternal(view._lView, true /** exhaustive */);\n } catch (e) {\n errorHandler.handleError(e);\n }\n }\n\n scheduleCheckNoChanges();\n }, interval);\n });\n }\n scheduleCheckNoChanges();\n });\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {EnvironmentProviders, makeEnvironmentProviders} from '../di';\nimport {UseExhaustiveCheckNoChanges} from './use_exhaustive_check_no_changes';\nimport {exhaustiveCheckNoChangesInterval} from './scheduling/exhaustive_check_no_changes';\n\n/**\n * Used to disable exhaustive checks when verifying no expressions changed after they were checked.\n *\n * This means that `OnPush` components that are not marked for check will not be checked.\n * This behavior is the current default behavior in Angular. When running change detection\n * on a view tree, views marked for check are refreshed and the flag to check it is removed.\n * When Angular checks views a second time to ensure nothing has changed, `OnPush` components\n * will no longer be marked and not be checked.\n *\n * @developerPreview 20.0\n */\nexport function provideCheckNoChangesConfig(options: {exhaustive: false}): EnvironmentProviders;\n/**\n * - `interval` will periodically run `checkNoChanges` on application views. This can be useful\n * in zoneless applications to periodically ensure no changes have been made without notifying\n * Angular that templates need to be refreshed.\n * - The exhaustive option will treat all application views as if they were `ChangeDetectionStrategy.Default` when verifying\n * no expressions have changed. All views attached to `ApplicationRef` and all the descendants of\n * those views will be checked for changes (excluding those subtrees which are detached via `ChangeDetectorRef.detach()`).\n * This is useful because the check that runs after regular change detection does not work for components using `ChangeDetectionStrategy.OnPush`.\n * This check is will surface any existing errors hidden by `OnPush` components.\n *\n * @developerPreview 20.0\n */\nexport function provideCheckNoChangesConfig(options: {\n interval?: number;\n exhaustive: true;\n}): EnvironmentProviders;\nexport function provideCheckNoChangesConfig(options: {\n interval?: number;\n exhaustive: boolean;\n}): EnvironmentProviders {\n return makeEnvironmentProviders(\n typeof ngDevMode === 'undefined' || ngDevMode\n ? [\n {\n provide: UseExhaustiveCheckNoChanges,\n useValue: options.exhaustive,\n },\n options?.interval !== undefined ? exhaustiveCheckNoChangesInterval(options.interval) : [],\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\nimport {global} from './global';\n\n/**\n * Returns whether Angular is in development mode.\n *\n * By default, this is true, unless `enableProdMode` is invoked prior to calling this method or the\n * application is built using the Angular CLI with the `optimization` option.\n * @see {@link /cli/build ng build}\n *\n * @publicApi\n */\nexport function isDevMode(): boolean {\n return typeof ngDevMode === 'undefined' || !!ngDevMode;\n}\n\n/**\n * Disable Angular's development mode, which turns off assertions and other\n * checks within the framework.\n *\n * One important assertion this disables verifies that a change detection pass\n * does not result in additional changes to any bindings (also known as\n * unidirectional data flow).\n *\n * Using this method is discouraged as the Angular CLI will set production mode when using the\n * `optimization` option.\n * @see {@link /cli/build ng build}\n *\n * @publicApi\n */\nexport function enableProdMode(): void {\n // The below check is there so when ngDevMode is set via terser\n // `global['ngDevMode'] = false;` is also dropped.\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n global['ngDevMode'] = false;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {Type} from '../interface/type';\nimport {NgModuleFactory as R3NgModuleFactory} from '../render3/ng_module_ref';\n\nimport {NgModuleFactory} from './ng_module_factory';\nimport {getRegisteredNgModuleType} from './ng_module_registration';\n\n/**\n * Returns the NgModuleFactory with the given id (specified using [@NgModule.id\n * field](api/core/NgModule#id)), if it exists and has been loaded. Factories for NgModules that do\n * not specify an `id` cannot be retrieved. Throws if an NgModule cannot be found.\n * @publicApi\n * @deprecated Use `getNgModuleById` instead.\n */\nexport function getModuleFactory(id: string): NgModuleFactory {\n const type = getRegisteredNgModuleType(id);\n if (!type) throw noModuleError(id);\n return new R3NgModuleFactory(type);\n}\n\n/**\n * Returns the NgModule class with the given id (specified using [@NgModule.id\n * field](api/core/NgModule#id)), if it exists and has been loaded. Classes for NgModules that do\n * not specify an `id` cannot be retrieved. Throws if an NgModule cannot be found.\n * @publicApi\n */\nexport function getNgModuleById(id: string): Type {\n const type = getRegisteredNgModuleType(id);\n if (!type) throw noModuleError(id);\n return type;\n}\n\nfunction noModuleError(id: string): Error {\n return new Error(`No module with ID ${id} loaded`);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {InternalInjectFlags} from '../di/interface/injector';\nimport {TNode, TNodeType} from '../render3/interfaces/node';\nimport {isComponentHost} from '../render3/interfaces/type_checks';\nimport {DECLARATION_COMPONENT_VIEW, LView} from '../render3/interfaces/view';\nimport {getCurrentTNode, getLView} from '../render3/state';\nimport {getComponentLViewByIndex} from '../render3/util/view_utils';\nimport {ViewRef} from '../render3/view_ref';\n\n/**\n * Base class that provides change detection functionality.\n * A change-detection tree collects all views that are to be checked for changes.\n * Use the methods to add and remove views from the tree, initiate change-detection,\n * and explicitly mark views as _dirty_, meaning that they have changed and need to be re-rendered.\n *\n * @see [Using change detection hooks](guide/components/lifecycle#using-change-detection-hooks)\n * @see [Defining custom change detection](guide/components/lifecycle#defining-custom-change-detection)\n *\n * @usageNotes\n *\n * The following examples demonstrate how to modify default change-detection behavior\n * to perform explicit detection when needed.\n *\n * ### Use `markForCheck()` with `CheckOnce` strategy\n *\n * The following example sets the `OnPush` change-detection strategy for a component\n * (`CheckOnce`, rather than the default `CheckAlways`), then forces a second check\n * after an interval.\n *\n * {@example core/ts/change_detect/change-detection.ts region='mark-for-check'}\n *\n * ### Detach change detector to limit how often check occurs\n *\n * The following example defines a component with a large list of read-only data\n * that is expected to change constantly, many times per second.\n * To improve performance, we want to check and update the list\n * less often than the changes actually occur. To do that, we detach\n * the component's change detector and perform an explicit local check every five seconds.\n *\n * {@example core/ts/change_detect/change-detection.ts region='detach'}\n *\n *\n * ### Reattaching a detached component\n *\n * The following example creates a component displaying live data.\n * The component detaches its change detector from the main change detector tree\n * when the `live` property is set to false, and reattaches it when the property\n * becomes true.\n *\n * {@example core/ts/change_detect/change-detection.ts region='reattach'}\n *\n * @publicApi\n */\nexport abstract class ChangeDetectorRef {\n /**\n * When a view uses the {@link ChangeDetectionStrategy#OnPush} (checkOnce)\n * change detection strategy, explicitly marks the view as changed so that\n * it can be checked again.\n *\n * Components are normally marked as dirty (in need of rerendering) when inputs\n * have changed or events have fired in the view. Call this method to ensure that\n * a component is checked even if these triggers have not occurred.\n *\n * \n *\n */\n abstract markForCheck(): void;\n\n /**\n * Detaches this view from the change-detection tree.\n * A detached view is not checked until it is reattached.\n * Use in combination with `detectChanges()` to implement local change detection checks.\n *\n * Detached views are not checked during change detection runs until they are\n * re-attached, even if they are marked as dirty.\n *\n * \n * \n *\n */\n abstract detach(): void;\n\n /**\n * Checks this view and its children. Use in combination with {@link ChangeDetectorRef#detach}\n * to implement local change detection checks.\n *\n * \n * \n *\n */\n abstract detectChanges(): void;\n\n /**\n * Checks the change detector and its children, and throws if any changes are detected.\n *\n * Use in development mode to verify that running change detection doesn't introduce\n * other changes. Calling it in production mode is a noop.\n *\n * @deprecated This is a test-only API that does not have a place in production interface.\n * `checkNoChanges` is already part of an `ApplicationRef` tick when the app is running in dev\n * mode. For more granular `checkNoChanges` validation, use `ComponentFixture`.\n */\n abstract checkNoChanges(): void;\n\n /**\n * Re-attaches the previously detached view to the change detection tree.\n * Views are attached to the tree by default.\n *\n * \n *\n */\n abstract reattach(): void;\n\n /**\n * @internal\n * @nocollapse\n */\n static __NG_ELEMENT_ID__: (flags: InternalInjectFlags) => ChangeDetectorRef =\n injectChangeDetectorRef;\n}\n\n/** Returns a ChangeDetectorRef (a.k.a. a ViewRef) */\nexport function injectChangeDetectorRef(flags: InternalInjectFlags): ChangeDetectorRef {\n return createViewRef(\n getCurrentTNode()!,\n getLView(),\n (flags & InternalInjectFlags.ForPipe) === InternalInjectFlags.ForPipe,\n );\n}\n\n/**\n * Creates a ViewRef and stores it on the injector as ChangeDetectorRef (public alias).\n *\n * @param tNode The node that is requesting a ChangeDetectorRef\n * @param lView The view to which the node belongs\n * @param isPipe Whether the view is being injected into a pipe.\n * @returns The ChangeDetectorRef to use\n */\nfunction createViewRef(tNode: TNode, lView: LView, isPipe: boolean): ChangeDetectorRef {\n if (isComponentHost(tNode) && !isPipe) {\n // The LView represents the location where the component is declared.\n // Instead we want the LView for the component View and so we need to look it up.\n const componentView = getComponentLViewByIndex(tNode.index, lView); // look down\n return new ViewRef(componentView, componentView);\n } else if (\n tNode.type &\n (TNodeType.AnyRNode | TNodeType.AnyContainer | TNodeType.Icu | TNodeType.LetDeclaration)\n ) {\n // The LView represents the location where the injection is requested from.\n // We need to locate the containing LView (in case where the `lView` is an embedded view)\n const hostComponentView = lView[DECLARATION_COMPONENT_VIEW]; // look up\n return new ViewRef(hostComponentView, lView);\n }\n return null!;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {ChangeDetectorRef} from '../change_detection/change_detector_ref';\n\n/**\n * Represents an Angular view.\n *\n * @see {@link /api/core/ChangeDetectorRef?tab=usage-notes Change detection usage}\n *\n * @publicApi\n */\nexport abstract class ViewRef extends ChangeDetectorRef {\n /**\n * Destroys this view and all of the data structures associated with it.\n */\n abstract destroy(): void;\n\n /**\n * Reports whether this view has been destroyed.\n * @returns True after the `destroy()` method has been called, false otherwise.\n */\n abstract get destroyed(): boolean;\n\n /**\n * A lifecycle hook that provides additional developer-defined cleanup\n * functionality for views.\n * @param callback A handler function that cleans up developer-defined data\n * associated with a view. Called when the `destroy()` method is invoked.\n */\n abstract onDestroy(callback: Function): void;\n}\n\n/**\n * Represents an Angular view in a view container.\n * An embedded view can be referenced from a component\n * other than the hosting component whose template defines it, or it can be defined\n * independently by a `TemplateRef`.\n *\n * Properties of elements in a view can change, but the structure (number and order) of elements in\n * a view cannot. Change the structure of elements by inserting, moving, or\n * removing nested views in a view container.\n *\n * @see {@link ViewContainerRef}\n *\n * @usageNotes\n *\n * The following template breaks down into two separate `TemplateRef` instances,\n * an outer one and an inner one.\n *\n * ```html\n * Count: {{items.length}}\n *
    \n *
  • {{item}}
  • \n *
\n * ```\n *\n * This is the outer `TemplateRef`:\n *\n * ```html\n * Count: {{items.length}}\n *
    \n * \n *
\n * ```\n *\n * This is the inner `TemplateRef`:\n *\n * ```html\n *
  • {{item}}
  • \n * ```\n *\n * The outer and inner `TemplateRef` instances are assembled into views as follows:\n *\n * ```html\n * \n * Count: 2\n *
      \n * \n *
    • first
    • \n *
    • second
    • \n *
    \n * \n * ```\n * @publicApi\n */\nexport abstract class EmbeddedViewRef extends ViewRef {\n /**\n * The context for this view, inherited from the anchor element.\n */\n abstract context: C;\n\n /**\n * The root nodes for this embedded view.\n */\n abstract get rootNodes(): any[];\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {RuntimeError, RuntimeErrorCode} from '../../errors';\nimport {Writable} from '../../interface/type';\nimport {isListLikeIterable, iterateListLike} from '../../util/iterable';\nimport {stringify} from '../../util/stringify';\n\nimport type {\n IterableChangeRecord,\n IterableChanges,\n IterableDiffer,\n IterableDifferFactory,\n NgIterable,\n TrackByFunction,\n} from './iterable_differs';\n\nexport class DefaultIterableDifferFactory implements IterableDifferFactory {\n constructor() {}\n supports(obj: Object | null | undefined): boolean {\n return isListLikeIterable(obj);\n }\n\n create(trackByFn?: TrackByFunction): DefaultIterableDiffer {\n return new DefaultIterableDiffer(trackByFn);\n }\n}\n\nconst trackByIdentity = (index: number, item: any) => item;\n\n/**\n * @deprecated v4.0.0 - Should not be part of public API.\n * @publicApi\n */\nexport class DefaultIterableDiffer implements IterableDiffer, IterableChanges {\n public readonly length: number = 0;\n // TODO: confirm the usage of `collection` as it's unused, readonly and on a non public API.\n public readonly collection!: V[] | Iterable | null;\n // Keeps track of the used records at any point in time (during & across `_check()` calls)\n private _linkedRecords: _DuplicateMap | null = null;\n // Keeps track of the removed records at any point in time during `_check()` calls.\n private _unlinkedRecords: _DuplicateMap | null = null;\n private _previousItHead: IterableChangeRecord_ | null = null;\n private _itHead: IterableChangeRecord_ | null = null;\n private _itTail: IterableChangeRecord_ | null = null;\n private _additionsHead: IterableChangeRecord_ | null = null;\n private _additionsTail: IterableChangeRecord_ | null = null;\n private _movesHead: IterableChangeRecord_ | null = null;\n private _movesTail: IterableChangeRecord_ | null = null;\n private _removalsHead: IterableChangeRecord_ | null = null;\n private _removalsTail: IterableChangeRecord_ | null = null;\n // Keeps track of records where custom track by is the same, but item identity has changed\n private _identityChangesHead: IterableChangeRecord_ | null = null;\n private _identityChangesTail: IterableChangeRecord_ | null = null;\n private _trackByFn: TrackByFunction;\n\n constructor(trackByFn?: TrackByFunction) {\n this._trackByFn = trackByFn || trackByIdentity;\n }\n\n forEachItem(fn: (record: IterableChangeRecord_) => void) {\n let record: IterableChangeRecord_ | null;\n for (record = this._itHead; record !== null; record = record._next) {\n fn(record);\n }\n }\n\n forEachOperation(\n fn: (\n item: IterableChangeRecord,\n previousIndex: number | null,\n currentIndex: number | null,\n ) => void,\n ) {\n let nextIt = this._itHead;\n let nextRemove = this._removalsHead;\n let addRemoveOffset = 0;\n let moveOffsets: number[] | null = null;\n while (nextIt || nextRemove) {\n // Figure out which is the next record to process\n // Order: remove, add, move\n const record: IterableChangeRecord =\n !nextRemove ||\n (nextIt &&\n nextIt.currentIndex! < getPreviousIndex(nextRemove, addRemoveOffset, moveOffsets))\n ? nextIt!\n : nextRemove;\n const adjPreviousIndex = getPreviousIndex(record, addRemoveOffset, moveOffsets);\n const currentIndex = record.currentIndex;\n\n // consume the item, and adjust the addRemoveOffset and update moveDistance if necessary\n if (record === nextRemove) {\n addRemoveOffset--;\n nextRemove = nextRemove._nextRemoved;\n } else {\n nextIt = nextIt!._next;\n if (record.previousIndex == null) {\n addRemoveOffset++;\n } else {\n // INVARIANT: currentIndex < previousIndex\n if (!moveOffsets) moveOffsets = [];\n const localMovePreviousIndex = adjPreviousIndex - addRemoveOffset;\n const localCurrentIndex = currentIndex! - addRemoveOffset;\n if (localMovePreviousIndex != localCurrentIndex) {\n for (let i = 0; i < localMovePreviousIndex; i++) {\n const offset = i < moveOffsets.length ? moveOffsets[i] : (moveOffsets[i] = 0);\n const index = offset + i;\n if (localCurrentIndex <= index && index < localMovePreviousIndex) {\n moveOffsets[i] = offset + 1;\n }\n }\n const previousIndex = record.previousIndex;\n moveOffsets[previousIndex] = localCurrentIndex - localMovePreviousIndex;\n }\n }\n }\n\n if (adjPreviousIndex !== currentIndex) {\n fn(record, adjPreviousIndex, currentIndex);\n }\n }\n }\n\n forEachPreviousItem(fn: (record: IterableChangeRecord_) => void) {\n let record: IterableChangeRecord_ | null;\n for (record = this._previousItHead; record !== null; record = record._nextPrevious) {\n fn(record);\n }\n }\n\n forEachAddedItem(fn: (record: IterableChangeRecord_) => void) {\n let record: IterableChangeRecord_ | null;\n for (record = this._additionsHead; record !== null; record = record._nextAdded) {\n fn(record);\n }\n }\n\n forEachMovedItem(fn: (record: IterableChangeRecord_) => void) {\n let record: IterableChangeRecord_ | null;\n for (record = this._movesHead; record !== null; record = record._nextMoved) {\n fn(record);\n }\n }\n\n forEachRemovedItem(fn: (record: IterableChangeRecord_) => void) {\n let record: IterableChangeRecord_ | null;\n for (record = this._removalsHead; record !== null; record = record._nextRemoved) {\n fn(record);\n }\n }\n\n forEachIdentityChange(fn: (record: IterableChangeRecord_) => void) {\n let record: IterableChangeRecord_ | null;\n for (record = this._identityChangesHead; record !== null; record = record._nextIdentityChange) {\n fn(record);\n }\n }\n\n diff(collection: NgIterable | null | undefined): DefaultIterableDiffer | null {\n if (collection == null) collection = [];\n if (!isListLikeIterable(collection)) {\n throw new RuntimeError(\n RuntimeErrorCode.INVALID_DIFFER_INPUT,\n ngDevMode &&\n `Error trying to diff '${stringify(collection)}'. Only arrays and iterables are allowed`,\n );\n }\n\n if (this.check(collection)) {\n return this;\n } else {\n return null;\n }\n }\n\n onDestroy() {}\n\n check(collection: NgIterable): boolean {\n this._reset();\n\n let record: IterableChangeRecord_ | null = this._itHead;\n let mayBeDirty: boolean = false;\n let index: number;\n let item: V;\n let itemTrackBy: any;\n if (Array.isArray(collection)) {\n (this as Writable).length = collection.length;\n\n for (let index = 0; index < this.length; index++) {\n item = collection[index];\n itemTrackBy = this._trackByFn(index, item);\n if (record === null || !Object.is(record.trackById, itemTrackBy)) {\n record = this._mismatch(record, item, itemTrackBy, index);\n mayBeDirty = true;\n } else {\n if (mayBeDirty) {\n // TODO(misko): can we limit this to duplicates only?\n record = this._verifyReinsertion(record, item, itemTrackBy, index);\n }\n if (!Object.is(record.item, item)) this._addIdentityChange(record, item);\n }\n\n record = record._next;\n }\n } else {\n index = 0;\n iterateListLike(collection, (item: V) => {\n itemTrackBy = this._trackByFn(index, item);\n if (record === null || !Object.is(record.trackById, itemTrackBy)) {\n record = this._mismatch(record, item, itemTrackBy, index);\n mayBeDirty = true;\n } else {\n if (mayBeDirty) {\n // TODO(misko): can we limit this to duplicates only?\n record = this._verifyReinsertion(record, item, itemTrackBy, index);\n }\n if (!Object.is(record.item, item)) this._addIdentityChange(record, item);\n }\n record = record._next;\n index++;\n });\n (this as Writable).length = index;\n }\n\n this._truncate(record);\n (this as Writable).collection = collection;\n return this.isDirty;\n }\n\n /* CollectionChanges is considered dirty if it has any additions, moves, removals, or identity\n * changes.\n */\n get isDirty(): boolean {\n return (\n this._additionsHead !== null ||\n this._movesHead !== null ||\n this._removalsHead !== null ||\n this._identityChangesHead !== null\n );\n }\n\n /**\n * Reset the state of the change objects to show no changes. This means set previousKey to\n * currentKey, and clear all of the queues (additions, moves, removals).\n * Set the previousIndexes of moved and added items to their currentIndexes\n * Reset the list of additions, moves and removals\n *\n * @internal\n */\n _reset() {\n if (this.isDirty) {\n let record: IterableChangeRecord_ | null;\n\n for (record = this._previousItHead = this._itHead; record !== null; record = record._next) {\n record._nextPrevious = record._next;\n }\n\n for (record = this._additionsHead; record !== null; record = record._nextAdded) {\n record.previousIndex = record.currentIndex;\n }\n this._additionsHead = this._additionsTail = null;\n\n for (record = this._movesHead; record !== null; record = record._nextMoved) {\n record.previousIndex = record.currentIndex;\n }\n this._movesHead = this._movesTail = null;\n this._removalsHead = this._removalsTail = null;\n this._identityChangesHead = this._identityChangesTail = null;\n\n // TODO(vicb): when assert gets supported\n // assert(!this.isDirty);\n }\n }\n\n /**\n * This is the core function which handles differences between collections.\n *\n * - `record` is the record which we saw at this position last time. If null then it is a new\n * item.\n * - `item` is the current item in the collection\n * - `index` is the position of the item in the collection\n *\n * @internal\n */\n _mismatch(\n record: IterableChangeRecord_ | null,\n item: V,\n itemTrackBy: any,\n index: number,\n ): IterableChangeRecord_ {\n // The previous record after which we will append the current one.\n let previousRecord: IterableChangeRecord_ | null;\n\n if (record === null) {\n previousRecord = this._itTail;\n } else {\n previousRecord = record._prev;\n // Remove the record from the collection since we know it does not match the item.\n this._remove(record);\n }\n\n // See if we have evicted the item, which used to be at some anterior position of _itHead list.\n record = this._unlinkedRecords === null ? null : this._unlinkedRecords.get(itemTrackBy, null);\n if (record !== null) {\n // It is an item which we have evicted earlier: reinsert it back into the list.\n // But first we need to check if identity changed, so we can update in view if necessary.\n if (!Object.is(record.item, item)) this._addIdentityChange(record, item);\n\n this._reinsertAfter(record, previousRecord, index);\n } else {\n // Attempt to see if the item is at some posterior position of _itHead list.\n record = this._linkedRecords === null ? null : this._linkedRecords.get(itemTrackBy, index);\n if (record !== null) {\n // We have the item in _itHead at/after `index` position. We need to move it forward in the\n // collection.\n // But first we need to check if identity changed, so we can update in view if necessary.\n if (!Object.is(record.item, item)) this._addIdentityChange(record, item);\n\n this._moveAfter(record, previousRecord, index);\n } else {\n // It is a new item: add it.\n record = this._addAfter(\n new IterableChangeRecord_(item, itemTrackBy),\n previousRecord,\n index,\n );\n }\n }\n return record;\n }\n\n /**\n * This check is only needed if an array contains duplicates. (Short circuit of nothing dirty)\n *\n * Use case: `[a, a]` => `[b, a, a]`\n *\n * If we did not have this check then the insertion of `b` would:\n * 1) evict first `a`\n * 2) insert `b` at `0` index.\n * 3) leave `a` at index `1` as is. <-- this is wrong!\n * 3) reinsert `a` at index 2. <-- this is wrong!\n *\n * The correct behavior is:\n * 1) evict first `a`\n * 2) insert `b` at `0` index.\n * 3) reinsert `a` at index 1.\n * 3) move `a` at from `1` to `2`.\n *\n *\n * Double check that we have not evicted a duplicate item. We need to check if the item type may\n * have already been removed:\n * The insertion of b will evict the first 'a'. If we don't reinsert it now it will be reinserted\n * at the end. Which will show up as the two 'a's switching position. This is incorrect, since a\n * better way to think of it is as insert of 'b' rather then switch 'a' with 'b' and then add 'a'\n * at the end.\n *\n * @internal\n */\n _verifyReinsertion(\n record: IterableChangeRecord_,\n item: V,\n itemTrackBy: any,\n index: number,\n ): IterableChangeRecord_ {\n let reinsertRecord: IterableChangeRecord_ | null =\n this._unlinkedRecords === null ? null : this._unlinkedRecords.get(itemTrackBy, null);\n if (reinsertRecord !== null) {\n record = this._reinsertAfter(reinsertRecord, record._prev!, index);\n } else if (record.currentIndex != index) {\n record.currentIndex = index;\n this._addToMoves(record, index);\n }\n return record;\n }\n\n /**\n * Get rid of any excess {@link IterableChangeRecord_}s from the previous collection\n *\n * - `record` The first excess {@link IterableChangeRecord_}.\n *\n * @internal\n */\n _truncate(record: IterableChangeRecord_ | null) {\n // Anything after that needs to be removed;\n while (record !== null) {\n const nextRecord: IterableChangeRecord_ | null = record._next;\n this._addToRemovals(this._unlink(record));\n record = nextRecord;\n }\n if (this._unlinkedRecords !== null) {\n this._unlinkedRecords.clear();\n }\n\n if (this._additionsTail !== null) {\n this._additionsTail._nextAdded = null;\n }\n if (this._movesTail !== null) {\n this._movesTail._nextMoved = null;\n }\n if (this._itTail !== null) {\n this._itTail._next = null;\n }\n if (this._removalsTail !== null) {\n this._removalsTail._nextRemoved = null;\n }\n if (this._identityChangesTail !== null) {\n this._identityChangesTail._nextIdentityChange = null;\n }\n }\n\n /** @internal */\n _reinsertAfter(\n record: IterableChangeRecord_,\n prevRecord: IterableChangeRecord_ | null,\n index: number,\n ): IterableChangeRecord_ {\n if (this._unlinkedRecords !== null) {\n this._unlinkedRecords.remove(record);\n }\n const prev = record._prevRemoved;\n const next = record._nextRemoved;\n\n if (prev === null) {\n this._removalsHead = next;\n } else {\n prev._nextRemoved = next;\n }\n if (next === null) {\n this._removalsTail = prev;\n } else {\n next._prevRemoved = prev;\n }\n\n this._insertAfter(record, prevRecord, index);\n this._addToMoves(record, index);\n return record;\n }\n\n /** @internal */\n _moveAfter(\n record: IterableChangeRecord_,\n prevRecord: IterableChangeRecord_ | null,\n index: number,\n ): IterableChangeRecord_ {\n this._unlink(record);\n this._insertAfter(record, prevRecord, index);\n this._addToMoves(record, index);\n return record;\n }\n\n /** @internal */\n _addAfter(\n record: IterableChangeRecord_,\n prevRecord: IterableChangeRecord_ | null,\n index: number,\n ): IterableChangeRecord_ {\n this._insertAfter(record, prevRecord, index);\n\n if (this._additionsTail === null) {\n // TODO(vicb):\n // assert(this._additionsHead === null);\n this._additionsTail = this._additionsHead = record;\n } else {\n // TODO(vicb):\n // assert(_additionsTail._nextAdded === null);\n // assert(record._nextAdded === null);\n this._additionsTail = this._additionsTail._nextAdded = record;\n }\n return record;\n }\n\n /** @internal */\n _insertAfter(\n record: IterableChangeRecord_,\n prevRecord: IterableChangeRecord_ | null,\n index: number,\n ): IterableChangeRecord_ {\n // TODO(vicb):\n // assert(record != prevRecord);\n // assert(record._next === null);\n // assert(record._prev === null);\n\n const next: IterableChangeRecord_ | null =\n prevRecord === null ? this._itHead : prevRecord._next;\n // TODO(vicb):\n // assert(next != record);\n // assert(prevRecord != record);\n record._next = next;\n record._prev = prevRecord;\n if (next === null) {\n this._itTail = record;\n } else {\n next._prev = record;\n }\n if (prevRecord === null) {\n this._itHead = record;\n } else {\n prevRecord._next = record;\n }\n\n if (this._linkedRecords === null) {\n this._linkedRecords = new _DuplicateMap();\n }\n this._linkedRecords.put(record);\n\n record.currentIndex = index;\n return record;\n }\n\n /** @internal */\n _remove(record: IterableChangeRecord_): IterableChangeRecord_ {\n return this._addToRemovals(this._unlink(record));\n }\n\n /** @internal */\n _unlink(record: IterableChangeRecord_): IterableChangeRecord_ {\n if (this._linkedRecords !== null) {\n this._linkedRecords.remove(record);\n }\n\n const prev = record._prev;\n const next = record._next;\n\n // TODO(vicb):\n // assert((record._prev = null) === null);\n // assert((record._next = null) === null);\n\n if (prev === null) {\n this._itHead = next;\n } else {\n prev._next = next;\n }\n if (next === null) {\n this._itTail = prev;\n } else {\n next._prev = prev;\n }\n\n return record;\n }\n\n /** @internal */\n _addToMoves(record: IterableChangeRecord_, toIndex: number): IterableChangeRecord_ {\n // TODO(vicb):\n // assert(record._nextMoved === null);\n\n if (record.previousIndex === toIndex) {\n return record;\n }\n\n if (this._movesTail === null) {\n // TODO(vicb):\n // assert(_movesHead === null);\n this._movesTail = this._movesHead = record;\n } else {\n // TODO(vicb):\n // assert(_movesTail._nextMoved === null);\n this._movesTail = this._movesTail._nextMoved = record;\n }\n\n return record;\n }\n\n private _addToRemovals(record: IterableChangeRecord_): IterableChangeRecord_ {\n if (this._unlinkedRecords === null) {\n this._unlinkedRecords = new _DuplicateMap();\n }\n this._unlinkedRecords.put(record);\n record.currentIndex = null;\n record._nextRemoved = null;\n\n if (this._removalsTail === null) {\n // TODO(vicb):\n // assert(_removalsHead === null);\n this._removalsTail = this._removalsHead = record;\n record._prevRemoved = null;\n } else {\n // TODO(vicb):\n // assert(_removalsTail._nextRemoved === null);\n // assert(record._nextRemoved === null);\n record._prevRemoved = this._removalsTail;\n this._removalsTail = this._removalsTail._nextRemoved = record;\n }\n return record;\n }\n\n /** @internal */\n _addIdentityChange(record: IterableChangeRecord_, item: V) {\n record.item = item;\n if (this._identityChangesTail === null) {\n this._identityChangesTail = this._identityChangesHead = record;\n } else {\n this._identityChangesTail = this._identityChangesTail._nextIdentityChange = record;\n }\n return record;\n }\n}\n\nexport class IterableChangeRecord_ implements IterableChangeRecord {\n currentIndex: number | null = null;\n previousIndex: number | null = null;\n\n /** @internal */\n _nextPrevious: IterableChangeRecord_ | null = null;\n /** @internal */\n _prev: IterableChangeRecord_ | null = null;\n /** @internal */\n _next: IterableChangeRecord_ | null = null;\n /** @internal */\n _prevDup: IterableChangeRecord_ | null = null;\n /** @internal */\n _nextDup: IterableChangeRecord_ | null = null;\n /** @internal */\n _prevRemoved: IterableChangeRecord_ | null = null;\n /** @internal */\n _nextRemoved: IterableChangeRecord_ | null = null;\n /** @internal */\n _nextAdded: IterableChangeRecord_ | null = null;\n /** @internal */\n _nextMoved: IterableChangeRecord_ | null = null;\n /** @internal */\n _nextIdentityChange: IterableChangeRecord_ | null = null;\n\n constructor(\n public item: V,\n public trackById: any,\n ) {}\n}\n\n// A linked list of IterableChangeRecords with the same IterableChangeRecord_.item\nclass _DuplicateItemRecordList {\n /** @internal */\n _head: IterableChangeRecord_ | null = null;\n /** @internal */\n _tail: IterableChangeRecord_ | null = null;\n\n /**\n * Append the record to the list of duplicates.\n *\n * Note: by design all records in the list of duplicates hold the same value in record.item.\n */\n add(record: IterableChangeRecord_): void {\n if (this._head === null) {\n this._head = this._tail = record;\n record._nextDup = null;\n record._prevDup = null;\n } else {\n // TODO(vicb):\n // assert(record.item == _head.item ||\n // record.item is num && record.item.isNaN && _head.item is num && _head.item.isNaN);\n this._tail!._nextDup = record;\n record._prevDup = this._tail;\n record._nextDup = null;\n this._tail = record;\n }\n }\n\n // Returns a IterableChangeRecord_ having IterableChangeRecord_.trackById == trackById and\n // IterableChangeRecord_.currentIndex >= atOrAfterIndex\n get(trackById: any, atOrAfterIndex: number | null): IterableChangeRecord_ | null {\n let record: IterableChangeRecord_ | null;\n for (record = this._head; record !== null; record = record._nextDup) {\n if (\n (atOrAfterIndex === null || atOrAfterIndex <= record.currentIndex!) &&\n Object.is(record.trackById, trackById)\n ) {\n return record;\n }\n }\n return null;\n }\n\n /**\n * Remove one {@link IterableChangeRecord_} from the list of duplicates.\n *\n * Returns whether the list of duplicates is empty.\n */\n remove(record: IterableChangeRecord_): boolean {\n // TODO(vicb):\n // assert(() {\n // // verify that the record being removed is in the list.\n // for (IterableChangeRecord_ cursor = _head; cursor != null; cursor = cursor._nextDup) {\n // if (identical(cursor, record)) return true;\n // }\n // return false;\n //});\n\n const prev: IterableChangeRecord_ | null = record._prevDup;\n const next: IterableChangeRecord_ | null = record._nextDup;\n if (prev === null) {\n this._head = next;\n } else {\n prev._nextDup = next;\n }\n if (next === null) {\n this._tail = prev;\n } else {\n next._prevDup = prev;\n }\n return this._head === null;\n }\n}\n\nclass _DuplicateMap {\n map = new Map>();\n\n put(record: IterableChangeRecord_) {\n const key = record.trackById;\n\n let duplicates = this.map.get(key);\n if (!duplicates) {\n duplicates = new _DuplicateItemRecordList();\n this.map.set(key, duplicates);\n }\n duplicates.add(record);\n }\n\n /**\n * Retrieve the `value` using key. Because the IterableChangeRecord_ value may be one which we\n * have already iterated over, we use the `atOrAfterIndex` to pretend it is not there.\n *\n * Use case: `[a, b, c, a, a]` if we are at index `3` which is the second `a` then asking if we\n * have any more `a`s needs to return the second `a`.\n */\n get(trackById: any, atOrAfterIndex: number | null): IterableChangeRecord_ | null {\n const key = trackById;\n const recordList = this.map.get(key);\n return recordList ? recordList.get(trackById, atOrAfterIndex) : null;\n }\n\n /**\n * Removes a {@link IterableChangeRecord_} from the list of duplicates.\n *\n * The list of duplicates also is removed from the map if it gets empty.\n */\n remove(record: IterableChangeRecord_): IterableChangeRecord_ {\n const key = record.trackById;\n const recordList: _DuplicateItemRecordList = this.map.get(key)!;\n // Remove the list of duplicates when it gets empty\n if (recordList.remove(record)) {\n this.map.delete(key);\n }\n return record;\n }\n\n get isEmpty(): boolean {\n return this.map.size === 0;\n }\n\n clear() {\n this.map.clear();\n }\n}\n\nfunction getPreviousIndex(\n item: any,\n addRemoveOffset: number,\n moveOffsets: number[] | null,\n): number {\n const previousIndex = item.previousIndex;\n if (previousIndex === null) return previousIndex;\n let moveOffset = 0;\n if (moveOffsets && previousIndex < moveOffsets.length) {\n moveOffset = moveOffsets[previousIndex];\n }\n return previousIndex + addRemoveOffset + moveOffset;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {RuntimeError, RuntimeErrorCode} from '../../errors';\nimport {isJsObject} from '../../util/iterable';\nimport {stringify} from '../../util/stringify';\n\nimport type {\n KeyValueChangeRecord,\n KeyValueChanges,\n KeyValueDiffer,\n KeyValueDifferFactory,\n} from './keyvalue_differs';\n\nexport class DefaultKeyValueDifferFactory implements KeyValueDifferFactory {\n constructor() {}\n supports(obj: any): boolean {\n return obj instanceof Map || isJsObject(obj);\n }\n\n create(): KeyValueDiffer {\n return new DefaultKeyValueDiffer();\n }\n}\n\nexport class DefaultKeyValueDiffer implements KeyValueDiffer, KeyValueChanges {\n private _records = new Map>();\n private _mapHead: KeyValueChangeRecord_ | null = null;\n // _appendAfter is used in the check loop\n private _appendAfter: KeyValueChangeRecord_ | null = null;\n private _previousMapHead: KeyValueChangeRecord_ | null = null;\n private _changesHead: KeyValueChangeRecord_ | null = null;\n private _changesTail: KeyValueChangeRecord_ | null = null;\n private _additionsHead: KeyValueChangeRecord_ | null = null;\n private _additionsTail: KeyValueChangeRecord_ | null = null;\n private _removalsHead: KeyValueChangeRecord_ | null = null;\n private _removalsTail: KeyValueChangeRecord_ | null = null;\n\n get isDirty(): boolean {\n return (\n this._additionsHead !== null || this._changesHead !== null || this._removalsHead !== null\n );\n }\n\n forEachItem(fn: (r: KeyValueChangeRecord) => void) {\n let record: KeyValueChangeRecord_ | null;\n for (record = this._mapHead; record !== null; record = record._next) {\n fn(record);\n }\n }\n\n forEachPreviousItem(fn: (r: KeyValueChangeRecord) => void) {\n let record: KeyValueChangeRecord_ | null;\n for (record = this._previousMapHead; record !== null; record = record._nextPrevious) {\n fn(record);\n }\n }\n\n forEachChangedItem(fn: (r: KeyValueChangeRecord) => void) {\n let record: KeyValueChangeRecord_ | null;\n for (record = this._changesHead; record !== null; record = record._nextChanged) {\n fn(record);\n }\n }\n\n forEachAddedItem(fn: (r: KeyValueChangeRecord) => void) {\n let record: KeyValueChangeRecord_ | null;\n for (record = this._additionsHead; record !== null; record = record._nextAdded) {\n fn(record);\n }\n }\n\n forEachRemovedItem(fn: (r: KeyValueChangeRecord) => void) {\n let record: KeyValueChangeRecord_ | null;\n for (record = this._removalsHead; record !== null; record = record._nextRemoved) {\n fn(record);\n }\n }\n\n diff(map?: Map | {[k: string]: any} | null): any {\n if (!map) {\n map = new Map();\n } else if (!(map instanceof Map || isJsObject(map))) {\n throw new RuntimeError(\n RuntimeErrorCode.INVALID_DIFFER_INPUT,\n ngDevMode && `Error trying to diff '${stringify(map)}'. Only maps and objects are allowed`,\n );\n }\n\n return this.check(map) ? this : null;\n }\n\n onDestroy() {}\n\n /**\n * Check the current state of the map vs the previous.\n * The algorithm is optimised for when the keys do no change.\n */\n check(map: Map | {[k: string]: any}): boolean {\n this._reset();\n\n let insertBefore = this._mapHead;\n this._appendAfter = null;\n\n this._forEach(map, (value: any, key: any) => {\n if (insertBefore && insertBefore.key === key) {\n this._maybeAddToChanges(insertBefore, value);\n this._appendAfter = insertBefore;\n insertBefore = insertBefore._next;\n } else {\n const record = this._getOrCreateRecordForKey(key, value);\n insertBefore = this._insertBeforeOrAppend(insertBefore, record);\n }\n });\n\n // Items remaining at the end of the list have been deleted\n if (insertBefore) {\n if (insertBefore._prev) {\n insertBefore._prev._next = null;\n }\n\n this._removalsHead = insertBefore;\n\n for (\n let record: KeyValueChangeRecord_ | null = insertBefore;\n record !== null;\n record = record._nextRemoved\n ) {\n if (record === this._mapHead) {\n this._mapHead = null;\n }\n this._records.delete(record.key);\n record._nextRemoved = record._next;\n record.previousValue = record.currentValue;\n record.currentValue = null;\n record._prev = null;\n record._next = null;\n }\n }\n\n // Make sure tails have no next records from previous runs\n if (this._changesTail) this._changesTail._nextChanged = null;\n if (this._additionsTail) this._additionsTail._nextAdded = null;\n\n return this.isDirty;\n }\n\n /**\n * Inserts a record before `before` or append at the end of the list when `before` is null.\n *\n * Notes:\n * - This method appends at `this._appendAfter`,\n * - This method updates `this._appendAfter`,\n * - The return value is the new value for the insertion pointer.\n */\n private _insertBeforeOrAppend(\n before: KeyValueChangeRecord_ | null,\n record: KeyValueChangeRecord_,\n ): KeyValueChangeRecord_ | null {\n if (before) {\n const prev = before._prev;\n record._next = before;\n record._prev = prev;\n before._prev = record;\n if (prev) {\n prev._next = record;\n }\n if (before === this._mapHead) {\n this._mapHead = record;\n }\n\n this._appendAfter = before;\n return before;\n }\n\n if (this._appendAfter) {\n this._appendAfter._next = record;\n record._prev = this._appendAfter;\n } else {\n this._mapHead = record;\n }\n\n this._appendAfter = record;\n return null;\n }\n\n private _getOrCreateRecordForKey(key: K, value: V): KeyValueChangeRecord_ {\n if (this._records.has(key)) {\n const record = this._records.get(key)!;\n this._maybeAddToChanges(record, value);\n const prev = record._prev;\n const next = record._next;\n if (prev) {\n prev._next = next;\n }\n if (next) {\n next._prev = prev;\n }\n record._next = null;\n record._prev = null;\n\n return record;\n }\n\n const record = new KeyValueChangeRecord_(key);\n this._records.set(key, record);\n record.currentValue = value;\n this._addToAdditions(record);\n return record;\n }\n\n /** @internal */\n _reset() {\n if (this.isDirty) {\n let record: KeyValueChangeRecord_ | null;\n // let `_previousMapHead` contain the state of the map before the changes\n this._previousMapHead = this._mapHead;\n for (record = this._previousMapHead; record !== null; record = record._next) {\n record._nextPrevious = record._next;\n }\n\n // Update `record.previousValue` with the value of the item before the changes\n // We need to update all changed items (that's those which have been added and changed)\n for (record = this._changesHead; record !== null; record = record._nextChanged) {\n record.previousValue = record.currentValue;\n }\n for (record = this._additionsHead; record != null; record = record._nextAdded) {\n record.previousValue = record.currentValue;\n }\n\n this._changesHead = this._changesTail = null;\n this._additionsHead = this._additionsTail = null;\n this._removalsHead = null;\n }\n }\n\n // Add the record or a given key to the list of changes only when the value has actually changed\n private _maybeAddToChanges(record: KeyValueChangeRecord_, newValue: any): void {\n if (!Object.is(newValue, record.currentValue)) {\n record.previousValue = record.currentValue;\n record.currentValue = newValue;\n this._addToChanges(record);\n }\n }\n\n private _addToAdditions(record: KeyValueChangeRecord_) {\n if (this._additionsHead === null) {\n this._additionsHead = this._additionsTail = record;\n } else {\n this._additionsTail!._nextAdded = record;\n this._additionsTail = record;\n }\n }\n\n private _addToChanges(record: KeyValueChangeRecord_) {\n if (this._changesHead === null) {\n this._changesHead = this._changesTail = record;\n } else {\n this._changesTail!._nextChanged = record;\n this._changesTail = record;\n }\n }\n\n /** @internal */\n private _forEach(obj: Map | {[k: string]: V}, fn: (v: V, k: any) => void) {\n if (obj instanceof Map) {\n obj.forEach(fn);\n } else {\n Object.keys(obj).forEach((k) => fn(obj[k], k));\n }\n }\n}\n\nclass KeyValueChangeRecord_ implements KeyValueChangeRecord {\n previousValue: V | null = null;\n currentValue: V | null = null;\n\n /** @internal */\n _nextPrevious: KeyValueChangeRecord_ | null = null;\n /** @internal */\n _next: KeyValueChangeRecord_ | null = null;\n /** @internal */\n _prev: KeyValueChangeRecord_ | null = null;\n /** @internal */\n _nextAdded: KeyValueChangeRecord_ | null = null;\n /** @internal */\n _nextRemoved: KeyValueChangeRecord_ | null = null;\n /** @internal */\n _nextChanged: KeyValueChangeRecord_ | null = null;\n\n constructor(public key: K) {}\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {ɵɵdefineInjectable} from '../../di/interface/defs';\nimport {StaticProvider} from '../../di/interface/provider';\nimport {Optional, SkipSelf} from '../../di/metadata';\nimport {RuntimeError, RuntimeErrorCode} from '../../errors';\nimport {DefaultIterableDifferFactory} from '../differs/default_iterable_differ';\n\n/**\n * A type describing supported iterable types.\n *\n * @publicApi\n */\nexport type NgIterable = Array | Iterable;\n\n/**\n * A strategy for tracking changes over time to an iterable. Used by {@link /api/common/NgForOf NgForOf} to\n * respond to changes in an iterable by effecting equivalent changes in the DOM.\n *\n * @publicApi\n */\nexport interface IterableDiffer {\n /**\n * Compute a difference between the previous state and the new `object` state.\n *\n * @param object containing the new value.\n * @returns an object describing the difference. The return value is only valid until the next\n * `diff()` invocation.\n */\n diff(object: NgIterable | undefined | null): IterableChanges | null;\n}\n\n/**\n * An object describing the changes in the `Iterable` collection since last time\n * `IterableDiffer#diff()` was invoked.\n *\n * @publicApi\n */\nexport interface IterableChanges {\n /**\n * Iterate over all changes. `IterableChangeRecord` will contain information about changes\n * to each item.\n */\n forEachItem(fn: (record: IterableChangeRecord) => void): void;\n\n /**\n * Iterate over a set of operations which when applied to the original `Iterable` will produce the\n * new `Iterable`.\n *\n * NOTE: These are not necessarily the actual operations which were applied to the original\n * `Iterable`, rather these are a set of computed operations which may not be the same as the\n * ones applied.\n *\n * @param record A change which needs to be applied\n * @param previousIndex The `IterableChangeRecord#previousIndex` of the `record` refers to the\n * original `Iterable` location, where as `previousIndex` refers to the transient location\n * of the item, after applying the operations up to this point.\n * @param currentIndex The `IterableChangeRecord#currentIndex` of the `record` refers to the\n * original `Iterable` location, where as `currentIndex` refers to the transient location\n * of the item, after applying the operations up to this point.\n */\n forEachOperation(\n fn: (\n record: IterableChangeRecord,\n previousIndex: number | null,\n currentIndex: number | null,\n ) => void,\n ): void;\n\n /**\n * Iterate over changes in the order of original `Iterable` showing where the original items\n * have moved.\n */\n forEachPreviousItem(fn: (record: IterableChangeRecord) => void): void;\n\n /** Iterate over all added items. */\n forEachAddedItem(fn: (record: IterableChangeRecord) => void): void;\n\n /** Iterate over all moved items. */\n forEachMovedItem(fn: (record: IterableChangeRecord) => void): void;\n\n /** Iterate over all removed items. */\n forEachRemovedItem(fn: (record: IterableChangeRecord) => void): void;\n\n /**\n * Iterate over all items which had their identity (as computed by the `TrackByFunction`)\n * changed.\n */\n forEachIdentityChange(fn: (record: IterableChangeRecord) => void): void;\n}\n\n/**\n * Record representing the item change information.\n *\n * @publicApi\n */\nexport interface IterableChangeRecord {\n /** Current index of the item in `Iterable` or null if removed. */\n readonly currentIndex: number | null;\n\n /** Previous index of the item in `Iterable` or null if added. */\n readonly previousIndex: number | null;\n\n /** The item. */\n readonly item: V;\n\n /** Track by identity as computed by the `TrackByFunction`. */\n readonly trackById: any;\n}\n\n/**\n * A function optionally passed into the `NgForOf` directive to customize how `NgForOf` uniquely\n * identifies items in an iterable.\n *\n * `NgForOf` needs to uniquely identify items in the iterable to correctly perform DOM updates\n * when items in the iterable are reordered, new items are added, or existing items are removed.\n *\n *\n * In all of these scenarios it is usually desirable to only update the DOM elements associated\n * with the items affected by the change. This behavior is important to:\n *\n * - preserve any DOM-specific UI state (like cursor position, focus, text selection) when the\n * iterable is modified\n * - enable animation of item addition, removal, and iterable reordering\n * - preserve the value of the `