function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
import * as R from 'ramda';
import React from "react";
var Rect = props => {
  var scale = props.scale ? "scale(".concat(props.scale, ")") : '';
  var transforms = {
    transform: "translate(".concat(props.xoffset, "px,").concat(props.yoffset, "px) ").concat(scale),
    fill: props.fill
  };
  return /*#__PURE__*/React.createElement("rect", {
    style: transforms,
    className: props.classnames ? props.classnames.join(' ') : undefined
    // css={[{
    //    transform: `translate(${props.xoffset}px,${props.yoffset}px) ${scale}`,
    //    fill: props.fill
    //  },
    // props.cssStyles ? props.cssStyles : undefined] }
    ,
    height: props.height ? props.height : 0,
    width: props.width
  });
};
var HighlightRect = props => {
  var fill = props.fill ? props.fill : '#48c9b0';
  if (props.isHighlighted([props.xoffset, props.xoffset + props.width], props.offx, props.offx + props.selectx)) {
    fill = props.highlightfill ? props.highlightfill : '#3498db';
  }
  return /*#__PURE__*/React.createElement(Rect, _extends({}, props, {
    fill: fill
  }));
};
var BarRects = props => {
  var stackvert = props.stackvert ? props.stackvert : false;
  var offset = 0;
  return /*#__PURE__*/React.createElement("g", null, R.map(fill => {
    offset = Math.round((stackvert ? offset + props.height : offset + props.width) * 10) / 10;
    return /*#__PURE__*/React.createElement(Rect, {
      key: offset,
      width: props.width,
      height: props.height,
      xoffset: stackvert ? 0 : offset,
      yoffset: stackvert ? offset : 0,
      fill: fill
    });
  })(props.fill));
};
export { Rect, HighlightRect, BarRects };