You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

1 lines
164 KiB

{"version":3,"file":"common.mjs","sources":["../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/common/src/location/navigation_adapter_for_location.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/common/src/i18n/locale_data.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/common/src/platform_id.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/common/src/version.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/common/src/viewport_scroller.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/common/src/directives/ng_optimized_image/image_loaders/constants.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/common/src/directives/ng_optimized_image/url.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/common/src/directives/ng_optimized_image/image_loaders/image_loader.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/common/src/directives/ng_optimized_image/image_loaders/normalized_options.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/common/src/directives/ng_optimized_image/image_loaders/cloudflare_loader.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/common/src/directives/ng_optimized_image/image_loaders/cloudinary_loader.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/common/src/directives/ng_optimized_image/image_loaders/imagekit_loader.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/common/src/directives/ng_optimized_image/image_loaders/imgix_loader.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/common/src/directives/ng_optimized_image/image_loaders/netlify_loader.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/common/src/directives/ng_optimized_image/error_helper.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/common/src/directives/ng_optimized_image/asserts.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/common/src/directives/ng_optimized_image/lcp_image_observer.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/common/src/directives/ng_optimized_image/preconnect_link_checker.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/common/src/directives/ng_optimized_image/tokens.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/common/src/directives/ng_optimized_image/preload-link-creator.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/common/src/directives/ng_optimized_image/ng_optimized_image.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 {Injectable, inject, DestroyRef} from '@angular/core';\nimport {PlatformNavigation} from '../navigation/platform_navigation';\nimport {Location} from './location';\nimport {LocationStrategy} from './location_strategy';\nimport {normalizeQueryParams} from './util';\n\n/**\n * A `Location` implementation that uses the browser's `Navigation` API.\n *\n * This class is an adapter that maps the methods of the `Location` service to the newer\n * browser `Navigation` API. It is used when the `Navigation` API is available.\n *\n * This adapter uses `navigation.navigate()` for `go` and `replaceState` to ensure a single source\n * of truth for the navigation state. The Navigation API's state and `history.state` are separate.\n *\n * Note that `navigation.back()` and `navigation.forward()` can differ from the traditional\n * `history` API in how they traverse the joint session history.\n *\n * @see {@link Location}\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Navigation_API\n */\n@Injectable()\nexport class NavigationAdapterForLocation extends Location {\n private readonly navigation = inject(PlatformNavigation);\n private readonly destroyRef = inject(DestroyRef);\n\n constructor() {\n super(inject(LocationStrategy));\n\n this.registerNavigationListeners();\n }\n\n private registerNavigationListeners() {\n const currentEntryChangeListener = () => {\n this._notifyUrlChangeListeners(this.path(true), this.getState());\n };\n this.navigation.addEventListener('currententrychange', currentEntryChangeListener);\n this.destroyRef.onDestroy(() => {\n this.navigation.removeEventListener('currententrychange', currentEntryChangeListener);\n });\n }\n\n override getState(): unknown {\n return this.navigation.currentEntry?.getState();\n }\n\n override replaceState(path: string, query: string = '', state: any = null): void {\n const url = this.prepareExternalUrl(path + normalizeQueryParams(query));\n // Use navigation API consistently for navigations. The \"navigation API state\"\n // field has no interaction with the existing \"serialized state\" field, which is what backs history.state\n this.navigation.navigate(url, {state, history: 'replace'});\n }\n\n override go(path: string, query: string = '', state: any = null): void {\n const url = this.prepareExternalUrl(path + normalizeQueryParams(query));\n // Use navigation API consistently for navigations. The \"navigation API state\"\n // field has no interaction with the existing \"serialized state\" field, which is what backs history.state\n this.navigation.navigate(url, {state, history: 'push'});\n }\n\n // Navigation.back/forward differs from history in how it traverses the joint session history\n // https://github.com/WICG/navigation-api?tab=readme-ov-file#correspondence-with-the-joint-session-history\n override back() {\n this.navigation.back();\n }\n\n override forward() {\n this.navigation.forward();\n }\n\n override onUrlChange(fn: (url: string, state: unknown) => void): VoidFunction {\n this._urlChangeListeners.push(fn);\n\n return () => {\n const fnIndex = this._urlChangeListeners.indexOf(fn);\n this._urlChangeListeners.splice(fnIndex, 1);\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 {ɵregisterLocaleData} from '@angular/core';\n\n/**\n * Register global data to be used internally by Angular. See the\n * [\"I18n guide\"](guide/i18n/format-data-locale) to know how to import additional locale\n * data.\n *\n * The signature registerLocaleData(data: any, extraData?: any) is deprecated since v5.1\n *\n * @publicApi\n */\nexport function registerLocaleData(data: any, localeId?: string | any, extraData?: any): void {\n return ɵregisterLocaleData(data, localeId, extraData);\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\nexport const PLATFORM_BROWSER_ID = 'browser';\nexport const PLATFORM_SERVER_ID = 'server';\n\n/**\n * Returns whether a platform id represents a browser platform.\n * @publicApi\n */\nexport function isPlatformBrowser(platformId: Object): boolean {\n return platformId === PLATFORM_BROWSER_ID;\n}\n\n/**\n * Returns whether a platform id represents a server platform.\n * @publicApi\n */\nexport function isPlatformServer(platformId: Object): boolean {\n return platformId === PLATFORM_SERVER_ID;\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 * @module\n * @description\n * Entry point for all public APIs of the common package.\n */\n\nimport {Version} from '@angular/core';\n\n/**\n * @publicApi\n */\nexport const VERSION = /* @__PURE__ */ new Version('21.1.1');\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 inject,\n ɵɵdefineInjectable,\n DOCUMENT,\n ɵformatRuntimeError as formatRuntimeError,\n} from '@angular/core';\nimport {RuntimeErrorCode} from './errors';\n\n/**\n * Defines a scroll position manager. Implemented by `BrowserViewportScroller`.\n *\n * @publicApi\n */\nexport abstract class ViewportScroller {\n // De-sugared tree-shakable injection\n // See #23917\n /** @nocollapse */\n static ɵprov = /** @pureOrBreakMyCode */ /* @__PURE__ */ ɵɵdefineInjectable({\n token: ViewportScroller,\n providedIn: 'root',\n factory: () =>\n typeof ngServerMode !== 'undefined' && ngServerMode\n ? new NullViewportScroller()\n : new BrowserViewportScroller(inject(DOCUMENT), window),\n });\n\n /**\n * Configures the top offset used when scrolling to an anchor.\n * @param offset A position in screen coordinates (a tuple with x and y values)\n * or a function that returns the top offset position.\n *\n */\n abstract setOffset(offset: [number, number] | (() => [number, number])): void;\n\n /**\n * Retrieves the current scroll position.\n * @returns A position in screen coordinates (a tuple with x and y values).\n */\n abstract getScrollPosition(): [number, number];\n\n /**\n * Scrolls to a specified position.\n * @param position A position in screen coordinates (a tuple with x and y values).\n */\n abstract scrollToPosition(position: [number, number], options?: ScrollOptions): void;\n\n /**\n * Scrolls to an anchor element.\n * @param anchor The ID of the anchor element.\n */\n abstract scrollToAnchor(anchor: string, options?: ScrollOptions): void;\n\n /**\n * Disables automatic scroll restoration provided by the browser.\n * See also [window.history.scrollRestoration\n * info](https://developers.google.com/web/updates/2015/09/history-api-scroll-restoration).\n */\n abstract setHistoryScrollRestoration(scrollRestoration: 'auto' | 'manual'): void;\n}\n\n/**\n * Manages the scroll position for a browser window.\n */\nexport class BrowserViewportScroller implements ViewportScroller {\n private offset: () => [number, number] = () => [0, 0];\n\n constructor(\n private document: Document,\n private window: Window,\n ) {}\n\n /**\n * Configures the top offset used when scrolling to an anchor.\n * @param offset A position in screen coordinates (a tuple with x and y values)\n * or a function that returns the top offset position.\n *\n */\n setOffset(offset: [number, number] | (() => [number, number])): void {\n if (Array.isArray(offset)) {\n this.offset = () => offset;\n } else {\n this.offset = offset;\n }\n }\n\n /**\n * Retrieves the current scroll position.\n * @returns The position in screen coordinates.\n */\n getScrollPosition(): [number, number] {\n return [this.window.scrollX, this.window.scrollY];\n }\n\n /**\n * Sets the scroll position.\n * @param position The new position in screen coordinates.\n */\n scrollToPosition(position: [number, number], options?: ScrollOptions): void {\n this.window.scrollTo({...options, left: position[0], top: position[1]});\n }\n\n /**\n * Scrolls to an element and attempts to focus the element.\n *\n * Note that the function name here is misleading in that the target string may be an ID for a\n * non-anchor element.\n *\n * @param target The ID of an element or name of the anchor.\n *\n * @see https://html.spec.whatwg.org/#the-indicated-part-of-the-document\n * @see https://html.spec.whatwg.org/#scroll-to-fragid\n */\n scrollToAnchor(target: string, options?: ScrollOptions): void {\n const elSelected = findAnchorFromDocument(this.document, target);\n\n if (elSelected) {\n this.scrollToElement(elSelected, options);\n // After scrolling to the element, the spec dictates that we follow the focus steps for the\n // target. Rather than following the robust steps, simply attempt focus.\n //\n // @see https://html.spec.whatwg.org/#get-the-focusable-area\n // @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLOrForeignElement/focus\n // @see https://html.spec.whatwg.org/#focusable-area\n elSelected.focus();\n }\n }\n\n /**\n * Disables automatic scroll restoration provided by the browser.\n */\n setHistoryScrollRestoration(scrollRestoration: 'auto' | 'manual'): void {\n try {\n this.window.history.scrollRestoration = scrollRestoration;\n } catch {\n console.warn(\n formatRuntimeError(\n RuntimeErrorCode.SCROLL_RESTORATION_UNSUPPORTED,\n ngDevMode &&\n 'Failed to set `window.history.scrollRestoration`. ' +\n 'This may occur when:\\n' +\n '• The script is running inside a sandboxed iframe\\n' +\n '• The window is partially navigated or inactive\\n' +\n '• The script is executed in an untrusted or special context (e.g., test runners, browser extensions, or content previews)\\n' +\n 'Scroll position may not be preserved across navigation.',\n ),\n );\n }\n }\n\n /**\n * Scrolls to an element using the native offset and the specified offset set on this scroller.\n *\n * The offset can be used when we know that there is a floating header and scrolling naively to an\n * element (ex: `scrollIntoView`) leaves the element hidden behind the floating header.\n */\n private scrollToElement(el: HTMLElement, options?: ScrollOptions): void {\n const rect = el.getBoundingClientRect();\n const left = rect.left + this.window.pageXOffset;\n const top = rect.top + this.window.pageYOffset;\n const offset = this.offset();\n this.window.scrollTo({\n ...options,\n left: left - offset[0],\n top: top - offset[1],\n });\n }\n}\n\nfunction findAnchorFromDocument(document: Document, target: string): HTMLElement | null {\n const documentResult = document.getElementById(target) || document.getElementsByName(target)[0];\n\n if (documentResult) {\n return documentResult;\n }\n\n // `getElementById` and `getElementsByName` won't pierce through the shadow DOM so we\n // have to traverse the DOM manually and do the lookup through the shadow roots.\n if (\n typeof document.createTreeWalker === 'function' &&\n document.body &&\n typeof document.body.attachShadow === 'function'\n ) {\n const treeWalker = document.createTreeWalker(document.body, NodeFilter.SHOW_ELEMENT);\n let currentNode = treeWalker.currentNode as HTMLElement | null;\n\n while (currentNode) {\n const shadowRoot = currentNode.shadowRoot;\n\n if (shadowRoot) {\n // Note that `ShadowRoot` doesn't support `getElementsByName`\n // so we have to fall back to `querySelector`.\n const result =\n shadowRoot.getElementById(target) || shadowRoot.querySelector(`[name=\"${target}\"]`);\n if (result) {\n return result;\n }\n }\n\n currentNode = treeWalker.nextNode() as HTMLElement | null;\n }\n }\n\n return null;\n}\n\n/**\n * Provides an empty implementation of the viewport scroller.\n */\nexport class NullViewportScroller implements ViewportScroller {\n /**\n * Empty implementation\n */\n setOffset(offset: [number, number] | (() => [number, number])): void {}\n\n /**\n * Empty implementation\n */\n getScrollPosition(): [number, number] {\n return [0, 0];\n }\n\n /**\n * Empty implementation\n */\n scrollToPosition(position: [number, number]): void {}\n\n /**\n * Empty implementation\n */\n scrollToAnchor(anchor: string): void {}\n\n /**\n * Empty implementation\n */\n setHistoryScrollRestoration(scrollRestoration: 'auto' | 'manual'): void {}\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 * Value (out of 100) of the requested quality for placeholder images.\n */\nexport const PLACEHOLDER_QUALITY = '20';\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// Converts a string that represents a URL into a URL class instance.\nexport function getUrl(src: string, win: Window): URL {\n // Don't use a base URL is the URL is absolute.\n return isAbsoluteUrl(src) ? new URL(src) : new URL(src, win.location.href);\n}\n\n// Checks whether a URL is absolute (i.e. starts with `http://` or `https://`).\nexport function isAbsoluteUrl(src: string): boolean {\n return /^https?:\\/\\//.test(src);\n}\n\n// Given a URL, extract the hostname part.\n// If a URL is a relative one - the URL is returned as is.\nexport function extractHostname(url: string): string {\n return isAbsoluteUrl(url) ? new URL(url).hostname : url;\n}\n\nexport function isValidPath(path: unknown): boolean {\n const isString = typeof path === 'string';\n\n if (!isString || path.trim() === '') {\n return false;\n }\n\n // Calling new URL() will throw if the path string is malformed\n try {\n const url = new URL(path);\n return true;\n } catch {\n return false;\n }\n}\n\nexport function normalizePath(path: string): string {\n return path.endsWith('/') ? path.slice(0, -1) : path;\n}\n\nexport function normalizeSrc(src: string): string {\n return src.startsWith('/') ? src.slice(1) : src;\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, Provider, ɵRuntimeError as RuntimeError} from '@angular/core';\n\nimport {RuntimeErrorCode} from '../../../errors';\nimport {isAbsoluteUrl, isValidPath, normalizePath, normalizeSrc} from '../url';\n\n/**\n * Config options recognized by the image loader function.\n *\n * @see {@link ImageLoader}\n * @see {@link NgOptimizedImage}\n * @publicApi\n */\nexport interface ImageLoaderConfig {\n /**\n * Image file name to be added to the image request URL.\n */\n src: string;\n /**\n * Width of the requested image (to be used when generating srcset).\n */\n width?: number;\n /**\n * Whether the loader should generate a URL for a small image placeholder instead of a full-sized\n * image.\n */\n isPlaceholder?: boolean;\n /**\n * Additional user-provided parameters for use by the ImageLoader.\n */\n loaderParams?: {[key: string]: any};\n}\n\n/**\n * Represents an image loader function. Image loader functions are used by the\n * NgOptimizedImage directive to produce full image URL based on the image name and its width.\n *\n * @publicApi\n */\nexport type ImageLoader = (config: ImageLoaderConfig) => string;\n\n/**\n * Noop image loader that does no transformation to the original src and just returns it as is.\n * This loader is used as a default one if more specific logic is not provided in an app config.\n *\n * @see {@link ImageLoader}\n * @see {@link NgOptimizedImage}\n */\nexport const noopImageLoader = (config: ImageLoaderConfig) => config.src;\n\n/**\n * Metadata about the image loader.\n */\nexport type ImageLoaderInfo = {\n name: string;\n testUrl: (url: string) => boolean;\n};\n\n/**\n * Injection token that configures the image loader function.\n *\n * @see {@link ImageLoader}\n * @see {@link NgOptimizedImage}\n * @publicApi\n */\nexport const IMAGE_LOADER = new InjectionToken<ImageLoader>(\n typeof ngDevMode !== 'undefined' && ngDevMode ? 'ImageLoader' : '',\n {\n factory: () => noopImageLoader,\n },\n);\n\n/**\n * Internal helper function that makes it easier to introduce custom image loaders for the\n * `NgOptimizedImage` directive. It is enough to specify a URL builder function to obtain full DI\n * configuration for a given loader: a DI token corresponding to the actual loader function, plus DI\n * tokens managing preconnect check functionality.\n * @param buildUrlFn a function returning a full URL based on loader's configuration\n * @param exampleUrls example of full URLs for a given loader (used in error messages)\n * @returns a set of DI providers corresponding to the configured image loader\n */\nexport function createImageLoader(\n buildUrlFn: (path: string, config: ImageLoaderConfig) => string,\n exampleUrls?: string[],\n) {\n return function provideImageLoader(path: string) {\n if (!isValidPath(path)) {\n throwInvalidPathError(path, exampleUrls || []);\n }\n\n // The trailing / is stripped (if provided) to make URL construction (concatenation) easier in\n // the individual loader functions.\n path = normalizePath(path);\n\n const loaderFn = (config: ImageLoaderConfig) => {\n if (isAbsoluteUrl(config.src)) {\n // Image loader functions expect an image file name (e.g. `my-image.png`)\n // or a relative path + a file name (e.g. `/a/b/c/my-image.png`) as an input,\n // so the final absolute URL can be constructed.\n // When an absolute URL is provided instead - the loader can not\n // build a final URL, thus the error is thrown to indicate that.\n throwUnexpectedAbsoluteUrlError(path, config.src);\n }\n\n return buildUrlFn(path, {...config, src: normalizeSrc(config.src)});\n };\n\n const providers: Provider[] = [{provide: IMAGE_LOADER, useValue: loaderFn}];\n return providers;\n };\n}\n\nfunction throwInvalidPathError(path: unknown, exampleUrls: string[]): never {\n throw new RuntimeError(\n RuntimeErrorCode.INVALID_LOADER_ARGUMENTS,\n ngDevMode &&\n `Image loader has detected an invalid path (\\`${path}\\`). ` +\n `To fix this, supply a path using one of the following formats: ${exampleUrls.join(\n ' or ',\n )}`,\n );\n}\n\nfunction throwUnexpectedAbsoluteUrlError(path: string, url: string): never {\n throw new RuntimeError(\n RuntimeErrorCode.INVALID_LOADER_ARGUMENTS,\n ngDevMode &&\n `Image loader has detected a \\`<img>\\` tag with an invalid \\`ngSrc\\` attribute: ${url}. ` +\n `This image loader expects \\`ngSrc\\` to be a relative URL - ` +\n `however the provided value is an absolute URL. ` +\n `To fix this, provide \\`ngSrc\\` as a path relative to the base URL ` +\n `configured for this loader (\\`${path}\\`).`,\n );\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\n/**\n * Converts transform parameter to URL parameter string.\n * @param transform The transform parameter as string or object\n * @param separator The separator between key and value ('_' for Cloudinary, '=' for Cloudflare/Imgix , '-' for ImageKit)\n */\nexport function normalizeLoaderTransform(\n transform: string | Record<string, string>,\n separator: string,\n): string {\n if (typeof transform === 'string') {\n return transform;\n }\n\n return Object.entries(transform)\n .map(([key, value]) => `${key}${separator}${value}`)\n .join(',');\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 {Provider} from '@angular/core';\nimport {PLACEHOLDER_QUALITY} from './constants';\nimport {createImageLoader, ImageLoaderConfig} from './image_loader';\nimport {normalizeLoaderTransform} from './normalized_options';\n\n/**\n * Function that generates an ImageLoader for [Cloudflare Image\n * Resizing](https://developers.cloudflare.com/images/image-resizing/) and turns it into an Angular\n * provider. Note: Cloudflare has multiple image products - this provider is specifically for\n * Cloudflare Image Resizing; it will not work with Cloudflare Images or Cloudflare Polish.\n *\n * @param path Your domain name, e.g. https://mysite.com\n * @returns Provider that provides an ImageLoader function\n *\n * @see [Image Optimization Guide](guide/image-optimization)\n * @publicApi\n */\nexport const provideCloudflareLoader: (path: string) => Provider[] = createImageLoader(\n createCloudflareUrl,\n ngDevMode ? ['https://<ZONE>/cdn-cgi/image/<OPTIONS>/<SOURCE-IMAGE>'] : undefined,\n);\n\nfunction createCloudflareUrl(path: string, config: ImageLoaderConfig) {\n let params = `format=auto`;\n if (config.width) {\n params += `,width=${config.width}`;\n }\n\n // When requesting a placeholder image we ask for a low quality image to reduce the load time.\n if (config.isPlaceholder) {\n params += `,quality=${PLACEHOLDER_QUALITY}`;\n }\n\n // Support custom transformation parameters\n if (config.loaderParams?.['transform']) {\n const transformStr = normalizeLoaderTransform(config.loaderParams['transform'], '=');\n params += `,${transformStr}`;\n }\n\n // Cloudflare image URLs format:\n // https://developers.cloudflare.com/images/image-resizing/url-format/\n return `${path}/cdn-cgi/image/${params}/${config.src}`;\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 {Provider} from '@angular/core';\nimport {createImageLoader, ImageLoaderConfig, ImageLoaderInfo} from './image_loader';\nimport {normalizeLoaderTransform} from './normalized_options';\n\n/**\n * Name and URL tester for Cloudinary.\n */\nexport const cloudinaryLoaderInfo: ImageLoaderInfo = {\n name: 'Cloudinary',\n testUrl: isCloudinaryUrl,\n};\n\nconst CLOUDINARY_LOADER_REGEX = /https?\\:\\/\\/[^\\/]+\\.cloudinary\\.com\\/.+/;\n/**\n * Tests whether a URL is from Cloudinary CDN.\n */\nfunction isCloudinaryUrl(url: string): boolean {\n return CLOUDINARY_LOADER_REGEX.test(url);\n}\n\n/**\n * Function that generates an ImageLoader for Cloudinary and turns it into an Angular provider.\n *\n * @param path Base URL of your Cloudinary images\n * This URL should match one of the following formats:\n * https://res.cloudinary.com/mysite\n * https://mysite.cloudinary.com\n * https://subdomain.mysite.com\n * @returns Set of providers to configure the Cloudinary loader.\n *\n * @see [Image Optimization Guide](guide/image-optimization)\n * @publicApi\n */\nexport const provideCloudinaryLoader: (path: string) => Provider[] = createImageLoader(\n createCloudinaryUrl,\n ngDevMode\n ? [\n 'https://res.cloudinary.com/mysite',\n 'https://mysite.cloudinary.com',\n 'https://subdomain.mysite.com',\n ]\n : undefined,\n);\n\nfunction createCloudinaryUrl(path: string, config: ImageLoaderConfig) {\n // Cloudinary image URLformat:\n // https://cloudinary.com/documentation/image_transformations#transformation_url_structure\n // Example of a Cloudinary image URL:\n // https://res.cloudinary.com/mysite/image/upload/c_scale,f_auto,q_auto,w_600/marketing/tile-topics-m.png\n\n // For a placeholder image, we use the lowest image setting available to reduce the load time\n // else we use the auto size\n const quality = config.isPlaceholder ? 'q_auto:low' : 'q_auto';\n\n let params = `f_auto,${quality}`;\n if (config.width) {\n params += `,w_${config.width}`;\n }\n\n if (config.loaderParams?.['rounded']) {\n params += `,r_max`;\n }\n\n // Allows users to add any Cloudinary transformation parameters as a string or object\n if (config.loaderParams?.['transform']) {\n const transformStr = normalizeLoaderTransform(config.loaderParams['transform'], '_');\n params += `,${transformStr}`;\n }\n\n return `${path}/image/upload/${params}/${config.src}`;\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 {Provider} from '@angular/core';\nimport {PLACEHOLDER_QUALITY} from './constants';\nimport {createImageLoader, ImageLoaderConfig, ImageLoaderInfo} from './image_loader';\nimport {normalizeLoaderTransform} from './normalized_options';\n\n/**\n * Name and URL tester for ImageKit.\n */\nexport const imageKitLoaderInfo: ImageLoaderInfo = {\n name: 'ImageKit',\n testUrl: isImageKitUrl,\n};\n\nconst IMAGE_KIT_LOADER_REGEX = /https?\\:\\/\\/[^\\/]+\\.imagekit\\.io\\/.+/;\n/**\n * Tests whether a URL is from ImageKit CDN.\n */\nfunction isImageKitUrl(url: string): boolean {\n return IMAGE_KIT_LOADER_REGEX.test(url);\n}\n\n/**\n * Function that generates an ImageLoader for ImageKit and turns it into an Angular provider.\n *\n * @param path Base URL of your ImageKit images\n * This URL should match one of the following formats:\n * https://ik.imagekit.io/myaccount\n * https://subdomain.mysite.com\n * @returns Set of providers to configure the ImageKit loader.\n *\n * @see [Image Optimization Guide](guide/image-optimization)\n * @publicApi\n */\nexport const provideImageKitLoader: (path: string) => Provider[] = createImageLoader(\n createImagekitUrl,\n ngDevMode ? ['https://ik.imagekit.io/mysite', 'https://subdomain.mysite.com'] : undefined,\n);\n\nexport function createImagekitUrl(path: string, config: ImageLoaderConfig): string {\n // Example of an ImageKit image URL:\n // https://ik.imagekit.io/demo/tr:w-300,h-300/medium_cafe_B1iTdD0C.jpg\n const {src, width} = config;\n const params: string[] = [];\n\n if (width) {\n params.push(`w-${width}`);\n }\n\n // When requesting a placeholder image we ask for a low quality image to reduce the load time.\n if (config.isPlaceholder) {\n params.push(`q-${PLACEHOLDER_QUALITY}`);\n }\n\n // Allows users to add any ImageKit transformation parameters as a string or object\n if (config.loaderParams?.['transform']) {\n const transformStr = normalizeLoaderTransform(config.loaderParams['transform'], '-');\n params.push(transformStr);\n }\n\n const urlSegments = params.length ? [path, `tr:${params.join(',')}`, src] : [path, src];\n const url = new URL(urlSegments.join('/'));\n return url.href;\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 {Provider} from '@angular/core';\nimport {PLACEHOLDER_QUALITY} from './constants';\nimport {createImageLoader, ImageLoaderConfig, ImageLoaderInfo} from './image_loader';\nimport {normalizeLoaderTransform} from './normalized_options';\n\n/**\n * Name and URL tester for Imgix.\n */\nexport const imgixLoaderInfo: ImageLoaderInfo = {\n name: 'Imgix',\n testUrl: isImgixUrl,\n};\n\nconst IMGIX_LOADER_REGEX = /https?\\:\\/\\/[^\\/]+\\.imgix\\.net\\/.+/;\n/**\n * Tests whether a URL is from Imgix CDN.\n */\nfunction isImgixUrl(url: string): boolean {\n return IMGIX_LOADER_REGEX.test(url);\n}\n\n/**\n * Function that generates an ImageLoader for Imgix and turns it into an Angular provider.\n *\n * @param path path to the desired Imgix origin,\n * e.g. https://somepath.imgix.net or https://images.mysite.com\n * @returns Set of providers to configure the Imgix loader.\n *\n * @see [Image Optimization Guide](guide/image-optimization)\n * @publicApi\n */\nexport const provideImgixLoader: (path: string) => Provider[] = createImageLoader(\n createImgixUrl,\n ngDevMode ? ['https://somepath.imgix.net/'] : undefined,\n);\n\nfunction createImgixUrl(path: string, config: ImageLoaderConfig) {\n const params: string[] = [];\n\n // This setting ensures the smallest allowable format is set.\n params.push('auto=format');\n\n if (config.width) {\n params.push(`w=${config.width}`);\n }\n\n // When requesting a placeholder image we ask a low quality image to reduce the load time.\n if (config.isPlaceholder) {\n params.push(`q=${PLACEHOLDER_QUALITY}`);\n }\n\n // Allows users to add any Imgix transformation parameters as a string or object\n if (config.loaderParams?.['transform']) {\n const transform = normalizeLoaderTransform(config.loaderParams['transform'], '=').split(',');\n params.push(...transform);\n }\n\n const url = new URL(`${path}/${config.src}`);\n url.search = params.join('&');\n return url.href;\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 Provider,\n ɵformatRuntimeError as formatRuntimeError,\n ɵRuntimeError as RuntimeError,\n} from '@angular/core';\n\nimport {RuntimeErrorCode} from '../../../errors';\nimport {isAbsoluteUrl, isValidPath} from '../url';\n\nimport {IMAGE_LOADER, ImageLoaderConfig, ImageLoaderInfo} from './image_loader';\nimport {PLACEHOLDER_QUALITY} from './constants';\n\n/**\n * Name and URL tester for Netlify.\n */\nexport const netlifyLoaderInfo: ImageLoaderInfo = {\n name: 'Netlify',\n testUrl: isNetlifyUrl,\n};\n\nconst NETLIFY_LOADER_REGEX = /https?\\:\\/\\/[^\\/]+\\.netlify\\.app\\/.+/;\n\n/**\n * Tests whether a URL is from a Netlify site. This won't catch sites with a custom domain,\n * but it's a good start for sites in development. This is only used to warn users who haven't\n * configured an image loader.\n */\nfunction isNetlifyUrl(url: string): boolean {\n return NETLIFY_LOADER_REGEX.test(url);\n}\n\n/**\n * Function that generates an ImageLoader for Netlify and turns it into an Angular provider.\n *\n * @param path optional URL of the desired Netlify site. Defaults to the current site.\n * @returns Set of providers to configure the Netlify loader.\n *\n * @publicApi\n */\nexport function provideNetlifyLoader(path?: string) {\n if (path && !isValidPath(path)) {\n throw new RuntimeError(\n RuntimeErrorCode.INVALID_LOADER_ARGUMENTS,\n ngDevMode &&\n `Image loader has detected an invalid path (\\`${path}\\`). ` +\n `To fix this, supply either the full URL to the Netlify site, or leave it empty to use the current site.`,\n );\n }\n\n if (path) {\n const url = new URL(path);\n path = url.origin;\n }\n\n const loaderFn = (config: ImageLoaderConfig) => {\n return createNetlifyUrl(config, path);\n };\n\n const providers: Provider[] = [{provide: IMAGE_LOADER, useValue: loaderFn}];\n return providers;\n}\n\nconst validParams = new Map<string, string>([\n ['height', 'h'],\n ['fit', 'fit'],\n ['quality', 'q'],\n ['q', 'q'],\n ['position', 'position'],\n]);\n\nfunction createNetlifyUrl(config: ImageLoaderConfig, path?: string) {\n // Note: `path` can be undefined, in which case we use a fake one to construct a `URL` instance.\n const url = new URL(path ?? 'https://a/');\n url.pathname = '/.netlify/images';\n\n if (!isAbsoluteUrl(config.src) && !config.src.startsWith('/')) {\n config.src = '/' + config.src;\n }\n\n url.searchParams.set('url', config.src);\n\n if (config.width) {\n url.searchParams.set('w', config.width.toString());\n }\n\n // When requesting a placeholder image we ask for a low quality image to reduce the load time.\n // If the quality is specified in the loader config - always use provided value.\n const configQuality = config.loaderParams?.['quality'] ?? config.loaderParams?.['q'];\n if (config.isPlaceholder && !configQuality) {\n url.searchParams.set('q', PLACEHOLDER_QUALITY);\n }\n\n for (const [param, value] of Object.entries(config.loaderParams ?? {})) {\n if (validParams.has(param)) {\n url.searchParams.set(validParams.get(param)!, value.toString());\n } else {\n if (ngDevMode) {\n console.warn(\n formatRuntimeError(\n RuntimeErrorCode.INVALID_LOADER_ARGUMENTS,\n `The Netlify image loader has detected an \\`<img>\\` tag with the unsupported attribute \"\\`${param}\\`\".`,\n ),\n );\n }\n }\n }\n // The \"a\" hostname is used for relative URLs, so we can remove it from the final URL.\n return url.hostname === 'a' ? url.href.replace(url.origin, '') : url.href;\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// Assembles directive details string, useful for error messages.\nexport function imgDirectiveDetails(ngSrc: string, includeNgSrc = true) {\n const ngSrcInfo = includeNgSrc\n ? `(activated on an <img> element with the \\`ngSrc=\"${ngSrc}\"\\`) `\n : '';\n return `The NgOptimizedImage directive ${ngSrcInfo}has detected that`;\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 as RuntimeError} from '@angular/core';\n\nimport {RuntimeErrorCode} from '../../errors';\n\n/**\n * Asserts that the application is in development mode. Throws an error if the application is in\n * production mode. This assert can be used to make sure that there is no dev-mode code invoked in\n * the prod mode accidentally.\n */\nexport function assertDevMode(checkName: string) {\n if (!ngDevMode) {\n throw new RuntimeError(\n RuntimeErrorCode.UNEXPECTED_DEV_MODE_CHECK_IN_PROD_MODE,\n `Unexpected invocation of the ${checkName} in the prod mode. ` +\n `Please make sure that the prod mode is enabled for production builds.`,\n );\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n inject,\n Injectable,\n OnDestroy,\n ɵformatRuntimeError as formatRuntimeError,\n DOCUMENT,\n} from '@angular/core';\n\nimport {RuntimeErrorCode} from '../../errors';\n\nimport {assertDevMode} from './asserts';\nimport {imgDirectiveDetails} from './error_helper';\nimport {getUrl} from './url';\n\ninterface ObservedImageState {\n priority: boolean;\n modified: boolean;\n alreadyWarnedPriority: boolean;\n alreadyWarnedModified: boolean;\n}\n\n/**\n * Observer that detects whether an image with `NgOptimizedImage`\n * is treated as a Largest Contentful Paint (LCP) element. If so,\n * asserts that the image has the `priority` attribute.\n *\n * Note: this is a dev-mode only class and it does not appear in prod bundles,\n * thus there is no `ngDevMode` use in the code.\n *\n * Based on https://web.dev/lcp/#measure-lcp-in-javascript.\n */\n@Injectable({providedIn: 'root'})\nexport class LCPImageObserver implements OnDestroy {\n // Map of full image URLs -> original `ngSrc` values.\n private images = new Map<string, ObservedImageState>();\n\n private window: Window | null = inject(DOCUMENT).defaultView;\n private observer: PerformanceObserver | null = null;\n\n constructor() {\n assertDevMode('LCP checker');\n\n if (\n (typeof ngServerMode === 'undefined' || !ngServerMode) &&\n typeof PerformanceObserver !== 'undefined'\n ) {\n this.observer = this.initPerformanceObserver();\n }\n }\n\n /**\n * Inits PerformanceObserver and subscribes to LCP events.\n * Based on https://web.dev/lcp/#measure-lcp-in-javascript\n */\n private initPerformanceObserver(): PerformanceObserver {\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 not supported by the directive.\n if (imgSrc.startsWith('data:') || imgSrc.startsWith('blob:')) return;\n\n const img = this.images.get(imgSrc);\n if (!img) return;\n if (!img.priority && !img.alreadyWarnedPriority) {\n img.alreadyWarnedPriority = true;\n logMissingPriorityError(imgSrc);\n }\n if (img.modified && !img.alreadyWarnedModified) {\n img.alreadyWarnedModified = true;\n logModifiedWarning(imgSrc);\n }\n });\n observer.observe({type: 'largest-contentful-paint', buffered: true});\n return observer;\n }\n\n registerImage(rewrittenSrc: string, originalNgSrc: string, isPriority: boolean) {\n if (!this.observer) return;\n const newObservedImageState: ObservedImageState = {\n priority: isPriority,\n modified: false,\n alreadyWarnedModified: false,\n alreadyWarnedPriority: false,\n };\n this.images.set(getUrl(rewrittenSrc, this.window!).href, newObservedImageState);\n }\n\n unregisterImage(rewrittenSrc: string) {\n if (!this.observer) return;\n this.images.delete(getUrl(rewrittenSrc, this.window!).href);\n }\n\n updateImage(originalSrc: string, newSrc: string) {\n if (!this.observer) return;\n const originalUrl = getUrl(originalSrc, this.window!).href;\n const img = this.images.get(originalUrl);\n if (img) {\n img.modified = true;\n this.images.set(getUrl(newSrc, this.window!).href, img);\n this.images.delete(originalUrl);\n }\n }\n\n ngOnDestroy() {\n if (!this.observer) return;\n this.observer.disconnect();\n this.images.clear();\n }\n}\n\nfunction logMissingPriorityError(ngSrc: string) {\n const directiveDetails = imgDirectiveDetails(ngSrc);\n console.error(\n formatRuntimeError(\n RuntimeErrorCode.LCP_IMG_MISSING_PRIORITY,\n `${directiveDetails} this image is the Largest Contentful Paint (LCP) ` +\n `element but was not marked \"priority\". This image should be marked ` +\n `\"priority\" in order to prioritize its loading. ` +\n `To fix this, add the \"priority\" attribute.`,\n ),\n );\n}\n\nfunction logModifiedWarning(ngSrc: string) {\n const directiveDetails = imgDirectiveDetails(ngSrc);\n console.warn(\n formatRuntimeError(\n RuntimeErrorCode.LCP_IMG_NGSRC_MODIFIED,\n `${directiveDetails} this image is the Largest Contentful Paint (LCP) ` +\n `element and has had its \"ngSrc\" attribute modified. This can cause ` +\n `slower loading performance. It is recommended not to modify the \"ngSrc\" ` +\n `property on any image which could be the LCP element.`,\n ),\n );\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n inject,\n Injectable,\n InjectionToken,\n ɵformatRuntimeError as formatRuntimeError,\n DOCUMENT,\n OnDestroy,\n} from '@angular/core';\n\nimport {RuntimeErrorCode} from '../../errors';\n\nimport {assertDevMode} from './asserts';\nimport {imgDirectiveDetails} from './error_helper';\nimport {extractHostname, getUrl} from './url';\n\n// Set of origins that are always excluded from the preconnect checks.\nconst INTERNAL_PRECONNECT_CHECK_BLOCKLIST = new Set(['localhost', '127.0.0.1', '0.0.0.0', '[::1]']);\n\n/**\n * Injection token to configure which origins should be excluded\n * from the preconnect checks. It can either be a single string or an array of strings\n * to represent a group of origins, for example:\n *\n * ```ts\n * {provide: PRECONNECT_CHECK_BLOCKLIST, useValue: 'https://your-domain.com'}\n * ```\n *\n * or:\n *\n * ```ts\n * {provide: PRECONNECT_CHECK_BLOCKLIST,\n * useValue: ['https://your-domain-1.com', 'https://your-domain-2.com']}\n * ```\n *\n * @publicApi\n */\nexport const PRECONNECT_CHECK_BLOCKLIST = new InjectionToken<Array<string | string[]>>(\n typeof ngDevMode !== 'undefined' && ngDevMode ? 'PRECONNECT_CHECK_BLOCKLIST' : '',\n);\n\n/**\n * Contains the logic to detect whether an image, marked with the \"priority\" attribute\n * has a corresponding `<link rel=\"preconnect\">` tag in the `document.head`.\n *\n * Note: this is a dev-mode only class, which should not appear in prod bundles,\n * thus there is no `ngDevMode` use in the code.\n */\n@Injectable({providedIn: 'root'})\nexport class PreconnectLinkChecker implements OnDestroy {\n private document = inject(DOCUMENT);\n\n /**\n * Set of <link rel=\"preconnect\"> tags found on this page.\n * The `null` value indicates that there was no DOM query operation performed.\n */\n private preconnectLinks: Set<string> | null = null;\n\n /*\n * Keep track of all already seen origin URLs to avoid repeating the same check.\n */\n private alreadySeen = new Set<string>();\n\n private window: Window | null = this.document.defaultView;\n\n private blocklist = new Set<string>(INTERNAL_PRECONNECT_CHECK_BLOCKLIST);\n\n constructor() {\n assertDevMode('preconnect link checker');\n const blocklist = inject(PRECONNECT_CHECK_BLOCKLIST, {optional: true});\n if (blocklist) {\n this.populateBlocklist(blocklist);\n }\n }\n\n private populateBlocklist(origins: Array<string | string[]> | string) {\n if (Array.isArray(origins)) {\n deepForEach(origins, (origin) => {\n this.blocklist.add(extractHostname(origin));\n });\n } else {\n this.blocklist.add(extractHostname(origins));\n }\n }\n\n /**\n * Checks that a preconnect resource hint exists in the head for the\n * given src.\n *\n * @param rewrittenSrc src formatted with loader\n * @param originalNgSrc ngSrc value\n */\n assertPreconnect(rewrittenSrc: string, originalNgSrc: string): void {\n if (typeof ngServerMode !== 'undefined' && ngServerMode) return;\n\n const imgUrl = getUrl(rewrittenSrc, this.window!);\n if (this.blocklist.has(imgUrl.hostname) || this.alreadySeen.has(imgUrl.origin)) return;\n\n // Register this origin as seen, so we don't check it again later.\n this.alreadySeen.add(imgUrl.origin);\n\n // Note: we query for preconnect links only *once* and cache the results\n // for the entire lifespan of an application, since it's unlikely that the\n // list would change frequently. This allows to make sure there are no\n // performance implications of making extra DOM lookups for each image.\n this.preconnectLinks ??= this.queryPreconnectLinks();\n\n if (!this.preconnectLinks.has(imgUrl.origin)) {\n console.warn(\n formatRuntimeError(\n RuntimeErrorCode.PRIORITY_IMG_MISSING_PRECONNECT_TAG,\n `${imgDirectiveDetails(originalNgSrc)} there is no preconnect tag present for this ` +\n `image. Preconnecting to the origin(s) that serve priority images ensures that these ` +\n `images are delivered as soon as possible. To fix this, please add the following ` +\n `element into the <head> of the document:\\n` +\n ` <link rel=\"preconnect\" href=\"${imgUrl.origin}\">`,\n ),\n );\n }\n }\n\n private queryPreconnectLinks(): Set<string> {\n const preconnectUrls = new Set<string>();\n const links = this.document.querySelectorAll<HTMLLinkElement>('link[rel=preconnect]');\n for (const link of links) {\n const url = getUrl(link.href, this.window!);\n preconnectUrls.add(url.origin);\n }\n return preconnectUrls;\n }\n\n ngOnDestroy() {\n this.preconnectLinks?.clear();\n this.alreadySeen.clear();\n }\n}\n\n/**\n * Invokes a callback for each element in the array. Also invokes a callback\n * recursively for each nested array.\n */\nfunction deepForEach<T>(input: (T | any[])[], fn: (value: T) => void): void {\n for (let value of input) {\n Array.isArray(value) ? deepForEach(value, fn) : fn(value);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {InjectionToken} from '@angular/core';\n\n/**\n * In SSR scenarios, a preload `<link>` element is generated for priority images.\n * Having a large number of preload tags may negatively affect the performance,\n * so we warn developers (by throwing an error) if the number of preloaded images\n * is above a certain threshold. This const specifies this threshold.\n */\nexport const DEFAULT_PRELOADED_IMAGES_LIMIT = 5;\n\n/**\n * Helps to keep track of priority images that already have a corresponding\n * preload tag (to avoid generating multiple preload tags with the same URL).\n *\n * This Set tracks the original src passed into the `ngSrc` input not the src after it has been\n * run through the specified `IMAGE_LOADER`.\n */\nexport const PRELOADED_IMAGES = new InjectionToken<Set<string>>(\n typeof ngDevMode === 'undefined' || ngDevMode ? 'NG_OPTIMIZED_PRELOADED_IMAGES' : '',\n {\n factory: () => new Set<string>(),\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 inject,\n Injectable,\n Renderer2,\n ɵformatRuntimeError as formatRuntimeError,\n DOCUMENT,\n} from '@angular/core';\n\nimport {RuntimeErrorCode} from '../../errors';\n\nimport {DEFAULT_PRELOADED_IMAGES_LIMIT, PRELOADED_IMAGES} from './tokens';\n\n/**\n * @description Contains the logic needed to track and add preload link tags to the `<head>` tag. It\n * will also track what images have already had preload link tags added so as to not duplicate link\n * tags.\n *\n * In dev mode this service will validate that the number of preloaded images does not exceed the\n * configured default preloaded images limit: {@link DEFAULT_PRELOADED_IMAGES_LIMIT}.\n */\n@Injectable({providedIn: 'root'})\nexport class PreloadLinkCreator {\n private readonly preloadedImages = inject(PRELOADED_IMAGES);\n private readonly document = inject(DOCUMENT);\n private errorShown = false;\n\n /**\n * @description Add a preload `<link>` to the `<head>` of the `index.html` that is served from the\n * server while using Angular Universal and SSR to kick off image loads for high priority images.\n *\n * The `sizes` (passed in from the user) and `srcset` (parsed and formatted from `ngSrcset`)\n * properties used to set the corresponding attributes, `imagesizes` and `imagesrcset`\n * respectively, on the preload `<link>` tag so that the correctly sized image is preloaded from\n * the CDN.\n *\n * {@link https://web.dev/preload-responsive-images/#imagesrcset-and-imagesizes}\n *\n * @param renderer The `Renderer2` passed in from the directive\n * @param src The original src of the image that is set on the `ngSrc` input.\n * @param srcset The parsed and formatted srcset created from the `ngSrcset` input\n * @param sizes The value of the `sizes` attribute passed in to the `<img>` tag\n */\n createPreloadLinkTag(renderer: Renderer2, src: string, srcset?: string, sizes?: string): void {\n if (\n ngDevMode &&\n !this.errorShown &&\n this.preloadedImages.size >= DEFAULT_PRELOADED_IMAGES_LIMIT\n ) {\n this.errorShown = true;\n console.warn(\n formatRuntimeError(\n RuntimeErrorCode.TOO_MANY_PRELOADED_IMAGES,\n `The \\`NgOptimizedImage\\` directive has detected that more than ` +\n `${DEFAULT_PRELOADED_IMAGES_LIMIT} images were marked as priority. ` +\n `This might negatively affect an overall performance of the page. ` +\n `To fix this, remove the \"priority\" attribute from images with less priority.`,\n ),\n );\n }\n\n if (this.preloadedImages.has(src)) {\n return;\n }\n\n this.preloadedImages.add(src);\n\n const preload = renderer.createElement('link');\n renderer.setAttribute(preload, 'as', 'image');\n renderer.setAttribute(preload, 'href', src);\n renderer.setAttribute(preload, 'rel', 'preload');\n renderer.setAttribute(preload, 'fetchpriority', 'high');\n\n if (sizes) {\n renderer.setAttribute(preload, 'imageSizes', sizes);\n }\n\n if (srcset) {\n renderer.setAttribute(preload, 'imageSrcset', srcset);\n }\n\n renderer.appendChild(this.document.head, preload);\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 ApplicationRef,\n booleanAttribute,\n ChangeDetectorRef,\n DestroyRef,\n Directive,\n ElementRef,\n ɵformatRuntimeError as formatRuntimeError,\n ɵIMAGE_CONFIG as IMAGE_CONFIG,\n ɵIMAGE_CONFIG_DEFAULTS as IMAGE_CONFIG_DEFAULTS,\n ɵImageConfig as ImageConfig,\n inject,\n Injector,\n Input,\n NgZone,\n numberAttribute,\n OnChanges,\n OnInit,\n ɵperformanceMarkFeature as performanceMarkFeature,\n Renderer2,\n ɵRuntimeError as RuntimeError,\n ɵSafeValue as SafeValue,\n SimpleChanges,\n ɵunwrapSafeValue as unwrapSafeValue,\n} from '@angular/core';\n\nimport {RuntimeErrorCode} from '../../errors';\n\nimport {imgDirectiveDetails} from './error_helper';\nimport {cloudinaryLoaderInfo} from './image_loaders/cloudinary_loader';\nimport {\n IMAGE_LOADER,\n ImageLoader,\n ImageLoaderConfig,\n noopImageLoader,\n} from './image_loaders/image_loader';\nimport {imageKitLoaderInfo} from './image_loaders/imagekit_loader';\nimport {imgixLoaderInfo} from './image_loaders/imgix_loader';\nimport {netlifyLoaderInfo} from './image_loaders/netlify_loader';\nimport {LCPImageObserver} from './lcp_image_observer';\nimport {PreconnectLinkChecker} from './preconnect_link_checker';\nimport {PreloadLinkCreator} from './preload-link-creator';\n\n/**\n * When a Base64-encoded image is passed as an input to the `NgOptimizedImage` directive,\n * an error is thrown. The image content (as a string) might be very long, thus making\n * it hard to read an error message if the entire string is included. This const defines\n * the number of characters that should be included into the error message. The rest\n * of the content is truncated.\n */\nconst BASE64_IMG_MAX_LENGTH_IN_ERROR = 50;\n\n/**\n * RegExpr to determine whether a src in a srcset is using width descriptors.\n * Should match something like: \"100w, 200w\".\n */\nconst VALID_WIDTH_DESCRIPTOR_SRCSET = /^((\\s*\\d+w\\s*(,|$)){1,})$/;\n\n/**\n * RegExpr to determine whether a src in a srcset is using density descriptors.\n * Should match something like: \"1x, 2x, 50x\". Also supports decimals like \"1.5x, 1.50x\".\n */\nconst VALID_DENSITY_DESCRIPTOR_SRCSET = /^((\\s*\\d+(\\.\\d+)?x\\s*(,|$)){1,})$/;\n\n/**\n * Srcset values with a density descriptor higher than this value will actively\n * throw an error. Such densities are not permitted as they cause image sizes\n * to be unreasonably large and slow down LCP.\n */\nexport const ABSOLUTE_SRCSET_DENSITY_CAP = 3;\n\n/**\n * Used only in error message text to communicate best practices, as we will\n * only throw based on the slightly more conservative ABSOLUTE_SRCSET_DENSITY_CAP.\n */\nexport const RECOMMENDED_SRCSET_DENSITY_CAP = 2;\n\n/**\n * Used in generating automatic density-based srcsets\n */\nconst DENSITY_SRCSET_MULTIPLIERS = [1, 2];\n\n/**\n * Used to determine which breakpoints to use on full-width images\n */\nconst VIEWPORT_BREAKPOINT_CUTOFF = 640;\n/**\n * Used to determine whether two aspect ratios are similar in value.\n */\nconst ASPECT_RATIO_TOLERANCE = 0.1;\n\n/**\n * Used to determine whether the image has been requested at an overly\n * large size compared to the actual rendered image size (after taking\n * into account a typical device pixel ratio). In pixels.\n */\nconst OVERSIZED_IMAGE_TOLERANCE = 1000;\n\n/**\n * Used to limit automatic srcset generation of very large sources for\n * fixed-size images. In pixels.\n */\nconst FIXED_SRCSET_WIDTH_LIMIT = 1920;\nconst FIXED_SRCSET_HEIGHT_LIMIT = 1080;\n\n/**\n * Placeholder dimension (height or width) limit in pixels. Angular produces a warning\n * when this limit is crossed.\n */\nconst PLACEHOLDER_DIMENSION_LIMIT = 1000;\n\n/**\n * Used to warn or error when the user provides an overly large dataURL for the placeholder\n * attribute.\n * Character count of Base64 images is 1 character per byte, and base64 encoding is approximately\n * 33% larger than base images, so 4000 characters is around 3KB on disk and 10000 characters is\n * around 7.7KB. Experimentally, 4000 characters is about 20x20px in PNG or medium-quality JPEG\n * format, and 10,000 is around 50x50px, but there's quite a bit of variation depending on how the\n * image is saved.\n */\nexport const DATA_URL_WARN_LIMIT = 4000;\nexport const DATA_URL_ERROR_LIMIT = 10000;\n\n/** Info about built-in loaders we can test for. */\nexport const BUILT_IN_LOADERS = [\n imgixLoaderInfo,\n imageKitLoaderInfo,\n cloudinaryLoaderInfo,\n netlifyLoaderInfo,\n];\n\n/**\n * Threshold for the PRIORITY_TRUE_COUNT\n */\nconst PRIORITY_COUNT_THRESHOLD = 10;\n\n/**\n * This count is used to log a devMode warning\n * when the count of directive instances with priority=true\n * exceeds the threshold PRIORITY_COUNT_THRESHOLD\n */\nlet IMGS_WITH_PRIORITY_ATTR_COUNT = 0;\n\n/**\n * This function is for testing purpose.\n */\nexport function resetImagePriorityCount() {\n IMGS_WITH_PRIORITY_ATTR_COUNT = 0;\n}\n\n/**\n * Config options used in rendering placeholder images.\n *\n * @see {@link NgOptimizedImage}\n * @publicApi\n */\nexport interface ImagePlaceholderConfig {\n blur?: boolean;\n}\n\n/**\n * Directive that improves image loading performance by enforcing best practices.\n *\n * `NgOptimizedImage` ensures that the loading of the Largest Contentful Paint (LCP) image is\n * prioritized by:\n * - Automatically setting the `fetchpriority` attribute on the `<img>` tag\n * - Lazy loading non-priority images by default\n * - Automatically generating a preconnect link tag in the document head\n *\n * In addition, the directive:\n * - Generates appropriate asset URLs if a corresponding `ImageLoader` function is provided\n * - Automatically generates a srcset\n * - Requires that `width` and `height` are set\n * - Warns if `width` or `height` have been set incorrectly\n * - Warns if the image will be visually distorted when rendered\n *\n * @usageNotes\n * The `NgOptimizedImage` directive is marked as [standalone](guide/components/importing) and can\n * be imported directly.\n *\n * Follow the steps below to enable and use the directive:\n * 1. Import it into the necessary NgModule or a standalone Component.\n * 2. Optionally provide an `ImageLoader` if you use an image hosting service.\n * 3. Update the necessary `<img>` tags in templates and replace `src` attributes with `ngSrc`.\n * Using a `ngSrc` allows the directive to control when the `src` gets set, which triggers an image\n * download.\n *\n * Step 1: import the `NgOptimizedImage` directive.\n *\n * ```ts\n * import { NgOptimizedImage } from '@angular/common';\n *\n * // Include it into the necessary NgModule\n * @NgModule({\n * imports: [NgOptimizedImage],\n * })\n * class AppModule {}\n *\n * // ... or a standalone Component\n * @Component({\n * imports: [NgOptimizedImage],\n * })\n * class MyStandaloneComponent {}\n * ```\n *\n * Step 2: configure a loader.\n *\n * To use the **default loader**: no additional code changes are necessary. The URL returned by the\n * generic loader will always match the value of \"src\". In other words, this loader applies no\n * transformations to the resource URL and the value of the `ngSrc` attribute will be used as is.\n *\n * To use an existing loader for a **third-party image service**: add the provider factory for your\n * chosen service to the `providers` array. In the example below, the Imgix loader is used:\n *\n * ```ts\n * import {provideImgixLoader} from '@angular/common';\n *\n * // Call the function and add the result to the `providers` array:\n * providers: [\n * provideImgixLoader(\"https://my.base.url/\"),\n * ],\n * ```\n *\n * The `NgOptimizedImage` directive provides the following functions:\n * - `provideCloudflareLoader`\n * - `provideCloudinaryLoader`\n * - `provideImageKitLoader`\n * - `provideImgixLoader`\n *\n * If you use a different image provider, you can create a custom loader function as described\n * below.\n *\n * To use a **custom loader**: provide your loader function as a value for the `IMAGE_LOADER` DI\n * token.\n *\n * ```ts\n * import {IMAGE_LOADER, ImageLoaderConfig} from '@angular/common';\n *\n * // Configure the loader using the `IMAGE_LOADER` token.\n * providers: [\n * {\n * provide: IMAGE_LOADER,\n * useValue: (config: ImageLoaderConfig) => {\n * return `https://example.com/${config.src}-${config.width}.jpg`;\n * }\n * },\n * ],\n * ```\n *\n * Step 3: update `<img>` tags in templates to use `ngSrc` instead of `src`.\n *\n * ```html\n * <img ngSrc=\"logo.png\" width=\"200\" height=\"100\">\n * ```\n *\n * @publicApi\n * @see [Image Optimization Guide](guide/image-optimization)\n */\n@Directive({\n selector: 'img[ngSrc]',\n host: {\n '[style.position]': 'fill ? \"absolute\" : null',\n '[style.width]': 'fill ? \"100%\" : null',\n '[style.height]': 'fill ? \"100%\" : null',\n '[style.inset]': 'fill ? \"0\" : null',\n '[style.background-size]': 'placeholder ? \"cover\" : null',\n '[style.background-position]': 'placeholder ? \"50% 50%\" : null',\n '[style.background-repeat]': 'placeholder ? \"no-repeat\" : null',\n '[style.background-image]': 'placeholder ? generatePlaceholder(placeholder) : null',\n '[style.filter]':\n 'placeholder && shouldBlurPlaceholder(placeholderConfig) ? \"blur(15px)\" : null',\n },\n})\nexport class NgOptimizedImage implements OnInit, OnChanges {\n private imageLoader = inject(IMAGE_LOADER);\n private config: ImageConfig = processConfig(inject(IMAGE_CONFIG));\n private renderer = inject(Renderer2);\n private imgElement: HTMLImageElement = inject(ElementRef).nativeElement;\n private injector = inject(Injector);\n private destroyRef = inject(DestroyRef);\n\n // An LCP image observer should be injected only in development mode.\n // Do not assign it to `null` to avoid having a redundant property in the production bundle.\n private lcpObserver?: LCPImageObserver;\n\n /**\n * Calculate the rewritten `src` once and store it.\n * This is needed to avoid repetitive calculations and make sure the directive cleanup in the\n * `ngOnDestroy` does not rely on the `IMAGE_LOADER` logic (which in turn can rely on some other\n * instance that might be already destroyed).\n */\n private _renderedSrc: string | null = null;\n\n /**\n * Name of the source image.\n * Image name will be processed by the image loader and the final URL will be applied as the `src`\n * property of the image.\n */\n @Input({required: true, transform: unwrapSafeUrl}) ngSrc!: string;\n\n /**\n * A comma separated list of width or density descriptors.\n * The image name will be taken from `ngSrc` and combined with the list of width or density\n * descriptors to generate the final `srcset` property of the image.\n *\n * Example:\n * ```html\n * <img ngSrc=\"hello.jpg\" ngSrcset=\"100w, 200w\" /> =>\n * <img src=\"path/hello.jpg\" srcset=\"path/hello.jpg?w=100 100w, path/hello.jpg?w=200 200w\" />\n * ```\n */\n @Input() ngSrcset!: string;\n\n /**\n * The base `sizes` attribute passed through to the `<img>` element.\n * Providing sizes causes the image to create an automatic responsive srcset.\n */\n @Input() sizes?: string;\n\n /**\n * For responsive images: the intrinsic width of the image in pixels.\n * For fixed size images: the desired rendered width of the image in pixels.\n */\n @Input({transform: numberAttribute}) width: number | undefined;\n\n /**\n * For responsive images: the intrinsic height of the image in pixels.\n * For fixed size images: the desired rendered height of the image in pixels.\n */\n @Input({transform: numberAttribute}) height: number | undefined;\n\n /**\n * The desired decoding behavior for the image. Defaults to `auto`\n * if not explicitly set, matching native browser behavior.\n *\n * Use `async` to decode the image off the main thread (non-blocking),\n * `sync` for immediate decoding (blocking), or `auto` to let the\n * browser decide the optimal strategy.\n *\n * [Spec](https://html.spec.whatwg.org/multipage/images.html#image-decoding-hint)\n */\n @Input() decoding?: 'sync' | 'async' | 'auto';\n\n /**\n * The desired loading behavior (lazy, eager, or auto). Defaults to `lazy`,\n * which is recommended for most images.\n *\n * Warning: Setting images as loading=\"eager\" or loading=\"auto\" marks them\n * as non-priority images and can hurt loading performance. For images which\n * may be the LCP element, use the `priority` attribute instead of `loading`.\n */\n @Input() loading?: 'lazy' | 'eager' | 'auto';\n\n /**\n * Indicates whether this image should have a high priority.\n */\n @Input({transform: booleanAttribute}) priority = false;\n\n /**\n * Data to pass through to custom loaders.\n */\n @Input() loaderParams?: {[key: string]: any};\n\n /**\n * Disables automatic srcset generation for this image.\n */\n @Input({transform: booleanAttribute}) disableOptimizedSrcset = false;\n\n /**\n * Sets the image to \"fill mode\", which eliminates the height/width requirement and adds\n * styles such that the image fills its containing element.\n */\n @Input({transform: booleanAttribute}) fill = false;\n\n /**\n * A URL or data URL for an image to be used as a placeholder while this image loads.\n */\n @Input({transform: booleanOrUrlAttribute}) placeholder?: string | boolean;\n\n /**\n * Configuration object for placeholder settings. Options:\n * * blur: Setting this to false disables the automatic CSS blur.\n */\n @Input() placeholderConfig?: ImagePlaceholderConfig;\n\n /**\n * Value of the `src` attribute if set on the host `<img>` element.\n * This input is exclusively read to assert that `src` is not set in conflict\n * with `ngSrc` and that images don't start to load until a lazy loading strategy is set.\n * @internal\n */\n @Input() src?: string;\n\n /**\n * Value of the `srcset` attribute if set on the host `<img>` element.\n * This input is exclusively read to assert that `srcset` is not set in conflict\n * with `ngSrcset` and that images don't start to load until a lazy loading strategy is set.\n * @internal\n */\n @Input() srcset?: string;\n\n constructor() {\n if (ngDevMode) {\n this.lcpObserver = this.injector.get(LCPImageObserver);\n\n this.destroyRef.onDestroy(() => {\n if (!this.priority && this._renderedSrc !== null) {\n this.lcpObserver!.unregisterImage(this._renderedSrc);\n }\n });\n }\n }\n\n /** @docs-private */\n ngOnInit() {\n performanceMarkFeature('NgOptimizedImage');\n\n if (ngDevMode) {\n const ngZone = this.injector.get(NgZone);\n assertNonEmptyInput(this, 'ngSrc', this.ngSrc);\n assertValidNgSrcset(this, this.ngSrcset);\n assertNoConflictingSrc(this);\n if (this.ngSrcset) {\n assertNoConflictingSrcset(this);\n }\n assertNotBase64Image(this);\n assertNotBlobUrl(this);\n if (this.fill) {\n assertEmptyWidthAndHeight(this);\n // This leaves the Angular zone to avoid triggering unnecessary change detection cycles when\n // `load` tasks are invoked on images.\n ngZone.runOutsideAngular(() =>\n assertNonZeroRenderedHeight(this, this.imgElement, this.renderer, this.destroyRef),\n );\n } else {\n assertNonEmptyWidthAndHeight(this);\n if (this.height !== undefined) {\n assertGreaterThanZero(this, this.height, 'height');\n }\n if (this.width !== undefined) {\n assertGreaterThanZero(this, this.width, 'width');\n }\n // Only check for distorted images when not in fill mode, where\n // images may be intentionally stretched, cropped or letterboxed.\n ngZone.runOutsideAngular(() =>\n assertNoImageDistortion(this, this.imgElement, this.renderer, this.destroyRef),\n );\n }\n assertValidLoadingInput(this);\n assertValidDecodingInput(this);\n if (!this.ngSrcset) {\n assertNoComplexSizes(this);\n }\n assertValidPlaceholder(this, this.imageLoader);\n assertNotMissingBuiltInLoader(this.ngSrc, this.imageLoader);\n assertNoNgSrcsetWithoutLoader(this, this.imageLoader);\n assertNoLoaderParamsWithoutLoader(this, this.imageLoader);\n\n ngZone.runOutsideAngular(() => {\n this.lcpObserver!.registerImage(this.getRewrittenSrc(), this.ngSrc, this.priority);\n });\n\n if (this.priority) {\n const checker = this.injector.get(PreconnectLinkChecker);\n checker.assertPreconnect(this.getRewrittenSrc(), this.ngSrc);\n\n if (typeof ngServerMode !== 'undefined' && !ngServerMode) {\n const applicationRef = this.injector.get(ApplicationRef);\n assetPriorityCountBelowThreshold(applicationRef);\n }\n }\n }\n if (this.placeholder) {\n this.removePlaceholderOnLoad(this.imgElement);\n }\n this.setHostAttributes();\n }\n\n private setHostAttributes() {\n // Must set width/height explicitly in case they are bound (in which case they will\n // only be reflected and not found by the browser)\n if (this.fill) {\n this.sizes ||= '100vw';\n } else {\n this.setHostAttribute('width', this.width!.toString());\n this.setHostAttribute('height', this.height!.toString());\n }\n\n this.setHostAttribute('loading', this.getLoadingBehavior());\n this.setHostAttribute('fetchpriority', this.getFetchPriority());\n this.setHostAttribute('decoding', this.getDecoding());\n\n // The `data-ng-img` attribute flags an image as using the directive, to allow\n // for analysis of the directive's performance.\n this.setHostAttribute('ng-img', 'true');\n\n // The `src` and `srcset` attributes should be set last since other attributes\n // could affect the image's loading behavior.\n const rewrittenSrcset = this.updateSrcAndSrcset();\n\n if (this.sizes) {\n if (this.getLoadingBehavior() === 'lazy') {\n this.setHostAttribute('sizes', 'auto, ' + this.sizes);\n } else {\n this.setHostAttribute('sizes', this.sizes);\n }\n } else {\n if (\n this.ngSrcset &&\n VALID_WIDTH_DESCRIPTOR_SRCSET.test(this.ngSrcset) &&\n this.getLoadingBehavior() === 'lazy'\n ) {\n this.setHostAttribute('sizes', 'auto, 100vw');\n }\n }\n\n if (typeof ngServerMode !== 'undefined' && ngServerMode && this.priority) {\n const preloadLinkCreator = this.injector.get(PreloadLinkCreator);\n preloadLinkCreator.createPreloadLinkTag(\n this.renderer,\n this.getRewrittenSrc(),\n rewrittenSrcset,\n this.sizes,\n );\n }\n }\n\n /** @docs-private */\n ngOnChanges(changes: SimpleChanges) {\n if (ngDevMode) {\n assertNoPostInitInputChange(this, changes, [\n 'ngSrcset',\n 'width',\n 'height',\n 'priority',\n 'fill',\n 'loading',\n 'sizes',\n 'loaderParams',\n 'disableOptimizedSrcset',\n ]);\n }\n if (changes['ngSrc'] && !changes['ngSrc'].isFirstChange()) {\n const oldSrc = this._renderedSrc;\n this.updateSrcAndSrcset(true);\n\n if (ngDevMode) {\n const newSrc = this._renderedSrc;\n if (oldSrc && newSrc && oldSrc !== newSrc) {\n const ngZone = this.injector.get(NgZone);\n ngZone.runOutsideAngular(() => {\n this.lcpObserver!.updateImage(oldSrc, newSrc);\n });\n }\n }\n }\n\n if (\n ngDevMode &&\n changes['placeholder']?.currentValue &&\n typeof ngServerMode !== 'undefined' &&\n !ngServerMode\n ) {\n assertPlaceholderDimensions(this, this.imgElement);\n }\n }\n\n private callImageLoader(\n configWithoutCustomParams: Omit<ImageLoaderConfig, 'loaderParams'>,\n ): string {\n let augmentedConfig: ImageLoaderConfig = configWithoutCustomParams;\n if (this.loaderParams) {\n augmentedConfig.loaderParams = this.loaderParams;\n }\n return this.imageLoader(augmentedConfig);\n }\n\n private getLoadingBehavior(): string {\n if (!this.priority && this.loading !== undefined) {\n return this.loading;\n }\n return this.priority ? 'eager' : 'lazy';\n }\n\n private getFetchPriority(): string {\n return this.priority ? 'high' : 'auto';\n }\n\n private getDecoding(): string {\n if (this.priority) {\n // `sync` means the image is decoded immediately when it's loaded,\n // reducing the risk of content shifting later (important for LCP).\n // If we're marking an image as priority, we want it decoded and\n // painted as early as possible.\n return 'sync';\n }\n // Returns the value of the `decoding` attribute, defaulting to `auto`\n // if not explicitly provided. This mimics native browser behavior and\n // avoids breaking changes when no decoding strategy is specified.\n return this.decoding ?? 'auto';\n }\n\n private getRewrittenSrc(): string {\n // ImageLoaderConfig supports setting a width property. However, we're not setting width here\n // because if the developer uses rendered width instead of intrinsic width in the HTML width\n // attribute, the image requested may be too small for 2x+ screens.\n if (!this._renderedSrc) {\n const imgConfig = {src: this.ngSrc};\n // Cache calculated image src to reuse it later in the code.\n this._renderedSrc = this.callImageLoader(imgConfig);\n }\n return this._renderedSrc;\n }\n\n private getRewrittenSrcset(): string {\n const widthSrcSet = VALID_WIDTH_DESCRIPTOR_SRCSET.test(this.ngSrcset);\n const finalSrcs = this.ngSrcset\n .split(',')\n .filter((src) => src !== '')\n .map((srcStr) => {\n srcStr = srcStr.trim();\n const width = widthSrcSet ? parseFloat(srcStr) : parseFloat(srcStr) * this.width!;\n return `${this.callImageLoader({src: this.ngSrc, width})} ${srcStr}`;\n });\n return finalSrcs.join(', ');\n }\n\n private getAutomaticSrcset(): string {\n if (this.sizes) {\n return this.getResponsiveSrcset();\n } else {\n return this.getFixedSrcset();\n }\n }\n\n private getResponsiveSrcset(): string {\n const {breakpoints} = this.config;\n\n let filteredBreakpoints = breakpoints!;\n if (this.sizes?.trim() === '100vw') {\n // Since this is a full-screen-width image, our srcset only needs to include\n // breakpoints with full viewport widths.\n filteredBreakpoints = breakpoints!.filter((bp) => bp >= VIEWPORT_BREAKPOINT_CUTOFF);\n }\n\n const finalSrcs = filteredBreakpoints.map(\n (bp) => `${this.callImageLoader({src: this.ngSrc, width: bp})} ${bp}w`,\n );\n return finalSrcs.join(', ');\n }\n\n private updateSrcAndSrcset(forceSrcRecalc = false): string | undefined {\n if (forceSrcRecalc) {\n // Reset cached value, so that the followup `getRewrittenSrc()` call\n // will recalculate it and update the cache.\n this._renderedSrc = null;\n }\n\n const rewrittenSrc = this.getRewrittenSrc();\n this.setHostAttribute('src', rewrittenSrc);\n\n let rewrittenSrcset: string | undefined = undefined;\n if (this.ngSrcset) {\n rewrittenSrcset = this.getRewrittenSrcset();\n } else if (this.shouldGenerateAutomaticSrcset()) {\n rewrittenSrcset = this.getAutomaticSrcset();\n }\n\n if (rewrittenSrcset) {\n this.setHostAttribute('srcset', rewrittenSrcset);\n }\n return rewrittenSrcset;\n }\n\n private getFixedSrcset(): string {\n const finalSrcs = DENSITY_SRCSET_MULTIPLIERS.map(\n (multiplier) =>\n `${this.callImageLoader({\n src: this.ngSrc,\n width: this.width! * multiplier,\n })} ${multiplier}x`,\n );\n return finalSrcs.join(', ');\n }\n\n private shouldGenerateAutomaticSrcset(): boolean {\n let oversizedImage = false;\n if (!this.sizes) {\n oversizedImage =\n this.width! > FIXED_SRCSET_WIDTH_LIMIT || this.height! > FIXED_SRCSET_HEIGHT_LIMIT;\n }\n return (\n !this.disableOptimizedSrcset &&\n !this.srcset &&\n this.imageLoader !== noopImageLoader &&\n !oversizedImage\n );\n }\n\n /**\n * Returns an image url formatted for use with the CSS background-image property. Expects one of:\n * * A base64 encoded image, which is wrapped and passed through.\n * * A boolean. If true, calls the image loader to generate a small placeholder url.\n */\n protected generatePlaceholder(placeholderInput: string | boolean): string | boolean | null {\n const {placeholderResolution} = this.config;\n if (placeholderInput === true) {\n return `url(${this.callImageLoader({\n src: this.ngSrc,\n width: placeholderResolution,\n isPlaceholder: true,\n })})`;\n } else if (typeof placeholderInput === 'string') {\n return `url(${placeholderInput})`;\n }\n return null;\n }\n\n /**\n * Determines if blur should be applied, based on an optional boolean\n * property `blur` within the optional configuration object `placeholderConfig`.\n */\n protected shouldBlurPlaceholder(placeholderConfig?: ImagePlaceholderConfig): boolean {\n if (!placeholderConfig || !placeholderConfig.hasOwnProperty('blur')) {\n return true;\n }\n return Boolean(placeholderConfig.blur);\n }\n\n private removePlaceholderOnLoad(img: HTMLImageElement): void {\n const callback = () => {\n const changeDetectorRef = this.injector.get(ChangeDetectorRef);\n removeLoadListenerFn();\n removeErrorListenerFn();\n this.placeholder = false;\n changeDetectorRef.markForCheck();\n };\n\n const removeLoadListenerFn = this.renderer.listen(img, 'load', callback);\n const removeErrorListenerFn = this.renderer.listen(img, 'error', callback);\n\n // Clean up listeners once the view is destroyed, before the image\n // loads or fails to load, to avoid element from being captured\n // in memory and redundant change detection.\n this.destroyRef.onDestroy(() => {\n removeLoadListenerFn();\n removeErrorListenerFn();\n });\n\n callOnLoadIfImageIsLoaded(img, callback);\n }\n\n private setHostAttribute(name: string, value: string): void {\n this.renderer.setAttribute(this.imgElement, name, value);\n }\n}\n\n/***** Helpers *****/\n\n/**\n * Sorts provided config breakpoints and uses defaults.\n */\nfunction processConfig(config: ImageConfig): ImageConfig {\n let sortedBreakpoints: {breakpoints?: number[]} = {};\n if (config.breakpoints) {\n sortedBreakpoints.breakpoints = config.breakpoints.sort((a, b) => a - b);\n }\n return Object.assign({}, IMAGE_CONFIG_DEFAULTS, config, sortedBreakpoints);\n}\n\n/***** Assert functions *****/\n\n/**\n * Verifies that there is no `src` set on a host element.\n */\nfunction assertNoConflictingSrc(dir: NgOptimizedImage) {\n if (dir.src) {\n throw new RuntimeError(\n RuntimeErrorCode.UNEXPECTED_SRC_ATTR,\n `${imgDirectiveDetails(dir.ngSrc)} both \\`src\\` and \\`ngSrc\\` have been set. ` +\n `Supplying both of these attributes breaks lazy loading. ` +\n `The NgOptimizedImage directive sets \\`src\\` itself based on the value of \\`ngSrc\\`. ` +\n `To fix this, please remove the \\`src\\` attribute.`,\n );\n }\n}\n\n/**\n * Verifies that there is no `srcset` set on a host element.\n */\nfunction assertNoConflictingSrcset(dir: NgOptimizedImage) {\n if (dir.srcset) {\n throw new RuntimeError(\n RuntimeErrorCode.UNEXPECTED_SRCSET_ATTR,\n `${imgDirectiveDetails(dir.ngSrc)} both \\`srcset\\` and \\`ngSrcset\\` have been set. ` +\n `Supplying both of these attributes breaks lazy loading. ` +\n `The NgOptimizedImage directive sets \\`srcset\\` itself based on the value of ` +\n `\\`ngSrcset\\`. To fix this, please remove the \\`srcset\\` attribute.`,\n );\n }\n}\n\n/**\n * Verifies that the `ngSrc` is not a Base64-encoded image.\n */\nfunction assertNotBase64Image(dir: NgOptimizedImage) {\n let ngSrc = dir.ngSrc.trim();\n if (ngSrc.startsWith('data:')) {\n if (ngSrc.length > BASE64_IMG_MAX_LENGTH_IN_ERROR) {\n ngSrc = ngSrc.substring(0, BASE64_IMG_MAX_LENGTH_IN_ERROR) + '...';\n }\n throw new RuntimeError(\n RuntimeErrorCode.INVALID_INPUT,\n `${imgDirectiveDetails(dir.ngSrc, false)} \\`ngSrc\\` is a Base64-encoded string ` +\n `(${ngSrc}). NgOptimizedImage does not support Base64-encoded strings. ` +\n `To fix this, disable the NgOptimizedImage directive for this element ` +\n `by removing \\`ngSrc\\` and using a standard \\`src\\` attribute instead.`,\n );\n }\n}\n\n/**\n * Verifies that the 'sizes' only includes responsive values.\n */\nfunction assertNoComplexSizes(dir: NgOptimizedImage) {\n let sizes = dir.sizes;\n if (sizes?.match(/((\\)|,)\\s|^)\\d+px/)) {\n throw new RuntimeError(\n RuntimeErrorCode.INVALID_INPUT,\n `${imgDirectiveDetails(dir.ngSrc, false)} \\`sizes\\` was set to a string including ` +\n `pixel values. For automatic \\`srcset\\` generation, \\`sizes\\` must only include responsive ` +\n `values, such as \\`sizes=\"50vw\"\\` or \\`sizes=\"(min-width: 768px) 50vw, 100vw\"\\`. ` +\n `To fix this, modify the \\`sizes\\` attribute, or provide your own \\`ngSrcset\\` value directly.`,\n );\n }\n}\n\nfunction assertValidPlaceholder(dir: NgOptimizedImage, imageLoader: ImageLoader) {\n assertNoPlaceholderConfigWithoutPlaceholder(dir);\n assertNoRelativePlaceholderWithoutLoader(dir, imageLoader);\n assertNoOversizedDataUrl(dir);\n}\n\n/**\n * Verifies that placeholderConfig isn't being used without placeholder\n */\nfunction assertNoPlaceholderConfigWithoutPlaceholder(dir: NgOptimizedImage) {\n if (dir.placeholderConfig && !dir.placeholder) {\n throw new RuntimeError(\n RuntimeErrorCode.INVALID_INPUT,\n `${imgDirectiveDetails(\n dir.ngSrc,\n false,\n )} \\`placeholderConfig\\` options were provided for an ` +\n `image that does not use the \\`placeholder\\` attribute, and will have no effect.`,\n );\n }\n}\n\n/**\n * Warns if a relative URL placeholder is specified, but no loader is present to provide the small\n * image.\n */\nfunction assertNoRelativePlaceholderWithoutLoader(dir: NgOptimizedImage, imageLoader: ImageLoader) {\n if (dir.placeholder === true && imageLoader === noopImageLoader) {\n throw new RuntimeError(\n RuntimeErrorCode.MISSING_NECESSARY_LOADER,\n `${imgDirectiveDetails(dir.ngSrc)} the \\`placeholder\\` attribute is set to true but ` +\n `no image loader is configured (i.e. the default one is being used), ` +\n `which would result in the same image being used for the primary image and its placeholder. ` +\n `To fix this, provide a loader or remove the \\`placeholder\\` attribute from the image.`,\n );\n }\n}\n\n/**\n * Warns or throws an error if an oversized dataURL placeholder is provided.\n */\nfunction assertNoOversizedDataUrl(dir: NgOptimizedImage) {\n if (\n dir.placeholder &&\n typeof dir.placeholder === 'string' &&\n dir.placeholder.startsWith('data:')\n ) {\n if (dir.placeholder.length > DATA_URL_ERROR_LIMIT) {\n throw new RuntimeError(\n RuntimeErrorCode.OVERSIZED_PLACEHOLDER,\n `${imgDirectiveDetails(\n dir.ngSrc,\n )} the \\`placeholder\\` attribute is set to a data URL which is longer ` +\n `than ${DATA_URL_ERROR_LIMIT} characters. This is strongly discouraged, as large inline placeholders ` +\n `directly increase the bundle size of Angular and hurt page load performance. To fix this, generate ` +\n `a smaller data URL placeholder.`,\n );\n }\n if (dir.placeholder.length > DATA_URL_WARN_LIMIT) {\n console.warn(\n formatRuntimeError(\n RuntimeErrorCode.OVERSIZED_PLACEHOLDER,\n `${imgDirectiveDetails(\n dir.ngSrc,\n )} the \\`placeholder\\` attribute is set to a data URL which is longer ` +\n `than ${DATA_URL_WARN_LIMIT} characters. This is discouraged, as large inline placeholders ` +\n `directly increase the bundle size of Angular and hurt page load performance. For better loading performance, ` +\n `generate a smaller data URL placeholder.`,\n ),\n );\n }\n }\n}\n\n/**\n * Verifies that the `ngSrc` is not a Blob URL.\n */\nfunction assertNotBlobUrl(dir: NgOptimizedImage) {\n const ngSrc = dir.ngSrc.trim();\n if (ngSrc.startsWith('blob:')) {\n throw new RuntimeError(\n RuntimeErrorCode.INVALID_INPUT,\n `${imgDirectiveDetails(dir.ngSrc)} \\`ngSrc\\` was set to a blob URL (${ngSrc}). ` +\n `Blob URLs are not supported by the NgOptimizedImage directive. ` +\n `To fix this, disable the NgOptimizedImage directive for this element ` +\n `by removing \\`ngSrc\\` and using a regular \\`src\\` attribute instead.`,\n );\n }\n}\n\n/**\n * Verifies that the input is set to a non-empty string.\n */\nfunction assertNonEmptyInput(dir: NgOptimizedImage, name: string, value: unknown) {\n const isString = typeof value === 'string';\n const isEmptyString = isString && value.trim() === '';\n if (!isString || isEmptyString) {\n throw new RuntimeError(\n RuntimeErrorCode.INVALID_INPUT,\n `${imgDirectiveDetails(dir.ngSrc)} \\`${name}\\` has an invalid value ` +\n `(\\`${value}\\`). To fix this, change the value to a non-empty string.`,\n );\n }\n}\n\n/**\n * Verifies that the `ngSrcset` is in a valid format, e.g. \"100w, 200w\" or \"1x, 2x\".\n */\nexport function assertValidNgSrcset(dir: NgOptimizedImage, value: unknown) {\n if (value == null) return;\n assertNonEmptyInput(dir, 'ngSrcset', value);\n const stringVal = value as string;\n const isValidWidthDescriptor = VALID_WIDTH_DESCRIPTOR_SRCSET.test(stringVal);\n const isValidDensityDescriptor = VALID_DENSITY_DESCRIPTOR_SRCSET.test(stringVal);\n\n if (isValidDensityDescriptor) {\n assertUnderDensityCap(dir, stringVal);\n }\n\n const isValidSrcset = isValidWidthDescriptor || isValidDensityDescriptor;\n if (!isValidSrcset) {\n throw new RuntimeError(\n RuntimeErrorCode.INVALID_INPUT,\n `${imgDirectiveDetails(dir.ngSrc)} \\`ngSrcset\\` has an invalid value (\\`${value}\\`). ` +\n `To fix this, supply \\`ngSrcset\\` using a comma-separated list of one or more width ` +\n `descriptors (e.g. \"100w, 200w\") or density descriptors (e.g. \"1x, 2x\").`,\n );\n }\n}\n\nfunction assertUnderDensityCap(dir: NgOptimizedImage, value: string) {\n const underDensityCap = value\n .split(',')\n .every((num) => num === '' || parseFloat(num) <= ABSOLUTE_SRCSET_DENSITY_CAP);\n if (!underDensityCap) {\n throw new RuntimeError(\n RuntimeErrorCode.INVALID_INPUT,\n `${imgDirectiveDetails(dir.ngSrc)} the \\`ngSrcset\\` contains an unsupported image density:` +\n `\\`${value}\\`. NgOptimizedImage generally recommends a max image density of ` +\n `${RECOMMENDED_SRCSET_DENSITY_CAP}x but supports image densities up to ` +\n `${ABSOLUTE_SRCSET_DENSITY_CAP}x. The human eye cannot distinguish between image densities ` +\n `greater than ${RECOMMENDED_SRCSET_DENSITY_CAP}x - which makes them unnecessary for ` +\n `most use cases. Images that will be pinch-zoomed are typically the primary use case for ` +\n `${ABSOLUTE_SRCSET_DENSITY_CAP}x images. Please remove the high density descriptor and try again.`,\n );\n }\n}\n\n/**\n * Creates a `RuntimeError` instance to represent a situation when an input is set after\n * the directive has initialized.\n */\nfunction postInitInputChangeError(dir: NgOptimizedImage, inputName: string): {} {\n let reason!: string;\n if (inputName === 'width' || inputName === 'height') {\n reason =\n `Changing \\`${inputName}\\` may result in different attribute value ` +\n `applied to the underlying image element and cause layout shifts on a page.`;\n } else {\n reason =\n `Changing the \\`${inputName}\\` would have no effect on the underlying ` +\n `image element, because the resource loading has already occurred.`;\n }\n return new RuntimeError(\n RuntimeErrorCode.UNEXPECTED_INPUT_CHANGE,\n `${imgDirectiveDetails(dir.ngSrc)} \\`${inputName}\\` was updated after initialization. ` +\n `The NgOptimizedImage directive will not react to this input change. ${reason} ` +\n `To fix this, either switch \\`${inputName}\\` to a static value ` +\n `or wrap the image element in an @if that is gated on the necessary value.`,\n );\n}\n\n/**\n * Verify that none of the listed inputs has changed.\n */\nfunction assertNoPostInitInputChange(\n dir: NgOptimizedImage,\n changes: SimpleChanges,\n inputs: string[],\n) {\n inputs.forEach((input) => {\n const isUpdated = changes.hasOwnProperty(input);\n if (isUpdated && !changes[input].isFirstChange()) {\n if (input === 'ngSrc') {\n // When the `ngSrc` input changes, we detect that only in the\n // `ngOnChanges` hook, thus the `ngSrc` is already set. We use\n // `ngSrc` in the error message, so we use a previous value, but\n // not the updated one in it.\n dir = {ngSrc: changes[input].previousValue} as NgOptimizedImage;\n }\n throw postInitInputChangeError(dir, input);\n }\n });\n}\n\n/**\n * Verifies that a specified input is a number greater than 0.\n */\nfunction assertGreaterThanZero(dir: NgOptimizedImage, inputValue: unknown, inputName: string) {\n const validNumber = typeof inputValue === 'number' && inputValue > 0;\n const validString =\n typeof inputValue === 'string' && /^\\d+$/.test(inputValue.trim()) && parseInt(inputValue) > 0;\n if (!validNumber && !validString) {\n throw new RuntimeError(\n RuntimeErrorCode.INVALID_INPUT,\n `${imgDirectiveDetails(dir.ngSrc)} \\`${inputName}\\` has an invalid value. ` +\n `To fix this, provide \\`${inputName}\\` as a number greater than 0.`,\n );\n }\n}\n\n/**\n * Verifies that the rendered image is not visually distorted. Effectively this is checking:\n * - Whether the \"width\" and \"height\" attributes reflect the actual dimensions of the image.\n * - Whether image styling is \"correct\" (see below for a longer explanation).\n */\nfunction assertNoImageDistortion(\n dir: NgOptimizedImage,\n img: HTMLImageElement,\n renderer: Renderer2,\n destroyRef: DestroyRef,\n) {\n const callback = () => {\n removeLoadListenerFn();\n removeErrorListenerFn();\n const computedStyle = window.getComputedStyle(img);\n let renderedWidth = parseFloat(computedStyle.getPropertyValue('width'));\n let renderedHeight = parseFloat(computedStyle.getPropertyValue('height'));\n const boxSizing = computedStyle.getPropertyValue('box-sizing');\n\n if (boxSizing === 'border-box') {\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 renderedAspectRatio = renderedWidth / renderedHeight;\n const nonZeroRenderedDimensions = renderedWidth !== 0 && renderedHeight !== 0;\n\n const intrinsicWidth = img.naturalWidth;\n const intrinsicHeight = img.naturalHeight;\n const intrinsicAspectRatio = intrinsicWidth / intrinsicHeight;\n\n const suppliedWidth = dir.width!;\n const suppliedHeight = dir.height!;\n const suppliedAspectRatio = suppliedWidth / suppliedHeight;\n\n // Tolerance is used to account for the impact of subpixel rendering.\n // Due to subpixel rendering, the rendered, intrinsic, and supplied\n // aspect ratios of a correctly configured image may not exactly match.\n // For example, a `width=4030 height=3020` image might have a rendered\n // size of \"1062w, 796.48h\". (An aspect ratio of 1.334... vs. 1.333...)\n const inaccurateDimensions =\n Math.abs(suppliedAspectRatio - intrinsicAspectRatio) > ASPECT_RATIO_TOLERANCE;\n const stylingDistortion =\n nonZeroRenderedDimensions &&\n Math.abs(intrinsicAspectRatio - renderedAspectRatio) > ASPECT_RATIO_TOLERANCE;\n\n if (inaccurateDimensions) {\n console.warn(\n formatRuntimeError(\n RuntimeErrorCode.INVALID_INPUT,\n `${imgDirectiveDetails(dir.ngSrc)} the aspect ratio of the image does not match ` +\n `the aspect ratio indicated by the width and height attributes. ` +\n `\\nIntrinsic image size: ${intrinsicWidth}w x ${intrinsicHeight}h ` +\n `(aspect-ratio: ${round(\n intrinsicAspectRatio,\n )}). \\nSupplied width and height attributes: ` +\n `${suppliedWidth}w x ${suppliedHeight}h (aspect-ratio: ${round(\n suppliedAspectRatio,\n )}). ` +\n `\\nTo fix this, update the width and height attributes.`,\n ),\n );\n } else if (stylingDistortion) {\n console.warn(\n formatRuntimeError(\n RuntimeErrorCode.INVALID_INPUT,\n `${imgDirectiveDetails(dir.ngSrc)} the aspect ratio of the rendered image ` +\n `does not match the image's intrinsic aspect ratio. ` +\n `\\nIntrinsic image size: ${intrinsicWidth}w x ${intrinsicHeight}h ` +\n `(aspect-ratio: ${round(intrinsicAspectRatio)}). \\nRendered image size: ` +\n `${renderedWidth}w x ${renderedHeight}h (aspect-ratio: ` +\n `${round(renderedAspectRatio)}). \\nThis issue can occur if \"width\" and \"height\" ` +\n `attributes are added to an image without updating the corresponding ` +\n `image styling. To fix this, adjust image styling. In most cases, ` +\n `adding \"height: auto\" or \"width: auto\" to the image styling will fix ` +\n `this issue.`,\n ),\n );\n } else if (!dir.ngSrcset && nonZeroRenderedDimensions) {\n // If `ngSrcset` hasn't been set, sanity check the intrinsic size.\n const recommendedWidth = RECOMMENDED_SRCSET_DENSITY_CAP * renderedWidth;\n const recommendedHeight = RECOMMENDED_SRCSET_DENSITY_CAP * renderedHeight;\n const oversizedWidth = intrinsicWidth - recommendedWidth >= OVERSIZED_IMAGE_TOLERANCE;\n const oversizedHeight = intrinsicHeight - recommendedHeight >= OVERSIZED_IMAGE_TOLERANCE;\n if (oversizedWidth || oversizedHeight) {\n console.warn(\n formatRuntimeError(\n RuntimeErrorCode.OVERSIZED_IMAGE,\n `${imgDirectiveDetails(dir.ngSrc)} the intrinsic image is significantly ` +\n `larger than necessary. ` +\n `\\nRendered image size: ${renderedWidth}w x ${renderedHeight}h. ` +\n `\\nIntrinsic image size: ${intrinsicWidth}w x ${intrinsicHeight}h. ` +\n `\\nRecommended intrinsic image size: ${recommendedWidth}w x ${recommendedHeight}h. ` +\n `\\nNote: Recommended intrinsic image size is calculated assuming a maximum DPR of ` +\n `${RECOMMENDED_SRCSET_DENSITY_CAP}. To improve loading time, resize the image ` +\n `or consider using the \"ngSrcset\" and \"sizes\" attributes.`,\n ),\n );\n }\n }\n };\n\n const removeLoadListenerFn = renderer.listen(img, 'load', callback);\n\n // We only listen to the `error` event to remove the `load` event listener because it will not be\n // fired if the image fails to load. This is done to prevent memory leaks in development mode\n // because image elements aren't garbage-collected properly. It happens because zone.js stores the\n // event listener directly on the element and closures capture `dir`.\n const removeErrorListenerFn = renderer.listen(img, 'error', () => {\n removeLoadListenerFn();\n removeErrorListenerFn();\n });\n\n // Clean up listeners once the view is destroyed, before the image\n // loads or fails to load, to avoid element from being captured\n // in memory and redundant change detection.\n destroyRef.onDestroy(() => {\n removeLoadListenerFn();\n removeErrorListenerFn();\n });\n\n callOnLoadIfImageIsLoaded(img, callback);\n}\n\n/**\n * Verifies that a specified input is set.\n */\nfunction assertNonEmptyWidthAndHeight(dir: NgOptimizedImage) {\n let missingAttributes = [];\n if (dir.width === undefined) missingAttributes.push('width');\n if (dir.height === undefined) missingAttributes.push('height');\n if (missingAttributes.length > 0) {\n throw new RuntimeError(\n RuntimeErrorCode.REQUIRED_INPUT_MISSING,\n `${imgDirectiveDetails(dir.ngSrc)} these required attributes ` +\n `are missing: ${missingAttributes.map((attr) => `\"${attr}\"`).join(', ')}. ` +\n `Including \"width\" and \"height\" attributes will prevent image-related layout shifts. ` +\n `To fix this, include \"width\" and \"height\" attributes on the image tag or turn on ` +\n `\"fill\" mode with the \\`fill\\` attribute.`,\n );\n }\n}\n\n/**\n * Verifies that width and height are not set. Used in fill mode, where those attributes don't make\n * sense.\n */\nfunction assertEmptyWidthAndHeight(dir: NgOptimizedImage) {\n if (dir.width || dir.height) {\n throw new RuntimeError(\n RuntimeErrorCode.INVALID_INPUT,\n `${imgDirectiveDetails(dir.ngSrc)} the attributes \\`height\\` and/or \\`width\\` are present ` +\n `along with the \\`fill\\` attribute. Because \\`fill\\` mode causes an image to fill its containing ` +\n `element, the size attributes have no effect and should be removed.`,\n );\n }\n}\n\n/**\n * Verifies that the rendered image has a nonzero height. If the image is in fill mode, provides\n * guidance that this can be caused by the containing element's CSS position property.\n */\nfunction assertNonZeroRenderedHeight(\n dir: NgOptimizedImage,\n img: HTMLImageElement,\n renderer: Renderer2,\n destroyRef: DestroyRef,\n) {\n const callback = () => {\n removeLoadListenerFn();\n removeErrorListenerFn();\n const renderedHeight = img.clientHeight;\n if (dir.fill && renderedHeight === 0) {\n console.warn(\n formatRuntimeError(\n RuntimeErrorCode.INVALID_INPUT,\n `${imgDirectiveDetails(dir.ngSrc)} the height of the fill-mode image is zero. ` +\n `This is likely because the containing element does not have the CSS 'position' ` +\n `property set to one of the following: \"relative\", \"fixed\", or \"absolute\". ` +\n `To fix this problem, make sure the container element has the CSS 'position' ` +\n `property defined and the height of the element is not zero.`,\n ),\n );\n }\n };\n\n const removeLoadListenerFn = renderer.listen(img, 'load', callback);\n\n // See comments in the `assertNoImageDistortion`.\n const removeErrorListenerFn = renderer.listen(img, 'error', () => {\n removeLoadListenerFn();\n removeErrorListenerFn();\n });\n\n // Clean up listeners once the view is destroyed, before the image\n // loads or fails to load, to avoid element from being captured\n // in memory and redundant change detection.\n destroyRef.onDestroy(() => {\n removeLoadListenerFn();\n removeErrorListenerFn();\n });\n\n callOnLoadIfImageIsLoaded(img, callback);\n}\n\n/**\n * Verifies that the `loading` attribute is set to a valid input &\n * is not used on priority images.\n */\nfunction assertValidLoadingInput(dir: NgOptimizedImage) {\n if (dir.loading && dir.priority) {\n throw new RuntimeError(\n RuntimeErrorCode.INVALID_INPUT,\n `${imgDirectiveDetails(dir.ngSrc)} the \\`loading\\` attribute ` +\n `was used on an image that was marked \"priority\". ` +\n `Setting \\`loading\\` on priority images is not allowed ` +\n `because these images will always be eagerly loaded. ` +\n `To fix this, remove the “loading” attribute from the priority image.`,\n );\n }\n const validInputs = ['auto', 'eager', 'lazy'];\n if (typeof dir.loading === 'string' && !validInputs.includes(dir.loading)) {\n throw new RuntimeError(\n RuntimeErrorCode.INVALID_INPUT,\n `${imgDirectiveDetails(dir.ngSrc)} the \\`loading\\` attribute ` +\n `has an invalid value (\\`${dir.loading}\\`). ` +\n `To fix this, provide a valid value (\"lazy\", \"eager\", or \"auto\").`,\n );\n }\n}\n\n/**\n * Verifies that the `decoding` attribute is set to a valid input.\n */\nfunction assertValidDecodingInput(dir: NgOptimizedImage) {\n const validInputs = ['sync', 'async', 'auto'];\n if (typeof dir.decoding === 'string' && !validInputs.includes(dir.decoding)) {\n throw new RuntimeError(\n RuntimeErrorCode.INVALID_INPUT,\n `${imgDirectiveDetails(dir.ngSrc)} the \\`decoding\\` attribute ` +\n `has an invalid value (\\`${dir.decoding}\\`). ` +\n `To fix this, provide a valid value (\"sync\", \"async\", or \"auto\").`,\n );\n }\n}\n\n/**\n * Warns if NOT using a loader (falling back to the generic loader) and\n * the image appears to be hosted on one of the image CDNs for which\n * we do have a built-in image loader. Suggests switching to the\n * built-in loader.\n *\n * @param ngSrc Value of the ngSrc attribute\n * @param imageLoader ImageLoader provided\n */\nfunction assertNotMissingBuiltInLoader(ngSrc: string, imageLoader: ImageLoader) {\n if (imageLoader === noopImageLoader) {\n let builtInLoaderName = '';\n for (const loader of BUILT_IN_LOADERS) {\n if (loader.testUrl(ngSrc)) {\n builtInLoaderName = loader.name;\n break;\n }\n }\n if (builtInLoaderName) {\n console.warn(\n formatRuntimeError(\n RuntimeErrorCode.MISSING_BUILTIN_LOADER,\n `NgOptimizedImage: It looks like your images may be hosted on the ` +\n `${builtInLoaderName} CDN, but your app is not using Angular's ` +\n `built-in loader for that CDN. We recommend switching to use ` +\n `the built-in by calling \\`provide${builtInLoaderName}Loader()\\` ` +\n `in your \\`providers\\` and passing it your instance's base URL. ` +\n `If you don't want to use the built-in loader, define a custom ` +\n `loader function using IMAGE_LOADER to silence this warning.`,\n ),\n );\n }\n }\n}\n\n/**\n * Warns if ngSrcset is present and no loader is configured (i.e. the default one is being used).\n */\nfunction assertNoNgSrcsetWithoutLoader(dir: NgOptimizedImage, imageLoader: ImageLoader) {\n if (dir.ngSrcset && imageLoader === noopImageLoader) {\n console.warn(\n formatRuntimeError(\n RuntimeErrorCode.MISSING_NECESSARY_LOADER,\n `${imgDirectiveDetails(dir.ngSrc)} the \\`ngSrcset\\` attribute is present but ` +\n `no image loader is configured (i.e. the default one is being used), ` +\n `which would result in the same image being used for all configured sizes. ` +\n `To fix this, provide a loader or remove the \\`ngSrcset\\` attribute from the image.`,\n ),\n );\n }\n}\n\n/**\n * Warns if loaderParams is present and no loader is configured (i.e. the default one is being\n * used).\n */\nfunction assertNoLoaderParamsWithoutLoader(dir: NgOptimizedImage, imageLoader: ImageLoader) {\n if (dir.loaderParams && imageLoader === noopImageLoader) {\n console.warn(\n formatRuntimeError(\n RuntimeErrorCode.MISSING_NECESSARY_LOADER,\n `${imgDirectiveDetails(dir.ngSrc)} the \\`loaderParams\\` attribute is present but ` +\n `no image loader is configured (i.e. the default one is being used), ` +\n `which means that the loaderParams data will not be consumed and will not affect the URL. ` +\n `To fix this, provide a custom loader or remove the \\`loaderParams\\` attribute from the image.`,\n ),\n );\n }\n}\n\n/**\n * Warns if the priority attribute is used too often on page load\n */\nasync function assetPriorityCountBelowThreshold(appRef: ApplicationRef) {\n if (IMGS_WITH_PRIORITY_ATTR_COUNT === 0) {\n IMGS_WITH_PRIORITY_ATTR_COUNT++;\n await appRef.whenStable();\n if (IMGS_WITH_PRIORITY_ATTR_COUNT > PRIORITY_COUNT_THRESHOLD) {\n console.warn(\n formatRuntimeError(\n RuntimeErrorCode.TOO_MANY_PRIORITY_ATTRIBUTES,\n `NgOptimizedImage: The \"priority\" attribute is set to true more than ${PRIORITY_COUNT_THRESHOLD} times (${IMGS_WITH_PRIORITY_ATTR_COUNT} times). ` +\n `Marking too many images as \"high\" priority can hurt your application's LCP (https://web.dev/lcp). ` +\n `\"Priority\" should only be set on the image expected to be the page's LCP element.`,\n ),\n );\n }\n } else {\n IMGS_WITH_PRIORITY_ATTR_COUNT++;\n }\n}\n\n/**\n * Warns if placeholder's dimension are over a threshold.\n *\n * This assert function is meant to only run on the browser.\n */\nfunction assertPlaceholderDimensions(dir: NgOptimizedImage, imgElement: HTMLImageElement) {\n const computedStyle = window.getComputedStyle(imgElement);\n let renderedWidth = parseFloat(computedStyle.getPropertyValue('width'));\n let renderedHeight = parseFloat(computedStyle.getPropertyValue('height'));\n\n if (renderedWidth > PLACEHOLDER_DIMENSION_LIMIT || renderedHeight > PLACEHOLDER_DIMENSION_LIMIT) {\n console.warn(\n formatRuntimeError(\n RuntimeErrorCode.PLACEHOLDER_DIMENSION_LIMIT_EXCEEDED,\n `${imgDirectiveDetails(dir.ngSrc)} it uses a placeholder image, but at least one ` +\n `of the dimensions attribute (height or width) exceeds the limit of ${PLACEHOLDER_DIMENSION_LIMIT}px. ` +\n `To fix this, use a smaller image as a placeholder.`,\n ),\n );\n }\n}\n\nfunction callOnLoadIfImageIsLoaded(img: HTMLImageElement, callback: VoidFunction): void {\n // https://html.spec.whatwg.org/multipage/embedded-content.html#dom-img-complete\n // The spec defines that `complete` is truthy once its request state is fully available.\n // The image may already be available if it’s loaded from the browser cache.\n // In that case, the `load` event will not fire at all, meaning that all setup\n // callbacks listening for the `load` event will not be invoked.\n // In Safari, there is a known behavior where the `complete` property of an\n // `HTMLImageElement` may sometimes return `true` even when the image is not fully loaded.\n // Checking both `img.complete` and `img.naturalWidth` is the most reliable way to\n // determine if an image has been fully loaded, especially in browsers where the\n // `complete` property may return `true` prematurely.\n if (img.complete && img.naturalWidth) {\n callback();\n }\n}\n\nfunction round(input: number): number | string {\n return Number.isInteger(input) ? input : input.toFixed(2);\n}\n\n// Transform function to handle SafeValue input for ngSrc. This doesn't do any sanitization,\n// as that is not needed for img.src and img.srcset. This transform is purely for compatibility.\nfunction unwrapSafeUrl(value: string | SafeValue): string {\n if (typeof value === 'string') {\n return value;\n }\n return unwrapSafeValue(value);\n}\n\n// Transform function to handle inputs which may be booleans, strings, or string representations\n// of boolean values. Used for the placeholder attribute.\nexport function booleanOrUrlAttribute(value: boolean | string): boolean | string {\n if (typeof value === 'string' && value !== 'true' && value !== 'false' && value !== '') {\n return value;\n }\n return booleanAttribute(value);\n}\n"],"names":["NavigationAdapterForLocation","Location","navigation","inject","PlatformNavigation","destroyRef","DestroyRef","constructor","LocationStrategy","registerNavigationListeners","currentEntryChangeListener","_notifyUrlChangeListeners","path","getState","addEventListener","onDestroy","removeEventListener","currentEntry","replaceState","query","state","url","prepareExternalUrl","normalizeQueryParams","navigate","history","go","back","forward","onUrlChange","fn","_urlChangeListeners","push","fnIndex","indexOf","splice","deps","target","i0","ɵɵFactoryTarget","Injectable","decorators","registerLocaleData","data","localeId","extraData","ɵregisterLocaleData","PLATFORM_BROWSER_ID","PLATFORM_SERVER_ID","isPlatformBrowser","platformId","isPlatformServer","VERSION","Version","ViewportScroller","ɵprov","ɵɵdefineInjectable","token","providedIn","factory","ngServerMode","NullViewportScroller","BrowserViewportScroller","DOCUMENT","window","document","offset","setOffset","Array","isArray","getScrollPosition","scrollX","scrollY","scrollToPosition","position","options","scrollTo","left","top","scrollToAnchor","elSelected","findAnchorFromDocument","scrollToElement","focus","setHistoryScrollRestoration","scrollRestoration","console","warn","formatRuntimeError","ngDevMode","el","rect","getBoundingClientRect","pageXOffset","pageYOffset","documentResult","getElementById","getElementsByName","createTreeWalker","body","attachShadow","treeWalker","NodeFilter","SHOW_ELEMENT","currentNode","shadowRoot","result","querySelector","nextNode","anchor","PLACEHOLDER_QUALITY","getUrl","src","win","isAbsoluteUrl","URL","location","href","test","extractHostname","hostname","isValidPath","isString","trim","normalizePath","endsWith","slice","normalizeSrc","startsWith","noopImageLoader","config","IMAGE_LOADER","InjectionToken","createImageLoader","buildUrlFn","exampleUrls","provideImageLoader","throwInvalidPathError","loaderFn","throwUnexpectedAbsoluteUrlError","providers","provide","useValue","RuntimeError","join","normalizeLoaderTransform","transform","separator","Object","entries","map","key","value","provideCloudflareLoader","createCloudflareUrl","undefined","params","width","isPlaceholder","loaderParams","transformStr","cloudinaryLoaderInfo","name","testUrl","isCloudinaryUrl","CLOUDINARY_LOADER_REGEX","provideCloudinaryLoader","createCloudinaryUrl","quality","imageKitLoaderInfo","isImageKitUrl","IMAGE_KIT_LOADER_REGEX","provideImageKitLoader","createImagekitUrl","urlSegments","length","imgixLoaderInfo","isImgixUrl","IMGIX_LOADER_REGEX","provideImgixLoader","createImgixUrl","split","search","netlifyLoaderInfo","isNetlifyUrl","NETLIFY_LOADER_REGEX","provideNetlifyLoader","origin","createNetlifyUrl","validParams","Map","pathname","searchParams","set","toString","configQuality","param","has","get","replace","imgDirectiveDetails","ngSrc","includeNgSrc","ngSrcInfo","assertDevMode","checkName","LCPImageObserver","images","defaultView","observer","PerformanceObserver","initPerformanceObserver","entryList","getEntries","lcpElement","imgSrc","element","img","priority","alreadyWarnedPriority","logMissingPriorityError","modified","alreadyWarnedModified","logModifiedWarning","observe","type","buffered","registerImage","rewrittenSrc","originalNgSrc","isPriority","newObservedImageState","unregisterImage","delete","updateImage","originalSrc","newSrc","originalUrl","ngOnDestroy","disconnect","clear","ɵɵngDeclareInjectable","minVersion","version","ngImport","directiveDetails","error","INTERNAL_PRECONNECT_CHECK_BLOCKLIST","Set","PRECONNECT_CHECK_BLOCKLIST","PreconnectLinkChecker","preconnectLinks","alreadySeen","blocklist","optional","populateBlocklist","origins","deepForEach","add","assertPreconnect","imgUrl","queryPreconnectLinks","preconnectUrls","links","querySelectorAll","link","input","DEFAULT_PRELOADED_IMAGES_LIMIT","PRELOADED_IMAGES","PreloadLinkCreator","preloadedImages","errorShown","createPreloadLinkTag","renderer","srcset","sizes","size","preload","createElement","setAttribute","appendChild","head","BASE64_IMG_MAX_LENGTH_IN_ERROR","VALID_WIDTH_DESCRIPTOR_SRCSET","VALID_DENSITY_DESCRIPTOR_SRCSET","ABSOLUTE_SRCSET_DENSITY_CAP","RECOMMENDED_SRCSET_DENSITY_CAP","DENSITY_SRCSET_MULTIPLIERS","VIEWPORT_BREAKPOINT_CUTOFF","ASPECT_RATIO_TOLERANCE","OVERSIZED_IMAGE_TOLERANCE","FIXED_SRCSET_WIDTH_LIMIT","FIXED_SRCSET_HEIGHT_LIMIT","PLACEHOLDER_DIMENSION_LIMIT","DATA_URL_WARN_LIMIT","DATA_URL_ERROR_LIMIT","BUILT_IN_LOADERS","PRIORITY_COUNT_THRESHOLD","IMGS_WITH_PRIORITY_ATTR_COUNT","NgOptimizedImage","imageLoader","processConfig","IMAGE_CONFIG","Renderer2","imgElement","ElementRef","nativeElement","injector","Injector","lcpObserver","_renderedSrc","ngSrcset","height","decoding","loading","disableOptimizedSrcset","fill","placeholder","placeholderConfig","ngOnInit","performanceMarkFeature","ngZone","NgZone","assertNonEmptyInput","assertValidNgSrcset","assertNoConflictingSrc","assertNoConflictingSrcset","assertNotBase64Image","assertNotBlobUrl","assertEmptyWidthAndHeight","runOutsideAngular","assertNonZeroRenderedHeight","assertNonEmptyWidthAndHeight","assertGreaterThanZero","assertNoImageDistortion","assertValidLoadingInput","assertValidDecodingInput","assertNoComplexSizes","assertValidPlaceholder","assertNotMissingBuiltInLoader","assertNoNgSrcsetWithoutLoader","assertNoLoaderParamsWithoutLoader","getRewrittenSrc","checker","applicationRef","ApplicationRef","assetPriorityCountBelowThreshold","removePlaceholderOnLoad","setHostAttributes","setHostAttribute","getLoadingBehavior","getFetchPriority","getDecoding","rewrittenSrcset","updateSrcAndSrcset","preloadLinkCreator","ngOnChanges","changes","assertNoPostInitInputChange","isFirstChange","oldSrc","currentValue","assertPlaceholderDimensions","callImageLoader","configWithoutCustomParams","augmentedConfig","imgConfig","getRewrittenSrcset","widthSrcSet","finalSrcs","filter","srcStr","parseFloat","getAutomaticSrcset","getResponsiveSrcset","getFixedSrcset","breakpoints","filteredBreakpoints","bp","forceSrcRecalc","shouldGenerateAutomaticSrcset","multiplier","oversizedImage","generatePlaceholder","placeholderInput","placeholderResolution","shouldBlurPlaceholder","hasOwnProperty","Boolean","blur","callback","changeDetectorRef","ChangeDetectorRef","removeLoadListenerFn","removeErrorListenerFn","markForCheck","listen","callOnLoadIfImageIsLoaded","Directive","ɵdir","ɵɵngDeclareDirective","isStandalone","selector","inputs","unwrapSafeUrl","numberAttribute","booleanAttribute","booleanOrUrlAttribute","host","properties","usesOnChanges","args","Input","required","sortedBreakpoints","sort","a","b","assign","IMAGE_CONFIG_DEFAULTS","dir","substring","match","assertNoPlaceholderConfigWithoutPlaceholder","assertNoRelativePlaceholderWithoutLoader","assertNoOversizedDataUrl","isEmptyString","stringVal","isValidWidthDescriptor","isValidDensityDescriptor","assertUnderDensityCap","isValidSrcset","underDensityCap","every","num","postInitInputChangeError","inputName","reason","forEach","isUpdated","previousValue","inputValue","validNumber","validString","parseInt","computedStyle","getComputedStyle","renderedWidth","getPropertyValue","renderedHeight","boxSizing","paddingTop","paddingRight","paddingBottom","paddingLeft","renderedAspectRatio","nonZeroRenderedDimensions","intrinsicWidth","naturalWidth","intrinsicHeight","naturalHeight","intrinsicAspectRatio","suppliedWidth","suppliedHeight","suppliedAspectRatio","inaccurateDimensions","Math","abs","stylingDistortion","round","recommendedWidth","recommendedHeight","oversizedWidth","oversizedHeight","missingAttributes","attr","clientHeight","validInputs","includes","builtInLoaderName","loader","appRef","whenStable","complete","Number","isInteger","toFixed","unwrapSafeValue"],"mappings":";;;;;;;;;;;;;;;;;;AA8BM,MAAOA,4BAA6B,SAAQC,QAAQ,CAAA;AACvCC,EAAAA,UAAU,GAAGC,MAAM,CAACC,kBAAkB,CAAC;AACvCC,EAAAA,UAAU,GAAGF,MAAM,CAACG,UAAU,CAAC;AAEhDC,EAAAA,WAAAA,GAAA;AACE,IAAA,KAAK,CAACJ,MAAM,CAACK,gBAAgB,CAAC,CAAC;IAE/B,IAAI,CAACC,2BAA2B,EAAE;AACpC;AAEQA,EAAAA,2BAA2BA,GAAA;IACjC,MAAMC,0BAA0B,GAAGA,MAAK;AACtC,MAAA,IAAI,CAACC,yBAAyB,CAAC,IAAI,CAACC,IAAI,CAAC,IAAI,CAAC,EAAE,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