{"version":3,"file":"siemens-element-ng-theme.mjs","sources":["../../../../projects/element-ng/theme/si-theme-store.ts","../../../../projects/element-ng/theme/si-theme-dom-target.ts","../../../../projects/element-ng/theme/si-theme.model.ts","../../../../projects/element-ng/theme/si-theme.service.ts","../../../../projects/element-ng/theme/si-theme-signals.ts","../../../../projects/element-ng/theme/index.ts","../../../../projects/element-ng/theme/siemens-element-ng-theme.ts"],"sourcesContent":["/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nimport { Observable, of } from 'rxjs';\n\nimport { Theme } from './si-theme.model';\n\n/**\n * SiThemeStore object is used by the theme service to load and\n * store the themes. You can inject your own implementation to provide\n * a backend implementation. Otherwise a localStorage based implementation\n * is used.\n */\nexport abstract class SiThemeStore {\n  /**\n   * Load and return an alternative custom theme, other then\n   * the default element theme. This method is invoked initially\n   * to check for an alternative custom theme.\n   * @returns The active theme to be used, or undefined if the\n   * default element theme shall be used. All wrapped in an observable\n   * that can also emit errors.\n   */\n  abstract loadActiveTheme(): Observable<Theme | undefined>;\n  /**\n   * Sets the theme with the given name to active.\n   * @param name - The name of the theme to become active.\n   * @returns True on success, otherwise false.\n   */\n  abstract activateTheme(name: string): Observable<boolean>;\n  /**\n   * Deactivate any active theme and makes the element theme the default one.\n   * @returns True on success, otherwise false.\n   */\n  abstract deactivateTheme(): Observable<boolean>;\n  /**\n   * Load and return the available theme names.\n   * @returns An `Observable` of available theme names, other than the\n   * default element theme.\n   */\n  abstract loadThemeNames(): Observable<string[]>;\n  /**\n   * Load theme with the given `name`.\n   * @param name - The name of the theme to be returned.\n   * @returns Observable with the named theme or `undefined` if no such theme exist.\n   */\n  abstract loadTheme(name: string): Observable<Theme | undefined>;\n  /**\n   * Saves a theme to the store. The name shall not be empty. A theme with\n   * identical name gets overwritten.\n   * @param theme - The theme to be saved.\n   * @returns True on success, otherwise false. All nicely wrapped in\n   * an observable that may also emit errors.\n   */\n  abstract saveTheme(theme: Theme): Observable<boolean>;\n  /**\n   * Deletes the theme with the given name from the store.\n   * @param name - The name of the theme to be deleted.\n   * @returns True on success, otherwise false. All nicely wrapped in\n   * an observable that may also emit errors. Returns false,\n   * if the theme does not exist.\n   */\n  abstract deleteTheme(name: string): Observable<boolean>;\n}\n\nexport const SI_THEME_LOCAL_STORAGE_KEY = 'si-themes';\n\nexport interface ThemeStorage {\n  activeTheme: string | undefined;\n  themes: { [key: string]: Theme };\n}\n\nexport class SiDefaultThemeStore extends SiThemeStore {\n  private isBrowser: boolean;\n\n  constructor(isBrowser: boolean) {\n    super();\n    this.isBrowser = isBrowser;\n  }\n\n  loadActiveTheme(): Observable<Theme | undefined> {\n    if (!this.isBrowser) {\n      return of(undefined);\n    }\n\n    const store = this.loadStore();\n    if (store.activeTheme) {\n      return of(store.themes[store.activeTheme]);\n    } else {\n      return of(undefined);\n    }\n  }\n\n  activateTheme(name: string): Observable<boolean> {\n    if (!this.isBrowser) {\n      return of(false);\n    }\n\n    const store = this.loadStore();\n    if (store.themes[name]) {\n      store.activeTheme = name;\n      this.saveStore(store);\n      return of(true);\n    } else {\n      return of(false);\n    }\n  }\n\n  deactivateTheme(): Observable<boolean> {\n    if (!this.isBrowser) {\n      return of(false);\n    }\n\n    const store = this.loadStore();\n    store.activeTheme = undefined;\n    this.saveStore(store);\n    return of(true);\n  }\n\n  loadThemeNames(): Observable<string[]> {\n    if (!this.isBrowser) {\n      return of([]);\n    }\n    const store = this.loadStore();\n    return of(Array.from(Object.keys(store.themes)));\n  }\n\n  saveTheme(theme: Theme): Observable<boolean> {\n    if (!this.isBrowser) {\n      return of(false);\n    }\n\n    const store = this.loadStore();\n    store.themes[theme.name] = theme;\n    this.saveStore(store);\n    return of(true);\n  }\n\n  loadTheme(name: string): Observable<Theme | undefined> {\n    if (!this.isBrowser) {\n      return of(undefined);\n    }\n    const store = this.loadStore();\n    return of(store.themes[name]);\n  }\n\n  deleteTheme(name: string): Observable<boolean> {\n    if (!this.isBrowser) {\n      return of(false);\n    }\n\n    const store = this.loadStore();\n    delete store.themes[name];\n    if (store.activeTheme === name) {\n      store.activeTheme = undefined;\n    }\n    this.saveStore(store);\n    return of(true);\n  }\n\n  private loadStore(): ThemeStorage {\n    const storeStr = localStorage.getItem(SI_THEME_LOCAL_STORAGE_KEY);\n    if (storeStr) {\n      return JSON.parse(storeStr) as ThemeStorage;\n    } else {\n      return { activeTheme: undefined, themes: {} };\n    }\n  }\n\n  private saveStore(store: ThemeStorage): void {\n    localStorage.setItem(SI_THEME_LOCAL_STORAGE_KEY, JSON.stringify(store));\n  }\n}\n","/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nimport { DOCUMENT, inject, InjectionToken } from '@angular/core';\nimport { Meta } from '@angular/platform-browser';\n\nimport type { ColorScheme } from './si-theme.model';\n\n/**\n * DOM boundary controlled by {@link SiThemeService}.\n */\nexport interface SiThemeDomTarget {\n  /** Element that receives theme and color-scheme classes. */\n  readonly element: HTMLElement;\n  /** CSS selector used for runtime theme variables. */\n  readonly rootSelector: string;\n  /** Event target for the legacy `theme-switch` event. */\n  readonly eventTarget?: EventTarget;\n\n  forEachElement(callback: (element: HTMLElement) => void): void;\n  registerElement?(element: HTMLElement): () => void;\n  getStyleElement(id: string): HTMLStyleElement | null;\n  appendStyleElement(style: HTMLStyleElement): void;\n  updateColorScheme(colorScheme: ColorScheme): void;\n}\n\n/**\n * Theme DOM target. The default implementation targets the current document.\n */\nexport const SI_THEME_DOM_TARGET = new InjectionToken<SiThemeDomTarget>('SI_THEME_DOM_TARGET', {\n  providedIn: 'root',\n  factory: () => {\n    const document = inject(DOCUMENT);\n    const meta = inject(Meta);\n\n    return {\n      element: document.documentElement,\n      rootSelector: ':root',\n      eventTarget: document.defaultView ?? undefined,\n      forEachElement: callback => callback(document.documentElement),\n      getStyleElement: id => document.getElementById(id) as HTMLStyleElement | null,\n      appendStyleElement: style => document.body.append(style),\n      updateColorScheme: colorScheme =>\n        meta.updateTag({ name: 'color-scheme', content: colorScheme })\n    };\n  }\n});\n","/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\n/** */\nexport interface ThemeDescription {\n  name: string;\n  groups: ThemePropertyGroup[];\n}\n\nexport interface ThemePropertyGroup {\n  name: string;\n  description?: string;\n  properties: ThemeProperty[];\n}\n\nexport interface ThemeProperty {\n  name: string;\n  usage: string;\n  type: ThemePropertyType;\n}\n\nexport type ThemePropertyType = 'color' | 'gradient' | 'font' | 'url' | 'text' | 'number';\n\nexport interface Theme {\n  name: string;\n  schemes: ThemeColorSchemes;\n  /**\n   * A map of icons that overrides the default Element icons.\n   * The key must be the key of the original icon that should be overridden.\n   * The value has to be a data SVG string.\n   *\n   * @example\n   * ```ts\n   * {\n   *   elementUser: \"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'>...</svg>\"\n   * }\n   * ```\n   *\n   * @experimental\n   */\n  icons?: Record<string, string>;\n}\n\nexport interface ThemeColorSchemes {\n  light?: ThemeColorScheme;\n  dark?: ThemeColorScheme;\n}\n\nexport type ThemeColorScheme = { [key: string]: string };\n\nexport type ColorScheme = 'light' | 'dark';\n\nexport type ThemeType = ColorScheme | 'auto';\n\nexport const ELEMENT_THEME_NAME = 'element';\n\nexport const elementTheme: ThemeDescription = {\n  name: 'element',\n  groups: [\n    {\n      name: 'Branding',\n      description: 'Configure the brand logo.',\n      properties: [\n        {\n          name: '--element-brand-logo',\n          usage: 'Enter a brand logo in the format: \\'url(\"https://company/logo.svg\")\\'',\n          type: 'text'\n        },\n        {\n          name: '--element-brand-logo-width',\n          usage: \"Enter the width of the logo as CSS width value. Example: '100px'\",\n          type: 'text'\n        },\n        {\n          name: '--element-brand-logo-height',\n          usage: \"Enter the height of the logo as CSS width value. Max: 48px; Example: '16px'\",\n          type: 'text'\n        },\n        {\n          name: '--element-brand-logo-text',\n          usage:\n            'Enter a textual representation of the logo. Example: \\'\"Siemens logo\"\\'. The text must be wrapped in double quotes.',\n          type: 'text'\n        }\n      ]\n    },\n    {\n      name: 'Basic definitions',\n      description: 'Basic definitions',\n      properties: [\n        {\n          name: '--element-body-font-family',\n          usage: 'The theme only uses one font everywhere.',\n          type: 'font'\n        },\n        { name: '--element-button-radius', usage: 'Button border radius', type: 'text' },\n        { name: '--element-button-focus-width', usage: 'Focus width', type: 'text' },\n        {\n          name: '--element-button-focus-overlay-width',\n          usage: 'Focus overlay width',\n          type: 'text'\n        },\n        {\n          name: '--element-button-focus-overlay-color',\n          usage: 'Focus overlay color',\n          type: 'text'\n        },\n        { name: '--element-input-radius', usage: 'Input field border radius', type: 'text' },\n        { name: '--element-logo-color', usage: 'Logo color', type: 'text' },\n        { name: '--element-radius-1', usage: 'Border radius-1', type: 'text' },\n        { name: '--element-radius-2', usage: 'Border radius-2', type: 'text' },\n        { name: '--element-radius-3', usage: 'Border radius-3', type: 'text' }\n      ]\n    },\n    {\n      name: 'UI',\n      description:\n        'UI colors are used on structural properties and icons and provide good contrast when used over any background.',\n      properties: [\n        { name: '--element-ui-0', usage: 'Logo, selected (active) elements', type: 'color' },\n        { name: '--element-ui-0-hover', usage: 'Selected hover', type: 'color' },\n        { name: '--element-ui-1', usage: 'Primary icons', type: 'color' },\n        { name: '--element-ui-2', usage: 'Secondary icons', type: 'color' },\n        { name: '--element-ui-3', usage: 'Disabled', type: 'color' },\n        { name: '--element-ui-4', usage: 'Borders', type: 'color' },\n        { name: '--element-ui-5', usage: 'Inverse', type: 'color' },\n        { name: '--element-ui-6', usage: 'Shadows', type: 'color' },\n        { name: '--element-box-shadow-color-1', usage: 'Box shadow color 1', type: 'color' },\n        { name: '--element-box-shadow-color-2', usage: 'Box shadow color 2', type: 'color' },\n        { name: '--element-focus-default', usage: 'Default focus color', type: 'color' }\n      ]\n    },\n    {\n      name: 'Base',\n      description: 'Base colors are used as backgrounds of containers.',\n      properties: [\n        { name: '--element-base-0', usage: 'Page background, row background', type: 'color' },\n        {\n          name: '--element-base-1',\n          usage: 'Header, navigation, card, table background',\n          type: 'color'\n        },\n        {\n          name: '--element-base-1-hover',\n          usage: 'Hover on base-1 backgrounds, like table, tree, or menu',\n          type: 'color'\n        },\n        {\n          name: '--element-base-1-selected',\n          usage: 'Selected on base-1 backgrounds, like table, tree, or menu',\n          type: 'color'\n        },\n        {\n          name: '--element-base-2',\n          usage: 'Page background with higher contrast pages in dark mode',\n          type: 'color'\n        },\n        {\n          name: '--element-base-information',\n          usage: 'Informational component background for e.g. badges',\n          type: 'gradient'\n        },\n        {\n          name: '--element-base-success',\n          usage: 'Success component background for e.g. badges',\n          type: 'gradient'\n        },\n        {\n          name: '--element-base-caution',\n          usage: 'Caution component background for e.g. badges',\n          type: 'gradient'\n        },\n        {\n          name: '--element-base-warning',\n          usage: 'Warning component background for e.g. badges',\n          type: 'gradient'\n        },\n        {\n          name: '--element-base-danger',\n          usage: 'Danger component background for e.g. badges',\n          type: 'gradient'\n        },\n        {\n          name: '--element-base-translucent-1',\n          usage: 'Translucent background, e.g. backdrop',\n          type: 'gradient'\n        },\n        {\n          name: '--element-base-translucent-2',\n          usage: 'Slightly translucent background, e.g. toasts',\n          type: 'gradient'\n        }\n      ]\n    },\n    {\n      name: 'Actions',\n      description: 'Action colors are used to indicate actions that users can perform.',\n      properties: [\n        { name: '--element-action-primary', usage: 'Primary interaction', type: 'gradient' },\n        {\n          name: '--element-action-primary-hover',\n          usage: 'Primary action background on hover',\n          type: 'gradient'\n        },\n        { name: '--element-action-primary-text', usage: 'Primary text color', type: 'color' },\n        { name: '--element-action-secondary', usage: 'Secondary interaction', type: 'gradient' },\n        {\n          name: '--element-action-secondary-hover',\n          usage: 'Secondary action background on hover',\n          type: 'gradient'\n        },\n        { name: '--element-action-secondary-text', usage: 'Secondary text color', type: 'color' },\n        {\n          name: '--element-action-secondary-text-hover',\n          usage: 'Secondary text color on hover',\n          type: 'color'\n        },\n        {\n          name: '--element-action-secondary-border',\n          usage: 'Secondary border color',\n          type: 'color'\n        },\n        {\n          name: '--element-action-secondary-border-hover',\n          usage: 'Secondary border color on hover',\n          type: 'color'\n        },\n        { name: '--element-action-warning', usage: 'Warning', type: 'gradient' },\n        {\n          name: '--element-action-warning-hover',\n          usage: 'Warning action background on hover',\n          type: 'gradient'\n        },\n        { name: '--element-action-warning-text', usage: 'Warning text color', type: 'color' },\n        { name: '--element-action-danger', usage: 'Danger', type: 'gradient' },\n        {\n          name: '--element-action-danger-hover',\n          usage: 'Danger action background on hover',\n          type: 'gradient'\n        },\n        { name: '--element-action-danger-text', usage: 'Danger text color', type: 'color' },\n        {\n          name: '--element-action-disabled-opacity',\n          usage: 'Disabled action opacity',\n          type: 'number'\n        }\n      ]\n    },\n    {\n      name: 'Text',\n      description: 'Similarly, categories for typography colors are also defined in this system.',\n      properties: [\n        { name: '--element-text-primary', usage: 'Primary', type: 'color' },\n        { name: '--element-text-secondary', usage: 'Secondary', type: 'color' },\n        { name: '--element-text-disabled', usage: 'Disabled', type: 'color' },\n        { name: '--element-text-inverse', usage: 'Inverse', type: 'color' },\n        { name: '--element-text-active', usage: 'Active', type: 'color' },\n        { name: '--element-text-information', usage: 'Informational', type: 'color' },\n        { name: '--element-text-success', usage: 'Success', type: 'color' },\n        { name: '--element-text-caution', usage: 'Caution', type: 'color' },\n        { name: '--element-text-warning', usage: 'Warning', type: 'color' },\n        { name: '--element-text-danger', usage: 'Danger', type: 'color' }\n      ]\n    },\n    {\n      name: 'Status',\n      description:\n        'Status colors are used to describe and/or report on the status of different things.',\n      properties: [\n        { name: '--element-status-information', usage: 'Informational', type: 'color' },\n        {\n          name: '--element-status-information-contrast',\n          usage: 'Informational contrast',\n          type: 'color'\n        },\n        { name: '--element-status-success', usage: 'Success', type: 'color' },\n        { name: '--element-status-success-contrast', usage: 'Success contrast', type: 'color' },\n        { name: '--element-status-caution', usage: 'Caution', type: 'color' },\n        { name: '--element-status-caution-contrast', usage: 'Caution contrast', type: 'color' },\n        { name: '--element-status-warning', usage: 'Warning', type: 'color' },\n        { name: '--element-status-warning-contrast', usage: 'Warning contrast', type: 'color' },\n        { name: '--element-status-danger', usage: 'Danger', type: 'color' },\n        { name: '--element-status-danger-contrast', usage: 'Danger contrast', type: 'color' }\n      ]\n    },\n    {\n      name: 'Form feedback icons',\n      description: 'Icons that are used to indicate a form item status',\n      properties: [{ name: '--element-invalid-feedback-icon', usage: 'Danger', type: 'text' }]\n    }\n  ]\n};\n","/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nimport { isPlatformBrowser } from '@angular/common';\nimport {\n  DestroyRef,\n  DOCUMENT,\n  EventEmitter,\n  inject,\n  Injectable,\n  PLATFORM_ID,\n  signal\n} from '@angular/core';\nimport { Observable, of, ReplaySubject, throwError } from 'rxjs';\nimport { map, switchMap, take, tap } from 'rxjs/operators';\n\nimport { SI_THEME_DOM_TARGET } from './si-theme-dom-target';\nimport { SiDefaultThemeStore, SiThemeStore } from './si-theme-store';\nimport {\n  ELEMENT_THEME_NAME,\n  Theme,\n  ThemeColorScheme,\n  ThemeColorSchemes,\n  ThemeType\n} from './si-theme.model';\n\n@Injectable({ providedIn: 'root' })\nexport class SiThemeService {\n  /**\n   * The current color scheme. (e.g. light or dark).\n   */\n  private _resolvedColorScheme: ThemeType | undefined = 'light';\n  private resolvedColorSchemeSub = new ReplaySubject<keyof ThemeColorSchemes>(1);\n  /**\n   * Emits events when the color scheme changes.\n   *\n   * @defaultValue this.resolvedColorSchemeSub.asObservable()\n   */\n  readonly resolvedColorScheme$ = this.resolvedColorSchemeSub.asObservable();\n  /**\n   * The current color scheme. (e.g. light or dark).\n   */\n  get resolvedColorScheme(): ThemeType | undefined {\n    return this._resolvedColorScheme;\n  }\n\n  /**\n   * All available theme names, including element theme name.\n   */\n  private _themeNames: string[] = [ELEMENT_THEME_NAME];\n  private themeNamesSub = new ReplaySubject<string[]>(1);\n  /**\n   * Emits events when the list of available theme names changes.\n   *\n   * @defaultValue this.themeNamesSub.asObservable()\n   */\n  readonly themeNames$ = this.themeNamesSub.asObservable();\n\n  /**\n   * All available theme names, including element theme name.\n   */\n  get themeNames(): string[] {\n    return this._themeNames;\n  }\n\n  /**\n   * Emits events when the currently applied theme changes. Either by\n   * changing to another theme or by re-applying a theme with updated\n   * properties. When switching to default theme element, `undefined`\n   * is emitted.\n   */\n  readonly themeChange = new EventEmitter<Theme | undefined>();\n\n  /**\n   * The name of the theme that is active. Theme name `element` is the default.\n   */\n  activeThemeName?: string;\n  /**\n   * Icon overrides by the currently activeTheme.\n   * @defaultValue\n   * ```\n   * {}\n   * ```\n   */\n  readonly themeIcons = signal<Record<string, string>>({});\n\n  private themes: Map<string, Theme> = new Map();\n  private themeStyles = new Map<string, HTMLStyleElement>();\n  private darkMediaQuery?: MediaQueryList;\n  private mediaQueryListener?: () => void;\n  private isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n  private previewTheme?: Theme;\n\n  private themeStore =\n    inject(SiThemeStore, { optional: true }) ?? new SiDefaultThemeStore(this.isBrowser);\n  private document = inject(DOCUMENT);\n  private themeTarget = inject(SI_THEME_DOM_TARGET);\n\n  constructor() {\n    inject(DestroyRef).onDestroy(() => {\n      this.themeStyles.forEach((_, name) => this.removeThemeCSS(name));\n    });\n\n    this._resolvedColorScheme = this.themeTarget.element.classList.contains('app--dark')\n      ? 'dark'\n      : 'light';\n    this.resolvedColorScheme$.subscribe(scheme => (this._resolvedColorScheme = scheme));\n    this.themeNames$.subscribe(names => (this._themeNames = names));\n\n    if (this.isBrowser) {\n      this.darkMediaQuery = window.matchMedia('(prefers-color-scheme: dark)');\n      this.mediaQueryListener = () => this.toggleDark(this.darkMediaQuery!.matches);\n    }\n\n    this.getActiveTheme()\n      .pipe(take(1))\n      .subscribe({\n        next: theme => this.applyThemeStyle(theme, this._resolvedColorScheme),\n        error: error => console.error('Cannot load active theme', error)\n      });\n\n    this.themeStore\n      .loadThemeNames()\n      .pipe(take(1))\n      .subscribe({\n        next: names => {\n          names.push(ELEMENT_THEME_NAME);\n          this.themeNamesSub.next(names);\n        },\n        error: error => console.error('Cannot load theme names', error)\n      });\n  }\n\n  /**\n   * Returns `true` if a theme with the given name is available.\n   */\n  hasTheme(name: string): boolean {\n    return this._themeNames.includes(name);\n  }\n\n  /**\n   * Returns a clone of the theme with the given name or `undefined` if not\n   * available or name is `element`.\n   * @param name - The name of the theme to be returned.\n   * @returns The theme with the given name and `undefined` if name is `element`.\n   */\n  getTheme(name: string): Observable<Theme | undefined> {\n    if (name === ELEMENT_THEME_NAME || !this.hasTheme(name)) {\n      return of(undefined);\n    }\n\n    if (this.themes.has(name)) {\n      const theme = this.themes.get(name)!;\n      // return a clone to avoid changes as a side effect\n      return of(this.cloneTheme(theme));\n    }\n\n    return this.themeStore.loadTheme(name).pipe(\n      tap(theme => {\n        if (theme) {\n          this.themes.set(theme.name, this.cloneTheme(theme));\n        }\n      })\n    );\n  }\n\n  /**\n   * Loads and returns the currently active theme. Returns undefined if no custom theme is used.\n   * @returns A custom theme or `undefined` if the default element theme is used.\n   */\n  getActiveTheme(): Observable<Theme | undefined> {\n    if (this.activeThemeName) {\n      return of(this.themes.get(this.activeThemeName));\n    }\n    return this.themeStore.loadActiveTheme().pipe(\n      map(theme => {\n        if (theme) {\n          this.activeThemeName = theme.name;\n          this.themes.set(theme.name, theme);\n          this.applyTheme(theme, this._resolvedColorScheme);\n          return theme;\n        }\n        this.activeThemeName = ELEMENT_THEME_NAME;\n        return undefined;\n      })\n    );\n  }\n\n  /**\n   * Adds or updates the given theme in the theme store.\n   * @param theme - The theme to be saved.\n   * @returns `true` if the theme was saved successfully.\n   */\n  addOrUpdateTheme(theme: Theme): Observable<boolean> {\n    const result = new ReplaySubject<boolean>(1);\n\n    this.themeStore.saveTheme(theme).subscribe({\n      next: saveResult => {\n        if (saveResult) {\n          this.themes.set(theme.name, this.cloneTheme(theme));\n          // Update list of theme names when this is a new one\n          if (!this.hasTheme(theme.name)) {\n            const names = this._themeNames.concat(theme.name);\n            this.themeNamesSub.next(names);\n          }\n        }\n        result.next(saveResult);\n        result.complete();\n      },\n      error: error => result.error(error),\n      complete: () => result.complete()\n    });\n    return result;\n  }\n\n  /**\n   * Deletes the theme with the given name from the theme store.\n   */\n  deleteTheme(name: string): Observable<boolean> {\n    const result = new ReplaySubject<boolean>(1);\n    if (!this.hasTheme(name) || name === ELEMENT_THEME_NAME) {\n      result.next(false);\n      result.complete();\n    } else {\n      this.removeThemeCSS(name);\n      this.themeStore.deleteTheme(name).subscribe({\n        next: deleteResult => {\n          if (deleteResult) {\n            this.themes.delete(name);\n            const names = this._themeNames.filter(themeName => themeName !== name);\n            this.themeNamesSub.next(names);\n          }\n          result.next(deleteResult);\n          result.complete();\n        },\n        error: error => result.error(error),\n        complete: () => result.complete()\n      });\n    }\n    return result;\n  }\n\n  /**\n   * Resets the preview theme to the default element theme.\n   */\n  resetPreview(): void {\n    this.previewTheme = { name: '__preview', schemes: { dark: {}, light: {} } };\n    this.removeThemeCSS(this.previewTheme.name);\n  }\n\n  /**\n   * Sets the active theme to the given name. If no name is given, the default element theme is used.\n   */\n  setActiveTheme(name?: string, type?: ThemeType): Observable<boolean> {\n    const theType = type ?? this._resolvedColorScheme ?? 'auto';\n    const theName = name ?? this.activeThemeName ?? ELEMENT_THEME_NAME;\n\n    if (theName === this.activeThemeName) {\n      return of(true);\n    }\n    if (!this.hasTheme(theName)) {\n      return of(false);\n    }\n\n    const result = new ReplaySubject<boolean>(1);\n    this.activeThemeName = theName;\n    // Make the change in the remove store\n    const store =\n      theName !== ELEMENT_THEME_NAME\n        ? this.themeStore.activateTheme(theName)\n        : this.themeStore.deactivateTheme();\n    store\n      .pipe(\n        // On success, load the theme\n        switchMap(storeResult => {\n          if (storeResult) {\n            return this.getTheme(theName);\n          } else {\n            return throwError(() => 'Cannot change active theme in theme store.');\n          }\n        }),\n        // Only take one to avoid unsubscription issues\n        take(1)\n      )\n      .subscribe({\n        next: theme => {\n          this.applyTheme(theme, theType);\n          result.next(true);\n        },\n        error: error => {\n          console.error(`Activating theme ${name} failed`, error);\n          result.next(false);\n        },\n        complete: () => result.complete()\n      });\n    return result;\n  }\n\n  /**\n   * Apply `light` or `dark` theme to the configured theme target.\n   */\n  applyThemeType(type: ThemeType): void {\n    if (type === this._resolvedColorScheme || !this.darkMediaQuery || !this.mediaQueryListener) {\n      return;\n    }\n\n    this.darkMediaQuery.removeEventListener('change', this.mediaQueryListener);\n\n    if (type === 'light') {\n      this.toggleDark(false);\n    } else if (type === 'dark') {\n      this.toggleDark(true);\n    } else {\n      this.mediaQueryListener();\n      this.darkMediaQuery.addEventListener('change', this.mediaQueryListener);\n    }\n  }\n\n  /**\n   * Applies the given theme to the configured theme target. If no theme is given, the active theme is applied.\n   */\n  applyTheme(theme?: Theme, type?: ThemeType, overwrite?: boolean): void {\n    if (theme) {\n      this.applyThemeStyle(theme, type, overwrite);\n    } else {\n      this.getActiveTheme()\n        .pipe(take(1))\n        .subscribe({\n          next: loadedTheme => this.applyThemeStyle(loadedTheme, type),\n          error: error => console.error('Cannot load active theme', error)\n        });\n    }\n  }\n\n  /**\n   * Updates the given property of the preview theme.\n   */\n  updateProperty(name: string, value: string, type: keyof ThemeColorSchemes): void {\n    if (!this.previewTheme) {\n      this.resetPreview();\n    }\n    this.previewTheme!.schemes[type]![name] = value;\n    this.createThemeCSS(this.previewTheme!);\n    this.themeTarget.forEachElement(element => element.classList.add('theme-__preview'));\n    this.dispatchThemeSwitchEvent();\n  }\n\n  /**\n   * Checks if the given theme JSON object is a valid theme.\n   */\n  isThemeValid(data: unknown): boolean {\n    const theme = data as Theme;\n    return (\n      !!data &&\n      typeof data === 'object' &&\n      'name' in data &&\n      'schemes' in data &&\n      typeof theme.name === 'string' &&\n      typeof theme.schemes === 'object' &&\n      this.isThemeTypeValid(theme, 'light') &&\n      this.isThemeTypeValid(theme, 'dark')\n    );\n  }\n\n  private isThemeTypeValid(theme: Theme, type: 'light' | 'dark'): boolean {\n    return (\n      !(type in theme.schemes) ||\n      (typeof theme.schemes[type] === 'object' &&\n        Object.values(theme.schemes[type] as ThemeColorScheme).every(\n          item => typeof item === 'string'\n        ) &&\n        Object.keys(theme.schemes[type] as ThemeColorScheme).every(\n          item => typeof item === 'string'\n        ))\n    );\n  }\n\n  private applyThemeStyle(theme?: Theme, type?: ThemeType, overwrite?: boolean): void {\n    if (!this.isBrowser) {\n      return;\n    }\n    this.resetPreview();\n\n    if (theme && theme.name !== ELEMENT_THEME_NAME && (overwrite || !this.hasThemeCSS(theme))) {\n      this.createThemeCSS(theme);\n    }\n    this.activateTheme(theme);\n\n    if (type && type !== this._resolvedColorScheme) {\n      this.applyThemeType(type);\n    }\n\n    this.themeIcons.set(\n      Object.fromEntries(Object.entries(theme?.icons ?? {}).map(([key, icon]) => [key, icon]))\n    );\n    this.themeChange.emit(theme);\n  }\n\n  private activateTheme(theme?: Theme): void {\n    this.themeTarget.forEachElement(element => {\n      const classList = element.classList;\n      classList.forEach(className => {\n        if (className.startsWith('theme-')) {\n          classList.remove(className);\n        }\n      });\n      if (theme) {\n        classList.add(`theme-${theme.name}`);\n      }\n    });\n  }\n\n  private hasThemeCSS(theme: Theme): boolean {\n    return this.themeStyles.has(theme.name);\n  }\n\n  private createThemeCSS(theme: Theme): void {\n    let css = '';\n    const themeSelector = this.createThemeSelector(theme.name);\n    if (theme.schemes.light) {\n      css = this.createThemeVariantCSS(css, themeSelector, theme.schemes.light);\n    }\n    if (theme.schemes.dark) {\n      css = this.createThemeVariantCSS(\n        css,\n        this.createThemeSelector(theme.name, true),\n        theme.schemes.dark\n      );\n    }\n\n    this.removeThemeCSS(theme.name);\n    const cssElement = this.document.createElement('style');\n    cssElement.id = `__theme-${theme.name}`;\n    cssElement.textContent = css;\n\n    this.themeTarget.appendStyleElement(cssElement);\n    this.themeStyles.set(theme.name, cssElement);\n  }\n\n  private createThemeSelector(name: string, dark: boolean = false): string {\n    const classes = `.theme-${name}${dark ? '.app--dark' : ''}`;\n    return this.themeTarget.rootSelector === ':host'\n      ? `:host(${classes})`\n      : `${this.themeTarget.rootSelector}${classes}`;\n  }\n\n  private createThemeVariantCSS(css: string, selector: string, scheme: ThemeColorScheme): string {\n    css += `${selector} {\\n`;\n    for (const key of Object.keys(scheme)) {\n      css += `${key}: ${scheme[key]};\\n`;\n    }\n    css += '}\\n';\n    return css;\n  }\n\n  private removeThemeCSS(name: string): void {\n    this.themeStyles.get(name)?.remove();\n    this.themeStyles.delete(name);\n    this.themeTarget.forEachElement(element => element.classList.remove(`theme-${name}`));\n  }\n\n  private toggleDark(dark: boolean): void {\n    if (!this.isBrowser) {\n      return;\n    }\n\n    this.themeTarget.forEachElement(element => element.classList.toggle('app--dark', dark));\n    const colorScheme = dark ? 'dark' : 'light';\n    this.themeTarget.updateColorScheme(colorScheme);\n    this.resolvedColorSchemeSub.next(colorScheme);\n    this.dispatchThemeSwitchEvent();\n  }\n\n  private cloneTheme(theme: Theme): Theme {\n    const clone: Theme = { ...theme, schemes: {} };\n    if (theme.schemes.light) {\n      clone.schemes.light = { ...theme.schemes.light };\n    }\n    if (theme.schemes.dark) {\n      clone.schemes.dark = { ...theme.schemes.dark };\n    }\n    return clone;\n  }\n\n  private dispatchThemeSwitchEvent(): void {\n    window.dispatchEvent(\n      new CustomEvent('theme-switch', {\n        detail: {\n          dark: this._resolvedColorScheme === 'dark',\n          colorScheme: this._resolvedColorScheme\n        }\n      })\n    );\n  }\n}\n","/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nimport { isPlatformBrowser } from '@angular/common';\nimport { inject, PLATFORM_ID, signal, Signal } from '@angular/core';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { fromEvent, map } from 'rxjs';\n\nimport { SI_THEME_DOM_TARGET } from './si-theme-dom-target';\n\n/**\n * Returns a signal that reflects whether the current Element theme is dark (`true`) or light\n * (`false`). The signal reacts to `theme-switch` events dispatched on `window`.\n *\n * @experimental\n * @returns A boolean signal — `true` when the active theme is dark\n * @throws When called outside of an Angular injection context\n */\nexport const injectIsDarkTheme = (): Signal<boolean> => {\n  if (!isPlatformBrowser(inject(PLATFORM_ID))) {\n    return signal(false);\n  }\n  const targetDom = inject(SI_THEME_DOM_TARGET);\n\n  return toSignal(\n    fromEvent<CustomEvent<{ dark: boolean }>>(window, 'theme-switch').pipe(map(e => e.detail.dark)),\n    {\n      initialValue: targetDom.element.classList.contains('app--dark')\n    }\n  );\n};\n","/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nexport * from './si-theme-store';\nexport * from './si-theme-dom-target';\nexport * from './si-theme.service';\nexport * from './si-theme.model';\nexport * from './si-theme-signals';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["map"],"mappings":";;;;;;;;AAAA;;;AAGG;AAKH;;;;;AAKG;MACmB,YAAY,CAAA;AAiDjC;AAEM,MAAM,0BAA0B,GAAG;AAOpC,MAAO,mBAAoB,SAAQ,YAAY,CAAA;AAC3C,IAAA,SAAS;AAEjB,IAAA,WAAA,CAAY,SAAkB,EAAA;AAC5B,QAAA,KAAK,EAAE;AACP,QAAA,IAAI,CAAC,SAAS,GAAG,SAAS;IAC5B;IAEA,eAAe,GAAA;AACb,QAAA,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;AACnB,YAAA,OAAO,EAAE,CAAC,SAAS,CAAC;QACtB;AAEA,QAAA,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,EAAE;AAC9B,QAAA,IAAI,KAAK,CAAC,WAAW,EAAE;YACrB,OAAO,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;QAC5C;aAAO;AACL,YAAA,OAAO,EAAE,CAAC,SAAS,CAAC;QACtB;IACF;AAEA,IAAA,aAAa,CAAC,IAAY,EAAA;AACxB,QAAA,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;AACnB,YAAA,OAAO,EAAE,CAAC,KAAK,CAAC;QAClB;AAEA,QAAA,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,EAAE;AAC9B,QA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