{"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('22.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   * @param options Scroll options\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      // Use `preventScroll: true` to avoid extra scroll that breaks smooth scrolling.\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      // @see https://www.yanandcoffee.com/2020/05/08/accessible-smooth-scrolling-and-focus-management-solutions/\n      elSelected.focus({preventScroll: true});\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) ||\n          shadowRoot.querySelector(`[name=\"${CSS.escape(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, options?: ScrollOptions): 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\nexport function escapeCssUrl(input: string): string {\n  return (\n    input\n      // Backslash first — later replacements must not have their own \\ escaped again.\n      .replace(/\\\\/g, '\\\\\\\\')\n      // \\n, \\r, \\f and null terminate a CSS string (CSS Syntax 3 §4.3.5,\n      // https://www.w3.org/TR/css-syntax-3/#consume-string-token) and are also\n      // invalid in URLs, so stripping them is safe.\n      .replace(/[\\n\\r\\f\\0]/g, '')\n      // A bare \" would close the url(\"...\") wrapper early.\n      .replace(/\"/g, '\\\\\"')\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, 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   * Height of the requested image (to be used when generating srcset).\n   */\n  height?: 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  if (config.height) {\n    params += `,height=${config.height}`;\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.height) {\n    params += `,h_${config.height}`;\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  if (config.height) {\n    params.push(`h-${config.height}`);\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  if (config.height) {\n    params.push(`h=${config.height}`);\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  if (config.height) {\n    url.searchParams.set('h', config.height.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  DOCUMENT,\n  ɵformatRuntimeError as formatRuntimeError,\n  inject,\n  OnDestroy,\n  Service,\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  count: number;\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@Service()\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, isPriority: boolean) {\n    if (!this.observer) return;\n    const url = getUrl(rewrittenSrc, this.window!).href;\n    const existingState = this.images.get(url);\n\n    if (existingState) {\n      // If any instance has priority, the URL is considered to have priority\n      existingState.priority = existingState.priority || isPriority;\n      existingState.count++;\n    } else {\n      const newObservedImageState: ObservedImageState = {\n        priority: isPriority,\n        modified: false,\n        alreadyWarnedModified: false,\n        alreadyWarnedPriority: false,\n        count: 1,\n      };\n      this.images.set(url, newObservedImageState);\n    }\n  }\n\n  unregisterImage(rewrittenSrc: string) {\n    if (!this.observer) return;\n    const url = getUrl(rewrittenSrc, this.window!).href;\n    const existingState = this.images.get(url);\n\n    if (existingState) {\n      existingState.count--;\n      if (existingState.count <= 0) {\n        this.images.delete(url);\n      }\n    }\n  }\n\n  updateImage(originalSrc: string, newSrc: string) {\n    if (!this.observer) return;\n    const originalUrl = getUrl(originalSrc, this.window!).href;\n    const newUrl = getUrl(newSrc, this.window!).href;\n\n    // URL hasn't changed\n    if (originalUrl === newUrl) return;\n\n    const originalState = this.images.get(originalUrl);\n    if (!originalState) return;\n\n    // Decrement count for original URL\n    originalState.count--;\n    if (originalState.count <= 0) {\n      this.images.delete(originalUrl);\n    }\n\n    // Add or update entry for new URL\n    const newState = this.images.get(newUrl);\n    if (newState) {\n      // Merge if original had priority, new should too\n      newState.priority = newState.priority || originalState.priority;\n      newState.modified = true;\n      // Preserve warning flags from the original state to avoid duplicate warnings\n      newState.alreadyWarnedPriority =\n        newState.alreadyWarnedPriority || originalState.alreadyWarnedPriority;\n      newState.alreadyWarnedModified =\n        newState.alreadyWarnedModified || originalState.alreadyWarnedModified;\n      newState.count++;\n    } else {\n      // Create new entry, preserving state from the image that moved\n      this.images.set(newUrl, {\n        priority: originalState.priority,\n        modified: true,\n        alreadyWarnedModified: originalState.alreadyWarnedModified,\n        alreadyWarnedPriority: originalState.alreadyWarnedPriority,\n        count: 1,\n      });\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  DOCUMENT,\n  ɵformatRuntimeError as formatRuntimeError,\n  inject,\n  InjectionToken,\n  OnDestroy,\n  Service,\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@Service()\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 preload tag. Each key\n * identifies the rewritten image URL and its CORS mode, since preload tags with different CORS\n * modes are not interchangeable.\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  DOCUMENT,\n  ɵformatRuntimeError as formatRuntimeError,\n  inject,\n  Renderer2,\n  Service,\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@Service()\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   * @param crossOrigin The value of the `crossorigin` attribute passed in to the `<img>` tag\n   */\n  createPreloadLinkTag(\n    renderer: Renderer2,\n    src: string,\n    srcset?: string,\n    sizes?: string,\n    crossOrigin?: string | null,\n  ): void {\n    const preloadKey = `${src}:${getCrossOriginMode(crossOrigin)}`;\n\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(preloadKey)) {\n      return;\n    }\n\n    this.preloadedImages.add(preloadKey);\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 (crossOrigin != null) {\n      renderer.setAttribute(preload, 'crossorigin', crossOrigin);\n    }\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\nfunction getCrossOriginMode(crossOrigin?: string | null): string | null {\n  if (crossOrigin == null) {\n    return null;\n  }\n\n  return crossOrigin.toLowerCase() === 'use-credentials' ? 'use-credentials' : 'anonymous';\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';\nimport {escapeCssUrl} from './url';\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 *\n * Follow the steps below to enable and use the directive:\n * 1. Import it into a 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 * @Component({\n *   imports: [NgOptimizedImage],\n * })\n * class MyPage {}\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   * `DestroyRef.onDestroy` 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    // Browsers might re-evaluate the image during DOM teardown when using `sizes=\"auto\"`\n    // with `loading=\"lazy\"`, potentially triggering an unnecessary image fetch.\n    // This is expected behavior per the HTML spec\n    // See: https://html.spec.whatwg.org/multipage/images.html#sizes-attributes\n    // See also: https://github.com/angular/angular/issues/67055#issuecomment-3898513831\n    this.destroyRef.onDestroy(() => {\n      this.renderer.removeAttribute(this.imgElement, 'loading');\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.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        this.imgElement.getAttribute('crossorigin'),\n      );\n    }\n  }\n\n  /** @docs-private */\n  ngOnChanges(changes: SimpleChanges<NgOptimizedImage>) {\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  /**\n   * Calculates the aspect ratio of the image based on width and height.\n   * Returns null if the aspect ratio cannot be calculated (missing dimensions or height is 0).\n   */\n  private getAspectRatio(): number | null {\n    if (this.width && this.height && this.height !== 0) {\n      return this.width / this.height;\n    }\n    return null;\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    // Calculate height if width is provided and aspect ratio is available\n    const ratio = this.getAspectRatio();\n    if (ratio !== null && augmentedConfig.width) {\n      augmentedConfig.height = Math.round(augmentedConfig.width / ratio);\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(\"${escapeCssUrl(\n        this.callImageLoader({\n          src: this.ngSrc,\n          width: placeholderResolution,\n          isPlaceholder: true,\n        }),\n      )}\")`;\n    } else if (typeof placeholderInput === 'string') {\n      return `url(\"${escapeCssUrl(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":["ɵregisterLocaleData","ɵɵdefineInjectable","formatRuntimeError","RuntimeError","IMAGE_CONFIG","performanceMarkFeature","IMAGE_CONFIG_DEFAULTS","unwrapSafeValue"],"mappings":";;;;;;;;;;;;;;;;;;AA8BM,MAAO,4BAA6B,SAAQ,QAAQ,CAAA;AACvC,EAAA,UAAU,GAAG,MAAM,CAAC,kBAAkB,CAAC;AACvC,EAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;AAEhD,EAAA,WAAA,GAAA;AACE,IAAA,KAAK,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC;IAE/B,IAAI,CAAC,2BAA2B,EAAE;AACpC,EAAA;AAEQ,EAAA,2BAA2B,GAAA;IACjC,MAAM,0BAA0B,GAAG,MAAK;AACtC,MAAA,IAAI,CAAC,yBAAyB,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC;IAClE,CAAC;IACD,IAAI,CAAC,UAAU,CAAC,gBAAgB,CAAC,oBAAoB,EAAE,0BAA0B,CAAC;AAClF,IAAA,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,MAAK;MAC7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