@liquid-js/lyr-core 22.0.0-alpha.1 → 22.0.0-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/components/accordion/accordion-item-body.component.html +7 -0
  2. package/components/accordion/accordion-item-body.component.scss +8 -1
  3. package/components/card/_card.component.theme.scss +7 -0
  4. package/components/card/flip-card/_flip-card.component.theme.scss +5 -0
  5. package/components/card/reveal-card/_reveal-card.component.theme.scss +5 -0
  6. package/components/file-drop/file-drop.component.scss +5 -1
  7. package/components/list/_list.component.theme.scss +6 -0
  8. package/components/menu/_menu.component.theme.scss +7 -1
  9. package/components/menu/menu-item.component.html +16 -14
  10. package/components/tag/_tag-list.scss +5 -0
  11. package/components/tree-grid/_tree-grid.component.theme.scss +7 -0
  12. package/fesm2022/liquid-js-lyr-core-accordion.mjs +87 -15
  13. package/fesm2022/liquid-js-lyr-core-accordion.mjs.map +1 -1
  14. package/fesm2022/liquid-js-lyr-core-base.mjs +38 -2
  15. package/fesm2022/liquid-js-lyr-core-base.mjs.map +1 -1
  16. package/fesm2022/liquid-js-lyr-core-chat.mjs +1 -1
  17. package/fesm2022/liquid-js-lyr-core-chat.mjs.map +1 -1
  18. package/fesm2022/liquid-js-lyr-core-context-menu.mjs +1 -0
  19. package/fesm2022/liquid-js-lyr-core-context-menu.mjs.map +1 -1
  20. package/fesm2022/liquid-js-lyr-core-dialog.mjs +13 -4
  21. package/fesm2022/liquid-js-lyr-core-dialog.mjs.map +1 -1
  22. package/fesm2022/liquid-js-lyr-core-file-drop.mjs +2 -2
  23. package/fesm2022/liquid-js-lyr-core-file-drop.mjs.map +1 -1
  24. package/fesm2022/liquid-js-lyr-core-form-field.mjs +1 -1
  25. package/fesm2022/liquid-js-lyr-core-form-field.mjs.map +1 -1
  26. package/fesm2022/liquid-js-lyr-core-menu.mjs +52 -4
  27. package/fesm2022/liquid-js-lyr-core-menu.mjs.map +1 -1
  28. package/fesm2022/liquid-js-lyr-core-tree-grid.mjs.map +1 -1
  29. package/package.json +1 -1
  30. package/schematics/ng-add/index.js +2 -2
  31. package/schematics/util/package.js +10 -1
  32. package/styles/core/_mixins.scss +10 -0
  33. package/styles/global/typography/_typography.scss +16 -0
  34. package/styles/prebuilt/components-custom-properties.css +1 -1
  35. package/styles/prebuilt/corporate-custom-properties.css +1 -1
  36. package/styles/prebuilt/corporate.css +1 -1
  37. package/styles/prebuilt/cosmic-custom-properties.css +1 -1
  38. package/styles/prebuilt/cosmic.css +1 -1
  39. package/styles/prebuilt/dark-custom-properties.css +1 -1
  40. package/styles/prebuilt/dark.css +1 -1
  41. package/styles/prebuilt/default-custom-properties.css +1 -1
  42. package/styles/prebuilt/default.css +1 -1
  43. package/styles/prebuilt/material-dark-custom-properties.css +1 -1
  44. package/styles/prebuilt/material-dark.css +1 -1
  45. package/styles/prebuilt/material-light-custom-properties.css +1 -1
  46. package/styles/prebuilt/material-light.css +1 -1
  47. package/styles/themes/_mapping.scss +8 -0
  48. package/types/liquid-js-lyr-core-accordion.d.ts +28 -3
  49. package/types/liquid-js-lyr-core-base.d.ts +5 -3
  50. package/types/liquid-js-lyr-core-button.d.ts +1 -1
  51. package/types/liquid-js-lyr-core-dialog.d.ts +11 -4
  52. package/types/liquid-js-lyr-core-menu.d.ts +44 -1
  53. package/types/liquid-js-lyr-core-select.d.ts +3 -3
  54. package/types/liquid-js-lyr-core-tree-grid.d.ts +4 -1
@@ -1 +1 @@
1
- {"version":3,"file":"liquid-js-lyr-core-base.mjs","names":["palette","palette","palette","palette","palette"],"sources":["../../../packages/core/src/services/js-themes/default.theme.ts","../../../packages/core/src/services/js-themes/cosmic.theme.ts","../../../packages/core/src/services/js-themes/corporate.theme.ts","../../../packages/core/src/services/js-themes/dark.theme.ts","../../../packages/core/src/services/js-themes/material-dark.theme.ts","../../../packages/core/src/services/js-themes/material-light.theme.ts","../../../packages/core/src/theme.options.ts","../../../packages/core/src/services/js-themes-registry.service.ts","../../../packages/core/src/services/breakpoints.service.ts","../../../packages/core/src/services/theme.service.ts","../../../packages/core/src/services/theme-style.service.ts","../../../packages/core/src/services/spinner.service.ts","../../../packages/core/src/services/storage/indexed-db-store.ts","../../../packages/core/src/services/storage/storage.ts","../../../packages/core/src/services/color.helper.ts","../../../packages/core/src/services/direction.service.ts","../../../packages/core/src/services/scroll.service.ts","../../../packages/core/src/services/ruler.service.ts","../../../packages/core/src/services/status.service.ts","../../../packages/core/src/services/texts.service.ts","../../../packages/core/src/components/component-defaults.ts","../../../packages/core/src/components/cdk/platform/platform-service.ts","../../../packages/core/src/components/cdk/bidi/bidi-service.ts","../../../packages/core/src/components/cdk/bidi/bidi.module.ts","../../../packages/core/src/components/cdk/keycodes/keycodes.ts","../../../packages/core/src/components/helpers.ts","../../../packages/core/src/components/shared/expand-animation.ts","../../../packages/core/src/components/shared/pane-animation.ts","../../../packages/core/src/components/shared/focus.ts","../../../packages/core/src/components/shared/transition.ts"],"sourcesContent":["import { NbJSThemeOptions } from './theme.options'\n\nconst palette = {\n primary: '#3469d1',\n success: '#03ce86',\n info: '#0095ff',\n warning: '#ffaa00',\n danger: '#ff3d71'\n}\n\nexport const DEFAULT_THEME: NbJSThemeOptions = {\n name: 'default',\n variables: {\n fontMain: 'Inter, sans-serif',\n fontSecondary: 'Raleway, sans-serif',\n\n bg: '#ffffff',\n bg2: '#f7f9fc',\n bg3: '#edf1f7',\n bg4: '#e4e9f2',\n\n border: '#ffffff',\n border2: '#f7f9fc',\n border3: '#edf1f7',\n border4: '#e4e9f2',\n border5: '#c5cee0',\n\n fg: '#8f9bb3',\n fgHeading: '#1a2138',\n fgText: '#1a2138',\n fgHighlight: palette.primary,\n layoutBg: '#f7f9fc',\n separator: '#edf1f7',\n\n primary: palette.primary,\n success: palette.success,\n info: palette.info,\n warning: palette.warning,\n danger: palette.danger,\n\n primaryLight: '#598bff',\n successLight: '#2ce69b',\n infoLight: '#42aaff',\n warningLight: '#ffc94d',\n dangerLight: '#ff708d'\n }\n}\n","import { NbJSThemeOptions } from './theme.options'\n\nconst palette = {\n primary: '#8a55f0',\n success: '#03ce86',\n info: '#0095ff',\n warning: '#ffaa00',\n danger: '#ff3d71'\n}\n\nexport const COSMIC_THEME: NbJSThemeOptions = {\n name: 'cosmic',\n variables: {\n fontMain: 'Inter, sans-serif',\n fontSecondary: 'Raleway, sans-serif',\n\n bg: '#323259',\n bg2: '#252547',\n bg3: '#1b1b38',\n bg4: '#13132b',\n\n border: '#323259',\n border2: '#252547',\n border3: '#1b1b38',\n border4: '#13132b',\n border5: '#13132b',\n\n fg: '#b4b4db',\n fgHeading: '#ffffff',\n fgText: '#ffffff',\n fgHighlight: palette.primary,\n layoutBg: '#151a30',\n separator: '#151a30',\n\n primary: palette.primary,\n success: palette.success,\n info: palette.info,\n warning: palette.warning,\n danger: palette.danger,\n\n primaryLight: '#a37bf8',\n successLight: '#2ce69b',\n infoLight: '#42aaff',\n warningLight: '#ffc94d',\n dangerLight: '#ff708d'\n }\n}\n","import { NbJSThemeOptions } from './theme.options'\n\nconst palette = {\n primary: '#73a1ff',\n success: '#5dcfe3',\n info: '#ba7fec',\n warning: '#ffa36b',\n danger: '#ff6b83'\n}\n\nexport const CORPORATE_THEME: NbJSThemeOptions = {\n name: 'corporate',\n base: 'default',\n variables: {\n fontMain: 'Inter, sans-serif',\n fontSecondary: 'Raleway, sans-serif',\n\n bg: '#ffffff',\n bg2: '#f7f9fc',\n bg3: '#edf1f7',\n bg4: '#e4e9f2',\n\n border: '#ffffff',\n border2: '#f7f9fc',\n border3: '#edf1f7',\n border4: '#e4e9f2',\n border5: '#c5cee0',\n\n fg: '#8f9bb3',\n fgHeading: '#1a2138',\n fgText: '#1a2138',\n fgHighlight: palette.primary,\n layoutBg: '#f7f9fc',\n separator: '#edf1f7',\n\n primary: palette.primary,\n success: palette.success,\n info: palette.info,\n warning: palette.warning,\n danger: palette.danger,\n\n primaryLight: '#598bff',\n successLight: '#2ce69b',\n infoLight: '#42aaff',\n warningLight: '#ffc94d',\n dangerLight: '#ff708d'\n }\n}\n","import { NbJSThemeOptions } from './theme.options'\n\nconst palette = {\n primary: '#3469d1',\n success: '#03ce86',\n info: '#0095ff',\n warning: '#ffaa00',\n danger: '#ff3d71'\n}\n\nexport const DARK_THEME: NbJSThemeOptions = {\n name: 'dark',\n variables: {\n fontMain: 'Inter, sans-serif',\n fontSecondary: 'Raleway, sans-serif',\n\n bg: '#222b45',\n bg2: '#1a2138',\n bg3: '#151a30',\n bg4: '#101426',\n\n border: '#222b45',\n border2: '#1a2138',\n border3: '#151a30',\n border4: '#101426',\n border5: '#101426',\n\n fg: '#8f9bb3',\n fgHeading: '#ffffff',\n fgText: '#ffffff',\n fgHighlight: palette.primary,\n layoutBg: '#1b1b38',\n separator: '#1b1b38',\n\n primary: palette.primary,\n success: palette.success,\n info: palette.info,\n warning: palette.warning,\n danger: palette.danger,\n\n primaryLight: '#598bff',\n successLight: '#2ce69b',\n infoLight: '#42aaff',\n warningLight: '#ffc94d',\n dangerLight: '#ff708d'\n }\n}\n","import { NbJSThemeOptions } from './theme.options'\n\nconst palette = {\n primary: '#d0bcff',\n success: '#8fd88a',\n info: '#96ccff',\n warning: '#ffb869',\n danger: '#f2b8b5'\n}\n\n/** Material 3's baseline dark scheme, for charts and other code that draws with the theme's colours. */\nexport const MATERIAL_DARK_THEME: NbJSThemeOptions = {\n name: 'material-dark',\n base: 'dark',\n variables: {\n fontMain: 'Roboto, sans-serif',\n fontSecondary: 'Roboto, sans-serif',\n\n bg: '#211f26',\n bg2: '#1d1b20',\n bg3: '#141218',\n bg4: '#0f0d13',\n\n border: '#211f26',\n border2: '#2b2930',\n border3: '#49454f',\n border4: '#938f99',\n border5: '#cac4d0',\n\n fg: '#cac4d0',\n fgHeading: '#e6e0e9',\n fgText: '#e6e0e9',\n fgHighlight: palette.primary,\n layoutBg: '#141218',\n separator: '#49454f',\n\n primary: palette.primary,\n success: palette.success,\n info: palette.info,\n warning: palette.warning,\n danger: palette.danger,\n\n primaryLight: '#ddcdff',\n successLight: '#9ddd95',\n infoLight: '#a0d2ff',\n warningLight: '#ffbf7b',\n dangerLight: '#f5cbc8'\n }\n}\n","import { NbJSThemeOptions } from './theme.options'\n\nconst palette = {\n primary: '#6750a4',\n success: '#2e6c2f',\n info: '#00629c',\n warning: '#8a5100',\n danger: '#b3261e'\n}\n\n/** Material 3's baseline light scheme, for charts and other code that draws with the theme's colours. */\nexport const MATERIAL_LIGHT_THEME: NbJSThemeOptions = {\n name: 'material-light',\n base: 'default',\n variables: {\n fontMain: 'Roboto, sans-serif',\n fontSecondary: 'Roboto, sans-serif',\n\n bg: '#fef7ff',\n bg2: '#f7f2fa',\n bg3: '#f3edf7',\n bg4: '#ece6f0',\n\n border: '#fef7ff',\n border2: '#ece6f0',\n border3: '#cac4d0',\n border4: '#79747e',\n border5: '#49454f',\n\n fg: '#49454f',\n fgHeading: '#1d1b20',\n fgText: '#1d1b20',\n fgHighlight: palette.primary,\n layoutBg: '#f3edf7',\n separator: '#cac4d0',\n\n primary: palette.primary,\n success: palette.success,\n info: palette.info,\n warning: palette.warning,\n danger: palette.danger,\n\n primaryLight: '#7f67be',\n successLight: '#477c44',\n infoLight: '#2b74a8',\n warningLight: '#98632b',\n dangerLight: '#dc362e'\n }\n}\n","import { isPlatformBrowser } from '@angular/common'\nimport { DOCUMENT, inject, InjectionToken, PLATFORM_ID } from '@angular/core'\nimport { NbMediaBreakpoint } from './services/breakpoints.service'\nimport { NbJSThemeOptions } from './services/js-themes/theme.options'\nimport { DEFAULT_THEME } from './services/js-themes/default.theme'\nimport { COSMIC_THEME } from './services/js-themes/cosmic.theme'\nimport { CORPORATE_THEME } from './services/js-themes/corporate.theme'\nimport { DARK_THEME } from './services/js-themes/dark.theme'\nimport { MATERIAL_DARK_THEME } from './services/js-themes/material-dark.theme'\nimport { MATERIAL_LIGHT_THEME } from './services/js-themes/material-light.theme'\n\n/** A theme of the app, with what it's for, so the system's preferences can pick it and `nb-theme-select` offer it. */\nexport interface NbThemeDescription {\n /** The theme's name, as registered with `nb-register-theme`. */\n name: string\n /** Its colour scheme, matched with the system's `prefers-color-scheme`. */\n scheme?: 'light' | 'dark'\n /** Its contrast, matched with the system's `prefers-contrast`: `more` for a high-contrast theme. */\n contrast?: 'more' | 'less'\n /** Names it in `nb-theme-select`; the name with a capital otherwise. */\n label?: string\n}\n\nexport interface NbThemeOptions {\n /** The theme to start with, and to fall back on when no declared theme fits the system's preferences. */\n name: string\n /**\n * The app's themes: with nothing chosen, the one that fits the system's colour scheme and contrast is used, shown\n * as \"System\" in `nb-theme-select`.\n */\n themes?: NbThemeDescription[]\n /**\n * Remembers the theme and content size the user chooses, in `NB_PREFERENCE_STORAGE` (`localStorage` by default),\n * under keys starting with `key` (`nb` by default).\n */\n preferences?: boolean | { key?: string }\n}\n\n/**\n * Where the user's theme and content size are kept: `localStorage` by default. Provide your own, e.g. to keep them in\n * the user's profile on a server; its methods may return promises.\n */\nexport interface NbPreferenceStorage {\n /** The kept value; `null` or `undefined` when there's none, as `Storage.getItem` gives it. */\n get(key: string): string | null | undefined | Promise<string | null | undefined>\n /** Keeps a value; `null` clears it, like `Storage.removeItem`. */\n set(key: string, value: string | null): void | Promise<void>\n}\n\n/** Keeps preferences in `localStorage`, where it's available. @internal */\nexport function nbLocalPreferenceStorage(): NbPreferenceStorage {\n const storage = (): Storage | undefined => {\n try {\n return isPlatformBrowser(inject(PLATFORM_ID)) ? globalThis.localStorage : undefined\n } catch {\n return undefined\n }\n }\n const local = storage()\n return {\n get: (key) => {\n try {\n return local?.getItem(key)\n } catch {\n return undefined\n }\n },\n set: (key, value) => {\n try {\n if (value === null) {\n local?.removeItem(key)\n } else {\n local?.setItem(key, value)\n }\n } catch {\n // Storage that's full or blocked keeps nothing.\n }\n }\n }\n}\n\nexport const NB_PREFERENCE_STORAGE = new InjectionToken<NbPreferenceStorage>('Lyra Preference Storage', {\n factory: nbLocalPreferenceStorage\n})\n\nexport const DEFAULT_MEDIA_BREAKPOINTS: NbMediaBreakpoint[] = [\n {\n name: 'xs',\n width: 0\n },\n {\n name: 'is',\n width: 400\n },\n {\n name: 'sm',\n width: 576\n },\n {\n name: 'md',\n width: 768\n },\n {\n name: 'lg',\n width: 992\n },\n {\n name: 'xl',\n width: 1200\n },\n {\n name: 'xxl',\n width: 1400\n },\n {\n name: 'xxxl',\n width: 1600\n }\n]\n\nexport const BUILT_IN_THEMES: NbJSThemeOptions[] = [\n DEFAULT_THEME,\n COSMIC_THEME,\n CORPORATE_THEME,\n DARK_THEME,\n MATERIAL_LIGHT_THEME,\n MATERIAL_DARK_THEME\n]\n\n// The defaults apply when `provideNbTheme()` doesn't set a value, so the theme services work without it.\nexport const NB_THEME_OPTIONS = new InjectionToken<NbThemeOptions>('Lyra Theme Options', {\n factory: () => ({ name: 'default' })\n})\nexport const NB_MEDIA_BREAKPOINTS = new InjectionToken<NbMediaBreakpoint[]>('Lyra Media Breakpoints', {\n factory: () => DEFAULT_MEDIA_BREAKPOINTS\n})\nexport const NB_BUILT_IN_JS_THEMES = new InjectionToken<NbJSThemeOptions[]>('Lyra Built-in JS Themes', {\n factory: () => BUILT_IN_THEMES\n})\nexport const NB_JS_THEMES = new InjectionToken<NbJSThemeOptions[]>('Lyra JS Themes', { factory: () => [] })\n\n/**\n * The browser's window, as a token so tests can replace it. It's `undefined` outside the browser (e.g. when\n * rendering on the server), so code that uses it checks for it; a server app can provide a window of its own.\n */\nexport const NB_WINDOW = new InjectionToken<(Window & typeof globalThis) | undefined>('Window', {\n factory: () => (isPlatformBrowser(inject(PLATFORM_ID)) ? window : undefined)\n})\nexport const NB_DOCUMENT = new InjectionToken<Document>('Document', { factory: () => inject(DOCUMENT) })\n","import { inject, Service } from '@angular/core'\n\nimport { NB_BUILT_IN_JS_THEMES, NB_JS_THEMES } from '../theme.options'\nimport { NbJSThemeOptions } from './js-themes/theme.options'\n\nexport { BUILT_IN_THEMES } from '../theme.options'\n\n/**\n * The JS themes' variables, by theme name; `NbThemeService.getJsTheme` gives the current theme's.\n *\n * It starts with the built-in themes and those `provideNbTheme` adds (`NB_JS_THEMES`), a theme of the same name\n * merged over the built-in one.\n */\n@Service()\nexport class NbJSThemesRegistry {\n\n private themes: Record<string, NbJSThemeOptions> = {}\n\n constructor() {\n const builtInThemes = inject(NB_BUILT_IN_JS_THEMES)\n const newThemes = inject(NB_JS_THEMES) ?? []\n\n const themes = this.combineByNames(newThemes, builtInThemes)\n\n themes.forEach((theme: NbJSThemeOptions) => {\n this.register(theme, theme.name, theme.base)\n })\n }\n\n /**\n * Registers a theme's variables over its base theme's, when the base is registered, replacing a theme of the same\n * name.\n */\n register(config: NbJSThemeOptions, themeName: string, baseTheme?: string) {\n const base = baseTheme && this.has(baseTheme) ? this.get(baseTheme) : {}\n this.themes[themeName] = this.mergeDeep<NbJSThemeOptions>({ name: config.name }, base, config)\n }\n\n has(themeName: string): boolean {\n return !!this.themes[themeName]\n }\n\n /** A copy of the theme, with its base's variables merged in; throws when it isn't registered. */\n get(themeName: string): NbJSThemeOptions {\n if (!this.themes[themeName]) {\n throw Error(`NbThemeConfig: no theme '${themeName}' found registered.`)\n }\n return JSON.parse(JSON.stringify(this.themes[themeName]))\n }\n\n private combineByNames(newThemes: NbJSThemeOptions[], oldThemes: NbJSThemeOptions[]): NbJSThemeOptions[] {\n if (newThemes) {\n const mergedThemes = new Array<NbJSThemeOptions>()\n newThemes.forEach((theme: NbJSThemeOptions) => {\n const sameOld: NbJSThemeOptions = oldThemes.find((tm: NbJSThemeOptions) => tm.name === theme.name) ||\n <NbJSThemeOptions>{}\n\n const mergedTheme = this.mergeDeep({ name: theme.name }, sameOld, theme)\n mergedThemes.push(mergedTheme)\n })\n\n oldThemes.forEach((theme: NbJSThemeOptions) => {\n if (!mergedThemes.find((tm: NbJSThemeOptions) => tm.name === theme.name)) {\n mergedThemes.push(theme)\n }\n })\n return mergedThemes\n }\n return oldThemes\n }\n\n private isObject(item: unknown): item is Record<string, unknown> {\n return !!item && typeof item === 'object' && !Array.isArray(item)\n }\n\n private mergeDeep<T>(target: T, ...sources: unknown[]): T {\n if (!sources.length) {\n return target\n }\n const source = sources.shift()\n\n if (this.isObject(target) && this.isObject(source)) {\n for (const key in source) {\n const value = source[key]\n if (this.isObject(value)) {\n if (!target[key]) {\n Object.assign(target, { [key]: {} })\n }\n this.mergeDeep(target[key], value)\n } else {\n Object.assign(target, { [key]: value })\n }\n }\n }\n return this.mergeDeep(target, ...sources)\n }\n}\n","import { inject, Service } from '@angular/core'\nimport { NB_MEDIA_BREAKPOINTS } from '../theme.options'\n\n/** A media breakpoint: its name (`xs`, `sm`, `md`…) and the width it starts at, in pixels. */\nexport interface NbMediaBreakpoint {\n name: string\n width: number\n}\n\nexport { DEFAULT_MEDIA_BREAKPOINTS } from '../theme.options'\n\n/**\n * Tells which of the configured media breakpoints a width falls in, e.g. 200px is `xs` with the defaults.\n *\n * The breakpoints come from `NB_MEDIA_BREAKPOINTS`, which `provideNbTheme` sets; `DEFAULT_MEDIA_BREAKPOINTS`\n * otherwise.\n */\n@Service()\nexport class NbMediaBreakpointsService {\n private readonly breakpoints = inject(NB_MEDIA_BREAKPOINTS)\n\n private readonly breakpointsMap = this.breakpoints.reduce<{ [breakpoint: string]: number }>((res, b) => {\n res[b.name] = b.width\n return res\n }, {})\n\n /** The breakpoint the width falls in; `unknown`, keeping the width, when none does or there's no width. */\n getByWidth(width?: number): NbMediaBreakpoint {\n // Like getByName('unknown'), an unknown width is NaN.\n const unknown = { name: 'unknown', width: width ?? NaN }\n const breakpoints = this.getBreakpoints()\n\n return breakpoints\n .find((point: NbMediaBreakpoint, index: number) => {\n const next = breakpoints[index + 1]\n return width !== undefined && width >= point.width && (!next || width < next.width)\n }) || unknown\n }\n\n /** The breakpoint with the name; `unknown`, with width `NaN`, when there's none. */\n getByName(name: string): NbMediaBreakpoint {\n const unknown = { name: 'unknown', width: NaN }\n const breakpoints = this.getBreakpoints()\n\n return breakpoints.find((point: NbMediaBreakpoint) => name === point.name) || unknown\n }\n\n /** The configured breakpoints, in the order given: `getByWidth` expects them by ascending width. */\n getBreakpoints(): NbMediaBreakpoint[] {\n return this.breakpoints\n }\n\n /** The width each configured breakpoint starts at, by name. */\n getBreakpointsMap(): { [breakpoint: string]: number } {\n return this.breakpointsMap\n }\n}\n","import { isPlatformBrowser } from '@angular/common'\nimport { DestroyRef, inject, PLATFORM_ID, Service, signal } from '@angular/core'\n\nimport { Observable, ReplaySubject, Subject } from 'rxjs'\nimport { map, filter, pairwise, distinctUntilChanged, startWith, share } from 'rxjs/operators'\n\nimport { NB_DOCUMENT, NB_PREFERENCE_STORAGE, NB_THEME_OPTIONS, NbThemeDescription } from '../theme.options'\nimport { NbJSThemeOptions } from './js-themes/theme.options'\nimport { NbJSThemesRegistry } from './js-themes-registry.service'\nimport { NbMediaBreakpointsService, NbMediaBreakpoint } from './breakpoints.service'\n\n/** How large the content is: the root font size, which everything sized in `rem` follows. */\nexport type NbContentSize = 'small' | 'medium' | 'large' | 'larger'\n\n/** The root font size of each content size; `medium` keeps the browser's own. */\nconst CONTENT_SIZES: Record<NbContentSize, string | undefined> = {\n small: '87.5%',\n medium: undefined,\n large: '112.5%',\n larger: '125%'\n}\n\n/** A theme change: the theme now shown and the one shown before, if any. */\nexport interface NbThemeChange {\n name: string\n previous?: string\n}\n\n/** The theme preference that follows the system's colour scheme and contrast. */\nexport const NB_SYSTEM_THEME = 'system'\n\n/**\n * Keeps the theme shown, which `nb-layout` puts on the body as `nb-theme-<name>`, and gives its JS variables; it also\n * tells which media breakpoint the window's width is in, and relays classes to add to `nb-layout`.\n *\n * It keeps the user's theme and content size too: `setThemePreference` takes a theme's name, or `system` for the\n * declared theme that fits the system's colour scheme and contrast, which it follows as they change, and\n * `setContentSize` scales the root font size. With `preferences` on, both are saved in `NB_PREFERENCE_STORAGE` and\n * restored; `nb-theme-select` and `nb-content-size-switcher` offer them.\n */\n@Service()\nexport class NbThemeService {\n protected readonly options = inject(NB_THEME_OPTIONS)\n private readonly breakpointService = inject(NbMediaBreakpointsService)\n private readonly jsThemesRegistry = inject(NbJSThemesRegistry)\n private readonly document = inject(NB_DOCUMENT)\n private readonly storage = inject(NB_PREFERENCE_STORAGE)\n private readonly browser = isPlatformBrowser(inject(PLATFORM_ID))\n\n /** The theme shown. */\n readonly theme = signal<string>(this.options?.name ?? 'default')\n\n /**\n * The user's theme: a theme's name, or `system` for the declared theme that fits the system's preferences, which\n * it is when the app declares its themes and the user chose none.\n */\n readonly themePreference = signal<string>(\n this.options?.themes?.length ? NB_SYSTEM_THEME : (this.options?.name ?? 'default')\n )\n\n /** How large the content is. */\n readonly contentSize = signal<NbContentSize>('medium')\n\n currentTheme?: string\n private themeChanges$ = new ReplaySubject<NbThemeChange>(1)\n private appendLayoutClass$ = new Subject<string>()\n private removeLayoutClass$ = new Subject<string>()\n private changeWindowWidth$ = new ReplaySubject<number>(2)\n\n constructor() {\n const options = this.options\n\n if (options && options.name) {\n this.changeTheme(options.name)\n }\n this.followSystem()\n this.restorePreferences()\n }\n\n /** Shows a theme by name, without touching the user's preference; `setThemePreference` keeps the choice. */\n changeTheme(name: string) {\n if (name === this.currentTheme) {\n return\n }\n this.themeChanges$.next({ name, previous: this.currentTheme })\n this.currentTheme = name\n this.theme.set(name)\n }\n\n /** The app's declared themes. */\n get themes(): NbThemeDescription[] {\n return this.options?.themes ?? []\n }\n\n /** Shows a theme by the user's choice, or with `system` the one that fits the system's preferences, and keeps it. */\n setThemePreference(preference: string) {\n this.applyThemePreference(preference)\n this.save('theme', preference === NB_SYSTEM_THEME ? null : preference)\n }\n\n /** Sets how large the content is, and keeps it. */\n setContentSize(size: NbContentSize) {\n this.applyContentSize(size)\n this.save('content-size', size === 'medium' ? null : size)\n }\n\n /**\n * The declared theme that fits the system's colour scheme and contrast: a high-contrast theme only when more\n * contrast is asked for; the starting theme without declared themes.\n */\n systemTheme(): string {\n const fallback = this.options?.name ?? 'default'\n if (!this.themes.length || !this.browser || typeof matchMedia !== 'function') {\n return this.themes.find((theme) => theme.name === fallback)?.name ?? this.themes[0]?.name ?? fallback\n }\n const scheme = matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'\n const more = matchMedia('(prefers-contrast: more)').matches\n const score = (theme: NbThemeDescription) =>\n (theme.scheme === scheme ? 2 : theme.scheme ? -2 : 0) + (theme.contrast === 'more' ? (more ? 4 : -8) : 0)\n return this.themes.reduce((best, theme) => (score(theme) > score(best) ? theme : best)).name\n }\n\n protected applyThemePreference(preference: string) {\n this.themePreference.set(preference)\n this.changeTheme(preference === NB_SYSTEM_THEME ? this.systemTheme() : preference)\n }\n\n protected applyContentSize(size: NbContentSize) {\n this.contentSize.set(size)\n const root = this.document?.documentElement\n const fontSize = CONTENT_SIZES[size]\n if (fontSize) {\n root?.style.setProperty('font-size', fontSize)\n } else {\n root?.style.removeProperty('font-size')\n }\n }\n\n /** Follows the system's colour scheme and contrast while the preference is `system`. */\n protected followSystem() {\n if (this.themePreference() === NB_SYSTEM_THEME) {\n this.changeTheme(this.systemTheme())\n }\n if (!this.themes.length || !this.browser || typeof matchMedia !== 'function') {\n return\n }\n const update = () => {\n if (this.themePreference() === NB_SYSTEM_THEME) {\n this.changeTheme(this.systemTheme())\n }\n }\n const queries = ['(prefers-color-scheme: dark)', '(prefers-contrast: more)'].map((query) => matchMedia(query))\n queries.forEach((query) => query.addEventListener('change', update))\n inject(DestroyRef).onDestroy(() => queries.forEach((query) => query.removeEventListener('change', update)))\n }\n\n /** Restores the saved theme and content size, when the app keeps preferences; storage may answer later. */\n protected restorePreferences() {\n if (!this.options?.preferences) {\n return\n }\n const known = (theme: string) =>\n theme === NB_SYSTEM_THEME || !this.themes.length || this.themes.some((declared) => declared.name === theme)\n Promise.resolve(this.storage.get(this.key('theme')))\n .then((theme) => theme && known(theme) && this.applyThemePreference(theme))\n .catch(() => undefined)\n Promise.resolve(this.storage.get(this.key('content-size')))\n .then((size) => size && size in CONTENT_SIZES && this.applyContentSize(size as NbContentSize))\n .catch(() => undefined)\n }\n\n /** Keeps a preference; `null` clears it, as `NbPreferenceStorage.set` takes it. */\n protected save(name: string, value: string | null) {\n if (this.options?.preferences) {\n Promise.resolve(this.storage.set(this.key(name), value)).catch(() => undefined)\n }\n }\n\n protected key(name: string): string {\n const preferences = this.options?.preferences\n const prefix = (typeof preferences === 'object' && preferences.key) || 'nb'\n return `${prefix}-${name}`\n }\n\n /** Called by `nb-layout` with the window's width, which `onMediaQueryChange` follows. */\n changeWindowWidth(width: number) {\n this.changeWindowWidth$.next(width)\n }\n\n /**\n * The current theme's JS variables (colours, paddings…), and each theme's as the theme changes.\n */\n getJsTheme(): Observable<NbJSThemeOptions> {\n return this.onThemeChange().pipe(\n map((theme: NbThemeChange) => this.jsThemesRegistry.get(theme.name))\n )\n }\n\n /**\n * Emits when the window's width enters another media breakpoint, as the previous breakpoint and the current one;\n * the first emission's previous breakpoint is `unknown`.\n * ```ts\n * [{ name: 'xs', width: 0 }, { name: 'md', width: 768 }] // change from `xs` to `md`\n * ```\n */\n onMediaQueryChange(): Observable<NbMediaBreakpoint[]> {\n return this.changeWindowWidth$\n .pipe(\n startWith(undefined),\n pairwise(),\n map(([prevWidth, width]: [number | undefined, number | undefined]) => [\n // Only the first width has no previous one, which resolves to the unknown breakpoint.\n this.breakpointService.getByWidth(prevWidth),\n this.breakpointService.getByWidth(width)\n ] as [NbMediaBreakpoint, NbMediaBreakpoint]),\n filter(([prevPoint, point]: [NbMediaBreakpoint, NbMediaBreakpoint]) => prevPoint.name !== point.name),\n distinctUntilChanged(\n (previous, current) => previous === current,\n (params) => params[0].name + params[1].name\n ),\n share()\n )\n }\n\n /** Emits the theme shown and the one before it, starting with the current theme. */\n onThemeChange(): Observable<NbThemeChange> {\n return this.themeChanges$.pipe(share())\n }\n\n /** Adds a class to the `nb-layout` element. */\n appendLayoutClass(className: string) {\n this.appendLayoutClass$.next(className)\n }\n\n /** The classes `appendLayoutClass` adds, which `nb-layout` applies. */\n onAppendLayoutClass(): Observable<string> {\n return this.appendLayoutClass$.pipe(share())\n }\n\n /** Removes a class from the `nb-layout` element. */\n removeLayoutClass(className: string) {\n this.removeLayoutClass$.next(className)\n }\n\n /** The classes `removeLayoutClass` removes, which `nb-layout` applies. */\n onRemoveLayoutClass(): Observable<string> {\n return this.removeLayoutClass$.pipe(share())\n }\n}\n","import { DestroyRef, inject, PLATFORM_ID, Service, Signal, signal } from '@angular/core'\nimport { isPlatformBrowser } from '@angular/common'\n\nimport { NB_DOCUMENT } from '../theme.options'\n\n/**\n * Counts changes to what the theme's variables on the page come from: the style and classes of the page and its body,\n * e.g. a variable an app sets there, or another theme's class. Components that read the variables in script, such as\n * a chart that draws on a canvas, read them again as it changes. The theme service's changes come with it.\n */\n@Service()\nexport class NbThemeStyleChanges {\n protected readonly count = signal(0)\n readonly changes: Signal<number> = this.count.asReadonly()\n\n constructor() {\n const document = inject(NB_DOCUMENT)\n if (!isPlatformBrowser(inject(PLATFORM_ID)) || typeof MutationObserver === 'undefined') {\n return\n }\n let frame = 0\n const observer = new MutationObserver(() => {\n // Once for the changes of a frame, e.g. many variables set one after another.\n if (!frame) {\n frame = requestAnimationFrame(() => {\n frame = 0\n this.count.update((count) => count + 1)\n })\n }\n })\n for (const element of [document.documentElement, document.body]) {\n observer.observe(element, { attributes: true, attributeFilter: ['style', 'class'] })\n }\n inject(DestroyRef).onDestroy(() => {\n observer.disconnect()\n cancelAnimationFrame(frame)\n })\n }\n}\n","import { inject, Service } from '@angular/core'\nimport { NB_DOCUMENT } from '../theme.options'\n\n/**\n * Shows the page's loading spinner, the element with the id `nb-global-spinner` in `index.html`, until the registered\n * loaders finish.\n *\n * Without such an element, `load` only waits for the loaders.\n */\n@Service()\nexport class NbSpinnerService {\n private readonly document = inject(NB_DOCUMENT)\n\n private loaders = new Array<Promise<unknown>>()\n private selector = 'nb-global-spinner'\n\n /** Adds a promise `load` waits for. */\n registerLoader(method: Promise<unknown>) {\n this.loaders.push(method)\n }\n\n /** Forgets the registered loaders. */\n clear() {\n this.loaders = []\n }\n\n /**\n * Shows the spinner until the registered loaders finish, and hides it whether they succeed or fail: resolves with\n * their values, or rejects with the first failure.\n */\n load(): Promise<unknown[]> {\n this.showSpinner()\n return Promise.all(this.loaders).finally(() => this.hideSpinner())\n }\n\n // The spinner is in index.html, outside the app, so it's shown and hidden through the DOM.\n private showSpinner() {\n const el = this.getSpinnerElement()\n if (el) {\n el.style.display = 'block'\n }\n }\n\n private hideSpinner() {\n const el = this.getSpinnerElement()\n if (el) {\n el.style.display = 'none'\n }\n }\n\n private getSpinnerElement() {\n return this.document.getElementById(this.selector)\n }\n}\n","/** The values of a store: real JavaScript values, as IndexedDB keeps them (structured clone). */\nexport interface NbStoreBackend {\n get(key: string): Promise<unknown>\n has(key: string): Promise<boolean>\n set(key: string, value: unknown): Promise<void>\n delete(key: string): Promise<void>\n keys(): Promise<string[]>\n clear(): Promise<void>\n /** Lets go of the backend's resources, e.g. its database connection. */\n close?(): Promise<void>\n}\n\nconst OBJECT_STORE = 'values'\n\n/** The IndexedDB database of a store, `nb-storage-<name>`, which a web worker can open as well. */\nexport function nbStoreDatabaseName(name: string): string {\n return `nb-storage-${name}`\n}\n\nconst promise = <T>(request: IDBRequest<T>) =>\n new Promise<T>((resolve, reject) => {\n request.onsuccess = () => resolve(request.result)\n request.onerror = () => reject(request.error)\n })\n\n/**\n * A store in IndexedDB: one database per store name, holding its values by key. It has no Angular dependency, so a web\n * worker can read and write the values an app keeps with `declareStorage`.\n */\nexport class NbIndexedDbStore implements NbStoreBackend {\n protected readonly db: Promise<IDBDatabase>\n\n constructor(name: string, factory: IDBFactory = indexedDB) {\n this.db = new Promise((resolve, reject) => {\n const request = factory.open(nbStoreDatabaseName(name), 1)\n request.onupgradeneeded = () => request.result.createObjectStore(OBJECT_STORE)\n request.onsuccess = () => {\n // Another tab's newer version of the database asks this one to let go.\n request.result.onversionchange = () => request.result.close()\n resolve(request.result)\n }\n request.onerror = () => reject(request.error)\n request.onblocked = () => reject(new Error(`The ${nbStoreDatabaseName(name)} database is open in an older version`))\n })\n }\n\n async get(key: string): Promise<unknown> {\n return promise((await this.store('readonly')).get(key))\n }\n\n async has(key: string): Promise<boolean> {\n return (await promise((await this.store('readonly')).count(key))) > 0\n }\n\n async set(key: string, value: unknown): Promise<void> {\n await this.write((store) => store.put(value, key))\n }\n\n async delete(key: string): Promise<void> {\n await this.write((store) => store.delete(key))\n }\n\n async keys(): Promise<string[]> {\n const keys = await promise((await this.store('readonly')).getAllKeys())\n return keys.map(String)\n }\n\n async clear(): Promise<void> {\n await this.write((store) => store.clear())\n }\n\n /** Closes the database; the store can't be used after. */\n async close(): Promise<void> {\n (await this.db).close()\n }\n\n protected async store(mode: IDBTransactionMode): Promise<IDBObjectStore> {\n return (await this.db).transaction(OBJECT_STORE, mode).objectStore(OBJECT_STORE)\n }\n\n // Resolves once the transaction commits, so a value is in the database before other tabs hear of it.\n protected async write(change: (store: IDBObjectStore) => void): Promise<void> {\n const transaction = (await this.db).transaction(OBJECT_STORE, 'readwrite')\n change(transaction.objectStore(OBJECT_STORE))\n await new Promise<void>((resolve, reject) => {\n transaction.oncomplete = () => resolve()\n transaction.onerror = () => reject(transaction.error)\n transaction.onabort = () => reject(transaction.error ?? new Error('The write was aborted'))\n })\n }\n}\n\n/** A store that keeps nothing, used on the server: each request starts from the defaults, and nothing is written. */\nexport class NbNoStore implements NbStoreBackend {\n async get(): Promise<unknown> {\n return undefined\n }\n\n async has(): Promise<boolean> {\n return false\n }\n\n async set(): Promise<void> {}\n\n async delete(): Promise<void> {}\n\n async keys(): Promise<string[]> {\n return []\n }\n\n async clear(): Promise<void> {}\n}\n\n/** A store in memory, for a browser without IndexedDB. Values last as long as the page does. */\nexport class NbMemoryStore implements NbStoreBackend {\n protected readonly values = new Map<string, unknown>()\n\n async get(key: string): Promise<unknown> {\n return this.values.get(key)\n }\n\n async has(key: string): Promise<boolean> {\n return this.values.has(key)\n }\n\n async set(key: string, value: unknown): Promise<void> {\n this.values.set(key, value)\n }\n\n async delete(key: string): Promise<void> {\n this.values.delete(key)\n }\n\n async keys(): Promise<string[]> {\n return [...this.values.keys()]\n }\n\n async clear(): Promise<void> {\n this.values.clear()\n }\n}\n","import { isPlatformBrowser } from '@angular/common'\nimport {\n DestroyRef,\n EnvironmentProviders,\n inject,\n InjectionToken,\n makeEnvironmentProviders,\n PLATFORM_ID,\n Signal,\n signal\n} from '@angular/core'\nimport { Observable, Subject } from 'rxjs'\n\nimport { NbIndexedDbStore, NbMemoryStore, NbNoStore, NbStoreBackend } from './indexed-db-store'\n\n/**\n * The defaults of a storage's keys: required for a key whose value can't be `undefined`, so its signal has a value\n * before the stored one loads, optional for the others.\n */\nexport type NbStorageDefaults<T> = {\n [K in keyof T as undefined extends T[K] ? never : K]-?: T[K];\n} & {\n [K in keyof T as undefined extends T[K] ? K : never]?: T[K];\n}\n\nexport interface NbStorageOptions<T> {\n /** The value of a key that holds none, and of its signal until the stored one loads. */\n defaults: NbStorageDefaults<T>\n /**\n * Turns what's stored for a key into its current shape as it loads, e.g. adding fields a newer version has. What's\n * stored is what an older version of the app wrote, so it's `unknown`.\n */\n migrate?: { [K in keyof T]?: (stored: unknown) => T[K] }\n /**\n * Where the values are kept. By default, IndexedDB in the browser (memory where it's unavailable), and nowhere on the\n * server, so each request renders with the defaults.\n */\n backend?: (name: string) => NbStoreBackend\n}\n\n/** A change to a storage's values, from this tab or another one. */\nexport type NbStorageChange<T> =\n | { [K in keyof T]: { key: K, value: T[K], removed: false, remote: boolean } }[keyof T]\n | { [K in keyof T]: { key: K, value: T[K], removed: true, remote: boolean } }[keyof T]\n | { cleared: true, remote: boolean }\n\n/**\n * A stored value as a signal, shared by everything that reads it: it starts as the key's default, takes the stored\n * value once it loads, and follows changes from other tabs.\n */\nexport type NbStoredSignal<V> = Signal<V> & {\n /** Sets the value now; resolves once it's stored and other tabs have heard of it. */\n set(value: V): Promise<void>\n update(change: (value: V) => V): Promise<void>\n /** Removes the stored value, so the key has its default again. */\n remove(): Promise<void>\n /** Whether the stored value is still loading. */\n readonly loading: Signal<boolean>\n /** The last failure to load or store the value, e.g. a full or unavailable IndexedDB. */\n readonly error: Signal<unknown>\n /** Resolves with the value once it has loaded. */\n readonly loaded: Promise<V>\n}\n\ntype Message = { key: string, value?: unknown, removed?: boolean } | { cleared: true }\n\ninterface Live {\n readonly state: ReturnType<typeof signal<unknown>>\n // Changes since the load started, which the loaded value mustn't overwrite.\n changed: boolean\n}\n\n/**\n * The values of a storage `declareStorage` declares, typed by its key map `T`: read and written by key, or as shared\n * signals, and kept in step with the other tabs.\n */\nexport class NbStorage<T> {\n /** Changes to the values, from this tab and the others. */\n readonly changes: Observable<NbStorageChange<T>>\n\n protected readonly changes$ = new Subject<NbStorageChange<T>>()\n // The signals in use, by key, held weakly: a signal goes once nothing holds it. Their state lives as long as they do.\n protected readonly live = new Map<string, WeakRef<NbStoredSignal<unknown>>>()\n protected readonly states = new WeakMap<NbStoredSignal<unknown>, Live>()\n protected readonly released = new FinalizationRegistry<{ key: string, ref: WeakRef<NbStoredSignal<unknown>> }>(\n ({ key, ref }) => {\n if (this.live.get(key) === ref) {\n this.live.delete(key)\n }\n }\n )\n\n constructor(\n readonly name: string,\n protected readonly options: NbStorageOptions<T>,\n protected readonly backend: NbStoreBackend,\n protected readonly channel?: BroadcastChannel\n ) {\n this.changes = this.changes$.asObservable()\n channel?.addEventListener('message', ({ data }: MessageEvent<Message>) => this.receive(data))\n }\n\n /** The value of a key: what's stored, migrated, or its default. */\n async get<K extends keyof T & string>(key: K): Promise<T[K]> {\n if (!(await this.backend.has(key))) {\n return this.defaultOf(key)\n }\n const stored = await this.backend.get(key)\n const migrate = this.options.migrate?.[key]\n return migrate ? migrate(stored) : (stored as T[K])\n }\n\n /** Stores a value, then tells the other tabs. */\n async set<K extends keyof T & string>(key: K, value: T[K]): Promise<void> {\n this.apply(key, value)\n this.changes$.next({ key, value, removed: false, remote: false } as NbStorageChange<T>)\n await this.backend.set(key, value)\n this.post({ key, value })\n }\n\n /** Removes a key's value, so it has its default again. */\n async remove<K extends keyof T & string>(key: K): Promise<void> {\n const value = this.defaultOf(key)\n this.apply(key, value)\n this.changes$.next({ key, value, removed: true, remote: false } as NbStorageChange<T>)\n await this.backend.delete(key)\n this.post({ key, removed: true })\n }\n\n /** The keys that hold a value. */\n async keys(): Promise<Array<keyof T & string>> {\n return (await this.backend.keys()) as Array<keyof T & string>\n }\n\n /** Removes every value. */\n async clear(): Promise<void> {\n for (const [key] of this.live) {\n this.apply(key, this.defaultOf(key as keyof T & string))\n }\n this.changes$.next({ cleared: true, remote: false })\n await this.backend.clear()\n this.post({ cleared: true })\n }\n\n /**\n * A key's value as a signal. It's shared: everything that asks for the key while it's in use gets the same one, and\n * it's released once nothing holds it.\n */\n signal<K extends keyof T & string>(key: K): NbStoredSignal<T[K]> {\n const existing = this.live.get(key)?.deref()\n if (existing) {\n return existing as NbStoredSignal<T[K]>\n }\n const stored = this.createSignal(key)\n const ref = new WeakRef<NbStoredSignal<unknown>>(stored)\n this.live.set(key, ref)\n this.released.register(stored, { key, ref })\n return stored\n }\n\n /** Stops following the other tabs and closes the backend; the storage can't be used after. */\n destroy() {\n this.channel?.close()\n this.changes$.complete()\n void this.backend.close?.().catch(() => undefined)\n }\n\n protected createSignal<K extends keyof T & string>(key: K): NbStoredSignal<T[K]> {\n const state = signal<unknown>(this.defaultOf(key))\n const loading = signal(true)\n const error = signal<unknown>(undefined)\n const stored = state.asReadonly() as NbStoredSignal<T[K]>\n const live: Live = { state, changed: false }\n this.states.set(stored as NbStoredSignal<unknown>, live)\n const write = (action: Promise<void>) =>\n action.then(\n () => error.set(undefined),\n (failure: unknown) => {\n error.set(failure)\n throw failure\n }\n )\n const loaded = this.get(key).then(\n (value) => {\n if (!live.changed) {\n state.set(value)\n }\n return state() as T[K]\n },\n (failure: unknown) => {\n error.set(failure)\n return state() as T[K]\n }\n )\n void loaded.finally(() => loading.set(false))\n Object.assign(stored, {\n set: (value: T[K]) => write(this.set(key, value)),\n update: (change: (value: T[K]) => T[K]) => write(this.set(key, change(state() as T[K]))),\n remove: () => write(this.remove(key)),\n loading: loading.asReadonly(),\n error: error.asReadonly(),\n loaded\n })\n return stored\n }\n\n // Sets a live signal's value, from a change here or in another tab.\n protected apply(key: string, value: unknown) {\n const stored = this.live.get(key)?.deref()\n const live = stored && this.states.get(stored)\n if (live) {\n live.changed = true\n live.state.set(value)\n }\n }\n\n protected receive(message: Message) {\n if ('cleared' in message) {\n for (const [liveKey] of this.live) {\n this.apply(liveKey, this.defaultOf(liveKey as keyof T & string))\n }\n this.changes$.next({ cleared: true, remote: true })\n return\n }\n const key = message.key as keyof T & string\n const value = message.removed ? this.defaultOf(key) : (message.value as T[typeof key])\n this.apply(key, value)\n this.changes$.next({ key, value, removed: !!message.removed, remote: true } as NbStorageChange<T>)\n }\n\n protected post(message: Message) {\n try {\n this.channel?.postMessage(message)\n } catch {\n // A value BroadcastChannel can't clone is still stored; other tabs read it when they next load it.\n }\n }\n\n protected defaultOf<K extends keyof T>(key: K): T[K] {\n // Each key's default, required where its value can't be undefined; the mapped type hides that from indexing.\n const defaults: Partial<T> = this.options.defaults as unknown as Partial<T>\n return defaults[key] as T[K]\n }\n}\n\n/** What `declareStorage` gives: the providers, a token for the storage, and its keys' signals. */\nexport interface NbStorageDeclaration<T> {\n readonly name: string\n /** The storage, typed by its key map: `inject(appState.token)`. */\n readonly token: InjectionToken<NbStorage<T>>\n /** Provides the storage, e.g. in the app's providers or a lazy route's. */\n readonly providers: EnvironmentProviders\n /**\n * A key's shared signal, in an injection context: `readonly themes = appState.signal('customThemes')`. It isn't a\n * token, which the injector would keep for good; the signal is released once nothing holds it.\n */\n signal<K extends keyof T & string>(key: K): NbStoredSignal<T[K]>\n}\n\n/**\n * Declares a storage of typed values, kept in IndexedDB (so a web worker can open them too), and in step across tabs.\n * An app can have several, e.g. one for its state and one for an API cache:\n *\n * ```ts\n * interface AppState {\n * sidebarOpen: boolean;\n * customThemes: ThemeDraft[];\n * lastSearch?: string;\n * }\n *\n * export const appState = declareStorage<AppState>('app-state', {\n * defaults: { sidebarOpen: true, customThemes: [] },\n * migrate: { customThemes: (stored) => (stored as ThemeDraft[]).map(withNewFields) },\n * });\n *\n * // app.config.ts\n * providers: [appState.providers]\n *\n * // a component\n * readonly themes = appState.signal('customThemes');\n * save(draft: ThemeDraft) {\n * void this.themes.update((themes) => [...themes, draft]);\n * }\n * ```\n */\nexport function declareStorage<T>(name: string, options: NbStorageOptions<T>): NbStorageDeclaration<T> {\n const token = new InjectionToken<NbStorage<T>>(`NbStorage ${name}`)\n return {\n name,\n token,\n providers: makeEnvironmentProviders([\n {\n provide: token,\n useFactory: () => {\n const browser = isPlatformBrowser(inject(PLATFORM_ID))\n // On the server, nothing is kept, so each request renders the defaults.\n const fallback = typeof indexedDB !== 'undefined' ? new NbIndexedDbStore(name) : new NbMemoryStore()\n const backend = options.backend?.(name) ?? (browser ? fallback : new NbNoStore())\n const channel =\n browser && typeof BroadcastChannel !== 'undefined' ? new BroadcastChannel(`nb-storage-${name}`) : undefined\n const storage = new NbStorage<T>(name, options, backend, channel)\n inject(DestroyRef).onDestroy(() => storage.destroy())\n return storage\n }\n }\n ]),\n signal: (key) => inject(token).signal(key)\n }\n}\n","export class NbColorHelper {\n static shade(color: string, weight: number) {\n return NbColorHelper.mix('#000000', color, weight)\n }\n\n static tint(color: string, weight: number) {\n return NbColorHelper.mix('#ffffff', color, weight)\n }\n\n static mix(color1: string, color2: string, weight: number) {\n const d2h = (d: number) => d.toString(16)\n const h2d = (h: string) => parseInt(h, 16)\n\n let result = '#'\n for (let i = 1; i < 7; i += 2) {\n const firstPart = h2d(color1.slice(i, i + 2))\n const secondPart = h2d(color2.slice(i, i + 2))\n const resultPart = d2h(Math.floor(secondPart + (firstPart - secondPart) * (weight / 100.0)))\n result += ('0' + resultPart).slice(-2)\n }\n return result\n }\n\n static hexToRgbA(hex: string, alpha: number | string) {\n if (/^#([A-Fa-f0-9]{3}){1,2}$/.test(hex)) {\n let digits = hex.substring(1).split('')\n if (digits.length === 3) {\n digits = [digits[0], digits[0], digits[1], digits[1], digits[2], digits[2]]\n }\n const c = Number('0x' + digits.join(''))\n return 'rgba(' + [(c >> 16) & 255, (c >> 8) & 255, c & 255].join(',') + ',' + alpha + ')'\n }\n throw new Error('Bad Hex')\n }\n}\n","import { InjectionToken, inject, signal, Service } from '@angular/core'\nimport { Observable, ReplaySubject } from 'rxjs'\nimport { share } from 'rxjs/operators'\n\nexport enum NbLayoutDirection {\n LTR = 'ltr',\n RTL = 'rtl'\n}\n\n/** The layout direction to start with, `ltr` by default; `provideNbTheme` sets it. */\nexport const NB_LAYOUT_DIRECTION = new InjectionToken<NbLayoutDirection>('Layout direction', {\n factory: () => NbLayoutDirection.LTR\n})\n\n/**\n * Keeps the layout direction, `ltr` or `rtl`, which the layout, the overlays and the positions follow.\n *\n * It starts as `NB_LAYOUT_DIRECTION` gives it; `setDirection` changes it at run time.\n */\n@Service()\nexport class NbLayoutDirectionService {\n private readonly directionState = signal(inject(NB_LAYOUT_DIRECTION, { optional: true }) ?? NbLayoutDirection.LTR)\n\n /**\n * The current layout direction; `isLtr()`, `isRtl()` and `getDirection()` read it too, so they're reactive.\n */\n readonly direction = this.directionState.asReadonly()\n\n private $directionChange = new ReplaySubject<NbLayoutDirection>(1)\n\n constructor() {\n this.$directionChange.next(this.direction())\n }\n\n isLtr(): boolean {\n return this.direction() === NbLayoutDirection.LTR\n }\n\n isRtl(): boolean {\n return this.direction() === NbLayoutDirection.RTL\n }\n\n getDirection(): NbLayoutDirection {\n return this.direction()\n }\n\n setDirection(direction: NbLayoutDirection) {\n this.directionState.set(direction)\n this.$directionChange.next(direction)\n }\n\n /** Emits the direction when it changes, starting with the current one. */\n onDirectionChange(): Observable<NbLayoutDirection> {\n return this.$directionChange.pipe(share<NbLayoutDirection>())\n }\n}\n","import { Service } from '@angular/core'\nimport { Observable, Subject, Subscriber } from 'rxjs'\nimport { share } from 'rxjs/operators'\n\n/** How far the layout is scrolled, in pixels. */\nexport interface NbScrollPosition {\n\n /** From the left. */\n x: number\n\n /** From the top. */\n y: number\n}\n\n/**\n * The layout's scroll: its position, its scroll events, and `scrollTo`.\n *\n * The `nb-layout` on the page answers through it, since it scrolls on the body by default and in an element of its\n * own with `withScroll`; code that uses the service needn't know which.\n */\n@Service()\nexport class NbLayoutScrollService {\n\n private scrollPositionReq$ = new Subject<{ listener: Subject<NbScrollPosition> }>()\n private manualScroll$ = new Subject<{ x?: number, y?: number }>()\n private scroll$ = new Subject<Event>()\n private scrollable$ = new Subject<boolean>()\n\n /** The scroll position, once the layout answers; it never emits without a layout on the page. */\n getPosition(): Observable<NbScrollPosition> {\n return new Observable((observer: Subscriber<NbScrollPosition>) => {\n const listener = new Subject<NbScrollPosition>()\n listener.subscribe(observer)\n this.scrollPositionReq$.next({ listener })\n\n return () => listener.complete()\n })\n }\n\n /** Scrolls the layout; a coordinate left out keeps its current value. */\n scrollTo(x?: number, y?: number) {\n this.manualScroll$.next({ x, y })\n }\n\n /** The layout's scroll events. */\n onScroll(): Observable<Event> {\n return this.scroll$.pipe(share())\n }\n\n /**\n * The `scrollTo` requests `nb-layout` carries out.\n *\n * @private\n */\n onManualScroll(): Observable<{ x?: number, y?: number }> {\n return this.manualScroll$.pipe(share())\n }\n\n /**\n * The position requests `nb-layout` answers.\n *\n * @private\n */\n onGetPosition(): Subject<{ listener: Subject<NbScrollPosition> }> {\n return this.scrollPositionReq$\n }\n\n /** Whether the layout may scroll: the block scroll strategy turns it off while a modal overlay is open. */\n onScrollableChange(): Observable<boolean> {\n return this.scrollable$.pipe(share())\n }\n\n /**\n * Called by `nb-layout` with its scroll events.\n *\n * @private\n */\n fireScrollChange(event: Event) {\n this.scroll$.next(event)\n }\n\n /** Blocks or frees the layout's scrolling; `NbBlockScrollStrategyAdapter` calls it. */\n scrollable(scrollable: boolean) {\n this.scrollable$.next(scrollable)\n }\n}\n","import { Service } from '@angular/core'\nimport { Observable, Subject, Subscriber } from 'rxjs'\n\n/**\n * The client and scroll size of the layout's scroll container: `documentElement`, or the layout's own\n * `.scrollable-container` with `withScroll`.\n */\nexport interface NbLayoutDimensions {\n\n clientWidth: number\n\n clientHeight: number\n\n scrollWidth: number\n\n scrollHeight: number\n}\n\n/**\n * Measures the layout's scroll container: `documentElement` by default, or the layout's own `.scrollable-container`\n * with `withScroll`.\n *\n * The `nb-layout` on the page answers the requests, so there's nothing to measure without one.\n */\n@Service()\nexport class NbLayoutRulerService {\n\n private contentDimensionsReq$ = new Subject<{ listener: Subject<NbLayoutDimensions> }>()\n\n /** The dimensions, once the layout answers; it never emits without a layout on the page. */\n getDimensions(): Observable<NbLayoutDimensions> {\n return new Observable((observer: Subscriber<NbLayoutDimensions>) => {\n const listener = new Subject<NbLayoutDimensions>()\n listener.subscribe(observer)\n this.contentDimensionsReq$.next({ listener })\n\n return () => listener.complete()\n })\n }\n\n /**\n * The requests `nb-layout` answers.\n *\n * @private\n */\n onGetDimensions(): Subject<{ listener: Subject<NbLayoutDimensions> }> {\n return this.contentDimensionsReq$\n }\n}\n","import { Service } from '@angular/core'\n\nimport { NbComponentOrCustomStatus, NbComponentStatus } from '../components/component-status'\n\n@Service()\nexport class NbStatusService {\n readonly coreStatuses: NbComponentStatus[] = ['basic', 'primary', 'info', 'warning', 'danger', 'control']\n\n isCoreStatus(status: NbComponentOrCustomStatus): boolean {\n return this.coreStatuses.includes(status as NbComponentStatus)\n }\n\n isCustomStatus(status: NbComponentOrCustomStatus): boolean {\n if (this.isValidStatusString(status)) {\n return !this.isCoreStatus(status)\n }\n\n return false\n }\n\n getStatusClass(status?: NbComponentOrCustomStatus): string | undefined {\n if (this.isValidStatusString(status)) {\n return `status-${status}`\n }\n\n return undefined\n }\n\n protected isValidStatusString(status?: NbComponentOrCustomStatus): boolean {\n return typeof status === 'string' && status.length > 0\n }\n}\n","import { computed, inject, InjectionToken, Provider, Service, Signal, signal } from '@angular/core'\n\nimport type { NbFileDropTexts, NbPaginationTexts, NbSelectTexts, NbTimepickerLocalizationConfig } from '../components/component-texts'\nimport type { NbValidationMessage } from '../components/component-validation'\n\n/** The `$localize` tag of `@angular/localize`, which Lyra's default texts use. */\nexport type NbLocalize = (messageParts: TemplateStringsArray, ...expressions: ReadonlyArray<unknown>) => string\n\n// Lyra's default texts are `$localize` messages, so `ng extract-i18n` finds them and an app's translations apply.\n// When the app doesn't load `@angular/localize`, they're their English text; `@angular/localize/init` replaces this.\n/**\n * Makes a `$localize` message its text: without the id and description before it and the names after its values.\n *\n * @internal\n */\nexport const nbLocalizeFallback: NbLocalize = (messageParts, ...expressions) => {\n const strip = (part: string, raw: string) => {\n if (raw.charAt(0) !== ':') {\n return part\n }\n for (let cooked = 1, index = 1; cooked < part.length; cooked++, index++) {\n if (raw[index] === '\\\\') {\n index++\n } else if (part[cooked] === ':') {\n return part.substring(cooked + 1)\n }\n }\n return part\n }\n let message = strip(messageParts[0], messageParts.raw[0])\n for (let i = 1; i < messageParts.length; i++) {\n message += String(expressions[i - 1]) + strip(messageParts[i], messageParts.raw[i])\n }\n return message\n}\n\nconst scope = globalThis as { $localize?: NbLocalize }\nif (typeof scope.$localize !== 'function') {\n scope.$localize = nbLocalizeFallback\n}\n\n/**\n * The texts of Lyra's components, by component. Other Lyra packages add theirs.\n */\nexport interface NbTexts {\n alert: {\n /** Label of the close button. */\n close: string\n }\n breadcrumbs: {\n /** Names the navigation landmark. */\n label: string\n }\n calendar: {\n /** Label of the button that shows the previous month, year or years. */\n previous: string\n /** Label of the button that shows the next month, year or years. */\n next: string\n /** Heads the week numbers. */\n weekNumber: string\n /** The button that keeps a date and time. */\n apply: string\n /** The button that sets the current time. */\n now: string\n /** Names a datepicker's popup with the calendar. */\n dialog: string\n }\n theme: {\n /** Names the theme select. */\n theme: string\n /** The theme that follows the system's colour scheme and contrast. */\n system: string\n /** Names the content size select. */\n contentSize: string\n small: string\n medium: string\n large: string\n larger: string\n }\n menu: {\n /** Names the button that opens and closes the submenu of an item with its own page, given the item's title. */\n submenu: (title: string) => string\n }\n table: {\n /** Names the checkbox that selects all rows of a table's page. */\n selectAll: string\n /** Names the checkbox that selects a row. */\n selectRow: string\n }\n pageIndicator: {\n /** Names the group of a page indicator's dots. */\n pages: string\n /** Names a page's dot, given the page, from 1, and how many there are. */\n page: (page: number, count: number) => string\n }\n slider: {\n /** Names the start thumb of a range slider, after the slider's own name. */\n start: string\n /** Names the end thumb of a range slider, after the slider's own name. */\n end: string\n }\n confirmDialog: {\n /** The button that confirms, e.g. in `NbDialogService.confirm`. */\n confirm: string\n /** The button that cancels. */\n cancel: string\n }\n chat: {\n /** Shown while there are no messages. */\n noMessages: string\n /** Name of the message list for screen readers, in a chat without a title. */\n messages: string\n /** Placeholder of the message field. */\n messagePlaceholder: string\n /** Placeholder of the message field while files are dragged over it. */\n dropFilePlaceholder: string\n /** Label of the button that removes a dropped file, given its name. */\n removeFile: (name: string) => string\n }\n fileDrop: NbFileDropTexts\n flipCard: {\n /** Label of the button that flips the card. */\n toggle: string\n }\n pagination: NbPaginationTexts\n progressBar: {\n /** Names a progress bar without an `aria-label` of its own. */\n label: string\n }\n revealCard: {\n /** Label of the button that reveals the back of the card. */\n toggle: string\n }\n search: {\n /** Placeholder of the search field. */\n placeholder: string\n /** Shown below the search field. */\n hint: string\n /** Label of the button that opens the search field. */\n open: string\n /** Label of the button that closes the search field. */\n close: string\n }\n select: NbSelectTexts\n spinner: {\n /** Shown with the spinner. */\n message: string\n }\n tag: {\n /** Label of the button that removes a tag outside a tag list, given its text. */\n remove: (text: string) => string\n }\n timepicker: Required<NbTimepickerLocalizationConfig>\n toastr: {\n /** Label of a toast's close button. */\n close: string\n }\n toc: {\n /** Names the navigation landmark. */\n label: string\n }\n treeGrid: {\n /** Label of the button that collapses a row. */\n collapse: string\n /** Label of the button that expands a row. */\n expand: string\n }\n /** Messages for kinds of errors, given the error, e.g. `required` or `minlength`. */\n validation: Record<string, NbValidationMessage>\n user: {\n /** The name shown without one. */\n anonymous: string\n }\n window: {\n /** Label of the button that minimizes the window. */\n minimize: string\n /** Label of the button that restores a minimized window. */\n restore: string\n /** Label of the button that collapses the window. */\n collapse: string\n /** Label of the button that expands the window to full screen. */\n expand: string\n /** Label of the button that closes the window. */\n close: string\n }\n}\n\n/** Texts to change, by component; the others stay as they are. */\nexport type NbTextsOverrides = { [Section in keyof NbTexts]?: Partial<NbTexts[Section]> }\n\nconst NB_TEXTS_OVERRIDES = new InjectionToken<NbTextsOverrides>('Lyra Texts Overrides')\n\n/**\n * The texts Lyra's components show and announce, such as labels, placeholders and messages for screen readers.\n *\n * They're English and translated with Angular's i18n, as `$localize` messages with ids like `@@nb.pagination.next`.\n * `provideNbTexts` changes them for the app or for the components inside one, e.g. for texts an app keeps\n * elsewhere, and `set` changes them at run time.\n */\n@Service()\nexport class NbTextsService {\n protected readonly parent = inject(NbTextsService, { optional: true, skipSelf: true })\n protected readonly own = signal(inject(NB_TEXTS_OVERRIDES, { optional: true }) ?? {})\n\n /** The changed texts, the parent's under these. */\n readonly overrides: Signal<NbTextsOverrides> = computed(() => {\n const parent = this.parent?.overrides() ?? {}\n const own = this.own()\n const merged: Record<string, object> = { ...parent }\n for (const [section, texts] of Object.entries(own)) {\n merged[section] = { ...(merged[section] ?? {}), ...texts }\n }\n return merged as NbTextsOverrides\n })\n\n /** Changes the texts, e.g. when the user picks another language. */\n set(overrides: NbTextsOverrides) {\n this.own.set(overrides)\n }\n}\n\n/**\n * Changes the texts of Lyra's components, for the app or for the components inside the one that provides it:\n *\n * ```ts\n * providers: [provideNbTexts({ pagination: { next: 'Next page' } })]\n * ```\n */\nexport function provideNbTexts(overrides: NbTextsOverrides): Provider[] {\n return [{ provide: NB_TEXTS_OVERRIDES, useValue: overrides }, NbTextsService]\n}\n\n/**\n * The texts of a component: its defaults, which `defaults` makes in the injection context, under the changed ones.\n *\n * @internal\n */\nexport function injectNbTexts<Section extends keyof NbTexts>(\n section: Section,\n defaults: () => NbTexts[Section]\n): Signal<NbTexts[Section]> {\n const service = inject(NbTextsService)\n const base = defaults()\n return computed(() => ({ ...base, ...(service.overrides()[section] ?? {}) }) as NbTexts[Section])\n}\n\n/** Joins names into a list in the app's language, e.g. \"a, b and c\". @internal */\nexport function nbFormatList(locale: string, items: string[]) {\n try {\n return new Intl.ListFormat(locale, { type: 'conjunction' }).format(items)\n } catch {\n return items.join(', ')\n }\n}\n","import { computed, inject, InjectionToken, isSignal, Provider, Signal, signal } from '@angular/core'\n\nimport type { NbAlertAppearance, NbButtonAppearance, NbButtonToggleAppearance, NbSelectAppearance, NbTagAppearance } from './component-appearance'\nimport type { NbComponentShape } from './component-shape'\nimport type { NbComponentSize } from './component-size'\n\n/** Outline or filled icons, as icon packs like Lyra's have most icons in both (`star-outline` and `star`). */\nexport type NbIconStyle = 'outline' | 'filled'\n\n/** Any of the components' appearances; each component has some of them. */\nexport type NbComponentAppearance =\n | NbButtonAppearance\n | NbSelectAppearance\n | NbTagAppearance\n | NbAlertAppearance\n | NbCardAppearance\n | 'outline'\n | 'filled'\n\n/**\n * How a container sits on the page: `outline`, with a border, among other content, or `floating`, with a shadow\n * instead, over the page, e.g. opened from a button.\n */\nexport type NbContainerAppearance = 'outline' | 'floating'\n\n/** A card's appearance: a container's, or `filled`, tinted without a border, e.g. for cards in a card. */\nexport type NbCardAppearance = NbContainerAppearance | 'filled'\n\n/** The shape and size of a control. */\nexport interface NbControlDefaults {\n shape?: NbComponentShape\n size?: NbComponentSize\n}\n\n/**\n * Defaults for the components' `shape`, `size` and `appearance`, which a component's own inputs override. `shape` and\n * `size` at the top apply to the controls (buttons, button groups, fields, selects, tags, checkboxes, radios, toggles,\n * sliders, file drops), `appearance` at the top to each component that has it, and each type's own defaults to that\n * type.\n */\nexport interface NbComponentDefaults extends NbControlDefaults {\n /**\n * The appearance of each component that has it: buttons, button groups, selects, tags, alerts, and the containers\n * (cards, chats, accordions, tables and tree grids), e.g. `outline` for all of them, `hero` for buttons, selects and\n * tags while the others keep their own, or `floating` for the containers. A type's own `appearance` wins.\n */\n appearance?: NbComponentAppearance\n /**\n * Draws icons in one style: an icon named in the other style uses this one where its pack has both, e.g.\n * `star-outline` is drawn as `star` with `filled`, the components' own icons included. Unset, icons are drawn as\n * named.\n */\n iconStyle?: NbIconStyle\n /** `nbButton`, and `nbButtonToggle` outside a group (which has no `hero` appearance). */\n button?: NbControlDefaults & { appearance?: NbButtonAppearance }\n buttonGroup?: NbControlDefaults & { appearance?: NbButtonToggleAppearance }\n /** `nbInput`, and fields like it: the phone input and the colour picker; an autocomplete's options match them. */\n input?: NbControlDefaults\n select?: NbControlDefaults & { appearance?: NbSelectAppearance }\n /** Tags and tag lists; tags are always round. */\n tag?: { size?: NbComponentSize, appearance?: NbTagAppearance }\n checkbox?: { size?: NbComponentSize }\n /** Radios and radio groups. */\n radio?: { size?: NbComponentSize }\n toggle?: { size?: NbComponentSize }\n slider?: { size?: NbComponentSize }\n fileDrop?: NbControlDefaults\n /** Alerts; their size is a height, so the controls' size doesn't apply. */\n alert?: { appearance?: NbAlertAppearance }\n /** Cards; their size is a height, so the controls' size doesn't apply. */\n card?: { appearance?: NbCardAppearance }\n chat?: { appearance?: NbContainerAppearance }\n accordion?: { appearance?: NbContainerAppearance }\n /** Data tables (`nbTable`); one in a card has the card's appearance. */\n table?: { appearance?: NbContainerAppearance }\n /** Tree grids (`nbTreeGrid`); one in a card has the card's appearance. */\n treeGrid?: { appearance?: NbContainerAppearance }\n /** Avatars; the controls' shape and size don't apply. */\n user?: NbControlDefaults\n /**\n * The controls' size doesn't apply; pagination is `small` by default. `edge` is whether its last button lines up its\n * icon with the end of the row (the default), see `NbPaginationComponent.edge`.\n */\n pagination?: { size?: NbComponentSize, edge?: boolean }\n}\n\n/** The types `NbComponentDefaults` has defaults for. */\nexport type NbComponentDefaultsType = Exclude<\n keyof NbComponentDefaults,\n keyof NbControlDefaults | 'appearance' | 'iconStyle'\n>\n\n// The types the controls' shape and size apply to.\nconst CONTROLS: ReadonlySet<NbComponentDefaultsType> = new Set([\n 'button',\n 'buttonGroup',\n 'input',\n 'select',\n 'tag',\n 'checkbox',\n 'radio',\n 'toggle',\n 'slider',\n 'fileDrop'\n])\n\n// The appearances each type has, which the appearance at the top reaches. Toggles outside a group take the buttons'.\nconst APPEARANCES: Partial<Record<NbComponentDefaultsType, ReadonlyArray<NbComponentAppearance>>> = {\n button: ['filled', 'outline', 'ghost', 'hero'],\n buttonGroup: ['filled', 'outline', 'ghost'],\n select: ['outline', 'filled', 'hero', 'ghost'],\n tag: ['filled', 'outline', 'hero'],\n alert: ['filled', 'outline', 'accent'],\n card: ['outline', 'filled', 'floating'],\n chat: ['outline', 'floating'],\n accordion: ['outline', 'floating'],\n table: ['outline', 'floating'],\n treeGrid: ['outline', 'floating']\n}\n\n/** The components' defaults, as a signal, so components follow changes to them. */\nexport const NB_COMPONENT_DEFAULTS = new InjectionToken<Signal<NbComponentDefaults>>('Lyra Component Defaults')\n\nconst NO_DEFAULTS: Signal<NbComponentDefaults> = signal({}).asReadonly()\n\n/**\n * Sets the components' default shape, size, appearance and icon style, e.g. round buttons and large fields across an\n * app, or in one part of it when provided by a component:\n *\n * ```ts\n * providers: [\n * provideNbComponentDefaults({\n * shape: 'semi-round',\n * size: 'large',\n * appearance: 'outline',\n * button: { shape: 'round' },\n * select: { appearance: 'filled' },\n * }),\n * ]\n * ```\n *\n * A component's own inputs still win; defaults provided closer to it override, type by type, the ones further up.\n * Given a signal, e.g. for a setting users change, the components follow it as it changes, without rendering again.\n */\nexport function provideNbComponentDefaults(defaults: NbComponentDefaults | Signal<NbComponentDefaults>): Provider {\n return {\n provide: NB_COMPONENT_DEFAULTS,\n useFactory: () => {\n const parent = inject(NB_COMPONENT_DEFAULTS, { optional: true, skipSelf: true }) ?? NO_DEFAULTS\n return computed(() => mergeDefaults(parent(), isSignal(defaults) ? defaults() : defaults))\n }\n }\n}\n\n/**\n * The defaults of a type, as a signal: its own, then the controls' shape and size where they apply to it, and the\n * appearance at the top where it's one of the type's. It changes only when they do, not when another type's do.\n */\nexport function injectNbDefaults<K extends NbComponentDefaultsType>(\n type: K\n): Signal<NonNullable<NbComponentDefaults[K]>> {\n const defaults = inject(NB_COMPONENT_DEFAULTS, { optional: true }) ?? NO_DEFAULTS\n return computed(\n () => {\n const all = defaults()\n const own = withoutUndefined(all[type] ?? {})\n const appearance = all.appearance && APPEARANCES[type]?.includes(all.appearance) ? all.appearance : undefined\n const merged = {\n ...(CONTROLS.has(type) ? { shape: all.shape, size: all.size } : {}),\n ...(appearance ? { appearance } : {}),\n ...own\n }\n return merged as NonNullable<NbComponentDefaults[K]>\n },\n { equal: shallowEqual }\n )\n}\n\n/** The style icons are drawn in, if the app sets one, as a signal. */\nexport function injectNbIconStyle(): Signal<NbIconStyle | undefined> {\n const defaults = inject(NB_COMPONENT_DEFAULTS, { optional: true }) ?? NO_DEFAULTS\n return computed(() => defaults().iconStyle)\n}\n\nfunction mergeDefaults(parent: NbComponentDefaults, child: NbComponentDefaults): NbComponentDefaults {\n const merged: Record<string, unknown> = { ...parent, ...withoutUndefined(child) }\n for (const [key, value] of Object.entries(child)) {\n const inherited: unknown = parent[key as keyof NbComponentDefaults]\n if (isObject(value) && isObject(inherited)) {\n merged[key] = { ...inherited, ...withoutUndefined(value) }\n }\n }\n return merged as NbComponentDefaults\n}\n\nfunction withoutUndefined<T extends object>(value: T): Partial<T> {\n return Object.fromEntries(Object.entries(value).filter(([, entry]) => entry !== undefined)) as Partial<T>\n}\n\nfunction isObject(value: unknown): value is object {\n return typeof value === 'object' && value !== null\n}\n\nfunction shallowEqual(a: object, b: object): boolean {\n const keys = Object.keys(a) as Array<keyof typeof a>\n return keys.length === Object.keys(b).length && keys.every((key) => a[key] === b[key])\n}\n","import { Platform } from '@angular/cdk/platform'\nimport { Injectable } from '@angular/core'\n\n// Aliases a CDK service, so it stays on @Injectable: a @Service factory can't type the inherited CDK statics.\n@Injectable({\n providedIn: 'root',\n useClass: Platform\n})\nexport class NbPlatform extends Platform {}\n","import { Injectable } from '@angular/core'\nimport { Directionality } from '@angular/cdk/bidi'\n\n// Aliases a CDK service, so it stays on @Injectable: a @Service factory can't type the inherited CDK statics.\n@Injectable({ providedIn: 'root', useExisting: Directionality })\nexport class NbDirectionality extends Directionality {}\n","import { NgModule } from '@angular/core'\nimport { BidiModule } from '@angular/cdk/bidi'\n\n@NgModule({})\nexport class NbBidiModule extends BidiModule {}\n","export * from '@angular/cdk/keycodes'\n\n/**\n * Whether a keydown belongs to an IME composition, e.g. of a Japanese word, rather than to the key it names. Safari\n * fires the keydown of the Enter that ends a composition after `compositionend`, so `isComposing` is false then and\n * only key code 229 tells.\n */\nexport function isComposing(event: KeyboardEvent): boolean {\n // eslint-disable-next-line @typescript-eslint/no-deprecated -- Safari marks the keydown that ends a composition only by key code 229.\n return event.isComposing || event.keyCode === 229\n}\n","export type NbNullableInput = string | null | undefined\nexport type NbBooleanInput = boolean | NbNullableInput\n\n/**\n * Classes as a `[class]` binding takes them: a space-separated string, an array, or an object of class names to flags.\n */\nexport type NbClassInput = string | string[] | Record<string, unknown> | null | undefined\n\nexport function convertToBoolProperty(val: NbBooleanInput): boolean {\n if (typeof val === 'string') {\n val = val.toLowerCase().trim()\n\n return val === 'true' || val === ''\n }\n\n return !!val\n}\n\n/** As `convertToBoolProperty`, but an input that isn't set stays `undefined`, so it can fall back to a default. */\nexport function convertToOptionalBoolProperty(val: NbBooleanInput): boolean | undefined {\n return val === undefined ? undefined : convertToBoolProperty(val)\n}\n\n/**\n * Whether a value written to a control is the one it holds: the same value, or arrays or plain objects, such as a\n * range, with the same items. Writing it again then changes nothing.\n */\nexport function sameControlValue(a: unknown, b: unknown): boolean {\n if (Object.is(a, b)) {\n return true\n }\n if (Array.isArray(a) && Array.isArray(b)) {\n return a.length === b.length && a.every((item, index) => Object.is(item, b[index]))\n }\n if (isPlainObject(a) && isPlainObject(b)) {\n const keys = Object.keys(a)\n return keys.length === Object.keys(b).length && keys.every((key) => Object.is(a[key], b[key]))\n }\n return false\n}\n\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && Object.getPrototypeOf(value) === Object.prototype\n}\n","const running = new WeakMap<HTMLElement, Animation>()\n\n/**\n * How long a height change of `distance` pixels takes: longer for taller content, but less than in proportion, so a\n * long panel opening beside a short one closing doesn't rush, nor drag. About 200ms for 50px, 290ms for 200px and\n * 410ms for 600px, at most 600ms.\n */\nexport function expandDuration(distance: number): number {\n return distance > 0 ? Math.min(600, Math.round(120 + 12 * Math.sqrt(distance))) : 0\n}\n\n/**\n * Animates an element's height to its content height or to 0, after its styles changed to the new state.\n *\n * CSS can't transition to `height: auto`, so the heights are measured: the element's styles hold the end state, and the\n * animation covers the change from the height it had. A change while one is running starts from where it is, so it\n * turns back without a jump. `keep` is held on every frame, e.g. the visibility a collapsed element only gets at the end.\n * Without a `duration`, it takes {@link expandDuration} of the distance.\n */\nexport function animateExpand(\n element: HTMLElement,\n expanded: boolean,\n options: KeyframeAnimationOptions = {},\n keep: Keyframe = {}\n) {\n if (typeof element.animate !== 'function' || matchMedia('(prefers-reduced-motion: reduce)').matches) {\n return\n }\n\n const previous = running.get(element)\n let from: number\n if (previous) {\n from = element.getBoundingClientRect().height\n previous.cancel()\n } else {\n // A collapsed element still lays out its content, so its scroll height is the height it collapses from.\n from = expanded ? 0 : element.scrollHeight\n }\n const to = expanded ? element.scrollHeight : 0\n\n const animation = element.animate(\n [\n { ...keep, height: `${from}px` },\n { ...keep, height: `${to}px` }\n ],\n { duration: expandDuration(Math.abs(to - from)), ...options }\n )\n running.set(element, animation)\n animation.onfinish = animation.oncancel = () => {\n if (running.get(element) === animation) {\n running.delete(element)\n }\n }\n}\n","const hidden: Keyframe = { opacity: 0, transform: 'scale(0.96)' }\nconst shown: Keyframe = { opacity: 1, transform: 'none' }\n\n/**\n * Fades and scales a pane, a dialog's or a window's, in as it opens, or out before it's removed; the overlay fades the\n * backdrop itself. Resolves when the animation ends, or right away with reduced motion or where elements don't\n * animate (the server).\n */\nexport function animatePane(pane: HTMLElement, opening: boolean): Promise<void> {\n if (\n typeof pane.animate !== 'function' ||\n (typeof matchMedia === 'function' && matchMedia('(prefers-reduced-motion: reduce)').matches)\n ) {\n return Promise.resolve()\n }\n const duration = opening ? 150 : 100\n const animation = pane.animate(opening ? [hidden, shown] : [shown, hidden], {\n duration,\n easing: opening ? 'ease-out' : 'ease-in',\n // Closing holds the end, so the pane doesn't flash back before it's removed.\n fill: opening ? 'none' : 'forwards'\n })\n return new Promise((resolve) => {\n const done = () => resolve()\n animation.finished.then(done, done)\n // A timer too, for clocks an animation doesn't follow, e.g. a test's fake timers.\n setTimeout(done, duration + 50)\n })\n}\n","/**\n * Focuses the control a click landed on, as Chrome and Firefox do. Safari doesn't focus checkboxes, radios and buttons\n * on click, so its users would never blur them, which is what marks a control touched, and they'd show no focus.\n */\nexport function focusOnClick(event: Event) {\n const target = event.currentTarget as HTMLElement | null\n if (target && target !== target.ownerDocument.activeElement) {\n target.focus({ preventScroll: true })\n }\n}\n","import { afterNextRender, inject, NgZone } from '@angular/core'\n\n/**\n * Adds `nb-transition` to an element after its first render, so the styles it renders with don't animate in (#2254).\n * Call it in an injection context.\n */\nexport function enableTransitionsAfterRender(element: HTMLElement) {\n const zone = inject(NgZone)\n afterNextRender(() => zone.runOutsideAngular(() => setTimeout(() => element.classList.add('nb-transition'))))\n}\n"],"mappings":";;;;;;;AAEA,MAAMA,YAAU;CACZ,SAAS;CACT,SAAS;CACT,MAAM;CACN,SAAS;CACT,QAAQ;AACX;AAED,MAAa,gBAAkC;CAC3C,MAAM;CACN,WAAW;EACP,UAAU;EACV,eAAe;EAEf,IAAI;EACJ,KAAK;EACL,KAAK;EACL,KAAK;EAEL,QAAQ;EACR,SAAS;EACT,SAAS;EACT,SAAS;EACT,SAAS;EAET,IAAI;EACJ,WAAW;EACX,QAAQ;EACR,aAAaA,UAAQ;EACrB,UAAU;EACV,WAAW;EAEX,SAASA,UAAQ;EACjB,SAASA,UAAQ;EACjB,MAAMA,UAAQ;EACd,SAASA,UAAQ;EACjB,QAAQA,UAAQ;EAEhB,c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,QAAO;EAC1B,UAAU,SAAS,KAAK,MAAM,IAAI;EAElC,WAAW,MAAM,WAAW,EAAE;CAClC,CAAC;AACL;ACxBA,SAAgB,aAAa,OAAY;CACrC,MAAM,SAAS,MAAM;CACrB,IAAI,UAAU,WAAW,OAAO,cAAc,eAC1C,OAAO,MAAM,EAAE,eAAe,KAAI,CAAE;AAE5C;ACHA,SAAgB,6BAA6B,SAAoB;CAC7D,MAAM,OAAO,OAAO,MAAM;CAC1B,sBAAsB,KAAK,wBAAwB,iBAAiB,QAAQ,UAAU,IAAI,eAAe,CAAC,CAAC,CAAC;AAChH"}
1
+ {"version":3,"file":"liquid-js-lyr-core-base.mjs","names":["palette","palette","palette","palette","palette"],"sources":["../../../packages/core/src/services/js-themes/default.theme.ts","../../../packages/core/src/services/js-themes/cosmic.theme.ts","../../../packages/core/src/services/js-themes/corporate.theme.ts","../../../packages/core/src/services/js-themes/dark.theme.ts","../../../packages/core/src/services/js-themes/material-dark.theme.ts","../../../packages/core/src/services/js-themes/material-light.theme.ts","../../../packages/core/src/theme.options.ts","../../../packages/core/src/services/js-themes-registry.service.ts","../../../packages/core/src/services/breakpoints.service.ts","../../../packages/core/src/services/theme.service.ts","../../../packages/core/src/services/theme-style.service.ts","../../../packages/core/src/services/spinner.service.ts","../../../packages/core/src/services/storage/indexed-db-store.ts","../../../packages/core/src/services/storage/storage.ts","../../../packages/core/src/services/color.helper.ts","../../../packages/core/src/services/direction.service.ts","../../../packages/core/src/services/scroll.service.ts","../../../packages/core/src/services/ruler.service.ts","../../../packages/core/src/services/status.service.ts","../../../packages/core/src/services/texts.service.ts","../../../packages/core/src/components/component-defaults.ts","../../../packages/core/src/components/cdk/platform/platform-service.ts","../../../packages/core/src/components/cdk/bidi/bidi-service.ts","../../../packages/core/src/components/cdk/bidi/bidi.module.ts","../../../packages/core/src/components/cdk/keycodes/keycodes.ts","../../../packages/core/src/components/helpers.ts","../../../packages/core/src/components/shared/expand-animation.ts","../../../packages/core/src/components/shared/pane-animation.ts","../../../packages/core/src/components/shared/focus.ts","../../../packages/core/src/components/shared/transition.ts"],"sourcesContent":["import { NbJSThemeOptions } from './theme.options'\n\nconst palette = {\n primary: '#3469d1',\n success: '#03ce86',\n info: '#0095ff',\n warning: '#ffaa00',\n danger: '#ff3d71'\n}\n\nexport const DEFAULT_THEME: NbJSThemeOptions = {\n name: 'default',\n variables: {\n fontMain: 'Inter, sans-serif',\n fontSecondary: 'Raleway, sans-serif',\n\n bg: '#ffffff',\n bg2: '#f7f9fc',\n bg3: '#edf1f7',\n bg4: '#e4e9f2',\n\n border: '#ffffff',\n border2: '#f7f9fc',\n border3: '#edf1f7',\n border4: '#e4e9f2',\n border5: '#c5cee0',\n\n fg: '#8f9bb3',\n fgHeading: '#1a2138',\n fgText: '#1a2138',\n fgHighlight: palette.primary,\n layoutBg: '#f7f9fc',\n separator: '#edf1f7',\n\n primary: palette.primary,\n success: palette.success,\n info: palette.info,\n warning: palette.warning,\n danger: palette.danger,\n\n primaryLight: '#598bff',\n successLight: '#2ce69b',\n infoLight: '#42aaff',\n warningLight: '#ffc94d',\n dangerLight: '#ff708d'\n }\n}\n","import { NbJSThemeOptions } from './theme.options'\n\nconst palette = {\n primary: '#8a55f0',\n success: '#03ce86',\n info: '#0095ff',\n warning: '#ffaa00',\n danger: '#ff3d71'\n}\n\nexport const COSMIC_THEME: NbJSThemeOptions = {\n name: 'cosmic',\n variables: {\n fontMain: 'Inter, sans-serif',\n fontSecondary: 'Raleway, sans-serif',\n\n bg: '#323259',\n bg2: '#252547',\n bg3: '#1b1b38',\n bg4: '#13132b',\n\n border: '#323259',\n border2: '#252547',\n border3: '#1b1b38',\n border4: '#13132b',\n border5: '#13132b',\n\n fg: '#b4b4db',\n fgHeading: '#ffffff',\n fgText: '#ffffff',\n fgHighlight: palette.primary,\n layoutBg: '#151a30',\n separator: '#151a30',\n\n primary: palette.primary,\n success: palette.success,\n info: palette.info,\n warning: palette.warning,\n danger: palette.danger,\n\n primaryLight: '#a37bf8',\n successLight: '#2ce69b',\n infoLight: '#42aaff',\n warningLight: '#ffc94d',\n dangerLight: '#ff708d'\n }\n}\n","import { NbJSThemeOptions } from './theme.options'\n\nconst palette = {\n primary: '#73a1ff',\n success: '#5dcfe3',\n info: '#ba7fec',\n warning: '#ffa36b',\n danger: '#ff6b83'\n}\n\nexport const CORPORATE_THEME: NbJSThemeOptions = {\n name: 'corporate',\n base: 'default',\n variables: {\n fontMain: 'Inter, sans-serif',\n fontSecondary: 'Raleway, sans-serif',\n\n bg: '#ffffff',\n bg2: '#f7f9fc',\n bg3: '#edf1f7',\n bg4: '#e4e9f2',\n\n border: '#ffffff',\n border2: '#f7f9fc',\n border3: '#edf1f7',\n border4: '#e4e9f2',\n border5: '#c5cee0',\n\n fg: '#8f9bb3',\n fgHeading: '#1a2138',\n fgText: '#1a2138',\n fgHighlight: palette.primary,\n layoutBg: '#f7f9fc',\n separator: '#edf1f7',\n\n primary: palette.primary,\n success: palette.success,\n info: palette.info,\n warning: palette.warning,\n danger: palette.danger,\n\n primaryLight: '#598bff',\n successLight: '#2ce69b',\n infoLight: '#42aaff',\n warningLight: '#ffc94d',\n dangerLight: '#ff708d'\n }\n}\n","import { NbJSThemeOptions } from './theme.options'\n\nconst palette = {\n primary: '#3469d1',\n success: '#03ce86',\n info: '#0095ff',\n warning: '#ffaa00',\n danger: '#ff3d71'\n}\n\nexport const DARK_THEME: NbJSThemeOptions = {\n name: 'dark',\n variables: {\n fontMain: 'Inter, sans-serif',\n fontSecondary: 'Raleway, sans-serif',\n\n bg: '#222b45',\n bg2: '#1a2138',\n bg3: '#151a30',\n bg4: '#101426',\n\n border: '#222b45',\n border2: '#1a2138',\n border3: '#151a30',\n border4: '#101426',\n border5: '#101426',\n\n fg: '#8f9bb3',\n fgHeading: '#ffffff',\n fgText: '#ffffff',\n fgHighlight: palette.primary,\n layoutBg: '#1b1b38',\n separator: '#1b1b38',\n\n primary: palette.primary,\n success: palette.success,\n info: palette.info,\n warning: palette.warning,\n danger: palette.danger,\n\n primaryLight: '#598bff',\n successLight: '#2ce69b',\n infoLight: '#42aaff',\n warningLight: '#ffc94d',\n dangerLight: '#ff708d'\n }\n}\n","import { NbJSThemeOptions } from './theme.options'\n\nconst palette = {\n primary: '#d0bcff',\n success: '#8fd88a',\n info: '#96ccff',\n warning: '#ffb869',\n danger: '#f2b8b5'\n}\n\n/** Material 3's baseline dark scheme, for charts and other code that draws with the theme's colours. */\nexport const MATERIAL_DARK_THEME: NbJSThemeOptions = {\n name: 'material-dark',\n base: 'dark',\n variables: {\n fontMain: 'Roboto, sans-serif',\n fontSecondary: 'Roboto, sans-serif',\n\n bg: '#211f26',\n bg2: '#1d1b20',\n bg3: '#141218',\n bg4: '#0f0d13',\n\n border: '#211f26',\n border2: '#2b2930',\n border3: '#49454f',\n border4: '#938f99',\n border5: '#cac4d0',\n\n fg: '#cac4d0',\n fgHeading: '#e6e0e9',\n fgText: '#e6e0e9',\n fgHighlight: palette.primary,\n layoutBg: '#141218',\n separator: '#49454f',\n\n primary: palette.primary,\n success: palette.success,\n info: palette.info,\n warning: palette.warning,\n danger: palette.danger,\n\n primaryLight: '#ddcdff',\n successLight: '#9ddd95',\n infoLight: '#a0d2ff',\n warningLight: '#ffbf7b',\n dangerLight: '#f5cbc8'\n }\n}\n","import { NbJSThemeOptions } from './theme.options'\n\nconst palette = {\n primary: '#6750a4',\n success: '#2e6c2f',\n info: '#00629c',\n warning: '#8a5100',\n danger: '#b3261e'\n}\n\n/** Material 3's baseline light scheme, for charts and other code that draws with the theme's colours. */\nexport const MATERIAL_LIGHT_THEME: NbJSThemeOptions = {\n name: 'material-light',\n base: 'default',\n variables: {\n fontMain: 'Roboto, sans-serif',\n fontSecondary: 'Roboto, sans-serif',\n\n bg: '#fef7ff',\n bg2: '#f7f2fa',\n bg3: '#f3edf7',\n bg4: '#ece6f0',\n\n border: '#fef7ff',\n border2: '#ece6f0',\n border3: '#cac4d0',\n border4: '#79747e',\n border5: '#49454f',\n\n fg: '#49454f',\n fgHeading: '#1d1b20',\n fgText: '#1d1b20',\n fgHighlight: palette.primary,\n layoutBg: '#f3edf7',\n separator: '#cac4d0',\n\n primary: palette.primary,\n success: palette.success,\n info: palette.info,\n warning: palette.warning,\n danger: palette.danger,\n\n primaryLight: '#7f67be',\n successLight: '#477c44',\n infoLight: '#2b74a8',\n warningLight: '#98632b',\n dangerLight: '#dc362e'\n }\n}\n","import { isPlatformBrowser } from '@angular/common'\nimport { DOCUMENT, inject, InjectionToken, PLATFORM_ID } from '@angular/core'\nimport { NbMediaBreakpoint } from './services/breakpoints.service'\nimport { NbJSThemeOptions } from './services/js-themes/theme.options'\nimport { DEFAULT_THEME } from './services/js-themes/default.theme'\nimport { COSMIC_THEME } from './services/js-themes/cosmic.theme'\nimport { CORPORATE_THEME } from './services/js-themes/corporate.theme'\nimport { DARK_THEME } from './services/js-themes/dark.theme'\nimport { MATERIAL_DARK_THEME } from './services/js-themes/material-dark.theme'\nimport { MATERIAL_LIGHT_THEME } from './services/js-themes/material-light.theme'\n\n/** A theme of the app, with what it's for, so the system's preferences can pick it and `nb-theme-select` offer it. */\nexport interface NbThemeDescription {\n /** The theme's name, as registered with `nb-register-theme`. */\n name: string\n /** Its colour scheme, matched with the system's `prefers-color-scheme`. */\n scheme?: 'light' | 'dark'\n /** Its contrast, matched with the system's `prefers-contrast`: `more` for a high-contrast theme. */\n contrast?: 'more' | 'less'\n /** Names it in `nb-theme-select`; the name with a capital otherwise. */\n label?: string\n}\n\nexport interface NbThemeOptions {\n /** The theme to start with, and to fall back on when no declared theme fits the system's preferences. */\n name: string\n /**\n * The app's themes: with nothing chosen, the one that fits the system's colour scheme and contrast is used, shown\n * as \"System\" in `nb-theme-select`.\n */\n themes?: NbThemeDescription[]\n /**\n * Remembers the theme and content size the user chooses, in `NB_PREFERENCE_STORAGE` (`localStorage` by default),\n * under keys starting with `key` (`nb` by default).\n */\n preferences?: boolean | { key?: string }\n}\n\n/**\n * Where the user's theme and content size are kept: `localStorage` by default. Provide your own, e.g. to keep them in\n * the user's profile on a server; its methods may return promises.\n */\nexport interface NbPreferenceStorage {\n /** The kept value; `null` or `undefined` when there's none, as `Storage.getItem` gives it. */\n get(key: string): string | null | undefined | Promise<string | null | undefined>\n /** Keeps a value; `null` clears it, like `Storage.removeItem`. */\n set(key: string, value: string | null): void | Promise<void>\n}\n\n/** Keeps preferences in `localStorage`, where it's available. @internal */\nexport function nbLocalPreferenceStorage(): NbPreferenceStorage {\n const storage = (): Storage | undefined => {\n try {\n return isPlatformBrowser(inject(PLATFORM_ID)) ? globalThis.localStorage : undefined\n } catch {\n return undefined\n }\n }\n const local = storage()\n return {\n get: (key) => {\n try {\n return local?.getItem(key)\n } catch {\n return undefined\n }\n },\n set: (key, value) => {\n try {\n if (value === null) {\n local?.removeItem(key)\n } else {\n local?.setItem(key, value)\n }\n } catch {\n // Storage that's full or blocked keeps nothing.\n }\n }\n }\n}\n\nexport const NB_PREFERENCE_STORAGE = new InjectionToken<NbPreferenceStorage>('Lyra Preference Storage', {\n factory: nbLocalPreferenceStorage\n})\n\nexport const DEFAULT_MEDIA_BREAKPOINTS: NbMediaBreakpoint[] = [\n {\n name: 'xs',\n width: 0\n },\n {\n name: 'is',\n width: 400\n },\n {\n name: 'sm',\n width: 576\n },\n {\n name: 'md',\n width: 768\n },\n {\n name: 'lg',\n width: 992\n },\n {\n name: 'xl',\n width: 1200\n },\n {\n name: 'xxl',\n width: 1400\n },\n {\n name: 'xxxl',\n width: 1600\n }\n]\n\nexport const BUILT_IN_THEMES: NbJSThemeOptions[] = [\n DEFAULT_THEME,\n COSMIC_THEME,\n CORPORATE_THEME,\n DARK_THEME,\n MATERIAL_LIGHT_THEME,\n MATERIAL_DARK_THEME\n]\n\n// The defaults apply when `provideNbTheme()` doesn't set a value, so the theme services work without it.\nexport const NB_THEME_OPTIONS = new InjectionToken<NbThemeOptions>('Lyra Theme Options', {\n factory: () => ({ name: 'default' })\n})\nexport const NB_MEDIA_BREAKPOINTS = new InjectionToken<NbMediaBreakpoint[]>('Lyra Media Breakpoints', {\n factory: () => DEFAULT_MEDIA_BREAKPOINTS\n})\nexport const NB_BUILT_IN_JS_THEMES = new InjectionToken<NbJSThemeOptions[]>('Lyra Built-in JS Themes', {\n factory: () => BUILT_IN_THEMES\n})\nexport const NB_JS_THEMES = new InjectionToken<NbJSThemeOptions[]>('Lyra JS Themes', { factory: () => [] })\n\n/**\n * The browser's window, as a token so tests can replace it. It's `undefined` outside the browser (e.g. when\n * rendering on the server), so code that uses it checks for it; a server app can provide a window of its own.\n */\nexport const NB_WINDOW = new InjectionToken<(Window & typeof globalThis) | undefined>('Window', {\n factory: () => (isPlatformBrowser(inject(PLATFORM_ID)) ? window : undefined)\n})\nexport const NB_DOCUMENT = new InjectionToken<Document>('Document', { factory: () => inject(DOCUMENT) })\n","import { inject, Service } from '@angular/core'\n\nimport { NB_BUILT_IN_JS_THEMES, NB_JS_THEMES } from '../theme.options'\nimport { NbJSThemeOptions } from './js-themes/theme.options'\n\nexport { BUILT_IN_THEMES } from '../theme.options'\n\n/**\n * The JS themes' variables, by theme name; `NbThemeService.getJsTheme` gives the current theme's.\n *\n * It starts with the built-in themes and those `provideNbTheme` adds (`NB_JS_THEMES`), a theme of the same name\n * merged over the built-in one.\n */\n@Service()\nexport class NbJSThemesRegistry {\n\n private themes: Record<string, NbJSThemeOptions> = {}\n\n constructor() {\n const builtInThemes = inject(NB_BUILT_IN_JS_THEMES)\n const newThemes = inject(NB_JS_THEMES) ?? []\n\n const themes = this.combineByNames(newThemes, builtInThemes)\n\n themes.forEach((theme: NbJSThemeOptions) => {\n this.register(theme, theme.name, theme.base)\n })\n }\n\n /**\n * Registers a theme's variables over its base theme's, when the base is registered, replacing a theme of the same\n * name.\n */\n register(config: NbJSThemeOptions, themeName: string, baseTheme?: string) {\n const base = baseTheme && this.has(baseTheme) ? this.get(baseTheme) : {}\n this.themes[themeName] = this.mergeDeep<NbJSThemeOptions>({ name: config.name }, base, config)\n }\n\n has(themeName: string): boolean {\n return !!this.themes[themeName]\n }\n\n /** A copy of the theme, with its base's variables merged in; throws when it isn't registered. */\n get(themeName: string): NbJSThemeOptions {\n if (!this.themes[themeName]) {\n throw Error(`NbThemeConfig: no theme '${themeName}' found registered.`)\n }\n return JSON.parse(JSON.stringify(this.themes[themeName]))\n }\n\n private combineByNames(newThemes: NbJSThemeOptions[], oldThemes: NbJSThemeOptions[]): NbJSThemeOptions[] {\n if (newThemes) {\n const mergedThemes = new Array<NbJSThemeOptions>()\n newThemes.forEach((theme: NbJSThemeOptions) => {\n const sameOld: NbJSThemeOptions = oldThemes.find((tm: NbJSThemeOptions) => tm.name === theme.name) ||\n <NbJSThemeOptions>{}\n\n const mergedTheme = this.mergeDeep({ name: theme.name }, sameOld, theme)\n mergedThemes.push(mergedTheme)\n })\n\n oldThemes.forEach((theme: NbJSThemeOptions) => {\n if (!mergedThemes.find((tm: NbJSThemeOptions) => tm.name === theme.name)) {\n mergedThemes.push(theme)\n }\n })\n return mergedThemes\n }\n return oldThemes\n }\n\n private isObject(item: unknown): item is Record<string, unknown> {\n return !!item && typeof item === 'object' && !Array.isArray(item)\n }\n\n private mergeDeep<T>(target: T, ...sources: unknown[]): T {\n if (!sources.length) {\n return target\n }\n const source = sources.shift()\n\n if (this.isObject(target) && this.isObject(source)) {\n for (const key in source) {\n const value = source[key]\n if (this.isObject(value)) {\n if (!target[key]) {\n Object.assign(target, { [key]: {} })\n }\n this.mergeDeep(target[key], value)\n } else {\n Object.assign(target, { [key]: value })\n }\n }\n }\n return this.mergeDeep(target, ...sources)\n }\n}\n","import { inject, Service } from '@angular/core'\nimport { NB_MEDIA_BREAKPOINTS } from '../theme.options'\n\n/** A media breakpoint: its name (`xs`, `sm`, `md`…) and the width it starts at, in pixels. */\nexport interface NbMediaBreakpoint {\n name: string\n width: number\n}\n\nexport { DEFAULT_MEDIA_BREAKPOINTS } from '../theme.options'\n\n/**\n * Tells which of the configured media breakpoints a width falls in, e.g. 200px is `xs` with the defaults.\n *\n * The breakpoints come from `NB_MEDIA_BREAKPOINTS`, which `provideNbTheme` sets; `DEFAULT_MEDIA_BREAKPOINTS`\n * otherwise.\n */\n@Service()\nexport class NbMediaBreakpointsService {\n private readonly breakpoints = inject(NB_MEDIA_BREAKPOINTS)\n\n private readonly breakpointsMap = this.breakpoints.reduce<{ [breakpoint: string]: number }>((res, b) => {\n res[b.name] = b.width\n return res\n }, {})\n\n /** The breakpoint the width falls in; `unknown`, keeping the width, when none does or there's no width. */\n getByWidth(width?: number): NbMediaBreakpoint {\n // Like getByName('unknown'), an unknown width is NaN.\n const unknown = { name: 'unknown', width: width ?? NaN }\n const breakpoints = this.getBreakpoints()\n\n return breakpoints\n .find((point: NbMediaBreakpoint, index: number) => {\n const next = breakpoints[index + 1]\n return width !== undefined && width >= point.width && (!next || width < next.width)\n }) || unknown\n }\n\n /** The breakpoint with the name; `unknown`, with width `NaN`, when there's none. */\n getByName(name: string): NbMediaBreakpoint {\n const unknown = { name: 'unknown', width: NaN }\n const breakpoints = this.getBreakpoints()\n\n return breakpoints.find((point: NbMediaBreakpoint) => name === point.name) || unknown\n }\n\n /** The configured breakpoints, in the order given: `getByWidth` expects them by ascending width. */\n getBreakpoints(): NbMediaBreakpoint[] {\n return this.breakpoints\n }\n\n /** The width each configured breakpoint starts at, by name. */\n getBreakpointsMap(): { [breakpoint: string]: number } {\n return this.breakpointsMap\n }\n}\n","import { isPlatformBrowser } from '@angular/common'\nimport { DestroyRef, inject, PLATFORM_ID, Service, signal } from '@angular/core'\n\nimport { Observable, ReplaySubject, Subject } from 'rxjs'\nimport { map, filter, pairwise, distinctUntilChanged, startWith, share } from 'rxjs/operators'\n\nimport { NB_DOCUMENT, NB_PREFERENCE_STORAGE, NB_THEME_OPTIONS, NbThemeDescription } from '../theme.options'\nimport { NbJSThemeOptions } from './js-themes/theme.options'\nimport { NbJSThemesRegistry } from './js-themes-registry.service'\nimport { NbMediaBreakpointsService, NbMediaBreakpoint } from './breakpoints.service'\n\n/** How large the content is: the root font size, which everything sized in `rem` follows. */\nexport type NbContentSize = 'small' | 'medium' | 'large' | 'larger'\n\n/** The root font size of each content size; `medium` keeps the browser's own. */\nconst CONTENT_SIZES: Record<NbContentSize, string | undefined> = {\n small: '87.5%',\n medium: undefined,\n large: '112.5%',\n larger: '125%'\n}\n\n/** A theme change: the theme now shown and the one shown before, if any. */\nexport interface NbThemeChange {\n name: string\n previous?: string\n}\n\n/** The theme preference that follows the system's colour scheme and contrast. */\nexport const NB_SYSTEM_THEME = 'system'\n\n/**\n * Keeps the theme shown, which `nb-layout` puts on the body as `nb-theme-<name>`, and gives its JS variables; it also\n * tells which media breakpoint the window's width is in, and relays classes to add to `nb-layout`.\n *\n * It keeps the user's theme and content size too: `setThemePreference` takes a theme's name, or `system` for the\n * declared theme that fits the system's colour scheme and contrast, which it follows as they change, and\n * `setContentSize` scales the root font size. With `preferences` on, both are saved in `NB_PREFERENCE_STORAGE` and\n * restored; `nb-theme-select` and `nb-content-size-switcher` offer them.\n */\n@Service()\nexport class NbThemeService {\n protected readonly options = inject(NB_THEME_OPTIONS)\n private readonly breakpointService = inject(NbMediaBreakpointsService)\n private readonly jsThemesRegistry = inject(NbJSThemesRegistry)\n private readonly document = inject(NB_DOCUMENT)\n private readonly storage = inject(NB_PREFERENCE_STORAGE)\n private readonly browser = isPlatformBrowser(inject(PLATFORM_ID))\n\n /** The theme shown. */\n readonly theme = signal<string>(this.options?.name ?? 'default')\n\n /**\n * The user's theme: a theme's name, or `system` for the declared theme that fits the system's preferences, which\n * it is when the app declares its themes and the user chose none.\n */\n readonly themePreference = signal<string>(\n this.options?.themes?.length ? NB_SYSTEM_THEME : (this.options?.name ?? 'default')\n )\n\n /** How large the content is. */\n readonly contentSize = signal<NbContentSize>('medium')\n\n currentTheme?: string\n private themeChanges$ = new ReplaySubject<NbThemeChange>(1)\n private appendLayoutClass$ = new Subject<string>()\n private removeLayoutClass$ = new Subject<string>()\n private changeWindowWidth$ = new ReplaySubject<number>(2)\n\n constructor() {\n const options = this.options\n\n if (options && options.name) {\n this.changeTheme(options.name)\n }\n this.followSystem()\n this.restorePreferences()\n }\n\n /** Shows a theme by name, without touching the user's preference; `setThemePreference` keeps the choice. */\n changeTheme(name: string) {\n if (name === this.currentTheme) {\n return\n }\n this.themeChanges$.next({ name, previous: this.currentTheme })\n this.currentTheme = name\n this.theme.set(name)\n }\n\n /** The app's declared themes. */\n get themes(): NbThemeDescription[] {\n return this.options?.themes ?? []\n }\n\n /** Shows a theme by the user's choice, or with `system` the one that fits the system's preferences, and keeps it. */\n setThemePreference(preference: string) {\n this.applyThemePreference(preference)\n this.save('theme', preference === NB_SYSTEM_THEME ? null : preference)\n }\n\n /** Sets how large the content is, and keeps it. */\n setContentSize(size: NbContentSize) {\n this.applyContentSize(size)\n this.save('content-size', size === 'medium' ? null : size)\n }\n\n /**\n * The declared theme that fits the system's colour scheme and contrast: a high-contrast theme only when more\n * contrast is asked for; the starting theme without declared themes.\n */\n systemTheme(): string {\n const fallback = this.options?.name ?? 'default'\n if (!this.themes.length || !this.browser || typeof matchMedia !== 'function') {\n return this.themes.find((theme) => theme.name === fallback)?.name ?? this.themes[0]?.name ?? fallback\n }\n const scheme = matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'\n const more = matchMedia('(prefers-contrast: more)').matches\n const score = (theme: NbThemeDescription) =>\n (theme.scheme === scheme ? 2 : theme.scheme ? -2 : 0) + (theme.contrast === 'more' ? (more ? 4 : -8) : 0)\n return this.themes.reduce((best, theme) => (score(theme) > score(best) ? theme : best)).name\n }\n\n protected applyThemePreference(preference: string) {\n this.themePreference.set(preference)\n this.changeTheme(preference === NB_SYSTEM_THEME ? this.systemTheme() : preference)\n }\n\n protected applyContentSize(size: NbContentSize) {\n this.contentSize.set(size)\n const root = this.document?.documentElement\n const fontSize = CONTENT_SIZES[size]\n if (fontSize) {\n root?.style.setProperty('font-size', fontSize)\n } else {\n root?.style.removeProperty('font-size')\n }\n }\n\n /** Follows the system's colour scheme and contrast while the preference is `system`. */\n protected followSystem() {\n if (this.themePreference() === NB_SYSTEM_THEME) {\n this.changeTheme(this.systemTheme())\n }\n if (!this.themes.length || !this.browser || typeof matchMedia !== 'function') {\n return\n }\n const update = () => {\n if (this.themePreference() === NB_SYSTEM_THEME) {\n this.changeTheme(this.systemTheme())\n }\n }\n const queries = ['(prefers-color-scheme: dark)', '(prefers-contrast: more)'].map((query) => matchMedia(query))\n queries.forEach((query) => query.addEventListener('change', update))\n inject(DestroyRef).onDestroy(() => queries.forEach((query) => query.removeEventListener('change', update)))\n }\n\n /** Restores the saved theme and content size, when the app keeps preferences; storage may answer later. */\n protected restorePreferences() {\n if (!this.options?.preferences) {\n return\n }\n const known = (theme: string) =>\n theme === NB_SYSTEM_THEME || !this.themes.length || this.themes.some((declared) => declared.name === theme)\n Promise.resolve(this.storage.get(this.key('theme')))\n .then((theme) => theme && known(theme) && this.applyThemePreference(theme))\n .catch(() => undefined)\n Promise.resolve(this.storage.get(this.key('content-size')))\n .then((size) => size && size in CONTENT_SIZES && this.applyContentSize(size as NbContentSize))\n .catch(() => undefined)\n }\n\n /** Keeps a preference; `null` clears it, as `NbPreferenceStorage.set` takes it. */\n protected save(name: string, value: string | null) {\n if (this.options?.preferences) {\n Promise.resolve(this.storage.set(this.key(name), value)).catch(() => undefined)\n }\n }\n\n protected key(name: string): string {\n const preferences = this.options?.preferences\n const prefix = (typeof preferences === 'object' && preferences.key) || 'nb'\n return `${prefix}-${name}`\n }\n\n /** Called by `nb-layout` with the window's width, which `onMediaQueryChange` follows. */\n changeWindowWidth(width: number) {\n this.changeWindowWidth$.next(width)\n }\n\n /**\n * The current theme's JS variables (colours, paddings…), and each theme's as the theme changes.\n */\n getJsTheme(): Observable<NbJSThemeOptions> {\n return this.onThemeChange().pipe(\n map((theme: NbThemeChange) => this.jsThemesRegistry.get(theme.name))\n )\n }\n\n /**\n * Emits when the window's width enters another media breakpoint, as the previous breakpoint and the current one;\n * the first emission's previous breakpoint is `unknown`.\n * ```ts\n * [{ name: 'xs', width: 0 }, { name: 'md', width: 768 }] // change from `xs` to `md`\n * ```\n */\n onMediaQueryChange(): Observable<NbMediaBreakpoint[]> {\n return this.changeWindowWidth$\n .pipe(\n startWith(undefined),\n pairwise(),\n map(([prevWidth, width]: [number | undefined, number | undefined]) => [\n // Only the first width has no previous one, which resolves to the unknown breakpoint.\n this.breakpointService.getByWidth(prevWidth),\n this.breakpointService.getByWidth(width)\n ] as [NbMediaBreakpoint, NbMediaBreakpoint]),\n filter(([prevPoint, point]: [NbMediaBreakpoint, NbMediaBreakpoint]) => prevPoint.name !== point.name),\n distinctUntilChanged(\n (previous, current) => previous === current,\n (params) => params[0].name + params[1].name\n ),\n share()\n )\n }\n\n /** Emits the theme shown and the one before it, starting with the current theme. */\n onThemeChange(): Observable<NbThemeChange> {\n return this.themeChanges$.pipe(share())\n }\n\n /** Adds a class to the `nb-layout` element. */\n appendLayoutClass(className: string) {\n this.appendLayoutClass$.next(className)\n }\n\n /** The classes `appendLayoutClass` adds, which `nb-layout` applies. */\n onAppendLayoutClass(): Observable<string> {\n return this.appendLayoutClass$.pipe(share())\n }\n\n /** Removes a class from the `nb-layout` element. */\n removeLayoutClass(className: string) {\n this.removeLayoutClass$.next(className)\n }\n\n /** The classes `removeLayoutClass` removes, which `nb-layout` applies. */\n onRemoveLayoutClass(): Observable<string> {\n return this.removeLayoutClass$.pipe(share())\n }\n}\n","import { DestroyRef, inject, PLATFORM_ID, Service, Signal, signal } from '@angular/core'\nimport { isPlatformBrowser } from '@angular/common'\n\nimport { NB_DOCUMENT } from '../theme.options'\n\n/**\n * Counts changes to what the theme's variables on the page come from: the style and classes of the page and its body,\n * e.g. a variable an app sets there, or another theme's class. Components that read the variables in script, such as\n * a chart that draws on a canvas, read them again as it changes. The theme service's changes come with it.\n */\n@Service()\nexport class NbThemeStyleChanges {\n protected readonly count = signal(0)\n readonly changes: Signal<number> = this.count.asReadonly()\n\n constructor() {\n const document = inject(NB_DOCUMENT)\n if (!isPlatformBrowser(inject(PLATFORM_ID)) || typeof MutationObserver === 'undefined') {\n return\n }\n let frame = 0\n const observer = new MutationObserver(() => {\n // Once for the changes of a frame, e.g. many variables set one after another.\n if (!frame) {\n frame = requestAnimationFrame(() => {\n frame = 0\n this.count.update((count) => count + 1)\n })\n }\n })\n for (const element of [document.documentElement, document.body]) {\n observer.observe(element, { attributes: true, attributeFilter: ['style', 'class'] })\n }\n inject(DestroyRef).onDestroy(() => {\n observer.disconnect()\n cancelAnimationFrame(frame)\n })\n }\n}\n","import { inject, Service } from '@angular/core'\nimport { NB_DOCUMENT } from '../theme.options'\n\n/**\n * Shows the page's loading spinner, the element with the id `nb-global-spinner` in `index.html`, until the registered\n * loaders finish.\n *\n * Without such an element, `load` only waits for the loaders.\n */\n@Service()\nexport class NbSpinnerService {\n private readonly document = inject(NB_DOCUMENT)\n\n private loaders = new Array<Promise<unknown>>()\n private selector = 'nb-global-spinner'\n\n /** Adds a promise `load` waits for. */\n registerLoader(method: Promise<unknown>) {\n this.loaders.push(method)\n }\n\n /** Forgets the registered loaders. */\n clear() {\n this.loaders = []\n }\n\n /**\n * Shows the spinner until the registered loaders finish, and hides it whether they succeed or fail: resolves with\n * their values, or rejects with the first failure.\n */\n load(): Promise<unknown[]> {\n this.showSpinner()\n return Promise.all(this.loaders).finally(() => this.hideSpinner())\n }\n\n // The spinner is in index.html, outside the app, so it's shown and hidden through the DOM.\n private showSpinner() {\n const el = this.getSpinnerElement()\n if (el) {\n el.style.display = 'block'\n }\n }\n\n private hideSpinner() {\n const el = this.getSpinnerElement()\n if (el) {\n el.style.display = 'none'\n }\n }\n\n private getSpinnerElement() {\n return this.document.getElementById(this.selector)\n }\n}\n","/** The values of a store: real JavaScript values, as IndexedDB keeps them (structured clone). */\nexport interface NbStoreBackend {\n get(key: string): Promise<unknown>\n has(key: string): Promise<boolean>\n set(key: string, value: unknown): Promise<void>\n delete(key: string): Promise<void>\n keys(): Promise<string[]>\n clear(): Promise<void>\n /** Lets go of the backend's resources, e.g. its database connection. */\n close?(): Promise<void>\n}\n\nconst OBJECT_STORE = 'values'\n\n/** The IndexedDB database of a store, `nb-storage-<name>`, which a web worker can open as well. */\nexport function nbStoreDatabaseName(name: string): string {\n return `nb-storage-${name}`\n}\n\nconst promise = <T>(request: IDBRequest<T>) =>\n new Promise<T>((resolve, reject) => {\n request.onsuccess = () => resolve(request.result)\n request.onerror = () => reject(request.error)\n })\n\n/**\n * A store in IndexedDB: one database per store name, holding its values by key. It has no Angular dependency, so a web\n * worker can read and write the values an app keeps with `declareStorage`.\n */\nexport class NbIndexedDbStore implements NbStoreBackend {\n protected readonly db: Promise<IDBDatabase>\n\n constructor(name: string, factory: IDBFactory = indexedDB) {\n this.db = new Promise((resolve, reject) => {\n const request = factory.open(nbStoreDatabaseName(name), 1)\n request.onupgradeneeded = () => request.result.createObjectStore(OBJECT_STORE)\n request.onsuccess = () => {\n // Another tab's newer version of the database asks this one to let go.\n request.result.onversionchange = () => request.result.close()\n resolve(request.result)\n }\n request.onerror = () => reject(request.error)\n request.onblocked = () => reject(new Error(`The ${nbStoreDatabaseName(name)} database is open in an older version`))\n })\n }\n\n async get(key: string): Promise<unknown> {\n return promise((await this.store('readonly')).get(key))\n }\n\n async has(key: string): Promise<boolean> {\n return (await promise((await this.store('readonly')).count(key))) > 0\n }\n\n async set(key: string, value: unknown): Promise<void> {\n await this.write((store) => store.put(value, key))\n }\n\n async delete(key: string): Promise<void> {\n await this.write((store) => store.delete(key))\n }\n\n async keys(): Promise<string[]> {\n const keys = await promise((await this.store('readonly')).getAllKeys())\n return keys.map(String)\n }\n\n async clear(): Promise<void> {\n await this.write((store) => store.clear())\n }\n\n /** Closes the database; the store can't be used after. */\n async close(): Promise<void> {\n (await this.db).close()\n }\n\n protected async store(mode: IDBTransactionMode): Promise<IDBObjectStore> {\n return (await this.db).transaction(OBJECT_STORE, mode).objectStore(OBJECT_STORE)\n }\n\n // Resolves once the transaction commits, so a value is in the database before other tabs hear of it.\n protected async write(change: (store: IDBObjectStore) => void): Promise<void> {\n const transaction = (await this.db).transaction(OBJECT_STORE, 'readwrite')\n change(transaction.objectStore(OBJECT_STORE))\n await new Promise<void>((resolve, reject) => {\n transaction.oncomplete = () => resolve()\n transaction.onerror = () => reject(transaction.error)\n transaction.onabort = () => reject(transaction.error ?? new Error('The write was aborted'))\n })\n }\n}\n\n/** A store that keeps nothing, used on the server: each request starts from the defaults, and nothing is written. */\nexport class NbNoStore implements NbStoreBackend {\n async get(): Promise<unknown> {\n return undefined\n }\n\n async has(): Promise<boolean> {\n return false\n }\n\n async set(): Promise<void> {}\n\n async delete(): Promise<void> {}\n\n async keys(): Promise<string[]> {\n return []\n }\n\n async clear(): Promise<void> {}\n}\n\n/** A store in memory, for a browser without IndexedDB. Values last as long as the page does. */\nexport class NbMemoryStore implements NbStoreBackend {\n protected readonly values = new Map<string, unknown>()\n\n async get(key: string): Promise<unknown> {\n return this.values.get(key)\n }\n\n async has(key: string): Promise<boolean> {\n return this.values.has(key)\n }\n\n async set(key: string, value: unknown): Promise<void> {\n this.values.set(key, value)\n }\n\n async delete(key: string): Promise<void> {\n this.values.delete(key)\n }\n\n async keys(): Promise<string[]> {\n return [...this.values.keys()]\n }\n\n async clear(): Promise<void> {\n this.values.clear()\n }\n}\n","import { isPlatformBrowser } from '@angular/common'\nimport {\n DestroyRef,\n EnvironmentProviders,\n inject,\n InjectionToken,\n makeEnvironmentProviders,\n PLATFORM_ID,\n Signal,\n signal\n} from '@angular/core'\nimport { Observable, Subject } from 'rxjs'\n\nimport { NbIndexedDbStore, NbMemoryStore, NbNoStore, NbStoreBackend } from './indexed-db-store'\n\n/**\n * The defaults of a storage's keys: required for a key whose value can't be `undefined`, so its signal has a value\n * before the stored one loads, optional for the others.\n */\nexport type NbStorageDefaults<T> = {\n [K in keyof T as undefined extends T[K] ? never : K]-?: T[K];\n} & {\n [K in keyof T as undefined extends T[K] ? K : never]?: T[K];\n}\n\nexport interface NbStorageOptions<T> {\n /** The value of a key that holds none, and of its signal until the stored one loads. */\n defaults: NbStorageDefaults<T>\n /**\n * Turns what's stored for a key into its current shape as it loads, e.g. adding fields a newer version has. What's\n * stored is what an older version of the app wrote, so it's `unknown`.\n */\n migrate?: { [K in keyof T]?: (stored: unknown) => T[K] }\n /**\n * Where the values are kept. By default, IndexedDB in the browser (memory where it's unavailable), and nowhere on the\n * server, so each request renders with the defaults.\n */\n backend?: (name: string) => NbStoreBackend\n}\n\n/** A change to a storage's values, from this tab or another one. */\nexport type NbStorageChange<T> =\n | { [K in keyof T]: { key: K, value: T[K], removed: false, remote: boolean } }[keyof T]\n | { [K in keyof T]: { key: K, value: T[K], removed: true, remote: boolean } }[keyof T]\n | { cleared: true, remote: boolean }\n\n/**\n * A stored value as a signal, shared by everything that reads it: it starts as the key's default, takes the stored\n * value once it loads, and follows changes from other tabs.\n */\nexport type NbStoredSignal<V> = Signal<V> & {\n /** Sets the value now; resolves once it's stored and other tabs have heard of it. */\n set(value: V): Promise<void>\n update(change: (value: V) => V): Promise<void>\n /** Removes the stored value, so the key has its default again. */\n remove(): Promise<void>\n /** Whether the stored value is still loading. */\n readonly loading: Signal<boolean>\n /** The last failure to load or store the value, e.g. a full or unavailable IndexedDB. */\n readonly error: Signal<unknown>\n /** Resolves with the value once it has loaded. */\n readonly loaded: Promise<V>\n}\n\ntype Message = { key: string, value?: unknown, removed?: boolean } | { cleared: true }\n\ninterface Live {\n readonly state: ReturnType<typeof signal<unknown>>\n // Changes since the load started, which the loaded value mustn't overwrite.\n changed: boolean\n}\n\n/**\n * The values of a storage `declareStorage` declares, typed by its key map `T`: read and written by key, or as shared\n * signals, and kept in step with the other tabs.\n */\nexport class NbStorage<T> {\n /** Changes to the values, from this tab and the others. */\n readonly changes: Observable<NbStorageChange<T>>\n\n protected readonly changes$ = new Subject<NbStorageChange<T>>()\n // The signals in use, by key, held weakly: a signal goes once nothing holds it. Their state lives as long as they do.\n protected readonly live = new Map<string, WeakRef<NbStoredSignal<unknown>>>()\n protected readonly states = new WeakMap<NbStoredSignal<unknown>, Live>()\n protected readonly released = new FinalizationRegistry<{ key: string, ref: WeakRef<NbStoredSignal<unknown>> }>(\n ({ key, ref }) => {\n if (this.live.get(key) === ref) {\n this.live.delete(key)\n }\n }\n )\n\n constructor(\n readonly name: string,\n protected readonly options: NbStorageOptions<T>,\n protected readonly backend: NbStoreBackend,\n protected readonly channel?: BroadcastChannel\n ) {\n this.changes = this.changes$.asObservable()\n channel?.addEventListener('message', ({ data }: MessageEvent<Message>) => this.receive(data))\n }\n\n /** The value of a key: what's stored, migrated, or its default. */\n async get<K extends keyof T & string>(key: K): Promise<T[K]> {\n if (!(await this.backend.has(key))) {\n return this.defaultOf(key)\n }\n const stored = await this.backend.get(key)\n const migrate = this.options.migrate?.[key]\n return migrate ? migrate(stored) : (stored as T[K])\n }\n\n /** Stores a value, then tells the other tabs. */\n async set<K extends keyof T & string>(key: K, value: T[K]): Promise<void> {\n this.apply(key, value)\n this.changes$.next({ key, value, removed: false, remote: false } as NbStorageChange<T>)\n await this.backend.set(key, value)\n this.post({ key, value })\n }\n\n /** Removes a key's value, so it has its default again. */\n async remove<K extends keyof T & string>(key: K): Promise<void> {\n const value = this.defaultOf(key)\n this.apply(key, value)\n this.changes$.next({ key, value, removed: true, remote: false } as NbStorageChange<T>)\n await this.backend.delete(key)\n this.post({ key, removed: true })\n }\n\n /** The keys that hold a value. */\n async keys(): Promise<Array<keyof T & string>> {\n return (await this.backend.keys()) as Array<keyof T & string>\n }\n\n /** Removes every value. */\n async clear(): Promise<void> {\n for (const [key] of this.live) {\n this.apply(key, this.defaultOf(key as keyof T & string))\n }\n this.changes$.next({ cleared: true, remote: false })\n await this.backend.clear()\n this.post({ cleared: true })\n }\n\n /**\n * A key's value as a signal. It's shared: everything that asks for the key while it's in use gets the same one, and\n * it's released once nothing holds it.\n */\n signal<K extends keyof T & string>(key: K): NbStoredSignal<T[K]> {\n const existing = this.live.get(key)?.deref()\n if (existing) {\n return existing as NbStoredSignal<T[K]>\n }\n const stored = this.createSignal(key)\n const ref = new WeakRef<NbStoredSignal<unknown>>(stored)\n this.live.set(key, ref)\n this.released.register(stored, { key, ref })\n return stored\n }\n\n /** Stops following the other tabs and closes the backend; the storage can't be used after. */\n destroy() {\n this.channel?.close()\n this.changes$.complete()\n void this.backend.close?.().catch(() => undefined)\n }\n\n protected createSignal<K extends keyof T & string>(key: K): NbStoredSignal<T[K]> {\n const state = signal<unknown>(this.defaultOf(key))\n const loading = signal(true)\n const error = signal<unknown>(undefined)\n const stored = state.asReadonly() as NbStoredSignal<T[K]>\n const live: Live = { state, changed: false }\n this.states.set(stored as NbStoredSignal<unknown>, live)\n const write = (action: Promise<void>) =>\n action.then(\n () => error.set(undefined),\n (failure: unknown) => {\n error.set(failure)\n throw failure\n }\n )\n const loaded = this.get(key).then(\n (value) => {\n if (!live.changed) {\n state.set(value)\n }\n return state() as T[K]\n },\n (failure: unknown) => {\n error.set(failure)\n return state() as T[K]\n }\n )\n void loaded.finally(() => loading.set(false))\n Object.assign(stored, {\n set: (value: T[K]) => write(this.set(key, value)),\n update: (change: (value: T[K]) => T[K]) => write(this.set(key, change(state() as T[K]))),\n remove: () => write(this.remove(key)),\n loading: loading.asReadonly(),\n error: error.asReadonly(),\n loaded\n })\n return stored\n }\n\n // Sets a live signal's value, from a change here or in another tab.\n protected apply(key: string, value: unknown) {\n const stored = this.live.get(key)?.deref()\n const live = stored && this.states.get(stored)\n if (live) {\n live.changed = true\n live.state.set(value)\n }\n }\n\n protected receive(message: Message) {\n if ('cleared' in message) {\n for (const [liveKey] of this.live) {\n this.apply(liveKey, this.defaultOf(liveKey as keyof T & string))\n }\n this.changes$.next({ cleared: true, remote: true })\n return\n }\n const key = message.key as keyof T & string\n const value = message.removed ? this.defaultOf(key) : (message.value as T[typeof key])\n this.apply(key, value)\n this.changes$.next({ key, value, removed: !!message.removed, remote: true } as NbStorageChange<T>)\n }\n\n protected post(message: Message) {\n try {\n this.channel?.postMessage(message)\n } catch {\n // A value BroadcastChannel can't clone is still stored; other tabs read it when they next load it.\n }\n }\n\n protected defaultOf<K extends keyof T>(key: K): T[K] {\n // Each key's default, required where its value can't be undefined; the mapped type hides that from indexing.\n const defaults: Partial<T> = this.options.defaults as unknown as Partial<T>\n return defaults[key] as T[K]\n }\n}\n\n/** What `declareStorage` gives: the providers, a token for the storage, and its keys' signals. */\nexport interface NbStorageDeclaration<T> {\n readonly name: string\n /** The storage, typed by its key map: `inject(appState.token)`. */\n readonly token: InjectionToken<NbStorage<T>>\n /** Provides the storage, e.g. in the app's providers or a lazy route's. */\n readonly providers: EnvironmentProviders\n /**\n * A key's shared signal, in an injection context: `readonly themes = appState.signal('customThemes')`. It isn't a\n * token, which the injector would keep for good; the signal is released once nothing holds it.\n */\n signal<K extends keyof T & string>(key: K): NbStoredSignal<T[K]>\n}\n\n/**\n * Declares a storage of typed values, kept in IndexedDB (so a web worker can open them too), and in step across tabs.\n * An app can have several, e.g. one for its state and one for an API cache:\n *\n * ```ts\n * interface AppState {\n * sidebarOpen: boolean;\n * customThemes: ThemeDraft[];\n * lastSearch?: string;\n * }\n *\n * export const appState = declareStorage<AppState>('app-state', {\n * defaults: { sidebarOpen: true, customThemes: [] },\n * migrate: { customThemes: (stored) => (stored as ThemeDraft[]).map(withNewFields) },\n * });\n *\n * // app.config.ts\n * providers: [appState.providers]\n *\n * // a component\n * readonly themes = appState.signal('customThemes');\n * save(draft: ThemeDraft) {\n * void this.themes.update((themes) => [...themes, draft]);\n * }\n * ```\n */\nexport function declareStorage<T>(name: string, options: NbStorageOptions<T>): NbStorageDeclaration<T> {\n const token = new InjectionToken<NbStorage<T>>(`NbStorage ${name}`)\n return {\n name,\n token,\n providers: makeEnvironmentProviders([\n {\n provide: token,\n useFactory: () => {\n const browser = isPlatformBrowser(inject(PLATFORM_ID))\n // On the server, nothing is kept, so each request renders the defaults.\n const fallback = typeof indexedDB !== 'undefined' ? new NbIndexedDbStore(name) : new NbMemoryStore()\n const backend = options.backend?.(name) ?? (browser ? fallback : new NbNoStore())\n const channel =\n browser && typeof BroadcastChannel !== 'undefined' ? new BroadcastChannel(`nb-storage-${name}`) : undefined\n const storage = new NbStorage<T>(name, options, backend, channel)\n inject(DestroyRef).onDestroy(() => storage.destroy())\n return storage\n }\n }\n ]),\n signal: (key) => inject(token).signal(key)\n }\n}\n","export class NbColorHelper {\n static shade(color: string, weight: number) {\n return NbColorHelper.mix('#000000', color, weight)\n }\n\n static tint(color: string, weight: number) {\n return NbColorHelper.mix('#ffffff', color, weight)\n }\n\n static mix(color1: string, color2: string, weight: number) {\n const d2h = (d: number) => d.toString(16)\n const h2d = (h: string) => parseInt(h, 16)\n\n let result = '#'\n for (let i = 1; i < 7; i += 2) {\n const firstPart = h2d(color1.slice(i, i + 2))\n const secondPart = h2d(color2.slice(i, i + 2))\n const resultPart = d2h(Math.floor(secondPart + (firstPart - secondPart) * (weight / 100.0)))\n result += ('0' + resultPart).slice(-2)\n }\n return result\n }\n\n static hexToRgbA(hex: string, alpha: number | string) {\n if (/^#([A-Fa-f0-9]{3}){1,2}$/.test(hex)) {\n let digits = hex.substring(1).split('')\n if (digits.length === 3) {\n digits = [digits[0], digits[0], digits[1], digits[1], digits[2], digits[2]]\n }\n const c = Number('0x' + digits.join(''))\n return 'rgba(' + [(c >> 16) & 255, (c >> 8) & 255, c & 255].join(',') + ',' + alpha + ')'\n }\n throw new Error('Bad Hex')\n }\n}\n","import { InjectionToken, inject, signal, Service } from '@angular/core'\nimport { Observable, ReplaySubject } from 'rxjs'\nimport { share } from 'rxjs/operators'\n\nexport enum NbLayoutDirection {\n LTR = 'ltr',\n RTL = 'rtl'\n}\n\n/** The layout direction to start with, `ltr` by default; `provideNbTheme` sets it. */\nexport const NB_LAYOUT_DIRECTION = new InjectionToken<NbLayoutDirection>('Layout direction', {\n factory: () => NbLayoutDirection.LTR\n})\n\n/**\n * Keeps the layout direction, `ltr` or `rtl`, which the layout, the overlays and the positions follow.\n *\n * It starts as `NB_LAYOUT_DIRECTION` gives it; `setDirection` changes it at run time.\n */\n@Service()\nexport class NbLayoutDirectionService {\n private readonly directionState = signal(inject(NB_LAYOUT_DIRECTION, { optional: true }) ?? NbLayoutDirection.LTR)\n\n /**\n * The current layout direction; `isLtr()`, `isRtl()` and `getDirection()` read it too, so they're reactive.\n */\n readonly direction = this.directionState.asReadonly()\n\n private $directionChange = new ReplaySubject<NbLayoutDirection>(1)\n\n constructor() {\n this.$directionChange.next(this.direction())\n }\n\n isLtr(): boolean {\n return this.direction() === NbLayoutDirection.LTR\n }\n\n isRtl(): boolean {\n return this.direction() === NbLayoutDirection.RTL\n }\n\n getDirection(): NbLayoutDirection {\n return this.direction()\n }\n\n setDirection(direction: NbLayoutDirection) {\n this.directionState.set(direction)\n this.$directionChange.next(direction)\n }\n\n /** Emits the direction when it changes, starting with the current one. */\n onDirectionChange(): Observable<NbLayoutDirection> {\n return this.$directionChange.pipe(share<NbLayoutDirection>())\n }\n}\n","import { Service } from '@angular/core'\nimport { Observable, Subject, Subscriber } from 'rxjs'\nimport { share } from 'rxjs/operators'\n\n/** How far the layout is scrolled, in pixels. */\nexport interface NbScrollPosition {\n\n /** From the left. */\n x: number\n\n /** From the top. */\n y: number\n}\n\n/**\n * The layout's scroll: its position, its scroll events, and `scrollTo`.\n *\n * The `nb-layout` on the page answers through it, since it scrolls on the body by default and in an element of its\n * own with `withScroll`; code that uses the service needn't know which.\n */\n@Service()\nexport class NbLayoutScrollService {\n\n private scrollPositionReq$ = new Subject<{ listener: Subject<NbScrollPosition> }>()\n private manualScroll$ = new Subject<{ x?: number, y?: number }>()\n private scroll$ = new Subject<Event>()\n private scrollable$ = new Subject<boolean>()\n\n /** The scroll position, once the layout answers; it never emits without a layout on the page. */\n getPosition(): Observable<NbScrollPosition> {\n return new Observable((observer: Subscriber<NbScrollPosition>) => {\n const listener = new Subject<NbScrollPosition>()\n listener.subscribe(observer)\n this.scrollPositionReq$.next({ listener })\n\n return () => listener.complete()\n })\n }\n\n /** Scrolls the layout; a coordinate left out keeps its current value. */\n scrollTo(x?: number, y?: number) {\n this.manualScroll$.next({ x, y })\n }\n\n /** The layout's scroll events. */\n onScroll(): Observable<Event> {\n return this.scroll$.pipe(share())\n }\n\n /**\n * The `scrollTo` requests `nb-layout` carries out.\n *\n * @private\n */\n onManualScroll(): Observable<{ x?: number, y?: number }> {\n return this.manualScroll$.pipe(share())\n }\n\n /**\n * The position requests `nb-layout` answers.\n *\n * @private\n */\n onGetPosition(): Subject<{ listener: Subject<NbScrollPosition> }> {\n return this.scrollPositionReq$\n }\n\n /** Whether the layout may scroll: the block scroll strategy turns it off while a modal overlay is open. */\n onScrollableChange(): Observable<boolean> {\n return this.scrollable$.pipe(share())\n }\n\n /**\n * Called by `nb-layout` with its scroll events.\n *\n * @private\n */\n fireScrollChange(event: Event) {\n this.scroll$.next(event)\n }\n\n /** Blocks or frees the layout's scrolling; `NbBlockScrollStrategyAdapter` calls it. */\n scrollable(scrollable: boolean) {\n this.scrollable$.next(scrollable)\n }\n}\n","import { Service } from '@angular/core'\nimport { Observable, Subject, Subscriber } from 'rxjs'\n\n/**\n * The client and scroll size of the layout's scroll container: `documentElement`, or the layout's own\n * `.scrollable-container` with `withScroll`.\n */\nexport interface NbLayoutDimensions {\n\n clientWidth: number\n\n clientHeight: number\n\n scrollWidth: number\n\n scrollHeight: number\n}\n\n/**\n * Measures the layout's scroll container: `documentElement` by default, or the layout's own `.scrollable-container`\n * with `withScroll`.\n *\n * The `nb-layout` on the page answers the requests, so there's nothing to measure without one.\n */\n@Service()\nexport class NbLayoutRulerService {\n\n private contentDimensionsReq$ = new Subject<{ listener: Subject<NbLayoutDimensions> }>()\n\n /** The dimensions, once the layout answers; it never emits without a layout on the page. */\n getDimensions(): Observable<NbLayoutDimensions> {\n return new Observable((observer: Subscriber<NbLayoutDimensions>) => {\n const listener = new Subject<NbLayoutDimensions>()\n listener.subscribe(observer)\n this.contentDimensionsReq$.next({ listener })\n\n return () => listener.complete()\n })\n }\n\n /**\n * The requests `nb-layout` answers.\n *\n * @private\n */\n onGetDimensions(): Subject<{ listener: Subject<NbLayoutDimensions> }> {\n return this.contentDimensionsReq$\n }\n}\n","import { Service } from '@angular/core'\n\nimport { NbComponentOrCustomStatus, NbComponentStatus } from '../components/component-status'\n\n@Service()\nexport class NbStatusService {\n readonly coreStatuses: NbComponentStatus[] = ['basic', 'primary', 'info', 'warning', 'danger', 'control']\n\n isCoreStatus(status: NbComponentOrCustomStatus): boolean {\n return this.coreStatuses.includes(status as NbComponentStatus)\n }\n\n isCustomStatus(status: NbComponentOrCustomStatus): boolean {\n if (this.isValidStatusString(status)) {\n return !this.isCoreStatus(status)\n }\n\n return false\n }\n\n getStatusClass(status?: NbComponentOrCustomStatus): string | undefined {\n if (this.isValidStatusString(status)) {\n return `status-${status}`\n }\n\n return undefined\n }\n\n protected isValidStatusString(status?: NbComponentOrCustomStatus): boolean {\n return typeof status === 'string' && status.length > 0\n }\n}\n","import { computed, inject, InjectionToken, Provider, Service, Signal, signal } from '@angular/core'\n\nimport type { NbFileDropTexts, NbPaginationTexts, NbSelectTexts, NbTimepickerLocalizationConfig } from '../components/component-texts'\nimport type { NbValidationMessage } from '../components/component-validation'\n\n/** The `$localize` tag of `@angular/localize`, which Lyra's default texts use. */\nexport type NbLocalize = (messageParts: TemplateStringsArray, ...expressions: ReadonlyArray<unknown>) => string\n\n// Lyra's default texts are `$localize` messages, so `ng extract-i18n` finds them and an app's translations apply.\n// When the app doesn't load `@angular/localize`, they're their English text; `@angular/localize/init` replaces this.\n/**\n * Makes a `$localize` message its text: without the id and description before it and the names after its values.\n *\n * @internal\n */\nexport const nbLocalizeFallback: NbLocalize = (messageParts, ...expressions) => {\n const strip = (part: string, raw: string) => {\n if (raw.charAt(0) !== ':') {\n return part\n }\n for (let cooked = 1, index = 1; cooked < part.length; cooked++, index++) {\n if (raw[index] === '\\\\') {\n index++\n } else if (part[cooked] === ':') {\n return part.substring(cooked + 1)\n }\n }\n return part\n }\n let message = strip(messageParts[0], messageParts.raw[0])\n for (let i = 1; i < messageParts.length; i++) {\n message += String(expressions[i - 1]) + strip(messageParts[i], messageParts.raw[i])\n }\n return message\n}\n\nconst scope = globalThis as { $localize?: NbLocalize }\nif (typeof scope.$localize !== 'function') {\n scope.$localize = nbLocalizeFallback\n}\n\n/**\n * The texts of Lyra's components, by component. Other Lyra packages add theirs.\n */\nexport interface NbTexts {\n alert: {\n /** Label of the close button. */\n close: string\n }\n breadcrumbs: {\n /** Names the navigation landmark. */\n label: string\n }\n calendar: {\n /** Label of the button that shows the previous month, year or years. */\n previous: string\n /** Label of the button that shows the next month, year or years. */\n next: string\n /** Heads the week numbers. */\n weekNumber: string\n /** The button that keeps a date and time. */\n apply: string\n /** The button that sets the current time. */\n now: string\n /** Names a datepicker's popup with the calendar. */\n dialog: string\n }\n theme: {\n /** Names the theme select. */\n theme: string\n /** The theme that follows the system's colour scheme and contrast. */\n system: string\n /** Names the content size select. */\n contentSize: string\n small: string\n medium: string\n large: string\n larger: string\n }\n menu: {\n /** Names the button that opens and closes the submenu of an item with its own page, given the item's title. */\n submenu: (title: string) => string\n }\n table: {\n /** Names the checkbox that selects all rows of a table's page. */\n selectAll: string\n /** Names the checkbox that selects a row. */\n selectRow: string\n }\n pageIndicator: {\n /** Names the group of a page indicator's dots. */\n pages: string\n /** Names a page's dot, given the page, from 1, and how many there are. */\n page: (page: number, count: number) => string\n }\n slider: {\n /** Names the start thumb of a range slider, after the slider's own name. */\n start: string\n /** Names the end thumb of a range slider, after the slider's own name. */\n end: string\n }\n confirmDialog: {\n /** The button that confirms, e.g. in `NbDialogService.confirm`. */\n confirm: string\n /** The button that cancels. */\n cancel: string\n }\n chat: {\n /** Shown while there are no messages. */\n noMessages: string\n /** Name of the message list for screen readers, in a chat without a title. */\n messages: string\n /** Placeholder of the message field. */\n messagePlaceholder: string\n /** Placeholder of the message field while files are dragged over it. */\n dropFilePlaceholder: string\n /** Label of the button that removes a dropped file, given its name. */\n removeFile: (name: string) => string\n }\n fileDrop: NbFileDropTexts\n flipCard: {\n /** Label of the button that flips the card. */\n toggle: string\n }\n pagination: NbPaginationTexts\n progressBar: {\n /** Names a progress bar without an `aria-label` of its own. */\n label: string\n }\n revealCard: {\n /** Label of the button that reveals the back of the card. */\n toggle: string\n }\n search: {\n /** Placeholder of the search field. */\n placeholder: string\n /** Shown below the search field. */\n hint: string\n /** Label of the button that opens the search field. */\n open: string\n /** Label of the button that closes the search field. */\n close: string\n }\n select: NbSelectTexts\n spinner: {\n /** Shown with the spinner. */\n message: string\n }\n tag: {\n /** Label of the button that removes a tag outside a tag list, given its text. */\n remove: (text: string) => string\n }\n timepicker: Required<NbTimepickerLocalizationConfig>\n toastr: {\n /** Label of a toast's close button. */\n close: string\n }\n toc: {\n /** Names the navigation landmark. */\n label: string\n }\n treeGrid: {\n /** Label of the button that collapses a row. */\n collapse: string\n /** Label of the button that expands a row. */\n expand: string\n }\n /** Messages for kinds of errors, given the error, e.g. `required` or `minlength`. */\n validation: Record<string, NbValidationMessage>\n user: {\n /** The name shown without one. */\n anonymous: string\n }\n window: {\n /** Label of the button that minimizes the window. */\n minimize: string\n /** Label of the button that restores a minimized window. */\n restore: string\n /** Label of the button that collapses the window. */\n collapse: string\n /** Label of the button that expands the window to full screen. */\n expand: string\n /** Label of the button that closes the window. */\n close: string\n }\n}\n\n/** Texts to change, by component; the others stay as they are. */\nexport type NbTextsOverrides = { [Section in keyof NbTexts]?: Partial<NbTexts[Section]> }\n\nconst NB_TEXTS_OVERRIDES = new InjectionToken<NbTextsOverrides>('Lyra Texts Overrides')\n\n/**\n * The texts Lyra's components show and announce, such as labels, placeholders and messages for screen readers.\n *\n * They're English and translated with Angular's i18n, as `$localize` messages with ids like `@@nb.pagination.next`.\n * `provideNbTexts` changes them for the app or for the components inside one, e.g. for texts an app keeps\n * elsewhere, and `set` changes them at run time.\n */\n@Service()\nexport class NbTextsService {\n protected readonly parent = inject(NbTextsService, { optional: true, skipSelf: true })\n protected readonly own = signal(inject(NB_TEXTS_OVERRIDES, { optional: true }) ?? {})\n\n /** The changed texts, the parent's under these. */\n readonly overrides: Signal<NbTextsOverrides> = computed(() => {\n const parent = this.parent?.overrides() ?? {}\n const own = this.own()\n const merged: Record<string, object> = { ...parent }\n for (const [section, texts] of Object.entries(own)) {\n merged[section] = { ...(merged[section] ?? {}), ...texts }\n }\n return merged as NbTextsOverrides\n })\n\n /** Changes the texts, e.g. when the user picks another language. */\n set(overrides: NbTextsOverrides) {\n this.own.set(overrides)\n }\n}\n\n/**\n * Changes the texts of Lyra's components, for the app or for the components inside the one that provides it:\n *\n * ```ts\n * providers: [provideNbTexts({ pagination: { next: 'Next page' } })]\n * ```\n */\nexport function provideNbTexts(overrides: NbTextsOverrides): Provider[] {\n return [{ provide: NB_TEXTS_OVERRIDES, useValue: overrides }, NbTextsService]\n}\n\n/**\n * The texts of a component: its defaults, which `defaults` makes in the injection context, under the changed ones.\n *\n * @internal\n */\nexport function injectNbTexts<Section extends keyof NbTexts>(\n section: Section,\n defaults: () => NbTexts[Section]\n): Signal<NbTexts[Section]> {\n const service = inject(NbTextsService)\n const base = defaults()\n return computed(() => ({ ...base, ...(service.overrides()[section] ?? {}) }) as NbTexts[Section])\n}\n\n/** Joins names into a list in the app's language, e.g. \"a, b and c\". @internal */\nexport function nbFormatList(locale: string, items: string[]) {\n try {\n return new Intl.ListFormat(locale, { type: 'conjunction' }).format(items)\n } catch {\n return items.join(', ')\n }\n}\n","import { computed, inject, InjectionToken, isSignal, Provider, Signal, signal } from '@angular/core'\n\nimport type { NbAlertAppearance, NbButtonAppearance, NbButtonToggleAppearance, NbSelectAppearance, NbTagAppearance } from './component-appearance'\nimport type { NbComponentShape } from './component-shape'\nimport type { NbComponentSize } from './component-size'\n\n/** Outline or filled icons, as icon packs like Lyra's have most icons in both (`star-outline` and `star`). */\nexport type NbIconStyle = 'outline' | 'filled'\n\n/** Any of the components' appearances; each component has some of them. */\nexport type NbComponentAppearance =\n | NbButtonAppearance\n | NbSelectAppearance\n | NbTagAppearance\n | NbAlertAppearance\n | NbCardAppearance\n | 'outline'\n | 'filled'\n\n/**\n * How a container sits on the page: `outline`, with a border, among other content, or `floating`, with a shadow\n * instead, over the page, e.g. opened from a button.\n */\nexport type NbContainerAppearance = 'outline' | 'floating'\n\n/** A card's appearance: a container's, or `filled`, tinted without a border, e.g. for cards in a card. */\nexport type NbCardAppearance = NbContainerAppearance | 'filled'\n\n/** The shape and size of a control. */\nexport interface NbControlDefaults {\n shape?: NbComponentShape\n size?: NbComponentSize\n}\n\n/**\n * Defaults for the components' `shape`, `size` and `appearance`, which a component's own inputs override. `shape` and\n * `size` at the top apply to the controls (buttons, button groups, fields, selects, tags, checkboxes, radios, toggles,\n * sliders, file drops), `appearance` at the top to each component that has it, and each type's own defaults to that\n * type.\n */\nexport interface NbComponentDefaults extends NbControlDefaults {\n /**\n * The appearance of each component that has it: buttons, button groups, selects, tags, alerts, and the containers\n * (cards, chats, accordions, tables and tree grids), e.g. `outline` for all of them, `hero` for buttons, selects and\n * tags while the others keep their own, or `floating` for the containers. A type's own `appearance` wins.\n */\n appearance?: NbComponentAppearance\n /**\n * Draws icons in one style: an icon named in the other style uses this one where its pack has both, e.g.\n * `star-outline` is drawn as `star` with `filled`, the components' own icons included. Unset, icons are drawn as\n * named.\n */\n iconStyle?: NbIconStyle\n /** `nbButton`, and `nbButtonToggle` outside a group (which has no `hero` appearance). */\n button?: NbControlDefaults & { appearance?: NbButtonAppearance }\n buttonGroup?: NbControlDefaults & { appearance?: NbButtonToggleAppearance }\n /** `nbInput`, and fields like it: the phone input and the colour picker; an autocomplete's options match them. */\n input?: NbControlDefaults\n select?: NbControlDefaults & { appearance?: NbSelectAppearance }\n /** Tags and tag lists; tags are always round. */\n tag?: { size?: NbComponentSize, appearance?: NbTagAppearance }\n checkbox?: { size?: NbComponentSize }\n /** Radios and radio groups. */\n radio?: { size?: NbComponentSize }\n toggle?: { size?: NbComponentSize }\n slider?: { size?: NbComponentSize }\n fileDrop?: NbControlDefaults\n /** Alerts; their size is a height, so the controls' size doesn't apply. */\n alert?: { appearance?: NbAlertAppearance }\n /** Cards; their size is a height, so the controls' size doesn't apply. */\n card?: { appearance?: NbCardAppearance }\n chat?: { appearance?: NbContainerAppearance }\n accordion?: { appearance?: NbContainerAppearance }\n /** Data tables (`nbTable`); one in a card has the card's appearance. */\n table?: { appearance?: NbContainerAppearance }\n /** Tree grids (`nbTreeGrid`); one in a card has the card's appearance. */\n treeGrid?: { appearance?: NbContainerAppearance }\n /** Avatars; the controls' shape and size don't apply. */\n user?: NbControlDefaults\n /**\n * The controls' size doesn't apply; pagination is `small` by default. `edge` is whether its last button lines up its\n * icon with the end of the row (the default), see `NbPaginationComponent.edge`.\n */\n pagination?: { size?: NbComponentSize, edge?: boolean }\n}\n\n/** The types `NbComponentDefaults` has defaults for. */\nexport type NbComponentDefaultsType = Exclude<\n keyof NbComponentDefaults,\n keyof NbControlDefaults | 'appearance' | 'iconStyle'\n>\n\n// The types the controls' shape and size apply to.\nconst CONTROLS: ReadonlySet<NbComponentDefaultsType> = new Set([\n 'button',\n 'buttonGroup',\n 'input',\n 'select',\n 'tag',\n 'checkbox',\n 'radio',\n 'toggle',\n 'slider',\n 'fileDrop'\n])\n\n// The appearances each type has, which the appearance at the top reaches. Toggles outside a group take the buttons'.\nconst APPEARANCES: Partial<Record<NbComponentDefaultsType, ReadonlyArray<NbComponentAppearance>>> = {\n button: ['filled', 'outline', 'ghost', 'hero'],\n buttonGroup: ['filled', 'outline', 'ghost'],\n select: ['outline', 'filled', 'hero', 'ghost'],\n tag: ['filled', 'outline', 'hero'],\n alert: ['filled', 'outline', 'accent'],\n card: ['outline', 'filled', 'floating'],\n chat: ['outline', 'floating'],\n accordion: ['outline', 'floating'],\n table: ['outline', 'floating'],\n treeGrid: ['outline', 'floating']\n}\n\n/** The components' defaults, as a signal, so components follow changes to them. */\nexport const NB_COMPONENT_DEFAULTS = new InjectionToken<Signal<NbComponentDefaults>>('Lyra Component Defaults')\n\nconst NO_DEFAULTS: Signal<NbComponentDefaults> = signal({}).asReadonly()\n\n/**\n * Sets the components' default shape, size, appearance and icon style, e.g. round buttons and large fields across an\n * app, or in one part of it when provided by a component:\n *\n * ```ts\n * providers: [\n * provideNbComponentDefaults({\n * shape: 'semi-round',\n * size: 'large',\n * appearance: 'outline',\n * button: { shape: 'round' },\n * select: { appearance: 'filled' },\n * }),\n * ]\n * ```\n *\n * A component's own inputs still win; defaults provided closer to it override, type by type, the ones further up.\n * Given a signal, e.g. for a setting users change, the components follow it as it changes, without rendering again.\n */\nexport function provideNbComponentDefaults(defaults: NbComponentDefaults | Signal<NbComponentDefaults>): Provider {\n return {\n provide: NB_COMPONENT_DEFAULTS,\n useFactory: () => {\n const parent = inject(NB_COMPONENT_DEFAULTS, { optional: true, skipSelf: true }) ?? NO_DEFAULTS\n return computed(() => mergeDefaults(parent(), isSignal(defaults) ? defaults() : defaults))\n }\n }\n}\n\n/**\n * The defaults of a type, as a signal: its own, then the controls' shape and size where they apply to it, and the\n * appearance at the top where it's one of the type's. It changes only when they do, not when another type's do.\n */\nexport function injectNbDefaults<K extends NbComponentDefaultsType>(\n type: K\n): Signal<NonNullable<NbComponentDefaults[K]>> {\n const defaults = inject(NB_COMPONENT_DEFAULTS, { optional: true }) ?? NO_DEFAULTS\n return computed(\n () => {\n const all = defaults()\n const own = withoutUndefined(all[type] ?? {})\n const appearance = all.appearance && APPEARANCES[type]?.includes(all.appearance) ? all.appearance : undefined\n const merged = {\n ...(CONTROLS.has(type) ? { shape: all.shape, size: all.size } : {}),\n ...(appearance ? { appearance } : {}),\n ...own\n }\n return merged as NonNullable<NbComponentDefaults[K]>\n },\n { equal: shallowEqual }\n )\n}\n\n/** The style icons are drawn in, if the app sets one, as a signal. */\nexport function injectNbIconStyle(): Signal<NbIconStyle | undefined> {\n const defaults = inject(NB_COMPONENT_DEFAULTS, { optional: true }) ?? NO_DEFAULTS\n return computed(() => defaults().iconStyle)\n}\n\nfunction mergeDefaults(parent: NbComponentDefaults, child: NbComponentDefaults): NbComponentDefaults {\n const merged: Record<string, unknown> = { ...parent, ...withoutUndefined(child) }\n for (const [key, value] of Object.entries(child)) {\n const inherited: unknown = parent[key as keyof NbComponentDefaults]\n if (isObject(value) && isObject(inherited)) {\n merged[key] = { ...inherited, ...withoutUndefined(value) }\n }\n }\n return merged as NbComponentDefaults\n}\n\nfunction withoutUndefined<T extends object>(value: T): Partial<T> {\n return Object.fromEntries(Object.entries(value).filter(([, entry]) => entry !== undefined)) as Partial<T>\n}\n\nfunction isObject(value: unknown): value is object {\n return typeof value === 'object' && value !== null\n}\n\nfunction shallowEqual(a: object, b: object): boolean {\n const keys = Object.keys(a) as Array<keyof typeof a>\n return keys.length === Object.keys(b).length && keys.every((key) => a[key] === b[key])\n}\n","import { Platform } from '@angular/cdk/platform'\nimport { Injectable } from '@angular/core'\n\n// Aliases a CDK service, so it stays on @Injectable: a @Service factory can't type the inherited CDK statics.\n@Injectable({\n providedIn: 'root',\n useClass: Platform\n})\nexport class NbPlatform extends Platform {}\n","import { Injectable } from '@angular/core'\nimport { Directionality } from '@angular/cdk/bidi'\n\n// Aliases a CDK service, so it stays on @Injectable: a @Service factory can't type the inherited CDK statics.\n@Injectable({ providedIn: 'root', useExisting: Directionality })\nexport class NbDirectionality extends Directionality {}\n","import { NgModule } from '@angular/core'\nimport { BidiModule } from '@angular/cdk/bidi'\n\n@NgModule({})\nexport class NbBidiModule extends BidiModule {}\n","export * from '@angular/cdk/keycodes'\n\n/**\n * Whether a keydown belongs to an IME composition, e.g. of a Japanese word, rather than to the key it names. Safari\n * fires the keydown of the Enter that ends a composition after `compositionend`, so `isComposing` is false then and\n * only key code 229 tells.\n */\nexport function isComposing(event: KeyboardEvent): boolean {\n // eslint-disable-next-line @typescript-eslint/no-deprecated -- Safari marks the keydown that ends a composition only by key code 229.\n return event.isComposing || event.keyCode === 229\n}\n","export type NbNullableInput = string | null | undefined\nexport type NbBooleanInput = boolean | NbNullableInput\n\n/**\n * Classes as a `[class]` binding takes them: a space-separated string, an array, or an object of class names to flags.\n */\nexport type NbClassInput = string | string[] | Record<string, unknown> | null | undefined\n\nexport function convertToBoolProperty(val: NbBooleanInput): boolean {\n if (typeof val === 'string') {\n val = val.toLowerCase().trim()\n\n return val === 'true' || val === ''\n }\n\n return !!val\n}\n\n/** As `convertToBoolProperty`, but an input that isn't set stays `undefined`, so it can fall back to a default. */\nexport function convertToOptionalBoolProperty(val: NbBooleanInput): boolean | undefined {\n return val === undefined ? undefined : convertToBoolProperty(val)\n}\n\n/**\n * Whether a value written to a control is the one it holds: the same value, or arrays or plain objects, such as a\n * range, with the same items. Writing it again then changes nothing.\n */\nexport function sameControlValue(a: unknown, b: unknown): boolean {\n if (Object.is(a, b)) {\n return true\n }\n if (Array.isArray(a) && Array.isArray(b)) {\n return a.length === b.length && a.every((item, index) => Object.is(item, b[index]))\n }\n if (isPlainObject(a) && isPlainObject(b)) {\n const keys = Object.keys(a)\n return keys.length === Object.keys(b).length && keys.every((key) => Object.is(a[key], b[key]))\n }\n return false\n}\n\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && Object.getPrototypeOf(value) === Object.prototype\n}\n","const running = new WeakMap<HTMLElement, Animation>()\n\n/**\n * How long a height change of `distance` pixels takes: longer for taller content, but less than in proportion, so a\n * long panel opening beside a short one closing doesn't rush, nor drag. About 200ms for 50px, 290ms for 200px and\n * 410ms for 600px, at most 600ms.\n */\nexport function expandDuration(distance: number): number {\n return distance > 0 ? Math.min(600, Math.round(120 + 12 * Math.sqrt(distance))) : 0\n}\n\n/**\n * Animates an element's height to its content height or to 0, after its styles changed to the new state.\n *\n * CSS can't transition to `height: auto`, so the heights are measured: the element's styles hold the end state, and the\n * animation covers the change from the height it had. A change while one is running starts from where it is, so it\n * turns back without a jump. Content that changes size while it opens, e.g. its own parts opening or images loading, is\n * followed to the end the animation was going to have, rather than reached with a jump once it ends. `keep` is held on\n * every frame, e.g. the visibility a collapsed element only gets at the end. Without a `duration`, it takes\n * {@link expandDuration} of the distance. Returns the animation, or nothing where there's none, as with reduced motion.\n */\nexport function animateExpand(\n element: HTMLElement,\n expanded: boolean,\n options: KeyframeAnimationOptions = {},\n keep: Keyframe = {}\n): Animation | undefined {\n if (typeof element.animate !== 'function' || matchMedia('(prefers-reduced-motion: reduce)').matches) {\n return undefined\n }\n\n const previous = running.get(element)\n let from: number\n if (previous) {\n from = element.getBoundingClientRect().height\n previous.cancel()\n } else if (expanded) {\n from = 0\n } else {\n // Measured at the height it had: laid out collapsed, even just to measure, a scroll container around it would\n // drop to its shorter content at once, rather than as it closes.\n const height = element.style.height\n element.style.height = 'auto'\n from = element.scrollHeight\n element.style.height = height\n }\n return run(element, from, expanded ? element.scrollHeight : 0, options, keep)\n}\n\nfunction run(element: HTMLElement, from: number, to: number, options: KeyframeAnimationOptions, keep: Keyframe, elapsed?: number): Animation {\n const animation = element.animate(\n [\n { ...keep, height: `${from}px` },\n { ...keep, height: `${to}px` }\n ],\n { duration: expandDuration(Math.abs(to - from)), ...options }\n )\n // One that takes over from another goes on at once, rather than holding still for the frame a new one waits to start.\n const timelineTime = document.timeline.currentTime\n if (elapsed !== undefined && timelineTime !== null) {\n animation.startTime = Number(timelineTime) - elapsed\n }\n running.set(element, animation)\n\n // The content's size, as it changes while it opens; the element's own height is the animated one. The animation is\n // changed on the next frame: changing layout while the observer reports would make it report again in that frame.\n let frame = 0\n const follow = () => {\n frame = 0\n const target = element.scrollHeight\n if (running.get(element) !== animation || Math.abs(target - to) < 1) {\n return\n }\n const timing = animation.effect?.getComputedTiming()\n const now = Number(animation.currentTime ?? 0)\n const current = element.getBoundingClientRect().height\n animation.cancel()\n if (Number(timing?.progress ?? 0) < 0.15) {\n // Content that settles as it renders, e.g. its own parts appearing: as if it had opened to that height\n // from the start, which this early is only a few pixels from where it is.\n run(element, from, target, options, keep, now)\n } else {\n // On from where it is, to end when this one would have, and without easing in again.\n const remaining = Number(timing?.endTime ?? 0) - now\n run(element, current, target, { ...options, duration: Math.max(remaining, 100), easing: 'ease-out' }, keep, 0)\n }\n }\n const observer = to > from && typeof ResizeObserver === 'function'\n ? new ResizeObserver(() => {\n frame ||= requestAnimationFrame(follow)\n })\n : undefined\n Array.from(element.children).forEach((child) => observer?.observe(child))\n\n animation.onfinish = animation.oncancel = () => {\n observer?.disconnect()\n cancelAnimationFrame(frame)\n if (running.get(element) === animation) {\n running.delete(element)\n }\n }\n return animation\n}\n","const hidden: Keyframe = { opacity: 0, transform: 'scale(0.96)' }\nconst shown: Keyframe = { opacity: 1, transform: 'none' }\n\n/**\n * Fades and scales a pane, a dialog's or a window's, in as it opens, or out before it's removed; the overlay fades the\n * backdrop itself. Resolves when the animation ends, or right away with reduced motion or where elements don't\n * animate (the server).\n */\nexport function animatePane(pane: HTMLElement, opening: boolean): Promise<void> {\n if (\n typeof pane.animate !== 'function' ||\n (typeof matchMedia === 'function' && matchMedia('(prefers-reduced-motion: reduce)').matches)\n ) {\n return Promise.resolve()\n }\n const duration = opening ? 150 : 100\n const animation = pane.animate(opening ? [hidden, shown] : [shown, hidden], {\n duration,\n easing: opening ? 'ease-out' : 'ease-in',\n // Closing holds the end, so the pane doesn't flash back before it's removed.\n fill: opening ? 'none' : 'forwards'\n })\n return new Promise((resolve) => {\n const done = () => resolve()\n animation.finished.then(done, done)\n // A timer too, for clocks an animation doesn't follow, e.g. a test's fake timers.\n setTimeout(done, duration + 50)\n })\n}\n","/**\n * Focuses the control a click landed on, as Chrome and Firefox do. Safari doesn't focus checkboxes, radios and buttons\n * on click, so its users would never blur them, which is what marks a control touched, and they'd show no focus.\n */\nexport function focusOnClick(event: Event) {\n const target = event.currentTarget as HTMLElement | null\n if (target && target !== target.ownerDocument.activeElement) {\n target.focus({ preventScroll: true })\n }\n}\n","import { afterNextRender, inject, NgZone } from '@angular/core'\n\n/**\n * Adds `nb-transition` to an element after its first render, so the styles it renders with don't animate in (#2254).\n * Call it in an injection context.\n */\nexport function enableTransitionsAfterRender(element: HTMLElement) {\n const zone = inject(NgZone)\n afterNextRender(() => zone.runOutsideAngular(() => setTimeout(() => element.classList.add('nb-transition'))))\n}\n"],"mappings":";;;;;;;AAEA,MAAMA,YAAU;CACZ,SAAS;CACT,SAAS;CACT,MAAM;CACN,SAAS;CACT,QAAQ;AACX;AAED,MAAa,gBAAkC;CAC3C,MAAM;CACN,WAAW;EACP,UAAU;EACV,eAAe;EAEf,IAAI;EACJ,KAAK;EACL,KAAK;EACL,KAAK;EAEL,QAAQ;EACR,SAAS;EACT,SAAS;EACT,SAAS;EACT,SAAS;EAET,IAAI;EACJ,WAAW;EACX,QAAQ;EACR,aAAaA,UAAQ;EACrB,UAAU;EACV,WAAW;EAEX,SAASA,UAAQ;EACjB,SAASA,UAAQ;EACjB,MAAMA,UAAQ;EACd,SAASA,UAAQ;EACjB,QAAQA,UAAQ;EAEhB,cAAc;EACd,cAAc;EACd,WAAW;EACX,cAAc;EACd,aAAa;CAChB;AACJ;AC5CD,MAAMC,YAAU;CACZ,SAAS;CACT,SAAS;CACT,MAAM;CACN,SAAS;CACT,QAAQ;AACX;AAED,MAAa,eAAiC;CAC1C,MAAM;CACN,WAAW;EACP,UAAU;EACV,eAAe;EAEf,IAAI;EACJ,KAAK;EACL,KAAK;EACL,KAAK;EAEL,QAAQ;EACR,SAAS;EACT,SAAS;EACT,SAAS;EACT,SAAS;EAET,IAAI;EACJ,WAAW;EACX,QAAQ;EACR,aAAaA,UAAQ;EACrB,UAAU;EACV,WAAW;EAEX,SAASA,UAAQ;EACjB,SAASA,UAAQ;EACjB,MAAMA,UAAQ;EACd,SAASA,UAAQ;EACjB,QAAQA,UAAQ;EAEhB,cAAc;EACd,cAAc;EACd,WAAW;EACX,cAAc;EACd,aAAa;CAChB;AACJ;AC5CD,MAAMC,YAAU;CACZ,SAAS;CACT,SAAS;CACT,MAAM;CACN,SAAS;CACT,QAAQ;AACX;AAED,MAAa,kBAAoC;CAC7C,MAAM;CACN,MAAM;CACN,WAAW;EACP,UAAU;EACV,eAAe;EA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