@stackone/malachite 2.62.1 → 2.63.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/COMPONENTS.md +2 -0
  2. package/dist/assets/icons/caret_double_left.svg.js +6 -0
  3. package/dist/assets/icons/caret_double_left.svg.js.map +1 -0
  4. package/dist/assets/icons/caret_double_right.svg.js +6 -0
  5. package/dist/assets/icons/caret_double_right.svg.js.map +1 -0
  6. package/dist/components/Chat/ChatThread.js +1 -2
  7. package/dist/components/Chat/ChatThread.js.map +1 -1
  8. package/dist/components/CustomIcons/CaretDoubleLeftIcon.js +21 -0
  9. package/dist/components/CustomIcons/CaretDoubleLeftIcon.js.map +1 -0
  10. package/dist/components/CustomIcons/CaretDoubleRightIcon.js +21 -0
  11. package/dist/components/CustomIcons/CaretDoubleRightIcon.js.map +1 -0
  12. package/dist/components/CustomIcons/index.js +306 -300
  13. package/dist/components/CustomIcons/index.js.map +1 -1
  14. package/dist/components/DatePicker.js +36 -0
  15. package/dist/components/DatePicker.js.map +1 -0
  16. package/dist/components/DatePickerField.js +246 -0
  17. package/dist/components/DatePickerField.js.map +1 -0
  18. package/dist/components/DatePickerPanel.js +399 -0
  19. package/dist/components/DatePickerPanel.js.map +1 -0
  20. package/dist/components/DatePickerTrigger.js +68 -0
  21. package/dist/components/DatePickerTrigger.js.map +1 -0
  22. package/dist/components/DateRangePicker.js +43 -0
  23. package/dist/components/DateRangePicker.js.map +1 -0
  24. package/dist/components/dateMath.js +153 -0
  25. package/dist/components/dateMath.js.map +1 -0
  26. package/dist/components/datePickerStyles.js +46 -0
  27. package/dist/components/datePickerStyles.js.map +1 -0
  28. package/dist/components/useDatePickerDraft.js +126 -0
  29. package/dist/components/useDatePickerDraft.js.map +1 -0
  30. package/dist/index.d.ts +233 -101
  31. package/dist/index.js +431 -423
  32. package/dist/index.js.map +1 -1
  33. package/dist/tailwind.css.js +1 -1
  34. package/dist/theme.js +372 -349
  35. package/dist/theme.js.map +1 -1
  36. package/package.json +1 -1
package/dist/theme.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"theme.js","sources":["../src/theme.ts"],"sourcesContent":["// Theme configuration for Malachite components\nexport type ThemeMode = 'light' | 'dark';\n\nexport interface MalachiteTheme {\n fontSizes: {\n xsmall: string;\n small: string;\n medium: string;\n /** Off-ladder: the control ladder's large tier is 15px, between `medium` and `large`. */\n '15'?: string;\n large: string;\n xlarge: string;\n xxlarge: string;\n };\n /**\n * Heights of the shared control ladder. Optional so adding the family never breaks a\n * consumer building a full theme literal — same reason `radius.xs` is optional.\n */\n controlHeights?: {\n small: string;\n medium: string;\n large: string;\n };\n iconSizes: {\n xsmall: string;\n small: string;\n medium: string;\n large: string;\n };\n radius: {\n /** Optional so adding a rung never breaks a consumer building a full theme literal. */\n xs?: string;\n sm: string;\n md: string;\n lg: string;\n /** Off-ladder: no rung exists between `lg` (8px) and `xl` (12px). */\n '10'?: string;\n xl: string;\n xxl: string;\n xxxl: string;\n };\n shadows: {\n sm: string;\n md: string;\n lg: string;\n xl: string;\n default: string;\n glow?: string;\n glowLg?: string;\n /** Optional so adding a shadow never breaks a consumer building a full theme literal. */\n accent?: string;\n success: string;\n warning: string;\n error: string;\n };\n colors: {\n shadowColor: string;\n shadowOpacity: number;\n card: {\n background: string;\n foreground: string;\n border: string;\n shadow: string;\n dimmedBackground: string;\n sunkenBackground: string;\n warmBackground: string;\n headerBackground: string;\n footerBackground: string;\n /** @deprecated No longer read by any component — glass surfaces derive from `sunkenBackground` (see `glassSurface.ts`). */\n footerGlassBackground: string;\n trayNeutral?: string;\n trayWarning?: string;\n trayError?: string;\n traySuccess?: string;\n subtleDivider?: string;\n };\n overlay: {\n /** Dimming layer drawn behind modal overlays (e.g. SidePanel). */\n scrim: string;\n };\n alert: {\n info: {\n background: string;\n foreground: string;\n };\n success: {\n background: string;\n foreground: string;\n };\n error: {\n background: string;\n foreground: string;\n };\n warning: {\n background: string;\n foreground: string;\n };\n /** Says a machine wrote this, not that anything is wrong — the violet the\n * assistant is named in elsewhere, not a fifth severity. */\n assistant: {\n background: string;\n foreground: string;\n };\n };\n tooltip: {\n background: string;\n foreground: string;\n border: string;\n shadow: string;\n };\n primary: {\n background: string;\n foreground: string;\n border: string;\n borderHover: string;\n };\n /** Brand accent for interaction states — checked, selected, active. Green today,\n * but a rebrand repaints it; `success.*` stays status-only and does not follow.\n * Optional so adding a group never breaks a consumer building a full theme literal. */\n accent?: {\n background: string;\n foreground: string;\n border: string;\n backgroundGlass: string;\n };\n control: {\n borderHover: string;\n };\n outline: {\n foreground: string;\n };\n secondary: {\n background: string;\n foreground: string;\n border: string;\n borderHover: string;\n };\n destructive: {\n background: string;\n foreground: string;\n border: string;\n borderHover: string;\n shadow: string;\n shadowLight: string;\n shadowMedium: string;\n };\n success: {\n background: string;\n foreground: string;\n border: string;\n borderHover: string;\n backgroundGlass: string;\n shadowLight: string;\n shadowMedium: string;\n };\n warning: {\n background: string;\n foreground: string;\n border: string;\n borderHover: string;\n backgroundGlass: string;\n shadowLight: string;\n shadowMedium: string;\n };\n error: {\n background: string;\n foreground: string;\n border: string;\n borderHover: string;\n backgroundGlass: string;\n shadowLight: string;\n shadowMedium: string;\n };\n buttonList: {\n background: string;\n foreground: string;\n hoverBackground: string;\n hoverForeground: string;\n };\n pillButton: {\n background: string;\n foreground: string;\n hoverBackground: string;\n hoverForeground: string;\n pressedBackground: string;\n pressedForeground: string;\n pressedOpacity: string;\n activeBackground: string;\n activeForeground: string;\n staticBackground: string;\n staticForeground: string;\n invertedBackground: string;\n invertedForeground: string;\n invertedHoverBackground: string;\n invertedHoverForeground: string;\n invertedPressedBackground: string;\n invertedPressedForeground: string;\n };\n toggle: {\n track: string;\n trackChecked: string;\n /** The checked track while the change it represents has not been saved yet. */\n trackCheckedPending: string;\n knob: string;\n };\n segmentedControl: {\n trackBackground: string;\n itemForeground: string;\n itemHoverForeground: string;\n selectedBackground: string;\n selectedForeground: string;\n selectedShadow: string;\n };\n selectableCard: {\n background: string;\n border: string;\n selectedTint: string;\n selectedSurfaceEnd: string;\n selectedBorder: string;\n librarySelectedTint: string;\n librarySelectedBorder: string;\n editingTint: string;\n accent: string;\n mutedForeground: string;\n hoverBackground: string;\n hoverRule: string;\n pendingForeground: string;\n };\n cardStrip: {\n background: string;\n divider: string;\n fade: string;\n arrowBackground: string;\n arrowBorder: string;\n addPrimaryBackground: string;\n addPrimaryForeground: string;\n };\n selectionBar: {\n background: string;\n foreground: string;\n mutedForeground: string;\n divider: string;\n border: string;\n primaryBorder: string;\n shadow: string;\n noticeBackground: string;\n noticeForeground: string;\n noticeShadow: string;\n };\n inlineConfirm: {\n background: string;\n foreground: string;\n divider: string;\n shadow: string;\n };\n dropdown: {\n border: string;\n borderActive: string;\n borderFilter: string;\n borderError: string;\n borderPending: string;\n shadow: string;\n shadowHover: string;\n shadowActive: string;\n shadowFilter: string;\n shadowError: string;\n shadowPending: string;\n disabledBackground: string;\n };\n tag: {\n primary: {\n background: string;\n foreground: string;\n border: string;\n shadow: string;\n };\n secondary: {\n background: string;\n foreground: string;\n border: string;\n shadow: string;\n };\n default: {\n background: string;\n foreground: string;\n border: string;\n shadow: string;\n };\n error: {\n background: string;\n foreground: string;\n border: string;\n shadow: string;\n };\n warning: {\n background: string;\n foreground: string;\n border: string;\n shadow: string;\n };\n success: {\n background: string;\n foreground: string;\n border: string;\n shadow: string;\n };\n emphasis: {\n background: string;\n foreground: string;\n border: string;\n shadow: string;\n };\n info: {\n background: string;\n foreground: string;\n border: string;\n shadow: string;\n };\n assistant: {\n background: string;\n foreground: string;\n border: string;\n shadow: string;\n };\n };\n numberTag: {\n background: string;\n foreground: string;\n emphasisBackground: string;\n emphasisForeground: string;\n };\n table: {\n background: string;\n boxShadow: string;\n header: {\n background: string;\n foreground: string;\n border: string;\n };\n row: {\n background: string;\n foreground: string;\n hoverBackground: string;\n border: string;\n /** `Table`'s `selectedRowKey` tint. Must stay distinguishable from\n * `hoverBackground`: a selected row keeps this tint under the cursor. */\n selectedBackground: string;\n /** Leading accent bar on that same row. */\n selectedAccent: string;\n /** Cascades, so cells setting their own colour are deliberately unaffected. */\n selectedForeground: string;\n };\n border: string;\n borderedRow: {\n background: string;\n outline: string;\n };\n rowVariant: {\n success: {\n background: string;\n };\n warning: {\n background: string;\n };\n error: {\n background: string;\n };\n info: {\n background: string;\n };\n };\n error: {\n iconBackground: string;\n iconForeground: string;\n titleForeground: string;\n subtitleForeground: string;\n };\n };\n text: {\n primary: string;\n secondary: string;\n dimmed: string;\n emphasis: string;\n muted: string;\n placeholder: string; // Figma #bbbbbb for input placeholders\n destructive: string;\n success: string;\n highlight: string;\n warning: string;\n warningMuted: string;\n error: string;\n info: string;\n linkForeground: string;\n linkForegroundHover: string;\n rightSideText: {\n muted: string; // #7B7B7B for less prominent right side text\n primary: string; // #0A0A0A for more prominent right side text\n alignment: 'left' | 'right'; // Alignment of right side text\n fontSize: string; // Font size of right side text\n minWidth: string; // Width the column reserves, so short values stay aligned\n };\n };\n codeBlock: {\n background: string;\n foreground: string;\n border: string;\n lineNumber: string;\n keyword: string; // for keywords like 'unified', 'string', etc.\n comment: string; // for comments\n string: string; // for string literals\n number: string; // for numbers\n type: string; // for type annotations\n diffAddedBackground: string; // tint for a line a diff added\n diffRemovedBackground: string; // tint for a line a diff removed\n diffAssistantBackground: string; // tint for an added line in the assistant diff palette\n diffAssistantForeground: string; // marker colour for an added line in the assistant diff palette\n diffAssistantRemovedBackground: string; // tint for a removed line in the assistant diff palette\n diffRemovedForeground: string; // marker colour for a removed line in the assistant diff palette\n diffContextForeground: string; // marker colour for an unchanged line in the assistant diff palette\n diffContextText: string; // text colour for an unchanged line in the assistant diff palette\n };\n /** The conversation's own surfaces — message bubbles, not chrome around them. */\n chat: {\n userBubbleBackground: string;\n userBubbleBorder: string;\n assistantBubbleBackground: string;\n assistantBubbleBorder: string;\n assistantBubbleForeground: string;\n };\n /** Chrome marking machine-authored content outside the conversation itself\n * (badges, diff callouts) — distinct from `chat`, which is the conversation's\n * own bubbles. */\n assistant: {\n foreground: string;\n surfaceBackground: string;\n surfaceBorder: string;\n /** Body text sitting on `surfaceBackground` — darker/muted so a run of it reads,\n * unlike `foreground`, which is the vivid accent. */\n surfaceForeground: string;\n };\n };\n}\n\n// Define a type for partial theme updates\nexport interface PartialMalachiteTheme {\n fontSizes?: Partial<MalachiteTheme['fontSizes']>;\n iconSizes?: Partial<MalachiteTheme['iconSizes']>;\n radius?: Partial<MalachiteTheme['radius']>;\n controlHeights?: Partial<MalachiteTheme['controlHeights']>;\n shadows?: Partial<MalachiteTheme['shadows']>;\n colors?: {\n shadowColor?: string;\n shadowOpacity?: number;\n card?: Partial<MalachiteTheme['colors']['card']>;\n overlay?: Partial<MalachiteTheme['colors']['overlay']>;\n /** Nested-partial: a sub-object may be overridden leaf by leaf. A flat\n * `Partial<…>` would demand every leaf of any group you touch. */\n alert?: {\n [K in keyof MalachiteTheme['colors']['alert']]?: Partial<\n MalachiteTheme['colors']['alert'][K]\n >;\n };\n tooltip?: Partial<MalachiteTheme['colors']['tooltip']>;\n primary?: Partial<MalachiteTheme['colors']['primary']>;\n accent?: Partial<NonNullable<MalachiteTheme['colors']['accent']>>;\n control?: Partial<MalachiteTheme['colors']['control']>;\n outline?: Partial<MalachiteTheme['colors']['outline']>;\n secondary?: Partial<MalachiteTheme['colors']['secondary']>;\n destructive?: Partial<MalachiteTheme['colors']['destructive']>;\n success?: Partial<MalachiteTheme['colors']['success']>;\n warning?: Partial<MalachiteTheme['colors']['warning']>;\n error?: Partial<MalachiteTheme['colors']['error']>;\n buttonList?: Partial<MalachiteTheme['colors']['buttonList']>;\n pillButton?: Partial<MalachiteTheme['colors']['pillButton']>;\n toggle?: Partial<MalachiteTheme['colors']['toggle']>;\n segmentedControl?: Partial<MalachiteTheme['colors']['segmentedControl']>;\n selectableCard?: Partial<MalachiteTheme['colors']['selectableCard']>;\n cardStrip?: Partial<MalachiteTheme['colors']['cardStrip']>;\n selectionBar?: Partial<MalachiteTheme['colors']['selectionBar']>;\n inlineConfirm?: Partial<MalachiteTheme['colors']['inlineConfirm']>;\n dropdown?: Partial<MalachiteTheme['colors']['dropdown']>;\n tag?: {\n [K in keyof MalachiteTheme['colors']['tag']]?: Partial<\n MalachiteTheme['colors']['tag'][K]\n >;\n };\n numberTag?: Partial<MalachiteTheme['colors']['numberTag']>;\n // Every nested group is listed: a flat Partial<> reaches only the top level, and any\n // group omitted here is shallow-spread by mergeThemes, silently dropping siblings.\n table?: Partial<\n Omit<\n MalachiteTheme['colors']['table'],\n 'header' | 'row' | 'borderedRow' | 'rowVariant' | 'error'\n >\n > & {\n header?: Partial<MalachiteTheme['colors']['table']['header']>;\n row?: Partial<MalachiteTheme['colors']['table']['row']>;\n borderedRow?: Partial<MalachiteTheme['colors']['table']['borderedRow']>;\n // Two levels: each variant is its own object.\n rowVariant?: {\n [K in keyof MalachiteTheme['colors']['table']['rowVariant']]?: Partial<\n MalachiteTheme['colors']['table']['rowVariant'][K]\n >;\n };\n error?: Partial<MalachiteTheme['colors']['table']['error']>;\n };\n text?: Partial<Omit<MalachiteTheme['colors']['text'], 'rightSideText'>> & {\n rightSideText?: Partial<MalachiteTheme['colors']['text']['rightSideText']>;\n };\n codeBlock?: Partial<MalachiteTheme['colors']['codeBlock']>;\n chat?: Partial<MalachiteTheme['colors']['chat']>;\n assistant?: Partial<MalachiteTheme['colors']['assistant']>;\n };\n}\n\n// `accent` is optional on MalachiteTheme, so a hand-built theme may omit it. Every read\n// site falls back to these rather than emitting `undefined` or throwing.\nconst DEFAULT_ACCENT_COLORS: NonNullable<MalachiteTheme['colors']['accent']> = {\n background: 'rgba(0, 175, 102)',\n foreground: 'rgb(2, 122, 66)',\n border: 'rgba(0, 175, 102, 0.2)',\n backgroundGlass: 'rgba(0, 175, 102, 0.08)',\n};\nconst DEFAULT_ACCENT_SHADOW = '0px 1px 0px 0px rgba(0, 175, 102, 0.15)';\n\n/** The shared control ladder, from Figma. Exported so callers can read it without\n * reaching for a possibly-absent theme field. */\nexport const CONTROL_HEIGHT = {\n small: '28px',\n medium: '32px',\n large: '42px',\n} as const;\n\n// Default theme values\nexport const defaultTheme: MalachiteTheme = {\n fontSizes: {\n xsmall: '11px',\n small: '13px',\n medium: '14px',\n '15': '15px',\n large: '16px',\n xlarge: '18px',\n xxlarge: '22px',\n },\n controlHeights: { ...CONTROL_HEIGHT },\n iconSizes: {\n xsmall: '12px',\n small: '13px',\n medium: '13px',\n large: '15px',\n },\n radius: {\n xs: '2px',\n sm: '4px',\n md: '6px',\n lg: '8px',\n '10': '10px',\n xl: '12px',\n xxl: '14px',\n xxxl: '16px',\n },\n shadows: {\n sm: '0 1px 2px 0 rgba(0, 0, 0, 0.05)',\n md: '0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1)',\n lg: '0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1)',\n xl: '0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1)',\n glow: '0px 0px 10px 0px rgba(0, 0, 0, 0.2)',\n glowLg: '0px 0px 20px 0px rgba(0, 0, 0, 0.2)',\n default: '0px 1px 0px 0px rgba(0, 0, 0, 0.15)',\n accent: DEFAULT_ACCENT_SHADOW,\n success: '0px 1px 0px 0px rgba(0, 175, 102, 0.15)',\n warning: '0px 1px 0px 0px rgba(241, 139, 10, 0.15)',\n error: '0px 1px 0px 0px rgba(197, 63, 63, 0.15)',\n },\n colors: {\n shadowColor: '0, 0, 0',\n shadowOpacity: 0.1,\n card: {\n background: 'rgb(255, 255, 255)',\n foreground: 'rgb(10, 10, 10)',\n border: 'rgb(232, 232, 232)',\n shadow: 'rgba(0, 0, 0, 0.1)',\n dimmedBackground: 'rgb(247, 247, 247)',\n sunkenBackground: 'rgb(250, 250, 250)',\n warmBackground: 'rgb(244, 242, 240)',\n headerBackground: 'rgb(255, 255, 255)',\n footerBackground: 'rgb(255, 255, 255)',\n footerGlassBackground: 'rgba(255, 255, 255, 0.7)',\n trayNeutral: 'rgb(247, 247, 247)', // Figma #F7F7F7\n trayWarning: 'rgb(253, 243, 230)', // Figma #FDF3E6\n trayError: 'rgb(254, 241, 241)', // Figma #FEF1F1\n traySuccess: 'rgb(236, 249, 244)', // Figma #ECF9F4\n subtleDivider: 'rgb(241, 241, 241)', // Figma #F1F1F1\n },\n overlay: {\n scrim: 'rgba(0, 0, 0, 0.1)',\n },\n alert: {\n info: {\n background: 'rgb(247, 247, 247)',\n foreground: 'rgb(10, 10, 10)',\n },\n success: {\n background: 'rgba(0, 175, 102, 0.08)',\n foreground: 'rgb(2, 122, 66)',\n },\n error: {\n background: 'rgba(197, 63, 63, 0.08)',\n foreground: 'rgb(237, 53, 54)',\n },\n warning: {\n background: 'rgba(241, 139, 10, 0.08)',\n foreground: 'rgb(150, 88, 10)',\n },\n assistant: {\n background: 'rgb(242, 238, 254)', // #F2EEFE, the assistant tag's ground\n foreground: 'rgb(110, 86, 207)', // #6E56CF\n },\n },\n tooltip: {\n background: 'rgb(59, 59, 59)',\n foreground: 'rgb(255, 255, 255)',\n border: 'rgb(60, 60, 60)',\n shadow: '0px 0px 10px 0px rgba(0, 0, 0, 0.20)',\n },\n primary: {\n background: 'rgb(48, 48, 48)',\n foreground: 'rgb(10, 10, 10)',\n border: 'rgb(232, 232, 232)',\n borderHover: 'rgb(186, 186, 186)',\n },\n accent: DEFAULT_ACCENT_COLORS,\n control: {\n borderHover: 'rgba(0, 175, 102, 0.4)',\n },\n outline: {\n foreground: 'rgb(10, 10, 10)',\n },\n secondary: {\n background: 'rgb(9, 9, 9)',\n foreground: 'rgb(255, 255, 255)',\n border: 'rgb(232, 232, 232)',\n borderHover: 'rgb(186, 186, 186)',\n },\n destructive: {\n background: 'transparent',\n foreground: 'rgb(196, 62, 62)',\n border: 'rgb(239, 55, 55)',\n borderHover: 'rgb(239, 55, 55)',\n shadow: 'rgb(239, 55, 55)',\n shadowLight: 'rgba(239, 55, 55, 0.4)',\n shadowMedium: 'rgba(239, 55, 55, 0.6)',\n },\n success: {\n background: 'rgba(0, 175, 102)',\n foreground: 'rgb(2, 122, 66)',\n border: 'rgba(0, 175, 102, 0.2)',\n borderHover: 'rgba(0, 175, 102, 0.4)',\n backgroundGlass: 'rgba(0, 175, 102, 0.08)',\n shadowLight: 'rgba(0, 175, 102, 0.4)',\n shadowMedium: 'rgba(0, 175, 102, 0.6)',\n },\n warning: {\n background: 'rgb(241, 139, 10)',\n foreground: 'rgb(150, 88, 10)',\n border: 'rgba(241, 139, 10, 0.2)',\n borderHover: 'rgba(241, 139, 10, 0.4)',\n backgroundGlass: 'rgba(241, 139, 10, 0.08)',\n shadowLight: 'rgba(241, 139, 10, 0.4)',\n shadowMedium: 'rgba(241, 139, 10, 0.6)',\n },\n error: {\n background: 'rgb(197, 63, 63)',\n foreground: 'rgb(237, 53, 54)',\n border: 'rgba(197, 63, 63, 0.2)',\n borderHover: 'rgba(197, 63, 63, 0.4)',\n backgroundGlass: 'rgba(197, 63, 63, 0.08)',\n shadowLight: 'rgba(197, 63, 63, 0.4)',\n shadowMedium: 'rgba(197, 63, 63, 0.6)',\n },\n buttonList: {\n background: 'rgb(255, 255, 255)',\n foreground: 'rgb(10, 10, 10)',\n hoverBackground: 'rgb(245, 245, 245)',\n hoverForeground: 'rgb(10, 10, 10)',\n },\n pillButton: {\n background: 'rgb(241, 241, 241)', // Figma #f1f1f1\n foreground: 'rgb(123, 123, 123)', // Figma #7b7b7b\n hoverBackground: 'rgb(232, 232, 232)', // Figma #e8e8e8\n hoverForeground: 'rgb(10, 10, 10)', // Figma neutral-950 (almost black)\n pressedBackground: 'rgb(232, 232, 232)', // Figma #e8e8e8 (same as hover)\n pressedForeground: 'rgb(10, 10, 10)', // Figma neutral-950 (same as hover)\n pressedOpacity: '0.6', // Figma opacity-60\n activeBackground: 'rgb(48, 48, 48)',\n activeForeground: 'rgb(255, 255, 255)',\n staticBackground: 'rgb(224, 222, 220)', // #e0dedc — used by interactive=false pills\n staticForeground: 'rgb(76, 75, 75)', // #4c4b4b\n invertedBackground: 'rgb(255, 255, 255)',\n invertedForeground: 'rgb(76, 75, 75)', // #4c4b4b\n invertedHoverBackground: 'rgb(10, 10, 10)', // neutral-950\n invertedHoverForeground: 'rgb(255, 255, 255)',\n invertedPressedBackground: 'rgb(10, 10, 10)',\n invertedPressedForeground: 'rgb(255, 255, 255)',\n },\n toggle: {\n track: 'rgb(232, 232, 232)', // #e8e8e8 neutral off track\n trackChecked: 'rgb(0, 175, 102)', // #00AF66 brand green\n trackCheckedPending: 'rgb(241, 139, 10)', // #F18B0A, the pending amber\n knob: 'rgb(255, 255, 255)',\n },\n segmentedControl: {\n trackBackground: 'rgb(241, 241, 241)', // Figma #f1f1f1 sunken track\n // Deliberately text.muted, not text.secondary: #7b7b7b on the #f1f1f1 track is\n // only 3.7:1, below WCAG AA for body text. #4c4b4b is 7.7:1.\n itemForeground: 'rgb(76, 75, 75)', // #4c4b4b text.muted\n itemHoverForeground: 'rgb(10, 10, 10)', // neutral-950\n selectedBackground: 'rgb(255, 255, 255)',\n selectedForeground: 'rgb(10, 10, 10)', // neutral-950\n selectedShadow: '0px 1px 5px 0px rgba(0, 0, 0, 0.1)',\n },\n selectableCard: {\n background: 'rgb(241, 241, 241)',\n border: 'rgb(221, 221, 221)',\n selectedTint: 'rgb(231, 248, 241)',\n selectedSurfaceEnd: 'rgb(255, 255, 255)',\n selectedBorder: 'rgb(4, 123, 67)',\n librarySelectedTint: 'rgb(241, 241, 241)',\n librarySelectedBorder: 'rgb(187, 187, 187)',\n editingTint: 'rgb(249, 242, 233)', // Figma #F9F2E9\n accent: 'rgb(4, 123, 67)', // Figma #047B43 primary (dark)\n mutedForeground: 'rgb(123, 123, 123)', // Figma #7B7B7B, the same grey as text-secondary\n hoverBackground: 'rgb(232, 232, 232)',\n hoverRule: 'rgb(187, 187, 187)',\n pendingForeground: 'rgb(150, 88, 10)',\n },\n cardStrip: {\n background: 'rgb(241, 241, 241)', // Figma #F1F1F1\n divider: 'rgb(221, 221, 221)', // Figma #DDDDDD — hairline between adjacent cards\n fade: 'rgb(255, 255, 255)',\n arrowBackground: 'rgb(255, 255, 255)',\n arrowBorder: 'rgb(232, 232, 232)', // Figma #E8E8E8, same hairline as dropdown.border\n addPrimaryBackground: 'rgb(10, 10, 10)',\n addPrimaryForeground: 'rgb(255, 255, 255)',\n },\n selectionBar: {\n background: 'rgb(10, 10, 10)', // Figma #0a0a0a\n foreground: 'rgb(255, 255, 255)',\n mutedForeground: 'rgb(123, 123, 123)',\n divider: 'rgb(64, 64, 64)',\n border: 'transparent', // edgeless in light\n primaryBorder: 'rgb(232, 232, 232)',\n shadow: '0px 0px 10px 0px rgba(0, 0, 0, 0.2)',\n noticeBackground: 'rgb(237, 217, 190)',\n noticeForeground: 'rgb(132, 77, 9)',\n noticeShadow:\n '0px 0px 4px 0px rgba(0, 0, 0, 0.08), 0px 4px 4px 0px rgba(0, 0, 0, 0.08), 0px 4px 10px 0px rgba(0, 0, 0, 0.05)',\n },\n inlineConfirm: {\n background: 'rgb(34, 33, 33)', // Figma #222121\n foreground: 'rgb(255, 255, 255)',\n divider: 'rgba(255, 255, 255, 0.1)',\n shadow: '0px 0px 10px 0px rgba(0, 0, 0, 0.2)',\n },\n dropdown: {\n border: 'rgb(232, 232, 232)',\n borderActive: 'rgba(0, 175, 102, 0.6)',\n borderFilter: 'rgba(0, 175, 102, 0.4)',\n borderError: 'rgba(239, 55, 55, 0.6)',\n borderPending: 'rgba(241, 139, 10, 0.6)',\n shadow: '0px 1px 0px 0px rgba(0, 0, 0, 0.15)',\n shadowHover: '0px 1px 0px 0px rgba(0, 175, 102, 0.6)',\n shadowActive: '0px 1px 0px 0px rgba(0, 175, 102, 0.8)',\n shadowFilter: '0px 1px 0px 0px rgba(0, 175, 102, 0.6)',\n shadowError:\n '0px 1px 0px 0px rgba(239, 55, 55, 0.8), 0px 0px 0px 2px rgba(239, 55, 55, 0.1)',\n shadowPending:\n '0px 1px 0px 0px rgba(241, 139, 10, 0.8), 0px 0px 0px 2px rgba(241, 139, 10, 0.1)',\n disabledBackground: 'rgb(241, 241, 241)', // Figma #f1f1f1\n },\n tag: {\n primary: {\n background: 'rgba(37, 130, 234, 0.1)', // #2582EA1A\n foreground: 'rgb(37, 130, 234)', // #2582EA\n border: 'rgb(37, 130, 234)', // #2582EA\n shadow: 'rgba(37, 130, 234, 0.5)', // #2582EA with 50% opacity\n },\n secondary: {\n background: 'rgba(0, 175, 102, 0.1)', // #00AF661A\n foreground: 'rgb(0, 175, 102)', // #00AF66\n border: 'rgb(0, 175, 102)', // #00AF66\n shadow: 'rgba(0, 175, 102, 0.5)', // #00AF66 with 50% opacity\n },\n default: {\n background: 'rgba(123, 123, 123, 0.1)', // #7B7B7B1A\n foreground: 'rgb(123, 123, 123)', // #7B7B7B\n border: 'rgb(123, 123, 123)', // #7B7B7B\n shadow: 'rgba(123, 123, 123, 0.5)', // #7B7B7B with 50% opacity\n },\n error: {\n background: 'rgba(196, 62, 62, 0.1)', // #C43E3E1A\n foreground: 'rgb(196, 62, 62)', // #C43E3E\n border: 'rgb(196, 62, 62)', // #C43E3E\n shadow: 'rgba(196, 62, 62, 0.5)', // #C43E3E with 50% opacity\n },\n warning: {\n background: 'rgba(150, 88, 10, 0.1)', // #96580A1A\n foreground: 'rgb(150, 88, 10)', // #96580A\n border: 'rgb(150, 88, 10)', // #96580A\n shadow: 'rgba(150, 88, 10, 0.5)', // #96580A with 50% opacity\n },\n success: {\n background: 'rgba(0, 175, 102, 0.1)', // #00AF661A\n foreground: 'rgb(2, 122, 66)', // #027A42\n border: 'rgb(2, 122, 66)', // #027A42\n shadow: 'rgba(2, 122, 66, 0.5)', // #027A42 with 50% opacity\n },\n emphasis: {\n background: 'rgba(123, 123, 123, 0.1)',\n foreground: 'rgb(10, 10, 10)',\n border: 'rgb(10, 10, 10)',\n shadow: 'rgba(0, 0, 0, 0.2)',\n },\n info: {\n background: 'rgba(12, 88, 174, 0.1)', // #0C58AE1A\n foreground: 'rgb(12, 88, 174)', // Blue (Dark) from Figma #0C58AE\n border: 'rgb(12, 88, 174)', // #0C58AE\n shadow: 'rgba(12, 88, 174, 0.5)', // #0C58AE with 50% opacity\n },\n assistant: {\n background: 'rgb(242, 238, 254)', // #F2EEFE\n foreground: 'rgb(110, 86, 207)', // #6E56CF\n border: 'rgb(227, 221, 251)', // #E3DDFB\n shadow: 'rgba(110, 86, 207, 0.5)', // #6E56CF with 50% opacity\n },\n },\n numberTag: {\n background: 'rgba(0, 0, 0, 0.08)',\n foreground: 'rgb(123, 123, 123)', // text secondary\n emphasisBackground: 'rgba(0, 0, 0, 0.15)',\n emphasisForeground: 'rgb(34, 33, 33)', // text emphasis\n },\n table: {\n background: 'rgb(247, 247, 247)', // #F7F7F7\n boxShadow: 'none', // The designed container is a flat grey frame, not elevated\n header: {\n background: 'rgb(247, 247, 247)', // #F7F7F7\n foreground: 'rgb(55, 65, 81)', // #374151\n border: 'rgb(229, 231, 235)', // #e5e7eb\n },\n row: {\n background: 'rgb(255, 255, 255)', // #ffffff\n foreground: 'rgb(75, 85, 99)', // #4b5563\n hoverBackground: 'rgb(249, 250, 251)', // #f9fafb\n border: 'rgb(229, 231, 235)', // #e5e7eb\n // Translucent, so it layers over the row (or a rowVariant tint). 15% not 10%:\n // at 10% the step was 1.11:1 from a plain row, near-invisible without colour\n // vision. Capped there to keep the foreground's AA headroom (4.64:1).\n selectedBackground: 'rgba(0, 175, 102, 0.15)', // #00AF66 at 15%\n selectedAccent: 'rgb(2, 122, 66)', // #027A42, matches text.success\n selectedForeground: 'rgb(2, 122, 66)', // #027A42\n },\n border: 'rgb(229, 231, 235)', // #e5e7eb\n borderedRow: {\n background: 'rgb(255, 255, 255)', // #FFF\n outline: 'rgb(232, 232, 232)', // #e8e8e8\n },\n rowVariant: {\n success: {\n background: 'rgb(236, 249, 244)', // #ECF9F4\n },\n warning: {\n background: 'rgb(253, 243, 230)', // #FDF3E6\n },\n error: {\n background: 'rgb(253, 236, 236)', // #FDECEC\n },\n info: {\n background: 'rgb(230, 244, 253)', // #E6F4FD\n },\n },\n error: {\n iconBackground: 'rgb(254, 243, 199)', // #fef3c7\n iconForeground: 'rgb(217, 119, 6)', // #d97706\n titleForeground: 'rgb(17, 24, 39)', // #111827\n subtitleForeground: 'rgb(107, 114, 128)', // #6b7280\n },\n },\n text: {\n primary: 'rgb(10, 10, 10)',\n secondary: 'rgb(123, 123, 123)',\n dimmed: 'rgb(161, 161, 161)',\n emphasis: 'rgb(34, 33, 33)',\n muted: 'rgb(76, 75, 75)',\n placeholder: 'rgb(187, 187, 187)', // Figma #bbbbbb for input placeholders\n destructive: 'rgb(237, 53, 54)',\n success: 'rgb(2, 122, 66)',\n highlight: 'rgb(118, 214, 174)',\n warning: 'rgb(150, 88, 10)',\n warningMuted: 'rgb(206, 163, 108)', // Figma #CEA36C\n error: 'rgb(237, 53, 54)',\n info: 'rgb(12, 88, 174)', // Blue (Dark) from Figma #0C58AE\n linkForeground: 'rgba(0, 0, 0, 0.45)',\n linkForegroundHover: 'rgb(10, 10, 10)',\n rightSideText: {\n muted: 'rgb(123, 123, 123)', // #7B7B7B for less prominent right side text\n primary: 'rgb(10, 10, 10)', // #0A0A0A for more prominent right side text\n alignment: 'right' as const, // Default to right alignment\n fontSize: '12px',\n minWidth: '80px',\n },\n },\n codeBlock: {\n background: 'rgb(255, 255, 255)', // White background from Figma\n foreground: 'rgb(10, 10, 10)', // Header color from Figma #0A0A0A\n border: 'rgb(232, 232, 232)', // Light border\n lineNumber: 'rgb(123, 123, 123)', // Text color from Figma #7B7B7B\n keyword: 'rgb(12, 88, 174)', // Blue (Dark) from Figma #0C58AE\n comment: 'rgb(123, 123, 123)', // Text color for comments\n string: 'rgb(2, 122, 66)', // Green for strings\n number: 'rgb(150, 88, 10)', // Orange for numbers\n type: 'rgb(12, 88, 174)', // Blue for types\n // Low alpha, so highlighted code stays readable through the tint.\n diffAddedBackground: 'rgba(0, 175, 102, 0.12)',\n diffRemovedBackground: 'rgba(239, 55, 55, 0.1)',\n // The assistant diff palette, from the design mock for AI-authored changes.\n diffAssistantBackground: '#F5F1FE',\n diffAssistantForeground: '#6E56CF',\n diffAssistantRemovedBackground: '#F7F6FB',\n diffRemovedForeground: '#5E5876',\n diffContextForeground: '#D9D9D9',\n diffContextText: '#3B3B3B',\n },\n chat: {\n userBubbleBackground: 'rgb(246, 246, 246)', // #F6F6F6\n userBubbleBorder: 'rgb(237, 237, 237)', // #EDEDED\n // Deliberately neutral, not violet. The violet marks a pending change in the form\n // beside this column; spending the same hue on \"the assistant said it\" leaves the\n // reader two meanings for one colour. The bubble differs from the user's by being\n // a white card against their filled grey, and the assistant is named in violet\n // above the thread instead.\n assistantBubbleBackground: 'rgb(255, 255, 255)',\n assistantBubbleBorder: 'rgb(232, 232, 232)', // The neutral hairline, as codeBlock.border\n assistantBubbleForeground: 'rgb(10, 10, 10)', // text.primary — this is body copy, read at length\n },\n assistant: {\n foreground: 'rgb(110, 86, 207)', // #6E56CF, matches tag.assistant.foreground\n surfaceBackground: 'rgb(251, 250, 255)', // #FBFAFF, a faint tint for a card or callout\n surfaceBorder: 'rgb(220, 211, 250)', // #DCD3FA, drawn dashed by the consumer\n surfaceForeground: 'rgb(74, 63, 122)', // #4A3F7A, from the Chat.Suggestion mock\n },\n },\n};\n\n// Dark theme colors\nexport const darkTheme: MalachiteTheme = {\n fontSizes: {\n xsmall: '11px',\n small: '13px',\n medium: '14px',\n '15': '15px',\n large: '16px',\n xlarge: '18px',\n xxlarge: '22px',\n },\n controlHeights: { ...CONTROL_HEIGHT },\n iconSizes: {\n xsmall: '12px',\n small: '13px',\n medium: '13px',\n large: '15px',\n },\n radius: {\n xs: '2px',\n sm: '4px',\n md: '6px',\n lg: '8px',\n '10': '10px',\n xl: '12px',\n xxl: '14px',\n xxxl: '16px',\n },\n shadows: {\n sm: '0 1px 2px 0 rgba(0, 0, 0, 0.3)',\n md: '0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.3)',\n lg: '0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -4px rgba(0, 0, 0, 0.3)',\n xl: '0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3)',\n glow: '0px 0px 10px 0px rgba(0, 0, 0, 0.5)',\n glowLg: '0px 0px 20px 0px rgba(0, 0, 0, 0.5)',\n default: '0px 1px 0px 0px rgba(0, 0, 0, 0.4)',\n accent: '0px 1px 0px 0px rgba(0, 175, 102, 0.4)',\n success: '0px 1px 0px 0px rgba(0, 175, 102, 0.4)',\n warning: '0px 1px 0px 0px rgba(241, 139, 10, 0.4)',\n error: '0px 1px 0px 0px rgba(197, 63, 63, 0.4)',\n },\n colors: {\n shadowColor: '0, 0, 0',\n shadowOpacity: 0.3,\n card: {\n background: 'rgb(30, 30, 30)',\n foreground: 'rgb(255, 255, 255)',\n border: 'rgb(64, 64, 64)',\n shadow: 'rgba(0, 0, 0, 0.3)',\n dimmedBackground: 'rgb(70, 70, 70)',\n sunkenBackground: 'rgb(10, 10, 10)',\n warmBackground: 'rgb(45, 43, 41)',\n headerBackground: 'rgb(30, 30, 30)',\n footerBackground: 'rgb(30, 30, 30)',\n footerGlassBackground: 'rgba(30, 30, 30, 0.7)',\n trayNeutral: 'rgb(56, 56, 56)',\n trayWarning: 'rgb(74, 62, 29)',\n trayError: 'rgb(70, 44, 44)',\n traySuccess: 'rgb(31, 63, 40)',\n subtleDivider: 'rgb(48, 48, 48)',\n },\n overlay: {\n scrim: 'rgba(0, 0, 0, 0.4)',\n },\n alert: {\n info: {\n background: 'rgb(70, 70, 70)',\n foreground: 'rgb(255, 255, 255)',\n },\n success: {\n background: 'rgba(0, 175, 102, 0.08)',\n foreground: 'rgb(2, 122, 66)',\n },\n error: {\n background: 'rgba(197, 63, 63, 0.08)',\n foreground: 'rgb(237, 53, 54)',\n },\n warning: {\n background: 'rgba(241, 139, 10, 0.08)',\n foreground: 'rgb(150, 88, 10)',\n },\n assistant: {\n // The dark violet the assistant Tag and diff palette already use; the light\n // pair here would render an opaque near-white block on a dark surface.\n background: 'rgba(158, 130, 255, 0.18)',\n foreground: 'rgb(184, 158, 255)',\n },\n },\n tooltip: {\n background: 'rgb(42, 42, 42)',\n foreground: 'rgb(255, 255, 255)',\n border: 'rgb(80, 80, 80)',\n shadow: '0px 0px 12px 0px rgba(0, 0, 0, 0.30)',\n },\n primary: {\n background: 'rgb(60, 60, 60)',\n foreground: 'rgb(255, 255, 255)',\n border: 'rgb(100, 100, 100)',\n borderHover: 'rgb(140, 140, 140)',\n },\n accent: {\n background: 'rgba(50, 205, 132)',\n foreground: 'rgb(20, 170, 100)',\n border: 'rgba(50, 205, 132, 0.3)',\n backgroundGlass: 'rgba(50, 205, 132, 0.12)',\n },\n control: {\n borderHover: 'rgba(50, 205, 132, 0.5)',\n },\n outline: {\n foreground: 'rgb(255, 255, 255)',\n },\n // Filled buttons invert in dark mode: white surface, near-black text.\n secondary: {\n background: 'rgb(255, 255, 255)',\n foreground: 'rgb(10, 10, 10)',\n border: 'rgb(255, 255, 255)',\n borderHover: 'rgb(220, 220, 220)',\n },\n destructive: {\n background: 'transparent',\n foreground: 'rgb(255, 120, 120)',\n border: 'rgb(255, 100, 100)',\n borderHover: 'rgb(255, 100, 100)',\n shadow: 'rgb(255, 100, 100)',\n shadowLight: 'rgba(255, 100, 100, 0.4)',\n shadowMedium: 'rgba(255, 100, 100, 0.6)',\n },\n success: {\n background: 'rgba(50, 205, 132)',\n foreground: 'rgb(20, 170, 100)',\n border: 'rgba(50, 205, 132, 0.3)',\n borderHover: 'rgba(50, 205, 132, 0.5)',\n backgroundGlass: 'rgba(50, 205, 132, 0.12)',\n shadowLight: 'rgba(50, 205, 132, 0.4)',\n shadowMedium: 'rgba(50, 205, 132, 0.6)',\n },\n warning: {\n background: 'rgb(255, 180, 50)',\n foreground: 'rgb(200, 130, 20)',\n border: 'rgba(255, 180, 50, 0.3)',\n borderHover: 'rgba(255, 180, 50, 0.5)',\n backgroundGlass: 'rgba(255, 180, 50, 0.12)',\n shadowLight: 'rgba(255, 180, 50, 0.4)',\n shadowMedium: 'rgba(255, 180, 50, 0.6)',\n },\n error: {\n background: 'rgb(255, 120, 120)',\n foreground: 'rgb(255, 80, 80)',\n border: 'rgba(255, 120, 120, 0.3)',\n borderHover: 'rgba(255, 120, 120, 0.5)',\n backgroundGlass: 'rgba(255, 120, 120, 0.12)',\n shadowLight: 'rgba(255, 120, 120, 0.4)',\n shadowMedium: 'rgba(255, 120, 120, 0.6)',\n },\n buttonList: {\n background: 'rgb(30, 30, 30)',\n foreground: 'rgb(255, 255, 255)',\n hoverBackground: 'rgb(60, 60, 60)',\n hoverForeground: 'rgb(255, 255, 255)',\n },\n pillButton: {\n background: 'rgb(70, 70, 70)', // Dark theme equivalent\n foreground: 'rgb(161, 161, 161)', // Dark theme equivalent\n hoverBackground: 'rgb(90, 90, 90)', // Lighter for dark theme hover\n hoverForeground: 'rgb(255, 255, 255)', // White text on hover in dark mode\n pressedBackground: 'rgb(90, 90, 90)', // Same as hover for dark theme\n pressedForeground: 'rgb(255, 255, 255)', // Same as hover for dark theme\n pressedOpacity: '0.6', // Same opacity reduction for dark theme\n activeBackground: 'rgb(255, 255, 255)',\n activeForeground: 'rgb(10, 10, 10)',\n staticBackground: 'rgb(60, 60, 60)',\n staticForeground: 'rgb(220, 220, 220)',\n invertedBackground: 'rgb(38, 38, 38)',\n invertedForeground: 'rgb(220, 220, 220)',\n invertedHoverBackground: 'rgb(255, 255, 255)',\n invertedHoverForeground: 'rgb(10, 10, 10)',\n invertedPressedBackground: 'rgb(255, 255, 255)',\n invertedPressedForeground: 'rgb(10, 10, 10)',\n },\n toggle: {\n track: 'rgb(70, 70, 70)', // neutral off track for dark theme\n trackChecked: 'rgb(34, 197, 94)', // lighter green to match dark theme success\n trackCheckedPending: 'rgb(240, 138, 7)', // dark-theme pending amber\n knob: 'rgb(255, 255, 255)',\n },\n segmentedControl: {\n // Inverted from light mode: the track is the DARKER surface and the selected\n // thumb sits lighter on top, so \"raised\" still reads as raised.\n trackBackground: 'rgb(38, 38, 38)',\n itemForeground: 'rgb(161, 161, 161)', // text.secondary — 5.9:1 on the track\n itemHoverForeground: 'rgb(255, 255, 255)',\n selectedBackground: 'rgb(82, 82, 82)',\n selectedForeground: 'rgb(255, 255, 255)', // 7.8:1 on the thumb\n selectedShadow: '0px 1px 2px 0px rgba(0, 0, 0, 0.4)',\n },\n selectableCard: {\n background: 'rgb(45, 45, 45)',\n border: 'rgb(64, 64, 64)',\n selectedTint: 'rgb(30, 62, 48)',\n selectedSurfaceEnd: 'rgb(52, 52, 52)',\n selectedBorder: 'rgb(50, 205, 132)',\n librarySelectedTint: 'rgb(45, 45, 45)',\n librarySelectedBorder: 'rgb(115, 115, 115)',\n editingTint: 'rgb(58, 48, 36)', // the amber tint re-picked for a dark sheet\n accent: 'rgb(50, 205, 132)', // dark success — #047B43 is unreadable on dark\n mutedForeground: 'rgb(161, 161, 161)', // 4.82:1 on the selected card, 5.86:1 on the trough\n hoverBackground: 'rgb(64, 64, 64)',\n hoverRule: 'rgb(115, 115, 115)',\n pendingForeground: 'rgb(240, 138, 7)',\n },\n cardStrip: {\n background: 'rgb(38, 38, 38)', // one step under the selected card, as #F1F1F1 is under white\n divider: 'rgb(64, 64, 64)',\n fade: 'rgb(30, 30, 30)', // matches card.background so the mask disappears into it\n arrowBackground: 'rgb(45, 45, 45)',\n arrowBorder: 'rgb(100, 100, 100)', // dark dropdown.border, the light pair of #E8E8E8\n addPrimaryBackground: 'rgb(245, 245, 245)',\n addPrimaryForeground: 'rgb(23, 23, 23)',\n },\n selectionBar: {\n background: 'rgb(56, 56, 56)', // lifts off the dark sheet\n foreground: 'rgb(255, 255, 255)',\n mutedForeground: 'rgb(176, 176, 176)',\n divider: 'rgb(96, 96, 96)',\n border: 'rgb(96, 96, 96)', // hairline on the dark sheet\n primaryBorder: 'rgb(120, 120, 120)',\n shadow: '0px 0px 10px 0px rgba(0, 0, 0, 0.45)',\n noticeBackground: 'rgb(96, 70, 28)',\n noticeForeground: 'rgb(240, 202, 148)',\n noticeShadow: '0px 4px 10px 0px rgba(0, 0, 0, 0.45)',\n },\n inlineConfirm: {\n background: 'rgb(64, 64, 64)', // lifts off the dark sheet\n foreground: 'rgb(255, 255, 255)',\n divider: 'rgba(255, 255, 255, 0.16)',\n shadow: '0px 0px 10px 0px rgba(0, 0, 0, 0.45)',\n },\n dropdown: {\n border: 'rgb(100, 100, 100)',\n borderActive: 'rgba(50, 205, 132, 0.7)',\n borderFilter: 'rgba(50, 205, 132, 0.5)',\n borderError: 'rgba(255, 100, 100, 0.6)',\n borderPending: 'rgba(240, 138, 7, 0.7)',\n shadow: '0px 1px 0px 0px rgba(0, 0, 0, 0.4)',\n shadowHover: '0px 1px 0px 0px rgba(50, 205, 132, 0.6)',\n shadowActive: '0px 1px 0px 0px rgba(50, 205, 132, 0.8)',\n shadowFilter: '0px 1px 0px 0px rgba(50, 205, 132, 0.6)',\n shadowError:\n '0px 1px 0px 0px rgba(255, 100, 100, 0.8), 0px 0px 0px 2px rgba(255, 100, 100, 0.1)',\n shadowPending:\n '0px 1px 0px 0px rgba(240, 138, 7, 0.8), 0px 0px 0px 2px rgba(240, 138, 7, 0.15)',\n disabledBackground: 'rgb(70, 70, 70)',\n },\n tag: {\n primary: {\n background: 'rgba(37, 130, 234, 0.2)', // Darker background for dark theme\n foreground: 'rgb(96, 165, 250)', // Lighter blue for dark theme\n border: 'rgb(96, 165, 250)', // Lighter blue border\n shadow: 'rgba(96, 165, 250, 0.5)', // Lighter blue shadow\n },\n secondary: {\n background: 'rgba(0, 175, 102, 0.2)', // Darker background for dark theme\n foreground: 'rgb(34, 197, 94)', // Lighter green for dark theme\n border: 'rgb(34, 197, 94)', // Lighter green border\n shadow: 'rgba(34, 197, 94, 0.5)', // Lighter green shadow\n },\n default: {\n background: 'rgba(161, 161, 161, 0.2)', // Darker background for dark theme\n foreground: 'rgb(161, 161, 161)', // Light gray for dark theme\n border: 'rgb(161, 161, 161)', // Light gray border\n shadow: 'rgba(161, 161, 161, 0.5)', // Light gray shadow\n },\n error: {\n background: 'rgba(239, 68, 68, 0.2)', // Darker background for dark theme\n foreground: 'rgb(248, 113, 113)', // Lighter red for dark theme\n border: 'rgb(248, 113, 113)', // Lighter red border\n shadow: 'rgba(248, 113, 113, 0.5)', // Lighter red shadow\n },\n warning: {\n background: 'rgba(245, 158, 11, 0.2)', // Darker background for dark theme\n foreground: 'rgb(251, 191, 36)', // Lighter orange for dark theme\n border: 'rgb(251, 191, 36)', // Lighter orange border\n shadow: 'rgba(251, 191, 36, 0.5)', // Lighter orange shadow\n },\n success: {\n background: 'rgba(0, 175, 102, 0.2)', // Darker background for dark theme\n foreground: 'rgb(34, 197, 94)', // Lighter green for dark theme\n border: 'rgb(34, 197, 94)', // Lighter green border\n shadow: 'rgba(34, 197, 94, 0.5)', // Lighter green shadow\n },\n emphasis: {\n background: 'rgb(59, 59, 59)', // Figma #3b3b3b\n foreground: 'rgb(255, 255, 255)',\n border: 'rgb(255, 255, 255)',\n shadow: 'rgba(0, 0, 0, 0.2)',\n },\n info: {\n background: 'rgba(12, 88, 174, 0.25)',\n foreground: 'rgb(125, 171, 245)', // Blue (Dark) lifted for dark surfaces\n border: 'rgb(125, 171, 245)',\n shadow: 'rgba(125, 171, 245, 0.5)',\n },\n assistant: {\n // Same violet the assistant diff palette already picked for dark ground\n // (see codeBlock.diffAssistantBackground below) — one hue, reused everywhere\n // \"made by the assistant\" needs to read in dark mode.\n background: 'rgba(158, 130, 255, 0.18)',\n foreground: 'rgb(184, 158, 255)', // Matches diffAssistantForeground\n border: 'rgba(158, 130, 255, 0.32)', // Same hue as the background, more opaque so the edge reads\n shadow: 'rgba(184, 158, 255, 0.5)', // Lighter violet shadow\n },\n },\n numberTag: {\n background: 'rgba(255, 255, 255, 0.1)', // Light pill on dark surfaces\n foreground: 'rgb(161, 161, 161)', // Dark theme text secondary\n emphasisBackground: 'rgba(255, 255, 255, 0.2)', // Stronger pill for emphasis\n emphasisForeground: 'rgb(237, 237, 237)', // Dark theme text emphasis\n },\n table: {\n // Copied from the light theme and never darkened, so dark mode rendered a light\n // container, header and white rows with pale grey text.\n background: 'rgb(23, 23, 23)', // Darker than rows, as #F7F7F7 is in light\n boxShadow: 'none', // The designed container is a flat grey frame, not elevated\n header: {\n background: 'rgb(42, 42, 42)', // Dark theme header surface\n foreground: 'rgb(237, 237, 237)', // Dark theme text emphasis\n border: 'rgb(75, 85, 99)', // Dark theme header border\n },\n row: {\n background: 'rgb(30, 30, 30)', // Dark theme row background\n foreground: 'rgb(209, 213, 219)', // Dark theme row text\n hoverBackground: 'rgb(42, 42, 42)', // Dark theme row hover\n border: 'rgb(75, 85, 99)', // Dark theme row border\n // Not the light theme's brand green: over a near-black row it composites darker\n // than hoverBackground. 20%, because at 15% the step past hover was 1.12:1.\n selectedBackground: 'rgba(34, 197, 94, 0.2)',\n selectedAccent: 'rgb(20, 170, 100)', // non-text, 3:1 applies\n selectedForeground: 'rgb(34, 197, 94)', // 5.09:1 — text needs AA 4.5:1\n },\n border: 'rgb(75, 85, 99)', // Dark theme table border\n borderedRow: {\n background: 'rgb(30, 30, 30)', // Matches row.background and card.background\n outline: 'rgb(75, 85, 99)', // Dark theme bordered row outline\n },\n rowVariant: {\n success: {\n background: 'rgba(34, 197, 94, 0.15)', // Dark theme success background\n },\n warning: {\n background: 'rgba(251, 191, 36, 0.15)', // Dark theme warning background\n },\n error: {\n background: 'rgba(248, 113, 113, 0.15)', // Dark theme error background\n },\n info: {\n background: 'rgba(96, 165, 250, 0.15)', // Dark theme info background\n },\n },\n error: {\n iconBackground: 'rgba(245, 158, 11, 0.2)', // Dark theme warning background\n iconForeground: 'rgb(251, 191, 36)', // Dark theme warning foreground\n titleForeground: 'rgb(255, 255, 255)', // Dark theme title\n subtitleForeground: 'rgb(161, 161, 161)', // Dark theme subtitle\n },\n },\n text: {\n primary: 'rgb(255, 255, 255)',\n secondary: 'rgb(161, 161, 161)',\n dimmed: 'rgb(115, 115, 115)',\n emphasis: 'rgb(237, 237, 237)',\n muted: 'rgb(199, 199, 199)',\n placeholder: 'rgb(140, 140, 140)', // Dark theme placeholder color\n destructive: 'rgb(255, 120, 120)',\n success: 'rgb(20, 170, 100)',\n highlight: 'rgb(118, 214, 174)',\n warning: 'rgb(200, 130, 20)',\n warningMuted: 'rgb(206, 163, 108)', // Same tan reads as muted on dark too\n error: 'rgb(255, 80, 80)',\n info: 'rgb(125, 171, 245)',\n linkForeground: 'rgba(255, 255, 255, 0.45)',\n linkForegroundHover: 'rgb(255, 255, 255)',\n rightSideText: {\n // Mirrors text.secondary / text.primary, exactly as the light theme does.\n muted: 'rgb(161, 161, 161)',\n primary: 'rgb(255, 255, 255)',\n alignment: 'right' as const,\n fontSize: '12px',\n minWidth: '80px',\n },\n },\n codeBlock: {\n background: 'rgb(42, 42, 42)', // Dark background\n foreground: 'rgb(255, 255, 255)', // Light text\n border: 'rgb(80, 80, 80)', // Dark border\n lineNumber: 'rgb(161, 161, 161)', // Light gray for line numbers\n keyword: 'rgb(100, 150, 220)', // Light blue for keywords\n comment: 'rgb(161, 161, 161)', // Gray for comments\n string: 'rgb(120, 220, 150)', // Light green for strings\n number: 'rgb(255, 180, 100)', // Light orange for numbers\n type: 'rgb(100, 150, 220)', // Light blue for types\n diffAddedBackground: 'rgba(34, 197, 94, 0.16)', // Lighter green for dark theme\n diffRemovedBackground: 'rgba(255, 100, 100, 0.14)', // Lighter red for dark theme\n // Assistant diff palette, kept at the same relationships as the light theme values.\n diffAssistantBackground: 'rgba(158, 130, 255, 0.18)', // Violet tint that still reads on a dark ground\n diffAssistantForeground: 'rgb(184, 158, 255)', // Lighter violet so the marker holds contrast\n diffAssistantRemovedBackground: 'rgba(190, 185, 210, 0.08)', // Faint neutral-violet tint\n diffRemovedForeground: 'rgb(168, 162, 190)', // Muted violet-grey marker, lightened for dark contrast\n diffContextForeground: 'rgb(90, 90, 90)', // Low-contrast marker, dark counterpart to the near-white D9D9D9\n diffContextText: 'rgb(170, 170, 170)', // De-emphasised text, in line with the existing comment grey\n },\n chat: {\n userBubbleBackground: 'rgb(45, 45, 45)', // One step up from the page, matching selectableCard's dark surface\n userBubbleBorder: 'rgb(64, 64, 64)', // Matches card.border, the dark theme's neutral hairline\n // Neutral for the same reason as the light theme: the violet belongs to the\n // pending-change marks, not to authorship. Here the assistant sits one step BELOW\n // the user's surface rather than above it, since dark has no room above 45.\n assistantBubbleBackground: 'rgb(30, 30, 30)', // card.background\n assistantBubbleBorder: 'rgb(64, 64, 64)', // card.border, the same hairline the user bubble uses\n assistantBubbleForeground: 'rgb(255, 255, 255)', // card.foreground\n },\n assistant: {\n foreground: 'rgb(184, 158, 255)', // Matches diffAssistantForeground / tag.assistant.foreground\n surfaceBackground: 'rgba(158, 130, 255, 0.08)', // Faint tint, still distinguishable from the dark page\n surfaceBorder: 'rgba(158, 130, 255, 0.35)', // A dashed outline needs more presence than the surface tint\n // Light theme darkens the violet accent (#6E56CF) to #4A3F7A for body text; dark\n // theme instead lifts it, the same transform `text.info` applies to its accent, so\n // the muted violet still reads against a near-black ground rather than going darker.\n surfaceForeground: 'rgb(134, 120, 186)',\n },\n },\n};\n\n// localStorage keys\nconst THEME_MODE_KEY = 'malachite-theme-mode';\nconst CUSTOM_THEME_KEY = 'malachite-custom-theme';\n\n// hub forwards a caller-supplied theme from a JSON attribute into applyTheme, and the\n// shadow-root branch concatenates values into a CSS string — any of these closes :host.\n/** A custom property name is only safe to echo into a log once it matches this. */\nconst SAFE_CUSTOM_PROPERTY = /^--[A-Za-z0-9_-]+$/;\n\nconst UNSAFE_CSS_SYNTAX = /[{};]|\\/\\*|\\*\\//;\n// Keys become custom-property names, so they carry the same risk.\nconst SAFE_THEME_KEY = /^[A-Za-z0-9_-]+$/;\n\n/** Drops any key or value that could break out of a CSS declaration. Dropped entries fall\n * through to the base theme rather than leaving the token unset. */\nfunction sanitizeThemeInput(value: unknown, path: string): unknown {\n if (typeof value === 'string') {\n if (UNSAFE_CSS_SYNTAX.test(value)) {\n console.warn(\n `Malachite: ignoring theme value at ${path} — CSS syntax characters ({ } ; /* */) are not allowed.`,\n );\n return undefined;\n }\n return value;\n }\n\n if (value === null || typeof value !== 'object') return value;\n\n const sanitized: Record<string, unknown> = {};\n for (const [key, child] of Object.entries(value as Record<string, unknown>)) {\n const childPath = path ? `${path}.${key}` : key;\n if (!SAFE_THEME_KEY.test(key)) {\n // Parent path, never childPath: the rejected key is untrusted input.\n console.warn(\n `Malachite: ignoring a theme key under ${path || '<root>'} — theme keys may contain only letters, digits, hyphens and underscores.`,\n );\n continue;\n }\n const sanitizedChild = sanitizeThemeInput(child, childPath);\n if (sanitizedChild !== undefined) sanitized[key] = sanitizedChild;\n }\n return sanitized;\n}\n\n// Keep track of all shadow roots so we can update them when theme changes\nconst registeredShadowRoots = new Set<ShadowRoot>();\n\n/**\n * Register a shadow root to receive theme updates\n */\nexport function registerShadowRoot(shadowRoot: ShadowRoot): void {\n try {\n // Prevent duplicate registrations\n if (registeredShadowRoots.has(shadowRoot)) {\n return;\n }\n\n registeredShadowRoots.add(shadowRoot);\n // Apply current theme to this new shadow root\n applyCurrentThemeToShadowRoot(shadowRoot);\n } catch (error) {\n console.error('Error registering shadow root:', error);\n }\n}\n\n/**\n * Unregister a shadow root when it's no longer needed\n */\nexport function unregisterShadowRoot(shadowRoot: ShadowRoot): void {\n try {\n registeredShadowRoots.delete(shadowRoot);\n } catch (error) {\n console.error('Error unregistering shadow root:', error);\n }\n}\n\n/** Table keys whose readers expect kebab-case. `boxShadow` was emitted camelCase while\n * tailwind.css and getCurrentTheme both read `--malachite-table-box-shadow`, so the\n * bordered container never received a shadow. Keyed on the real table shape, so a typo\n * fails typecheck rather than silently emitting the camelCase name. */\nconst TABLE_KEBAB_KEYS: Partial<Record<keyof MalachiteTheme['colors']['table'], string>> = {\n rowVariant: 'row-variant',\n boxShadow: 'box-shadow',\n};\n\n/**\n * Helper function to process table color properties and add them to CSS properties\n */\nfunction processTableColorProperties(\n tableColors: MalachiteTheme['colors']['table'],\n prefix: string,\n addProperty: (key: string, value: string) => void,\n): void {\n Object.entries(tableColors).forEach(([key, value]) => {\n // Top-level table keys are NOT kebab-cased in general: `borderedRow` ships as\n // `--malachite-table-borderedRow-*` and tailwind.css reads it that way, so\n // renaming it would break consumers. Only the keys whose readers expect kebab\n // are mapped, hence the explicit list rather than a blanket transform.\n const parentKeyVar = TABLE_KEBAB_KEYS[key as keyof typeof TABLE_KEBAB_KEYS] ?? key;\n if (typeof value === 'object' && value !== null) {\n Object.entries(value).forEach(([subKey, subValue]) => {\n const kebabKey = subKey.replace(/([A-Z])/g, '-$1').toLowerCase();\n if (typeof subValue === 'object' && subValue !== null) {\n Object.entries(subValue).forEach(([deepKey, deepValue]) => {\n const deepKebabKey = deepKey.replace(/([A-Z])/g, '-$1').toLowerCase();\n addProperty(\n `${prefix}-${parentKeyVar}-${kebabKey}-${deepKebabKey}`,\n deepValue as string,\n );\n });\n } else {\n addProperty(`${prefix}-${parentKeyVar}-${kebabKey}`, subValue as string);\n }\n });\n } else {\n addProperty(`${prefix}-${parentKeyVar}`, value);\n }\n });\n}\n\n/**\n * Apply CSS custom properties to a target element (document.documentElement or shadow root)\n */\nfunction applyCSSCustomProperties(theme: MalachiteTheme, target: HTMLElement | ShadowRoot): void {\n // Both branches emit accent from these, so an omitted accent still paints the defaults.\n const accentColors = theme.colors.accent ?? DEFAULT_ACCENT_COLORS;\n const shadows = { ...theme.shadows, accent: theme.shadows.accent ?? DEFAULT_ACCENT_SHADOW };\n\n if (target instanceof ShadowRoot) {\n // For shadow roots, we need to set properties on a style element\n let styleElement = target.querySelector('#malachite-theme-vars') as HTMLStyleElement;\n if (!styleElement) {\n styleElement = document.createElement('style');\n styleElement.id = 'malachite-theme-vars';\n target.appendChild(styleElement);\n }\n\n // Build CSS custom properties\n const properties: string[] = [];\n\n // Add font size properties\n Object.entries(theme.fontSizes).forEach(([key, value]) => {\n properties.push(`--malachite-font-size-${key}: ${value}`);\n });\n\n // Add icon size properties\n Object.entries(theme.iconSizes).forEach(([key, value]) => {\n properties.push(`--malachite-icon-size-${key}: ${value}`);\n });\n\n // Add radius properties\n Object.entries(theme.radius).forEach(([key, value]) => {\n properties.push(`--malachite-radius-${key}: ${value}`);\n });\n\n // Add control height properties\n Object.entries(theme.controlHeights ?? CONTROL_HEIGHT).forEach(([key, value]) => {\n properties.push(`--malachite-control-height-${key}: ${value}`);\n });\n\n // Add shadow properties\n Object.entries(shadows).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n properties.push(`--malachite-shadow-${kebabKey}: ${value}`);\n });\n\n // Add color properties\n properties.push(`--malachite-shadow-color: ${theme.colors.shadowColor}`);\n properties.push(`--malachite-shadow-opacity: ${theme.colors.shadowOpacity}`);\n\n // Add card color properties\n Object.entries(theme.colors.card).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n properties.push(`--malachite-card-${kebabKey}: ${value}`);\n });\n\n // Add overlay color properties\n Object.entries(theme.colors.overlay).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n properties.push(`--malachite-overlay-${kebabKey}: ${value}`);\n });\n\n // Add alert color properties\n Object.entries(theme.colors.alert).forEach(([alertType, alertColors]) => {\n Object.entries(alertColors).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n properties.push(`--malachite-alert-${alertType}-${kebabKey}: ${value}`);\n });\n });\n\n // Add tooltip color properties\n Object.entries(theme.colors.tooltip).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n properties.push(`--malachite-tooltip-${kebabKey}: ${value}`);\n });\n\n // Add buttonList color properties\n Object.entries(theme.colors.buttonList).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n properties.push(`--malachite-buttonlist-${kebabKey}: ${value}`);\n });\n\n // Add pillButton color properties\n Object.entries(theme.colors.pillButton).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n properties.push(`--malachite-pillbutton-${kebabKey}: ${value}`);\n });\n\n // Add toggle color properties\n Object.entries(theme.colors.toggle).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n properties.push(`--malachite-toggle-${kebabKey}: ${value}`);\n });\n\n // Add segmentedControl color properties\n Object.entries(theme.colors.segmentedControl).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n properties.push(`--malachite-segmented-control-${kebabKey}: ${value}`);\n });\n\n Object.entries(theme.colors.selectableCard).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n properties.push(`--malachite-selectable-card-${kebabKey}: ${value}`);\n });\n\n Object.entries(theme.colors.cardStrip).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n properties.push(`--malachite-card-strip-${kebabKey}: ${value}`);\n });\n\n Object.entries(theme.colors.selectionBar).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n properties.push(`--malachite-selection-bar-${kebabKey}: ${value}`);\n });\n\n Object.entries(theme.colors.inlineConfirm).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n properties.push(`--malachite-inline-confirm-${kebabKey}: ${value}`);\n });\n\n // Add dropdown color properties\n Object.entries(theme.colors.dropdown).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n properties.push(`--malachite-dropdown-${kebabKey}: ${value}`);\n });\n\n Object.entries(theme.colors.control).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n properties.push(`--malachite-control-${kebabKey}: ${value}`);\n });\n\n Object.entries(accentColors).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n properties.push(`--malachite-accent-${kebabKey}: ${value}`);\n });\n\n // Add tag color properties\n Object.entries(theme.colors.tag).forEach(([tagType, tagColors]) => {\n Object.entries(tagColors).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n properties.push(`--malachite-tag-${tagType}-${kebabKey}: ${value}`);\n });\n });\n\n // Add number tag color properties\n Object.entries(theme.colors.numberTag).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n properties.push(`--malachite-number-tag-${kebabKey}: ${value}`);\n });\n\n // Add table color properties\n processTableColorProperties(theme.colors.table, '--malachite-table', (key, value) =>\n properties.push(`${key}: ${value}`),\n );\n\n // Add text color properties\n Object.entries(theme.colors.text).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n if (typeof value === 'object' && value !== null) {\n // Handle nested objects like rightSideText (supports one extra nesting level)\n Object.entries(value).forEach(([nestedKey, nestedValue]) => {\n const nestedKebabKey = nestedKey.replace(/([A-Z])/g, '-$1').toLowerCase();\n if (typeof nestedValue === 'object' && nestedValue !== null) {\n Object.entries(nestedValue as Record<string, string>).forEach(\n ([deepKey, deepValue]) => {\n const deepKebabKey = deepKey\n .replace(/([A-Z])/g, '-$1')\n .toLowerCase();\n properties.push(\n `--malachite-text-${kebabKey}-${nestedKebabKey}-${deepKebabKey}: ${deepValue}`,\n );\n },\n );\n } else {\n properties.push(\n `--malachite-text-${kebabKey}-${nestedKebabKey}: ${nestedValue}`,\n );\n }\n });\n } else {\n properties.push(`--malachite-text-${kebabKey}: ${value}`);\n }\n });\n\n // Add codeBlock color properties\n Object.entries(theme.colors.codeBlock).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n properties.push(`--malachite-codeblock-${kebabKey}: ${value}`);\n });\n\n // Add chat color properties\n Object.entries(theme.colors.chat).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n properties.push(`--malachite-chat-${kebabKey}: ${value}`);\n });\n\n // Add assistant color properties\n Object.entries(theme.colors.assistant).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n properties.push(`--malachite-assistant-${kebabKey}: ${value}`);\n });\n\n // Add button color variants\n // Keep in sync with the documentElement branch's list: 'outline' was missing here,\n // so the token never reached a shadow root — where every component actually renders.\n const colorVariants = [\n 'primary',\n 'secondary',\n 'outline',\n 'destructive',\n 'success',\n 'warning',\n 'error',\n ] as const;\n colorVariants.forEach((variant) => {\n const variantColors = theme.colors[variant];\n Object.entries(variantColors).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n properties.push(`--malachite-${variant}-${kebabKey}: ${value}`);\n });\n });\n\n // :host only — custom properties inherit to the whole shadow tree, and a\n // universal `* { }` copy forces WebKit to apply/compare every token on every\n // element, which makes style recalc O(elements × tokens) and freezes Safari\n // on large pages. Component-level token overrides still win over inheritance.\n // Second line of defence behind mergeThemes' sanitizer.\n const safeProperties = properties.filter((declaration) => {\n if (!UNSAFE_CSS_SYNTAX.test(declaration)) return true;\n // A hostile key puts the breakout before the first colon, so check the name too.\n const candidate = declaration.split(':', 1)[0].trim();\n const name = SAFE_CUSTOM_PROPERTY.test(candidate) ? candidate : 'an unnamed token';\n console.warn(`Malachite: dropped an unsafe theme declaration for ${name}`);\n return false;\n });\n\n styleElement.textContent = `:host { ${safeProperties.join('; ')} }`;\n } else if (target instanceof HTMLElement) {\n // For document.documentElement, use setProperty directly\n Object.entries(theme.fontSizes).forEach(([key, value]) => {\n target.style.setProperty(`--malachite-font-size-${key}`, value);\n });\n\n Object.entries(theme.iconSizes).forEach(([key, value]) => {\n target.style.setProperty(`--malachite-icon-size-${key}`, value);\n });\n\n Object.entries(theme.radius).forEach(([key, value]) => {\n target.style.setProperty(`--malachite-radius-${key}`, value);\n });\n\n Object.entries(theme.controlHeights ?? CONTROL_HEIGHT).forEach(([key, value]) => {\n target.style.setProperty(`--malachite-control-height-${key}`, value);\n });\n\n Object.entries(shadows).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n target.style.setProperty(`--malachite-shadow-${kebabKey}`, value);\n });\n\n target.style.setProperty('--malachite-shadow-color', theme.colors.shadowColor);\n target.style.setProperty(\n '--malachite-shadow-opacity',\n theme.colors.shadowOpacity.toString(),\n );\n\n // Add card color properties\n Object.entries(theme.colors.card).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n target.style.setProperty(`--malachite-card-${kebabKey}`, value);\n });\n\n // Add overlay color properties\n Object.entries(theme.colors.overlay).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n target.style.setProperty(`--malachite-overlay-${kebabKey}`, value);\n });\n\n // Add alert color properties\n Object.entries(theme.colors.alert).forEach(([alertType, alertColors]) => {\n Object.entries(alertColors).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n target.style.setProperty(`--malachite-alert-${alertType}-${kebabKey}`, value);\n });\n });\n\n // Add tooltip color properties\n Object.entries(theme.colors.tooltip).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n target.style.setProperty(`--malachite-tooltip-${kebabKey}`, value);\n });\n\n // Add buttonList color properties\n Object.entries(theme.colors.buttonList).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n target.style.setProperty(`--malachite-buttonlist-${kebabKey}`, value);\n });\n\n // Add pillButton color properties\n Object.entries(theme.colors.pillButton).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n target.style.setProperty(`--malachite-pillbutton-${kebabKey}`, value);\n });\n\n // Add toggle color properties\n Object.entries(theme.colors.toggle).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n target.style.setProperty(`--malachite-toggle-${kebabKey}`, value);\n });\n\n // Add segmentedControl color properties\n Object.entries(theme.colors.segmentedControl).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n target.style.setProperty(`--malachite-segmented-control-${kebabKey}`, value);\n });\n\n Object.entries(theme.colors.selectableCard).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n target.style.setProperty(`--malachite-selectable-card-${kebabKey}`, value);\n });\n\n Object.entries(theme.colors.cardStrip).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n target.style.setProperty(`--malachite-card-strip-${kebabKey}`, value);\n });\n\n Object.entries(theme.colors.selectionBar).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n target.style.setProperty(`--malachite-selection-bar-${kebabKey}`, value);\n });\n\n Object.entries(theme.colors.inlineConfirm).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n target.style.setProperty(`--malachite-inline-confirm-${kebabKey}`, value);\n });\n\n // Add dropdown color properties\n Object.entries(theme.colors.dropdown).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n target.style.setProperty(`--malachite-dropdown-${kebabKey}`, value);\n });\n\n Object.entries(theme.colors.control).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n target.style.setProperty(`--malachite-control-${kebabKey}`, value);\n });\n\n Object.entries(accentColors).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n target.style.setProperty(`--malachite-accent-${kebabKey}`, value);\n });\n\n // Add tag color properties\n Object.entries(theme.colors.tag).forEach(([tagType, tagColors]) => {\n Object.entries(tagColors).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n target.style.setProperty(`--malachite-tag-${tagType}-${kebabKey}`, value);\n });\n });\n\n // Add number tag color properties\n Object.entries(theme.colors.numberTag).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n target.style.setProperty(`--malachite-number-tag-${kebabKey}`, value);\n });\n\n // Add table color properties\n processTableColorProperties(theme.colors.table, '--malachite-table', (key, value) =>\n target.style.setProperty(key, value),\n );\n\n // Add text color properties\n Object.entries(theme.colors.text).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n if (typeof value === 'object' && value !== null) {\n // Handle nested objects like rightSideText (supports one extra nesting level)\n Object.entries(value).forEach(([nestedKey, nestedValue]) => {\n const nestedKebabKey = nestedKey.replace(/([A-Z])/g, '-$1').toLowerCase();\n if (typeof nestedValue === 'object' && nestedValue !== null) {\n Object.entries(nestedValue as Record<string, string>).forEach(\n ([deepKey, deepValue]) => {\n const deepKebabKey = deepKey\n .replace(/([A-Z])/g, '-$1')\n .toLowerCase();\n target.style.setProperty(\n `--malachite-text-${kebabKey}-${nestedKebabKey}-${deepKebabKey}`,\n deepValue,\n );\n },\n );\n } else {\n target.style.setProperty(\n `--malachite-text-${kebabKey}-${nestedKebabKey}`,\n nestedValue as string,\n );\n }\n });\n } else {\n target.style.setProperty(`--malachite-text-${kebabKey}`, value);\n }\n });\n\n // Add codeBlock color properties\n Object.entries(theme.colors.codeBlock).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n target.style.setProperty(`--malachite-codeblock-${kebabKey}`, value);\n });\n\n // Add chat color properties\n Object.entries(theme.colors.chat).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n target.style.setProperty(`--malachite-chat-${kebabKey}`, value);\n });\n\n // Add assistant color properties\n Object.entries(theme.colors.assistant).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n target.style.setProperty(`--malachite-assistant-${kebabKey}`, value);\n });\n\n const colorVariants = [\n 'primary',\n 'secondary',\n 'outline',\n 'destructive',\n 'success',\n 'warning',\n 'error',\n ] as const;\n colorVariants.forEach((variant) => {\n const variantColors = theme.colors[variant];\n Object.entries(variantColors).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n target.style.setProperty(`--malachite-${variant}-${kebabKey}`, value);\n });\n });\n }\n}\n\n/**\n * Apply current theme to a specific shadow root\n */\nfunction applyCurrentThemeToShadowRoot(shadowRoot: ShadowRoot): void {\n try {\n const currentMode = getCurrentThemeMode();\n const customTheme = getCustomTheme();\n\n // Start with base theme (light or dark)\n const baseTheme = currentMode === 'dark' ? darkTheme : defaultTheme;\n\n // Merge with custom theme if any\n const finalTheme = customTheme ? mergeThemes(baseTheme, customTheme) : baseTheme;\n\n applyCSSCustomProperties(finalTheme, shadowRoot);\n } catch (error) {\n console.error('Error applying theme to shadow root:', error);\n }\n}\n\n/**\n * Get current theme mode from localStorage\n */\nexport function getCurrentThemeMode(): 'light' | 'dark' {\n if (typeof window === 'undefined') return 'light';\n return (localStorage.getItem(THEME_MODE_KEY) as 'light' | 'dark') || 'light';\n}\n\n/**\n * Get custom theme from localStorage\n */\nfunction getCustomTheme(): PartialMalachiteTheme | null {\n if (typeof window === 'undefined') return null;\n const stored = localStorage.getItem(CUSTOM_THEME_KEY);\n if (!stored) return null;\n try {\n return JSON.parse(stored);\n } catch {\n // Corrupt entry: drop it rather than throwing out of every caller. applyLightTheme\n // used to removeItem before reading, so it self-healed; now that it merges like\n // applyDarkTheme, that recovery has to live here or a bad entry wedges both modes.\n localStorage.removeItem(CUSTOM_THEME_KEY);\n return null;\n }\n}\n\n/**\n * Save theme mode to localStorage\n */\nfunction saveThemeMode(mode: 'light' | 'dark'): void {\n if (typeof window !== 'undefined') {\n localStorage.setItem(THEME_MODE_KEY, mode);\n }\n}\n\n/**\n * Save custom theme to localStorage\n */\nfunction saveCustomTheme(theme: PartialMalachiteTheme): void {\n if (typeof window !== 'undefined') {\n localStorage.setItem(CUSTOM_THEME_KEY, JSON.stringify(theme));\n }\n}\n\n/**\n * Merge themes (deep merge for nested objects)\n */\nfunction mergeThemes(base: MalachiteTheme, customInput: PartialMalachiteTheme): MalachiteTheme {\n // The one choke point every custom-theme path funnels through.\n const custom = sanitizeThemeInput(customInput, '') as PartialMalachiteTheme;\n\n const result = { ...base };\n\n if (custom.fontSizes) {\n result.fontSizes = { ...result.fontSizes, ...custom.fontSizes };\n }\n\n if (custom.iconSizes) {\n result.iconSizes = { ...result.iconSizes, ...custom.iconSizes };\n }\n\n if (custom.radius) {\n result.radius = { ...result.radius, ...custom.radius };\n }\n\n if (custom.controlHeights) {\n result.controlHeights = {\n ...(result.controlHeights ?? CONTROL_HEIGHT),\n ...custom.controlHeights,\n };\n }\n\n if (custom.shadows) {\n result.shadows = { ...result.shadows, ...custom.shadows };\n }\n\n if (custom.colors) {\n result.colors = { ...result.colors };\n\n if (custom.colors.shadowColor !== undefined) {\n result.colors.shadowColor = custom.colors.shadowColor;\n }\n if (custom.colors.shadowOpacity !== undefined) {\n result.colors.shadowOpacity = custom.colors.shadowOpacity;\n }\n\n // Handle card colors\n if (custom.colors.card) {\n result.colors.card = { ...result.colors.card, ...custom.colors.card };\n }\n\n // Handle overlay colors\n if (custom.colors.overlay) {\n result.colors.overlay = { ...result.colors.overlay, ...custom.colors.overlay };\n }\n\n // Handle alert colors. Keyed loop rather than a fixed destructure, so an alert\n // variant added to the theme later is merged instead of silently dropped.\n if (custom.colors.alert) {\n // Copy first: the spread makes a fresh `alert`, but each variant still points\n // at defaultTheme's object, which must not be mutated.\n result.colors.alert = { ...result.colors.alert };\n for (const key of Object.keys(\n custom.colors.alert,\n ) as (keyof MalachiteTheme['colors']['alert'])[]) {\n const variant = custom.colors.alert[key];\n if (variant) {\n result.colors.alert[key] = { ...result.colors.alert[key], ...variant };\n }\n }\n }\n\n // Handle tooltip colors\n if (custom.colors.tooltip) {\n result.colors.tooltip = { ...result.colors.tooltip, ...custom.colors.tooltip };\n }\n\n // Handle each color variant explicitly to avoid TypeScript issues\n if (custom.colors.primary) {\n result.colors.primary = { ...result.colors.primary, ...custom.colors.primary };\n }\n if (custom.colors.accent) {\n result.colors.accent = {\n ...(result.colors.accent ?? DEFAULT_ACCENT_COLORS),\n ...custom.colors.accent,\n };\n }\n if (custom.colors.control) {\n result.colors.control = { ...result.colors.control, ...custom.colors.control };\n }\n if (custom.colors.outline) {\n result.colors.outline = { ...result.colors.outline, ...custom.colors.outline };\n }\n if (custom.colors.secondary) {\n result.colors.secondary = { ...result.colors.secondary, ...custom.colors.secondary };\n }\n if (custom.colors.destructive) {\n result.colors.destructive = {\n ...result.colors.destructive,\n ...custom.colors.destructive,\n };\n }\n if (custom.colors.success) {\n result.colors.success = { ...result.colors.success, ...custom.colors.success };\n }\n if (custom.colors.warning) {\n result.colors.warning = { ...result.colors.warning, ...custom.colors.warning };\n }\n if (custom.colors.error) {\n result.colors.error = { ...result.colors.error, ...custom.colors.error };\n }\n if (custom.colors.buttonList) {\n result.colors.buttonList = { ...result.colors.buttonList, ...custom.colors.buttonList };\n }\n if (custom.colors.pillButton) {\n result.colors.pillButton = { ...result.colors.pillButton, ...custom.colors.pillButton };\n }\n if (custom.colors.toggle) {\n result.colors.toggle = { ...result.colors.toggle, ...custom.colors.toggle };\n }\n if (custom.colors.segmentedControl) {\n result.colors.segmentedControl = {\n ...result.colors.segmentedControl,\n ...custom.colors.segmentedControl,\n };\n }\n if (custom.colors.selectableCard) {\n result.colors.selectableCard = {\n ...result.colors.selectableCard,\n ...custom.colors.selectableCard,\n };\n }\n if (custom.colors.cardStrip) {\n result.colors.cardStrip = { ...result.colors.cardStrip, ...custom.colors.cardStrip };\n }\n if (custom.colors.selectionBar) {\n result.colors.selectionBar = {\n ...result.colors.selectionBar,\n ...custom.colors.selectionBar,\n };\n }\n if (custom.colors.inlineConfirm) {\n result.colors.inlineConfirm = {\n ...result.colors.inlineConfirm,\n ...custom.colors.inlineConfirm,\n };\n }\n if (custom.colors.dropdown) {\n result.colors.dropdown = { ...result.colors.dropdown, ...custom.colors.dropdown };\n }\n if (custom.colors.tag) {\n // Copy first: the spread makes a fresh `tag`, but each variant still points at\n // defaultTheme's object, which must not be mutated.\n result.colors.tag = { ...result.colors.tag };\n for (const key of Object.keys(\n custom.colors.tag,\n ) as (keyof MalachiteTheme['colors']['tag'])[]) {\n const variant = custom.colors.tag[key];\n if (variant) {\n result.colors.tag[key] = { ...result.colors.tag[key], ...variant };\n }\n }\n }\n if (custom.colors.numberTag) {\n result.colors.numberTag = { ...result.colors.numberTag, ...custom.colors.numberTag };\n }\n if (custom.colors.text) {\n const { rightSideText, ...flat } = custom.colors.text;\n result.colors.text = { ...result.colors.text, ...flat };\n if (rightSideText) {\n result.colors.text.rightSideText = {\n ...result.colors.text.rightSideText,\n ...rightSideText,\n };\n }\n }\n if (custom.colors.codeBlock) {\n result.colors.codeBlock = { ...result.colors.codeBlock, ...custom.colors.codeBlock };\n }\n if (custom.colors.chat) {\n result.colors.chat = { ...result.colors.chat, ...custom.colors.chat };\n }\n if (custom.colors.assistant) {\n result.colors.assistant = { ...result.colors.assistant, ...custom.colors.assistant };\n }\n // Deeper than the flat groups above: table's sub-objects are nested, so a shallow\n // spread would drop whatever the caller didn't restate.\n if (custom.colors.table) {\n const { header, row, borderedRow, rowVariant, error, ...flat } = custom.colors.table;\n result.colors.table = { ...result.colors.table, ...flat };\n if (header) {\n result.colors.table.header = { ...result.colors.table.header, ...header };\n }\n if (row) {\n result.colors.table.row = { ...result.colors.table.row, ...row };\n }\n if (borderedRow) {\n result.colors.table.borderedRow = {\n ...result.colors.table.borderedRow,\n ...borderedRow,\n };\n }\n if (error) {\n result.colors.table.error = { ...result.colors.table.error, ...error };\n }\n if (rowVariant) {\n // Copy first: the spread made a fresh `table`, but `rowVariant` still points at\n // defaultTheme's, which must not be mutated.\n const merged = { ...result.colors.table.rowVariant };\n for (const key of Object.keys(rowVariant) as (keyof typeof rowVariant)[]) {\n const variant = rowVariant[key];\n if (variant) {\n merged[key] = { ...merged[key], ...variant };\n }\n }\n result.colors.table.rowVariant = merged;\n }\n }\n }\n\n return result;\n}\n\n/**\n * Apply a custom theme to Malachite components\n * This function sets CSS custom properties that will be used by all Malachite components\n * Works with Shadow DOM isolation by applying to all registered shadow roots\n */\nexport function applyTheme(theme: PartialMalachiteTheme): void {\n // Save custom theme to localStorage\n saveCustomTheme(theme);\n\n // Apply to main document\n const currentMode = getCurrentThemeMode();\n const baseTheme = currentMode === 'dark' ? darkTheme : defaultTheme;\n const finalTheme = mergeThemes(baseTheme, theme);\n\n applyCSSCustomProperties(finalTheme, document.documentElement);\n\n // Apply to all registered shadow roots\n registeredShadowRoots.forEach((shadowRoot) => {\n applyCSSCustomProperties(finalTheme, shadowRoot);\n });\n\n // Update data-theme attribute for main document CSS\n if (currentMode === 'dark') {\n document.documentElement.setAttribute('data-theme', 'dark');\n } else {\n document.documentElement.removeAttribute('data-theme');\n }\n}\n\n/** Scope the active theme (base mode + any persisted custom overrides) to one element/root, without changing global mode. Used by <ThemeScope>. */\nexport function applyThemeVars(target: HTMLElement | ShadowRoot, mode: ThemeMode): void {\n const baseTheme = mode === 'dark' ? darkTheme : defaultTheme;\n const customTheme = getCustomTheme();\n const finalTheme = customTheme ? mergeThemes(baseTheme, customTheme) : baseTheme;\n applyCSSCustomProperties(finalTheme, target);\n}\n\n/**\n * Apply the default (light) theme\n */\nexport function applyLightTheme(): void {\n saveThemeMode('light');\n document.documentElement.removeAttribute('data-theme');\n\n // Apply the light theme, preserving any custom theme. Deliberately symmetric with\n // applyDarkTheme: this used to removeItem(CUSTOM_THEME_KEY), so a toggle to light\n // destroyed a consumer's custom theme permanently. resetTheme is the way to clear one.\n const customTheme = getCustomTheme();\n const finalTheme = customTheme ? mergeThemes(defaultTheme, customTheme) : defaultTheme;\n\n applyCSSCustomProperties(finalTheme, document.documentElement);\n\n // Apply to all registered shadow roots\n registeredShadowRoots.forEach((shadowRoot) => {\n applyCSSCustomProperties(finalTheme, shadowRoot);\n });\n}\n\n/**\n * Apply the dark theme\n */\nexport function applyDarkTheme(): void {\n saveThemeMode('dark');\n document.documentElement.setAttribute('data-theme', 'dark');\n\n // Apply dark theme, preserving any custom theme\n const customTheme = getCustomTheme();\n const finalTheme = customTheme ? mergeThemes(darkTheme, customTheme) : darkTheme;\n\n applyCSSCustomProperties(finalTheme, document.documentElement);\n\n // Apply to all registered shadow roots\n registeredShadowRoots.forEach((shadowRoot) => {\n applyCSSCustomProperties(finalTheme, shadowRoot);\n });\n}\n\n/**\n * Toggle between light and dark themes\n */\nexport function toggleTheme(): 'light' | 'dark' {\n const currentMode = getCurrentThemeMode();\n if (currentMode === 'dark') {\n applyLightTheme();\n return 'light';\n } else {\n applyDarkTheme();\n return 'dark';\n }\n}\n\n/**\n * Apply a custom theme while preserving the current theme mode (light/dark)\n */\nexport function applyCustomTheme(customTheme: PartialMalachiteTheme): void {\n applyTheme(customTheme);\n}\n\n/**\n * Reset theme to default values\n */\nexport function resetTheme(): void {\n const currentMode = getCurrentThemeMode();\n localStorage.removeItem(CUSTOM_THEME_KEY);\n\n if (currentMode === 'dark') {\n applyDarkTheme();\n } else {\n applyLightTheme();\n }\n}\n\n/**\n * Initialize the theme system - should be called on app startup\n */\nexport function initializeTheme(): void {\n if (typeof window !== 'undefined') {\n const currentMode = getCurrentThemeMode();\n const customTheme = getCustomTheme();\n\n if (currentMode === 'dark') {\n if (customTheme) {\n const finalTheme = mergeThemes(darkTheme, customTheme);\n applyCSSCustomProperties(finalTheme, document.documentElement);\n } else {\n applyCSSCustomProperties(darkTheme, document.documentElement);\n }\n document.documentElement.setAttribute('data-theme', 'dark');\n } else {\n if (customTheme) {\n const finalTheme = mergeThemes(defaultTheme, customTheme);\n applyCSSCustomProperties(finalTheme, document.documentElement);\n } else {\n applyCSSCustomProperties(defaultTheme, document.documentElement);\n }\n document.documentElement.removeAttribute('data-theme');\n }\n }\n}\n\n/**\n * Get current theme values from CSS custom properties\n */\nexport function getCurrentTheme(): MalachiteTheme {\n const computedStyle = getComputedStyle(document.documentElement);\n\n return {\n fontSizes: {\n xsmall:\n computedStyle.getPropertyValue('--malachite-font-size-xsmall').trim() ||\n defaultTheme.fontSizes.xsmall,\n small:\n computedStyle.getPropertyValue('--malachite-font-size-small').trim() ||\n defaultTheme.fontSizes.small,\n medium:\n computedStyle.getPropertyValue('--malachite-font-size-medium').trim() ||\n defaultTheme.fontSizes.medium,\n '15':\n computedStyle.getPropertyValue('--malachite-font-size-15').trim() ||\n defaultTheme.fontSizes['15'],\n large:\n computedStyle.getPropertyValue('--malachite-font-size-large').trim() ||\n defaultTheme.fontSizes.large,\n xlarge:\n computedStyle.getPropertyValue('--malachite-font-size-xlarge').trim() ||\n defaultTheme.fontSizes.xlarge,\n xxlarge:\n computedStyle.getPropertyValue('--malachite-font-size-xxlarge').trim() ||\n defaultTheme.fontSizes.xxlarge,\n },\n iconSizes: {\n xsmall:\n computedStyle.getPropertyValue('--malachite-icon-size-xsmall').trim() ||\n defaultTheme.iconSizes.xsmall,\n small:\n computedStyle.getPropertyValue('--malachite-icon-size-small').trim() ||\n defaultTheme.iconSizes.small,\n medium:\n computedStyle.getPropertyValue('--malachite-icon-size-medium').trim() ||\n defaultTheme.iconSizes.medium,\n large:\n computedStyle.getPropertyValue('--malachite-icon-size-large').trim() ||\n defaultTheme.iconSizes.large,\n },\n controlHeights: {\n small:\n computedStyle.getPropertyValue('--malachite-control-height-small').trim() ||\n CONTROL_HEIGHT.small,\n medium:\n computedStyle.getPropertyValue('--malachite-control-height-medium').trim() ||\n CONTROL_HEIGHT.medium,\n large:\n computedStyle.getPropertyValue('--malachite-control-height-large').trim() ||\n CONTROL_HEIGHT.large,\n },\n radius: {\n xs:\n computedStyle.getPropertyValue('--malachite-radius-xs').trim() ||\n defaultTheme.radius.xs,\n sm:\n computedStyle.getPropertyValue('--malachite-radius-sm').trim() ||\n defaultTheme.radius.sm,\n md:\n computedStyle.getPropertyValue('--malachite-radius-md').trim() ||\n defaultTheme.radius.md,\n lg:\n computedStyle.getPropertyValue('--malachite-radius-lg').trim() ||\n defaultTheme.radius.lg,\n '10':\n computedStyle.getPropertyValue('--malachite-radius-10').trim() ||\n defaultTheme.radius['10'],\n xl:\n computedStyle.getPropertyValue('--malachite-radius-xl').trim() ||\n defaultTheme.radius.xl,\n xxl:\n computedStyle.getPropertyValue('--malachite-radius-xxl').trim() ||\n defaultTheme.radius.xxl,\n xxxl:\n computedStyle.getPropertyValue('--malachite-radius-xxxl').trim() ||\n defaultTheme.radius.xxxl,\n },\n shadows: {\n sm:\n computedStyle.getPropertyValue('--malachite-shadow-sm').trim() ||\n defaultTheme.shadows.sm,\n md:\n computedStyle.getPropertyValue('--malachite-shadow-md').trim() ||\n defaultTheme.shadows.md,\n lg:\n computedStyle.getPropertyValue('--malachite-shadow-lg').trim() ||\n defaultTheme.shadows.lg,\n xl:\n computedStyle.getPropertyValue('--malachite-shadow-xl').trim() ||\n defaultTheme.shadows.xl,\n glow:\n computedStyle.getPropertyValue('--malachite-shadow-glow').trim() ||\n defaultTheme.shadows.glow,\n glowLg:\n computedStyle.getPropertyValue('--malachite-shadow-glow-lg').trim() ||\n defaultTheme.shadows.glowLg,\n default:\n computedStyle.getPropertyValue('--malachite-shadow-default').trim() ||\n defaultTheme.shadows.default,\n accent:\n computedStyle.getPropertyValue('--malachite-shadow-accent').trim() ||\n DEFAULT_ACCENT_SHADOW,\n success:\n computedStyle.getPropertyValue('--malachite-shadow-success').trim() ||\n defaultTheme.shadows.success,\n warning:\n computedStyle.getPropertyValue('--malachite-shadow-warning').trim() ||\n defaultTheme.shadows.warning,\n error:\n computedStyle.getPropertyValue('--malachite-shadow-error').trim() ||\n defaultTheme.shadows.error,\n },\n colors: {\n shadowColor:\n computedStyle.getPropertyValue('--malachite-shadow-color').trim() ||\n defaultTheme.colors.shadowColor,\n shadowOpacity:\n parseFloat(computedStyle.getPropertyValue('--malachite-shadow-opacity').trim()) ||\n defaultTheme.colors.shadowOpacity,\n card: {\n background:\n computedStyle.getPropertyValue('--malachite-card-background').trim() ||\n defaultTheme.colors.card.background,\n foreground:\n computedStyle.getPropertyValue('--malachite-card-foreground').trim() ||\n defaultTheme.colors.card.foreground,\n border:\n computedStyle.getPropertyValue('--malachite-card-border').trim() ||\n defaultTheme.colors.card.border,\n shadow:\n computedStyle.getPropertyValue('--malachite-card-shadow').trim() ||\n defaultTheme.colors.card.shadow,\n dimmedBackground:\n computedStyle.getPropertyValue('--malachite-card-dimmed-background').trim() ||\n defaultTheme.colors.card.dimmedBackground,\n sunkenBackground:\n computedStyle.getPropertyValue('--malachite-card-sunken-background').trim() ||\n defaultTheme.colors.card.sunkenBackground,\n warmBackground:\n computedStyle.getPropertyValue('--malachite-card-warm-background').trim() ||\n defaultTheme.colors.card.warmBackground,\n headerBackground:\n computedStyle.getPropertyValue('--malachite-card-header-background').trim() ||\n defaultTheme.colors.card.headerBackground,\n footerBackground:\n computedStyle.getPropertyValue('--malachite-card-footer-background').trim() ||\n defaultTheme.colors.card.footerBackground,\n footerGlassBackground:\n computedStyle\n .getPropertyValue('--malachite-card-footer-glass-background')\n .trim() || defaultTheme.colors.card.footerGlassBackground,\n trayNeutral:\n computedStyle.getPropertyValue('--malachite-card-tray-neutral').trim() ||\n defaultTheme.colors.card.trayNeutral,\n trayWarning:\n computedStyle.getPropertyValue('--malachite-card-tray-warning').trim() ||\n defaultTheme.colors.card.trayWarning,\n trayError:\n computedStyle.getPropertyValue('--malachite-card-tray-error').trim() ||\n defaultTheme.colors.card.trayError,\n traySuccess:\n computedStyle.getPropertyValue('--malachite-card-tray-success').trim() ||\n defaultTheme.colors.card.traySuccess,\n subtleDivider:\n computedStyle.getPropertyValue('--malachite-card-subtle-divider').trim() ||\n defaultTheme.colors.card.subtleDivider,\n },\n overlay: {\n scrim:\n computedStyle.getPropertyValue('--malachite-overlay-scrim').trim() ||\n defaultTheme.colors.overlay.scrim,\n },\n alert: {\n info: {\n background:\n computedStyle\n .getPropertyValue('--malachite-alert-info-background')\n .trim() || defaultTheme.colors.alert.info.background,\n foreground:\n computedStyle\n .getPropertyValue('--malachite-alert-info-foreground')\n .trim() || defaultTheme.colors.alert.info.foreground,\n },\n success: {\n background:\n computedStyle\n .getPropertyValue('--malachite-alert-success-background')\n .trim() || defaultTheme.colors.alert.success.background,\n foreground:\n computedStyle\n .getPropertyValue('--malachite-alert-success-foreground')\n .trim() || defaultTheme.colors.alert.success.foreground,\n },\n error: {\n background:\n computedStyle\n .getPropertyValue('--malachite-alert-error-background')\n .trim() || defaultTheme.colors.alert.error.background,\n foreground:\n computedStyle\n .getPropertyValue('--malachite-alert-error-foreground')\n .trim() || defaultTheme.colors.alert.error.foreground,\n },\n warning: {\n background:\n computedStyle\n .getPropertyValue('--malachite-alert-warning-background')\n .trim() || defaultTheme.colors.alert.warning.background,\n foreground:\n computedStyle\n .getPropertyValue('--malachite-alert-warning-foreground')\n .trim() || defaultTheme.colors.alert.warning.foreground,\n },\n assistant: {\n background:\n computedStyle\n .getPropertyValue('--malachite-alert-assistant-background')\n .trim() || defaultTheme.colors.alert.assistant.background,\n foreground:\n computedStyle\n .getPropertyValue('--malachite-alert-assistant-foreground')\n .trim() || defaultTheme.colors.alert.assistant.foreground,\n },\n },\n tooltip: {\n background:\n computedStyle.getPropertyValue('--malachite-tooltip-background').trim() ||\n defaultTheme.colors.tooltip.background,\n foreground:\n computedStyle.getPropertyValue('--malachite-tooltip-foreground').trim() ||\n defaultTheme.colors.tooltip.foreground,\n border:\n computedStyle.getPropertyValue('--malachite-tooltip-border').trim() ||\n defaultTheme.colors.tooltip.border,\n shadow:\n computedStyle.getPropertyValue('--malachite-tooltip-shadow').trim() ||\n defaultTheme.colors.tooltip.shadow,\n },\n primary: {\n background:\n computedStyle.getPropertyValue('--malachite-primary-background').trim() ||\n defaultTheme.colors.primary.background,\n foreground:\n computedStyle.getPropertyValue('--malachite-primary-foreground').trim() ||\n defaultTheme.colors.primary.foreground,\n border:\n computedStyle.getPropertyValue('--malachite-primary-border').trim() ||\n defaultTheme.colors.primary.border,\n borderHover:\n computedStyle.getPropertyValue('--malachite-primary-border-hover').trim() ||\n defaultTheme.colors.primary.borderHover,\n },\n accent: {\n background:\n computedStyle.getPropertyValue('--malachite-accent-background').trim() ||\n DEFAULT_ACCENT_COLORS.background,\n foreground:\n computedStyle.getPropertyValue('--malachite-accent-foreground').trim() ||\n DEFAULT_ACCENT_COLORS.foreground,\n border:\n computedStyle.getPropertyValue('--malachite-accent-border').trim() ||\n DEFAULT_ACCENT_COLORS.border,\n backgroundGlass:\n computedStyle.getPropertyValue('--malachite-accent-background-glass').trim() ||\n DEFAULT_ACCENT_COLORS.backgroundGlass,\n },\n control: {\n borderHover:\n computedStyle.getPropertyValue('--malachite-control-border-hover').trim() ||\n defaultTheme.colors.control.borderHover,\n },\n outline: {\n foreground:\n computedStyle.getPropertyValue('--malachite-outline-foreground').trim() ||\n defaultTheme.colors.outline.foreground,\n },\n secondary: {\n background:\n computedStyle.getPropertyValue('--malachite-secondary-background').trim() ||\n defaultTheme.colors.secondary.background,\n foreground:\n computedStyle.getPropertyValue('--malachite-secondary-foreground').trim() ||\n defaultTheme.colors.secondary.foreground,\n border:\n computedStyle.getPropertyValue('--malachite-secondary-border').trim() ||\n defaultTheme.colors.secondary.border,\n borderHover:\n computedStyle.getPropertyValue('--malachite-secondary-border-hover').trim() ||\n defaultTheme.colors.secondary.borderHover,\n },\n destructive: {\n background:\n computedStyle.getPropertyValue('--malachite-destructive-background').trim() ||\n defaultTheme.colors.destructive.background,\n foreground:\n computedStyle.getPropertyValue('--malachite-destructive-foreground').trim() ||\n defaultTheme.colors.destructive.foreground,\n border:\n computedStyle.getPropertyValue('--malachite-destructive-border').trim() ||\n defaultTheme.colors.destructive.border,\n borderHover:\n computedStyle.getPropertyValue('--malachite-destructive-border-hover').trim() ||\n defaultTheme.colors.destructive.borderHover,\n shadow:\n computedStyle.getPropertyValue('--malachite-destructive-shadow').trim() ||\n defaultTheme.colors.destructive.shadow,\n shadowLight:\n computedStyle.getPropertyValue('--malachite-destructive-shadow-light').trim() ||\n defaultTheme.colors.destructive.shadowLight,\n shadowMedium:\n computedStyle\n .getPropertyValue('--malachite-destructive-shadow-medium')\n .trim() || defaultTheme.colors.destructive.shadowMedium,\n },\n success: {\n background:\n computedStyle.getPropertyValue('--malachite-success-background').trim() ||\n defaultTheme.colors.success.background,\n foreground:\n computedStyle.getPropertyValue('--malachite-success-foreground').trim() ||\n defaultTheme.colors.success.foreground,\n border:\n computedStyle.getPropertyValue('--malachite-success-border').trim() ||\n defaultTheme.colors.success.border,\n borderHover:\n computedStyle.getPropertyValue('--malachite-success-border-hover').trim() ||\n defaultTheme.colors.success.borderHover,\n backgroundGlass:\n computedStyle.getPropertyValue('--malachite-success-background-glass').trim() ||\n defaultTheme.colors.success.backgroundGlass,\n shadowLight:\n computedStyle.getPropertyValue('--malachite-success-shadow-light').trim() ||\n defaultTheme.colors.success.shadowLight,\n shadowMedium:\n computedStyle.getPropertyValue('--malachite-success-shadow-medium').trim() ||\n defaultTheme.colors.success.shadowMedium,\n },\n warning: {\n background:\n computedStyle.getPropertyValue('--malachite-warning-background').trim() ||\n defaultTheme.colors.warning.background,\n foreground:\n computedStyle.getPropertyValue('--malachite-warning-foreground').trim() ||\n defaultTheme.colors.warning.foreground,\n border:\n computedStyle.getPropertyValue('--malachite-warning-border').trim() ||\n defaultTheme.colors.warning.border,\n borderHover:\n computedStyle.getPropertyValue('--malachite-warning-border-hover').trim() ||\n defaultTheme.colors.warning.borderHover,\n backgroundGlass:\n computedStyle.getPropertyValue('--malachite-warning-background-glass').trim() ||\n defaultTheme.colors.warning.backgroundGlass,\n shadowLight:\n computedStyle.getPropertyValue('--malachite-warning-shadow-light').trim() ||\n defaultTheme.colors.warning.shadowLight,\n shadowMedium:\n computedStyle.getPropertyValue('--malachite-warning-shadow-medium').trim() ||\n defaultTheme.colors.warning.shadowMedium,\n },\n error: {\n background:\n computedStyle.getPropertyValue('--malachite-error-background').trim() ||\n defaultTheme.colors.error.background,\n foreground:\n computedStyle.getPropertyValue('--malachite-error-foreground').trim() ||\n defaultTheme.colors.error.foreground,\n border:\n computedStyle.getPropertyValue('--malachite-error-border').trim() ||\n defaultTheme.colors.error.border,\n borderHover:\n computedStyle.getPropertyValue('--malachite-error-border-hover').trim() ||\n defaultTheme.colors.error.borderHover,\n backgroundGlass:\n computedStyle.getPropertyValue('--malachite-error-background-glass').trim() ||\n defaultTheme.colors.error.backgroundGlass,\n shadowLight:\n computedStyle.getPropertyValue('--malachite-error-shadow-light').trim() ||\n defaultTheme.colors.error.shadowLight,\n shadowMedium:\n computedStyle.getPropertyValue('--malachite-error-shadow-medium').trim() ||\n defaultTheme.colors.error.shadowMedium,\n },\n buttonList: {\n background:\n computedStyle.getPropertyValue('--malachite-buttonlist-background').trim() ||\n defaultTheme.colors.buttonList.background,\n foreground:\n computedStyle.getPropertyValue('--malachite-buttonlist-foreground').trim() ||\n defaultTheme.colors.buttonList.foreground,\n hoverBackground:\n computedStyle\n .getPropertyValue('--malachite-buttonlist-hover-background')\n .trim() || defaultTheme.colors.buttonList.hoverBackground,\n hoverForeground:\n computedStyle\n .getPropertyValue('--malachite-buttonlist-hover-foreground')\n .trim() || defaultTheme.colors.buttonList.hoverForeground,\n },\n pillButton: {\n background:\n computedStyle.getPropertyValue('--malachite-pillbutton-background').trim() ||\n defaultTheme.colors.pillButton.background,\n foreground:\n computedStyle.getPropertyValue('--malachite-pillbutton-foreground').trim() ||\n defaultTheme.colors.pillButton.foreground,\n hoverBackground:\n computedStyle\n .getPropertyValue('--malachite-pillbutton-hover-background')\n .trim() || defaultTheme.colors.pillButton.hoverBackground,\n hoverForeground:\n computedStyle\n .getPropertyValue('--malachite-pillbutton-hover-foreground')\n .trim() || defaultTheme.colors.pillButton.hoverForeground,\n pressedBackground:\n computedStyle\n .getPropertyValue('--malachite-pillbutton-pressed-background')\n .trim() || defaultTheme.colors.pillButton.pressedBackground,\n pressedForeground:\n computedStyle\n .getPropertyValue('--malachite-pillbutton-pressed-foreground')\n .trim() || defaultTheme.colors.pillButton.pressedForeground,\n pressedOpacity:\n computedStyle\n .getPropertyValue('--malachite-pillbutton-pressed-opacity')\n .trim() || defaultTheme.colors.pillButton.pressedOpacity,\n activeBackground:\n computedStyle\n .getPropertyValue('--malachite-pillbutton-active-background')\n .trim() || defaultTheme.colors.pillButton.activeBackground,\n activeForeground:\n computedStyle\n .getPropertyValue('--malachite-pillbutton-active-foreground')\n .trim() || defaultTheme.colors.pillButton.activeForeground,\n staticBackground:\n computedStyle\n .getPropertyValue('--malachite-pillbutton-static-background')\n .trim() || defaultTheme.colors.pillButton.staticBackground,\n staticForeground:\n computedStyle\n .getPropertyValue('--malachite-pillbutton-static-foreground')\n .trim() || defaultTheme.colors.pillButton.staticForeground,\n invertedBackground:\n computedStyle\n .getPropertyValue('--malachite-pillbutton-inverted-background')\n .trim() || defaultTheme.colors.pillButton.invertedBackground,\n invertedForeground:\n computedStyle\n .getPropertyValue('--malachite-pillbutton-inverted-foreground')\n .trim() || defaultTheme.colors.pillButton.invertedForeground,\n invertedHoverBackground:\n computedStyle\n .getPropertyValue('--malachite-pillbutton-inverted-hover-background')\n .trim() || defaultTheme.colors.pillButton.invertedHoverBackground,\n invertedHoverForeground:\n computedStyle\n .getPropertyValue('--malachite-pillbutton-inverted-hover-foreground')\n .trim() || defaultTheme.colors.pillButton.invertedHoverForeground,\n invertedPressedBackground:\n computedStyle\n .getPropertyValue('--malachite-pillbutton-inverted-pressed-background')\n .trim() || defaultTheme.colors.pillButton.invertedPressedBackground,\n invertedPressedForeground:\n computedStyle\n .getPropertyValue('--malachite-pillbutton-inverted-pressed-foreground')\n .trim() || defaultTheme.colors.pillButton.invertedPressedForeground,\n },\n toggle: {\n track:\n computedStyle.getPropertyValue('--malachite-toggle-track').trim() ||\n defaultTheme.colors.toggle.track,\n trackChecked:\n computedStyle.getPropertyValue('--malachite-toggle-track-checked').trim() ||\n defaultTheme.colors.toggle.trackChecked,\n trackCheckedPending:\n computedStyle\n .getPropertyValue('--malachite-toggle-track-checked-pending')\n .trim() || defaultTheme.colors.toggle.trackCheckedPending,\n knob:\n computedStyle.getPropertyValue('--malachite-toggle-knob').trim() ||\n defaultTheme.colors.toggle.knob,\n },\n segmentedControl: {\n trackBackground:\n computedStyle\n .getPropertyValue('--malachite-segmented-control-track-background')\n .trim() || defaultTheme.colors.segmentedControl.trackBackground,\n itemForeground:\n computedStyle\n .getPropertyValue('--malachite-segmented-control-item-foreground')\n .trim() || defaultTheme.colors.segmentedControl.itemForeground,\n itemHoverForeground:\n computedStyle\n .getPropertyValue('--malachite-segmented-control-item-hover-foreground')\n .trim() || defaultTheme.colors.segmentedControl.itemHoverForeground,\n selectedBackground:\n computedStyle\n .getPropertyValue('--malachite-segmented-control-selected-background')\n .trim() || defaultTheme.colors.segmentedControl.selectedBackground,\n selectedForeground:\n computedStyle\n .getPropertyValue('--malachite-segmented-control-selected-foreground')\n .trim() || defaultTheme.colors.segmentedControl.selectedForeground,\n selectedShadow:\n computedStyle\n .getPropertyValue('--malachite-segmented-control-selected-shadow')\n .trim() || defaultTheme.colors.segmentedControl.selectedShadow,\n },\n selectableCard: {\n background:\n computedStyle\n .getPropertyValue('--malachite-selectable-card-background')\n .trim() || defaultTheme.colors.selectableCard.background,\n border:\n computedStyle.getPropertyValue('--malachite-selectable-card-border').trim() ||\n defaultTheme.colors.selectableCard.border,\n selectedTint:\n computedStyle\n .getPropertyValue('--malachite-selectable-card-selected-tint')\n .trim() || defaultTheme.colors.selectableCard.selectedTint,\n selectedSurfaceEnd:\n computedStyle\n .getPropertyValue('--malachite-selectable-card-selected-surface-end')\n .trim() || defaultTheme.colors.selectableCard.selectedSurfaceEnd,\n selectedBorder:\n computedStyle\n .getPropertyValue('--malachite-selectable-card-selected-border')\n .trim() || defaultTheme.colors.selectableCard.selectedBorder,\n librarySelectedTint:\n computedStyle\n .getPropertyValue('--malachite-selectable-card-library-selected-tint')\n .trim() || defaultTheme.colors.selectableCard.librarySelectedTint,\n librarySelectedBorder:\n computedStyle\n .getPropertyValue('--malachite-selectable-card-library-selected-border')\n .trim() || defaultTheme.colors.selectableCard.librarySelectedBorder,\n editingTint:\n computedStyle\n .getPropertyValue('--malachite-selectable-card-editing-tint')\n .trim() || defaultTheme.colors.selectableCard.editingTint,\n accent:\n computedStyle.getPropertyValue('--malachite-selectable-card-accent').trim() ||\n defaultTheme.colors.selectableCard.accent,\n mutedForeground:\n computedStyle\n .getPropertyValue('--malachite-selectable-card-muted-foreground')\n .trim() || defaultTheme.colors.selectableCard.mutedForeground,\n hoverBackground:\n computedStyle\n .getPropertyValue('--malachite-selectable-card-hover-background')\n .trim() || defaultTheme.colors.selectableCard.hoverBackground,\n hoverRule:\n computedStyle\n .getPropertyValue('--malachite-selectable-card-hover-rule')\n .trim() || defaultTheme.colors.selectableCard.hoverRule,\n pendingForeground:\n computedStyle\n .getPropertyValue('--malachite-selectable-card-pending-foreground')\n .trim() || defaultTheme.colors.selectableCard.pendingForeground,\n },\n cardStrip: {\n background:\n computedStyle.getPropertyValue('--malachite-card-strip-background').trim() ||\n defaultTheme.colors.cardStrip.background,\n divider:\n computedStyle.getPropertyValue('--malachite-card-strip-divider').trim() ||\n defaultTheme.colors.cardStrip.divider,\n fade:\n computedStyle.getPropertyValue('--malachite-card-strip-fade').trim() ||\n defaultTheme.colors.cardStrip.fade,\n arrowBackground:\n computedStyle\n .getPropertyValue('--malachite-card-strip-arrow-background')\n .trim() || defaultTheme.colors.cardStrip.arrowBackground,\n arrowBorder:\n computedStyle.getPropertyValue('--malachite-card-strip-arrow-border').trim() ||\n defaultTheme.colors.cardStrip.arrowBorder,\n addPrimaryBackground:\n computedStyle\n .getPropertyValue('--malachite-card-strip-add-primary-background')\n .trim() || defaultTheme.colors.cardStrip.addPrimaryBackground,\n addPrimaryForeground:\n computedStyle\n .getPropertyValue('--malachite-card-strip-add-primary-foreground')\n .trim() || defaultTheme.colors.cardStrip.addPrimaryForeground,\n },\n selectionBar: {\n background:\n computedStyle.getPropertyValue('--malachite-selection-bar-background').trim() ||\n defaultTheme.colors.selectionBar.background,\n foreground:\n computedStyle.getPropertyValue('--malachite-selection-bar-foreground').trim() ||\n defaultTheme.colors.selectionBar.foreground,\n mutedForeground:\n computedStyle\n .getPropertyValue('--malachite-selection-bar-muted-foreground')\n .trim() || defaultTheme.colors.selectionBar.mutedForeground,\n divider:\n computedStyle.getPropertyValue('--malachite-selection-bar-divider').trim() ||\n defaultTheme.colors.selectionBar.divider,\n border:\n computedStyle.getPropertyValue('--malachite-selection-bar-border').trim() ||\n defaultTheme.colors.selectionBar.border,\n primaryBorder:\n computedStyle\n .getPropertyValue('--malachite-selection-bar-primary-border')\n .trim() || defaultTheme.colors.selectionBar.primaryBorder,\n shadow:\n computedStyle.getPropertyValue('--malachite-selection-bar-shadow').trim() ||\n defaultTheme.colors.selectionBar.shadow,\n noticeBackground:\n computedStyle\n .getPropertyValue('--malachite-selection-bar-notice-background')\n .trim() || defaultTheme.colors.selectionBar.noticeBackground,\n noticeForeground:\n computedStyle\n .getPropertyValue('--malachite-selection-bar-notice-foreground')\n .trim() || defaultTheme.colors.selectionBar.noticeForeground,\n noticeShadow:\n computedStyle\n .getPropertyValue('--malachite-selection-bar-notice-shadow')\n .trim() || defaultTheme.colors.selectionBar.noticeShadow,\n },\n inlineConfirm: {\n background:\n computedStyle\n .getPropertyValue('--malachite-inline-confirm-background')\n .trim() || defaultTheme.colors.inlineConfirm.background,\n foreground:\n computedStyle\n .getPropertyValue('--malachite-inline-confirm-foreground')\n .trim() || defaultTheme.colors.inlineConfirm.foreground,\n divider:\n computedStyle.getPropertyValue('--malachite-inline-confirm-divider').trim() ||\n defaultTheme.colors.inlineConfirm.divider,\n shadow:\n computedStyle.getPropertyValue('--malachite-inline-confirm-shadow').trim() ||\n defaultTheme.colors.inlineConfirm.shadow,\n },\n dropdown: {\n border:\n computedStyle.getPropertyValue('--malachite-dropdown-border').trim() ||\n defaultTheme.colors.dropdown.border,\n borderActive:\n computedStyle.getPropertyValue('--malachite-dropdown-border-active').trim() ||\n defaultTheme.colors.dropdown.borderActive,\n borderFilter:\n computedStyle.getPropertyValue('--malachite-dropdown-border-filter').trim() ||\n defaultTheme.colors.dropdown.borderFilter,\n borderError:\n computedStyle.getPropertyValue('--malachite-dropdown-border-error').trim() ||\n defaultTheme.colors.dropdown.borderError,\n borderPending:\n computedStyle.getPropertyValue('--malachite-dropdown-border-pending').trim() ||\n defaultTheme.colors.dropdown.borderPending,\n shadow:\n computedStyle.getPropertyValue('--malachite-dropdown-shadow').trim() ||\n defaultTheme.colors.dropdown.shadow,\n shadowHover:\n computedStyle.getPropertyValue('--malachite-dropdown-shadow-hover').trim() ||\n defaultTheme.colors.dropdown.shadowHover,\n shadowActive:\n computedStyle.getPropertyValue('--malachite-dropdown-shadow-active').trim() ||\n defaultTheme.colors.dropdown.shadowActive,\n shadowFilter:\n computedStyle.getPropertyValue('--malachite-dropdown-shadow-filter').trim() ||\n defaultTheme.colors.dropdown.shadowFilter,\n shadowError:\n computedStyle.getPropertyValue('--malachite-dropdown-shadow-error').trim() ||\n defaultTheme.colors.dropdown.shadowError,\n shadowPending:\n computedStyle.getPropertyValue('--malachite-dropdown-shadow-pending').trim() ||\n defaultTheme.colors.dropdown.shadowPending,\n disabledBackground:\n computedStyle\n .getPropertyValue('--malachite-dropdown-disabled-background')\n .trim() || defaultTheme.colors.dropdown.disabledBackground,\n },\n tag: {\n primary: {\n background:\n computedStyle\n .getPropertyValue('--malachite-tag-primary-background')\n .trim() || defaultTheme.colors.tag.primary.background,\n foreground:\n computedStyle\n .getPropertyValue('--malachite-tag-primary-foreground')\n .trim() || defaultTheme.colors.tag.primary.foreground,\n border:\n computedStyle.getPropertyValue('--malachite-tag-primary-border').trim() ||\n defaultTheme.colors.tag.primary.border,\n shadow:\n computedStyle.getPropertyValue('--malachite-tag-primary-shadow').trim() ||\n defaultTheme.colors.tag.primary.shadow,\n },\n secondary: {\n background:\n computedStyle\n .getPropertyValue('--malachite-tag-secondary-background')\n .trim() || defaultTheme.colors.tag.secondary.background,\n foreground:\n computedStyle\n .getPropertyValue('--malachite-tag-secondary-foreground')\n .trim() || defaultTheme.colors.tag.secondary.foreground,\n border:\n computedStyle.getPropertyValue('--malachite-tag-secondary-border').trim() ||\n defaultTheme.colors.tag.secondary.border,\n shadow:\n computedStyle.getPropertyValue('--malachite-tag-secondary-shadow').trim() ||\n defaultTheme.colors.tag.secondary.shadow,\n },\n default: {\n background:\n computedStyle\n .getPropertyValue('--malachite-tag-default-background')\n .trim() || defaultTheme.colors.tag.default.background,\n foreground:\n computedStyle\n .getPropertyValue('--malachite-tag-default-foreground')\n .trim() || defaultTheme.colors.tag.default.foreground,\n border:\n computedStyle.getPropertyValue('--malachite-tag-default-border').trim() ||\n defaultTheme.colors.tag.default.border,\n shadow:\n computedStyle.getPropertyValue('--malachite-tag-default-shadow').trim() ||\n defaultTheme.colors.tag.default.shadow,\n },\n error: {\n background:\n computedStyle.getPropertyValue('--malachite-tag-error-background').trim() ||\n defaultTheme.colors.tag.error.background,\n foreground:\n computedStyle.getPropertyValue('--malachite-tag-error-foreground').trim() ||\n defaultTheme.colors.tag.error.foreground,\n border:\n computedStyle.getPropertyValue('--malachite-tag-error-border').trim() ||\n defaultTheme.colors.tag.error.border,\n shadow:\n computedStyle.getPropertyValue('--malachite-tag-error-shadow').trim() ||\n defaultTheme.colors.tag.error.shadow,\n },\n warning: {\n background:\n computedStyle\n .getPropertyValue('--malachite-tag-warning-background')\n .trim() || defaultTheme.colors.tag.warning.background,\n foreground:\n computedStyle\n .getPropertyValue('--malachite-tag-warning-foreground')\n .trim() || defaultTheme.colors.tag.warning.foreground,\n border:\n computedStyle.getPropertyValue('--malachite-tag-warning-border').trim() ||\n defaultTheme.colors.tag.warning.border,\n shadow:\n computedStyle.getPropertyValue('--malachite-tag-warning-shadow').trim() ||\n defaultTheme.colors.tag.warning.shadow,\n },\n success: {\n background:\n computedStyle\n .getPropertyValue('--malachite-tag-success-background')\n .trim() || defaultTheme.colors.tag.success.background,\n foreground:\n computedStyle\n .getPropertyValue('--malachite-tag-success-foreground')\n .trim() || defaultTheme.colors.tag.success.foreground,\n border:\n computedStyle.getPropertyValue('--malachite-tag-success-border').trim() ||\n defaultTheme.colors.tag.success.border,\n shadow:\n computedStyle.getPropertyValue('--malachite-tag-success-shadow').trim() ||\n defaultTheme.colors.tag.success.shadow,\n },\n emphasis: {\n background:\n computedStyle\n .getPropertyValue('--malachite-tag-emphasis-background')\n .trim() || defaultTheme.colors.tag.emphasis.background,\n foreground:\n computedStyle\n .getPropertyValue('--malachite-tag-emphasis-foreground')\n .trim() || defaultTheme.colors.tag.emphasis.foreground,\n border:\n computedStyle.getPropertyValue('--malachite-tag-emphasis-border').trim() ||\n defaultTheme.colors.tag.emphasis.border,\n shadow:\n computedStyle.getPropertyValue('--malachite-tag-emphasis-shadow').trim() ||\n defaultTheme.colors.tag.emphasis.shadow,\n },\n info: {\n background:\n computedStyle.getPropertyValue('--malachite-tag-info-background').trim() ||\n defaultTheme.colors.tag.info.background,\n foreground:\n computedStyle.getPropertyValue('--malachite-tag-info-foreground').trim() ||\n defaultTheme.colors.tag.info.foreground,\n border:\n computedStyle.getPropertyValue('--malachite-tag-info-border').trim() ||\n defaultTheme.colors.tag.info.border,\n shadow:\n computedStyle.getPropertyValue('--malachite-tag-info-shadow').trim() ||\n defaultTheme.colors.tag.info.shadow,\n },\n assistant: {\n background:\n computedStyle\n .getPropertyValue('--malachite-tag-assistant-background')\n .trim() || defaultTheme.colors.tag.assistant.background,\n foreground:\n computedStyle\n .getPropertyValue('--malachite-tag-assistant-foreground')\n .trim() || defaultTheme.colors.tag.assistant.foreground,\n border:\n computedStyle.getPropertyValue('--malachite-tag-assistant-border').trim() ||\n defaultTheme.colors.tag.assistant.border,\n shadow:\n computedStyle.getPropertyValue('--malachite-tag-assistant-shadow').trim() ||\n defaultTheme.colors.tag.assistant.shadow,\n },\n },\n numberTag: {\n background:\n computedStyle.getPropertyValue('--malachite-number-tag-background').trim() ||\n defaultTheme.colors.numberTag.background,\n foreground:\n computedStyle.getPropertyValue('--malachite-number-tag-foreground').trim() ||\n defaultTheme.colors.numberTag.foreground,\n emphasisBackground:\n computedStyle\n .getPropertyValue('--malachite-number-tag-emphasis-background')\n .trim() || defaultTheme.colors.numberTag.emphasisBackground,\n emphasisForeground:\n computedStyle\n .getPropertyValue('--malachite-number-tag-emphasis-foreground')\n .trim() || defaultTheme.colors.numberTag.emphasisForeground,\n },\n text: {\n primary:\n computedStyle.getPropertyValue('--malachite-text-primary').trim() ||\n defaultTheme.colors.text.primary,\n secondary:\n computedStyle.getPropertyValue('--malachite-text-secondary').trim() ||\n defaultTheme.colors.text.secondary,\n dimmed:\n computedStyle.getPropertyValue('--malachite-text-dimmed').trim() ||\n defaultTheme.colors.text.dimmed,\n emphasis:\n computedStyle.getPropertyValue('--malachite-text-emphasis').trim() ||\n defaultTheme.colors.text.emphasis,\n muted:\n computedStyle.getPropertyValue('--malachite-text-muted').trim() ||\n defaultTheme.colors.text.muted,\n placeholder:\n computedStyle.getPropertyValue('--malachite-text-placeholder').trim() ||\n defaultTheme.colors.text.placeholder,\n destructive:\n computedStyle.getPropertyValue('--malachite-text-destructive').trim() ||\n defaultTheme.colors.text.destructive,\n success:\n computedStyle.getPropertyValue('--malachite-text-success').trim() ||\n defaultTheme.colors.text.success,\n highlight:\n computedStyle.getPropertyValue('--malachite-text-highlight').trim() ||\n defaultTheme.colors.text.highlight,\n warning:\n computedStyle.getPropertyValue('--malachite-text-warning').trim() ||\n defaultTheme.colors.text.warning,\n warningMuted:\n computedStyle.getPropertyValue('--malachite-text-warning-muted').trim() ||\n defaultTheme.colors.text.warningMuted,\n error:\n computedStyle.getPropertyValue('--malachite-text-error').trim() ||\n defaultTheme.colors.text.error,\n info:\n computedStyle.getPropertyValue('--malachite-text-info').trim() ||\n defaultTheme.colors.text.info,\n linkForeground:\n computedStyle.getPropertyValue('--malachite-text-link-foreground').trim() ||\n defaultTheme.colors.text.linkForeground,\n linkForegroundHover:\n computedStyle\n .getPropertyValue('--malachite-text-link-foreground-hover')\n .trim() || defaultTheme.colors.text.linkForegroundHover,\n rightSideText: {\n muted:\n computedStyle\n .getPropertyValue('--malachite-text-right-side-text-muted')\n .trim() || defaultTheme.colors.text.rightSideText.muted,\n primary:\n computedStyle\n .getPropertyValue('--malachite-text-right-side-text-primary')\n .trim() || defaultTheme.colors.text.rightSideText.primary,\n alignment:\n (computedStyle\n .getPropertyValue('--malachite-text-right-side-text-alignment')\n .trim() as 'left' | 'right') ||\n defaultTheme.colors.text.rightSideText.alignment,\n fontSize:\n computedStyle\n .getPropertyValue('--malachite-text-right-side-text-font-size')\n .trim() || defaultTheme.colors.text.rightSideText.fontSize,\n minWidth:\n computedStyle\n .getPropertyValue('--malachite-text-right-side-text-min-width')\n .trim() || defaultTheme.colors.text.rightSideText.minWidth,\n },\n },\n codeBlock: {\n background:\n computedStyle.getPropertyValue('--malachite-codeblock-background').trim() ||\n defaultTheme.colors.codeBlock.background,\n foreground:\n computedStyle.getPropertyValue('--malachite-codeblock-foreground').trim() ||\n defaultTheme.colors.codeBlock.foreground,\n border:\n computedStyle.getPropertyValue('--malachite-codeblock-border').trim() ||\n defaultTheme.colors.codeBlock.border,\n lineNumber:\n computedStyle.getPropertyValue('--malachite-codeblock-line-number').trim() ||\n defaultTheme.colors.codeBlock.lineNumber,\n keyword:\n computedStyle.getPropertyValue('--malachite-codeblock-keyword').trim() ||\n defaultTheme.colors.codeBlock.keyword,\n comment:\n computedStyle.getPropertyValue('--malachite-codeblock-comment').trim() ||\n defaultTheme.colors.codeBlock.comment,\n string:\n computedStyle.getPropertyValue('--malachite-codeblock-string').trim() ||\n defaultTheme.colors.codeBlock.string,\n number:\n computedStyle.getPropertyValue('--malachite-codeblock-number').trim() ||\n defaultTheme.colors.codeBlock.number,\n type:\n computedStyle.getPropertyValue('--malachite-codeblock-type').trim() ||\n defaultTheme.colors.codeBlock.type,\n diffAddedBackground:\n computedStyle\n .getPropertyValue('--malachite-codeblock-diff-added-background')\n .trim() || defaultTheme.colors.codeBlock.diffAddedBackground,\n diffRemovedBackground:\n computedStyle\n .getPropertyValue('--malachite-codeblock-diff-removed-background')\n .trim() || defaultTheme.colors.codeBlock.diffRemovedBackground,\n diffAssistantBackground:\n computedStyle\n .getPropertyValue('--malachite-codeblock-diff-assistant-background')\n .trim() || defaultTheme.colors.codeBlock.diffAssistantBackground,\n diffAssistantForeground:\n computedStyle\n .getPropertyValue('--malachite-codeblock-diff-assistant-foreground')\n .trim() || defaultTheme.colors.codeBlock.diffAssistantForeground,\n diffAssistantRemovedBackground:\n computedStyle\n .getPropertyValue('--malachite-codeblock-diff-assistant-removed-background')\n .trim() || defaultTheme.colors.codeBlock.diffAssistantRemovedBackground,\n diffRemovedForeground:\n computedStyle\n .getPropertyValue('--malachite-codeblock-diff-removed-foreground')\n .trim() || defaultTheme.colors.codeBlock.diffRemovedForeground,\n diffContextForeground:\n computedStyle\n .getPropertyValue('--malachite-codeblock-diff-context-foreground')\n .trim() || defaultTheme.colors.codeBlock.diffContextForeground,\n diffContextText:\n computedStyle\n .getPropertyValue('--malachite-codeblock-diff-context-text')\n .trim() || defaultTheme.colors.codeBlock.diffContextText,\n },\n chat: {\n userBubbleBackground:\n computedStyle\n .getPropertyValue('--malachite-chat-user-bubble-background')\n .trim() || defaultTheme.colors.chat.userBubbleBackground,\n userBubbleBorder:\n computedStyle.getPropertyValue('--malachite-chat-user-bubble-border').trim() ||\n defaultTheme.colors.chat.userBubbleBorder,\n assistantBubbleBackground:\n computedStyle\n .getPropertyValue('--malachite-chat-assistant-bubble-background')\n .trim() || defaultTheme.colors.chat.assistantBubbleBackground,\n assistantBubbleBorder:\n computedStyle\n .getPropertyValue('--malachite-chat-assistant-bubble-border')\n .trim() || defaultTheme.colors.chat.assistantBubbleBorder,\n assistantBubbleForeground:\n computedStyle\n .getPropertyValue('--malachite-chat-assistant-bubble-foreground')\n .trim() || defaultTheme.colors.chat.assistantBubbleForeground,\n },\n assistant: {\n foreground:\n computedStyle.getPropertyValue('--malachite-assistant-foreground').trim() ||\n defaultTheme.colors.assistant.foreground,\n surfaceBackground:\n computedStyle\n .getPropertyValue('--malachite-assistant-surface-background')\n .trim() || defaultTheme.colors.assistant.surfaceBackground,\n surfaceBorder:\n computedStyle.getPropertyValue('--malachite-assistant-surface-border').trim() ||\n defaultTheme.colors.assistant.surfaceBorder,\n surfaceForeground:\n computedStyle\n .getPropertyValue('--malachite-assistant-surface-foreground')\n .trim() || defaultTheme.colors.assistant.surfaceForeground,\n },\n table: {\n background:\n computedStyle.getPropertyValue('--malachite-table-background').trim() ||\n defaultTheme.colors.table.background,\n boxShadow:\n computedStyle.getPropertyValue('--malachite-table-box-shadow').trim() ||\n defaultTheme.colors.table.boxShadow,\n header: {\n background:\n computedStyle\n .getPropertyValue('--malachite-table-header-background')\n .trim() || defaultTheme.colors.table.header.background,\n foreground:\n computedStyle\n .getPropertyValue('--malachite-table-header-foreground')\n .trim() || defaultTheme.colors.table.header.foreground,\n border:\n computedStyle.getPropertyValue('--malachite-table-header-border').trim() ||\n defaultTheme.colors.table.header.border,\n },\n row: {\n background:\n computedStyle.getPropertyValue('--malachite-table-row-background').trim() ||\n defaultTheme.colors.table.row.background,\n foreground:\n computedStyle.getPropertyValue('--malachite-table-row-foreground').trim() ||\n defaultTheme.colors.table.row.foreground,\n hoverBackground:\n computedStyle\n .getPropertyValue('--malachite-table-row-hover-background')\n .trim() || defaultTheme.colors.table.row.hoverBackground,\n border:\n computedStyle.getPropertyValue('--malachite-table-row-border').trim() ||\n defaultTheme.colors.table.row.border,\n selectedBackground:\n computedStyle\n .getPropertyValue('--malachite-table-row-selected-background')\n .trim() || defaultTheme.colors.table.row.selectedBackground,\n selectedAccent:\n computedStyle\n .getPropertyValue('--malachite-table-row-selected-accent')\n .trim() || defaultTheme.colors.table.row.selectedAccent,\n selectedForeground:\n computedStyle\n .getPropertyValue('--malachite-table-row-selected-foreground')\n .trim() || defaultTheme.colors.table.row.selectedForeground,\n },\n border:\n computedStyle.getPropertyValue('--malachite-table-border').trim() ||\n defaultTheme.colors.table.border,\n borderedRow: {\n background:\n computedStyle\n .getPropertyValue('--malachite-table-borderedRow-background')\n .trim() || defaultTheme.colors.table.borderedRow.background,\n outline:\n computedStyle\n .getPropertyValue('--malachite-table-borderedRow-outline')\n .trim() || defaultTheme.colors.table.borderedRow.outline,\n },\n rowVariant: {\n success: {\n background:\n computedStyle\n .getPropertyValue(\n '--malachite-table-row-variant-success-background',\n )\n .trim() || defaultTheme.colors.table.rowVariant.success.background,\n },\n warning: {\n background:\n computedStyle\n .getPropertyValue(\n '--malachite-table-row-variant-warning-background',\n )\n .trim() || defaultTheme.colors.table.rowVariant.warning.background,\n },\n error: {\n background:\n computedStyle\n .getPropertyValue('--malachite-table-row-variant-error-background')\n .trim() || defaultTheme.colors.table.rowVariant.error.background,\n },\n info: {\n background:\n computedStyle\n .getPropertyValue('--malachite-table-row-variant-info-background')\n .trim() || defaultTheme.colors.table.rowVariant.info.background,\n },\n },\n error: {\n iconBackground:\n computedStyle\n .getPropertyValue('--malachite-table-error-icon-background')\n .trim() || defaultTheme.colors.table.error.iconBackground,\n iconForeground:\n computedStyle\n .getPropertyValue('--malachite-table-error-icon-foreground')\n .trim() || defaultTheme.colors.table.error.iconForeground,\n titleForeground:\n computedStyle\n .getPropertyValue('--malachite-table-error-title-foreground')\n .trim() || defaultTheme.colors.table.error.titleForeground,\n subtitleForeground:\n computedStyle\n .getPropertyValue('--malachite-table-error-subtitle-foreground')\n .trim() || defaultTheme.colors.table.error.subtitleForeground,\n },\n },\n },\n };\n}\n\nlet themeInitialized = false;\n\n/**\n * Applies the document-level theme once per page. Called from ShadowRootWrapper rather than\n * run at import: a bare top-level call is an import-time side effect, and `sideEffects: false`\n * in package.json tells a consumer's bundler it may drop a module nothing imports from, which\n * would take the theme with it. A consumer wanting the document themed without mounting any\n * Malachite component calls `initializeTheme()` directly.\n */\nexport const ensureThemeInitialized = (): void => {\n if (themeInitialized) {\n return;\n }\n themeInitialized = true;\n initializeTheme();\n};\n"],"names":["DEFAULT_ACCENT_COLORS","DEFAULT_ACCENT_SHADOW","CONTROL_HEIGHT","defaultTheme","darkTheme","THEME_MODE_KEY","CUSTOM_THEME_KEY","SAFE_CUSTOM_PROPERTY","UNSAFE_CSS_SYNTAX","SAFE_THEME_KEY","sanitizeThemeInput","value","path","sanitized","key","child","childPath","sanitizedChild","registeredShadowRoots","registerShadowRoot","shadowRoot","applyCurrentThemeToShadowRoot","error","unregisterShadowRoot","TABLE_KEBAB_KEYS","processTableColorProperties","tableColors","prefix","addProperty","parentKeyVar","subKey","subValue","kebabKey","deepKey","deepValue","deepKebabKey","applyCSSCustomProperties","theme","target","accentColors","shadows","styleElement","properties","alertType","alertColors","tagType","tagColors","nestedKey","nestedValue","nestedKebabKey","variant","variantColors","safeProperties","declaration","candidate","name","currentMode","getCurrentThemeMode","customTheme","getCustomTheme","baseTheme","finalTheme","mergeThemes","stored","saveThemeMode","mode","saveCustomTheme","base","customInput","custom","result","rightSideText","flat","header","row","borderedRow","rowVariant","merged","applyTheme","applyThemeVars","applyLightTheme","applyDarkTheme","toggleTheme","applyCustomTheme","resetTheme","initializeTheme","getCurrentTheme","computedStyle","themeInitialized","ensureThemeInitialized"],"mappings":"AAqgBA,MAAMA,IAAyE;AAAA,EAC3E,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,iBAAiB;AACrB,GACMC,IAAwB,2CAIjBC,IAAiB;AAAA,EAC1B,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,OAAO;AACX,GAGaC,IAA+B;AAAA,EACxC,WAAW;AAAA,IACP,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,QA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QAAQ;AAAA,UAAA;AAAA,UAEpE,OAAO;AAAA,YACH,YACIoF,EACK,iBAAiB,gDAAgD,EACjE,UAAUpF,EAAa,OAAO,MAAM,WAAW,MAAM;AAAA,UAAA;AAAA,UAElE,MAAM;AAAA,YACF,YACIoF,EACK,iBAAiB,+CAA+C,EAChE,UAAUpF,EAAa,OAAO,MAAM,WAAW,KAAK;AAAA,UAAA;AAAA,QACjE;AAAA,QAEJ,OAAO;AAAA,UACH,gBACIoF,EACK,iBAAiB,yCAAyC,EAC1D,UAAUpF,EAAa,OAAO,MAAM,MAAM;AAAA,UACnD,gBACIoF,EACK,iBAAiB,yCAAyC,EAC1D,UAAUpF,EAAa,OAAO,MAAM,MAAM;AAAA,UACnD,iBACIoF,EACK,iBAAiB,0CAA0C,EAC3D,UAAUpF,EAAa,OAAO,MAAM,MAAM;AAAA,UACnD,oBACIoF,EACK,iBAAiB,6CAA6C,EAC9D,UAAUpF,EAAa,OAAO,MAAM,MAAM;AAAA,QAAA;AAAA,MACvD;AAAA,IACJ;AAAA,EACJ;AAER;AAEA,IAAIqF,IAAmB;AAShB,MAAMC,IAAyB,MAAY;AAC9C,EAAID,MAGJA,IAAmB,IACnBH,EAAA;AACJ;"}
1
+ {"version":3,"file":"theme.js","sources":["../src/theme.ts"],"sourcesContent":["// Theme configuration for Malachite components\nexport type ThemeMode = 'light' | 'dark';\n\nconst DATE_PICKER_TOKENS = [\n 'hoverBackground',\n 'subtleHoverBackground',\n 'outsideForeground',\n 'selectedBackground',\n 'selectedHoverBorder',\n 'todayBorder',\n 'todayHoverBorder',\n 'rangeBackground',\n 'pressedOpacity',\n] as const;\n\ntype DatePickerToken = (typeof DATE_PICKER_TOKENS)[number];\n\nconst datePickerVar = (key: string): string =>\n `--malachite-date-picker-${key.replace(/([A-Z])/g, '-$1').toLowerCase()}`;\n\nexport interface MalachiteTheme {\n fontSizes: {\n xsmall: string;\n small: string;\n medium: string;\n /** Off-ladder: the control ladder's large tier is 15px, between `medium` and `large`. */\n '15'?: string;\n large: string;\n xlarge: string;\n xxlarge: string;\n };\n /**\n * Heights of the shared control ladder. Optional so adding the family never breaks a\n * consumer building a full theme literal — same reason `radius.xs` is optional.\n */\n controlHeights?: {\n small: string;\n medium: string;\n large: string;\n };\n iconSizes: {\n xsmall: string;\n small: string;\n medium: string;\n large: string;\n };\n radius: {\n /** Optional so adding a rung never breaks a consumer building a full theme literal. */\n xs?: string;\n sm: string;\n md: string;\n lg: string;\n /** Off-ladder: no rung exists between `lg` (8px) and `xl` (12px). */\n '10'?: string;\n xl: string;\n xxl: string;\n xxxl: string;\n };\n shadows: {\n sm: string;\n md: string;\n lg: string;\n xl: string;\n default: string;\n glow?: string;\n glowLg?: string;\n /** Optional so adding a shadow never breaks a consumer building a full theme literal. */\n accent?: string;\n success: string;\n warning: string;\n error: string;\n };\n colors: {\n shadowColor: string;\n shadowOpacity: number;\n card: {\n background: string;\n foreground: string;\n border: string;\n shadow: string;\n dimmedBackground: string;\n sunkenBackground: string;\n warmBackground: string;\n headerBackground: string;\n footerBackground: string;\n /** @deprecated No longer read by any component — glass surfaces derive from `sunkenBackground` (see `glassSurface.ts`). */\n footerGlassBackground: string;\n trayNeutral?: string;\n trayWarning?: string;\n trayError?: string;\n traySuccess?: string;\n subtleDivider?: string;\n };\n overlay: {\n /** Dimming layer drawn behind modal overlays (e.g. SidePanel). */\n scrim: string;\n };\n alert: {\n info: {\n background: string;\n foreground: string;\n };\n success: {\n background: string;\n foreground: string;\n };\n error: {\n background: string;\n foreground: string;\n };\n warning: {\n background: string;\n foreground: string;\n };\n /** Says a machine wrote this, not that anything is wrong — the violet the\n * assistant is named in elsewhere, not a fifth severity. */\n assistant: {\n background: string;\n foreground: string;\n };\n };\n tooltip: {\n background: string;\n foreground: string;\n border: string;\n shadow: string;\n };\n primary: {\n background: string;\n foreground: string;\n border: string;\n borderHover: string;\n };\n /** Brand accent for interaction states — checked, selected, active. Green today,\n * but a rebrand repaints it; `success.*` stays status-only and does not follow.\n * Optional so adding a group never breaks a consumer building a full theme literal. */\n accent?: {\n background: string;\n foreground: string;\n border: string;\n backgroundGlass: string;\n };\n /** Overrides for DatePicker / DateRangePicker's derived states. Override-only: nothing\n * is emitted until a consumer sets a key, so each state otherwise derives from `text`\n * and `accent` wherever those resolve, subtree overrides included. */\n datePicker?: Partial<Record<DatePickerToken, string>>;\n control: {\n borderHover: string;\n };\n outline: {\n foreground: string;\n };\n secondary: {\n background: string;\n foreground: string;\n border: string;\n borderHover: string;\n };\n destructive: {\n background: string;\n foreground: string;\n border: string;\n borderHover: string;\n shadow: string;\n shadowLight: string;\n shadowMedium: string;\n };\n success: {\n background: string;\n foreground: string;\n border: string;\n borderHover: string;\n backgroundGlass: string;\n shadowLight: string;\n shadowMedium: string;\n };\n warning: {\n background: string;\n foreground: string;\n border: string;\n borderHover: string;\n backgroundGlass: string;\n shadowLight: string;\n shadowMedium: string;\n };\n error: {\n background: string;\n foreground: string;\n border: string;\n borderHover: string;\n backgroundGlass: string;\n shadowLight: string;\n shadowMedium: string;\n };\n buttonList: {\n background: string;\n foreground: string;\n hoverBackground: string;\n hoverForeground: string;\n };\n pillButton: {\n background: string;\n foreground: string;\n hoverBackground: string;\n hoverForeground: string;\n pressedBackground: string;\n pressedForeground: string;\n pressedOpacity: string;\n activeBackground: string;\n activeForeground: string;\n staticBackground: string;\n staticForeground: string;\n invertedBackground: string;\n invertedForeground: string;\n invertedHoverBackground: string;\n invertedHoverForeground: string;\n invertedPressedBackground: string;\n invertedPressedForeground: string;\n };\n toggle: {\n track: string;\n trackChecked: string;\n /** The checked track while the change it represents has not been saved yet. */\n trackCheckedPending: string;\n knob: string;\n };\n segmentedControl: {\n trackBackground: string;\n itemForeground: string;\n itemHoverForeground: string;\n selectedBackground: string;\n selectedForeground: string;\n selectedShadow: string;\n };\n selectableCard: {\n background: string;\n border: string;\n selectedTint: string;\n selectedSurfaceEnd: string;\n selectedBorder: string;\n librarySelectedTint: string;\n librarySelectedBorder: string;\n editingTint: string;\n accent: string;\n mutedForeground: string;\n hoverBackground: string;\n hoverRule: string;\n pendingForeground: string;\n };\n cardStrip: {\n background: string;\n divider: string;\n fade: string;\n arrowBackground: string;\n arrowBorder: string;\n addPrimaryBackground: string;\n addPrimaryForeground: string;\n };\n selectionBar: {\n background: string;\n foreground: string;\n mutedForeground: string;\n divider: string;\n border: string;\n primaryBorder: string;\n shadow: string;\n noticeBackground: string;\n noticeForeground: string;\n noticeShadow: string;\n };\n inlineConfirm: {\n background: string;\n foreground: string;\n divider: string;\n shadow: string;\n };\n dropdown: {\n border: string;\n borderActive: string;\n borderFilter: string;\n borderError: string;\n borderPending: string;\n shadow: string;\n shadowHover: string;\n shadowActive: string;\n shadowFilter: string;\n shadowError: string;\n shadowPending: string;\n disabledBackground: string;\n };\n tag: {\n primary: {\n background: string;\n foreground: string;\n border: string;\n shadow: string;\n };\n secondary: {\n background: string;\n foreground: string;\n border: string;\n shadow: string;\n };\n default: {\n background: string;\n foreground: string;\n border: string;\n shadow: string;\n };\n error: {\n background: string;\n foreground: string;\n border: string;\n shadow: string;\n };\n warning: {\n background: string;\n foreground: string;\n border: string;\n shadow: string;\n };\n success: {\n background: string;\n foreground: string;\n border: string;\n shadow: string;\n };\n emphasis: {\n background: string;\n foreground: string;\n border: string;\n shadow: string;\n };\n info: {\n background: string;\n foreground: string;\n border: string;\n shadow: string;\n };\n assistant: {\n background: string;\n foreground: string;\n border: string;\n shadow: string;\n };\n };\n numberTag: {\n background: string;\n foreground: string;\n emphasisBackground: string;\n emphasisForeground: string;\n };\n table: {\n background: string;\n boxShadow: string;\n header: {\n background: string;\n foreground: string;\n border: string;\n };\n row: {\n background: string;\n foreground: string;\n hoverBackground: string;\n border: string;\n /** `Table`'s `selectedRowKey` tint. Must stay distinguishable from\n * `hoverBackground`: a selected row keeps this tint under the cursor. */\n selectedBackground: string;\n /** Leading accent bar on that same row. */\n selectedAccent: string;\n /** Cascades, so cells setting their own colour are deliberately unaffected. */\n selectedForeground: string;\n };\n border: string;\n borderedRow: {\n background: string;\n outline: string;\n };\n rowVariant: {\n success: {\n background: string;\n };\n warning: {\n background: string;\n };\n error: {\n background: string;\n };\n info: {\n background: string;\n };\n };\n error: {\n iconBackground: string;\n iconForeground: string;\n titleForeground: string;\n subtitleForeground: string;\n };\n };\n text: {\n primary: string;\n secondary: string;\n dimmed: string;\n emphasis: string;\n muted: string;\n placeholder: string; // Figma #bbbbbb for input placeholders\n destructive: string;\n success: string;\n highlight: string;\n warning: string;\n warningMuted: string;\n error: string;\n info: string;\n linkForeground: string;\n linkForegroundHover: string;\n rightSideText: {\n muted: string; // #7B7B7B for less prominent right side text\n primary: string; // #0A0A0A for more prominent right side text\n alignment: 'left' | 'right'; // Alignment of right side text\n fontSize: string; // Font size of right side text\n minWidth: string; // Width the column reserves, so short values stay aligned\n };\n };\n codeBlock: {\n background: string;\n foreground: string;\n border: string;\n lineNumber: string;\n keyword: string; // for keywords like 'unified', 'string', etc.\n comment: string; // for comments\n string: string; // for string literals\n number: string; // for numbers\n type: string; // for type annotations\n diffAddedBackground: string; // tint for a line a diff added\n diffRemovedBackground: string; // tint for a line a diff removed\n diffAssistantBackground: string; // tint for an added line in the assistant diff palette\n diffAssistantForeground: string; // marker colour for an added line in the assistant diff palette\n diffAssistantRemovedBackground: string; // tint for a removed line in the assistant diff palette\n diffRemovedForeground: string; // marker colour for a removed line in the assistant diff palette\n diffContextForeground: string; // marker colour for an unchanged line in the assistant diff palette\n diffContextText: string; // text colour for an unchanged line in the assistant diff palette\n };\n /** The conversation's own surfaces — message bubbles, not chrome around them. */\n chat: {\n userBubbleBackground: string;\n userBubbleBorder: string;\n assistantBubbleBackground: string;\n assistantBubbleBorder: string;\n assistantBubbleForeground: string;\n };\n /** Chrome marking machine-authored content outside the conversation itself\n * (badges, diff callouts) — distinct from `chat`, which is the conversation's\n * own bubbles. */\n assistant: {\n foreground: string;\n surfaceBackground: string;\n surfaceBorder: string;\n /** Body text sitting on `surfaceBackground` — darker/muted so a run of it reads,\n * unlike `foreground`, which is the vivid accent. */\n surfaceForeground: string;\n };\n };\n}\n\n// Define a type for partial theme updates\nexport interface PartialMalachiteTheme {\n fontSizes?: Partial<MalachiteTheme['fontSizes']>;\n iconSizes?: Partial<MalachiteTheme['iconSizes']>;\n radius?: Partial<MalachiteTheme['radius']>;\n controlHeights?: Partial<MalachiteTheme['controlHeights']>;\n shadows?: Partial<MalachiteTheme['shadows']>;\n colors?: {\n shadowColor?: string;\n shadowOpacity?: number;\n card?: Partial<MalachiteTheme['colors']['card']>;\n overlay?: Partial<MalachiteTheme['colors']['overlay']>;\n /** Nested-partial: a sub-object may be overridden leaf by leaf. A flat\n * `Partial<…>` would demand every leaf of any group you touch. */\n alert?: {\n [K in keyof MalachiteTheme['colors']['alert']]?: Partial<\n MalachiteTheme['colors']['alert'][K]\n >;\n };\n tooltip?: Partial<MalachiteTheme['colors']['tooltip']>;\n primary?: Partial<MalachiteTheme['colors']['primary']>;\n accent?: Partial<NonNullable<MalachiteTheme['colors']['accent']>>;\n datePicker?: MalachiteTheme['colors']['datePicker'];\n control?: Partial<MalachiteTheme['colors']['control']>;\n outline?: Partial<MalachiteTheme['colors']['outline']>;\n secondary?: Partial<MalachiteTheme['colors']['secondary']>;\n destructive?: Partial<MalachiteTheme['colors']['destructive']>;\n success?: Partial<MalachiteTheme['colors']['success']>;\n warning?: Partial<MalachiteTheme['colors']['warning']>;\n error?: Partial<MalachiteTheme['colors']['error']>;\n buttonList?: Partial<MalachiteTheme['colors']['buttonList']>;\n pillButton?: Partial<MalachiteTheme['colors']['pillButton']>;\n toggle?: Partial<MalachiteTheme['colors']['toggle']>;\n segmentedControl?: Partial<MalachiteTheme['colors']['segmentedControl']>;\n selectableCard?: Partial<MalachiteTheme['colors']['selectableCard']>;\n cardStrip?: Partial<MalachiteTheme['colors']['cardStrip']>;\n selectionBar?: Partial<MalachiteTheme['colors']['selectionBar']>;\n inlineConfirm?: Partial<MalachiteTheme['colors']['inlineConfirm']>;\n dropdown?: Partial<MalachiteTheme['colors']['dropdown']>;\n tag?: {\n [K in keyof MalachiteTheme['colors']['tag']]?: Partial<\n MalachiteTheme['colors']['tag'][K]\n >;\n };\n numberTag?: Partial<MalachiteTheme['colors']['numberTag']>;\n // Every nested group is listed: a flat Partial<> reaches only the top level, and any\n // group omitted here is shallow-spread by mergeThemes, silently dropping siblings.\n table?: Partial<\n Omit<\n MalachiteTheme['colors']['table'],\n 'header' | 'row' | 'borderedRow' | 'rowVariant' | 'error'\n >\n > & {\n header?: Partial<MalachiteTheme['colors']['table']['header']>;\n row?: Partial<MalachiteTheme['colors']['table']['row']>;\n borderedRow?: Partial<MalachiteTheme['colors']['table']['borderedRow']>;\n // Two levels: each variant is its own object.\n rowVariant?: {\n [K in keyof MalachiteTheme['colors']['table']['rowVariant']]?: Partial<\n MalachiteTheme['colors']['table']['rowVariant'][K]\n >;\n };\n error?: Partial<MalachiteTheme['colors']['table']['error']>;\n };\n text?: Partial<Omit<MalachiteTheme['colors']['text'], 'rightSideText'>> & {\n rightSideText?: Partial<MalachiteTheme['colors']['text']['rightSideText']>;\n };\n codeBlock?: Partial<MalachiteTheme['colors']['codeBlock']>;\n chat?: Partial<MalachiteTheme['colors']['chat']>;\n assistant?: Partial<MalachiteTheme['colors']['assistant']>;\n };\n}\n\n// `accent` is optional on MalachiteTheme, so a hand-built theme may omit it. Every read\n// site falls back to these rather than emitting `undefined` or throwing.\nconst DEFAULT_ACCENT_COLORS: NonNullable<MalachiteTheme['colors']['accent']> = {\n background: 'rgba(0, 175, 102)',\n foreground: 'rgb(2, 122, 66)',\n border: 'rgba(0, 175, 102, 0.2)',\n backgroundGlass: 'rgba(0, 175, 102, 0.08)',\n};\nconst DEFAULT_ACCENT_SHADOW = '0px 1px 0px 0px rgba(0, 175, 102, 0.15)';\n\n/** The shared control ladder, from Figma. Exported so callers can read it without\n * reaching for a possibly-absent theme field. */\nexport const CONTROL_HEIGHT = {\n small: '28px',\n medium: '32px',\n large: '42px',\n} as const;\n\n// Default theme values\nexport const defaultTheme: MalachiteTheme = {\n fontSizes: {\n xsmall: '11px',\n small: '13px',\n medium: '14px',\n '15': '15px',\n large: '16px',\n xlarge: '18px',\n xxlarge: '22px',\n },\n controlHeights: { ...CONTROL_HEIGHT },\n iconSizes: {\n xsmall: '12px',\n small: '13px',\n medium: '13px',\n large: '15px',\n },\n radius: {\n xs: '2px',\n sm: '4px',\n md: '6px',\n lg: '8px',\n '10': '10px',\n xl: '12px',\n xxl: '14px',\n xxxl: '16px',\n },\n shadows: {\n sm: '0 1px 2px 0 rgba(0, 0, 0, 0.05)',\n md: '0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1)',\n lg: '0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1)',\n xl: '0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1)',\n glow: '0px 0px 10px 0px rgba(0, 0, 0, 0.2)',\n glowLg: '0px 0px 20px 0px rgba(0, 0, 0, 0.2)',\n default: '0px 1px 0px 0px rgba(0, 0, 0, 0.15)',\n accent: DEFAULT_ACCENT_SHADOW,\n success: '0px 1px 0px 0px rgba(0, 175, 102, 0.15)',\n warning: '0px 1px 0px 0px rgba(241, 139, 10, 0.15)',\n error: '0px 1px 0px 0px rgba(197, 63, 63, 0.15)',\n },\n colors: {\n shadowColor: '0, 0, 0',\n shadowOpacity: 0.1,\n card: {\n background: 'rgb(255, 255, 255)',\n foreground: 'rgb(10, 10, 10)',\n border: 'rgb(232, 232, 232)',\n shadow: 'rgba(0, 0, 0, 0.1)',\n dimmedBackground: 'rgb(247, 247, 247)',\n sunkenBackground: 'rgb(250, 250, 250)',\n warmBackground: 'rgb(244, 242, 240)',\n headerBackground: 'rgb(255, 255, 255)',\n footerBackground: 'rgb(255, 255, 255)',\n footerGlassBackground: 'rgba(255, 255, 255, 0.7)',\n trayNeutral: 'rgb(247, 247, 247)', // Figma #F7F7F7\n trayWarning: 'rgb(253, 243, 230)', // Figma #FDF3E6\n trayError: 'rgb(254, 241, 241)', // Figma #FEF1F1\n traySuccess: 'rgb(236, 249, 244)', // Figma #ECF9F4\n subtleDivider: 'rgb(241, 241, 241)', // Figma #F1F1F1\n },\n overlay: {\n scrim: 'rgba(0, 0, 0, 0.1)',\n },\n alert: {\n info: {\n background: 'rgb(247, 247, 247)',\n foreground: 'rgb(10, 10, 10)',\n },\n success: {\n background: 'rgba(0, 175, 102, 0.08)',\n foreground: 'rgb(2, 122, 66)',\n },\n error: {\n background: 'rgba(197, 63, 63, 0.08)',\n foreground: 'rgb(237, 53, 54)',\n },\n warning: {\n background: 'rgba(241, 139, 10, 0.08)',\n foreground: 'rgb(150, 88, 10)',\n },\n assistant: {\n background: 'rgb(242, 238, 254)', // #F2EEFE, the assistant tag's ground\n foreground: 'rgb(110, 86, 207)', // #6E56CF\n },\n },\n tooltip: {\n background: 'rgb(59, 59, 59)',\n foreground: 'rgb(255, 255, 255)',\n border: 'rgb(60, 60, 60)',\n shadow: '0px 0px 10px 0px rgba(0, 0, 0, 0.20)',\n },\n primary: {\n background: 'rgb(48, 48, 48)',\n foreground: 'rgb(10, 10, 10)',\n border: 'rgb(232, 232, 232)',\n borderHover: 'rgb(186, 186, 186)',\n },\n accent: DEFAULT_ACCENT_COLORS,\n control: {\n borderHover: 'rgba(0, 175, 102, 0.4)',\n },\n outline: {\n foreground: 'rgb(10, 10, 10)',\n },\n secondary: {\n background: 'rgb(9, 9, 9)',\n foreground: 'rgb(255, 255, 255)',\n border: 'rgb(232, 232, 232)',\n borderHover: 'rgb(186, 186, 186)',\n },\n destructive: {\n background: 'transparent',\n foreground: 'rgb(196, 62, 62)',\n border: 'rgb(239, 55, 55)',\n borderHover: 'rgb(239, 55, 55)',\n shadow: 'rgb(239, 55, 55)',\n shadowLight: 'rgba(239, 55, 55, 0.4)',\n shadowMedium: 'rgba(239, 55, 55, 0.6)',\n },\n success: {\n background: 'rgba(0, 175, 102)',\n foreground: 'rgb(2, 122, 66)',\n border: 'rgba(0, 175, 102, 0.2)',\n borderHover: 'rgba(0, 175, 102, 0.4)',\n backgroundGlass: 'rgba(0, 175, 102, 0.08)',\n shadowLight: 'rgba(0, 175, 102, 0.4)',\n shadowMedium: 'rgba(0, 175, 102, 0.6)',\n },\n warning: {\n background: 'rgb(241, 139, 10)',\n foreground: 'rgb(150, 88, 10)',\n border: 'rgba(241, 139, 10, 0.2)',\n borderHover: 'rgba(241, 139, 10, 0.4)',\n backgroundGlass: 'rgba(241, 139, 10, 0.08)',\n shadowLight: 'rgba(241, 139, 10, 0.4)',\n shadowMedium: 'rgba(241, 139, 10, 0.6)',\n },\n error: {\n background: 'rgb(197, 63, 63)',\n foreground: 'rgb(237, 53, 54)',\n border: 'rgba(197, 63, 63, 0.2)',\n borderHover: 'rgba(197, 63, 63, 0.4)',\n backgroundGlass: 'rgba(197, 63, 63, 0.08)',\n shadowLight: 'rgba(197, 63, 63, 0.4)',\n shadowMedium: 'rgba(197, 63, 63, 0.6)',\n },\n buttonList: {\n background: 'rgb(255, 255, 255)',\n foreground: 'rgb(10, 10, 10)',\n hoverBackground: 'rgb(245, 245, 245)',\n hoverForeground: 'rgb(10, 10, 10)',\n },\n pillButton: {\n background: 'rgb(241, 241, 241)', // Figma #f1f1f1\n foreground: 'rgb(123, 123, 123)', // Figma #7b7b7b\n hoverBackground: 'rgb(232, 232, 232)', // Figma #e8e8e8\n hoverForeground: 'rgb(10, 10, 10)', // Figma neutral-950 (almost black)\n pressedBackground: 'rgb(232, 232, 232)', // Figma #e8e8e8 (same as hover)\n pressedForeground: 'rgb(10, 10, 10)', // Figma neutral-950 (same as hover)\n pressedOpacity: '0.6', // Figma opacity-60\n activeBackground: 'rgb(48, 48, 48)',\n activeForeground: 'rgb(255, 255, 255)',\n staticBackground: 'rgb(224, 222, 220)', // #e0dedc — used by interactive=false pills\n staticForeground: 'rgb(76, 75, 75)', // #4c4b4b\n invertedBackground: 'rgb(255, 255, 255)',\n invertedForeground: 'rgb(76, 75, 75)', // #4c4b4b\n invertedHoverBackground: 'rgb(10, 10, 10)', // neutral-950\n invertedHoverForeground: 'rgb(255, 255, 255)',\n invertedPressedBackground: 'rgb(10, 10, 10)',\n invertedPressedForeground: 'rgb(255, 255, 255)',\n },\n toggle: {\n track: 'rgb(232, 232, 232)', // #e8e8e8 neutral off track\n trackChecked: 'rgb(0, 175, 102)', // #00AF66 brand green\n trackCheckedPending: 'rgb(241, 139, 10)', // #F18B0A, the pending amber\n knob: 'rgb(255, 255, 255)',\n },\n segmentedControl: {\n trackBackground: 'rgb(241, 241, 241)', // Figma #f1f1f1 sunken track\n // Deliberately text.muted, not text.secondary: #7b7b7b on the #f1f1f1 track is\n // only 3.7:1, below WCAG AA for body text. #4c4b4b is 7.7:1.\n itemForeground: 'rgb(76, 75, 75)', // #4c4b4b text.muted\n itemHoverForeground: 'rgb(10, 10, 10)', // neutral-950\n selectedBackground: 'rgb(255, 255, 255)',\n selectedForeground: 'rgb(10, 10, 10)', // neutral-950\n selectedShadow: '0px 1px 5px 0px rgba(0, 0, 0, 0.1)',\n },\n selectableCard: {\n background: 'rgb(241, 241, 241)',\n border: 'rgb(221, 221, 221)',\n selectedTint: 'rgb(231, 248, 241)',\n selectedSurfaceEnd: 'rgb(255, 255, 255)',\n selectedBorder: 'rgb(4, 123, 67)',\n librarySelectedTint: 'rgb(241, 241, 241)',\n librarySelectedBorder: 'rgb(187, 187, 187)',\n editingTint: 'rgb(249, 242, 233)', // Figma #F9F2E9\n accent: 'rgb(4, 123, 67)', // Figma #047B43 primary (dark)\n mutedForeground: 'rgb(123, 123, 123)', // Figma #7B7B7B, the same grey as text-secondary\n hoverBackground: 'rgb(232, 232, 232)',\n hoverRule: 'rgb(187, 187, 187)',\n pendingForeground: 'rgb(150, 88, 10)',\n },\n cardStrip: {\n background: 'rgb(241, 241, 241)', // Figma #F1F1F1\n divider: 'rgb(221, 221, 221)', // Figma #DDDDDD — hairline between adjacent cards\n fade: 'rgb(255, 255, 255)',\n arrowBackground: 'rgb(255, 255, 255)',\n arrowBorder: 'rgb(232, 232, 232)', // Figma #E8E8E8, same hairline as dropdown.border\n addPrimaryBackground: 'rgb(10, 10, 10)',\n addPrimaryForeground: 'rgb(255, 255, 255)',\n },\n selectionBar: {\n background: 'rgb(10, 10, 10)', // Figma #0a0a0a\n foreground: 'rgb(255, 255, 255)',\n mutedForeground: 'rgb(123, 123, 123)',\n divider: 'rgb(64, 64, 64)',\n border: 'transparent', // edgeless in light\n primaryBorder: 'rgb(232, 232, 232)',\n shadow: '0px 0px 10px 0px rgba(0, 0, 0, 0.2)',\n noticeBackground: 'rgb(237, 217, 190)',\n noticeForeground: 'rgb(132, 77, 9)',\n noticeShadow:\n '0px 0px 4px 0px rgba(0, 0, 0, 0.08), 0px 4px 4px 0px rgba(0, 0, 0, 0.08), 0px 4px 10px 0px rgba(0, 0, 0, 0.05)',\n },\n inlineConfirm: {\n background: 'rgb(34, 33, 33)', // Figma #222121\n foreground: 'rgb(255, 255, 255)',\n divider: 'rgba(255, 255, 255, 0.1)',\n shadow: '0px 0px 10px 0px rgba(0, 0, 0, 0.2)',\n },\n dropdown: {\n border: 'rgb(232, 232, 232)',\n borderActive: 'rgba(0, 175, 102, 0.6)',\n borderFilter: 'rgba(0, 175, 102, 0.4)',\n borderError: 'rgba(239, 55, 55, 0.6)',\n borderPending: 'rgba(241, 139, 10, 0.6)',\n shadow: '0px 1px 0px 0px rgba(0, 0, 0, 0.15)',\n shadowHover: '0px 1px 0px 0px rgba(0, 175, 102, 0.6)',\n shadowActive: '0px 1px 0px 0px rgba(0, 175, 102, 0.8)',\n shadowFilter: '0px 1px 0px 0px rgba(0, 175, 102, 0.6)',\n shadowError:\n '0px 1px 0px 0px rgba(239, 55, 55, 0.8), 0px 0px 0px 2px rgba(239, 55, 55, 0.1)',\n shadowPending:\n '0px 1px 0px 0px rgba(241, 139, 10, 0.8), 0px 0px 0px 2px rgba(241, 139, 10, 0.1)',\n disabledBackground: 'rgb(241, 241, 241)', // Figma #f1f1f1\n },\n tag: {\n primary: {\n background: 'rgba(37, 130, 234, 0.1)', // #2582EA1A\n foreground: 'rgb(37, 130, 234)', // #2582EA\n border: 'rgb(37, 130, 234)', // #2582EA\n shadow: 'rgba(37, 130, 234, 0.5)', // #2582EA with 50% opacity\n },\n secondary: {\n background: 'rgba(0, 175, 102, 0.1)', // #00AF661A\n foreground: 'rgb(0, 175, 102)', // #00AF66\n border: 'rgb(0, 175, 102)', // #00AF66\n shadow: 'rgba(0, 175, 102, 0.5)', // #00AF66 with 50% opacity\n },\n default: {\n background: 'rgba(123, 123, 123, 0.1)', // #7B7B7B1A\n foreground: 'rgb(123, 123, 123)', // #7B7B7B\n border: 'rgb(123, 123, 123)', // #7B7B7B\n shadow: 'rgba(123, 123, 123, 0.5)', // #7B7B7B with 50% opacity\n },\n error: {\n background: 'rgba(196, 62, 62, 0.1)', // #C43E3E1A\n foreground: 'rgb(196, 62, 62)', // #C43E3E\n border: 'rgb(196, 62, 62)', // #C43E3E\n shadow: 'rgba(196, 62, 62, 0.5)', // #C43E3E with 50% opacity\n },\n warning: {\n background: 'rgba(150, 88, 10, 0.1)', // #96580A1A\n foreground: 'rgb(150, 88, 10)', // #96580A\n border: 'rgb(150, 88, 10)', // #96580A\n shadow: 'rgba(150, 88, 10, 0.5)', // #96580A with 50% opacity\n },\n success: {\n background: 'rgba(0, 175, 102, 0.1)', // #00AF661A\n foreground: 'rgb(2, 122, 66)', // #027A42\n border: 'rgb(2, 122, 66)', // #027A42\n shadow: 'rgba(2, 122, 66, 0.5)', // #027A42 with 50% opacity\n },\n emphasis: {\n background: 'rgba(123, 123, 123, 0.1)',\n foreground: 'rgb(10, 10, 10)',\n border: 'rgb(10, 10, 10)',\n shadow: 'rgba(0, 0, 0, 0.2)',\n },\n info: {\n background: 'rgba(12, 88, 174, 0.1)', // #0C58AE1A\n foreground: 'rgb(12, 88, 174)', // Blue (Dark) from Figma #0C58AE\n border: 'rgb(12, 88, 174)', // #0C58AE\n shadow: 'rgba(12, 88, 174, 0.5)', // #0C58AE with 50% opacity\n },\n assistant: {\n background: 'rgb(242, 238, 254)', // #F2EEFE\n foreground: 'rgb(110, 86, 207)', // #6E56CF\n border: 'rgb(227, 221, 251)', // #E3DDFB\n shadow: 'rgba(110, 86, 207, 0.5)', // #6E56CF with 50% opacity\n },\n },\n numberTag: {\n background: 'rgba(0, 0, 0, 0.08)',\n foreground: 'rgb(123, 123, 123)', // text secondary\n emphasisBackground: 'rgba(0, 0, 0, 0.15)',\n emphasisForeground: 'rgb(34, 33, 33)', // text emphasis\n },\n table: {\n background: 'rgb(247, 247, 247)', // #F7F7F7\n boxShadow: 'none', // The designed container is a flat grey frame, not elevated\n header: {\n background: 'rgb(247, 247, 247)', // #F7F7F7\n foreground: 'rgb(55, 65, 81)', // #374151\n border: 'rgb(229, 231, 235)', // #e5e7eb\n },\n row: {\n background: 'rgb(255, 255, 255)', // #ffffff\n foreground: 'rgb(75, 85, 99)', // #4b5563\n hoverBackground: 'rgb(249, 250, 251)', // #f9fafb\n border: 'rgb(229, 231, 235)', // #e5e7eb\n // Translucent, so it layers over the row (or a rowVariant tint). 15% not 10%:\n // at 10% the step was 1.11:1 from a plain row, near-invisible without colour\n // vision. Capped there to keep the foreground's AA headroom (4.64:1).\n selectedBackground: 'rgba(0, 175, 102, 0.15)', // #00AF66 at 15%\n selectedAccent: 'rgb(2, 122, 66)', // #027A42, matches text.success\n selectedForeground: 'rgb(2, 122, 66)', // #027A42\n },\n border: 'rgb(229, 231, 235)', // #e5e7eb\n borderedRow: {\n background: 'rgb(255, 255, 255)', // #FFF\n outline: 'rgb(232, 232, 232)', // #e8e8e8\n },\n rowVariant: {\n success: {\n background: 'rgb(236, 249, 244)', // #ECF9F4\n },\n warning: {\n background: 'rgb(253, 243, 230)', // #FDF3E6\n },\n error: {\n background: 'rgb(253, 236, 236)', // #FDECEC\n },\n info: {\n background: 'rgb(230, 244, 253)', // #E6F4FD\n },\n },\n error: {\n iconBackground: 'rgb(254, 243, 199)', // #fef3c7\n iconForeground: 'rgb(217, 119, 6)', // #d97706\n titleForeground: 'rgb(17, 24, 39)', // #111827\n subtitleForeground: 'rgb(107, 114, 128)', // #6b7280\n },\n },\n text: {\n primary: 'rgb(10, 10, 10)',\n secondary: 'rgb(123, 123, 123)',\n dimmed: 'rgb(161, 161, 161)',\n emphasis: 'rgb(34, 33, 33)',\n muted: 'rgb(76, 75, 75)',\n placeholder: 'rgb(187, 187, 187)', // Figma #bbbbbb for input placeholders\n destructive: 'rgb(237, 53, 54)',\n success: 'rgb(2, 122, 66)',\n highlight: 'rgb(118, 214, 174)',\n warning: 'rgb(150, 88, 10)',\n warningMuted: 'rgb(206, 163, 108)', // Figma #CEA36C\n error: 'rgb(237, 53, 54)',\n info: 'rgb(12, 88, 174)', // Blue (Dark) from Figma #0C58AE\n linkForeground: 'rgba(0, 0, 0, 0.45)',\n linkForegroundHover: 'rgb(10, 10, 10)',\n rightSideText: {\n muted: 'rgb(123, 123, 123)', // #7B7B7B for less prominent right side text\n primary: 'rgb(10, 10, 10)', // #0A0A0A for more prominent right side text\n alignment: 'right' as const, // Default to right alignment\n fontSize: '12px',\n minWidth: '80px',\n },\n },\n codeBlock: {\n background: 'rgb(255, 255, 255)', // White background from Figma\n foreground: 'rgb(10, 10, 10)', // Header color from Figma #0A0A0A\n border: 'rgb(232, 232, 232)', // Light border\n lineNumber: 'rgb(123, 123, 123)', // Text color from Figma #7B7B7B\n keyword: 'rgb(12, 88, 174)', // Blue (Dark) from Figma #0C58AE\n comment: 'rgb(123, 123, 123)', // Text color for comments\n string: 'rgb(2, 122, 66)', // Green for strings\n number: 'rgb(150, 88, 10)', // Orange for numbers\n type: 'rgb(12, 88, 174)', // Blue for types\n // Low alpha, so highlighted code stays readable through the tint.\n diffAddedBackground: 'rgba(0, 175, 102, 0.12)',\n diffRemovedBackground: 'rgba(239, 55, 55, 0.1)',\n // The assistant diff palette, from the design mock for AI-authored changes.\n diffAssistantBackground: '#F5F1FE',\n diffAssistantForeground: '#6E56CF',\n diffAssistantRemovedBackground: '#F7F6FB',\n diffRemovedForeground: '#5E5876',\n diffContextForeground: '#D9D9D9',\n diffContextText: '#3B3B3B',\n },\n chat: {\n userBubbleBackground: 'rgb(246, 246, 246)', // #F6F6F6\n userBubbleBorder: 'rgb(237, 237, 237)', // #EDEDED\n // Deliberately neutral, not violet. The violet marks a pending change in the form\n // beside this column; spending the same hue on \"the assistant said it\" leaves the\n // reader two meanings for one colour. The bubble differs from the user's by being\n // a white card against their filled grey, and the assistant is named in violet\n // above the thread instead.\n assistantBubbleBackground: 'rgb(255, 255, 255)',\n assistantBubbleBorder: 'rgb(232, 232, 232)', // The neutral hairline, as codeBlock.border\n assistantBubbleForeground: 'rgb(10, 10, 10)', // text.primary — this is body copy, read at length\n },\n assistant: {\n foreground: 'rgb(110, 86, 207)', // #6E56CF, matches tag.assistant.foreground\n surfaceBackground: 'rgb(251, 250, 255)', // #FBFAFF, a faint tint for a card or callout\n surfaceBorder: 'rgb(220, 211, 250)', // #DCD3FA, drawn dashed by the consumer\n surfaceForeground: 'rgb(74, 63, 122)', // #4A3F7A, from the Chat.Suggestion mock\n },\n },\n};\n\n// Dark theme colors\nexport const darkTheme: MalachiteTheme = {\n fontSizes: {\n xsmall: '11px',\n small: '13px',\n medium: '14px',\n '15': '15px',\n large: '16px',\n xlarge: '18px',\n xxlarge: '22px',\n },\n controlHeights: { ...CONTROL_HEIGHT },\n iconSizes: {\n xsmall: '12px',\n small: '13px',\n medium: '13px',\n large: '15px',\n },\n radius: {\n xs: '2px',\n sm: '4px',\n md: '6px',\n lg: '8px',\n '10': '10px',\n xl: '12px',\n xxl: '14px',\n xxxl: '16px',\n },\n shadows: {\n sm: '0 1px 2px 0 rgba(0, 0, 0, 0.3)',\n md: '0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.3)',\n lg: '0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -4px rgba(0, 0, 0, 0.3)',\n xl: '0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3)',\n glow: '0px 0px 10px 0px rgba(0, 0, 0, 0.5)',\n glowLg: '0px 0px 20px 0px rgba(0, 0, 0, 0.5)',\n default: '0px 1px 0px 0px rgba(0, 0, 0, 0.4)',\n accent: '0px 1px 0px 0px rgba(0, 175, 102, 0.4)',\n success: '0px 1px 0px 0px rgba(0, 175, 102, 0.4)',\n warning: '0px 1px 0px 0px rgba(241, 139, 10, 0.4)',\n error: '0px 1px 0px 0px rgba(197, 63, 63, 0.4)',\n },\n colors: {\n shadowColor: '0, 0, 0',\n shadowOpacity: 0.3,\n card: {\n background: 'rgb(30, 30, 30)',\n foreground: 'rgb(255, 255, 255)',\n border: 'rgb(64, 64, 64)',\n shadow: 'rgba(0, 0, 0, 0.3)',\n dimmedBackground: 'rgb(70, 70, 70)',\n sunkenBackground: 'rgb(10, 10, 10)',\n warmBackground: 'rgb(45, 43, 41)',\n headerBackground: 'rgb(30, 30, 30)',\n footerBackground: 'rgb(30, 30, 30)',\n footerGlassBackground: 'rgba(30, 30, 30, 0.7)',\n trayNeutral: 'rgb(56, 56, 56)',\n trayWarning: 'rgb(74, 62, 29)',\n trayError: 'rgb(70, 44, 44)',\n traySuccess: 'rgb(31, 63, 40)',\n subtleDivider: 'rgb(48, 48, 48)',\n },\n overlay: {\n scrim: 'rgba(0, 0, 0, 0.4)',\n },\n alert: {\n info: {\n background: 'rgb(70, 70, 70)',\n foreground: 'rgb(255, 255, 255)',\n },\n success: {\n background: 'rgba(0, 175, 102, 0.08)',\n foreground: 'rgb(2, 122, 66)',\n },\n error: {\n background: 'rgba(197, 63, 63, 0.08)',\n foreground: 'rgb(237, 53, 54)',\n },\n warning: {\n background: 'rgba(241, 139, 10, 0.08)',\n foreground: 'rgb(150, 88, 10)',\n },\n assistant: {\n // The dark violet the assistant Tag and diff palette already use; the light\n // pair here would render an opaque near-white block on a dark surface.\n background: 'rgba(158, 130, 255, 0.18)',\n foreground: 'rgb(184, 158, 255)',\n },\n },\n tooltip: {\n background: 'rgb(42, 42, 42)',\n foreground: 'rgb(255, 255, 255)',\n border: 'rgb(80, 80, 80)',\n shadow: '0px 0px 12px 0px rgba(0, 0, 0, 0.30)',\n },\n primary: {\n background: 'rgb(60, 60, 60)',\n foreground: 'rgb(255, 255, 255)',\n border: 'rgb(100, 100, 100)',\n borderHover: 'rgb(140, 140, 140)',\n },\n accent: {\n background: 'rgba(50, 205, 132)',\n foreground: 'rgb(20, 170, 100)',\n border: 'rgba(50, 205, 132, 0.3)',\n backgroundGlass: 'rgba(50, 205, 132, 0.12)',\n },\n control: {\n borderHover: 'rgba(50, 205, 132, 0.5)',\n },\n outline: {\n foreground: 'rgb(255, 255, 255)',\n },\n // Filled buttons invert in dark mode: white surface, near-black text.\n secondary: {\n background: 'rgb(255, 255, 255)',\n foreground: 'rgb(10, 10, 10)',\n border: 'rgb(255, 255, 255)',\n borderHover: 'rgb(220, 220, 220)',\n },\n destructive: {\n background: 'transparent',\n foreground: 'rgb(255, 120, 120)',\n border: 'rgb(255, 100, 100)',\n borderHover: 'rgb(255, 100, 100)',\n shadow: 'rgb(255, 100, 100)',\n shadowLight: 'rgba(255, 100, 100, 0.4)',\n shadowMedium: 'rgba(255, 100, 100, 0.6)',\n },\n success: {\n background: 'rgba(50, 205, 132)',\n foreground: 'rgb(20, 170, 100)',\n border: 'rgba(50, 205, 132, 0.3)',\n borderHover: 'rgba(50, 205, 132, 0.5)',\n backgroundGlass: 'rgba(50, 205, 132, 0.12)',\n shadowLight: 'rgba(50, 205, 132, 0.4)',\n shadowMedium: 'rgba(50, 205, 132, 0.6)',\n },\n warning: {\n background: 'rgb(255, 180, 50)',\n foreground: 'rgb(200, 130, 20)',\n border: 'rgba(255, 180, 50, 0.3)',\n borderHover: 'rgba(255, 180, 50, 0.5)',\n backgroundGlass: 'rgba(255, 180, 50, 0.12)',\n shadowLight: 'rgba(255, 180, 50, 0.4)',\n shadowMedium: 'rgba(255, 180, 50, 0.6)',\n },\n error: {\n background: 'rgb(255, 120, 120)',\n foreground: 'rgb(255, 80, 80)',\n border: 'rgba(255, 120, 120, 0.3)',\n borderHover: 'rgba(255, 120, 120, 0.5)',\n backgroundGlass: 'rgba(255, 120, 120, 0.12)',\n shadowLight: 'rgba(255, 120, 120, 0.4)',\n shadowMedium: 'rgba(255, 120, 120, 0.6)',\n },\n buttonList: {\n background: 'rgb(30, 30, 30)',\n foreground: 'rgb(255, 255, 255)',\n hoverBackground: 'rgb(60, 60, 60)',\n hoverForeground: 'rgb(255, 255, 255)',\n },\n pillButton: {\n background: 'rgb(70, 70, 70)', // Dark theme equivalent\n foreground: 'rgb(161, 161, 161)', // Dark theme equivalent\n hoverBackground: 'rgb(90, 90, 90)', // Lighter for dark theme hover\n hoverForeground: 'rgb(255, 255, 255)', // White text on hover in dark mode\n pressedBackground: 'rgb(90, 90, 90)', // Same as hover for dark theme\n pressedForeground: 'rgb(255, 255, 255)', // Same as hover for dark theme\n pressedOpacity: '0.6', // Same opacity reduction for dark theme\n activeBackground: 'rgb(255, 255, 255)',\n activeForeground: 'rgb(10, 10, 10)',\n staticBackground: 'rgb(60, 60, 60)',\n staticForeground: 'rgb(220, 220, 220)',\n invertedBackground: 'rgb(38, 38, 38)',\n invertedForeground: 'rgb(220, 220, 220)',\n invertedHoverBackground: 'rgb(255, 255, 255)',\n invertedHoverForeground: 'rgb(10, 10, 10)',\n invertedPressedBackground: 'rgb(255, 255, 255)',\n invertedPressedForeground: 'rgb(10, 10, 10)',\n },\n toggle: {\n track: 'rgb(70, 70, 70)', // neutral off track for dark theme\n trackChecked: 'rgb(34, 197, 94)', // lighter green to match dark theme success\n trackCheckedPending: 'rgb(240, 138, 7)', // dark-theme pending amber\n knob: 'rgb(255, 255, 255)',\n },\n segmentedControl: {\n // Inverted from light mode: the track is the DARKER surface and the selected\n // thumb sits lighter on top, so \"raised\" still reads as raised.\n trackBackground: 'rgb(38, 38, 38)',\n itemForeground: 'rgb(161, 161, 161)', // text.secondary — 5.9:1 on the track\n itemHoverForeground: 'rgb(255, 255, 255)',\n selectedBackground: 'rgb(82, 82, 82)',\n selectedForeground: 'rgb(255, 255, 255)', // 7.8:1 on the thumb\n selectedShadow: '0px 1px 2px 0px rgba(0, 0, 0, 0.4)',\n },\n selectableCard: {\n background: 'rgb(45, 45, 45)',\n border: 'rgb(64, 64, 64)',\n selectedTint: 'rgb(30, 62, 48)',\n selectedSurfaceEnd: 'rgb(52, 52, 52)',\n selectedBorder: 'rgb(50, 205, 132)',\n librarySelectedTint: 'rgb(45, 45, 45)',\n librarySelectedBorder: 'rgb(115, 115, 115)',\n editingTint: 'rgb(58, 48, 36)', // the amber tint re-picked for a dark sheet\n accent: 'rgb(50, 205, 132)', // dark success — #047B43 is unreadable on dark\n mutedForeground: 'rgb(161, 161, 161)', // 4.82:1 on the selected card, 5.86:1 on the trough\n hoverBackground: 'rgb(64, 64, 64)',\n hoverRule: 'rgb(115, 115, 115)',\n pendingForeground: 'rgb(240, 138, 7)',\n },\n cardStrip: {\n background: 'rgb(38, 38, 38)', // one step under the selected card, as #F1F1F1 is under white\n divider: 'rgb(64, 64, 64)',\n fade: 'rgb(30, 30, 30)', // matches card.background so the mask disappears into it\n arrowBackground: 'rgb(45, 45, 45)',\n arrowBorder: 'rgb(100, 100, 100)', // dark dropdown.border, the light pair of #E8E8E8\n addPrimaryBackground: 'rgb(245, 245, 245)',\n addPrimaryForeground: 'rgb(23, 23, 23)',\n },\n selectionBar: {\n background: 'rgb(56, 56, 56)', // lifts off the dark sheet\n foreground: 'rgb(255, 255, 255)',\n mutedForeground: 'rgb(176, 176, 176)',\n divider: 'rgb(96, 96, 96)',\n border: 'rgb(96, 96, 96)', // hairline on the dark sheet\n primaryBorder: 'rgb(120, 120, 120)',\n shadow: '0px 0px 10px 0px rgba(0, 0, 0, 0.45)',\n noticeBackground: 'rgb(96, 70, 28)',\n noticeForeground: 'rgb(240, 202, 148)',\n noticeShadow: '0px 4px 10px 0px rgba(0, 0, 0, 0.45)',\n },\n inlineConfirm: {\n background: 'rgb(64, 64, 64)', // lifts off the dark sheet\n foreground: 'rgb(255, 255, 255)',\n divider: 'rgba(255, 255, 255, 0.16)',\n shadow: '0px 0px 10px 0px rgba(0, 0, 0, 0.45)',\n },\n dropdown: {\n border: 'rgb(100, 100, 100)',\n borderActive: 'rgba(50, 205, 132, 0.7)',\n borderFilter: 'rgba(50, 205, 132, 0.5)',\n borderError: 'rgba(255, 100, 100, 0.6)',\n borderPending: 'rgba(240, 138, 7, 0.7)',\n shadow: '0px 1px 0px 0px rgba(0, 0, 0, 0.4)',\n shadowHover: '0px 1px 0px 0px rgba(50, 205, 132, 0.6)',\n shadowActive: '0px 1px 0px 0px rgba(50, 205, 132, 0.8)',\n shadowFilter: '0px 1px 0px 0px rgba(50, 205, 132, 0.6)',\n shadowError:\n '0px 1px 0px 0px rgba(255, 100, 100, 0.8), 0px 0px 0px 2px rgba(255, 100, 100, 0.1)',\n shadowPending:\n '0px 1px 0px 0px rgba(240, 138, 7, 0.8), 0px 0px 0px 2px rgba(240, 138, 7, 0.15)',\n disabledBackground: 'rgb(70, 70, 70)',\n },\n tag: {\n primary: {\n background: 'rgba(37, 130, 234, 0.2)', // Darker background for dark theme\n foreground: 'rgb(96, 165, 250)', // Lighter blue for dark theme\n border: 'rgb(96, 165, 250)', // Lighter blue border\n shadow: 'rgba(96, 165, 250, 0.5)', // Lighter blue shadow\n },\n secondary: {\n background: 'rgba(0, 175, 102, 0.2)', // Darker background for dark theme\n foreground: 'rgb(34, 197, 94)', // Lighter green for dark theme\n border: 'rgb(34, 197, 94)', // Lighter green border\n shadow: 'rgba(34, 197, 94, 0.5)', // Lighter green shadow\n },\n default: {\n background: 'rgba(161, 161, 161, 0.2)', // Darker background for dark theme\n foreground: 'rgb(161, 161, 161)', // Light gray for dark theme\n border: 'rgb(161, 161, 161)', // Light gray border\n shadow: 'rgba(161, 161, 161, 0.5)', // Light gray shadow\n },\n error: {\n background: 'rgba(239, 68, 68, 0.2)', // Darker background for dark theme\n foreground: 'rgb(248, 113, 113)', // Lighter red for dark theme\n border: 'rgb(248, 113, 113)', // Lighter red border\n shadow: 'rgba(248, 113, 113, 0.5)', // Lighter red shadow\n },\n warning: {\n background: 'rgba(245, 158, 11, 0.2)', // Darker background for dark theme\n foreground: 'rgb(251, 191, 36)', // Lighter orange for dark theme\n border: 'rgb(251, 191, 36)', // Lighter orange border\n shadow: 'rgba(251, 191, 36, 0.5)', // Lighter orange shadow\n },\n success: {\n background: 'rgba(0, 175, 102, 0.2)', // Darker background for dark theme\n foreground: 'rgb(34, 197, 94)', // Lighter green for dark theme\n border: 'rgb(34, 197, 94)', // Lighter green border\n shadow: 'rgba(34, 197, 94, 0.5)', // Lighter green shadow\n },\n emphasis: {\n background: 'rgb(59, 59, 59)', // Figma #3b3b3b\n foreground: 'rgb(255, 255, 255)',\n border: 'rgb(255, 255, 255)',\n shadow: 'rgba(0, 0, 0, 0.2)',\n },\n info: {\n background: 'rgba(12, 88, 174, 0.25)',\n foreground: 'rgb(125, 171, 245)', // Blue (Dark) lifted for dark surfaces\n border: 'rgb(125, 171, 245)',\n shadow: 'rgba(125, 171, 245, 0.5)',\n },\n assistant: {\n // Same violet the assistant diff palette already picked for dark ground\n // (see codeBlock.diffAssistantBackground below) — one hue, reused everywhere\n // \"made by the assistant\" needs to read in dark mode.\n background: 'rgba(158, 130, 255, 0.18)',\n foreground: 'rgb(184, 158, 255)', // Matches diffAssistantForeground\n border: 'rgba(158, 130, 255, 0.32)', // Same hue as the background, more opaque so the edge reads\n shadow: 'rgba(184, 158, 255, 0.5)', // Lighter violet shadow\n },\n },\n numberTag: {\n background: 'rgba(255, 255, 255, 0.1)', // Light pill on dark surfaces\n foreground: 'rgb(161, 161, 161)', // Dark theme text secondary\n emphasisBackground: 'rgba(255, 255, 255, 0.2)', // Stronger pill for emphasis\n emphasisForeground: 'rgb(237, 237, 237)', // Dark theme text emphasis\n },\n table: {\n // Copied from the light theme and never darkened, so dark mode rendered a light\n // container, header and white rows with pale grey text.\n background: 'rgb(23, 23, 23)', // Darker than rows, as #F7F7F7 is in light\n boxShadow: 'none', // The designed container is a flat grey frame, not elevated\n header: {\n background: 'rgb(42, 42, 42)', // Dark theme header surface\n foreground: 'rgb(237, 237, 237)', // Dark theme text emphasis\n border: 'rgb(75, 85, 99)', // Dark theme header border\n },\n row: {\n background: 'rgb(30, 30, 30)', // Dark theme row background\n foreground: 'rgb(209, 213, 219)', // Dark theme row text\n hoverBackground: 'rgb(42, 42, 42)', // Dark theme row hover\n border: 'rgb(75, 85, 99)', // Dark theme row border\n // Not the light theme's brand green: over a near-black row it composites darker\n // than hoverBackground. 20%, because at 15% the step past hover was 1.12:1.\n selectedBackground: 'rgba(34, 197, 94, 0.2)',\n selectedAccent: 'rgb(20, 170, 100)', // non-text, 3:1 applies\n selectedForeground: 'rgb(34, 197, 94)', // 5.09:1 — text needs AA 4.5:1\n },\n border: 'rgb(75, 85, 99)', // Dark theme table border\n borderedRow: {\n background: 'rgb(30, 30, 30)', // Matches row.background and card.background\n outline: 'rgb(75, 85, 99)', // Dark theme bordered row outline\n },\n rowVariant: {\n success: {\n background: 'rgba(34, 197, 94, 0.15)', // Dark theme success background\n },\n warning: {\n background: 'rgba(251, 191, 36, 0.15)', // Dark theme warning background\n },\n error: {\n background: 'rgba(248, 113, 113, 0.15)', // Dark theme error background\n },\n info: {\n background: 'rgba(96, 165, 250, 0.15)', // Dark theme info background\n },\n },\n error: {\n iconBackground: 'rgba(245, 158, 11, 0.2)', // Dark theme warning background\n iconForeground: 'rgb(251, 191, 36)', // Dark theme warning foreground\n titleForeground: 'rgb(255, 255, 255)', // Dark theme title\n subtitleForeground: 'rgb(161, 161, 161)', // Dark theme subtitle\n },\n },\n text: {\n primary: 'rgb(255, 255, 255)',\n secondary: 'rgb(161, 161, 161)',\n dimmed: 'rgb(115, 115, 115)',\n emphasis: 'rgb(237, 237, 237)',\n muted: 'rgb(199, 199, 199)',\n placeholder: 'rgb(140, 140, 140)', // Dark theme placeholder color\n destructive: 'rgb(255, 120, 120)',\n success: 'rgb(20, 170, 100)',\n highlight: 'rgb(118, 214, 174)',\n warning: 'rgb(200, 130, 20)',\n warningMuted: 'rgb(206, 163, 108)', // Same tan reads as muted on dark too\n error: 'rgb(255, 80, 80)',\n info: 'rgb(125, 171, 245)',\n linkForeground: 'rgba(255, 255, 255, 0.45)',\n linkForegroundHover: 'rgb(255, 255, 255)',\n rightSideText: {\n // Mirrors text.secondary / text.primary, exactly as the light theme does.\n muted: 'rgb(161, 161, 161)',\n primary: 'rgb(255, 255, 255)',\n alignment: 'right' as const,\n fontSize: '12px',\n minWidth: '80px',\n },\n },\n codeBlock: {\n background: 'rgb(42, 42, 42)', // Dark background\n foreground: 'rgb(255, 255, 255)', // Light text\n border: 'rgb(80, 80, 80)', // Dark border\n lineNumber: 'rgb(161, 161, 161)', // Light gray for line numbers\n keyword: 'rgb(100, 150, 220)', // Light blue for keywords\n comment: 'rgb(161, 161, 161)', // Gray for comments\n string: 'rgb(120, 220, 150)', // Light green for strings\n number: 'rgb(255, 180, 100)', // Light orange for numbers\n type: 'rgb(100, 150, 220)', // Light blue for types\n diffAddedBackground: 'rgba(34, 197, 94, 0.16)', // Lighter green for dark theme\n diffRemovedBackground: 'rgba(255, 100, 100, 0.14)', // Lighter red for dark theme\n // Assistant diff palette, kept at the same relationships as the light theme values.\n diffAssistantBackground: 'rgba(158, 130, 255, 0.18)', // Violet tint that still reads on a dark ground\n diffAssistantForeground: 'rgb(184, 158, 255)', // Lighter violet so the marker holds contrast\n diffAssistantRemovedBackground: 'rgba(190, 185, 210, 0.08)', // Faint neutral-violet tint\n diffRemovedForeground: 'rgb(168, 162, 190)', // Muted violet-grey marker, lightened for dark contrast\n diffContextForeground: 'rgb(90, 90, 90)', // Low-contrast marker, dark counterpart to the near-white D9D9D9\n diffContextText: 'rgb(170, 170, 170)', // De-emphasised text, in line with the existing comment grey\n },\n chat: {\n userBubbleBackground: 'rgb(45, 45, 45)', // One step up from the page, matching selectableCard's dark surface\n userBubbleBorder: 'rgb(64, 64, 64)', // Matches card.border, the dark theme's neutral hairline\n // Neutral for the same reason as the light theme: the violet belongs to the\n // pending-change marks, not to authorship. Here the assistant sits one step BELOW\n // the user's surface rather than above it, since dark has no room above 45.\n assistantBubbleBackground: 'rgb(30, 30, 30)', // card.background\n assistantBubbleBorder: 'rgb(64, 64, 64)', // card.border, the same hairline the user bubble uses\n assistantBubbleForeground: 'rgb(255, 255, 255)', // card.foreground\n },\n assistant: {\n foreground: 'rgb(184, 158, 255)', // Matches diffAssistantForeground / tag.assistant.foreground\n surfaceBackground: 'rgba(158, 130, 255, 0.08)', // Faint tint, still distinguishable from the dark page\n surfaceBorder: 'rgba(158, 130, 255, 0.35)', // A dashed outline needs more presence than the surface tint\n // Light theme darkens the violet accent (#6E56CF) to #4A3F7A for body text; dark\n // theme instead lifts it, the same transform `text.info` applies to its accent, so\n // the muted violet still reads against a near-black ground rather than going darker.\n surfaceForeground: 'rgb(134, 120, 186)',\n },\n },\n};\n\n// localStorage keys\nconst THEME_MODE_KEY = 'malachite-theme-mode';\nconst CUSTOM_THEME_KEY = 'malachite-custom-theme';\n\n// hub forwards a caller-supplied theme from a JSON attribute into applyTheme, and the\n// shadow-root branch concatenates values into a CSS string — any of these closes :host.\n/** A custom property name is only safe to echo into a log once it matches this. */\nconst SAFE_CUSTOM_PROPERTY = /^--[A-Za-z0-9_-]+$/;\n\nconst UNSAFE_CSS_SYNTAX = /[{};]|\\/\\*|\\*\\//;\n// Keys become custom-property names, so they carry the same risk.\nconst SAFE_THEME_KEY = /^[A-Za-z0-9_-]+$/;\n\n/** Drops any key or value that could break out of a CSS declaration. Dropped entries fall\n * through to the base theme rather than leaving the token unset. */\nfunction sanitizeThemeInput(value: unknown, path: string): unknown {\n if (typeof value === 'string') {\n if (UNSAFE_CSS_SYNTAX.test(value)) {\n console.warn(\n `Malachite: ignoring theme value at ${path} — CSS syntax characters ({ } ; /* */) are not allowed.`,\n );\n return undefined;\n }\n return value;\n }\n\n if (value === null || typeof value !== 'object') return value;\n\n const sanitized: Record<string, unknown> = {};\n for (const [key, child] of Object.entries(value as Record<string, unknown>)) {\n const childPath = path ? `${path}.${key}` : key;\n if (!SAFE_THEME_KEY.test(key)) {\n // Parent path, never childPath: the rejected key is untrusted input.\n console.warn(\n `Malachite: ignoring a theme key under ${path || '<root>'} — theme keys may contain only letters, digits, hyphens and underscores.`,\n );\n continue;\n }\n const sanitizedChild = sanitizeThemeInput(child, childPath);\n if (sanitizedChild !== undefined) sanitized[key] = sanitizedChild;\n }\n return sanitized;\n}\n\n// Keep track of all shadow roots so we can update them when theme changes\nconst registeredShadowRoots = new Set<ShadowRoot>();\n\n/**\n * Register a shadow root to receive theme updates\n */\nexport function registerShadowRoot(shadowRoot: ShadowRoot): void {\n try {\n // Prevent duplicate registrations\n if (registeredShadowRoots.has(shadowRoot)) {\n return;\n }\n\n registeredShadowRoots.add(shadowRoot);\n // Apply current theme to this new shadow root\n applyCurrentThemeToShadowRoot(shadowRoot);\n } catch (error) {\n console.error('Error registering shadow root:', error);\n }\n}\n\n/**\n * Unregister a shadow root when it's no longer needed\n */\nexport function unregisterShadowRoot(shadowRoot: ShadowRoot): void {\n try {\n registeredShadowRoots.delete(shadowRoot);\n } catch (error) {\n console.error('Error unregistering shadow root:', error);\n }\n}\n\n/** Table keys whose readers expect kebab-case. `boxShadow` was emitted camelCase while\n * tailwind.css and getCurrentTheme both read `--malachite-table-box-shadow`, so the\n * bordered container never received a shadow. Keyed on the real table shape, so a typo\n * fails typecheck rather than silently emitting the camelCase name. */\nconst TABLE_KEBAB_KEYS: Partial<Record<keyof MalachiteTheme['colors']['table'], string>> = {\n rowVariant: 'row-variant',\n boxShadow: 'box-shadow',\n};\n\n/**\n * Helper function to process table color properties and add them to CSS properties\n */\nfunction processTableColorProperties(\n tableColors: MalachiteTheme['colors']['table'],\n prefix: string,\n addProperty: (key: string, value: string) => void,\n): void {\n Object.entries(tableColors).forEach(([key, value]) => {\n // Top-level table keys are NOT kebab-cased in general: `borderedRow` ships as\n // `--malachite-table-borderedRow-*` and tailwind.css reads it that way, so\n // renaming it would break consumers. Only the keys whose readers expect kebab\n // are mapped, hence the explicit list rather than a blanket transform.\n const parentKeyVar = TABLE_KEBAB_KEYS[key as keyof typeof TABLE_KEBAB_KEYS] ?? key;\n if (typeof value === 'object' && value !== null) {\n Object.entries(value).forEach(([subKey, subValue]) => {\n const kebabKey = subKey.replace(/([A-Z])/g, '-$1').toLowerCase();\n if (typeof subValue === 'object' && subValue !== null) {\n Object.entries(subValue).forEach(([deepKey, deepValue]) => {\n const deepKebabKey = deepKey.replace(/([A-Z])/g, '-$1').toLowerCase();\n addProperty(\n `${prefix}-${parentKeyVar}-${kebabKey}-${deepKebabKey}`,\n deepValue as string,\n );\n });\n } else {\n addProperty(`${prefix}-${parentKeyVar}-${kebabKey}`, subValue as string);\n }\n });\n } else {\n addProperty(`${prefix}-${parentKeyVar}`, value);\n }\n });\n}\n\n/**\n * Apply CSS custom properties to a target element (document.documentElement or shadow root)\n */\nfunction applyCSSCustomProperties(theme: MalachiteTheme, target: HTMLElement | ShadowRoot): void {\n // Both branches emit accent from these, so an omitted accent still paints the defaults.\n const accentColors = theme.colors.accent ?? DEFAULT_ACCENT_COLORS;\n const datePickerColors = theme.colors.datePicker ?? {};\n const shadows = { ...theme.shadows, accent: theme.shadows.accent ?? DEFAULT_ACCENT_SHADOW };\n\n if (target instanceof ShadowRoot) {\n // For shadow roots, we need to set properties on a style element\n let styleElement = target.querySelector('#malachite-theme-vars') as HTMLStyleElement;\n if (!styleElement) {\n styleElement = document.createElement('style');\n styleElement.id = 'malachite-theme-vars';\n target.appendChild(styleElement);\n }\n\n // Build CSS custom properties\n const properties: string[] = [];\n\n // Add font size properties\n Object.entries(theme.fontSizes).forEach(([key, value]) => {\n properties.push(`--malachite-font-size-${key}: ${value}`);\n });\n\n // Add icon size properties\n Object.entries(theme.iconSizes).forEach(([key, value]) => {\n properties.push(`--malachite-icon-size-${key}: ${value}`);\n });\n\n // Add radius properties\n Object.entries(theme.radius).forEach(([key, value]) => {\n properties.push(`--malachite-radius-${key}: ${value}`);\n });\n\n // Add control height properties\n Object.entries(theme.controlHeights ?? CONTROL_HEIGHT).forEach(([key, value]) => {\n properties.push(`--malachite-control-height-${key}: ${value}`);\n });\n\n // Add shadow properties\n Object.entries(shadows).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n properties.push(`--malachite-shadow-${kebabKey}: ${value}`);\n });\n\n // Add color properties\n properties.push(`--malachite-shadow-color: ${theme.colors.shadowColor}`);\n properties.push(`--malachite-shadow-opacity: ${theme.colors.shadowOpacity}`);\n\n // Add card color properties\n Object.entries(theme.colors.card).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n properties.push(`--malachite-card-${kebabKey}: ${value}`);\n });\n\n // Add overlay color properties\n Object.entries(theme.colors.overlay).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n properties.push(`--malachite-overlay-${kebabKey}: ${value}`);\n });\n\n // Add alert color properties\n Object.entries(theme.colors.alert).forEach(([alertType, alertColors]) => {\n Object.entries(alertColors).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n properties.push(`--malachite-alert-${alertType}-${kebabKey}: ${value}`);\n });\n });\n\n // Add tooltip color properties\n Object.entries(theme.colors.tooltip).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n properties.push(`--malachite-tooltip-${kebabKey}: ${value}`);\n });\n\n // Add buttonList color properties\n Object.entries(theme.colors.buttonList).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n properties.push(`--malachite-buttonlist-${kebabKey}: ${value}`);\n });\n\n // Add pillButton color properties\n Object.entries(theme.colors.pillButton).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n properties.push(`--malachite-pillbutton-${kebabKey}: ${value}`);\n });\n\n // Add toggle color properties\n Object.entries(theme.colors.toggle).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n properties.push(`--malachite-toggle-${kebabKey}: ${value}`);\n });\n\n // Add segmentedControl color properties\n Object.entries(theme.colors.segmentedControl).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n properties.push(`--malachite-segmented-control-${kebabKey}: ${value}`);\n });\n\n Object.entries(theme.colors.selectableCard).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n properties.push(`--malachite-selectable-card-${kebabKey}: ${value}`);\n });\n\n Object.entries(theme.colors.cardStrip).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n properties.push(`--malachite-card-strip-${kebabKey}: ${value}`);\n });\n\n Object.entries(theme.colors.selectionBar).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n properties.push(`--malachite-selection-bar-${kebabKey}: ${value}`);\n });\n\n Object.entries(theme.colors.inlineConfirm).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n properties.push(`--malachite-inline-confirm-${kebabKey}: ${value}`);\n });\n\n // Add dropdown color properties\n Object.entries(theme.colors.dropdown).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n properties.push(`--malachite-dropdown-${kebabKey}: ${value}`);\n });\n\n Object.entries(theme.colors.control).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n properties.push(`--malachite-control-${kebabKey}: ${value}`);\n });\n\n Object.entries(accentColors).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n properties.push(`--malachite-accent-${kebabKey}: ${value}`);\n });\n\n Object.entries(datePickerColors).forEach(([key, value]) => {\n if (value) {\n properties.push(`${datePickerVar(key)}: ${value}`);\n }\n });\n\n // Add tag color properties\n Object.entries(theme.colors.tag).forEach(([tagType, tagColors]) => {\n Object.entries(tagColors).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n properties.push(`--malachite-tag-${tagType}-${kebabKey}: ${value}`);\n });\n });\n\n // Add number tag color properties\n Object.entries(theme.colors.numberTag).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n properties.push(`--malachite-number-tag-${kebabKey}: ${value}`);\n });\n\n // Add table color properties\n processTableColorProperties(theme.colors.table, '--malachite-table', (key, value) =>\n properties.push(`${key}: ${value}`),\n );\n\n // Add text color properties\n Object.entries(theme.colors.text).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n if (typeof value === 'object' && value !== null) {\n // Handle nested objects like rightSideText (supports one extra nesting level)\n Object.entries(value).forEach(([nestedKey, nestedValue]) => {\n const nestedKebabKey = nestedKey.replace(/([A-Z])/g, '-$1').toLowerCase();\n if (typeof nestedValue === 'object' && nestedValue !== null) {\n Object.entries(nestedValue as Record<string, string>).forEach(\n ([deepKey, deepValue]) => {\n const deepKebabKey = deepKey\n .replace(/([A-Z])/g, '-$1')\n .toLowerCase();\n properties.push(\n `--malachite-text-${kebabKey}-${nestedKebabKey}-${deepKebabKey}: ${deepValue}`,\n );\n },\n );\n } else {\n properties.push(\n `--malachite-text-${kebabKey}-${nestedKebabKey}: ${nestedValue}`,\n );\n }\n });\n } else {\n properties.push(`--malachite-text-${kebabKey}: ${value}`);\n }\n });\n\n // Add codeBlock color properties\n Object.entries(theme.colors.codeBlock).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n properties.push(`--malachite-codeblock-${kebabKey}: ${value}`);\n });\n\n // Add chat color properties\n Object.entries(theme.colors.chat).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n properties.push(`--malachite-chat-${kebabKey}: ${value}`);\n });\n\n // Add assistant color properties\n Object.entries(theme.colors.assistant).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n properties.push(`--malachite-assistant-${kebabKey}: ${value}`);\n });\n\n // Add button color variants\n // Keep in sync with the documentElement branch's list: 'outline' was missing here,\n // so the token never reached a shadow root — where every component actually renders.\n const colorVariants = [\n 'primary',\n 'secondary',\n 'outline',\n 'destructive',\n 'success',\n 'warning',\n 'error',\n ] as const;\n colorVariants.forEach((variant) => {\n const variantColors = theme.colors[variant];\n Object.entries(variantColors).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n properties.push(`--malachite-${variant}-${kebabKey}: ${value}`);\n });\n });\n\n // :host only — custom properties inherit to the whole shadow tree, and a\n // universal `* { }` copy forces WebKit to apply/compare every token on every\n // element, which makes style recalc O(elements × tokens) and freezes Safari\n // on large pages. Component-level token overrides still win over inheritance.\n // Second line of defence behind mergeThemes' sanitizer.\n const safeProperties = properties.filter((declaration) => {\n if (!UNSAFE_CSS_SYNTAX.test(declaration)) return true;\n // A hostile key puts the breakout before the first colon, so check the name too.\n const candidate = declaration.split(':', 1)[0].trim();\n const name = SAFE_CUSTOM_PROPERTY.test(candidate) ? candidate : 'an unnamed token';\n console.warn(`Malachite: dropped an unsafe theme declaration for ${name}`);\n return false;\n });\n\n styleElement.textContent = `:host { ${safeProperties.join('; ')} }`;\n } else if (target instanceof HTMLElement) {\n // For document.documentElement, use setProperty directly\n Object.entries(theme.fontSizes).forEach(([key, value]) => {\n target.style.setProperty(`--malachite-font-size-${key}`, value);\n });\n\n Object.entries(theme.iconSizes).forEach(([key, value]) => {\n target.style.setProperty(`--malachite-icon-size-${key}`, value);\n });\n\n Object.entries(theme.radius).forEach(([key, value]) => {\n target.style.setProperty(`--malachite-radius-${key}`, value);\n });\n\n Object.entries(theme.controlHeights ?? CONTROL_HEIGHT).forEach(([key, value]) => {\n target.style.setProperty(`--malachite-control-height-${key}`, value);\n });\n\n Object.entries(shadows).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n target.style.setProperty(`--malachite-shadow-${kebabKey}`, value);\n });\n\n target.style.setProperty('--malachite-shadow-color', theme.colors.shadowColor);\n target.style.setProperty(\n '--malachite-shadow-opacity',\n theme.colors.shadowOpacity.toString(),\n );\n\n // Add card color properties\n Object.entries(theme.colors.card).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n target.style.setProperty(`--malachite-card-${kebabKey}`, value);\n });\n\n // Add overlay color properties\n Object.entries(theme.colors.overlay).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n target.style.setProperty(`--malachite-overlay-${kebabKey}`, value);\n });\n\n // Add alert color properties\n Object.entries(theme.colors.alert).forEach(([alertType, alertColors]) => {\n Object.entries(alertColors).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n target.style.setProperty(`--malachite-alert-${alertType}-${kebabKey}`, value);\n });\n });\n\n // Add tooltip color properties\n Object.entries(theme.colors.tooltip).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n target.style.setProperty(`--malachite-tooltip-${kebabKey}`, value);\n });\n\n // Add buttonList color properties\n Object.entries(theme.colors.buttonList).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n target.style.setProperty(`--malachite-buttonlist-${kebabKey}`, value);\n });\n\n // Add pillButton color properties\n Object.entries(theme.colors.pillButton).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n target.style.setProperty(`--malachite-pillbutton-${kebabKey}`, value);\n });\n\n // Add toggle color properties\n Object.entries(theme.colors.toggle).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n target.style.setProperty(`--malachite-toggle-${kebabKey}`, value);\n });\n\n // Add segmentedControl color properties\n Object.entries(theme.colors.segmentedControl).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n target.style.setProperty(`--malachite-segmented-control-${kebabKey}`, value);\n });\n\n Object.entries(theme.colors.selectableCard).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n target.style.setProperty(`--malachite-selectable-card-${kebabKey}`, value);\n });\n\n Object.entries(theme.colors.cardStrip).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n target.style.setProperty(`--malachite-card-strip-${kebabKey}`, value);\n });\n\n Object.entries(theme.colors.selectionBar).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n target.style.setProperty(`--malachite-selection-bar-${kebabKey}`, value);\n });\n\n Object.entries(theme.colors.inlineConfirm).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n target.style.setProperty(`--malachite-inline-confirm-${kebabKey}`, value);\n });\n\n // Add dropdown color properties\n Object.entries(theme.colors.dropdown).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n target.style.setProperty(`--malachite-dropdown-${kebabKey}`, value);\n });\n\n Object.entries(theme.colors.control).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n target.style.setProperty(`--malachite-control-${kebabKey}`, value);\n });\n\n Object.entries(accentColors).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n target.style.setProperty(`--malachite-accent-${kebabKey}`, value);\n });\n\n // Removed when unset, or an override outlives the custom theme that set it.\n DATE_PICKER_TOKENS.forEach((key) => {\n const value = datePickerColors[key];\n if (value) {\n target.style.setProperty(datePickerVar(key), value);\n } else {\n target.style.removeProperty(datePickerVar(key));\n }\n });\n\n // Add tag color properties\n Object.entries(theme.colors.tag).forEach(([tagType, tagColors]) => {\n Object.entries(tagColors).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n target.style.setProperty(`--malachite-tag-${tagType}-${kebabKey}`, value);\n });\n });\n\n // Add number tag color properties\n Object.entries(theme.colors.numberTag).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n target.style.setProperty(`--malachite-number-tag-${kebabKey}`, value);\n });\n\n // Add table color properties\n processTableColorProperties(theme.colors.table, '--malachite-table', (key, value) =>\n target.style.setProperty(key, value),\n );\n\n // Add text color properties\n Object.entries(theme.colors.text).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n if (typeof value === 'object' && value !== null) {\n // Handle nested objects like rightSideText (supports one extra nesting level)\n Object.entries(value).forEach(([nestedKey, nestedValue]) => {\n const nestedKebabKey = nestedKey.replace(/([A-Z])/g, '-$1').toLowerCase();\n if (typeof nestedValue === 'object' && nestedValue !== null) {\n Object.entries(nestedValue as Record<string, string>).forEach(\n ([deepKey, deepValue]) => {\n const deepKebabKey = deepKey\n .replace(/([A-Z])/g, '-$1')\n .toLowerCase();\n target.style.setProperty(\n `--malachite-text-${kebabKey}-${nestedKebabKey}-${deepKebabKey}`,\n deepValue,\n );\n },\n );\n } else {\n target.style.setProperty(\n `--malachite-text-${kebabKey}-${nestedKebabKey}`,\n nestedValue as string,\n );\n }\n });\n } else {\n target.style.setProperty(`--malachite-text-${kebabKey}`, value);\n }\n });\n\n // Add codeBlock color properties\n Object.entries(theme.colors.codeBlock).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n target.style.setProperty(`--malachite-codeblock-${kebabKey}`, value);\n });\n\n // Add chat color properties\n Object.entries(theme.colors.chat).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n target.style.setProperty(`--malachite-chat-${kebabKey}`, value);\n });\n\n // Add assistant color properties\n Object.entries(theme.colors.assistant).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n target.style.setProperty(`--malachite-assistant-${kebabKey}`, value);\n });\n\n const colorVariants = [\n 'primary',\n 'secondary',\n 'outline',\n 'destructive',\n 'success',\n 'warning',\n 'error',\n ] as const;\n colorVariants.forEach((variant) => {\n const variantColors = theme.colors[variant];\n Object.entries(variantColors).forEach(([key, value]) => {\n const kebabKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();\n target.style.setProperty(`--malachite-${variant}-${kebabKey}`, value);\n });\n });\n }\n}\n\n/**\n * Apply current theme to a specific shadow root\n */\nfunction applyCurrentThemeToShadowRoot(shadowRoot: ShadowRoot): void {\n try {\n const currentMode = getCurrentThemeMode();\n const customTheme = getCustomTheme();\n\n // Start with base theme (light or dark)\n const baseTheme = currentMode === 'dark' ? darkTheme : defaultTheme;\n\n // Merge with custom theme if any\n const finalTheme = customTheme ? mergeThemes(baseTheme, customTheme) : baseTheme;\n\n applyCSSCustomProperties(finalTheme, shadowRoot);\n } catch (error) {\n console.error('Error applying theme to shadow root:', error);\n }\n}\n\n/**\n * Get current theme mode from localStorage\n */\nexport function getCurrentThemeMode(): 'light' | 'dark' {\n if (typeof window === 'undefined') return 'light';\n return (localStorage.getItem(THEME_MODE_KEY) as 'light' | 'dark') || 'light';\n}\n\n/**\n * Get custom theme from localStorage\n */\nfunction getCustomTheme(): PartialMalachiteTheme | null {\n if (typeof window === 'undefined') return null;\n const stored = localStorage.getItem(CUSTOM_THEME_KEY);\n if (!stored) return null;\n try {\n return JSON.parse(stored);\n } catch {\n // Corrupt entry: drop it rather than throwing out of every caller. applyLightTheme\n // used to removeItem before reading, so it self-healed; now that it merges like\n // applyDarkTheme, that recovery has to live here or a bad entry wedges both modes.\n localStorage.removeItem(CUSTOM_THEME_KEY);\n return null;\n }\n}\n\n/**\n * Save theme mode to localStorage\n */\nfunction saveThemeMode(mode: 'light' | 'dark'): void {\n if (typeof window !== 'undefined') {\n localStorage.setItem(THEME_MODE_KEY, mode);\n }\n}\n\n/**\n * Save custom theme to localStorage\n */\nfunction saveCustomTheme(theme: PartialMalachiteTheme): void {\n if (typeof window !== 'undefined') {\n localStorage.setItem(CUSTOM_THEME_KEY, JSON.stringify(theme));\n }\n}\n\n/**\n * Merge themes (deep merge for nested objects)\n */\nfunction mergeThemes(base: MalachiteTheme, customInput: PartialMalachiteTheme): MalachiteTheme {\n // The one choke point every custom-theme path funnels through.\n const custom = sanitizeThemeInput(customInput, '') as PartialMalachiteTheme;\n\n const result = { ...base };\n\n if (custom.fontSizes) {\n result.fontSizes = { ...result.fontSizes, ...custom.fontSizes };\n }\n\n if (custom.iconSizes) {\n result.iconSizes = { ...result.iconSizes, ...custom.iconSizes };\n }\n\n if (custom.radius) {\n result.radius = { ...result.radius, ...custom.radius };\n }\n\n if (custom.controlHeights) {\n result.controlHeights = {\n ...(result.controlHeights ?? CONTROL_HEIGHT),\n ...custom.controlHeights,\n };\n }\n\n if (custom.shadows) {\n result.shadows = { ...result.shadows, ...custom.shadows };\n }\n\n if (custom.colors) {\n result.colors = { ...result.colors };\n\n if (custom.colors.shadowColor !== undefined) {\n result.colors.shadowColor = custom.colors.shadowColor;\n }\n if (custom.colors.shadowOpacity !== undefined) {\n result.colors.shadowOpacity = custom.colors.shadowOpacity;\n }\n\n // Handle card colors\n if (custom.colors.card) {\n result.colors.card = { ...result.colors.card, ...custom.colors.card };\n }\n\n // Handle overlay colors\n if (custom.colors.overlay) {\n result.colors.overlay = { ...result.colors.overlay, ...custom.colors.overlay };\n }\n\n // Handle alert colors. Keyed loop rather than a fixed destructure, so an alert\n // variant added to the theme later is merged instead of silently dropped.\n if (custom.colors.alert) {\n // Copy first: the spread makes a fresh `alert`, but each variant still points\n // at defaultTheme's object, which must not be mutated.\n result.colors.alert = { ...result.colors.alert };\n for (const key of Object.keys(\n custom.colors.alert,\n ) as (keyof MalachiteTheme['colors']['alert'])[]) {\n const variant = custom.colors.alert[key];\n if (variant) {\n result.colors.alert[key] = { ...result.colors.alert[key], ...variant };\n }\n }\n }\n\n // Handle tooltip colors\n if (custom.colors.tooltip) {\n result.colors.tooltip = { ...result.colors.tooltip, ...custom.colors.tooltip };\n }\n\n // Handle each color variant explicitly to avoid TypeScript issues\n if (custom.colors.primary) {\n result.colors.primary = { ...result.colors.primary, ...custom.colors.primary };\n }\n if (custom.colors.accent) {\n result.colors.accent = {\n ...(result.colors.accent ?? DEFAULT_ACCENT_COLORS),\n ...custom.colors.accent,\n };\n }\n if (custom.colors.datePicker) {\n result.colors.datePicker = {\n ...result.colors.datePicker,\n ...custom.colors.datePicker,\n };\n }\n if (custom.colors.control) {\n result.colors.control = { ...result.colors.control, ...custom.colors.control };\n }\n if (custom.colors.outline) {\n result.colors.outline = { ...result.colors.outline, ...custom.colors.outline };\n }\n if (custom.colors.secondary) {\n result.colors.secondary = { ...result.colors.secondary, ...custom.colors.secondary };\n }\n if (custom.colors.destructive) {\n result.colors.destructive = {\n ...result.colors.destructive,\n ...custom.colors.destructive,\n };\n }\n if (custom.colors.success) {\n result.colors.success = { ...result.colors.success, ...custom.colors.success };\n }\n if (custom.colors.warning) {\n result.colors.warning = { ...result.colors.warning, ...custom.colors.warning };\n }\n if (custom.colors.error) {\n result.colors.error = { ...result.colors.error, ...custom.colors.error };\n }\n if (custom.colors.buttonList) {\n result.colors.buttonList = { ...result.colors.buttonList, ...custom.colors.buttonList };\n }\n if (custom.colors.pillButton) {\n result.colors.pillButton = { ...result.colors.pillButton, ...custom.colors.pillButton };\n }\n if (custom.colors.toggle) {\n result.colors.toggle = { ...result.colors.toggle, ...custom.colors.toggle };\n }\n if (custom.colors.segmentedControl) {\n result.colors.segmentedControl = {\n ...result.colors.segmentedControl,\n ...custom.colors.segmentedControl,\n };\n }\n if (custom.colors.selectableCard) {\n result.colors.selectableCard = {\n ...result.colors.selectableCard,\n ...custom.colors.selectableCard,\n };\n }\n if (custom.colors.cardStrip) {\n result.colors.cardStrip = { ...result.colors.cardStrip, ...custom.colors.cardStrip };\n }\n if (custom.colors.selectionBar) {\n result.colors.selectionBar = {\n ...result.colors.selectionBar,\n ...custom.colors.selectionBar,\n };\n }\n if (custom.colors.inlineConfirm) {\n result.colors.inlineConfirm = {\n ...result.colors.inlineConfirm,\n ...custom.colors.inlineConfirm,\n };\n }\n if (custom.colors.dropdown) {\n result.colors.dropdown = { ...result.colors.dropdown, ...custom.colors.dropdown };\n }\n if (custom.colors.tag) {\n // Copy first: the spread makes a fresh `tag`, but each variant still points at\n // defaultTheme's object, which must not be mutated.\n result.colors.tag = { ...result.colors.tag };\n for (const key of Object.keys(\n custom.colors.tag,\n ) as (keyof MalachiteTheme['colors']['tag'])[]) {\n const variant = custom.colors.tag[key];\n if (variant) {\n result.colors.tag[key] = { ...result.colors.tag[key], ...variant };\n }\n }\n }\n if (custom.colors.numberTag) {\n result.colors.numberTag = { ...result.colors.numberTag, ...custom.colors.numberTag };\n }\n if (custom.colors.text) {\n const { rightSideText, ...flat } = custom.colors.text;\n result.colors.text = { ...result.colors.text, ...flat };\n if (rightSideText) {\n result.colors.text.rightSideText = {\n ...result.colors.text.rightSideText,\n ...rightSideText,\n };\n }\n }\n if (custom.colors.codeBlock) {\n result.colors.codeBlock = { ...result.colors.codeBlock, ...custom.colors.codeBlock };\n }\n if (custom.colors.chat) {\n result.colors.chat = { ...result.colors.chat, ...custom.colors.chat };\n }\n if (custom.colors.assistant) {\n result.colors.assistant = { ...result.colors.assistant, ...custom.colors.assistant };\n }\n // Deeper than the flat groups above: table's sub-objects are nested, so a shallow\n // spread would drop whatever the caller didn't restate.\n if (custom.colors.table) {\n const { header, row, borderedRow, rowVariant, error, ...flat } = custom.colors.table;\n result.colors.table = { ...result.colors.table, ...flat };\n if (header) {\n result.colors.table.header = { ...result.colors.table.header, ...header };\n }\n if (row) {\n result.colors.table.row = { ...result.colors.table.row, ...row };\n }\n if (borderedRow) {\n result.colors.table.borderedRow = {\n ...result.colors.table.borderedRow,\n ...borderedRow,\n };\n }\n if (error) {\n result.colors.table.error = { ...result.colors.table.error, ...error };\n }\n if (rowVariant) {\n // Copy first: the spread made a fresh `table`, but `rowVariant` still points at\n // defaultTheme's, which must not be mutated.\n const merged = { ...result.colors.table.rowVariant };\n for (const key of Object.keys(rowVariant) as (keyof typeof rowVariant)[]) {\n const variant = rowVariant[key];\n if (variant) {\n merged[key] = { ...merged[key], ...variant };\n }\n }\n result.colors.table.rowVariant = merged;\n }\n }\n }\n\n return result;\n}\n\n/**\n * Apply a custom theme to Malachite components\n * This function sets CSS custom properties that will be used by all Malachite components\n * Works with Shadow DOM isolation by applying to all registered shadow roots\n */\nexport function applyTheme(theme: PartialMalachiteTheme): void {\n // Save custom theme to localStorage\n saveCustomTheme(theme);\n\n // Apply to main document\n const currentMode = getCurrentThemeMode();\n const baseTheme = currentMode === 'dark' ? darkTheme : defaultTheme;\n const finalTheme = mergeThemes(baseTheme, theme);\n\n applyCSSCustomProperties(finalTheme, document.documentElement);\n\n // Apply to all registered shadow roots\n registeredShadowRoots.forEach((shadowRoot) => {\n applyCSSCustomProperties(finalTheme, shadowRoot);\n });\n\n // Update data-theme attribute for main document CSS\n if (currentMode === 'dark') {\n document.documentElement.setAttribute('data-theme', 'dark');\n } else {\n document.documentElement.removeAttribute('data-theme');\n }\n}\n\n/** Scope the active theme (base mode + any persisted custom overrides) to one element/root, without changing global mode. Used by <ThemeScope>. */\nexport function applyThemeVars(target: HTMLElement | ShadowRoot, mode: ThemeMode): void {\n const baseTheme = mode === 'dark' ? darkTheme : defaultTheme;\n const customTheme = getCustomTheme();\n const finalTheme = customTheme ? mergeThemes(baseTheme, customTheme) : baseTheme;\n applyCSSCustomProperties(finalTheme, target);\n}\n\n/**\n * Apply the default (light) theme\n */\nexport function applyLightTheme(): void {\n saveThemeMode('light');\n document.documentElement.removeAttribute('data-theme');\n\n // Apply the light theme, preserving any custom theme. Deliberately symmetric with\n // applyDarkTheme: this used to removeItem(CUSTOM_THEME_KEY), so a toggle to light\n // destroyed a consumer's custom theme permanently. resetTheme is the way to clear one.\n const customTheme = getCustomTheme();\n const finalTheme = customTheme ? mergeThemes(defaultTheme, customTheme) : defaultTheme;\n\n applyCSSCustomProperties(finalTheme, document.documentElement);\n\n // Apply to all registered shadow roots\n registeredShadowRoots.forEach((shadowRoot) => {\n applyCSSCustomProperties(finalTheme, shadowRoot);\n });\n}\n\n/**\n * Apply the dark theme\n */\nexport function applyDarkTheme(): void {\n saveThemeMode('dark');\n document.documentElement.setAttribute('data-theme', 'dark');\n\n // Apply dark theme, preserving any custom theme\n const customTheme = getCustomTheme();\n const finalTheme = customTheme ? mergeThemes(darkTheme, customTheme) : darkTheme;\n\n applyCSSCustomProperties(finalTheme, document.documentElement);\n\n // Apply to all registered shadow roots\n registeredShadowRoots.forEach((shadowRoot) => {\n applyCSSCustomProperties(finalTheme, shadowRoot);\n });\n}\n\n/**\n * Toggle between light and dark themes\n */\nexport function toggleTheme(): 'light' | 'dark' {\n const currentMode = getCurrentThemeMode();\n if (currentMode === 'dark') {\n applyLightTheme();\n return 'light';\n } else {\n applyDarkTheme();\n return 'dark';\n }\n}\n\n/**\n * Apply a custom theme while preserving the current theme mode (light/dark)\n */\nexport function applyCustomTheme(customTheme: PartialMalachiteTheme): void {\n applyTheme(customTheme);\n}\n\n/**\n * Reset theme to default values\n */\nexport function resetTheme(): void {\n const currentMode = getCurrentThemeMode();\n localStorage.removeItem(CUSTOM_THEME_KEY);\n\n if (currentMode === 'dark') {\n applyDarkTheme();\n } else {\n applyLightTheme();\n }\n}\n\n/**\n * Initialize the theme system - should be called on app startup\n */\nexport function initializeTheme(): void {\n if (typeof window !== 'undefined') {\n const currentMode = getCurrentThemeMode();\n const customTheme = getCustomTheme();\n\n if (currentMode === 'dark') {\n if (customTheme) {\n const finalTheme = mergeThemes(darkTheme, customTheme);\n applyCSSCustomProperties(finalTheme, document.documentElement);\n } else {\n applyCSSCustomProperties(darkTheme, document.documentElement);\n }\n document.documentElement.setAttribute('data-theme', 'dark');\n } else {\n if (customTheme) {\n const finalTheme = mergeThemes(defaultTheme, customTheme);\n applyCSSCustomProperties(finalTheme, document.documentElement);\n } else {\n applyCSSCustomProperties(defaultTheme, document.documentElement);\n }\n document.documentElement.removeAttribute('data-theme');\n }\n }\n}\n\n/**\n * Get current theme values from CSS custom properties\n */\nexport function getCurrentTheme(): MalachiteTheme {\n const computedStyle = getComputedStyle(document.documentElement);\n const datePicker: MalachiteTheme['colors']['datePicker'] = {};\n for (const key of DATE_PICKER_TOKENS) {\n const value = computedStyle.getPropertyValue(datePickerVar(key)).trim();\n if (value) {\n datePicker[key] = value;\n }\n }\n\n return {\n fontSizes: {\n xsmall:\n computedStyle.getPropertyValue('--malachite-font-size-xsmall').trim() ||\n defaultTheme.fontSizes.xsmall,\n small:\n computedStyle.getPropertyValue('--malachite-font-size-small').trim() ||\n defaultTheme.fontSizes.small,\n medium:\n computedStyle.getPropertyValue('--malachite-font-size-medium').trim() ||\n defaultTheme.fontSizes.medium,\n '15':\n computedStyle.getPropertyValue('--malachite-font-size-15').trim() ||\n defaultTheme.fontSizes['15'],\n large:\n computedStyle.getPropertyValue('--malachite-font-size-large').trim() ||\n defaultTheme.fontSizes.large,\n xlarge:\n computedStyle.getPropertyValue('--malachite-font-size-xlarge').trim() ||\n defaultTheme.fontSizes.xlarge,\n xxlarge:\n computedStyle.getPropertyValue('--malachite-font-size-xxlarge').trim() ||\n defaultTheme.fontSizes.xxlarge,\n },\n iconSizes: {\n xsmall:\n computedStyle.getPropertyValue('--malachite-icon-size-xsmall').trim() ||\n defaultTheme.iconSizes.xsmall,\n small:\n computedStyle.getPropertyValue('--malachite-icon-size-small').trim() ||\n defaultTheme.iconSizes.small,\n medium:\n computedStyle.getPropertyValue('--malachite-icon-size-medium').trim() ||\n defaultTheme.iconSizes.medium,\n large:\n computedStyle.getPropertyValue('--malachite-icon-size-large').trim() ||\n defaultTheme.iconSizes.large,\n },\n controlHeights: {\n small:\n computedStyle.getPropertyValue('--malachite-control-height-small').trim() ||\n CONTROL_HEIGHT.small,\n medium:\n computedStyle.getPropertyValue('--malachite-control-height-medium').trim() ||\n CONTROL_HEIGHT.medium,\n large:\n computedStyle.getPropertyValue('--malachite-control-height-large').trim() ||\n CONTROL_HEIGHT.large,\n },\n radius: {\n xs:\n computedStyle.getPropertyValue('--malachite-radius-xs').trim() ||\n defaultTheme.radius.xs,\n sm:\n computedStyle.getPropertyValue('--malachite-radius-sm').trim() ||\n defaultTheme.radius.sm,\n md:\n computedStyle.getPropertyValue('--malachite-radius-md').trim() ||\n defaultTheme.radius.md,\n lg:\n computedStyle.getPropertyValue('--malachite-radius-lg').trim() ||\n defaultTheme.radius.lg,\n '10':\n computedStyle.getPropertyValue('--malachite-radius-10').trim() ||\n defaultTheme.radius['10'],\n xl:\n computedStyle.getPropertyValue('--malachite-radius-xl').trim() ||\n defaultTheme.radius.xl,\n xxl:\n computedStyle.getPropertyValue('--malachite-radius-xxl').trim() ||\n defaultTheme.radius.xxl,\n xxxl:\n computedStyle.getPropertyValue('--malachite-radius-xxxl').trim() ||\n defaultTheme.radius.xxxl,\n },\n shadows: {\n sm:\n computedStyle.getPropertyValue('--malachite-shadow-sm').trim() ||\n defaultTheme.shadows.sm,\n md:\n computedStyle.getPropertyValue('--malachite-shadow-md').trim() ||\n defaultTheme.shadows.md,\n lg:\n computedStyle.getPropertyValue('--malachite-shadow-lg').trim() ||\n defaultTheme.shadows.lg,\n xl:\n computedStyle.getPropertyValue('--malachite-shadow-xl').trim() ||\n defaultTheme.shadows.xl,\n glow:\n computedStyle.getPropertyValue('--malachite-shadow-glow').trim() ||\n defaultTheme.shadows.glow,\n glowLg:\n computedStyle.getPropertyValue('--malachite-shadow-glow-lg').trim() ||\n defaultTheme.shadows.glowLg,\n default:\n computedStyle.getPropertyValue('--malachite-shadow-default').trim() ||\n defaultTheme.shadows.default,\n accent:\n computedStyle.getPropertyValue('--malachite-shadow-accent').trim() ||\n DEFAULT_ACCENT_SHADOW,\n success:\n computedStyle.getPropertyValue('--malachite-shadow-success').trim() ||\n defaultTheme.shadows.success,\n warning:\n computedStyle.getPropertyValue('--malachite-shadow-warning').trim() ||\n defaultTheme.shadows.warning,\n error:\n computedStyle.getPropertyValue('--malachite-shadow-error').trim() ||\n defaultTheme.shadows.error,\n },\n colors: {\n shadowColor:\n computedStyle.getPropertyValue('--malachite-shadow-color').trim() ||\n defaultTheme.colors.shadowColor,\n shadowOpacity:\n parseFloat(computedStyle.getPropertyValue('--malachite-shadow-opacity').trim()) ||\n defaultTheme.colors.shadowOpacity,\n card: {\n background:\n computedStyle.getPropertyValue('--malachite-card-background').trim() ||\n defaultTheme.colors.card.background,\n foreground:\n computedStyle.getPropertyValue('--malachite-card-foreground').trim() ||\n defaultTheme.colors.card.foreground,\n border:\n computedStyle.getPropertyValue('--malachite-card-border').trim() ||\n defaultTheme.colors.card.border,\n shadow:\n computedStyle.getPropertyValue('--malachite-card-shadow').trim() ||\n defaultTheme.colors.card.shadow,\n dimmedBackground:\n computedStyle.getPropertyValue('--malachite-card-dimmed-background').trim() ||\n defaultTheme.colors.card.dimmedBackground,\n sunkenBackground:\n computedStyle.getPropertyValue('--malachite-card-sunken-background').trim() ||\n defaultTheme.colors.card.sunkenBackground,\n warmBackground:\n computedStyle.getPropertyValue('--malachite-card-warm-background').trim() ||\n defaultTheme.colors.card.warmBackground,\n headerBackground:\n computedStyle.getPropertyValue('--malachite-card-header-background').trim() ||\n defaultTheme.colors.card.headerBackground,\n footerBackground:\n computedStyle.getPropertyValue('--malachite-card-footer-background').trim() ||\n defaultTheme.colors.card.footerBackground,\n footerGlassBackground:\n computedStyle\n .getPropertyValue('--malachite-card-footer-glass-background')\n .trim() || defaultTheme.colors.card.footerGlassBackground,\n trayNeutral:\n computedStyle.getPropertyValue('--malachite-card-tray-neutral').trim() ||\n defaultTheme.colors.card.trayNeutral,\n trayWarning:\n computedStyle.getPropertyValue('--malachite-card-tray-warning').trim() ||\n defaultTheme.colors.card.trayWarning,\n trayError:\n computedStyle.getPropertyValue('--malachite-card-tray-error').trim() ||\n defaultTheme.colors.card.trayError,\n traySuccess:\n computedStyle.getPropertyValue('--malachite-card-tray-success').trim() ||\n defaultTheme.colors.card.traySuccess,\n subtleDivider:\n computedStyle.getPropertyValue('--malachite-card-subtle-divider').trim() ||\n defaultTheme.colors.card.subtleDivider,\n },\n overlay: {\n scrim:\n computedStyle.getPropertyValue('--malachite-overlay-scrim').trim() ||\n defaultTheme.colors.overlay.scrim,\n },\n alert: {\n info: {\n background:\n computedStyle\n .getPropertyValue('--malachite-alert-info-background')\n .trim() || defaultTheme.colors.alert.info.background,\n foreground:\n computedStyle\n .getPropertyValue('--malachite-alert-info-foreground')\n .trim() || defaultTheme.colors.alert.info.foreground,\n },\n success: {\n background:\n computedStyle\n .getPropertyValue('--malachite-alert-success-background')\n .trim() || defaultTheme.colors.alert.success.background,\n foreground:\n computedStyle\n .getPropertyValue('--malachite-alert-success-foreground')\n .trim() || defaultTheme.colors.alert.success.foreground,\n },\n error: {\n background:\n computedStyle\n .getPropertyValue('--malachite-alert-error-background')\n .trim() || defaultTheme.colors.alert.error.background,\n foreground:\n computedStyle\n .getPropertyValue('--malachite-alert-error-foreground')\n .trim() || defaultTheme.colors.alert.error.foreground,\n },\n warning: {\n background:\n computedStyle\n .getPropertyValue('--malachite-alert-warning-background')\n .trim() || defaultTheme.colors.alert.warning.background,\n foreground:\n computedStyle\n .getPropertyValue('--malachite-alert-warning-foreground')\n .trim() || defaultTheme.colors.alert.warning.foreground,\n },\n assistant: {\n background:\n computedStyle\n .getPropertyValue('--malachite-alert-assistant-background')\n .trim() || defaultTheme.colors.alert.assistant.background,\n foreground:\n computedStyle\n .getPropertyValue('--malachite-alert-assistant-foreground')\n .trim() || defaultTheme.colors.alert.assistant.foreground,\n },\n },\n tooltip: {\n background:\n computedStyle.getPropertyValue('--malachite-tooltip-background').trim() ||\n defaultTheme.colors.tooltip.background,\n foreground:\n computedStyle.getPropertyValue('--malachite-tooltip-foreground').trim() ||\n defaultTheme.colors.tooltip.foreground,\n border:\n computedStyle.getPropertyValue('--malachite-tooltip-border').trim() ||\n defaultTheme.colors.tooltip.border,\n shadow:\n computedStyle.getPropertyValue('--malachite-tooltip-shadow').trim() ||\n defaultTheme.colors.tooltip.shadow,\n },\n primary: {\n background:\n computedStyle.getPropertyValue('--malachite-primary-background').trim() ||\n defaultTheme.colors.primary.background,\n foreground:\n computedStyle.getPropertyValue('--malachite-primary-foreground').trim() ||\n defaultTheme.colors.primary.foreground,\n border:\n computedStyle.getPropertyValue('--malachite-primary-border').trim() ||\n defaultTheme.colors.primary.border,\n borderHover:\n computedStyle.getPropertyValue('--malachite-primary-border-hover').trim() ||\n defaultTheme.colors.primary.borderHover,\n },\n accent: {\n background:\n computedStyle.getPropertyValue('--malachite-accent-background').trim() ||\n DEFAULT_ACCENT_COLORS.background,\n foreground:\n computedStyle.getPropertyValue('--malachite-accent-foreground').trim() ||\n DEFAULT_ACCENT_COLORS.foreground,\n border:\n computedStyle.getPropertyValue('--malachite-accent-border').trim() ||\n DEFAULT_ACCENT_COLORS.border,\n backgroundGlass:\n computedStyle.getPropertyValue('--malachite-accent-background-glass').trim() ||\n DEFAULT_ACCENT_COLORS.backgroundGlass,\n },\n datePicker,\n control: {\n borderHover:\n computedStyle.getPropertyValue('--malachite-control-border-hover').trim() ||\n defaultTheme.colors.control.borderHover,\n },\n outline: {\n foreground:\n computedStyle.getPropertyValue('--malachite-outline-foreground').trim() ||\n defaultTheme.colors.outline.foreground,\n },\n secondary: {\n background:\n computedStyle.getPropertyValue('--malachite-secondary-background').trim() ||\n defaultTheme.colors.secondary.background,\n foreground:\n computedStyle.getPropertyValue('--malachite-secondary-foreground').trim() ||\n defaultTheme.colors.secondary.foreground,\n border:\n computedStyle.getPropertyValue('--malachite-secondary-border').trim() ||\n defaultTheme.colors.secondary.border,\n borderHover:\n computedStyle.getPropertyValue('--malachite-secondary-border-hover').trim() ||\n defaultTheme.colors.secondary.borderHover,\n },\n destructive: {\n background:\n computedStyle.getPropertyValue('--malachite-destructive-background').trim() ||\n defaultTheme.colors.destructive.background,\n foreground:\n computedStyle.getPropertyValue('--malachite-destructive-foreground').trim() ||\n defaultTheme.colors.destructive.foreground,\n border:\n computedStyle.getPropertyValue('--malachite-destructive-border').trim() ||\n defaultTheme.colors.destructive.border,\n borderHover:\n computedStyle.getPropertyValue('--malachite-destructive-border-hover').trim() ||\n defaultTheme.colors.destructive.borderHover,\n shadow:\n computedStyle.getPropertyValue('--malachite-destructive-shadow').trim() ||\n defaultTheme.colors.destructive.shadow,\n shadowLight:\n computedStyle.getPropertyValue('--malachite-destructive-shadow-light').trim() ||\n defaultTheme.colors.destructive.shadowLight,\n shadowMedium:\n computedStyle\n .getPropertyValue('--malachite-destructive-shadow-medium')\n .trim() || defaultTheme.colors.destructive.shadowMedium,\n },\n success: {\n background:\n computedStyle.getPropertyValue('--malachite-success-background').trim() ||\n defaultTheme.colors.success.background,\n foreground:\n computedStyle.getPropertyValue('--malachite-success-foreground').trim() ||\n defaultTheme.colors.success.foreground,\n border:\n computedStyle.getPropertyValue('--malachite-success-border').trim() ||\n defaultTheme.colors.success.border,\n borderHover:\n computedStyle.getPropertyValue('--malachite-success-border-hover').trim() ||\n defaultTheme.colors.success.borderHover,\n backgroundGlass:\n computedStyle.getPropertyValue('--malachite-success-background-glass').trim() ||\n defaultTheme.colors.success.backgroundGlass,\n shadowLight:\n computedStyle.getPropertyValue('--malachite-success-shadow-light').trim() ||\n defaultTheme.colors.success.shadowLight,\n shadowMedium:\n computedStyle.getPropertyValue('--malachite-success-shadow-medium').trim() ||\n defaultTheme.colors.success.shadowMedium,\n },\n warning: {\n background:\n computedStyle.getPropertyValue('--malachite-warning-background').trim() ||\n defaultTheme.colors.warning.background,\n foreground:\n computedStyle.getPropertyValue('--malachite-warning-foreground').trim() ||\n defaultTheme.colors.warning.foreground,\n border:\n computedStyle.getPropertyValue('--malachite-warning-border').trim() ||\n defaultTheme.colors.warning.border,\n borderHover:\n computedStyle.getPropertyValue('--malachite-warning-border-hover').trim() ||\n defaultTheme.colors.warning.borderHover,\n backgroundGlass:\n computedStyle.getPropertyValue('--malachite-warning-background-glass').trim() ||\n defaultTheme.colors.warning.backgroundGlass,\n shadowLight:\n computedStyle.getPropertyValue('--malachite-warning-shadow-light').trim() ||\n defaultTheme.colors.warning.shadowLight,\n shadowMedium:\n computedStyle.getPropertyValue('--malachite-warning-shadow-medium').trim() ||\n defaultTheme.colors.warning.shadowMedium,\n },\n error: {\n background:\n computedStyle.getPropertyValue('--malachite-error-background').trim() ||\n defaultTheme.colors.error.background,\n foreground:\n computedStyle.getPropertyValue('--malachite-error-foreground').trim() ||\n defaultTheme.colors.error.foreground,\n border:\n computedStyle.getPropertyValue('--malachite-error-border').trim() ||\n defaultTheme.colors.error.border,\n borderHover:\n computedStyle.getPropertyValue('--malachite-error-border-hover').trim() ||\n defaultTheme.colors.error.borderHover,\n backgroundGlass:\n computedStyle.getPropertyValue('--malachite-error-background-glass').trim() ||\n defaultTheme.colors.error.backgroundGlass,\n shadowLight:\n computedStyle.getPropertyValue('--malachite-error-shadow-light').trim() ||\n defaultTheme.colors.error.shadowLight,\n shadowMedium:\n computedStyle.getPropertyValue('--malachite-error-shadow-medium').trim() ||\n defaultTheme.colors.error.shadowMedium,\n },\n buttonList: {\n background:\n computedStyle.getPropertyValue('--malachite-buttonlist-background').trim() ||\n defaultTheme.colors.buttonList.background,\n foreground:\n computedStyle.getPropertyValue('--malachite-buttonlist-foreground').trim() ||\n defaultTheme.colors.buttonList.foreground,\n hoverBackground:\n computedStyle\n .getPropertyValue('--malachite-buttonlist-hover-background')\n .trim() || defaultTheme.colors.buttonList.hoverBackground,\n hoverForeground:\n computedStyle\n .getPropertyValue('--malachite-buttonlist-hover-foreground')\n .trim() || defaultTheme.colors.buttonList.hoverForeground,\n },\n pillButton: {\n background:\n computedStyle.getPropertyValue('--malachite-pillbutton-background').trim() ||\n defaultTheme.colors.pillButton.background,\n foreground:\n computedStyle.getPropertyValue('--malachite-pillbutton-foreground').trim() ||\n defaultTheme.colors.pillButton.foreground,\n hoverBackground:\n computedStyle\n .getPropertyValue('--malachite-pillbutton-hover-background')\n .trim() || defaultTheme.colors.pillButton.hoverBackground,\n hoverForeground:\n computedStyle\n .getPropertyValue('--malachite-pillbutton-hover-foreground')\n .trim() || defaultTheme.colors.pillButton.hoverForeground,\n pressedBackground:\n computedStyle\n .getPropertyValue('--malachite-pillbutton-pressed-background')\n .trim() || defaultTheme.colors.pillButton.pressedBackground,\n pressedForeground:\n computedStyle\n .getPropertyValue('--malachite-pillbutton-pressed-foreground')\n .trim() || defaultTheme.colors.pillButton.pressedForeground,\n pressedOpacity:\n computedStyle\n .getPropertyValue('--malachite-pillbutton-pressed-opacity')\n .trim() || defaultTheme.colors.pillButton.pressedOpacity,\n activeBackground:\n computedStyle\n .getPropertyValue('--malachite-pillbutton-active-background')\n .trim() || defaultTheme.colors.pillButton.activeBackground,\n activeForeground:\n computedStyle\n .getPropertyValue('--malachite-pillbutton-active-foreground')\n .trim() || defaultTheme.colors.pillButton.activeForeground,\n staticBackground:\n computedStyle\n .getPropertyValue('--malachite-pillbutton-static-background')\n .trim() || defaultTheme.colors.pillButton.staticBackground,\n staticForeground:\n computedStyle\n .getPropertyValue('--malachite-pillbutton-static-foreground')\n .trim() || defaultTheme.colors.pillButton.staticForeground,\n invertedBackground:\n computedStyle\n .getPropertyValue('--malachite-pillbutton-inverted-background')\n .trim() || defaultTheme.colors.pillButton.invertedBackground,\n invertedForeground:\n computedStyle\n .getPropertyValue('--malachite-pillbutton-inverted-foreground')\n .trim() || defaultTheme.colors.pillButton.invertedForeground,\n invertedHoverBackground:\n computedStyle\n .getPropertyValue('--malachite-pillbutton-inverted-hover-background')\n .trim() || defaultTheme.colors.pillButton.invertedHoverBackground,\n invertedHoverForeground:\n computedStyle\n .getPropertyValue('--malachite-pillbutton-inverted-hover-foreground')\n .trim() || defaultTheme.colors.pillButton.invertedHoverForeground,\n invertedPressedBackground:\n computedStyle\n .getPropertyValue('--malachite-pillbutton-inverted-pressed-background')\n .trim() || defaultTheme.colors.pillButton.invertedPressedBackground,\n invertedPressedForeground:\n computedStyle\n .getPropertyValue('--malachite-pillbutton-inverted-pressed-foreground')\n .trim() || defaultTheme.colors.pillButton.invertedPressedForeground,\n },\n toggle: {\n track:\n computedStyle.getPropertyValue('--malachite-toggle-track').trim() ||\n defaultTheme.colors.toggle.track,\n trackChecked:\n computedStyle.getPropertyValue('--malachite-toggle-track-checked').trim() ||\n defaultTheme.colors.toggle.trackChecked,\n trackCheckedPending:\n computedStyle\n .getPropertyValue('--malachite-toggle-track-checked-pending')\n .trim() || defaultTheme.colors.toggle.trackCheckedPending,\n knob:\n computedStyle.getPropertyValue('--malachite-toggle-knob').trim() ||\n defaultTheme.colors.toggle.knob,\n },\n segmentedControl: {\n trackBackground:\n computedStyle\n .getPropertyValue('--malachite-segmented-control-track-background')\n .trim() || defaultTheme.colors.segmentedControl.trackBackground,\n itemForeground:\n computedStyle\n .getPropertyValue('--malachite-segmented-control-item-foreground')\n .trim() || defaultTheme.colors.segmentedControl.itemForeground,\n itemHoverForeground:\n computedStyle\n .getPropertyValue('--malachite-segmented-control-item-hover-foreground')\n .trim() || defaultTheme.colors.segmentedControl.itemHoverForeground,\n selectedBackground:\n computedStyle\n .getPropertyValue('--malachite-segmented-control-selected-background')\n .trim() || defaultTheme.colors.segmentedControl.selectedBackground,\n selectedForeground:\n computedStyle\n .getPropertyValue('--malachite-segmented-control-selected-foreground')\n .trim() || defaultTheme.colors.segmentedControl.selectedForeground,\n selectedShadow:\n computedStyle\n .getPropertyValue('--malachite-segmented-control-selected-shadow')\n .trim() || defaultTheme.colors.segmentedControl.selectedShadow,\n },\n selectableCard: {\n background:\n computedStyle\n .getPropertyValue('--malachite-selectable-card-background')\n .trim() || defaultTheme.colors.selectableCard.background,\n border:\n computedStyle.getPropertyValue('--malachite-selectable-card-border').trim() ||\n defaultTheme.colors.selectableCard.border,\n selectedTint:\n computedStyle\n .getPropertyValue('--malachite-selectable-card-selected-tint')\n .trim() || defaultTheme.colors.selectableCard.selectedTint,\n selectedSurfaceEnd:\n computedStyle\n .getPropertyValue('--malachite-selectable-card-selected-surface-end')\n .trim() || defaultTheme.colors.selectableCard.selectedSurfaceEnd,\n selectedBorder:\n computedStyle\n .getPropertyValue('--malachite-selectable-card-selected-border')\n .trim() || defaultTheme.colors.selectableCard.selectedBorder,\n librarySelectedTint:\n computedStyle\n .getPropertyValue('--malachite-selectable-card-library-selected-tint')\n .trim() || defaultTheme.colors.selectableCard.librarySelectedTint,\n librarySelectedBorder:\n computedStyle\n .getPropertyValue('--malachite-selectable-card-library-selected-border')\n .trim() || defaultTheme.colors.selectableCard.librarySelectedBorder,\n editingTint:\n computedStyle\n .getPropertyValue('--malachite-selectable-card-editing-tint')\n .trim() || defaultTheme.colors.selectableCard.editingTint,\n accent:\n computedStyle.getPropertyValue('--malachite-selectable-card-accent').trim() ||\n defaultTheme.colors.selectableCard.accent,\n mutedForeground:\n computedStyle\n .getPropertyValue('--malachite-selectable-card-muted-foreground')\n .trim() || defaultTheme.colors.selectableCard.mutedForeground,\n hoverBackground:\n computedStyle\n .getPropertyValue('--malachite-selectable-card-hover-background')\n .trim() || defaultTheme.colors.selectableCard.hoverBackground,\n hoverRule:\n computedStyle\n .getPropertyValue('--malachite-selectable-card-hover-rule')\n .trim() || defaultTheme.colors.selectableCard.hoverRule,\n pendingForeground:\n computedStyle\n .getPropertyValue('--malachite-selectable-card-pending-foreground')\n .trim() || defaultTheme.colors.selectableCard.pendingForeground,\n },\n cardStrip: {\n background:\n computedStyle.getPropertyValue('--malachite-card-strip-background').trim() ||\n defaultTheme.colors.cardStrip.background,\n divider:\n computedStyle.getPropertyValue('--malachite-card-strip-divider').trim() ||\n defaultTheme.colors.cardStrip.divider,\n fade:\n computedStyle.getPropertyValue('--malachite-card-strip-fade').trim() ||\n defaultTheme.colors.cardStrip.fade,\n arrowBackground:\n computedStyle\n .getPropertyValue('--malachite-card-strip-arrow-background')\n .trim() || defaultTheme.colors.cardStrip.arrowBackground,\n arrowBorder:\n computedStyle.getPropertyValue('--malachite-card-strip-arrow-border').trim() ||\n defaultTheme.colors.cardStrip.arrowBorder,\n addPrimaryBackground:\n computedStyle\n .getPropertyValue('--malachite-card-strip-add-primary-background')\n .trim() || defaultTheme.colors.cardStrip.addPrimaryBackground,\n addPrimaryForeground:\n computedStyle\n .getPropertyValue('--malachite-card-strip-add-primary-foreground')\n .trim() || defaultTheme.colors.cardStrip.addPrimaryForeground,\n },\n selectionBar: {\n background:\n computedStyle.getPropertyValue('--malachite-selection-bar-background').trim() ||\n defaultTheme.colors.selectionBar.background,\n foreground:\n computedStyle.getPropertyValue('--malachite-selection-bar-foreground').trim() ||\n defaultTheme.colors.selectionBar.foreground,\n mutedForeground:\n computedStyle\n .getPropertyValue('--malachite-selection-bar-muted-foreground')\n .trim() || defaultTheme.colors.selectionBar.mutedForeground,\n divider:\n computedStyle.getPropertyValue('--malachite-selection-bar-divider').trim() ||\n defaultTheme.colors.selectionBar.divider,\n border:\n computedStyle.getPropertyValue('--malachite-selection-bar-border').trim() ||\n defaultTheme.colors.selectionBar.border,\n primaryBorder:\n computedStyle\n .getPropertyValue('--malachite-selection-bar-primary-border')\n .trim() || defaultTheme.colors.selectionBar.primaryBorder,\n shadow:\n computedStyle.getPropertyValue('--malachite-selection-bar-shadow').trim() ||\n defaultTheme.colors.selectionBar.shadow,\n noticeBackground:\n computedStyle\n .getPropertyValue('--malachite-selection-bar-notice-background')\n .trim() || defaultTheme.colors.selectionBar.noticeBackground,\n noticeForeground:\n computedStyle\n .getPropertyValue('--malachite-selection-bar-notice-foreground')\n .trim() || defaultTheme.colors.selectionBar.noticeForeground,\n noticeShadow:\n computedStyle\n .getPropertyValue('--malachite-selection-bar-notice-shadow')\n .trim() || defaultTheme.colors.selectionBar.noticeShadow,\n },\n inlineConfirm: {\n background:\n computedStyle\n .getPropertyValue('--malachite-inline-confirm-background')\n .trim() || defaultTheme.colors.inlineConfirm.background,\n foreground:\n computedStyle\n .getPropertyValue('--malachite-inline-confirm-foreground')\n .trim() || defaultTheme.colors.inlineConfirm.foreground,\n divider:\n computedStyle.getPropertyValue('--malachite-inline-confirm-divider').trim() ||\n defaultTheme.colors.inlineConfirm.divider,\n shadow:\n computedStyle.getPropertyValue('--malachite-inline-confirm-shadow').trim() ||\n defaultTheme.colors.inlineConfirm.shadow,\n },\n dropdown: {\n border:\n computedStyle.getPropertyValue('--malachite-dropdown-border').trim() ||\n defaultTheme.colors.dropdown.border,\n borderActive:\n computedStyle.getPropertyValue('--malachite-dropdown-border-active').trim() ||\n defaultTheme.colors.dropdown.borderActive,\n borderFilter:\n computedStyle.getPropertyValue('--malachite-dropdown-border-filter').trim() ||\n defaultTheme.colors.dropdown.borderFilter,\n borderError:\n computedStyle.getPropertyValue('--malachite-dropdown-border-error').trim() ||\n defaultTheme.colors.dropdown.borderError,\n borderPending:\n computedStyle.getPropertyValue('--malachite-dropdown-border-pending').trim() ||\n defaultTheme.colors.dropdown.borderPending,\n shadow:\n computedStyle.getPropertyValue('--malachite-dropdown-shadow').trim() ||\n defaultTheme.colors.dropdown.shadow,\n shadowHover:\n computedStyle.getPropertyValue('--malachite-dropdown-shadow-hover').trim() ||\n defaultTheme.colors.dropdown.shadowHover,\n shadowActive:\n computedStyle.getPropertyValue('--malachite-dropdown-shadow-active').trim() ||\n defaultTheme.colors.dropdown.shadowActive,\n shadowFilter:\n computedStyle.getPropertyValue('--malachite-dropdown-shadow-filter').trim() ||\n defaultTheme.colors.dropdown.shadowFilter,\n shadowError:\n computedStyle.getPropertyValue('--malachite-dropdown-shadow-error').trim() ||\n defaultTheme.colors.dropdown.shadowError,\n shadowPending:\n computedStyle.getPropertyValue('--malachite-dropdown-shadow-pending').trim() ||\n defaultTheme.colors.dropdown.shadowPending,\n disabledBackground:\n computedStyle\n .getPropertyValue('--malachite-dropdown-disabled-background')\n .trim() || defaultTheme.colors.dropdown.disabledBackground,\n },\n tag: {\n primary: {\n background:\n computedStyle\n .getPropertyValue('--malachite-tag-primary-background')\n .trim() || defaultTheme.colors.tag.primary.background,\n foreground:\n computedStyle\n .getPropertyValue('--malachite-tag-primary-foreground')\n .trim() || defaultTheme.colors.tag.primary.foreground,\n border:\n computedStyle.getPropertyValue('--malachite-tag-primary-border').trim() ||\n defaultTheme.colors.tag.primary.border,\n shadow:\n computedStyle.getPropertyValue('--malachite-tag-primary-shadow').trim() ||\n defaultTheme.colors.tag.primary.shadow,\n },\n secondary: {\n background:\n computedStyle\n .getPropertyValue('--malachite-tag-secondary-background')\n .trim() || defaultTheme.colors.tag.secondary.background,\n foreground:\n computedStyle\n .getPropertyValue('--malachite-tag-secondary-foreground')\n .trim() || defaultTheme.colors.tag.secondary.foreground,\n border:\n computedStyle.getPropertyValue('--malachite-tag-secondary-border').trim() ||\n defaultTheme.colors.tag.secondary.border,\n shadow:\n computedStyle.getPropertyValue('--malachite-tag-secondary-shadow').trim() ||\n defaultTheme.colors.tag.secondary.shadow,\n },\n default: {\n background:\n computedStyle\n .getPropertyValue('--malachite-tag-default-background')\n .trim() || defaultTheme.colors.tag.default.background,\n foreground:\n computedStyle\n .getPropertyValue('--malachite-tag-default-foreground')\n .trim() || defaultTheme.colors.tag.default.foreground,\n border:\n computedStyle.getPropertyValue('--malachite-tag-default-border').trim() ||\n defaultTheme.colors.tag.default.border,\n shadow:\n computedStyle.getPropertyValue('--malachite-tag-default-shadow').trim() ||\n defaultTheme.colors.tag.default.shadow,\n },\n error: {\n background:\n computedStyle.getPropertyValue('--malachite-tag-error-background').trim() ||\n defaultTheme.colors.tag.error.background,\n foreground:\n computedStyle.getPropertyValue('--malachite-tag-error-foreground').trim() ||\n defaultTheme.colors.tag.error.foreground,\n border:\n computedStyle.getPropertyValue('--malachite-tag-error-border').trim() ||\n defaultTheme.colors.tag.error.border,\n shadow:\n computedStyle.getPropertyValue('--malachite-tag-error-shadow').trim() ||\n defaultTheme.colors.tag.error.shadow,\n },\n warning: {\n background:\n computedStyle\n .getPropertyValue('--malachite-tag-warning-background')\n .trim() || defaultTheme.colors.tag.warning.background,\n foreground:\n computedStyle\n .getPropertyValue('--malachite-tag-warning-foreground')\n .trim() || defaultTheme.colors.tag.warning.foreground,\n border:\n computedStyle.getPropertyValue('--malachite-tag-warning-border').trim() ||\n defaultTheme.colors.tag.warning.border,\n shadow:\n computedStyle.getPropertyValue('--malachite-tag-warning-shadow').trim() ||\n defaultTheme.colors.tag.warning.shadow,\n },\n success: {\n background:\n computedStyle\n .getPropertyValue('--malachite-tag-success-background')\n .trim() || defaultTheme.colors.tag.success.background,\n foreground:\n computedStyle\n .getPropertyValue('--malachite-tag-success-foreground')\n .trim() || defaultTheme.colors.tag.success.foreground,\n border:\n computedStyle.getPropertyValue('--malachite-tag-success-border').trim() ||\n defaultTheme.colors.tag.success.border,\n shadow:\n computedStyle.getPropertyValue('--malachite-tag-success-shadow').trim() ||\n defaultTheme.colors.tag.success.shadow,\n },\n emphasis: {\n background:\n computedStyle\n .getPropertyValue('--malachite-tag-emphasis-background')\n .trim() || defaultTheme.colors.tag.emphasis.background,\n foreground:\n computedStyle\n .getPropertyValue('--malachite-tag-emphasis-foreground')\n .trim() || defaultTheme.colors.tag.emphasis.foreground,\n border:\n computedStyle.getPropertyValue('--malachite-tag-emphasis-border').trim() ||\n defaultTheme.colors.tag.emphasis.border,\n shadow:\n computedStyle.getPropertyValue('--malachite-tag-emphasis-shadow').trim() ||\n defaultTheme.colors.tag.emphasis.shadow,\n },\n info: {\n background:\n computedStyle.getPropertyValue('--malachite-tag-info-background').trim() ||\n defaultTheme.colors.tag.info.background,\n foreground:\n computedStyle.getPropertyValue('--malachite-tag-info-foreground').trim() ||\n defaultTheme.colors.tag.info.foreground,\n border:\n computedStyle.getPropertyValue('--malachite-tag-info-border').trim() ||\n defaultTheme.colors.tag.info.border,\n shadow:\n computedStyle.getPropertyValue('--malachite-tag-info-shadow').trim() ||\n defaultTheme.colors.tag.info.shadow,\n },\n assistant: {\n background:\n computedStyle\n .getPropertyValue('--malachite-tag-assistant-background')\n .trim() || defaultTheme.colors.tag.assistant.background,\n foreground:\n computedStyle\n .getPropertyValue('--malachite-tag-assistant-foreground')\n .trim() || defaultTheme.colors.tag.assistant.foreground,\n border:\n computedStyle.getPropertyValue('--malachite-tag-assistant-border').trim() ||\n defaultTheme.colors.tag.assistant.border,\n shadow:\n computedStyle.getPropertyValue('--malachite-tag-assistant-shadow').trim() ||\n defaultTheme.colors.tag.assistant.shadow,\n },\n },\n numberTag: {\n background:\n computedStyle.getPropertyValue('--malachite-number-tag-background').trim() ||\n defaultTheme.colors.numberTag.background,\n foreground:\n computedStyle.getPropertyValue('--malachite-number-tag-foreground').trim() ||\n defaultTheme.colors.numberTag.foreground,\n emphasisBackground:\n computedStyle\n .getPropertyValue('--malachite-number-tag-emphasis-background')\n .trim() || defaultTheme.colors.numberTag.emphasisBackground,\n emphasisForeground:\n computedStyle\n .getPropertyValue('--malachite-number-tag-emphasis-foreground')\n .trim() || defaultTheme.colors.numberTag.emphasisForeground,\n },\n text: {\n primary:\n computedStyle.getPropertyValue('--malachite-text-primary').trim() ||\n defaultTheme.colors.text.primary,\n secondary:\n computedStyle.getPropertyValue('--malachite-text-secondary').trim() ||\n defaultTheme.colors.text.secondary,\n dimmed:\n computedStyle.getPropertyValue('--malachite-text-dimmed').trim() ||\n defaultTheme.colors.text.dimmed,\n emphasis:\n computedStyle.getPropertyValue('--malachite-text-emphasis').trim() ||\n defaultTheme.colors.text.emphasis,\n muted:\n computedStyle.getPropertyValue('--malachite-text-muted').trim() ||\n defaultTheme.colors.text.muted,\n placeholder:\n computedStyle.getPropertyValue('--malachite-text-placeholder').trim() ||\n defaultTheme.colors.text.placeholder,\n destructive:\n computedStyle.getPropertyValue('--malachite-text-destructive').trim() ||\n defaultTheme.colors.text.destructive,\n success:\n computedStyle.getPropertyValue('--malachite-text-success').trim() ||\n defaultTheme.colors.text.success,\n highlight:\n computedStyle.getPropertyValue('--malachite-text-highlight').trim() ||\n defaultTheme.colors.text.highlight,\n warning:\n computedStyle.getPropertyValue('--malachite-text-warning').trim() ||\n defaultTheme.colors.text.warning,\n warningMuted:\n computedStyle.getPropertyValue('--malachite-text-warning-muted').trim() ||\n defaultTheme.colors.text.warningMuted,\n error:\n computedStyle.getPropertyValue('--malachite-text-error').trim() ||\n defaultTheme.colors.text.error,\n info:\n computedStyle.getPropertyValue('--malachite-text-info').trim() ||\n defaultTheme.colors.text.info,\n linkForeground:\n computedStyle.getPropertyValue('--malachite-text-link-foreground').trim() ||\n defaultTheme.colors.text.linkForeground,\n linkForegroundHover:\n computedStyle\n .getPropertyValue('--malachite-text-link-foreground-hover')\n .trim() || defaultTheme.colors.text.linkForegroundHover,\n rightSideText: {\n muted:\n computedStyle\n .getPropertyValue('--malachite-text-right-side-text-muted')\n .trim() || defaultTheme.colors.text.rightSideText.muted,\n primary:\n computedStyle\n .getPropertyValue('--malachite-text-right-side-text-primary')\n .trim() || defaultTheme.colors.text.rightSideText.primary,\n alignment:\n (computedStyle\n .getPropertyValue('--malachite-text-right-side-text-alignment')\n .trim() as 'left' | 'right') ||\n defaultTheme.colors.text.rightSideText.alignment,\n fontSize:\n computedStyle\n .getPropertyValue('--malachite-text-right-side-text-font-size')\n .trim() || defaultTheme.colors.text.rightSideText.fontSize,\n minWidth:\n computedStyle\n .getPropertyValue('--malachite-text-right-side-text-min-width')\n .trim() || defaultTheme.colors.text.rightSideText.minWidth,\n },\n },\n codeBlock: {\n background:\n computedStyle.getPropertyValue('--malachite-codeblock-background').trim() ||\n defaultTheme.colors.codeBlock.background,\n foreground:\n computedStyle.getPropertyValue('--malachite-codeblock-foreground').trim() ||\n defaultTheme.colors.codeBlock.foreground,\n border:\n computedStyle.getPropertyValue('--malachite-codeblock-border').trim() ||\n defaultTheme.colors.codeBlock.border,\n lineNumber:\n computedStyle.getPropertyValue('--malachite-codeblock-line-number').trim() ||\n defaultTheme.colors.codeBlock.lineNumber,\n keyword:\n computedStyle.getPropertyValue('--malachite-codeblock-keyword').trim() ||\n defaultTheme.colors.codeBlock.keyword,\n comment:\n computedStyle.getPropertyValue('--malachite-codeblock-comment').trim() ||\n defaultTheme.colors.codeBlock.comment,\n string:\n computedStyle.getPropertyValue('--malachite-codeblock-string').trim() ||\n defaultTheme.colors.codeBlock.string,\n number:\n computedStyle.getPropertyValue('--malachite-codeblock-number').trim() ||\n defaultTheme.colors.codeBlock.number,\n type:\n computedStyle.getPropertyValue('--malachite-codeblock-type').trim() ||\n defaultTheme.colors.codeBlock.type,\n diffAddedBackground:\n computedStyle\n .getPropertyValue('--malachite-codeblock-diff-added-background')\n .trim() || defaultTheme.colors.codeBlock.diffAddedBackground,\n diffRemovedBackground:\n computedStyle\n .getPropertyValue('--malachite-codeblock-diff-removed-background')\n .trim() || defaultTheme.colors.codeBlock.diffRemovedBackground,\n diffAssistantBackground:\n computedStyle\n .getPropertyValue('--malachite-codeblock-diff-assistant-background')\n .trim() || defaultTheme.colors.codeBlock.diffAssistantBackground,\n diffAssistantForeground:\n computedStyle\n .getPropertyValue('--malachite-codeblock-diff-assistant-foreground')\n .trim() || defaultTheme.colors.codeBlock.diffAssistantForeground,\n diffAssistantRemovedBackground:\n computedStyle\n .getPropertyValue('--malachite-codeblock-diff-assistant-removed-background')\n .trim() || defaultTheme.colors.codeBlock.diffAssistantRemovedBackground,\n diffRemovedForeground:\n computedStyle\n .getPropertyValue('--malachite-codeblock-diff-removed-foreground')\n .trim() || defaultTheme.colors.codeBlock.diffRemovedForeground,\n diffContextForeground:\n computedStyle\n .getPropertyValue('--malachite-codeblock-diff-context-foreground')\n .trim() || defaultTheme.colors.codeBlock.diffContextForeground,\n diffContextText:\n computedStyle\n .getPropertyValue('--malachite-codeblock-diff-context-text')\n .trim() || defaultTheme.colors.codeBlock.diffContextText,\n },\n chat: {\n userBubbleBackground:\n computedStyle\n .getPropertyValue('--malachite-chat-user-bubble-background')\n .trim() || defaultTheme.colors.chat.userBubbleBackground,\n userBubbleBorder:\n computedStyle.getPropertyValue('--malachite-chat-user-bubble-border').trim() ||\n defaultTheme.colors.chat.userBubbleBorder,\n assistantBubbleBackground:\n computedStyle\n .getPropertyValue('--malachite-chat-assistant-bubble-background')\n .trim() || defaultTheme.colors.chat.assistantBubbleBackground,\n assistantBubbleBorder:\n computedStyle\n .getPropertyValue('--malachite-chat-assistant-bubble-border')\n .trim() || defaultTheme.colors.chat.assistantBubbleBorder,\n assistantBubbleForeground:\n computedStyle\n .getPropertyValue('--malachite-chat-assistant-bubble-foreground')\n .trim() || defaultTheme.colors.chat.assistantBubbleForeground,\n },\n assistant: {\n foreground:\n computedStyle.getPropertyValue('--malachite-assistant-foreground').trim() ||\n defaultTheme.colors.assistant.foreground,\n surfaceBackground:\n computedStyle\n .getPropertyValue('--malachite-assistant-surface-background')\n .trim() || defaultTheme.colors.assistant.surfaceBackground,\n surfaceBorder:\n computedStyle.getPropertyValue('--malachite-assistant-surface-border').trim() ||\n defaultTheme.colors.assistant.surfaceBorder,\n surfaceForeground:\n computedStyle\n .getPropertyValue('--malachite-assistant-surface-foreground')\n .trim() || defaultTheme.colors.assistant.surfaceForeground,\n },\n table: {\n background:\n computedStyle.getPropertyValue('--malachite-table-background').trim() ||\n defaultTheme.colors.table.background,\n boxShadow:\n computedStyle.getPropertyValue('--malachite-table-box-shadow').trim() ||\n defaultTheme.colors.table.boxShadow,\n header: {\n background:\n computedStyle\n .getPropertyValue('--malachite-table-header-background')\n .trim() || defaultTheme.colors.table.header.background,\n foreground:\n computedStyle\n .getPropertyValue('--malachite-table-header-foreground')\n .trim() || defaultTheme.colors.table.header.foreground,\n border:\n computedStyle.getPropertyValue('--malachite-table-header-border').trim() ||\n defaultTheme.colors.table.header.border,\n },\n row: {\n background:\n computedStyle.getPropertyValue('--malachite-table-row-background').trim() ||\n defaultTheme.colors.table.row.background,\n foreground:\n computedStyle.getPropertyValue('--malachite-table-row-foreground').trim() ||\n defaultTheme.colors.table.row.foreground,\n hoverBackground:\n computedStyle\n .getPropertyValue('--malachite-table-row-hover-background')\n .trim() || defaultTheme.colors.table.row.hoverBackground,\n border:\n computedStyle.getPropertyValue('--malachite-table-row-border').trim() ||\n defaultTheme.colors.table.row.border,\n selectedBackground:\n computedStyle\n .getPropertyValue('--malachite-table-row-selected-background')\n .trim() || defaultTheme.colors.table.row.selectedBackground,\n selectedAccent:\n computedStyle\n .getPropertyValue('--malachite-table-row-selected-accent')\n .trim() || defaultTheme.colors.table.row.selectedAccent,\n selectedForeground:\n computedStyle\n .getPropertyValue('--malachite-table-row-selected-foreground')\n .trim() || defaultTheme.colors.table.row.selectedForeground,\n },\n border:\n computedStyle.getPropertyValue('--malachite-table-border').trim() ||\n defaultTheme.colors.table.border,\n borderedRow: {\n background:\n computedStyle\n .getPropertyValue('--malachite-table-borderedRow-background')\n .trim() || defaultTheme.colors.table.borderedRow.background,\n outline:\n computedStyle\n .getPropertyValue('--malachite-table-borderedRow-outline')\n .trim() || defaultTheme.colors.table.borderedRow.outline,\n },\n rowVariant: {\n success: {\n background:\n computedStyle\n .getPropertyValue(\n '--malachite-table-row-variant-success-background',\n )\n .trim() || defaultTheme.colors.table.rowVariant.success.background,\n },\n warning: {\n background:\n computedStyle\n .getPropertyValue(\n '--malachite-table-row-variant-warning-background',\n )\n .trim() || defaultTheme.colors.table.rowVariant.warning.background,\n },\n error: {\n background:\n computedStyle\n .getPropertyValue('--malachite-table-row-variant-error-background')\n .trim() || defaultTheme.colors.table.rowVariant.error.background,\n },\n info: {\n background:\n computedStyle\n .getPropertyValue('--malachite-table-row-variant-info-background')\n .trim() || defaultTheme.colors.table.rowVariant.info.background,\n },\n },\n error: {\n iconBackground:\n computedStyle\n .getPropertyValue('--malachite-table-error-icon-background')\n .trim() || defaultTheme.colors.table.error.iconBackground,\n iconForeground:\n computedStyle\n .getPropertyValue('--malachite-table-error-icon-foreground')\n .trim() || defaultTheme.colors.table.error.iconForeground,\n titleForeground:\n computedStyle\n .getPropertyValue('--malachite-table-error-title-foreground')\n .trim() || defaultTheme.colors.table.error.titleForeground,\n subtitleForeground:\n computedStyle\n .getPropertyValue('--malachite-table-error-subtitle-foreground')\n .trim() || defaultTheme.colors.table.error.subtitleForeground,\n },\n },\n },\n };\n}\n\nlet themeInitialized = false;\n\n/**\n * Applies the document-level theme once per page. Called from ShadowRootWrapper rather than\n * run at import: a bare top-level call is an import-time side effect, and `sideEffects: false`\n * in package.json tells a consumer's bundler it may drop a module nothing imports from, which\n * would take the theme with it. A consumer wanting the document themed without mounting any\n * Malachite component calls `initializeTheme()` directly.\n */\nexport const ensureThemeInitialized = (): void => {\n if (themeInitialized) {\n return;\n }\n themeInitialized = true;\n initializeTheme();\n};\n"],"names":["DATE_PICKER_TOKENS","datePickerVar","key","DEFAULT_ACCENT_COLORS","DEFAULT_ACCENT_SHADOW","CONTROL_HEIGHT","defaultTheme","darkTheme","THEME_MODE_KEY","CUSTOM_THEME_KEY","SAFE_CUSTOM_PROPERTY","UNSAFE_CSS_SYNTAX","SAFE_THEME_KEY","sanitizeThemeInput","value","path","sanitized","child","childPath","sanitizedChild","registeredShadowRoots","registerShadowRoot","shadowRoot","applyCurrentThemeToShadowRoot","error","unregisterShadowRoot","TABLE_KEBAB_KEYS","processTableColorProperties","tableColors","prefix","addProperty","parentKeyVar","subKey","subValue","kebabKey","deepKey","deepValue","deepKebabKey","applyCSSCustomProperties","theme","target","accentColors","datePickerColors","shadows","styleElement","properties","alertType","alertColors","tagType","tagColors","nestedKey","nestedValue","nestedKebabKey","variant","variantColors","safeProperties","declaration","candidate","name","currentMode","getCurrentThemeMode","customTheme","getCustomTheme","baseTheme","finalTheme","mergeThemes","stored","saveThemeMode","mode","saveCustomTheme","base","customInput","custom","result","rightSideText","flat","header","row","borderedRow","rowVariant","merged","applyTheme","applyThemeVars","applyLightTheme","applyDarkTheme","toggleTheme","applyCustomTheme","resetTheme","initializeTheme","getCurrentTheme","computedStyle","datePicker","themeInitialized","ensureThemeInitialized"],"mappings":"AAGA,MAAMA,IAAqB;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACJ,GAIMC,IAAgB,CAACC,MACnB,2BAA2BA,EAAI,QAAQ,YAAY,KAAK,EAAE,YAAA,CAAa,IAygBrEC,IAAyE;AAAA,EAC3E,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,iBAAiB;AACrB,GACMC,IAAwB,2CAIjBC,IAAiB;AAAA,EAC1B,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,OAAO;AACX,GAGaC,IAA+B;AAAA,EACxC,WAAW;AAAA,IACP,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,IAAM;AAAA,IACN,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,SAAS;AAAA,EAAA;AAAA,EAEb,gBAAgB,EAAE,GAAGD,EAAA;AAAA,EACrB,WAAW;AAAA,IACP,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,OAAO;AAAA,EAAA;AAAA,EAEX,QAAQ;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAM;AAAA,IACN,IAAI;AAAA,IACJ,KAAK;AAAA,IACL,MAAM;AAAA,EAAA;AAAA,EAEV,SAAS;AAAA,IACL,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,QAAQD;AAAA,IACR,SAAS;AAAA,IACT,SAAS;AAAA,IACT,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