'use strict';

var checkMarkerInSeries = require('./checkMarkerInSeries.js');
var MarkAreaModel = require('./MarkAreaModel.js');
var MarkAreaView = require('./MarkAreaView.js');

function install(registers) {
  registers.registerComponentModel(MarkAreaModel.default);
  registers.registerComponentView(MarkAreaView.default);
  registers.registerPreprocessor(function (opt) {
    if (checkMarkerInSeries.default(opt.series, 'markArea')) {
      // Make sure markArea component is enabled
      opt.markArea = opt.markArea || {};
    }
  });
}

exports.install = install;
