'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var tslib_es6 = require('../../../../../../tslib@2.3.0/node_modules/tslib/tslib.es6.js');
var util = require('../../../../../../zrender@6.0.0/node_modules/zrender/lib/core/util.js');
var featureManager = require('./featureManager.js');
var Component = require('../../model/Component.js');
var tokens = require('../../visual/tokens.js');

var ToolboxModel = /** @class */function (_super) {
  tslib_es6.__extends(ToolboxModel, _super);
  function ToolboxModel() {
    var _this = _super !== null && _super.apply(this, arguments) || this;
    _this.type = ToolboxModel.type;
    return _this;
  }
  ToolboxModel.prototype.optionUpdated = function () {
    _super.prototype.optionUpdated.apply(this, arguments);
    var ecModel = this.ecModel;
    util.each(this.option.feature, function (featureOpt, featureName) {
      var Feature = featureManager.getFeature(featureName);
      if (Feature) {
        if (Feature.getDefaultOption) {
          Feature.defaultOption = Feature.getDefaultOption(ecModel);
        }
        util.merge(featureOpt, Feature.defaultOption);
      }
    });
  };
  ToolboxModel.type = 'toolbox';
  ToolboxModel.layoutMode = {
    type: 'box',
    ignoreSize: true
  };
  ToolboxModel.defaultOption = {
    show: true,
    z: 6,
    // zlevel: 0,
    orient: 'horizontal',
    left: 'right',
    top: 'top',
    // right
    // bottom
    backgroundColor: 'transparent',
    borderColor: tokens.default.color.border,
    borderRadius: 0,
    borderWidth: 0,
    padding: tokens.default.size.m,
    itemSize: 15,
    itemGap: tokens.default.size.s,
    showTitle: true,
    iconStyle: {
      borderColor: tokens.default.color.accent50,
      color: 'none'
    },
    emphasis: {
      iconStyle: {
        borderColor: tokens.default.color.accent50
      }
    },
    // textStyle: {},
    // feature
    tooltip: {
      show: false,
      position: 'bottom'
    }
  };
  return ToolboxModel;
}(Component.default);

exports.default = ToolboxModel;
