import { __extends } from '../../../../../../tslib@2.3.0/node_modules/tslib/tslib.es6.mjs';
import { each, merge } from '../../../../../../zrender@6.0.0/node_modules/zrender/lib/core/util.mjs';
import { getFeature } from './featureManager.mjs';
import ComponentModel from '../../model/Component.mjs';
import tokens from '../../visual/tokens.mjs';

var ToolboxModel = /** @class */function (_super) {
  __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;
    each(this.option.feature, function (featureOpt, featureName) {
      var Feature = getFeature(featureName);
      if (Feature) {
        if (Feature.getDefaultOption) {
          Feature.defaultOption = Feature.getDefaultOption(ecModel);
        }
        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.color.border,
    borderRadius: 0,
    borderWidth: 0,
    padding: tokens.size.m,
    itemSize: 15,
    itemGap: tokens.size.s,
    showTitle: true,
    iconStyle: {
      borderColor: tokens.color.accent50,
      color: 'none'
    },
    emphasis: {
      iconStyle: {
        borderColor: tokens.color.accent50
      }
    },
    // textStyle: {},
    // feature
    tooltip: {
      show: false,
      position: 'bottom'
    }
  };
  return ToolboxModel;
}(ComponentModel);

export { ToolboxModel as default };
