text: "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  var dependents_1 = require("../../dependents");
  var util_1 = require("@antv/util");
  var theme_1 = require("../../theme");
  var theme_2 = require("../../util/responsive/theme");
  var theme_3 = require("../../theme/theme");
  /**
   * 负责图表theme的管理
   */
  var G2DefaultTheme = dependents_1.getTheme();
  var ThemeController = /** @class */ (function () {
      function ThemeController() {
      }
      /**
       * 获取指定的全局theme
       * @param theme
       */
      ThemeController.getGlobalTheme = function (theme) {
          if (util_1.isString(theme)) {
              return theme_1.getGlobalTheme(theme);
          }
          return util_1.deepMix({}, theme_1.getGlobalTheme(), theme);
      };
      /**
       * 通过 theme 和图表类型，获取当前 plot 对应的主题
       * @param props
       * @param type
       */
      ThemeController.prototype.getPlotTheme = function (props, type) {
          var theme = props.theme;
          if (util_1.isString(theme)) {
              return util_1.deepMix({}, theme_1.getGlobalTheme(theme), theme_1.getTheme(type));
          }
          return util_1.deepMix({}, theme_1.getGlobalTheme(), theme_1.getTheme(type), theme_3.convertThemeToG2Theme(type, theme));
      };
      /**
       * 获取转化成 G2 的结构主题
       * @param props
       * @param type
       */
      ThemeController.prototype.getTheme = function (props, type) {
          var plotG2Theme = theme_1.convertToG2Theme(this.getPlotTheme(props, type));
          var g2Theme = util_1.deepMix({}, G2DefaultTheme, plotG2Theme);
          return g2Theme;
      };
      ThemeController.prototype.getResponsiveTheme = function (type) {
          return theme_2.getResponsiveTheme(type) || theme_2.getResponsiveTheme('default');
      };
      return ThemeController;
  }());
  exports.default = ThemeController;
  //# sourceMappingURL=theme.js.map