@anionex/dsh-eye-care 0.1.0 → 0.1.2
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.
- package/CHANGELOG.md +8 -0
- package/README.i18n.yaml +2 -2
- package/README.md +3 -2
- package/README.zh.md +3 -2
- package/lib/client.js +734 -25
- package/lib/client.js.map +1 -1
- package/lib/index.js +3 -1
- package/lib/index.js.map +1 -1
- package/lib/rpc.js +9 -3
- package/lib/rpc.js.map +1 -1
- package/lib/settings.js +12 -2
- package/lib/settings.js.map +1 -1
- package/lib/shared.js +4 -1
- package/lib/shared.js.map +1 -1
- package/lib/transport.js +63 -0
- package/lib/transport.js.map +1 -0
- package/lib/types/client/controller.d.ts +4 -2
- package/lib/types/client/controller.d.ts.map +1 -1
- package/lib/types/client/index.d.ts +1 -1
- package/lib/types/client/index.d.ts.map +1 -1
- package/lib/types/index.d.ts +1 -0
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/rpc.d.ts.map +1 -1
- package/lib/types/settings.d.ts +4 -1
- package/lib/types/settings.d.ts.map +1 -1
- package/lib/types/shared.d.ts +2 -0
- package/lib/types/shared.d.ts.map +1 -1
- package/lib/types/transport.d.ts +6 -0
- package/lib/types/transport.d.ts.map +1 -0
- package/package.json +44 -13
- package/src/client/controller.ts +35 -6
- package/src/client/index.tsx +3 -2
- package/src/index.ts +3 -1
- package/src/rpc.ts +9 -3
- package/src/settings.ts +11 -2
- package/src/shared.ts +5 -1
- package/src/transport.ts +57 -0
package/lib/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","names":["css"],"sources":["../src/client/EyeCareRow.tsx","../src/shared.ts","../src/client/themes.ts","../src/client/controller.ts","../src/client/locales.ts","../src/client/index.tsx"],"sourcesContent":["/** General-settings row for eye-care mode and warmth controls. */\n\nimport type { InjectFace, PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots'\nimport type { EyeCareController } from './controller.ts'\nimport type { EyeCareKey } from './locales.ts'\nimport type { EyeCareIntensity, EyeCareMode } from '../shared.ts'\nimport css from './EyeCareRow.module.css'\n\n/** Injected business face used by the row. */\nexport interface EyeCareRowInjected {\n /** State source. */\n hooks: { eyeCare: EyeCareController['store'] }\n /** Set the selected mode. */\n setMode: (mode: EyeCareMode) => Promise<void>\n /** Set the selected warmth. */\n setIntensity: (intensity: EyeCareIntensity) => Promise<void>\n}\n\n/** Full composed props for the settings slot. */\nexport type EyeCareRowProps = PropsRuntime<'settings.general.item'>\n & PropsLocale<'settings.eyeCare'>\n & InjectFace<EyeCareRowInjected>\n\nconst MODES: readonly { id: EyeCareMode; label: EyeCareKey }[] = [\n { id: 'off', label: 'mode.off' },\n { id: 'auto', label: 'mode.auto' },\n { id: 'light', label: 'mode.light' },\n { id: 'dark', label: 'mode.dark' },\n]\n\nconst INTENSITIES: readonly { id: EyeCareIntensity; label: EyeCareKey }[] = [\n { id: 'soft', label: 'intensity.soft' },\n { id: 'balanced', label: 'intensity.balanced' },\n { id: 'warm', label: 'intensity.warm' },\n]\n\nfunction statusKey(mode: EyeCareMode): EyeCareKey {\n return `status.${mode}` as EyeCareKey\n}\n\n/** Render the feature-owned General settings row. */\nexport function EyeCareRow({ t, useEyeCare, setMode, setIntensity }: EyeCareRowProps) {\n const state = useEyeCare(value => value)\n const busy = state.status === 'loading' || state.status === 'saving'\n const enabled = state.settings.mode !== 'off'\n const status = state.status === 'error' && state.error !== null ? state.error : t(statusKey(state.settings.mode))\n const statusText = state.status === 'unavailable' ? `${status} · ${t('status.local')}` : status\n return (\n <section className={css.row} aria-labelledby=\"dsh-eye-care-title\">\n <div className={css.copy}>\n <h3 id=\"dsh-eye-care-title\" className={css.title}>{t('title')}</h3>\n <p className={css.description}>{t('description')}</p>\n </div>\n <div className={css.controls}>\n <div className={css.primaryLine}>\n <div className={css.controlGroup} role=\"group\" aria-label={t('enabled.title')}>\n <button\n type=\"button\"\n className={`${css.option}${!enabled ? ` ${css.selected}` : ''}`}\n aria-pressed={!enabled}\n disabled={busy}\n onClick={() => { void setMode('off') }}\n >\n {t('enabled.off')}\n </button>\n <button\n type=\"button\"\n className={`${css.option}${enabled ? ` ${css.selected}` : ''}`}\n aria-pressed={enabled}\n disabled={busy}\n onClick={() => { void setMode(state.settings.mode === 'off' ? 'auto' : state.settings.mode) }}\n >\n {t('enabled.on')}\n </button>\n </div>\n </div>\n {enabled ? <details className={css.advanced}>\n <summary>{t('advanced.title')}</summary>\n <div className={css.advancedBody}>\n <div className={css.settingLine}>\n <span className={css.settingLabel}>{t('mode.title')}</span>\n <div className={css.controlGroup} role=\"group\" aria-label={t('mode.title')}>\n {MODES.filter(({ id }) => id !== 'off').map(({ id, label }) => (\n <button\n key={id}\n type=\"button\"\n className={`${css.smallOption}${state.settings.mode === id ? ` ${css.selected}` : ''}`}\n aria-pressed={state.settings.mode === id}\n disabled={busy}\n onClick={() => { void setMode(id) }}\n >\n {t(label)}\n </button>\n ))}\n </div>\n </div>\n <div className={css.settingLine}>\n <span className={css.settingLabel}>{t('intensity.title')}</span>\n <div className={css.controlGroup} role=\"group\" aria-label={t('intensity.title')}>\n {INTENSITIES.map(({ id, label }) => (\n <button\n key={id}\n type=\"button\"\n className={`${css.smallOption}${state.settings.intensity === id ? ` ${css.selected}` : ''}`}\n aria-pressed={state.settings.intensity === id}\n disabled={busy}\n onClick={() => { void setIntensity(id) }}\n >\n {t(label)}\n </button>\n ))}\n </div>\n </div>\n </div>\n </details> : null}\n <div className={css.status} aria-live=\"polite\">\n {state.status === 'saving' ? t('status.saving') : statusText}\n </div>\n </div>\n </section>\n )\n}\n","/** Browser-safe eye-care settings and RPC wire values. */\n\n/** User-selectable eye-care operating modes. */\nexport const EYE_CARE_MODES = ['off', 'auto', 'light', 'dark'] as const\n\n/** Warmth levels shared by light and dark palettes. */\nexport const EYE_CARE_INTENSITIES = ['soft', 'balanced', 'warm'] as const\n\n/** Eye-care operating mode. */\nexport type EyeCareMode = typeof EYE_CARE_MODES[number]\n\n/** Eye-care warmth level. */\nexport type EyeCareIntensity = typeof EYE_CARE_INTENSITIES[number]\n\n/** Settings namespace owned by this package. */\nexport const EYE_CARE_SETTINGS_NAMESPACE = 'eye-care'\n\n/** Loopback-only Connection RPC channel owned by this package. */\nexport const EYE_CARE_RPC_CHANNEL = '/eye-care'\n\n/** RPC endpoint that reads the current settings snapshot. */\nexport const EYE_CARE_RPC_READ = 'settings.read'\n\n/** RPC endpoint that replaces the settings section. */\nexport const EYE_CARE_RPC_SAVE = 'settings.save'\n\n/** Settings field carrying the selected mode. */\nexport const MODE_FIELD = 'mode'\n\n/** Settings field carrying the selected warmth. */\nexport const INTENSITY_FIELD = 'intensity'\n\n/** Defaults used when no user section exists. */\nexport const DEFAULT_EYE_CARE_SETTINGS: Readonly<EyeCareSettings> = Object.freeze({\n mode: 'off',\n intensity: 'balanced',\n})\n\n/** Persisted eye-care preferences. */\nexport interface EyeCareSettings {\n /** Whether eye care is disabled, system-aware, light, or dark. */\n mode: EyeCareMode\n /** Warmth applied by the active eye-care palette. */\n intensity: EyeCareIntensity\n}\n\n/** Browser-safe Host snapshot returned through the loopback RPC channel. */\nexport interface EyeCareSettingsSnapshot {\n /** Wire schema version for this dedicated endpoint. */\n schemaVersion: 1\n /** Whether the active settings provider accepts writes. */\n writable: boolean\n /** Resolved settings and the revision fencing the next write. */\n settings: {\n value: EyeCareSettings\n revision: number\n applies: 'live'\n }\n /** Durable built-in Appearance preference used to fence startup convergence. */\n baseThemePreference?: 'light' | 'dark' | 'system'\n}\n\n/** Revision-fenced write request. */\nexport interface EyeCareSettingsWriteRequest {\n expectedRevision: number\n value: EyeCareSettings\n}\n\n/** Narrow an unknown value to one supported mode. */\nexport function isEyeCareMode(value: unknown): value is EyeCareMode {\n return EYE_CARE_MODES.some(mode => mode === value)\n}\n\n/** Narrow an unknown value to one supported warmth. */\nexport function isEyeCareIntensity(value: unknown): value is EyeCareIntensity {\n return EYE_CARE_INTENSITIES.some(intensity => intensity === value)\n}\n\n/** Decode a complete settings value from the RPC boundary. */\nexport function decodeEyeCareSettings(value: unknown): EyeCareSettings | undefined {\n if (typeof value !== 'object' || value === null || Array.isArray(value)) return undefined\n const record = value as Record<string, unknown>\n if (!isEyeCareMode(record[MODE_FIELD]) || !isEyeCareIntensity(record[INTENSITY_FIELD])) return undefined\n return { mode: record[MODE_FIELD], intensity: record[INTENSITY_FIELD] }\n}\n\n/** Decode one complete Host snapshot from the RPC boundary. */\nexport function decodeEyeCareSnapshot(value: unknown): EyeCareSettingsSnapshot | undefined {\n if (typeof value !== 'object' || value === null || Array.isArray(value)) return undefined\n const record = value as Record<string, unknown>\n const settingsEnvelope = record['settings']\n if (record['schemaVersion'] !== 1 || typeof record['writable'] !== 'boolean'\n || typeof settingsEnvelope !== 'object' || settingsEnvelope === null || Array.isArray(settingsEnvelope)) return undefined\n const settingsRecord = settingsEnvelope as Record<string, unknown>\n const settings = decodeEyeCareSettings(settingsRecord['value'])\n const revision = settingsRecord['revision']\n if (settings === undefined || !Number.isSafeInteger(revision) || (revision as number) < 0\n || settingsRecord['applies'] !== 'live') return undefined\n const baseThemePreference = record['baseThemePreference']\n if (baseThemePreference !== undefined\n && baseThemePreference !== 'light' && baseThemePreference !== 'dark' && baseThemePreference !== 'system') return undefined\n return {\n schemaVersion: 1,\n writable: record['writable'],\n settings: {\n value: settings,\n revision: revision as number,\n applies: 'live',\n },\n ...(baseThemePreference === undefined ? {} : { baseThemePreference }),\n }\n}\n","/** Fixed eye-care themes built from semantic DSH Web tokens. */\n\nimport type { ThemeDefinition, ThemeTokens } from '@deepseek-ai/dsh-client-ui-theme/client'\nimport type { EyeCareIntensity } from '../shared.ts'\n\n/** Theme id prefix reserved by this package. */\nexport const EYE_CARE_THEME_PREFIX = 'eye-care-'\n\ntype Scheme = 'light' | 'dark'\n\ninterface Palette {\n bgBase: string\n bgLayer1: string\n bgLayer2: string\n bgLayer3: string\n bgModule: string\n bgOverlay: string\n textPrimary: string\n textSecondary: string\n textTertiary: string\n textCaption: string\n border1: string\n border2: string\n border3: string\n hover: string\n hoverSolid: string\n active: string\n primaryFill: string\n primaryHover: string\n primaryDimmed: string\n bubble: string\n bubbleHighlight: string\n input: string\n selector: string\n sidebar: string\n sidebarHover: string\n sidebarActive: string\n sidebarAccent: string\n code: string\n codeBanner: string\n inlineCode: string\n scrollbar: string\n scrollbarHover: string\n shiki: {\n constant: string\n string: string\n comment: string\n keyword: string\n parameter: string\n function: string\n stringExpression: string\n punctuation: string\n link: string\n }\n}\n\nconst LIGHT: Record<EyeCareIntensity, Palette> = {\n soft: {\n bgBase: '#fbf8ef', bgLayer1: '#fffdf6', bgLayer2: '#f8f3e8', bgLayer3: '#f2ecde',\n bgModule: '#f7f2e7', bgOverlay: '#ece4d5', textPrimary: '#29271f', textSecondary: '#575247',\n textTertiary: '#716a5d', textCaption: '#958b7a', border1: 'rgba(85, 72, 46, 0.08)',\n border2: 'rgba(85, 72, 46, 0.15)', border3: 'rgba(85, 72, 46, 0.21)',\n hover: 'rgba(126, 101, 53, 0.08)', hoverSolid: '#f1eadc', active: 'rgba(126, 101, 53, 0.14)',\n primaryFill: '#44583d', primaryHover: '#536a49', primaryDimmed: '#dfe6d9',\n bubble: '#eef3df', bubbleHighlight: '#e0e9cb', input: '#fffdf6', selector: '#f2ecde',\n sidebar: '#f4efe3', sidebarHover: '#ebe4d5', sidebarActive: '#e2dac9', sidebarAccent: '#d6e0c1',\n code: '#f2eee4', codeBanner: '#ebe5d8', inlineCode: '#eee8db', scrollbar: '#d1c6b4',\n scrollbarHover: '#baad98',\n shiki: {\n constant: '#176f88', string: '#34783c', comment: '#817768', keyword: '#a03e58',\n parameter: '#a15b1f', function: '#6950a6', stringExpression: '#2f7040', punctuation: '#5a554d', link: '#246d9a',\n },\n },\n balanced: {\n bgBase: '#faf5e8', bgLayer1: '#fffaf0', bgLayer2: '#f5eddd', bgLayer3: '#eee3d0',\n bgModule: '#f3ead9', bgOverlay: '#e7dbc7', textPrimary: '#2b281f', textSecondary: '#5b5345',\n textTertiary: '#766d5b', textCaption: '#9b8e77', border1: 'rgba(93, 72, 36, 0.09)',\n border2: 'rgba(93, 72, 36, 0.17)', border3: 'rgba(93, 72, 36, 0.24)',\n hover: 'rgba(139, 100, 37, 0.09)', hoverSolid: '#eee3d1', active: 'rgba(139, 100, 37, 0.16)',\n primaryFill: '#425b3c', primaryHover: '#52704a', primaryDimmed: '#dce7d3',\n bubble: '#eaf1d5', bubbleHighlight: '#dce7bc', input: '#fffaf0', selector: '#eee3d0',\n sidebar: '#f1e8d7', sidebarHover: '#e7dcc8', sidebarActive: '#ddd0b9', sidebarAccent: '#d2dfb3',\n code: '#efe9dc', codeBanner: '#e6dece', inlineCode: '#ebe2d1', scrollbar: '#ccbda6',\n scrollbarHover: '#b3a188',\n shiki: {\n constant: '#146d87', string: '#39753b', comment: '#837664', keyword: '#a13e57',\n parameter: '#a1581c', function: '#684ba3', stringExpression: '#34703d', punctuation: '#5d5549', link: '#206c98',\n },\n },\n warm: {\n bgBase: '#f8efda', bgLayer1: '#fff7e7', bgLayer2: '#f2e6d0', bgLayer3: '#eadcc4',\n bgModule: '#f0e3cc', bgOverlay: '#e1d0b5', textPrimary: '#30291f', textSecondary: '#615343',\n textTertiary: '#7c6a56', textCaption: '#a08b70', border1: 'rgba(105, 73, 30, 0.10)',\n border2: 'rgba(105, 73, 30, 0.19)', border3: 'rgba(105, 73, 30, 0.27)',\n hover: 'rgba(151, 97, 27, 0.10)', hoverSolid: '#eadbc2', active: 'rgba(151, 97, 27, 0.18)',\n primaryFill: '#3f5c39', primaryHover: '#506f46', primaryDimmed: '#d8e5ce',\n bubble: '#e6efc9', bubbleHighlight: '#d6e3ac', input: '#fff7e7', selector: '#eadcc4',\n sidebar: '#eee1ca', sidebarHover: '#e3d3b9', sidebarActive: '#d7c4a7', sidebarAccent: '#cedeaa',\n code: '#ece2d1', codeBanner: '#e2d5c0', inlineCode: '#e7dac4', scrollbar: '#c7b398',\n scrollbarHover: '#ad9779',\n shiki: {\n constant: '#116b83', string: '#3e7439', comment: '#85735e', keyword: '#a33b54',\n parameter: '#a25418', function: '#67459e', stringExpression: '#386d39', punctuation: '#625344', link: '#1c6b94',\n },\n },\n}\n\nconst DARK: Record<EyeCareIntensity, Palette> = {\n soft: {\n bgBase: '#20211c', bgLayer1: '#25261f', bgLayer2: '#2a2b23', bgLayer3: '#313128',\n bgModule: '#2d2e26', bgOverlay: '#3a392e', textPrimary: '#ece9dc', textSecondary: '#c7c1b0',\n textTertiary: '#aaa28f', textCaption: '#7f786a', border1: 'rgba(245, 233, 201, 0.07)',\n border2: 'rgba(245, 233, 201, 0.13)', border3: 'rgba(245, 233, 201, 0.19)',\n hover: 'rgba(244, 227, 182, 0.08)', hoverSolid: '#36362c', active: 'rgba(244, 227, 182, 0.14)',\n primaryFill: '#dfe9cf', primaryHover: '#f1f5e7', primaryDimmed: '#4d5143',\n bubble: '#30372a', bubbleHighlight: '#3d4933', input: '#2b2d25', selector: '#37382e',\n sidebar: '#252820', sidebarHover: '#30342a', sidebarActive: '#3a3e32', sidebarAccent: '#3f4b35',\n code: '#1c1e1b', codeBanner: '#252821', inlineCode: '#292c24', scrollbar: '#57584d',\n scrollbarHover: '#707064',\n shiki: {\n constant: '#68b7d2', string: '#91c88b', comment: '#9d988d', keyword: '#e39aaf',\n parameter: '#e6ad72', function: '#b9a5df', stringExpression: '#9bcf91', punctuation: '#c7c2b7', link: '#77b8d9',\n },\n },\n balanced: {\n bgBase: '#211f19', bgLayer1: '#27231c', bgLayer2: '#2d2921', bgLayer3: '#353027',\n bgModule: '#302b22', bgOverlay: '#40382b', textPrimary: '#efe7d6', textSecondary: '#cbc0aa',\n textTertiary: '#aea087', textCaption: '#837662', border1: 'rgba(250, 230, 190, 0.08)',\n border2: 'rgba(250, 230, 190, 0.15)', border3: 'rgba(250, 230, 190, 0.21)',\n hover: 'rgba(247, 216, 157, 0.09)', hoverSolid: '#3b352b', active: 'rgba(247, 216, 157, 0.16)',\n primaryFill: '#e0ebcf', primaryHover: '#f2f7e6', primaryDimmed: '#505243',\n bubble: '#32392a', bubbleHighlight: '#404c32', input: '#302b23', selector: '#3b352a',\n sidebar: '#282820', sidebarHover: '#33342a', sidebarActive: '#3d3e32', sidebarAccent: '#435036',\n code: '#1d1d19', codeBanner: '#28251f', inlineCode: '#2d2922', scrollbar: '#5b584b',\n scrollbarHover: '#757062',\n shiki: {\n constant: '#69b8d0', string: '#94c985', comment: '#a19a8d', keyword: '#e49aad',\n parameter: '#e7aa6c', function: '#bca2df', stringExpression: '#9dcc89', punctuation: '#cbc2b2', link: '#79b9d5',\n },\n },\n warm: {\n bgBase: '#231e17', bgLayer1: '#2a231b', bgLayer2: '#31291f', bgLayer3: '#3a3025',\n bgModule: '#342b21', bgOverlay: '#46392b', textPrimary: '#f1e4cf', textSecondary: '#cdbb9f',\n textTertiary: '#b09a7e', textCaption: '#857058', border1: 'rgba(255, 225, 177, 0.09)',\n border2: 'rgba(255, 225, 177, 0.17)', border3: 'rgba(255, 225, 177, 0.24)',\n hover: 'rgba(252, 207, 136, 0.10)', hoverSolid: '#403529', active: 'rgba(252, 207, 136, 0.18)',\n primaryFill: '#e1ebcc', primaryHover: '#f3f7e4', primaryDimmed: '#535143',\n bubble: '#353a28', bubbleHighlight: '#444d30', input: '#342a20', selector: '#403428',\n sidebar: '#2b271e', sidebarHover: '#363127', sidebarActive: '#413a2e', sidebarAccent: '#485235',\n code: '#1f1b17', codeBanner: '#2b241d', inlineCode: '#31281f', scrollbar: '#605548',\n scrollbarHover: '#7a6b5b',\n shiki: {\n constant: '#6ab9ce', string: '#98c87e', comment: '#a59a89', keyword: '#e696a8',\n parameter: '#e8a765', function: '#bea0dc', stringExpression: '#a0cb82', punctuation: '#cec0ad', link: '#7bb9d1',\n },\n },\n}\n\n/** Build the stable id for one concrete eye-care theme. */\nexport function eyeCareThemeId(scheme: Scheme, intensity: EyeCareIntensity): string {\n return `${EYE_CARE_THEME_PREFIX}${scheme}-${intensity}`\n}\n\nfunction tokensOf(palette: Palette): ThemeTokens {\n return Object.freeze({\n '--dsw-alias-bg-base': palette.bgBase,\n '--dsw-alias-bg-layer-1': palette.bgLayer1,\n '--dsw-alias-bg-layer-2': palette.bgLayer2,\n '--dsw-alias-bg-layer-3': palette.bgLayer3,\n '--dsw-alias-bg-module-platform': palette.bgModule,\n '--dsw-alias-bg-multi-select': palette.bgModule,\n '--dsw-alias-bg-overlay': palette.bgOverlay,\n '--dsw-alias-bg-skeleton': palette.hover,\n '--dsw-alias-border-l1': palette.border1,\n '--dsw-alias-border-l2-darkmode-thin': palette.border2,\n '--dsw-alias-border-l2': palette.border2,\n '--dsw-alias-border-l3': palette.border3,\n '--dsw-alias-border-l4': palette.border3,\n '--dsw-alias-brand-primary': palette.textPrimary,\n '--dsw-alias-brand-text': palette.textPrimary,\n '--dsw-alias-button-contrast-fill': palette.textSecondary,\n '--dsw-alias-button-elevated-fill': palette.bgLayer3,\n '--dsw-alias-button-floating-fill': palette.bgLayer2,\n '--dsw-alias-button-floating-hover': palette.hoverSolid,\n '--dsw-alias-button-ghost-active-border': palette.textCaption,\n '--dsw-alias-button-ghost-active-fill': palette.active,\n '--dsw-alias-button-ghost-active-hover': palette.hoverSolid,\n '--dsw-alias-button-primary-fill': palette.primaryFill,\n '--dsw-alias-button-primary-hover': palette.primaryHover,\n '--dsw-alias-button-primary-dimmed': palette.primaryDimmed,\n '--dsw-alias-interactive-bg-active': palette.active,\n '--dsw-alias-interactive-bg-hover-accent': palette.active,\n '--dsw-alias-interactive-bg-hover': palette.hover,\n '--dsw-alias-interactive-bg-hover-solid': palette.hoverSolid,\n '--dsw-alias-label-caption': palette.textCaption,\n '--dsw-alias-label-dimmed': palette.border3,\n '--dsw-alias-label-primary-bluish': palette.textPrimary,\n '--dsw-alias-label-primary-dimmed': palette.textPrimary,\n '--dsw-alias-label-primary': palette.textPrimary,\n '--dsw-alias-label-secondary': palette.textSecondary,\n '--dsw-alias-label-tertiary': palette.textTertiary,\n '--dsw-alias-markdown-citation': palette.hoverSolid,\n '--dsw-alias-markdown-code-block-banner': palette.codeBanner,\n '--dsw-alias-markdown-code-block': palette.code,\n '--dsw-alias-markdown-code-segment-selected': palette.bgLayer3,\n '--dsw-alias-markdown-code-segment-unselected': palette.code,\n '--dsw-alias-markdown-inline-code': palette.inlineCode,\n '--dsw-alias-markdown-placeholder': palette.bgModule,\n '--dsw-alias-markdown-tag': palette.hoverSolid,\n '--dsw-alias-scrollbar-bg-l1': palette.scrollbar,\n '--dsw-alias-scrollbar-bg-l2': palette.scrollbar,\n '--dsw-alias-scrollbar-hover-l1': palette.scrollbarHover,\n '--dsw-alias-scrollbar-hover-l2': palette.scrollbarHover,\n '--dsw-specific-bubble-highlight': palette.bubbleHighlight,\n '--dsw-specific-bubble': palette.bubble,\n '--dsw-specific-input-major': palette.input,\n '--dsw-specific-login-input': palette.bgLayer2,\n '--dsw-specific-menu': palette.bgLayer3,\n '--dsw-specific-selector': palette.selector,\n '--dsw-specific-sidebar-fill': palette.sidebar,\n '--dsw-specific-sidebar-nav-item-active-accent': palette.sidebarAccent,\n '--dsw-specific-sidebar-nav-item-active': palette.sidebarActive,\n '--dsw-specific-sidebar-nav-item-hover': palette.sidebarHover,\n '--dsw-specific-tip': palette.bgModule,\n '--shiki-foreground': palette.textPrimary,\n '--shiki-background': palette.code,\n '--shiki-token-constant': palette.shiki.constant,\n '--shiki-token-string': palette.shiki.string,\n '--shiki-token-comment': palette.shiki.comment,\n '--shiki-token-keyword': palette.shiki.keyword,\n '--shiki-token-parameter': palette.shiki.parameter,\n '--shiki-token-function': palette.shiki.function,\n '--shiki-token-string-expression': palette.shiki.stringExpression,\n '--shiki-token-punctuation': palette.shiki.punctuation,\n '--shiki-token-link': palette.shiki.link,\n })\n}\n\n/** Six concrete themes registered for the two schemes and three warmth levels. */\nexport const EYE_CARE_THEMES: readonly ThemeDefinition[] = Object.freeze(\n (['light', 'dark'] as const).flatMap(scheme =>\n (['soft', 'balanced', 'warm'] as const).map(intensity => Object.freeze({\n id: eyeCareThemeId(scheme, intensity),\n colorScheme: scheme,\n tokens: tokensOf((scheme === 'light' ? LIGHT : DARK)[intensity]),\n }))),\n)\n\nconst EYE_CARE_THEME_IDS = new Set(EYE_CARE_THEMES.map(theme => theme.id))\n\n/** Whether a theme id is one of this package's registered concrete themes. */\nexport function isEyeCareThemeId(id: string): boolean {\n return EYE_CARE_THEME_IDS.has(id)\n}\n","/** Eye-care state owner: durable settings synchronization plus theme lifecycle. */\n\nimport type { ClientConnectionRpc } from '@deepseek-ai/dsh-client-connection/client'\nimport { createSnapshotStore, type SnapshotStore } from '@deepseek-ai/dsh-client-runtime/client'\nimport type { ThemeRuntime, ThemeSnapshot } from '@deepseek-ai/dsh-client-ui-theme/client'\nimport {\n DEFAULT_EYE_CARE_SETTINGS,\n decodeEyeCareSnapshot,\n EYE_CARE_RPC_CHANNEL,\n EYE_CARE_RPC_READ,\n EYE_CARE_RPC_SAVE,\n type EyeCareIntensity,\n type EyeCareMode,\n type EyeCareSettings,\n type EyeCareSettingsSnapshot,\n} from '../shared.ts'\nimport {\n EYE_CARE_THEMES,\n eyeCareThemeId,\n isEyeCareThemeId,\n} from './themes.ts'\n\n/** State consumed by the General-settings row. */\nexport interface EyeCareState {\n /** Current eye-care selection. */\n settings: EyeCareSettings\n /** Persistence lifecycle. */\n status: 'loading' | 'ready' | 'saving' | 'unavailable' | 'error'\n /** Whether the Host settings document can be written. */\n writable: boolean\n /** Host namespace revision for the next write. */\n revision: number | undefined\n /** User-facing read or write failure, when one stands. */\n error: string | null\n}\n\n/** Inputs isolated for deterministic controller tests. */\nexport interface EyeCareControllerOptions {\n /** DSH theme registry. */\n theme: Pick<ThemeRuntime, 'getTheme' | 'setTheme' | 'register'>\n /** Snapshot change subscription. */\n subscribeTheme(listener: (snapshot: ThemeSnapshot) => void): () => void\n /** Loopback-only Connection RPC; absent remote browsers stay process-local. */\n rpc?: ClientConnectionRpc\n /** System dark-mode sensor. */\n media?: MediaQueryList\n /** Monotonic wall-clock source used only by the one-shot startup adoption fence. */\n now?: () => number\n}\n\nconst INITIAL_STATE: EyeCareState = {\n settings: { ...DEFAULT_EYE_CARE_SETTINGS },\n status: 'loading',\n writable: false,\n revision: undefined,\n error: null,\n}\n\n/** Maximum delay accepted for ui-theme's already-started Host adoption. */\nconst STARTUP_BASE_THEME_GRACE_MS = 1000\n\nfunction sameSettings(left: EyeCareSettings, right: EyeCareSettings): boolean {\n return left.mode === right.mode && left.intensity === right.intensity\n}\n\nfunction messageOf(error: unknown): string {\n return error instanceof Error ? error.message : String(error)\n}\n\n/** Stateful controller shared by theme listeners and the Settings row. */\nexport class EyeCareController {\n /** Reactive row source. */\n readonly store: SnapshotStore<EyeCareState> = createSnapshotStore(INITIAL_STATE)\n\n private readonly theme: EyeCareControllerOptions['theme']\n private readonly rpc: ClientConnectionRpc | undefined\n private readonly media: MediaQueryList | undefined\n private readonly now: () => number\n private readonly unregisterThemes: Array<() => void> = []\n private unsubscribeTheme: (() => void) | undefined\n private unsubscribeMedia: (() => void) | undefined\n private tail: Promise<void> = Promise.resolve()\n private disposeTask: Promise<void> | undefined\n private pendingSettings: EyeCareSettings | undefined\n private disposed = false\n private applyingTheme = 0\n private restoreTheme = 'system'\n private hasRestoreTheme = false\n private acceptedRemoteSnapshot = false\n private startupBaseTheme: 'light' | 'dark' | 'system' | undefined\n private startupBaseThemeDeadline = 0\n\n /**\n * Register the concrete themes and lifecycle listeners.\n * @param options - theme, transport, and system-scheme collaborators.\n */\n constructor(options: EyeCareControllerOptions) {\n this.theme = options.theme\n this.rpc = options.rpc\n this.now = options.now ?? Date.now\n this.media = options.media ?? (typeof matchMedia === 'function' ? matchMedia('(prefers-color-scheme: dark)') : undefined)\n const currentTheme = this.theme.getTheme().preference\n if (!isEyeCareThemeId(currentTheme)) {\n this.restoreTheme = currentTheme\n this.hasRestoreTheme = true\n }\n try {\n for (const definition of EYE_CARE_THEMES) {\n this.unregisterThemes.push(this.theme.register(definition))\n }\n this.unsubscribeTheme = options.subscribeTheme(snapshot => { this.onThemeChanged(snapshot) })\n if (this.media !== undefined) {\n const media = this.media\n const listener = (): void => {\n if (!this.disposed && this.store.getSnapshot().settings.mode === 'auto') this.applyCurrentTheme()\n }\n media.addEventListener('change', listener)\n this.unsubscribeMedia = () => { media.removeEventListener('change', listener) }\n }\n } catch (error) {\n for (const unregister of this.unregisterThemes.splice(0).reverse()) unregister()\n throw error\n }\n }\n\n /**\n * Load durable settings without blocking plugin activation.\n * @returns settlement after this read reaches the serialized transport queue.\n */\n load(): Promise<void> {\n if (this.rpc === undefined) {\n this.setUnavailable()\n return Promise.resolve()\n }\n if (this.store.getSnapshot().revision === undefined) {\n this.store.update(state => {\n state.status = 'loading'\n state.error = null\n })\n }\n return this.enqueue(async () => { await this.readRemote() })\n }\n\n /**\n * Select a mode and persist the latest selection when Host settings are writable.\n * @param mode - next operating mode.\n * @returns settlement after the serialized persistence attempt.\n */\n setMode(mode: EyeCareMode): Promise<void> {\n return this.select({ ...this.store.getSnapshot().settings, mode })\n }\n\n /**\n * Select a warmth and persist the latest selection when Host settings are writable.\n * @param intensity - next warmth level.\n * @returns settlement after the serialized persistence attempt.\n */\n setIntensity(intensity: EyeCareIntensity): Promise<void> {\n return this.select({ ...this.store.getSnapshot().settings, intensity })\n }\n\n /** Queue a refresh after a Host settings invalidation. */\n refresh(): void {\n void this.load()\n }\n\n /**\n * Reach transport quiescence, restore the user's live non-eye-care theme, and unregister all resources.\n * @returns settlement after cleanup completes.\n */\n dispose(): Promise<void> {\n return this.disposeTask ??= this.disposeOnce()\n }\n\n private async disposeOnce(): Promise<void> {\n this.disposed = true\n this.pendingSettings = undefined\n\n const failures: unknown[] = []\n for (const unsubscribe of [this.unsubscribeMedia, this.unsubscribeTheme]) {\n if (unsubscribe === undefined) continue\n try { unsubscribe() } catch (error) { failures.push(error) }\n }\n this.unsubscribeMedia = undefined\n this.unsubscribeTheme = undefined\n\n await this.tail\n\n const current = this.theme.getTheme()\n if (isEyeCareThemeId(current.preference)) {\n try {\n this.setTheme(this.resolveRestoreTheme())\n } catch (error) {\n failures.push(error)\n try { this.setTheme('system') } catch (fallbackError) { failures.push(fallbackError) }\n }\n }\n for (const unregister of this.unregisterThemes.splice(0).reverse()) {\n try { unregister() } catch (error) { failures.push(error) }\n }\n if (failures.length > 0) throw new AggregateError(failures, 'eye-care cleanup failed')\n }\n\n private enqueue(operation: () => Promise<void>): Promise<void> {\n if (this.disposed) return Promise.resolve()\n const task = this.tail.then(async () => {\n if (!this.disposed) await operation()\n })\n this.tail = task.catch(() => {})\n return task\n }\n\n private select(settings: EyeCareSettings): Promise<void> {\n if (this.disposed) return Promise.resolve()\n const previous = this.store.getSnapshot().settings\n if (previous.mode === 'off' && settings.mode !== 'off') this.captureRestoreTheme()\n this.store.update(state => {\n state.settings = settings\n state.error = null\n if (state.status === 'error') state.status = state.revision === undefined ? 'unavailable' : 'ready'\n })\n this.applyCurrentTheme()\n return this.persist(settings)\n }\n\n private persist(settings: EyeCareSettings): Promise<void> {\n const state = this.store.getSnapshot()\n if (this.rpc === undefined) {\n this.setUnavailable(state.error)\n return Promise.resolve()\n }\n if (state.revision !== undefined && !state.writable) {\n this.setUnavailable(state.error)\n return Promise.resolve()\n }\n this.pendingSettings = { ...settings }\n return this.enqueue(async () => { await this.flushPending() })\n }\n\n private async flushPending(): Promise<void> {\n while (!this.disposed && this.pendingSettings !== undefined) {\n const desired = this.pendingSettings\n this.pendingSettings = undefined\n\n let state = this.store.getSnapshot()\n if (state.revision === undefined) {\n if (this.pendingSettings === undefined) this.pendingSettings = desired\n if (!await this.readRemote()) return\n continue\n }\n if (!state.writable || state.revision === undefined) {\n this.setUnavailable(state.error)\n return\n }\n\n this.store.update(next => {\n next.status = 'saving'\n next.error = null\n })\n let response: Awaited<ReturnType<ClientConnectionRpc['call']>>\n try {\n const rpc = this.rpc\n if (rpc === undefined) return\n response = await rpc.call(EYE_CARE_RPC_CHANNEL, EYE_CARE_RPC_SAVE, {\n expectedRevision: state.revision,\n value: desired,\n })\n } catch (error) {\n if (!this.disposed) this.setUnavailable(messageOf(error))\n return\n }\n if (this.disposed) return\n if (!response.ok) {\n if (response.error.code === 'settings-conflict') {\n const latest = this.pendingSettings ?? desired\n this.pendingSettings = latest\n if (!await this.readRemote()) return\n if (this.disposed) return\n continue\n }\n this.setUnavailable(response.error.message)\n return\n }\n const snapshot = decodeEyeCareSnapshot(response.value)\n if (snapshot === undefined) {\n this.store.update(next => {\n next.status = 'error'\n next.error = 'eye-care Settings returned an invalid save response'\n })\n return\n }\n const preserveSettings = this.pendingSettings !== undefined\n || !sameSettings(this.store.getSnapshot().settings, desired)\n this.accept(snapshot, preserveSettings)\n }\n }\n\n private async readRemote(): Promise<boolean> {\n let response: Awaited<ReturnType<ClientConnectionRpc['call']>>\n try {\n const rpc = this.rpc\n if (rpc === undefined) return false\n response = await rpc.call(EYE_CARE_RPC_CHANNEL, EYE_CARE_RPC_READ, {})\n } catch (error) {\n if (!this.disposed) this.setUnavailable(messageOf(error), true)\n return false\n }\n if (this.disposed) return false\n if (!response.ok) {\n this.setUnavailable(response.error.message, true)\n return false\n }\n const snapshot = decodeEyeCareSnapshot(response.value)\n if (snapshot === undefined) {\n this.store.update(state => {\n state.status = 'error'\n state.error = 'eye-care Settings returned an invalid read response'\n })\n return false\n }\n this.accept(snapshot, this.pendingSettings !== undefined)\n return true\n }\n\n private accept(snapshot: EyeCareSettingsSnapshot, preserveSettings: boolean): void {\n const previous = this.store.getSnapshot().settings\n const next = preserveSettings ? previous : snapshot.settings.value\n const firstRemote = !this.acceptedRemoteSnapshot\n this.acceptedRemoteSnapshot = true\n\n if (next.mode === 'off') {\n this.startupBaseTheme = undefined\n this.startupBaseThemeDeadline = 0\n if (!this.hasRestoreTheme && snapshot.baseThemePreference !== undefined) {\n this.restoreTheme = snapshot.baseThemePreference\n this.hasRestoreTheme = true\n }\n } else if (firstRemote) {\n const base = snapshot.baseThemePreference\n if (base === undefined) {\n if (!this.hasRestoreTheme) this.captureRestoreTheme()\n } else {\n this.restoreTheme = base\n this.hasRestoreTheme = true\n if (this.theme.getTheme().preference !== base) {\n this.startupBaseTheme = base\n this.startupBaseThemeDeadline = this.now() + STARTUP_BASE_THEME_GRACE_MS\n }\n }\n } else if (!preserveSettings && previous.mode === 'off') {\n this.captureRestoreTheme(snapshot.baseThemePreference)\n }\n\n this.store.set({\n settings: next,\n status: snapshot.writable ? 'ready' : 'unavailable',\n writable: snapshot.writable,\n revision: snapshot.settings.revision,\n error: null,\n })\n this.applyCurrentTheme()\n }\n\n private setUnavailable(error: string | null = null, clearRevision = false): void {\n this.store.update(state => {\n state.status = 'unavailable'\n state.writable = false\n if (clearRevision) state.revision = undefined\n state.error = error\n })\n }\n\n private captureRestoreTheme(fallback?: 'light' | 'dark' | 'system'): void {\n const preference = this.theme.getTheme().preference\n const candidate = isEyeCareThemeId(preference) ? fallback ?? 'system' : preference\n this.restoreTheme = candidate\n this.hasRestoreTheme = true\n }\n\n private resolveRestoreTheme(): string {\n if (!this.hasRestoreTheme || this.restoreTheme === 'system') return 'system'\n return this.theme.getTheme().themes.some(theme => theme.id === this.restoreTheme)\n ? this.restoreTheme\n : 'system'\n }\n\n private applyCurrentTheme(): void {\n const { mode, intensity } = this.store.getSnapshot().settings\n const current = this.theme.getTheme().preference\n if (mode === 'off') {\n if (isEyeCareThemeId(current)) this.setTheme(this.resolveRestoreTheme())\n this.hasRestoreTheme = false\n return\n }\n if (!this.hasRestoreTheme) this.captureRestoreTheme()\n const scheme = mode === 'auto' ? (this.media?.matches === true ? 'dark' : 'light') : mode\n this.setTheme(eyeCareThemeId(scheme, intensity))\n }\n\n private setTheme(id: string): void {\n if (this.theme.getTheme().preference === id) return\n this.applyingTheme += 1\n try {\n this.theme.setTheme(id)\n } finally {\n this.applyingTheme -= 1\n }\n }\n\n private onThemeChanged(snapshot: ThemeSnapshot): void {\n if (this.disposed || this.applyingTheme > 0 || isEyeCareThemeId(snapshot.preference)) return\n if (this.startupBaseTheme !== undefined) {\n const expected = this.startupBaseTheme\n const withinStartupWindow = this.now() <= this.startupBaseThemeDeadline\n this.startupBaseTheme = undefined\n this.startupBaseThemeDeadline = 0\n if (withinStartupWindow && snapshot.preference === expected) {\n this.restoreTheme = expected\n this.hasRestoreTheme = true\n this.applyCurrentTheme()\n return\n }\n }\n const state = this.store.getSnapshot()\n if (state.settings.mode === 'off') return\n this.restoreTheme = snapshot.preference\n this.hasRestoreTheme = true\n const settings = { ...state.settings, mode: 'off' as const }\n this.store.update(next => {\n next.settings = settings\n next.error = null\n })\n void this.persist(settings)\n }\n}\n","/** `settings.eyeCare` dictionaries. */\n\n/** Simplified Chinese dictionary. */\nexport const zh = {\n 'title': '护眼模式',\n 'description': '降低页面的冷白光感,长时间阅读更柔和。',\n 'enabled.title': '护眼模式',\n 'enabled.off': '关闭',\n 'enabled.on': '开启',\n 'advanced.title': '显示方式与暖色强度',\n 'mode.title': '显示方式',\n 'mode.off': '关闭',\n 'mode.auto': '自动',\n 'mode.light': '日间',\n 'mode.dark': '夜间',\n 'intensity.title': '暖色强度',\n 'intensity.soft': '柔和',\n 'intensity.balanced': '均衡',\n 'intensity.warm': '温暖',\n 'status.off': '护眼模式已关闭',\n 'status.auto': '自动跟随系统明暗外观',\n 'status.light': '正在使用暖色日间主题',\n 'status.dark': '正在使用暖暗夜间主题',\n 'status.local': '仅当前浏览器有效',\n 'status.saving': '正在保存',\n 'status.error': '设置暂未保存',\n} satisfies Record<string, string>\n\n/** Dictionary key union. */\nexport type EyeCareKey = keyof typeof zh\n\n/** English dictionary. */\nexport const en = {\n 'title': 'Eye care',\n 'description': 'Use warm semantic themes to reduce cool-white glare during long reading sessions',\n 'enabled.title': 'Eye care',\n 'enabled.off': 'Off',\n 'enabled.on': 'On',\n 'advanced.title': 'Appearance and warmth',\n 'mode.title': 'Appearance',\n 'mode.off': 'Off',\n 'mode.auto': 'Auto',\n 'mode.light': 'Day',\n 'mode.dark': 'Night',\n 'intensity.title': 'Warmth',\n 'intensity.soft': 'Soft',\n 'intensity.balanced': 'Balanced',\n 'intensity.warm': 'Warm',\n 'status.off': 'Eye care is off',\n 'status.auto': 'Following the system light or dark appearance',\n 'status.light': 'Warm day theme is active',\n 'status.dark': 'Warm night theme is active',\n 'status.local': 'Current browser only',\n 'status.saving': 'Saving',\n 'status.error': 'Setting is not saved yet',\n} satisfies Record<EyeCareKey, string>\n","/** DSH Web browser half for the eye-care profile bundle. */\n\nimport type { ConnectionHandle } from '@deepseek-ai/dsh-client-connection/client'\nimport type { ClientContext } from '@deepseek-ai/dsh-client-runtime/client'\nimport type { ThemeRuntime, ThemeSnapshot } from '@deepseek-ai/dsh-client-ui-theme/client'\nimport type {} from '@deepseek-ai/dsh-client-ui-settings/client'\nimport type {} from '@deepseek-ai/dsh-api-remotes/client'\nimport type {} from '@deepseek-ai/dsh-client-locale/client'\nimport type {} from '@deepseek-ai/dsh-client-ui-theme/client'\nimport { EyeCareRow, type EyeCareRowInjected } from './EyeCareRow.tsx'\nimport { EyeCareController } from './controller.ts'\nimport { en, zh, type EyeCareKey } from './locales.ts'\n\n/** Required browser services. */\nexport const inject = ['slots', 'locale', 'theme', 'connection', 'remote']\n\ndeclare module '@deepseek-ai/dsh-client-ui-slots' {\n interface LocaleNamespaceMap {\n /** Eye-care General row copy. */\n 'settings.eyeCare': EyeCareKey\n }\n}\n\n/** Browser context with the theme service declaration merged by ui-theme. */\ntype EyeCareClientContext = ClientContext & { theme: ThemeRuntime }\n\n/** Register settings copy, controller lifecycle, and General row. */\nexport function apply(ctx: EyeCareClientContext): void {\n const theme = ctx.get('theme') as ThemeRuntime\n const connection = ctx.get('connection') as ConnectionHandle\n const controller = new EyeCareController({\n theme,\n ...(connection.isLoopback ? { rpc: connection.rpc } : {}),\n subscribeTheme: (listener: (snapshot: ThemeSnapshot) => void): (() => void) => ctx.on('theme/change', listener),\n })\n ctx.effect(() => ctx.locale.register('settings.eyeCare', { zh, en }), 'dsh-eye-care: dictionaries')\n ctx.effect(() => {\n const refresh = (namespace?: string): void => {\n if (namespace !== undefined && namespace !== 'eye-care') return\n controller.refresh()\n }\n const disposers = [\n ctx.remote.$on('settings/document-updated', refresh),\n ctx.on('connection/reset', () => {\n if (connection.isLoopback) controller.refresh()\n }),\n ]\n void controller.load()\n return async () => {\n for (const dispose of disposers) dispose()\n await controller.dispose()\n }\n }, 'dsh-eye-care: controller lifecycle')\n\n const injected = (): EyeCareRowInjected => ({\n hooks: { eyeCare: controller.store },\n setMode: mode => controller.setMode(mode),\n setIntensity: intensity => controller.setIntensity(intensity),\n })\n ctx.slots.inject('settings.general.item', () => ctx.slots.register({\n name: 'settings.general.item',\n id: 'eye-care',\n order: 15,\n locale: 'settings.eyeCare',\n inject: injected,\n }, EyeCareRow))\n}\n\nexport type { EyeCareRowInjected, EyeCareRowProps } from './EyeCareRow.tsx'\nexport type { EyeCareState } from './controller.ts'\nexport { EyeCareController } from './controller.ts'\nexport { EYE_CARE_THEMES, eyeCareThemeId, isEyeCareThemeId } from './themes.ts'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuBA,MAAM,QAA2D;GAC/D;IAAE,IAAI;IAAO,OAAO;GAAW;GAC/B;IAAE,IAAI;IAAQ,OAAO;GAAY;GACjC;IAAE,IAAI;IAAS,OAAO;GAAa;GACnC;IAAE,IAAI;IAAQ,OAAO;GAAY;EACnC;EAEA,MAAM,cAAsE;GAC1E;IAAE,IAAI;IAAQ,OAAO;GAAiB;GACtC;IAAE,IAAI;IAAY,OAAO;GAAqB;GAC9C;IAAE,IAAI;IAAQ,OAAO;GAAiB;EACxC;EAEA,SAAS,UAAU,MAA+B;GAChD,OAAO,UAAU;EACnB;;EAGA,SAAgB,WAAW,EAAE,GAAG,YAAY,SAAS,gBAAiC;GACpF,MAAM,QAAQ,YAAW,UAAS,KAAK;GACvC,MAAM,OAAO,MAAM,WAAW,aAAa,MAAM,WAAW;GAC5D,MAAM,UAAU,MAAM,SAAS,SAAS;GACxC,MAAM,SA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SAAS,WAAW,MAAM;IACnC,UAAS,SAAQ,WAAW,QAAQ,IAAI;IACxC,eAAc,cAAa,WAAW,aAAa,SAAS;GAC9D;GACA,IAAI,MAAM,OAAO,+BAA+B,IAAI,MAAM,SAAS;IACjE,MAAM;IACN,IAAI;IACJ,OAAO;IACP,QAAQ;IACR,QAAQ;GACV,GAAG,UAAU,CAAC;EAChB"}
|
|
1
|
+
{"version":3,"file":"client.js","names":["css"],"sources":["../src/client/EyeCareRow.tsx","../node_modules/.pnpm/zustand@4.4.7_@types+react@18.3.31_immer@10.1.1_react@18.3.1/node_modules/zustand/esm/vanilla.mjs","../node_modules/.pnpm/zustand@4.4.7_@types+react@18.3.31_immer@10.1.1_react@18.3.1/node_modules/zustand/esm/middleware.mjs","../node_modules/.pnpm/immer@10.1.1/node_modules/immer/dist/immer.mjs","../node_modules/.pnpm/@deepseek-ai+dsh-client-store@0.2.0-rc.2_@deepseek-ai+cordis@4.0.4/node_modules/@deepseek-ai/dsh-client-store/lib/index.js","../src/shared.ts","../src/client/themes.ts","../src/client/controller.ts","../src/client/locales.ts","../src/client/index.tsx"],"sourcesContent":["/** General-settings row for eye-care mode and warmth controls. */\n\nimport type { InjectFace, PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots'\nimport type { EyeCareController } from './controller.ts'\nimport type { EyeCareKey } from './locales.ts'\nimport type { EyeCareIntensity, EyeCareMode } from '../shared.ts'\nimport css from './EyeCareRow.module.css'\n\n/** Injected business face used by the row. */\nexport interface EyeCareRowInjected {\n /** State source. */\n hooks: { eyeCare: EyeCareController['store'] }\n /** Set the selected mode. */\n setMode: (mode: EyeCareMode) => Promise<void>\n /** Set the selected warmth. */\n setIntensity: (intensity: EyeCareIntensity) => Promise<void>\n}\n\n/** Full composed props for the settings slot. */\nexport type EyeCareRowProps = PropsRuntime<'settings.general.item'>\n & PropsLocale<'settings.eyeCare'>\n & InjectFace<EyeCareRowInjected>\n\nconst MODES: readonly { id: EyeCareMode; label: EyeCareKey }[] = [\n { id: 'off', label: 'mode.off' },\n { id: 'auto', label: 'mode.auto' },\n { id: 'light', label: 'mode.light' },\n { id: 'dark', label: 'mode.dark' },\n]\n\nconst INTENSITIES: readonly { id: EyeCareIntensity; label: EyeCareKey }[] = [\n { id: 'soft', label: 'intensity.soft' },\n { id: 'balanced', label: 'intensity.balanced' },\n { id: 'warm', label: 'intensity.warm' },\n]\n\nfunction statusKey(mode: EyeCareMode): EyeCareKey {\n return `status.${mode}` as EyeCareKey\n}\n\n/** Render the feature-owned General settings row. */\nexport function EyeCareRow({ t, useEyeCare, setMode, setIntensity }: EyeCareRowProps) {\n const state = useEyeCare(value => value)\n const busy = state.status === 'loading' || state.status === 'saving'\n const enabled = state.settings.mode !== 'off'\n const status = state.status === 'error' && state.error !== null ? state.error : t(statusKey(state.settings.mode))\n const statusText = state.status === 'unavailable' ? `${status} · ${t('status.local')}` : status\n return (\n <section className={css.row} aria-labelledby=\"dsh-eye-care-title\">\n <div className={css.copy}>\n <h3 id=\"dsh-eye-care-title\" className={css.title}>{t('title')}</h3>\n <p className={css.description}>{t('description')}</p>\n </div>\n <div className={css.controls}>\n <div className={css.primaryLine}>\n <div className={css.controlGroup} role=\"group\" aria-label={t('enabled.title')}>\n <button\n type=\"button\"\n className={`${css.option}${!enabled ? ` ${css.selected}` : ''}`}\n aria-pressed={!enabled}\n disabled={busy}\n onClick={() => { void setMode('off') }}\n >\n {t('enabled.off')}\n </button>\n <button\n type=\"button\"\n className={`${css.option}${enabled ? ` ${css.selected}` : ''}`}\n aria-pressed={enabled}\n disabled={busy}\n onClick={() => { void setMode(state.settings.mode === 'off' ? 'auto' : state.settings.mode) }}\n >\n {t('enabled.on')}\n </button>\n </div>\n </div>\n {enabled ? <details className={css.advanced}>\n <summary>{t('advanced.title')}</summary>\n <div className={css.advancedBody}>\n <div className={css.settingLine}>\n <span className={css.settingLabel}>{t('mode.title')}</span>\n <div className={css.controlGroup} role=\"group\" aria-label={t('mode.title')}>\n {MODES.filter(({ id }) => id !== 'off').map(({ id, label }) => (\n <button\n key={id}\n type=\"button\"\n className={`${css.smallOption}${state.settings.mode === id ? ` ${css.selected}` : ''}`}\n aria-pressed={state.settings.mode === id}\n disabled={busy}\n onClick={() => { void setMode(id) }}\n >\n {t(label)}\n </button>\n ))}\n </div>\n </div>\n <div className={css.settingLine}>\n <span className={css.settingLabel}>{t('intensity.title')}</span>\n <div className={css.controlGroup} role=\"group\" aria-label={t('intensity.title')}>\n {INTENSITIES.map(({ id, label }) => (\n <button\n key={id}\n type=\"button\"\n className={`${css.smallOption}${state.settings.intensity === id ? ` ${css.selected}` : ''}`}\n aria-pressed={state.settings.intensity === id}\n disabled={busy}\n onClick={() => { void setIntensity(id) }}\n >\n {t(label)}\n </button>\n ))}\n </div>\n </div>\n </div>\n </details> : null}\n <div className={css.status} aria-live=\"polite\">\n {state.status === 'saving' ? t('status.saving') : statusText}\n </div>\n </div>\n </section>\n )\n}\n","const createStoreImpl = (createState) => {\n let state;\n const listeners = /* @__PURE__ */ new Set();\n const setState = (partial, replace) => {\n const nextState = typeof partial === \"function\" ? partial(state) : partial;\n if (!Object.is(nextState, state)) {\n const previousState = state;\n state = (replace != null ? replace : typeof nextState !== \"object\" || nextState === null) ? nextState : Object.assign({}, state, nextState);\n listeners.forEach((listener) => listener(state, previousState));\n }\n };\n const getState = () => state;\n const subscribe = (listener) => {\n listeners.add(listener);\n return () => listeners.delete(listener);\n };\n const destroy = () => {\n if ((import.meta.env ? import.meta.env.MODE : void 0) !== \"production\") {\n console.warn(\n \"[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected.\"\n );\n }\n listeners.clear();\n };\n const api = { setState, getState, subscribe, destroy };\n state = createState(setState, getState, api);\n return api;\n};\nconst createStore = (createState) => createState ? createStoreImpl(createState) : createStoreImpl;\nvar vanilla = (createState) => {\n if ((import.meta.env ? import.meta.env.MODE : void 0) !== \"production\") {\n console.warn(\n \"[DEPRECATED] Default export is deprecated. Instead use import { createStore } from 'zustand/vanilla'.\"\n );\n }\n return createStore(createState);\n};\n\nexport { createStore, vanilla as default };\n","const reduxImpl = (reducer, initial) => (set, _get, api) => {\n api.dispatch = (action) => {\n set((state) => reducer(state, action), false, action);\n return action;\n };\n api.dispatchFromDevtools = true;\n return { dispatch: (...a) => api.dispatch(...a), ...initial };\n};\nconst redux = reduxImpl;\n\nconst trackedConnections = /* @__PURE__ */ new Map();\nconst getTrackedConnectionState = (name) => {\n const api = trackedConnections.get(name);\n if (!api)\n return {};\n return Object.fromEntries(\n Object.entries(api.stores).map(([key, api2]) => [key, api2.getState()])\n );\n};\nconst extractConnectionInformation = (store, extensionConnector, options) => {\n if (store === void 0) {\n return {\n type: \"untracked\",\n connection: extensionConnector.connect(options)\n };\n }\n const existingConnection = trackedConnections.get(options.name);\n if (existingConnection) {\n return { type: \"tracked\", store, ...existingConnection };\n }\n const newConnection = {\n connection: extensionConnector.connect(options),\n stores: {}\n };\n trackedConnections.set(options.name, newConnection);\n return { type: \"tracked\", store, ...newConnection };\n};\nconst devtoolsImpl = (fn, devtoolsOptions = {}) => (set, get, api) => {\n const { enabled, anonymousActionType, store, ...options } = devtoolsOptions;\n let extensionConnector;\n try {\n extensionConnector = (enabled != null ? enabled : (import.meta.env ? import.meta.env.MODE : void 0) !== \"production\") && window.__REDUX_DEVTOOLS_EXTENSION__;\n } catch (e) {\n }\n if (!extensionConnector) {\n if ((import.meta.env ? import.meta.env.MODE : void 0) !== \"production\" && enabled) {\n console.warn(\n \"[zustand devtools middleware] Please install/enable Redux devtools extension\"\n );\n }\n return fn(set, get, api);\n }\n const { connection, ...connectionInformation } = extractConnectionInformation(store, extensionConnector, options);\n let isRecording = true;\n api.setState = (state, replace, nameOrAction) => {\n const r = set(state, replace);\n if (!isRecording)\n return r;\n const action = nameOrAction === void 0 ? { type: anonymousActionType || \"anonymous\" } : typeof nameOrAction === \"string\" ? { type: nameOrAction } : nameOrAction;\n if (store === void 0) {\n connection == null ? void 0 : connection.send(action, get());\n return r;\n }\n connection == null ? void 0 : connection.send(\n {\n ...action,\n type: `${store}/${action.type}`\n },\n {\n ...getTrackedConnectionState(options.name),\n [store]: api.getState()\n }\n );\n return r;\n };\n const setStateFromDevtools = (...a) => {\n const originalIsRecording = isRecording;\n isRecording = false;\n set(...a);\n isRecording = originalIsRecording;\n };\n const initialState = fn(api.setState, get, api);\n if (connectionInformation.type === \"untracked\") {\n connection == null ? void 0 : connection.init(initialState);\n } else {\n connectionInformation.stores[connectionInformation.store] = api;\n connection == null ? void 0 : connection.init(\n Object.fromEntries(\n Object.entries(connectionInformation.stores).map(([key, store2]) => [\n key,\n key === connectionInformation.store ? initialState : store2.getState()\n ])\n )\n );\n }\n if (api.dispatchFromDevtools && typeof api.dispatch === \"function\") {\n let didWarnAboutReservedActionType = false;\n const originalDispatch = api.dispatch;\n api.dispatch = (...a) => {\n if ((import.meta.env ? import.meta.env.MODE : void 0) !== \"production\" && a[0].type === \"__setState\" && !didWarnAboutReservedActionType) {\n console.warn(\n '[zustand devtools middleware] \"__setState\" action type is reserved to set state from the devtools. Avoid using it.'\n );\n didWarnAboutReservedActionType = true;\n }\n originalDispatch(...a);\n };\n }\n connection.subscribe((message) => {\n var _a;\n switch (message.type) {\n case \"ACTION\":\n if (typeof message.payload !== \"string\") {\n console.error(\n \"[zustand devtools middleware] Unsupported action format\"\n );\n return;\n }\n return parseJsonThen(\n message.payload,\n (action) => {\n if (action.type === \"__setState\") {\n if (store === void 0) {\n setStateFromDevtools(action.state);\n return;\n }\n if (Object.keys(action.state).length !== 1) {\n console.error(\n `\n [zustand devtools middleware] Unsupported __setState action format. \n When using 'store' option in devtools(), the 'state' should have only one key, which is a value of 'store' that was passed in devtools(),\n and value of this only key should be a state object. Example: { \"type\": \"__setState\", \"state\": { \"abc123Store\": { \"foo\": \"bar\" } } }\n `\n );\n }\n const stateFromDevtools = action.state[store];\n if (stateFromDevtools === void 0 || stateFromDevtools === null) {\n return;\n }\n if (JSON.stringify(api.getState()) !== JSON.stringify(stateFromDevtools)) {\n setStateFromDevtools(stateFromDevtools);\n }\n return;\n }\n if (!api.dispatchFromDevtools)\n return;\n if (typeof api.dispatch !== \"function\")\n return;\n api.dispatch(action);\n }\n );\n case \"DISPATCH\":\n switch (message.payload.type) {\n case \"RESET\":\n setStateFromDevtools(initialState);\n if (store === void 0) {\n return connection == null ? void 0 : connection.init(api.getState());\n }\n return connection == null ? void 0 : connection.init(getTrackedConnectionState(options.name));\n case \"COMMIT\":\n if (store === void 0) {\n connection == null ? void 0 : connection.init(api.getState());\n return;\n }\n return connection == null ? void 0 : connection.init(getTrackedConnectionState(options.name));\n case \"ROLLBACK\":\n return parseJsonThen(message.state, (state) => {\n if (store === void 0) {\n setStateFromDevtools(state);\n connection == null ? void 0 : connection.init(api.getState());\n return;\n }\n setStateFromDevtools(state[store]);\n connection == null ? void 0 : connection.init(getTrackedConnectionState(options.name));\n });\n case \"JUMP_TO_STATE\":\n case \"JUMP_TO_ACTION\":\n return parseJsonThen(message.state, (state) => {\n if (store === void 0) {\n setStateFromDevtools(state);\n return;\n }\n if (JSON.stringify(api.getState()) !== JSON.stringify(state[store])) {\n setStateFromDevtools(state[store]);\n }\n });\n case \"IMPORT_STATE\": {\n const { nextLiftedState } = message.payload;\n const lastComputedState = (_a = nextLiftedState.computedStates.slice(-1)[0]) == null ? void 0 : _a.state;\n if (!lastComputedState)\n return;\n if (store === void 0) {\n setStateFromDevtools(lastComputedState);\n } else {\n setStateFromDevtools(lastComputedState[store]);\n }\n connection == null ? void 0 : connection.send(\n null,\n // FIXME no-any\n nextLiftedState\n );\n return;\n }\n case \"PAUSE_RECORDING\":\n return isRecording = !isRecording;\n }\n return;\n }\n });\n return initialState;\n};\nconst devtools = devtoolsImpl;\nconst parseJsonThen = (stringified, f) => {\n let parsed;\n try {\n parsed = JSON.parse(stringified);\n } catch (e) {\n console.error(\n \"[zustand devtools middleware] Could not parse the received json\",\n e\n );\n }\n if (parsed !== void 0)\n f(parsed);\n};\n\nconst subscribeWithSelectorImpl = (fn) => (set, get, api) => {\n const origSubscribe = api.subscribe;\n api.subscribe = (selector, optListener, options) => {\n let listener = selector;\n if (optListener) {\n const equalityFn = (options == null ? void 0 : options.equalityFn) || Object.is;\n let currentSlice = selector(api.getState());\n listener = (state) => {\n const nextSlice = selector(state);\n if (!equalityFn(currentSlice, nextSlice)) {\n const previousSlice = currentSlice;\n optListener(currentSlice = nextSlice, previousSlice);\n }\n };\n if (options == null ? void 0 : options.fireImmediately) {\n optListener(currentSlice, currentSlice);\n }\n }\n return origSubscribe(listener);\n };\n const initialState = fn(set, get, api);\n return initialState;\n};\nconst subscribeWithSelector = subscribeWithSelectorImpl;\n\nconst combine = (initialState, create) => (...a) => Object.assign({}, initialState, create(...a));\n\nfunction createJSONStorage(getStorage, options) {\n let storage;\n try {\n storage = getStorage();\n } catch (e) {\n return;\n }\n const persistStorage = {\n getItem: (name) => {\n var _a;\n const parse = (str2) => {\n if (str2 === null) {\n return null;\n }\n return JSON.parse(str2, options == null ? void 0 : options.reviver);\n };\n const str = (_a = storage.getItem(name)) != null ? _a : null;\n if (str instanceof Promise) {\n return str.then(parse);\n }\n return parse(str);\n },\n setItem: (name, newValue) => storage.setItem(\n name,\n JSON.stringify(newValue, options == null ? void 0 : options.replacer)\n ),\n removeItem: (name) => storage.removeItem(name)\n };\n return persistStorage;\n}\nconst toThenable = (fn) => (input) => {\n try {\n const result = fn(input);\n if (result instanceof Promise) {\n return result;\n }\n return {\n then(onFulfilled) {\n return toThenable(onFulfilled)(result);\n },\n catch(_onRejected) {\n return this;\n }\n };\n } catch (e) {\n return {\n then(_onFulfilled) {\n return this;\n },\n catch(onRejected) {\n return toThenable(onRejected)(e);\n }\n };\n }\n};\nconst oldImpl = (config, baseOptions) => (set, get, api) => {\n let options = {\n getStorage: () => localStorage,\n serialize: JSON.stringify,\n deserialize: JSON.parse,\n partialize: (state) => state,\n version: 0,\n merge: (persistedState, currentState) => ({\n ...currentState,\n ...persistedState\n }),\n ...baseOptions\n };\n let hasHydrated = false;\n const hydrationListeners = /* @__PURE__ */ new Set();\n const finishHydrationListeners = /* @__PURE__ */ new Set();\n let storage;\n try {\n storage = options.getStorage();\n } catch (e) {\n }\n if (!storage) {\n return config(\n (...args) => {\n console.warn(\n `[zustand persist middleware] Unable to update item '${options.name}', the given storage is currently unavailable.`\n );\n set(...args);\n },\n get,\n api\n );\n }\n const thenableSerialize = toThenable(options.serialize);\n const setItem = () => {\n const state = options.partialize({ ...get() });\n let errorInSync;\n const thenable = thenableSerialize({ state, version: options.version }).then(\n (serializedValue) => storage.setItem(options.name, serializedValue)\n ).catch((e) => {\n errorInSync = e;\n });\n if (errorInSync) {\n throw errorInSync;\n }\n return thenable;\n };\n const savedSetState = api.setState;\n api.setState = (state, replace) => {\n savedSetState(state, replace);\n void setItem();\n };\n const configResult = config(\n (...args) => {\n set(...args);\n void setItem();\n },\n get,\n api\n );\n let stateFromStorage;\n const hydrate = () => {\n var _a;\n if (!storage)\n return;\n hasHydrated = false;\n hydrationListeners.forEach((cb) => cb(get()));\n const postRehydrationCallback = ((_a = options.onRehydrateStorage) == null ? void 0 : _a.call(options, get())) || void 0;\n return toThenable(storage.getItem.bind(storage))(options.name).then((storageValue) => {\n if (storageValue) {\n return options.deserialize(storageValue);\n }\n }).then((deserializedStorageValue) => {\n if (deserializedStorageValue) {\n if (typeof deserializedStorageValue.version === \"number\" && deserializedStorageValue.version !== options.version) {\n if (options.migrate) {\n return options.migrate(\n deserializedStorageValue.state,\n deserializedStorageValue.version\n );\n }\n console.error(\n `State loaded from storage couldn't be migrated since no migrate function was provided`\n );\n } else {\n return deserializedStorageValue.state;\n }\n }\n }).then((migratedState) => {\n var _a2;\n stateFromStorage = options.merge(\n migratedState,\n (_a2 = get()) != null ? _a2 : configResult\n );\n set(stateFromStorage, true);\n return setItem();\n }).then(() => {\n postRehydrationCallback == null ? void 0 : postRehydrationCallback(stateFromStorage, void 0);\n hasHydrated = true;\n finishHydrationListeners.forEach((cb) => cb(stateFromStorage));\n }).catch((e) => {\n postRehydrationCallback == null ? void 0 : postRehydrationCallback(void 0, e);\n });\n };\n api.persist = {\n setOptions: (newOptions) => {\n options = {\n ...options,\n ...newOptions\n };\n if (newOptions.getStorage) {\n storage = newOptions.getStorage();\n }\n },\n clearStorage: () => {\n storage == null ? void 0 : storage.removeItem(options.name);\n },\n getOptions: () => options,\n rehydrate: () => hydrate(),\n hasHydrated: () => hasHydrated,\n onHydrate: (cb) => {\n hydrationListeners.add(cb);\n return () => {\n hydrationListeners.delete(cb);\n };\n },\n onFinishHydration: (cb) => {\n finishHydrationListeners.add(cb);\n return () => {\n finishHydrationListeners.delete(cb);\n };\n }\n };\n hydrate();\n return stateFromStorage || configResult;\n};\nconst newImpl = (config, baseOptions) => (set, get, api) => {\n let options = {\n storage: createJSONStorage(() => localStorage),\n partialize: (state) => state,\n version: 0,\n merge: (persistedState, currentState) => ({\n ...currentState,\n ...persistedState\n }),\n ...baseOptions\n };\n let hasHydrated = false;\n const hydrationListeners = /* @__PURE__ */ new Set();\n const finishHydrationListeners = /* @__PURE__ */ new Set();\n let storage = options.storage;\n if (!storage) {\n return config(\n (...args) => {\n console.warn(\n `[zustand persist middleware] Unable to update item '${options.name}', the given storage is currently unavailable.`\n );\n set(...args);\n },\n get,\n api\n );\n }\n const setItem = () => {\n const state = options.partialize({ ...get() });\n return storage.setItem(options.name, {\n state,\n version: options.version\n });\n };\n const savedSetState = api.setState;\n api.setState = (state, replace) => {\n savedSetState(state, replace);\n void setItem();\n };\n const configResult = config(\n (...args) => {\n set(...args);\n void setItem();\n },\n get,\n api\n );\n let stateFromStorage;\n const hydrate = () => {\n var _a, _b;\n if (!storage)\n return;\n hasHydrated = false;\n hydrationListeners.forEach((cb) => {\n var _a2;\n return cb((_a2 = get()) != null ? _a2 : configResult);\n });\n const postRehydrationCallback = ((_b = options.onRehydrateStorage) == null ? void 0 : _b.call(options, (_a = get()) != null ? _a : configResult)) || void 0;\n return toThenable(storage.getItem.bind(storage))(options.name).then((deserializedStorageValue) => {\n if (deserializedStorageValue) {\n if (typeof deserializedStorageValue.version === \"number\" && deserializedStorageValue.version !== options.version) {\n if (options.migrate) {\n return options.migrate(\n deserializedStorageValue.state,\n deserializedStorageValue.version\n );\n }\n console.error(\n `State loaded from storage couldn't be migrated since no migrate function was provided`\n );\n } else {\n return deserializedStorageValue.state;\n }\n }\n }).then((migratedState) => {\n var _a2;\n stateFromStorage = options.merge(\n migratedState,\n (_a2 = get()) != null ? _a2 : configResult\n );\n set(stateFromStorage, true);\n return setItem();\n }).then(() => {\n postRehydrationCallback == null ? void 0 : postRehydrationCallback(stateFromStorage, void 0);\n stateFromStorage = get();\n hasHydrated = true;\n finishHydrationListeners.forEach((cb) => cb(stateFromStorage));\n }).catch((e) => {\n postRehydrationCallback == null ? void 0 : postRehydrationCallback(void 0, e);\n });\n };\n api.persist = {\n setOptions: (newOptions) => {\n options = {\n ...options,\n ...newOptions\n };\n if (newOptions.storage) {\n storage = newOptions.storage;\n }\n },\n clearStorage: () => {\n storage == null ? void 0 : storage.removeItem(options.name);\n },\n getOptions: () => options,\n rehydrate: () => hydrate(),\n hasHydrated: () => hasHydrated,\n onHydrate: (cb) => {\n hydrationListeners.add(cb);\n return () => {\n hydrationListeners.delete(cb);\n };\n },\n onFinishHydration: (cb) => {\n finishHydrationListeners.add(cb);\n return () => {\n finishHydrationListeners.delete(cb);\n };\n }\n };\n if (!options.skipHydration) {\n hydrate();\n }\n return stateFromStorage || configResult;\n};\nconst persistImpl = (config, baseOptions) => {\n if (\"getStorage\" in baseOptions || \"serialize\" in baseOptions || \"deserialize\" in baseOptions) {\n if ((import.meta.env ? import.meta.env.MODE : void 0) !== \"production\") {\n console.warn(\n \"[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead.\"\n );\n }\n return oldImpl(config, baseOptions);\n }\n return newImpl(config, baseOptions);\n};\nconst persist = persistImpl;\n\nexport { combine, createJSONStorage, devtools, persist, redux, subscribeWithSelector };\n","// src/utils/env.ts\nvar NOTHING = Symbol.for(\"immer-nothing\");\nvar DRAFTABLE = Symbol.for(\"immer-draftable\");\nvar DRAFT_STATE = Symbol.for(\"immer-state\");\n\n// src/utils/errors.ts\nvar errors = process.env.NODE_ENV !== \"production\" ? [\n // All error codes, starting by 0:\n function(plugin) {\n return `The plugin for '${plugin}' has not been loaded into Immer. To enable the plugin, import and call \\`enable${plugin}()\\` when initializing your application.`;\n },\n function(thing) {\n return `produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${thing}'`;\n },\n \"This object has been frozen and should not be mutated\",\n function(data) {\n return \"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? \" + data;\n },\n \"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.\",\n \"Immer forbids circular references\",\n \"The first or second argument to `produce` must be a function\",\n \"The third argument to `produce` must be a function or undefined\",\n \"First argument to `createDraft` must be a plain object, an array, or an immerable object\",\n \"First argument to `finishDraft` must be a draft returned by `createDraft`\",\n function(thing) {\n return `'current' expects a draft, got: ${thing}`;\n },\n \"Object.defineProperty() cannot be used on an Immer draft\",\n \"Object.setPrototypeOf() cannot be used on an Immer draft\",\n \"Immer only supports deleting array indices\",\n \"Immer only supports setting array indices and the 'length' property\",\n function(thing) {\n return `'original' expects a draft, got: ${thing}`;\n }\n // Note: if more errors are added, the errorOffset in Patches.ts should be increased\n // See Patches.ts for additional errors\n] : [];\nfunction die(error, ...args) {\n if (process.env.NODE_ENV !== \"production\") {\n const e = errors[error];\n const msg = typeof e === \"function\" ? e.apply(null, args) : e;\n throw new Error(`[Immer] ${msg}`);\n }\n throw new Error(\n `[Immer] minified error nr: ${error}. Full error at: https://bit.ly/3cXEKWf`\n );\n}\n\n// src/utils/common.ts\nvar getPrototypeOf = Object.getPrototypeOf;\nfunction isDraft(value) {\n return !!value && !!value[DRAFT_STATE];\n}\nfunction isDraftable(value) {\n if (!value)\n return false;\n return isPlainObject(value) || Array.isArray(value) || !!value[DRAFTABLE] || !!value.constructor?.[DRAFTABLE] || isMap(value) || isSet(value);\n}\nvar objectCtorString = Object.prototype.constructor.toString();\nfunction isPlainObject(value) {\n if (!value || typeof value !== \"object\")\n return false;\n const proto = getPrototypeOf(value);\n if (proto === null) {\n return true;\n }\n const Ctor = Object.hasOwnProperty.call(proto, \"constructor\") && proto.constructor;\n if (Ctor === Object)\n return true;\n return typeof Ctor == \"function\" && Function.toString.call(Ctor) === objectCtorString;\n}\nfunction original(value) {\n if (!isDraft(value))\n die(15, value);\n return value[DRAFT_STATE].base_;\n}\nfunction each(obj, iter) {\n if (getArchtype(obj) === 0 /* Object */) {\n Reflect.ownKeys(obj).forEach((key) => {\n iter(key, obj[key], obj);\n });\n } else {\n obj.forEach((entry, index) => iter(index, entry, obj));\n }\n}\nfunction getArchtype(thing) {\n const state = thing[DRAFT_STATE];\n return state ? state.type_ : Array.isArray(thing) ? 1 /* Array */ : isMap(thing) ? 2 /* Map */ : isSet(thing) ? 3 /* Set */ : 0 /* Object */;\n}\nfunction has(thing, prop) {\n return getArchtype(thing) === 2 /* Map */ ? thing.has(prop) : Object.prototype.hasOwnProperty.call(thing, prop);\n}\nfunction get(thing, prop) {\n return getArchtype(thing) === 2 /* Map */ ? thing.get(prop) : thing[prop];\n}\nfunction set(thing, propOrOldValue, value) {\n const t = getArchtype(thing);\n if (t === 2 /* Map */)\n thing.set(propOrOldValue, value);\n else if (t === 3 /* Set */) {\n thing.add(value);\n } else\n thing[propOrOldValue] = value;\n}\nfunction is(x, y) {\n if (x === y) {\n return x !== 0 || 1 / x === 1 / y;\n } else {\n return x !== x && y !== y;\n }\n}\nfunction isMap(target) {\n return target instanceof Map;\n}\nfunction isSet(target) {\n return target instanceof Set;\n}\nfunction latest(state) {\n return state.copy_ || state.base_;\n}\nfunction shallowCopy(base, strict) {\n if (isMap(base)) {\n return new Map(base);\n }\n if (isSet(base)) {\n return new Set(base);\n }\n if (Array.isArray(base))\n return Array.prototype.slice.call(base);\n const isPlain = isPlainObject(base);\n if (strict === true || strict === \"class_only\" && !isPlain) {\n const descriptors = Object.getOwnPropertyDescriptors(base);\n delete descriptors[DRAFT_STATE];\n let keys = Reflect.ownKeys(descriptors);\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n const desc = descriptors[key];\n if (desc.writable === false) {\n desc.writable = true;\n desc.configurable = true;\n }\n if (desc.get || desc.set)\n descriptors[key] = {\n configurable: true,\n writable: true,\n // could live with !!desc.set as well here...\n enumerable: desc.enumerable,\n value: base[key]\n };\n }\n return Object.create(getPrototypeOf(base), descriptors);\n } else {\n const proto = getPrototypeOf(base);\n if (proto !== null && isPlain) {\n return { ...base };\n }\n const obj = Object.create(proto);\n return Object.assign(obj, base);\n }\n}\nfunction freeze(obj, deep = false) {\n if (isFrozen(obj) || isDraft(obj) || !isDraftable(obj))\n return obj;\n if (getArchtype(obj) > 1) {\n obj.set = obj.add = obj.clear = obj.delete = dontMutateFrozenCollections;\n }\n Object.freeze(obj);\n if (deep)\n Object.entries(obj).forEach(([key, value]) => freeze(value, true));\n return obj;\n}\nfunction dontMutateFrozenCollections() {\n die(2);\n}\nfunction isFrozen(obj) {\n return Object.isFrozen(obj);\n}\n\n// src/utils/plugins.ts\nvar plugins = {};\nfunction getPlugin(pluginKey) {\n const plugin = plugins[pluginKey];\n if (!plugin) {\n die(0, pluginKey);\n }\n return plugin;\n}\nfunction loadPlugin(pluginKey, implementation) {\n if (!plugins[pluginKey])\n plugins[pluginKey] = implementation;\n}\n\n// src/core/scope.ts\nvar currentScope;\nfunction getCurrentScope() {\n return currentScope;\n}\nfunction createScope(parent_, immer_) {\n return {\n drafts_: [],\n parent_,\n immer_,\n // Whenever the modified draft contains a draft from another scope, we\n // need to prevent auto-freezing so the unowned draft can be finalized.\n canAutoFreeze_: true,\n unfinalizedDrafts_: 0\n };\n}\nfunction usePatchesInScope(scope, patchListener) {\n if (patchListener) {\n getPlugin(\"Patches\");\n scope.patches_ = [];\n scope.inversePatches_ = [];\n scope.patchListener_ = patchListener;\n }\n}\nfunction revokeScope(scope) {\n leaveScope(scope);\n scope.drafts_.forEach(revokeDraft);\n scope.drafts_ = null;\n}\nfunction leaveScope(scope) {\n if (scope === currentScope) {\n currentScope = scope.parent_;\n }\n}\nfunction enterScope(immer2) {\n return currentScope = createScope(currentScope, immer2);\n}\nfunction revokeDraft(draft) {\n const state = draft[DRAFT_STATE];\n if (state.type_ === 0 /* Object */ || state.type_ === 1 /* Array */)\n state.revoke_();\n else\n state.revoked_ = true;\n}\n\n// src/core/finalize.ts\nfunction processResult(result, scope) {\n scope.unfinalizedDrafts_ = scope.drafts_.length;\n const baseDraft = scope.drafts_[0];\n const isReplaced = result !== void 0 && result !== baseDraft;\n if (isReplaced) {\n if (baseDraft[DRAFT_STATE].modified_) {\n revokeScope(scope);\n die(4);\n }\n if (isDraftable(result)) {\n result = finalize(scope, result);\n if (!scope.parent_)\n maybeFreeze(scope, result);\n }\n if (scope.patches_) {\n getPlugin(\"Patches\").generateReplacementPatches_(\n baseDraft[DRAFT_STATE].base_,\n result,\n scope.patches_,\n scope.inversePatches_\n );\n }\n } else {\n result = finalize(scope, baseDraft, []);\n }\n revokeScope(scope);\n if (scope.patches_) {\n scope.patchListener_(scope.patches_, scope.inversePatches_);\n }\n return result !== NOTHING ? result : void 0;\n}\nfunction finalize(rootScope, value, path) {\n if (isFrozen(value))\n return value;\n const state = value[DRAFT_STATE];\n if (!state) {\n each(\n value,\n (key, childValue) => finalizeProperty(rootScope, state, value, key, childValue, path)\n );\n return value;\n }\n if (state.scope_ !== rootScope)\n return value;\n if (!state.modified_) {\n maybeFreeze(rootScope, state.base_, true);\n return state.base_;\n }\n if (!state.finalized_) {\n state.finalized_ = true;\n state.scope_.unfinalizedDrafts_--;\n const result = state.copy_;\n let resultEach = result;\n let isSet2 = false;\n if (state.type_ === 3 /* Set */) {\n resultEach = new Set(result);\n result.clear();\n isSet2 = true;\n }\n each(\n resultEach,\n (key, childValue) => finalizeProperty(rootScope, state, result, key, childValue, path, isSet2)\n );\n maybeFreeze(rootScope, result, false);\n if (path && rootScope.patches_) {\n getPlugin(\"Patches\").generatePatches_(\n state,\n path,\n rootScope.patches_,\n rootScope.inversePatches_\n );\n }\n }\n return state.copy_;\n}\nfunction finalizeProperty(rootScope, parentState, targetObject, prop, childValue, rootPath, targetIsSet) {\n if (process.env.NODE_ENV !== \"production\" && childValue === targetObject)\n die(5);\n if (isDraft(childValue)) {\n const path = rootPath && parentState && parentState.type_ !== 3 /* Set */ && // Set objects are atomic since they have no keys.\n !has(parentState.assigned_, prop) ? rootPath.concat(prop) : void 0;\n const res = finalize(rootScope, childValue, path);\n set(targetObject, prop, res);\n if (isDraft(res)) {\n rootScope.canAutoFreeze_ = false;\n } else\n return;\n } else if (targetIsSet) {\n targetObject.add(childValue);\n }\n if (isDraftable(childValue) && !isFrozen(childValue)) {\n if (!rootScope.immer_.autoFreeze_ && rootScope.unfinalizedDrafts_ < 1) {\n return;\n }\n finalize(rootScope, childValue);\n if ((!parentState || !parentState.scope_.parent_) && typeof prop !== \"symbol\" && Object.prototype.propertyIsEnumerable.call(targetObject, prop))\n maybeFreeze(rootScope, childValue);\n }\n}\nfunction maybeFreeze(scope, value, deep = false) {\n if (!scope.parent_ && scope.immer_.autoFreeze_ && scope.canAutoFreeze_) {\n freeze(value, deep);\n }\n}\n\n// src/core/proxy.ts\nfunction createProxyProxy(base, parent) {\n const isArray = Array.isArray(base);\n const state = {\n type_: isArray ? 1 /* Array */ : 0 /* Object */,\n // Track which produce call this is associated with.\n scope_: parent ? parent.scope_ : getCurrentScope(),\n // True for both shallow and deep changes.\n modified_: false,\n // Used during finalization.\n finalized_: false,\n // Track which properties have been assigned (true) or deleted (false).\n assigned_: {},\n // The parent draft state.\n parent_: parent,\n // The base state.\n base_: base,\n // The base proxy.\n draft_: null,\n // set below\n // The base copy with any updated values.\n copy_: null,\n // Called by the `produce` function.\n revoke_: null,\n isManual_: false\n };\n let target = state;\n let traps = objectTraps;\n if (isArray) {\n target = [state];\n traps = arrayTraps;\n }\n const { revoke, proxy } = Proxy.revocable(target, traps);\n state.draft_ = proxy;\n state.revoke_ = revoke;\n return proxy;\n}\nvar objectTraps = {\n get(state, prop) {\n if (prop === DRAFT_STATE)\n return state;\n const source = latest(state);\n if (!has(source, prop)) {\n return readPropFromProto(state, source, prop);\n }\n const value = source[prop];\n if (state.finalized_ || !isDraftable(value)) {\n return value;\n }\n if (value === peek(state.base_, prop)) {\n prepareCopy(state);\n return state.copy_[prop] = createProxy(value, state);\n }\n return value;\n },\n has(state, prop) {\n return prop in latest(state);\n },\n ownKeys(state) {\n return Reflect.ownKeys(latest(state));\n },\n set(state, prop, value) {\n const desc = getDescriptorFromProto(latest(state), prop);\n if (desc?.set) {\n desc.set.call(state.draft_, value);\n return true;\n }\n if (!state.modified_) {\n const current2 = peek(latest(state), prop);\n const currentState = current2?.[DRAFT_STATE];\n if (currentState && currentState.base_ === value) {\n state.copy_[prop] = value;\n state.assigned_[prop] = false;\n return true;\n }\n if (is(value, current2) && (value !== void 0 || has(state.base_, prop)))\n return true;\n prepareCopy(state);\n markChanged(state);\n }\n if (state.copy_[prop] === value && // special case: handle new props with value 'undefined'\n (value !== void 0 || prop in state.copy_) || // special case: NaN\n Number.isNaN(value) && Number.isNaN(state.copy_[prop]))\n return true;\n state.copy_[prop] = value;\n state.assigned_[prop] = true;\n return true;\n },\n deleteProperty(state, prop) {\n if (peek(state.base_, prop) !== void 0 || prop in state.base_) {\n state.assigned_[prop] = false;\n prepareCopy(state);\n markChanged(state);\n } else {\n delete state.assigned_[prop];\n }\n if (state.copy_) {\n delete state.copy_[prop];\n }\n return true;\n },\n // Note: We never coerce `desc.value` into an Immer draft, because we can't make\n // the same guarantee in ES5 mode.\n getOwnPropertyDescriptor(state, prop) {\n const owner = latest(state);\n const desc = Reflect.getOwnPropertyDescriptor(owner, prop);\n if (!desc)\n return desc;\n return {\n writable: true,\n configurable: state.type_ !== 1 /* Array */ || prop !== \"length\",\n enumerable: desc.enumerable,\n value: owner[prop]\n };\n },\n defineProperty() {\n die(11);\n },\n getPrototypeOf(state) {\n return getPrototypeOf(state.base_);\n },\n setPrototypeOf() {\n die(12);\n }\n};\nvar arrayTraps = {};\neach(objectTraps, (key, fn) => {\n arrayTraps[key] = function() {\n arguments[0] = arguments[0][0];\n return fn.apply(this, arguments);\n };\n});\narrayTraps.deleteProperty = function(state, prop) {\n if (process.env.NODE_ENV !== \"production\" && isNaN(parseInt(prop)))\n die(13);\n return arrayTraps.set.call(this, state, prop, void 0);\n};\narrayTraps.set = function(state, prop, value) {\n if (process.env.NODE_ENV !== \"production\" && prop !== \"length\" && isNaN(parseInt(prop)))\n die(14);\n return objectTraps.set.call(this, state[0], prop, value, state[0]);\n};\nfunction peek(draft, prop) {\n const state = draft[DRAFT_STATE];\n const source = state ? latest(state) : draft;\n return source[prop];\n}\nfunction readPropFromProto(state, source, prop) {\n const desc = getDescriptorFromProto(source, prop);\n return desc ? `value` in desc ? desc.value : (\n // This is a very special case, if the prop is a getter defined by the\n // prototype, we should invoke it with the draft as context!\n desc.get?.call(state.draft_)\n ) : void 0;\n}\nfunction getDescriptorFromProto(source, prop) {\n if (!(prop in source))\n return void 0;\n let proto = getPrototypeOf(source);\n while (proto) {\n const desc = Object.getOwnPropertyDescriptor(proto, prop);\n if (desc)\n return desc;\n proto = getPrototypeOf(proto);\n }\n return void 0;\n}\nfunction markChanged(state) {\n if (!state.modified_) {\n state.modified_ = true;\n if (state.parent_) {\n markChanged(state.parent_);\n }\n }\n}\nfunction prepareCopy(state) {\n if (!state.copy_) {\n state.copy_ = shallowCopy(\n state.base_,\n state.scope_.immer_.useStrictShallowCopy_\n );\n }\n}\n\n// src/core/immerClass.ts\nvar Immer2 = class {\n constructor(config) {\n this.autoFreeze_ = true;\n this.useStrictShallowCopy_ = false;\n /**\n * The `produce` function takes a value and a \"recipe function\" (whose\n * return value often depends on the base state). The recipe function is\n * free to mutate its first argument however it wants. All mutations are\n * only ever applied to a __copy__ of the base state.\n *\n * Pass only a function to create a \"curried producer\" which relieves you\n * from passing the recipe function every time.\n *\n * Only plain objects and arrays are made mutable. All other objects are\n * considered uncopyable.\n *\n * Note: This function is __bound__ to its `Immer` instance.\n *\n * @param {any} base - the initial state\n * @param {Function} recipe - function that receives a proxy of the base state as first argument and which can be freely modified\n * @param {Function} patchListener - optional function that will be called with all the patches produced here\n * @returns {any} a new state, or the initial state if nothing was modified\n */\n this.produce = (base, recipe, patchListener) => {\n if (typeof base === \"function\" && typeof recipe !== \"function\") {\n const defaultBase = recipe;\n recipe = base;\n const self = this;\n return function curriedProduce(base2 = defaultBase, ...args) {\n return self.produce(base2, (draft) => recipe.call(this, draft, ...args));\n };\n }\n if (typeof recipe !== \"function\")\n die(6);\n if (patchListener !== void 0 && typeof patchListener !== \"function\")\n die(7);\n let result;\n if (isDraftable(base)) {\n const scope = enterScope(this);\n const proxy = createProxy(base, void 0);\n let hasError = true;\n try {\n result = recipe(proxy);\n hasError = false;\n } finally {\n if (hasError)\n revokeScope(scope);\n else\n leaveScope(scope);\n }\n usePatchesInScope(scope, patchListener);\n return processResult(result, scope);\n } else if (!base || typeof base !== \"object\") {\n result = recipe(base);\n if (result === void 0)\n result = base;\n if (result === NOTHING)\n result = void 0;\n if (this.autoFreeze_)\n freeze(result, true);\n if (patchListener) {\n const p = [];\n const ip = [];\n getPlugin(\"Patches\").generateReplacementPatches_(base, result, p, ip);\n patchListener(p, ip);\n }\n return result;\n } else\n die(1, base);\n };\n this.produceWithPatches = (base, recipe) => {\n if (typeof base === \"function\") {\n return (state, ...args) => this.produceWithPatches(state, (draft) => base(draft, ...args));\n }\n let patches, inversePatches;\n const result = this.produce(base, recipe, (p, ip) => {\n patches = p;\n inversePatches = ip;\n });\n return [result, patches, inversePatches];\n };\n if (typeof config?.autoFreeze === \"boolean\")\n this.setAutoFreeze(config.autoFreeze);\n if (typeof config?.useStrictShallowCopy === \"boolean\")\n this.setUseStrictShallowCopy(config.useStrictShallowCopy);\n }\n createDraft(base) {\n if (!isDraftable(base))\n die(8);\n if (isDraft(base))\n base = current(base);\n const scope = enterScope(this);\n const proxy = createProxy(base, void 0);\n proxy[DRAFT_STATE].isManual_ = true;\n leaveScope(scope);\n return proxy;\n }\n finishDraft(draft, patchListener) {\n const state = draft && draft[DRAFT_STATE];\n if (!state || !state.isManual_)\n die(9);\n const { scope_: scope } = state;\n usePatchesInScope(scope, patchListener);\n return processResult(void 0, scope);\n }\n /**\n * Pass true to automatically freeze all copies created by Immer.\n *\n * By default, auto-freezing is enabled.\n */\n setAutoFreeze(value) {\n this.autoFreeze_ = value;\n }\n /**\n * Pass true to enable strict shallow copy.\n *\n * By default, immer does not copy the object descriptors such as getter, setter and non-enumrable properties.\n */\n setUseStrictShallowCopy(value) {\n this.useStrictShallowCopy_ = value;\n }\n applyPatches(base, patches) {\n let i;\n for (i = patches.length - 1; i >= 0; i--) {\n const patch = patches[i];\n if (patch.path.length === 0 && patch.op === \"replace\") {\n base = patch.value;\n break;\n }\n }\n if (i > -1) {\n patches = patches.slice(i + 1);\n }\n const applyPatchesImpl = getPlugin(\"Patches\").applyPatches_;\n if (isDraft(base)) {\n return applyPatchesImpl(base, patches);\n }\n return this.produce(\n base,\n (draft) => applyPatchesImpl(draft, patches)\n );\n }\n};\nfunction createProxy(value, parent) {\n const draft = isMap(value) ? getPlugin(\"MapSet\").proxyMap_(value, parent) : isSet(value) ? getPlugin(\"MapSet\").proxySet_(value, parent) : createProxyProxy(value, parent);\n const scope = parent ? parent.scope_ : getCurrentScope();\n scope.drafts_.push(draft);\n return draft;\n}\n\n// src/core/current.ts\nfunction current(value) {\n if (!isDraft(value))\n die(10, value);\n return currentImpl(value);\n}\nfunction currentImpl(value) {\n if (!isDraftable(value) || isFrozen(value))\n return value;\n const state = value[DRAFT_STATE];\n let copy;\n if (state) {\n if (!state.modified_)\n return state.base_;\n state.finalized_ = true;\n copy = shallowCopy(value, state.scope_.immer_.useStrictShallowCopy_);\n } else {\n copy = shallowCopy(value, true);\n }\n each(copy, (key, childValue) => {\n set(copy, key, currentImpl(childValue));\n });\n if (state) {\n state.finalized_ = false;\n }\n return copy;\n}\n\n// src/plugins/patches.ts\nfunction enablePatches() {\n const errorOffset = 16;\n if (process.env.NODE_ENV !== \"production\") {\n errors.push(\n 'Sets cannot have \"replace\" patches.',\n function(op) {\n return \"Unsupported patch operation: \" + op;\n },\n function(path) {\n return \"Cannot apply patch, path doesn't resolve: \" + path;\n },\n \"Patching reserved attributes like __proto__, prototype and constructor is not allowed\"\n );\n }\n const REPLACE = \"replace\";\n const ADD = \"add\";\n const REMOVE = \"remove\";\n function generatePatches_(state, basePath, patches, inversePatches) {\n switch (state.type_) {\n case 0 /* Object */:\n case 2 /* Map */:\n return generatePatchesFromAssigned(\n state,\n basePath,\n patches,\n inversePatches\n );\n case 1 /* Array */:\n return generateArrayPatches(state, basePath, patches, inversePatches);\n case 3 /* Set */:\n return generateSetPatches(\n state,\n basePath,\n patches,\n inversePatches\n );\n }\n }\n function generateArrayPatches(state, basePath, patches, inversePatches) {\n let { base_, assigned_ } = state;\n let copy_ = state.copy_;\n if (copy_.length < base_.length) {\n ;\n [base_, copy_] = [copy_, base_];\n [patches, inversePatches] = [inversePatches, patches];\n }\n for (let i = 0; i < base_.length; i++) {\n if (assigned_[i] && copy_[i] !== base_[i]) {\n const path = basePath.concat([i]);\n patches.push({\n op: REPLACE,\n path,\n // Need to maybe clone it, as it can in fact be the original value\n // due to the base/copy inversion at the start of this function\n value: clonePatchValueIfNeeded(copy_[i])\n });\n inversePatches.push({\n op: REPLACE,\n path,\n value: clonePatchValueIfNeeded(base_[i])\n });\n }\n }\n for (let i = base_.length; i < copy_.length; i++) {\n const path = basePath.concat([i]);\n patches.push({\n op: ADD,\n path,\n // Need to maybe clone it, as it can in fact be the original value\n // due to the base/copy inversion at the start of this function\n value: clonePatchValueIfNeeded(copy_[i])\n });\n }\n for (let i = copy_.length - 1; base_.length <= i; --i) {\n const path = basePath.concat([i]);\n inversePatches.push({\n op: REMOVE,\n path\n });\n }\n }\n function generatePatchesFromAssigned(state, basePath, patches, inversePatches) {\n const { base_, copy_ } = state;\n each(state.assigned_, (key, assignedValue) => {\n const origValue = get(base_, key);\n const value = get(copy_, key);\n const op = !assignedValue ? REMOVE : has(base_, key) ? REPLACE : ADD;\n if (origValue === value && op === REPLACE)\n return;\n const path = basePath.concat(key);\n patches.push(op === REMOVE ? { op, path } : { op, path, value });\n inversePatches.push(\n op === ADD ? { op: REMOVE, path } : op === REMOVE ? { op: ADD, path, value: clonePatchValueIfNeeded(origValue) } : { op: REPLACE, path, value: clonePatchValueIfNeeded(origValue) }\n );\n });\n }\n function generateSetPatches(state, basePath, patches, inversePatches) {\n let { base_, copy_ } = state;\n let i = 0;\n base_.forEach((value) => {\n if (!copy_.has(value)) {\n const path = basePath.concat([i]);\n patches.push({\n op: REMOVE,\n path,\n value\n });\n inversePatches.unshift({\n op: ADD,\n path,\n value\n });\n }\n i++;\n });\n i = 0;\n copy_.forEach((value) => {\n if (!base_.has(value)) {\n const path = basePath.concat([i]);\n patches.push({\n op: ADD,\n path,\n value\n });\n inversePatches.unshift({\n op: REMOVE,\n path,\n value\n });\n }\n i++;\n });\n }\n function generateReplacementPatches_(baseValue, replacement, patches, inversePatches) {\n patches.push({\n op: REPLACE,\n path: [],\n value: replacement === NOTHING ? void 0 : replacement\n });\n inversePatches.push({\n op: REPLACE,\n path: [],\n value: baseValue\n });\n }\n function applyPatches_(draft, patches) {\n patches.forEach((patch) => {\n const { path, op } = patch;\n let base = draft;\n for (let i = 0; i < path.length - 1; i++) {\n const parentType = getArchtype(base);\n let p = path[i];\n if (typeof p !== \"string\" && typeof p !== \"number\") {\n p = \"\" + p;\n }\n if ((parentType === 0 /* Object */ || parentType === 1 /* Array */) && (p === \"__proto__\" || p === \"constructor\"))\n die(errorOffset + 3);\n if (typeof base === \"function\" && p === \"prototype\")\n die(errorOffset + 3);\n base = get(base, p);\n if (typeof base !== \"object\")\n die(errorOffset + 2, path.join(\"/\"));\n }\n const type = getArchtype(base);\n const value = deepClonePatchValue(patch.value);\n const key = path[path.length - 1];\n switch (op) {\n case REPLACE:\n switch (type) {\n case 2 /* Map */:\n return base.set(key, value);\n case 3 /* Set */:\n die(errorOffset);\n default:\n return base[key] = value;\n }\n case ADD:\n switch (type) {\n case 1 /* Array */:\n return key === \"-\" ? base.push(value) : base.splice(key, 0, value);\n case 2 /* Map */:\n return base.set(key, value);\n case 3 /* Set */:\n return base.add(value);\n default:\n return base[key] = value;\n }\n case REMOVE:\n switch (type) {\n case 1 /* Array */:\n return base.splice(key, 1);\n case 2 /* Map */:\n return base.delete(key);\n case 3 /* Set */:\n return base.delete(patch.value);\n default:\n return delete base[key];\n }\n default:\n die(errorOffset + 1, op);\n }\n });\n return draft;\n }\n function deepClonePatchValue(obj) {\n if (!isDraftable(obj))\n return obj;\n if (Array.isArray(obj))\n return obj.map(deepClonePatchValue);\n if (isMap(obj))\n return new Map(\n Array.from(obj.entries()).map(([k, v]) => [k, deepClonePatchValue(v)])\n );\n if (isSet(obj))\n return new Set(Array.from(obj).map(deepClonePatchValue));\n const cloned = Object.create(getPrototypeOf(obj));\n for (const key in obj)\n cloned[key] = deepClonePatchValue(obj[key]);\n if (has(obj, DRAFTABLE))\n cloned[DRAFTABLE] = obj[DRAFTABLE];\n return cloned;\n }\n function clonePatchValueIfNeeded(obj) {\n if (isDraft(obj)) {\n return deepClonePatchValue(obj);\n } else\n return obj;\n }\n loadPlugin(\"Patches\", {\n applyPatches_,\n generatePatches_,\n generateReplacementPatches_\n });\n}\n\n// src/plugins/mapset.ts\nfunction enableMapSet() {\n class DraftMap extends Map {\n constructor(target, parent) {\n super();\n this[DRAFT_STATE] = {\n type_: 2 /* Map */,\n parent_: parent,\n scope_: parent ? parent.scope_ : getCurrentScope(),\n modified_: false,\n finalized_: false,\n copy_: void 0,\n assigned_: void 0,\n base_: target,\n draft_: this,\n isManual_: false,\n revoked_: false\n };\n }\n get size() {\n return latest(this[DRAFT_STATE]).size;\n }\n has(key) {\n return latest(this[DRAFT_STATE]).has(key);\n }\n set(key, value) {\n const state = this[DRAFT_STATE];\n assertUnrevoked(state);\n if (!latest(state).has(key) || latest(state).get(key) !== value) {\n prepareMapCopy(state);\n markChanged(state);\n state.assigned_.set(key, true);\n state.copy_.set(key, value);\n state.assigned_.set(key, true);\n }\n return this;\n }\n delete(key) {\n if (!this.has(key)) {\n return false;\n }\n const state = this[DRAFT_STATE];\n assertUnrevoked(state);\n prepareMapCopy(state);\n markChanged(state);\n if (state.base_.has(key)) {\n state.assigned_.set(key, false);\n } else {\n state.assigned_.delete(key);\n }\n state.copy_.delete(key);\n return true;\n }\n clear() {\n const state = this[DRAFT_STATE];\n assertUnrevoked(state);\n if (latest(state).size) {\n prepareMapCopy(state);\n markChanged(state);\n state.assigned_ = /* @__PURE__ */ new Map();\n each(state.base_, (key) => {\n state.assigned_.set(key, false);\n });\n state.copy_.clear();\n }\n }\n forEach(cb, thisArg) {\n const state = this[DRAFT_STATE];\n latest(state).forEach((_value, key, _map) => {\n cb.call(thisArg, this.get(key), key, this);\n });\n }\n get(key) {\n const state = this[DRAFT_STATE];\n assertUnrevoked(state);\n const value = latest(state).get(key);\n if (state.finalized_ || !isDraftable(value)) {\n return value;\n }\n if (value !== state.base_.get(key)) {\n return value;\n }\n const draft = createProxy(value, state);\n prepareMapCopy(state);\n state.copy_.set(key, draft);\n return draft;\n }\n keys() {\n return latest(this[DRAFT_STATE]).keys();\n }\n values() {\n const iterator = this.keys();\n return {\n [Symbol.iterator]: () => this.values(),\n next: () => {\n const r = iterator.next();\n if (r.done)\n return r;\n const value = this.get(r.value);\n return {\n done: false,\n value\n };\n }\n };\n }\n entries() {\n const iterator = this.keys();\n return {\n [Symbol.iterator]: () => this.entries(),\n next: () => {\n const r = iterator.next();\n if (r.done)\n return r;\n const value = this.get(r.value);\n return {\n done: false,\n value: [r.value, value]\n };\n }\n };\n }\n [(DRAFT_STATE, Symbol.iterator)]() {\n return this.entries();\n }\n }\n function proxyMap_(target, parent) {\n return new DraftMap(target, parent);\n }\n function prepareMapCopy(state) {\n if (!state.copy_) {\n state.assigned_ = /* @__PURE__ */ new Map();\n state.copy_ = new Map(state.base_);\n }\n }\n class DraftSet extends Set {\n constructor(target, parent) {\n super();\n this[DRAFT_STATE] = {\n type_: 3 /* Set */,\n parent_: parent,\n scope_: parent ? parent.scope_ : getCurrentScope(),\n modified_: false,\n finalized_: false,\n copy_: void 0,\n base_: target,\n draft_: this,\n drafts_: /* @__PURE__ */ new Map(),\n revoked_: false,\n isManual_: false\n };\n }\n get size() {\n return latest(this[DRAFT_STATE]).size;\n }\n has(value) {\n const state = this[DRAFT_STATE];\n assertUnrevoked(state);\n if (!state.copy_) {\n return state.base_.has(value);\n }\n if (state.copy_.has(value))\n return true;\n if (state.drafts_.has(value) && state.copy_.has(state.drafts_.get(value)))\n return true;\n return false;\n }\n add(value) {\n const state = this[DRAFT_STATE];\n assertUnrevoked(state);\n if (!this.has(value)) {\n prepareSetCopy(state);\n markChanged(state);\n state.copy_.add(value);\n }\n return this;\n }\n delete(value) {\n if (!this.has(value)) {\n return false;\n }\n const state = this[DRAFT_STATE];\n assertUnrevoked(state);\n prepareSetCopy(state);\n markChanged(state);\n return state.copy_.delete(value) || (state.drafts_.has(value) ? state.copy_.delete(state.drafts_.get(value)) : (\n /* istanbul ignore next */\n false\n ));\n }\n clear() {\n const state = this[DRAFT_STATE];\n assertUnrevoked(state);\n if (latest(state).size) {\n prepareSetCopy(state);\n markChanged(state);\n state.copy_.clear();\n }\n }\n values() {\n const state = this[DRAFT_STATE];\n assertUnrevoked(state);\n prepareSetCopy(state);\n return state.copy_.values();\n }\n entries() {\n const state = this[DRAFT_STATE];\n assertUnrevoked(state);\n prepareSetCopy(state);\n return state.copy_.entries();\n }\n keys() {\n return this.values();\n }\n [(DRAFT_STATE, Symbol.iterator)]() {\n return this.values();\n }\n forEach(cb, thisArg) {\n const iterator = this.values();\n let result = iterator.next();\n while (!result.done) {\n cb.call(thisArg, result.value, result.value, this);\n result = iterator.next();\n }\n }\n }\n function proxySet_(target, parent) {\n return new DraftSet(target, parent);\n }\n function prepareSetCopy(state) {\n if (!state.copy_) {\n state.copy_ = /* @__PURE__ */ new Set();\n state.base_.forEach((value) => {\n if (isDraftable(value)) {\n const draft = createProxy(value, state);\n state.drafts_.set(value, draft);\n state.copy_.add(draft);\n } else {\n state.copy_.add(value);\n }\n });\n }\n }\n function assertUnrevoked(state) {\n if (state.revoked_)\n die(3, JSON.stringify(latest(state)));\n }\n loadPlugin(\"MapSet\", { proxyMap_, proxySet_ });\n}\n\n// src/immer.ts\nvar immer = new Immer2();\nvar produce = immer.produce;\nvar produceWithPatches = immer.produceWithPatches.bind(\n immer\n);\nvar setAutoFreeze = immer.setAutoFreeze.bind(immer);\nvar setUseStrictShallowCopy = immer.setUseStrictShallowCopy.bind(immer);\nvar applyPatches = immer.applyPatches.bind(immer);\nvar createDraft = immer.createDraft.bind(immer);\nvar finishDraft = immer.finishDraft.bind(immer);\nfunction castDraft(value) {\n return value;\n}\nfunction castImmutable(value) {\n return value;\n}\nexport {\n Immer2 as Immer,\n applyPatches,\n castDraft,\n castImmutable,\n createDraft,\n current,\n enableMapSet,\n enablePatches,\n finishDraft,\n freeze,\n DRAFTABLE as immerable,\n isDraft,\n isDraftable,\n NOTHING as nothing,\n original,\n produce,\n produceWithPatches,\n setAutoFreeze,\n setUseStrictShallowCopy\n};\n//# sourceMappingURL=immer.mjs.map","import { createStore } from \"zustand/vanilla\";\nimport { subscribeWithSelector } from \"zustand/middleware\";\nimport { shallow } from \"zustand/shallow\";\nimport { freeze, produce } from \"immer\";\n//#region lib/types/index.js\n/**\n* React-free snapshot store engine (zustand vanilla + immer + subscribeWithSelector +\n* rafFlush middleware + opt-in persist + dev freeze) plus the declarative\n* shell over it: {@link defineStore} bakes an init/persist/actions literal\n* into a {@link StoreHandle}, the registration-side store seat of slot\n* terminals. Engine products are bare observables — subscribe/getSnapshot/\n* update/set, NO selector hook. Hook synthesis is ui-renderer's (the one\n* uSES bridge, cached per source at the binding site).\n*/\n/**\n* Notify an observer set without allowing one callback to starve the rest.\n* @param listeners - current observer callbacks; copied before dispatch.\n* @param label - diagnostic owner prefix.\n* @param args - callback arguments.\n*/\nfunction notifySubscribers(listeners, label, ...args) {\n\tfor (const listener of [...listeners]) try {\n\t\tlistener(...args);\n\t} catch (error) {\n\t\tconsole.error(`${label} subscriber failed:`, error);\n\t}\n}\n/**\n* Shallow equality for selector slices (zustand/shallow semantics; travels\n* with the engine so hook consumers need no zustand dependency).\n* @param a - left value.\n* @param b - right value.\n* @returns whether the values are shallowly equal.\n*/\nfunction shallowEqual(a, b) {\n\treturn shallow(a, b);\n}\n/** Batches subscriber notification into one flush per animation frame. */\nfunction rafBatch(notify) {\n\tconst schedule = typeof requestAnimationFrame === \"function\" ? (fn) => {\n\t\trequestAnimationFrame(() => {\n\t\t\tfn();\n\t\t});\n\t} : (fn) => {\n\t\tqueueMicrotask(fn);\n\t};\n\tlet scheduled = false;\n\treturn () => {\n\t\tif (scheduled) return;\n\t\tscheduled = true;\n\t\tschedule(() => {\n\t\t\tscheduled = false;\n\t\t\tnotify();\n\t\t});\n\t};\n}\n/**\n* Create a snapshot store.\n*\n* Flush default is 'sync' (controlled inputs need same-tick echo); frame-driven\n* stores opt into 'raf', where a frame's worth of updates coalesces into one\n* notification. Known raf-mode tradeoff: a component mounting mid-frame reads\n* fresh state while existing subscribers hear it next flush — transient\n* frame-level skew, same nature as the object layer's microtask batching.\n*\n* @param init - initial state.\n* @param opts - flush mode and opt-in persistence (localStorage, keyed by name).\n* @returns the store.\n*/\nfunction createSnapshotStore(init, opts) {\n\tconst withSelector = subscribeWithSelector(() => init);\n\tconst api = createStore()(withSelector);\n\tif (opts?.persist) attachPersistence(api, opts.persist.name);\n\tlet subscribe = (fn) => api.subscribe(() => {\n\t\tnotifySubscribers([fn], \"[client-store]\");\n\t});\n\tif (opts?.flush === \"raf\") {\n\t\tconst listeners = /* @__PURE__ */ new Set();\n\t\tconst flush = rafBatch(() => {\n\t\t\tnotifySubscribers(listeners, \"[client-store]\");\n\t\t});\n\t\tapi.subscribe(flush);\n\t\tsubscribe = (fn) => {\n\t\t\tlisteners.add(fn);\n\t\t\treturn () => {\n\t\t\t\tlisteners.delete(fn);\n\t\t\t};\n\t\t};\n\t}\n\treturn {\n\t\tgetSnapshot: () => api.getState(),\n\t\tsubscribe: (fn) => subscribe(fn),\n\t\tupdate: (mutator) => {\n\t\t\tapi.setState(produce(api.getState(), (draft) => {\n\t\t\t\tmutator(draft);\n\t\t\t}), true);\n\t\t},\n\t\tset: (next) => {\n\t\t\tapi.setState(devFreeze(next), true);\n\t\t}\n\t};\n}\n/**\n* Whole-value JSON persistence to localStorage. Hand-rolled instead of the\n* zustand persist middleware: its write path spreads state into an object\n* (`partialize({ ...get() })`), exploding primitive state (a persisted string\n* draft becomes {0:'h',1:'e',...}) — not fixable via merge/deserialize options\n* because the corruption happens before serialization. Storage failures\n* (quota, private mode) only disable persistence, never break the store.\n*/\nfunction attachPersistence(api, name) {\n\tif (typeof localStorage === \"undefined\") return;\n\ttry {\n\t\tconst raw = localStorage.getItem(name);\n\t\tif (raw !== null) api.setState(devFreeze(JSON.parse(raw)), true);\n\t} catch (error) {\n\t\tconsole.error(`snapshot store '${name}' rehydration failed:`, error);\n\t}\n\tapi.subscribe((state) => {\n\t\ttry {\n\t\t\tlocalStorage.setItem(name, JSON.stringify(state));\n\t\t} catch (error) {\n\t\t\tconsole.error(`snapshot store '${name}' persistence failed:`, error);\n\t\t}\n\t});\n}\n/** Deep-freeze draftable wholesale-set state outside production: set() bypasses immer's freeze. */\nfunction devFreeze(value) {\n\treturn freeze(value, true);\n}\n/**\n* Declare a store: initial state, optional persistence, and the full write\n* set as pure draft mutators. The returned handle is the registration\n* currency of the store seat — its identity keys instance sharing. Satisfies\n* ui-slots' DefineStore contract (the handle/instance are the engine-extended\n* subtypes).\n*\n* The `A & ActionsDecl<T>` actions position is load-bearing: T resolves from\n* `init` in the first inference round, and the intersection then contextually\n* types each mutator's draft parameter (context-sensitive functions defer),\n* so call sites write `(d, x: X) => { ... }` with no draft annotation. If a\n* future TS version breaks this single-literal inference, the design's\n* documented fallback is currying (`defineStore(init).actions({...})`).\n* @param decl - init lambda (fresh state per instance), optional persist key, actions table.\n* @returns the store handle.\n*/\nfunction defineStore(decl) {\n\treturn {\n\t\tspec: decl,\n\t\tcreate(scopeKey) {\n\t\t\tconst persistKey = decl.persist === void 0 ? void 0 : scopeKey === void 0 ? decl.persist : `${decl.persist}.${scopeKey}`;\n\t\t\tconst store = createSnapshotStore(decl.init(), persistKey !== void 0 ? { persist: { name: persistKey } } : void 0);\n\t\t\tconst actions = {};\n\t\t\tfor (const key of Object.keys(decl.actions)) {\n\t\t\t\tconst mutate = decl.actions[key];\n\t\t\t\tactions[key] = (...params) => {\n\t\t\t\t\tstore.update((draft) => {\n\t\t\t\t\t\tmutate(draft, ...params);\n\t\t\t\t\t});\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tactions,\n\t\t\t\tgetSnapshot: () => store.getSnapshot(),\n\t\t\t\tsubscribe: (fn) => store.subscribe(fn),\n\t\t\t\tstore,\n\t\t\t\tclearPersisted: () => {\n\t\t\t\t\tif (persistKey === void 0 || typeof localStorage === \"undefined\") return;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tlocalStorage.removeItem(persistKey);\n\t\t\t\t\t} catch {}\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t};\n}\n//#endregion\nexport { createSnapshotStore, defineStore, notifySubscribers, shallowEqual };\n\n//# sourceMappingURL=index.js.map","/** Browser-safe eye-care settings and RPC wire values. */\n\n/** User-selectable eye-care operating modes. */\nexport const EYE_CARE_MODES = ['off', 'auto', 'light', 'dark'] as const\n\n/** Warmth levels shared by light and dark palettes. */\nexport const EYE_CARE_INTENSITIES = ['soft', 'balanced', 'warm'] as const\n\n/** Eye-care operating mode. */\nexport type EyeCareMode = typeof EYE_CARE_MODES[number]\n\n/** Eye-care warmth level. */\nexport type EyeCareIntensity = typeof EYE_CARE_INTENSITIES[number]\n\n/** Settings namespace owned by this package. */\nexport const EYE_CARE_SETTINGS_NAMESPACE = 'eye-care'\n\n/** Loopback-only Connection RPC channel owned by this package. */\nexport const EYE_CARE_RPC_CHANNEL = '/eye-care'\n\n/** RPC endpoint that reads the current settings snapshot. */\nexport const EYE_CARE_RPC_READ = 'settings.read'\n\n/** RPC endpoint that replaces the settings section. */\nexport const EYE_CARE_RPC_SAVE = 'settings.save'\n\n/** Settings field carrying the selected mode. */\nexport const MODE_FIELD = 'mode'\n\n/** Settings field carrying the selected warmth. */\nexport const INTENSITY_FIELD = 'intensity'\n\n/** Defaults used when no user section exists. */\nexport const DEFAULT_EYE_CARE_SETTINGS: Readonly<EyeCareSettings> = Object.freeze({\n mode: 'off',\n intensity: 'balanced',\n})\n\n/** Persisted eye-care preferences. */\nexport interface EyeCareSettings {\n /** Whether eye care is disabled, system-aware, light, or dark. */\n mode: EyeCareMode\n /** Warmth applied by the active eye-care palette. */\n intensity: EyeCareIntensity\n /** Built-in preference to restore after a token-layer host reload. */\n restoreTheme?: 'light' | 'dark' | 'system'\n}\n\n/** Browser-safe Host snapshot returned through the loopback RPC channel. */\nexport interface EyeCareSettingsSnapshot {\n /** Wire schema version for this dedicated endpoint. */\n schemaVersion: 1\n /** Whether the active settings provider accepts writes. */\n writable: boolean\n /** Resolved settings and the revision fencing the next write. */\n settings: {\n value: EyeCareSettings\n revision: number\n applies: 'live'\n }\n /** Durable built-in Appearance preference used to fence startup convergence. */\n baseThemePreference?: 'light' | 'dark' | 'system'\n}\n\n/** Revision-fenced write request. */\nexport interface EyeCareSettingsWriteRequest {\n expectedRevision: number\n value: EyeCareSettings\n}\n\n/** Narrow an unknown value to one supported mode. */\nexport function isEyeCareMode(value: unknown): value is EyeCareMode {\n return EYE_CARE_MODES.some(mode => mode === value)\n}\n\n/** Narrow an unknown value to one supported warmth. */\nexport function isEyeCareIntensity(value: unknown): value is EyeCareIntensity {\n return EYE_CARE_INTENSITIES.some(intensity => intensity === value)\n}\n\n/** Decode a complete settings value from the RPC boundary. */\nexport function decodeEyeCareSettings(value: unknown): EyeCareSettings | undefined {\n if (typeof value !== 'object' || value === null || Array.isArray(value)) return undefined\n const record = value as Record<string, unknown>\n if (!isEyeCareMode(record[MODE_FIELD]) || !isEyeCareIntensity(record[INTENSITY_FIELD])) return undefined\n const restoreTheme = record['restoreTheme']\n if (restoreTheme !== undefined && restoreTheme !== 'light' && restoreTheme !== 'dark' && restoreTheme !== 'system') return undefined\n return { mode: record[MODE_FIELD], intensity: record[INTENSITY_FIELD], ...(restoreTheme === undefined ? {} : { restoreTheme }) }\n}\n\n/** Decode one complete Host snapshot from the RPC boundary. */\nexport function decodeEyeCareSnapshot(value: unknown): EyeCareSettingsSnapshot | undefined {\n if (typeof value !== 'object' || value === null || Array.isArray(value)) return undefined\n const record = value as Record<string, unknown>\n const settingsEnvelope = record['settings']\n if (record['schemaVersion'] !== 1 || typeof record['writable'] !== 'boolean'\n || typeof settingsEnvelope !== 'object' || settingsEnvelope === null || Array.isArray(settingsEnvelope)) return undefined\n const settingsRecord = settingsEnvelope as Record<string, unknown>\n const settings = decodeEyeCareSettings(settingsRecord['value'])\n const revision = settingsRecord['revision']\n if (settings === undefined || !Number.isSafeInteger(revision) || (revision as number) < 0\n || settingsRecord['applies'] !== 'live') return undefined\n const baseThemePreference = record['baseThemePreference']\n if (baseThemePreference !== undefined\n && baseThemePreference !== 'light' && baseThemePreference !== 'dark' && baseThemePreference !== 'system') return undefined\n return {\n schemaVersion: 1,\n writable: record['writable'],\n settings: {\n value: settings,\n revision: revision as number,\n applies: 'live',\n },\n ...(baseThemePreference === undefined ? {} : { baseThemePreference }),\n }\n}\n","/** Fixed eye-care themes built from semantic DSH Web tokens. */\n\nimport type { ThemeDefinition, ThemeTokens } from '@deepseek-ai/dsh-client-ui-theme/client'\nimport type { EyeCareIntensity } from '../shared.ts'\n\n/** Theme id prefix reserved by this package. */\nexport const EYE_CARE_THEME_PREFIX = 'eye-care-'\n\ntype Scheme = 'light' | 'dark'\n\ninterface Palette {\n bgBase: string\n bgLayer1: string\n bgLayer2: string\n bgLayer3: string\n bgModule: string\n bgOverlay: string\n textPrimary: string\n textSecondary: string\n textTertiary: string\n textCaption: string\n border1: string\n border2: string\n border3: string\n hover: string\n hoverSolid: string\n active: string\n primaryFill: string\n primaryHover: string\n primaryDimmed: string\n bubble: string\n bubbleHighlight: string\n input: string\n selector: string\n sidebar: string\n sidebarHover: string\n sidebarActive: string\n sidebarAccent: string\n code: string\n codeBanner: string\n inlineCode: string\n scrollbar: string\n scrollbarHover: string\n shiki: {\n constant: string\n string: string\n comment: string\n keyword: string\n parameter: string\n function: string\n stringExpression: string\n punctuation: string\n link: string\n }\n}\n\nconst LIGHT: Record<EyeCareIntensity, Palette> = {\n soft: {\n bgBase: '#fbf8ef', bgLayer1: '#fffdf6', bgLayer2: '#f8f3e8', bgLayer3: '#f2ecde',\n bgModule: '#f7f2e7', bgOverlay: '#ece4d5', textPrimary: '#29271f', textSecondary: '#575247',\n textTertiary: '#716a5d', textCaption: '#958b7a', border1: 'rgba(85, 72, 46, 0.08)',\n border2: 'rgba(85, 72, 46, 0.15)', border3: 'rgba(85, 72, 46, 0.21)',\n hover: 'rgba(126, 101, 53, 0.08)', hoverSolid: '#f1eadc', active: 'rgba(126, 101, 53, 0.14)',\n primaryFill: '#44583d', primaryHover: '#536a49', primaryDimmed: '#dfe6d9',\n bubble: '#eef3df', bubbleHighlight: '#e0e9cb', input: '#fffdf6', selector: '#f2ecde',\n sidebar: '#f4efe3', sidebarHover: '#ebe4d5', sidebarActive: '#e2dac9', sidebarAccent: '#d6e0c1',\n code: '#f2eee4', codeBanner: '#ebe5d8', inlineCode: '#eee8db', scrollbar: '#d1c6b4',\n scrollbarHover: '#baad98',\n shiki: {\n constant: '#176f88', string: '#34783c', comment: '#817768', keyword: '#a03e58',\n parameter: '#a15b1f', function: '#6950a6', stringExpression: '#2f7040', punctuation: '#5a554d', link: '#246d9a',\n },\n },\n balanced: {\n bgBase: '#faf5e8', bgLayer1: '#fffaf0', bgLayer2: '#f5eddd', bgLayer3: '#eee3d0',\n bgModule: '#f3ead9', bgOverlay: '#e7dbc7', textPrimary: '#2b281f', textSecondary: '#5b5345',\n textTertiary: '#766d5b', textCaption: '#9b8e77', border1: 'rgba(93, 72, 36, 0.09)',\n border2: 'rgba(93, 72, 36, 0.17)', border3: 'rgba(93, 72, 36, 0.24)',\n hover: 'rgba(139, 100, 37, 0.09)', hoverSolid: '#eee3d1', active: 'rgba(139, 100, 37, 0.16)',\n primaryFill: '#425b3c', primaryHover: '#52704a', primaryDimmed: '#dce7d3',\n bubble: '#eaf1d5', bubbleHighlight: '#dce7bc', input: '#fffaf0', selector: '#eee3d0',\n sidebar: '#f1e8d7', sidebarHover: '#e7dcc8', sidebarActive: '#ddd0b9', sidebarAccent: '#d2dfb3',\n code: '#efe9dc', codeBanner: '#e6dece', inlineCode: '#ebe2d1', scrollbar: '#ccbda6',\n scrollbarHover: '#b3a188',\n shiki: {\n constant: '#146d87', string: '#39753b', comment: '#837664', keyword: '#a13e57',\n parameter: '#a1581c', function: '#684ba3', stringExpression: '#34703d', punctuation: '#5d5549', link: '#206c98',\n },\n },\n warm: {\n bgBase: '#f8efda', bgLayer1: '#fff7e7', bgLayer2: '#f2e6d0', bgLayer3: '#eadcc4',\n bgModule: '#f0e3cc', bgOverlay: '#e1d0b5', textPrimary: '#30291f', textSecondary: '#615343',\n textTertiary: '#7c6a56', textCaption: '#a08b70', border1: 'rgba(105, 73, 30, 0.10)',\n border2: 'rgba(105, 73, 30, 0.19)', border3: 'rgba(105, 73, 30, 0.27)',\n hover: 'rgba(151, 97, 27, 0.10)', hoverSolid: '#eadbc2', active: 'rgba(151, 97, 27, 0.18)',\n primaryFill: '#3f5c39', primaryHover: '#506f46', primaryDimmed: '#d8e5ce',\n bubble: '#e6efc9', bubbleHighlight: '#d6e3ac', input: '#fff7e7', selector: '#eadcc4',\n sidebar: '#eee1ca', sidebarHover: '#e3d3b9', sidebarActive: '#d7c4a7', sidebarAccent: '#cedeaa',\n code: '#ece2d1', codeBanner: '#e2d5c0', inlineCode: '#e7dac4', scrollbar: '#c7b398',\n scrollbarHover: '#ad9779',\n shiki: {\n constant: '#116b83', string: '#3e7439', comment: '#85735e', keyword: '#a33b54',\n parameter: '#a25418', function: '#67459e', stringExpression: '#386d39', punctuation: '#625344', link: '#1c6b94',\n },\n },\n}\n\nconst DARK: Record<EyeCareIntensity, Palette> = {\n soft: {\n bgBase: '#20211c', bgLayer1: '#25261f', bgLayer2: '#2a2b23', bgLayer3: '#313128',\n bgModule: '#2d2e26', bgOverlay: '#3a392e', textPrimary: '#ece9dc', textSecondary: '#c7c1b0',\n textTertiary: '#aaa28f', textCaption: '#7f786a', border1: 'rgba(245, 233, 201, 0.07)',\n border2: 'rgba(245, 233, 201, 0.13)', border3: 'rgba(245, 233, 201, 0.19)',\n hover: 'rgba(244, 227, 182, 0.08)', hoverSolid: '#36362c', active: 'rgba(244, 227, 182, 0.14)',\n primaryFill: '#dfe9cf', primaryHover: '#f1f5e7', primaryDimmed: '#4d5143',\n bubble: '#30372a', bubbleHighlight: '#3d4933', input: '#2b2d25', selector: '#37382e',\n sidebar: '#252820', sidebarHover: '#30342a', sidebarActive: '#3a3e32', sidebarAccent: '#3f4b35',\n code: '#1c1e1b', codeBanner: '#252821', inlineCode: '#292c24', scrollbar: '#57584d',\n scrollbarHover: '#707064',\n shiki: {\n constant: '#68b7d2', string: '#91c88b', comment: '#9d988d', keyword: '#e39aaf',\n parameter: '#e6ad72', function: '#b9a5df', stringExpression: '#9bcf91', punctuation: '#c7c2b7', link: '#77b8d9',\n },\n },\n balanced: {\n bgBase: '#211f19', bgLayer1: '#27231c', bgLayer2: '#2d2921', bgLayer3: '#353027',\n bgModule: '#302b22', bgOverlay: '#40382b', textPrimary: '#efe7d6', textSecondary: '#cbc0aa',\n textTertiary: '#aea087', textCaption: '#837662', border1: 'rgba(250, 230, 190, 0.08)',\n border2: 'rgba(250, 230, 190, 0.15)', border3: 'rgba(250, 230, 190, 0.21)',\n hover: 'rgba(247, 216, 157, 0.09)', hoverSolid: '#3b352b', active: 'rgba(247, 216, 157, 0.16)',\n primaryFill: '#e0ebcf', primaryHover: '#f2f7e6', primaryDimmed: '#505243',\n bubble: '#32392a', bubbleHighlight: '#404c32', input: '#302b23', selector: '#3b352a',\n sidebar: '#282820', sidebarHover: '#33342a', sidebarActive: '#3d3e32', sidebarAccent: '#435036',\n code: '#1d1d19', codeBanner: '#28251f', inlineCode: '#2d2922', scrollbar: '#5b584b',\n scrollbarHover: '#757062',\n shiki: {\n constant: '#69b8d0', string: '#94c985', comment: '#a19a8d', keyword: '#e49aad',\n parameter: '#e7aa6c', function: '#bca2df', stringExpression: '#9dcc89', punctuation: '#cbc2b2', link: '#79b9d5',\n },\n },\n warm: {\n bgBase: '#231e17', bgLayer1: '#2a231b', bgLayer2: '#31291f', bgLayer3: '#3a3025',\n bgModule: '#342b21', bgOverlay: '#46392b', textPrimary: '#f1e4cf', textSecondary: '#cdbb9f',\n textTertiary: '#b09a7e', textCaption: '#857058', border1: 'rgba(255, 225, 177, 0.09)',\n border2: 'rgba(255, 225, 177, 0.17)', border3: 'rgba(255, 225, 177, 0.24)',\n hover: 'rgba(252, 207, 136, 0.10)', hoverSolid: '#403529', active: 'rgba(252, 207, 136, 0.18)',\n primaryFill: '#e1ebcc', primaryHover: '#f3f7e4', primaryDimmed: '#535143',\n bubble: '#353a28', bubbleHighlight: '#444d30', input: '#342a20', selector: '#403428',\n sidebar: '#2b271e', sidebarHover: '#363127', sidebarActive: '#413a2e', sidebarAccent: '#485235',\n code: '#1f1b17', codeBanner: '#2b241d', inlineCode: '#31281f', scrollbar: '#605548',\n scrollbarHover: '#7a6b5b',\n shiki: {\n constant: '#6ab9ce', string: '#98c87e', comment: '#a59a89', keyword: '#e696a8',\n parameter: '#e8a765', function: '#bea0dc', stringExpression: '#a0cb82', punctuation: '#cec0ad', link: '#7bb9d1',\n },\n },\n}\n\n/** Build the stable id for one concrete eye-care theme. */\nexport function eyeCareThemeId(scheme: Scheme, intensity: EyeCareIntensity): string {\n return `${EYE_CARE_THEME_PREFIX}${scheme}-${intensity}`\n}\n\nfunction tokensOf(palette: Palette): ThemeTokens {\n return Object.freeze({\n '--dsw-alias-bg-base': palette.bgBase,\n '--dsw-alias-bg-layer-1': palette.bgLayer1,\n '--dsw-alias-bg-layer-2': palette.bgLayer2,\n '--dsw-alias-bg-layer-3': palette.bgLayer3,\n '--dsw-alias-bg-module-platform': palette.bgModule,\n '--dsw-alias-bg-multi-select': palette.bgModule,\n '--dsw-alias-bg-overlay': palette.bgOverlay,\n '--dsw-alias-bg-skeleton': palette.hover,\n '--dsw-alias-border-l1': palette.border1,\n '--dsw-alias-border-l2-darkmode-thin': palette.border2,\n '--dsw-alias-border-l2': palette.border2,\n '--dsw-alias-border-l3': palette.border3,\n '--dsw-alias-border-l4': palette.border3,\n '--dsw-alias-brand-primary': palette.textPrimary,\n '--dsw-alias-brand-text': palette.textPrimary,\n '--dsw-alias-button-contrast-fill': palette.textSecondary,\n '--dsw-alias-button-elevated-fill': palette.bgLayer3,\n '--dsw-alias-button-floating-fill': palette.bgLayer2,\n '--dsw-alias-button-floating-hover': palette.hoverSolid,\n '--dsw-alias-button-ghost-active-border': palette.textCaption,\n '--dsw-alias-button-ghost-active-fill': palette.active,\n '--dsw-alias-button-ghost-active-hover': palette.hoverSolid,\n '--dsw-alias-button-primary-fill': palette.primaryFill,\n '--dsw-alias-button-primary-hover': palette.primaryHover,\n '--dsw-alias-button-primary-dimmed': palette.primaryDimmed,\n '--dsw-alias-interactive-bg-active': palette.active,\n '--dsw-alias-interactive-bg-hover-accent': palette.active,\n '--dsw-alias-interactive-bg-hover': palette.hover,\n '--dsw-alias-interactive-bg-hover-solid': palette.hoverSolid,\n '--dsw-alias-label-caption': palette.textCaption,\n '--dsw-alias-label-dimmed': palette.border3,\n '--dsw-alias-label-primary-bluish': palette.textPrimary,\n '--dsw-alias-label-primary-dimmed': palette.textPrimary,\n '--dsw-alias-label-primary': palette.textPrimary,\n '--dsw-alias-label-secondary': palette.textSecondary,\n '--dsw-alias-label-tertiary': palette.textTertiary,\n '--dsw-alias-markdown-citation': palette.hoverSolid,\n '--dsw-alias-markdown-code-block-banner': palette.codeBanner,\n '--dsw-alias-markdown-code-block': palette.code,\n '--dsw-alias-markdown-code-segment-selected': palette.bgLayer3,\n '--dsw-alias-markdown-code-segment-unselected': palette.code,\n '--dsw-alias-markdown-inline-code': palette.inlineCode,\n '--dsw-alias-markdown-placeholder': palette.bgModule,\n '--dsw-alias-markdown-tag': palette.hoverSolid,\n '--dsw-alias-scrollbar-bg-l1': palette.scrollbar,\n '--dsw-alias-scrollbar-bg-l2': palette.scrollbar,\n '--dsw-alias-scrollbar-hover-l1': palette.scrollbarHover,\n '--dsw-alias-scrollbar-hover-l2': palette.scrollbarHover,\n '--dsw-specific-bubble-highlight': palette.bubbleHighlight,\n '--dsw-specific-bubble': palette.bubble,\n '--dsw-specific-input-major': palette.input,\n '--dsw-specific-login-input': palette.bgLayer2,\n '--dsw-specific-menu': palette.bgLayer3,\n '--dsw-specific-selector': palette.selector,\n '--dsw-specific-sidebar-fill': palette.sidebar,\n '--dsw-specific-sidebar-nav-item-active-accent': palette.sidebarAccent,\n '--dsw-specific-sidebar-nav-item-active': palette.sidebarActive,\n '--dsw-specific-sidebar-nav-item-hover': palette.sidebarHover,\n '--dsw-specific-tip': palette.bgModule,\n '--shiki-foreground': palette.textPrimary,\n '--shiki-background': palette.code,\n '--shiki-token-constant': palette.shiki.constant,\n '--shiki-token-string': palette.shiki.string,\n '--shiki-token-comment': palette.shiki.comment,\n '--shiki-token-keyword': palette.shiki.keyword,\n '--shiki-token-parameter': palette.shiki.parameter,\n '--shiki-token-function': palette.shiki.function,\n '--shiki-token-string-expression': palette.shiki.stringExpression,\n '--shiki-token-punctuation': palette.shiki.punctuation,\n '--shiki-token-link': palette.shiki.link,\n })\n}\n\n/** Six concrete themes registered for the two schemes and three warmth levels. */\nexport const EYE_CARE_THEMES: readonly ThemeDefinition[] = Object.freeze(\n (['light', 'dark'] as const).flatMap(scheme =>\n (['soft', 'balanced', 'warm'] as const).map(intensity => Object.freeze({\n id: eyeCareThemeId(scheme, intensity),\n colorScheme: scheme,\n tokens: tokensOf((scheme === 'light' ? LIGHT : DARK)[intensity]),\n }))),\n)\n\nconst EYE_CARE_THEME_IDS = new Set(EYE_CARE_THEMES.map(theme => theme.id))\n\n/** Whether a theme id is one of this package's registered concrete themes. */\nexport function isEyeCareThemeId(id: string): boolean {\n return EYE_CARE_THEME_IDS.has(id)\n}\n","/** Eye-care state owner: durable settings synchronization plus theme lifecycle. */\n\nimport type { ClientConnectionRpc } from '@deepseek-ai/dsh-client-connection/client'\nimport { createSnapshotStore, type SnapshotStore } from '@deepseek-ai/dsh-client-store'\nimport type { ThemeRuntime, ThemeSnapshot } from '@deepseek-ai/dsh-client-ui-theme/client'\nimport {\n DEFAULT_EYE_CARE_SETTINGS,\n decodeEyeCareSnapshot,\n EYE_CARE_RPC_CHANNEL,\n EYE_CARE_RPC_READ,\n EYE_CARE_RPC_SAVE,\n type EyeCareIntensity,\n type EyeCareMode,\n type EyeCareSettings,\n type EyeCareSettingsSnapshot,\n} from '../shared.ts'\nimport {\n EYE_CARE_THEMES,\n eyeCareThemeId,\n isEyeCareThemeId,\n} from './themes.ts'\n\n/** State consumed by the General-settings row. */\nexport interface EyeCareState {\n /** Current eye-care selection. */\n settings: EyeCareSettings\n /** Persistence lifecycle. */\n status: 'loading' | 'ready' | 'saving' | 'unavailable' | 'error'\n /** Whether the Host settings document can be written. */\n writable: boolean\n /** Host namespace revision for the next write. */\n revision: number | undefined\n /** User-facing read or write failure, when one stands. */\n error: string | null\n}\n\n/** Inputs isolated for deterministic controller tests. */\nexport interface EyeCareControllerOptions {\n /** DSH theme registry. */\n theme: Pick<ThemeRuntime, 'getTheme' | 'setTheme' | 'register'> & Partial<Pick<ThemeRuntime, 'overrideTokens'>>\n /** Snapshot change subscription. */\n subscribeTheme(listener: (snapshot: ThemeSnapshot) => void): () => void\n /** Loopback-only Connection RPC; absent remote browsers stay process-local. */\n rpc?: ClientConnectionRpc\n /** System dark-mode sensor. */\n media?: MediaQueryList\n /** Monotonic wall-clock source used only by the one-shot startup adoption fence. */\n now?: () => number\n}\n\nconst INITIAL_STATE: EyeCareState = {\n settings: { ...DEFAULT_EYE_CARE_SETTINGS },\n status: 'loading',\n writable: false,\n revision: undefined,\n error: null,\n}\n\n/** Maximum delay accepted for ui-theme's already-started Host adoption. */\nconst STARTUP_BASE_THEME_GRACE_MS = 1000\n\nfunction sameSettings(left: EyeCareSettings, right: EyeCareSettings): boolean {\n return left.mode === right.mode && left.intensity === right.intensity\n}\n\nfunction messageOf(error: unknown): string {\n return error instanceof Error ? error.message : String(error)\n}\n\n/** Stateful controller shared by theme listeners and the Settings row. */\nexport class EyeCareController {\n /** Reactive row source. */\n readonly store: SnapshotStore<EyeCareState> = createSnapshotStore(INITIAL_STATE)\n\n private readonly theme: EyeCareControllerOptions['theme']\n private readonly rpc: ClientConnectionRpc | undefined\n private readonly media: MediaQueryList | undefined\n private readonly now: () => number\n private readonly unregisterThemes: Array<() => void> = []\n private unsubscribeTheme: (() => void) | undefined\n private unsubscribeMedia: (() => void) | undefined\n private tail: Promise<void> = Promise.resolve()\n private disposeTask: Promise<void> | undefined\n private pendingSettings: EyeCareSettings | undefined\n private disposed = false\n private applyingTheme = 0\n private restoreTheme = 'system'\n private hasRestoreTheme = false\n private acceptedRemoteSnapshot = false\n private startupBaseTheme: 'light' | 'dark' | 'system' | undefined\n private startupBaseThemeDeadline = 0\n private removeTokenLayer: (() => void) | undefined\n private activeBaseTheme: string | undefined\n\n /**\n * Register the concrete themes and lifecycle listeners.\n * @param options - theme, transport, and system-scheme collaborators.\n */\n constructor(options: EyeCareControllerOptions) {\n this.theme = options.theme\n this.rpc = options.rpc\n this.now = options.now ?? Date.now\n this.media = options.media ?? (typeof matchMedia === 'function' ? matchMedia('(prefers-color-scheme: dark)') : undefined)\n const currentTheme = this.theme.getTheme().preference\n if (!isEyeCareThemeId(currentTheme)) {\n this.restoreTheme = currentTheme\n this.hasRestoreTheme = true\n }\n try {\n for (const definition of EYE_CARE_THEMES) {\n this.unregisterThemes.push(this.theme.register(definition))\n }\n this.unsubscribeTheme = options.subscribeTheme(snapshot => { this.onThemeChanged(snapshot) })\n if (this.media !== undefined) {\n const media = this.media\n const listener = (): void => {\n if (!this.disposed && this.store.getSnapshot().settings.mode === 'auto') this.applyCurrentTheme()\n }\n media.addEventListener('change', listener)\n this.unsubscribeMedia = () => { media.removeEventListener('change', listener) }\n }\n } catch (error) {\n for (const unregister of this.unregisterThemes.splice(0).reverse()) unregister()\n throw error\n }\n }\n\n /**\n * Load durable settings without blocking plugin activation.\n * @returns settlement after this read reaches the serialized transport queue.\n */\n load(): Promise<void> {\n if (this.rpc === undefined) {\n this.setUnavailable()\n return Promise.resolve()\n }\n if (this.store.getSnapshot().revision === undefined) {\n this.store.update(state => {\n state.status = 'loading'\n state.error = null\n })\n }\n return this.enqueue(async () => { await this.readRemote() })\n }\n\n /**\n * Select a mode and persist the latest selection when Host settings are writable.\n * @param mode - next operating mode.\n * @returns settlement after the serialized persistence attempt.\n */\n setMode(mode: EyeCareMode): Promise<void> {\n return this.select({ ...this.store.getSnapshot().settings, mode })\n }\n\n /**\n * Select a warmth and persist the latest selection when Host settings are writable.\n * @param intensity - next warmth level.\n * @returns settlement after the serialized persistence attempt.\n */\n setIntensity(intensity: EyeCareIntensity): Promise<void> {\n return this.select({ ...this.store.getSnapshot().settings, intensity })\n }\n\n /** Queue a refresh after a Host settings invalidation. */\n refresh(): void {\n void this.load()\n }\n\n /**\n * Reach transport quiescence, restore the user's live non-eye-care theme, and unregister all resources.\n * @returns settlement after cleanup completes.\n */\n dispose(): Promise<void> {\n return this.disposeTask ??= this.disposeOnce()\n }\n\n private async disposeOnce(): Promise<void> {\n this.disposed = true\n this.pendingSettings = undefined\n\n const failures: unknown[] = []\n for (const unsubscribe of [this.unsubscribeMedia, this.unsubscribeTheme]) {\n if (unsubscribe === undefined) continue\n try { unsubscribe() } catch (error) { failures.push(error) }\n }\n this.unsubscribeMedia = undefined\n this.unsubscribeTheme = undefined\n\n await this.tail\n\n const current = this.theme.getTheme()\n this.removeTokenLayer?.()\n this.removeTokenLayer = undefined\n if (isEyeCareThemeId(current.preference) || current.preference === this.activeBaseTheme) {\n try {\n this.setTheme(this.resolveRestoreTheme())\n } catch (error) {\n failures.push(error)\n try { this.setTheme('system') } catch (fallbackError) { failures.push(fallbackError) }\n }\n }\n for (const unregister of this.unregisterThemes.splice(0).reverse()) {\n try { unregister() } catch (error) { failures.push(error) }\n }\n if (failures.length > 0) throw new AggregateError(failures, 'eye-care cleanup failed')\n }\n\n private enqueue(operation: () => Promise<void>): Promise<void> {\n if (this.disposed) return Promise.resolve()\n const task = this.tail.then(async () => {\n if (!this.disposed) await operation()\n })\n this.tail = task.catch(() => {})\n return task\n }\n\n private select(settings: EyeCareSettings): Promise<void> {\n if (this.disposed) return Promise.resolve()\n const previous = this.store.getSnapshot().settings\n if (previous.mode === 'off' && settings.mode !== 'off') this.captureRestoreTheme()\n this.store.update(state => {\n state.settings = settings\n state.error = null\n if (state.status === 'error') state.status = state.revision === undefined ? 'unavailable' : 'ready'\n })\n this.applyCurrentTheme()\n return this.persist(settings)\n }\n\n private persist(settings: EyeCareSettings): Promise<void> {\n const state = this.store.getSnapshot()\n if (this.rpc === undefined) {\n this.setUnavailable(state.error)\n return Promise.resolve()\n }\n if (state.revision !== undefined && !state.writable) {\n this.setUnavailable(state.error)\n return Promise.resolve()\n }\n this.pendingSettings = { mode: settings.mode, intensity: settings.intensity }\n if (this.theme.overrideTokens !== undefined && settings.mode !== 'off'\n && (this.restoreTheme === 'light' || this.restoreTheme === 'dark' || this.restoreTheme === 'system')) {\n this.pendingSettings.restoreTheme = this.restoreTheme\n }\n return this.enqueue(async () => { await this.flushPending() })\n }\n\n private async flushPending(): Promise<void> {\n while (!this.disposed && this.pendingSettings !== undefined) {\n const desired = this.pendingSettings\n this.pendingSettings = undefined\n\n let state = this.store.getSnapshot()\n if (state.revision === undefined) {\n if (this.pendingSettings === undefined) this.pendingSettings = desired\n if (!await this.readRemote()) return\n continue\n }\n if (!state.writable || state.revision === undefined) {\n this.setUnavailable(state.error)\n return\n }\n\n this.store.update(next => {\n next.status = 'saving'\n next.error = null\n })\n let response: Awaited<ReturnType<ClientConnectionRpc['call']>>\n try {\n const rpc = this.rpc\n if (rpc === undefined) return\n response = await rpc.call(EYE_CARE_RPC_CHANNEL, EYE_CARE_RPC_SAVE, {\n expectedRevision: state.revision,\n value: desired,\n })\n } catch (error) {\n if (!this.disposed) this.setUnavailable(messageOf(error))\n return\n }\n if (this.disposed) return\n if (!response.ok) {\n if (response.error.code === 'settings-conflict') {\n const latest = this.pendingSettings ?? desired\n this.pendingSettings = latest\n if (!await this.readRemote()) return\n if (this.disposed) return\n continue\n }\n this.setUnavailable(response.error.message)\n return\n }\n const snapshot = decodeEyeCareSnapshot(response.value)\n if (snapshot === undefined) {\n this.store.update(next => {\n next.status = 'error'\n next.error = 'eye-care Settings returned an invalid save response'\n })\n return\n }\n const preserveSettings = this.pendingSettings !== undefined\n || !sameSettings(this.store.getSnapshot().settings, desired)\n this.accept(snapshot, preserveSettings)\n }\n }\n\n private async readRemote(): Promise<boolean> {\n let response: Awaited<ReturnType<ClientConnectionRpc['call']>>\n try {\n const rpc = this.rpc\n if (rpc === undefined) return false\n response = await rpc.call(EYE_CARE_RPC_CHANNEL, EYE_CARE_RPC_READ, {})\n } catch (error) {\n if (!this.disposed) this.setUnavailable(messageOf(error), true)\n return false\n }\n if (this.disposed) return false\n if (!response.ok) {\n this.setUnavailable(response.error.message, true)\n return false\n }\n const snapshot = decodeEyeCareSnapshot(response.value)\n if (snapshot === undefined) {\n this.store.update(state => {\n state.status = 'error'\n state.error = 'eye-care Settings returned an invalid read response'\n })\n return false\n }\n this.accept(snapshot, this.pendingSettings !== undefined)\n return true\n }\n\n private accept(snapshot: EyeCareSettingsSnapshot, preserveSettings: boolean): void {\n const previous = this.store.getSnapshot().settings\n const next = preserveSettings ? previous : snapshot.settings.value\n const firstRemote = !this.acceptedRemoteSnapshot\n this.acceptedRemoteSnapshot = true\n\n if (next.mode === 'off') {\n this.startupBaseTheme = undefined\n this.startupBaseThemeDeadline = 0\n if (!this.hasRestoreTheme && snapshot.baseThemePreference !== undefined) {\n this.restoreTheme = snapshot.baseThemePreference\n this.hasRestoreTheme = true\n }\n } else if (firstRemote) {\n const base = next.restoreTheme ?? snapshot.baseThemePreference\n if (base === undefined) {\n if (!this.hasRestoreTheme) this.captureRestoreTheme()\n } else {\n this.restoreTheme = base\n this.hasRestoreTheme = true\n if (this.theme.getTheme().preference !== base) {\n this.startupBaseTheme = base\n this.startupBaseThemeDeadline = this.now() + STARTUP_BASE_THEME_GRACE_MS\n }\n }\n } else if (!preserveSettings && previous.mode === 'off') {\n this.captureRestoreTheme(snapshot.baseThemePreference)\n }\n\n this.store.set({\n settings: next,\n status: snapshot.writable ? 'ready' : 'unavailable',\n writable: snapshot.writable,\n revision: snapshot.settings.revision,\n error: null,\n })\n this.applyCurrentTheme()\n }\n\n private setUnavailable(error: string | null = null, clearRevision = false): void {\n this.store.update(state => {\n state.status = 'unavailable'\n state.writable = false\n if (clearRevision) state.revision = undefined\n state.error = error\n })\n }\n\n private captureRestoreTheme(fallback?: 'light' | 'dark' | 'system'): void {\n const preference = this.theme.getTheme().preference\n const candidate = isEyeCareThemeId(preference) ? fallback ?? 'system' : preference\n this.restoreTheme = candidate\n this.hasRestoreTheme = true\n }\n\n private resolveRestoreTheme(): string {\n if (!this.hasRestoreTheme || this.restoreTheme === 'system') return 'system'\n return this.theme.getTheme().themes.some(theme => theme.id === this.restoreTheme)\n ? this.restoreTheme\n : 'system'\n }\n\n private applyCurrentTheme(): void {\n const { mode, intensity } = this.store.getSnapshot().settings\n const current = this.theme.getTheme().preference\n if (mode === 'off') {\n this.applyingTheme += 1\n try {\n this.removeTokenLayer?.()\n this.removeTokenLayer = undefined\n if (isEyeCareThemeId(current) || current === this.activeBaseTheme) this.setTheme(this.resolveRestoreTheme())\n this.activeBaseTheme = undefined\n } finally { this.applyingTheme -= 1 }\n this.hasRestoreTheme = false\n return\n }\n if (!this.hasRestoreTheme) this.captureRestoreTheme()\n const scheme = mode === 'auto' ? (this.media?.matches === true ? 'dark' : 'light') : mode\n // ConfigForms hosts re-adopt their durable built-in preference on every\n // settings refresh. Use the public token layer so warmth survives adoption.\n if (this.theme.overrideTokens !== undefined) {\n const definition = EYE_CARE_THEMES.find(theme => theme.id === eyeCareThemeId(scheme, intensity))!\n const tokens = Object.fromEntries(Object.entries(definition.tokens).map(([name, value]) => [name, { light: value, dark: value }]))\n this.applyingTheme += 1\n try {\n this.activeBaseTheme = mode === 'auto' ? 'system' : mode\n this.removeTokenLayer = this.theme.overrideTokens('@anionex/dsh-eye-care', tokens)\n this.setTheme(this.activeBaseTheme)\n } finally { this.applyingTheme -= 1 }\n return\n }\n this.setTheme(eyeCareThemeId(scheme, intensity))\n }\n\n private setTheme(id: string): void {\n if (this.theme.getTheme().preference === id) return\n this.applyingTheme += 1\n try {\n this.theme.setTheme(id)\n } finally {\n this.applyingTheme -= 1\n }\n }\n\n private onThemeChanged(snapshot: ThemeSnapshot): void {\n if (this.disposed || this.applyingTheme > 0 || isEyeCareThemeId(snapshot.preference)) return\n if (snapshot.preference === this.activeBaseTheme) return\n if (this.startupBaseTheme !== undefined) {\n const expected = this.startupBaseTheme\n const withinStartupWindow = this.now() <= this.startupBaseThemeDeadline\n this.startupBaseTheme = undefined\n this.startupBaseThemeDeadline = 0\n if (withinStartupWindow && snapshot.preference === expected) {\n this.restoreTheme = expected\n this.hasRestoreTheme = true\n this.applyCurrentTheme()\n return\n }\n }\n const state = this.store.getSnapshot()\n if (state.settings.mode === 'off') return\n this.restoreTheme = snapshot.preference\n this.hasRestoreTheme = true\n const settings = { ...state.settings, mode: 'off' as const }\n this.store.update(next => {\n next.settings = settings\n next.error = null\n })\n this.applyCurrentTheme()\n void this.persist(settings)\n }\n}\n","/** `settings.eyeCare` dictionaries. */\n\n/** Simplified Chinese dictionary. */\nexport const zh = {\n 'title': '护眼模式',\n 'description': '降低页面的冷白光感,长时间阅读更柔和。',\n 'enabled.title': '护眼模式',\n 'enabled.off': '关闭',\n 'enabled.on': '开启',\n 'advanced.title': '显示方式与暖色强度',\n 'mode.title': '显示方式',\n 'mode.off': '关闭',\n 'mode.auto': '自动',\n 'mode.light': '日间',\n 'mode.dark': '夜间',\n 'intensity.title': '暖色强度',\n 'intensity.soft': '柔和',\n 'intensity.balanced': '均衡',\n 'intensity.warm': '温暖',\n 'status.off': '护眼模式已关闭',\n 'status.auto': '自动跟随系统明暗外观',\n 'status.light': '正在使用暖色日间主题',\n 'status.dark': '正在使用暖暗夜间主题',\n 'status.local': '仅当前浏览器有效',\n 'status.saving': '正在保存',\n 'status.error': '设置暂未保存',\n} satisfies Record<string, string>\n\n/** Dictionary key union. */\nexport type EyeCareKey = keyof typeof zh\n\n/** English dictionary. */\nexport const en = {\n 'title': 'Eye care',\n 'description': 'Use warm semantic themes to reduce cool-white glare during long reading sessions',\n 'enabled.title': 'Eye care',\n 'enabled.off': 'Off',\n 'enabled.on': 'On',\n 'advanced.title': 'Appearance and warmth',\n 'mode.title': 'Appearance',\n 'mode.off': 'Off',\n 'mode.auto': 'Auto',\n 'mode.light': 'Day',\n 'mode.dark': 'Night',\n 'intensity.title': 'Warmth',\n 'intensity.soft': 'Soft',\n 'intensity.balanced': 'Balanced',\n 'intensity.warm': 'Warm',\n 'status.off': 'Eye care is off',\n 'status.auto': 'Following the system light or dark appearance',\n 'status.light': 'Warm day theme is active',\n 'status.dark': 'Warm night theme is active',\n 'status.local': 'Current browser only',\n 'status.saving': 'Saving',\n 'status.error': 'Setting is not saved yet',\n} satisfies Record<EyeCareKey, string>\n","/** DSH Web browser half for the eye-care profile bundle. */\n\nimport type {} from '@deepseek-ai/dsh-client-ui-renderer/client'\nimport type { ConnectionHandle } from '@deepseek-ai/dsh-client-connection/client'\nimport type { Context as ClientContext } from '@deepseek-ai/cordis'\nimport type { ThemeRuntime, ThemeSnapshot } from '@deepseek-ai/dsh-client-ui-theme/client'\nimport type {} from '@deepseek-ai/dsh-client-ui-settings/client'\nimport type {} from '@deepseek-ai/dsh-api-remotes/client'\nimport type {} from '@deepseek-ai/dsh-client-locale/client'\nimport type {} from '@deepseek-ai/dsh-client-ui-theme/client'\nimport { EyeCareRow, type EyeCareRowInjected } from './EyeCareRow.tsx'\nimport { EyeCareController } from './controller.ts'\nimport { en, zh, type EyeCareKey } from './locales.ts'\n\n/** Required browser services. */\nexport const inject = ['slots', 'locale', 'theme', 'connection', 'remote']\n\ndeclare module '@deepseek-ai/dsh-client-ui-slots' {\n interface LocaleNamespaceMap {\n /** Eye-care General row copy. */\n 'settings.eyeCare': EyeCareKey\n }\n}\n\n/** Browser context with the theme service declaration merged by ui-theme. */\ntype EyeCareClientContext = ClientContext & { theme: ThemeRuntime }\n\n/** Register settings copy, controller lifecycle, and General row. */\nexport function apply(ctx: EyeCareClientContext): void {\n const theme = ctx.get('theme') as ThemeRuntime\n const connection = ctx.get('connection') as ConnectionHandle\n const controller = new EyeCareController({\n theme,\n ...(connection.isLoopback ? { rpc: connection.rpc } : {}),\n subscribeTheme: (listener: (snapshot: ThemeSnapshot) => void): (() => void) => ctx.on('theme/change', listener),\n })\n ctx.effect(() => ctx.locale.register('settings.eyeCare', { zh, en }), 'dsh-eye-care: dictionaries')\n ctx.effect(() => {\n const refresh = (namespace?: string): void => {\n if (namespace !== undefined && namespace !== 'eye-care' && namespace !== 'dsh-eye-care') return\n controller.refresh()\n }\n const disposers = [\n ctx.remote.$on('settings/document-updated', refresh),\n ctx.on('connection/reset', () => {\n if (connection.isLoopback) controller.refresh()\n }),\n ]\n void controller.load()\n return async () => {\n for (const dispose of disposers) dispose()\n await controller.dispose()\n }\n }, 'dsh-eye-care: controller lifecycle')\n\n const injected = (): EyeCareRowInjected => ({\n hooks: { eyeCare: controller.store },\n setMode: mode => controller.setMode(mode),\n setIntensity: intensity => controller.setIntensity(intensity),\n })\n ctx.slots.inject('settings.general.item', () => ctx.slots.register({\n name: 'settings.general.item',\n id: 'eye-care',\n order: 15,\n locale: 'settings.eyeCare',\n inject: injected,\n }, EyeCareRow))\n}\n\nexport type { EyeCareRowInjected, EyeCareRowProps } from './EyeCareRow.tsx'\nexport type { EyeCareState } from './controller.ts'\nexport { EyeCareController } from './controller.ts'\nexport { EYE_CARE_THEMES, eyeCareThemeId, isEyeCareThemeId } from './themes.ts'\n"],"x_google_ignoreList":[1,2,3,4],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuBA,MAAM,QAA2D;GAC/D;IAAE,IAAI;IAAO,OAAO;GAAW;GAC/B;IAAE,IAAI;IAAQ,OAAO;GAAY;GACjC;IAAE,IAAI;IAAS,OAAO;GAAa;GACnC;IAAE,IAAI;IAAQ,OAAO;GAAY;EACnC;EAEA,MAAM,cAAsE;GAC1E;IAAE,IAAI;IAAQ,OAAO;GAAiB;GACtC;IAAE,IAAI;IAAY,OAAO;GAAqB;GAC9C;IAAE,IAAI;IAAQ,OAAO;GAAiB;EACxC;EAEA,SAAS,UAAU,MAA+B;GAChD,OAAO,UAAU;EACnB;;EAGA,SAAgB,WAAW,EAAE,GAAG,YAAY,SAAS,gBAAiC;GACpF,MAAM,QAAQ,YAAW,UAAS,KAAK;GACvC,MAAM,OAAO,MAAM,WAAW,aAAa,MAAM,WAAW;GAC5D,MAAM,UAAU,MAAM,SAAS,SAAS;GACxC,MAAM,SAAS,MAAM,WAAW,WAAW,MAAM,UAAU,OAAO,MAAM,QAAQ,EAAE,UAAU,MAAM,SAAS,IAAI,CAAC;GA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A0B;KAC/B,IAAI,WAAW,YAAY,WAAW,QAAQ;IAChD,CAAC,CACH;IACA,WAAgB,KAAK;IACrB,OAAO,YAAY;KACjB,KAAK,MAAM,WAAW,WAAW,QAAQ;KACzC,MAAM,WAAW,QAAQ;IAC3B;GACF,GAAG,oCAAoC;GAEvC,MAAM,kBAAsC;IAC1C,OAAO,EAAE,SAAS,WAAW,MAAM;IACnC,UAAS,SAAQ,WAAW,QAAQ,IAAI;IACxC,eAAc,cAAa,WAAW,aAAa,SAAS;GAC9D;GACA,IAAI,MAAM,OAAO,+BAA+B,IAAI,MAAM,SAAS;IACjE,MAAM;IACN,IAAI;IACJ,OAAO;IACP,QAAQ;IACR,QAAQ;GACV,GAAG,UAAU,CAAC;EAChB"}
|
package/lib/index.js
CHANGED
|
@@ -3,12 +3,14 @@ import { installEyeCareRpc } from "./rpc.js";
|
|
|
3
3
|
import { EYE_CARE_SETTINGS_NS, EyeCareSettingsSchema } from "./settings.js";
|
|
4
4
|
export { DEFAULT_EYE_CARE_SETTINGS, EYE_CARE_INTENSITIES, EYE_CARE_MODES, EYE_CARE_SETTINGS_NAMESPACE, EYE_CARE_RPC_CHANNEL, EYE_CARE_RPC_READ, EYE_CARE_RPC_SAVE, } from "./shared.js";
|
|
5
5
|
export { EYE_CARE_SETTINGS_NS, EyeCareSettingsSchema } from "./settings.js";
|
|
6
|
+
export { Config } from "./settings.js";
|
|
6
7
|
export { EyeCareRpcBackend } from "./rpc.js";
|
|
7
8
|
/** Required Host capability. */
|
|
8
9
|
export const inject = ['settings'];
|
|
9
10
|
/** Register the durable namespace and the optional loopback browser transport. */
|
|
10
11
|
export function apply(ctx) {
|
|
11
|
-
ctx.settings
|
|
12
|
+
const settings = ctx.settings;
|
|
13
|
+
settings.register?.(EYE_CARE_SETTINGS_NS, EyeCareSettingsSchema);
|
|
12
14
|
installEyeCareRpc(ctx);
|
|
13
15
|
}
|
|
14
16
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAI/E,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAC5C,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAA;AAE3E,OAAO,EACL,yBAAyB,EACzB,oBAAoB,EACpB,cAAc,EACd,2BAA2B,EAC3B,oBAAoB,EACpB,iBAAiB,EACjB,iBAAiB,GAIlB,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAA;AAC3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAE5C,gCAAgC;AAChC,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,UAAU,CAAC,CAAA;AAElC,kFAAkF;AAClF,MAAM,UAAU,KAAK,CAAC,GAAY;IAChC,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC,oBAAoB,EAAE,qBAAqB,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAI/E,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAC5C,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAA;AAE3E,OAAO,EACL,yBAAyB,EACzB,oBAAoB,EACpB,cAAc,EACd,2BAA2B,EAC3B,oBAAoB,EACpB,iBAAiB,EACjB,iBAAiB,GAIlB,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAA;AAC3E,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AACtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAE5C,gCAAgC;AAChC,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,UAAU,CAAC,CAAA;AAElC,kFAAkF;AAClF,MAAM,UAAU,KAAK,CAAC,GAAY;IAChC,MAAM,QAAQ,GAAG,GAAG,CAAC,QAAmG,CAAA;IACxH,QAAQ,CAAC,QAAQ,EAAE,CAAC,oBAAoB,EAAE,qBAAqB,CAAC,CAAA;IAChE,iBAAiB,CAAC,GAAG,CAAC,CAAA;AACxB,CAAC"}
|
package/lib/rpc.js
CHANGED
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
import { SettingsConflictError } from '@deepseek-ai/dsh-settings';
|
|
3
3
|
import { decodeEyeCareSettings, EYE_CARE_RPC_CHANNEL, EYE_CARE_RPC_READ, EYE_CARE_RPC_SAVE, } from "./shared.js";
|
|
4
4
|
import { EYE_CARE_SETTINGS_NS } from "./settings.js";
|
|
5
|
+
import { installLoopbackTransport } from "./transport.js";
|
|
5
6
|
function descriptorOf(ctx) {
|
|
6
|
-
const descriptor = ctx.settings.describe().find(row => row.ns === EYE_CARE_SETTINGS_NS);
|
|
7
|
+
const descriptor = ctx.settings.describe().find(row => row.ns === EYE_CARE_SETTINGS_NS || String(row.ns) === 'dsh-eye-care');
|
|
7
8
|
if (descriptor === undefined)
|
|
8
9
|
throw new Error('eye-care settings namespace is not registered');
|
|
9
10
|
return descriptor;
|
|
@@ -84,7 +85,7 @@ export class EyeCareRpcBackend {
|
|
|
84
85
|
try {
|
|
85
86
|
if (!this.ctx.settings.writable)
|
|
86
87
|
throw new Error('settings provider is read-only');
|
|
87
|
-
await this.ctx.settings.replace(
|
|
88
|
+
await this.ctx.settings.replace(descriptorOf(this.ctx).ns, request.value, request.expectedRevision);
|
|
88
89
|
return { ok: true, value: this.snapshot() };
|
|
89
90
|
}
|
|
90
91
|
catch (error) {
|
|
@@ -117,7 +118,12 @@ export class EyeCareRpcBackend {
|
|
|
117
118
|
export function installEyeCareRpc(ctx) {
|
|
118
119
|
const backend = new EyeCareRpcBackend(ctx);
|
|
119
120
|
ctx.inject(['connection'], (connectionCtx) => {
|
|
120
|
-
connectionCtx.connection.
|
|
121
|
+
if (typeof connectionCtx.connection.requestRejection === 'function') {
|
|
122
|
+
installLoopbackTransport(connectionCtx, backend.handle);
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
const legacy = connectionCtx.connection;
|
|
126
|
+
legacy.rpc.handle(EYE_CARE_RPC_CHANNEL, backend.handle, { authority: 'loopback' });
|
|
121
127
|
});
|
|
122
128
|
}
|
|
123
129
|
//# sourceMappingURL=rpc.js.map
|