import { __extends } from '../../../../../../tslib@2.3.0/node_modules/tslib/tslib.es6.mjs';
import ComponentModel from '../../model/Component.mjs';
import ComponentView from '../../view/Component.mjs';
import { SERIES_LAYOUT_BY_COLUMN } from '../../util/types.mjs';
import { SourceManager, disableTransformOptionMerge } from '../../data/helper/sourceManager.mjs';

var DatasetModel = /** @class */function (_super) {
  __extends(DatasetModel, _super);
  function DatasetModel() {
    var _this = _super !== null && _super.apply(this, arguments) || this;
    _this.type = 'dataset';
    return _this;
  }
  DatasetModel.prototype.init = function (option, parentModel, ecModel) {
    _super.prototype.init.call(this, option, parentModel, ecModel);
    this._sourceManager = new SourceManager(this);
    disableTransformOptionMerge(this);
  };
  DatasetModel.prototype.mergeOption = function (newOption, ecModel) {
    _super.prototype.mergeOption.call(this, newOption, ecModel);
    disableTransformOptionMerge(this);
  };
  DatasetModel.prototype.optionUpdated = function () {
    this._sourceManager.dirty();
  };
  DatasetModel.prototype.getSourceManager = function () {
    return this._sourceManager;
  };
  DatasetModel.type = 'dataset';
  DatasetModel.defaultOption = {
    seriesLayoutBy: SERIES_LAYOUT_BY_COLUMN
  };
  return DatasetModel;
}(ComponentModel);
var DatasetView = /** @class */function (_super) {
  __extends(DatasetView, _super);
  function DatasetView() {
    var _this = _super !== null && _super.apply(this, arguments) || this;
    _this.type = 'dataset';
    return _this;
  }
  DatasetView.type = 'dataset';
  return DatasetView;
}(ComponentView);
function install(registers) {
  registers.registerComponentModel(DatasetModel);
  registers.registerComponentView(DatasetView);
}

export { DatasetModel, install };
