function getEffectiveTheme(theme = null) {
  // eslint-disable-next-line no-underscore-dangle
  const _theme = theme || assistantConfig.theme;

  if (['light', 'dark'].includes(_theme)) {
    return _theme;
  }

  if (_theme === 'system') {
    if (window.matchMedia('(prefers-color-scheme: light)').matches) {
      return 'light';
    }
  }

  return 'dark';
}
Returns effective theme based on `assistantConfig.theme`.
If the theme is set to `"system"`, it returns
the system theme.

@param {"dark" | "light" | "system"} theme
Get the effective theme for given theme
explicitly. Leave it blank to infer from
`assistantConfig.theme`

@returns {string}
Effective theme based on config and system preferences