import { V as VegaInternalThemeManager } from './dark-mode-style-controller-1615519f.js';
import './global-slimmer-registry-0a7aa308.js';
import { I as InjectVegaTelemetrySlimmer, c as createPublicAPIRuntimeMetricsSlimmer } from './create-public-api-runtime-metrics-slimmer-407de188.js';
import './static-subject-title-52f93124.js';
import './change-manager-ecbd3a2a.js';
import './observer-3959f9dd.js';
import './tinycolor-polyfill-7be0eb93.js';
import './vega-nonce-manager-209a4c0a.js';
import './try-get-document-bef0f526.js';
import './index-3b327f29.js';
import './dynamic-slimmer-60d5da5a.js';
import './misc-9fdbcfbb.js';

const ThemeManagerRuntimeMetricsPayloadDefinition = [
  {
    payloadKey: 'IS_OVERRIDECOLORS_METHOD_CALLED',
    payloadDescription: 'Indicate if the method overrideColors of public API ThemeManager is called',
    /**
     * Indicate whether the method is collected when the method been called .
     *
     * @param {string} scope - The class name of public api
     * @param {string} methodName - The method name called by the public api
     * @returns {boolean} A boolean value
     */
    canAccept: (scope, methodName) => scope === 'ThemeManager' && methodName === 'overrideColors',
    /**
     * The function checks if the method is be called.
     *
     * @returns {boolean} A boolean value
     */
    payloadValue: () => {
      return true;
    },
  },
  {
    payloadKey: 'IS_RESET_METHOD_CALLED',
    payloadDescription: 'Indicate if the method reset of public API ThemeManager is called',
    /**
     * Indicate whether the method is collected when the method been called .
     *
     * @param {string} scope - The class name of public api
     * @param {string} methodName - The method name called by the public api
     * @returns {boolean} A boolean value
     */
    canAccept: (scope, methodName) => scope === 'ThemeManager' && methodName === 'reset',
    /**
     * The function checks if the method is be called.
     *
     * @returns {boolean} A boolean value
     */
    payloadValue: () => {
      return true;
    },
  },
  {
    payloadKey: 'IS_TOGGLEDARKMODE_METHOD_CALLED',
    payloadDescription: 'Indicate if the method toggleDarkMode of public API ThemeManager is called',
    /**
     * Indicate whether the method is collected when the method been called .
     *
     * @param {string} scope - The class name of public api
     * @param {string} methodName - The method name called by the public api
     * @returns {boolean} A boolean value
     */
    canAccept: (scope, methodName) => scope === 'ThemeManager' && methodName === 'toggleDarkMode',
    /**
     * The function checks if the method is be called.
     *
     * @returns {boolean} A boolean value
     */
    payloadValue: () => {
      return true;
    },
  },
  {
    payloadKey: 'IS_ISDARKMODE_METHOD_CALLED',
    payloadDescription: 'Indicate if the method isDarkMode of public API ThemeManager is called',
    /**
     * Indicate whether the method is collected when the method been called .
     *
     * @param {string} scope - The class name of public api
     * @param {string} methodName - The method name called by the public api
     * @returns {boolean} A boolean value
     */
    canAccept: (scope, methodName) => scope === 'ThemeManager' && methodName === 'isDarkMode',
    /**
     * The function checks if the method is be called.
     *
     * @returns {boolean} A boolean value
     */
    payloadValue: () => {
      return true;
    },
  },
  {
    payloadKey: 'IS_APPLY_BRANDING_METHOD_CALLED',
    payloadDescription: 'Indicate if the method applyBranding of public API ThemeManager is called',
    /**
     * Indicate whether the method is collected when the method been called .
     *
     * @param {string} scope - The class name of public api
     * @param {string} methodName - The method name called by the public api
     * @returns {boolean} A boolean value
     */
    canAccept: (scope, methodName) => scope === 'ThemeManager' && methodName === 'applyBranding',
    /**
     * The function checks if the method is be called.
     *
     * @returns {boolean} A boolean value
     */
    payloadValue: () => {
      return true;
    },
  },
];

var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  return c > 3 && r && Object.defineProperty(target, key, r), r;
};
/**
 * Vega components theme manager
 */
class ThemeManager {
  constructor() {
    this.vegaPublicAPIRuntimeMetricsSlimmer = createPublicAPIRuntimeMetricsSlimmer(ThemeManager, ['overrideColors', 'reset', 'toggleDarkMode', 'isDarkMode', 'applyBranding'], ThemeManagerRuntimeMetricsPayloadDefinition);
  }
  /**
   * It takes the colors you passed in, parses them into the correct format, and then applies them to the theme
   *
   * @param {VegaThemeOverrideColors} overrideColors - OverrideColors - This is the object that you pass to the function.
   * @vegaVersion 1.20.0
   */
  async overrideColors(overrideColors) {
    void VegaInternalThemeManager.overrideColors(overrideColors);
  }
  /**
   * It removes all the custom override theme styles from the DOM
   *
   * @vegaVersion 1.20.0
   */
  async reset() {
    void VegaInternalThemeManager.reset();
  }
  /**
   * This function toggles the dark mode of a webpage by adding or removing a 'dark' class to the HTML element.
   *
   * @param {boolean | undefined} darkMode - A boolean or undefined value that determines whether to enable or disable dark mode.
   * If it is true, dark mode is enabled.
   * If it is false, dark mode is disabled.
   * @vegaVersion 1.32.0
   */
  toggleDarkMode(darkMode) {
    VegaInternalThemeManager.toggleDarkMode(darkMode);
  }
  /**
   * The function checks if the HTML element has a class of "dark" and returns a boolean value accordingly.
   *
   * @returns {boolean} A boolean value indicating whether the HTML element has a class of "dark", which is
   * typically used to indicate that the website is in dark mode.
   * @vegaVersion 1.32.0
   */
  isDarkMode() {
    return VegaInternalThemeManager.isDarkMode();
  }
  /**
   * This function switches the Vega theme to a brand theme based on the provided options.
   *
   * @param {BrandOptions} options - The options includes 'gp', 'genius' and 'heartland' options
   * @vegaVersion 2.47.0
   */
  applyBranding(options) {
    VegaInternalThemeManager.applyBranding(options);
  }
}
__decorate([
  InjectVegaTelemetrySlimmer()
], ThemeManager.prototype, "vegaPublicAPIRuntimeMetricsSlimmer", void 0);
const VegaThemeManager = new ThemeManager();

export { VegaThemeManager };
