text: "use strict";
  
  var _interopRequireDefault = require("@babel/runtime/helpers/builtin/interopRequireDefault");
  
  exports.__esModule = true;
  exports.default = brushes;
  
  var _isNumber2 = _interopRequireDefault(require("lodash/isNumber"));
  
  var _flatten2 = _interopRequireDefault(require("lodash/flatten"));
  
  var _map2 = _interopRequireDefault(require("lodash/map"));
  
  var _defaults = require("../chartCore/defaults");
  
  var _path2DUtils = require("../utils/path2DUtils");
  
  var _getBrushesRenderData = require("./getBrushesRenderData");
  
  var _getPlotValues = _interopRequireDefault(require("./getPlotValues"));
  
  function brushesRender(props, datum) {
    var _props$backgroundOffs = props.backgroundOffset,
        backgroundOffset = _props$backgroundOffs === void 0 ? _defaults.BACKGROUND_OFFSET : _props$backgroundOffs,
        plotRect = props.plotRect;
    var stroke = props.strokeValue;
    var fill = props.fillValue;
    var fillAlpha = props.fillAlphaValue || 0.4;
    var lineWidth = props.lineWidthValue || 3;
    var values = (0, _getPlotValues.default)(props, datum);
    var renderArgs = Object.assign({}, values, {
      plotRect: plotRect,
      backgroundOffset: backgroundOffset,
      stroke: stroke,
      fill: fill,
      fillAlpha: fillAlpha,
      lineWidth: lineWidth
    });
  
    if ((0, _isNumber2.default)(values.x1) && (0, _isNumber2.default)(values.x2) && (0, _isNumber2.default)(values.y1) && (0, _isNumber2.default)(values.y2)) {
      return [(0, _getBrushesRenderData.centerArea)(renderArgs), (0, _getBrushesRenderData.leftCenterLine)(renderArgs), (0, _getBrushesRenderData.rightCenterLine)(renderArgs), (0, _getBrushesRenderData.topCenterLine)(renderArgs), (0, _getBrushesRenderData.bottomCenterLine)(renderArgs), (0, _getBrushesRenderData.leftTopLine)(renderArgs), (0, _getBrushesRenderData.leftBottomLine)(renderArgs), (0, _getBrushesRenderData.rightTopLine)(renderArgs), (0, _getBrushesRenderData.rightBottomLine)(renderArgs)];
    } else if ((0, _isNumber2.default)(values.x1) && (0, _isNumber2.default)(values.x2)) {
      return [(0, _getBrushesRenderData.verticalArea)(renderArgs), (0, _getBrushesRenderData.leftVerticalLine)(renderArgs), (0, _getBrushesRenderData.rightVerticalLine)(renderArgs)];
    } else if ((0, _isNumber2.default)(values.y1) && (0, _isNumber2.default)(values.y2)) {
      return [(0, _getBrushesRenderData.horizontalArea)(renderArgs), (0, _getBrushesRenderData.topHorizontalLine)(renderArgs), (0, _getBrushesRenderData.bottomHorizontalLine)(renderArgs)];
    }
  
    return {
      showHover: false,
      type: 'area',
      path2D: (0, _path2DUtils.getPath2D)()
    };
  }
  
  function brushes(props) {
    if (!props.xScale && !props.yScale) return undefined;
    return (0, _flatten2.default)((0, _map2.default)((0, _flatten2.default)(props.data), function (datum) {
      return brushesRender(props, datum);
    }));
  }