import _extends from "@babel/runtime/helpers/extends";

/* eslint-disable max-len */
import React from "react";
import PropTypes from "prop-types";
import classnames from "classnames";
import makeStyles from "../styles/makeStyles";
import { getShades } from "../styles/colors";

var deprecationWarning = function deprecationWarning(message) {
  if (process.env.NODE_ENV === "development") {
    // eslint-disable-next-line no-console
    console.warn("[Clever-react]: ".concat(message));
  }
};

var getClasses = makeStyles(function (_ref) {
  var colors = _ref.cleverUI.colors;
  return {
    root: function root(_ref2) {
      var rotation = _ref2.rotation,
          padding = _ref2.padding,
          size = _ref2.size,
          color = _ref2.color,
          shade = _ref2.shade;
      var res = {
        color: colors[color] ? colors[color][shade] : color
      };

      if (rotation > 0) {
        res.transform = "rotate(".concat(rotation, "deg)");
      }

      if (padding > 0) {
        res.padding = "".concat(size * padding / 200, "px");
      }

      return res;
    }
  };
});
var shadesList = getShades();

function EditImage(props) {
  var classes = getClasses(props);
  var size = props.size,
      padding = props.padding,
      className = props.className,
      onMouseEnter = props.onMouseEnter,
      onMouseLeave = props.onMouseLeave;
  var sizeIcon = size;
  var otherProps = {
    className: classnames(className, classes.root),
    onMouseEnter: onMouseEnter,
    onMouseLeave: onMouseLeave
  };

  if (padding) {
    deprecationWarning("The padding prop is deprecated, use a className for customization");
    sizeIcon = sizeIcon * (100 - padding) / 100;
  }

  return /*#__PURE__*/React.createElement("svg", _extends({
    viewBox: "0 0 16 16",
    fill: "none",
    height: sizeIcon,
    width: sizeIcon
  }, otherProps), /*#__PURE__*/React.createElement("path", {
    d: "M12.663 7.305a.666.666 0 0 0-.666.667v1.593l-1-.987c-.73-.7-1.883-.7-2.612 0l-.467.467-1.66-1.66a1.853 1.853 0 0 0-2.612 0l-.98.993V4.64c0-.368.299-.666.667-.666h3.999a.666.666 0 1 0 0-1.333h-4a2 2 0 0 0-1.999 2v7.997a2 2 0 0 0 2 2h7.997a2 2 0 0 0 2-2V7.972a.666.666 0 0 0-.667-.667Zm-9.33 5.998a.666.666 0 0 1-.667-.666v-2.373l1.92-1.946a.52.52 0 0 1 .746 0l2.113 2.113 2.839 2.84-6.951.032Zm8.664-.666a.666.666 0 0 1-.114.36L8.858 9.984l.466-.46a.52.52 0 0 1 .733 0l1.94 1.927v1.186Zm2.48-10.164L12.862.86a.666.666 0 0 0-.94 0L8.872 3.913a.666.666 0 0 0-.207.473V6c0 .368.299.666.667.666h1.613c.175 0 .342-.07.466-.193l3.053-3.052a.666.666 0 0 0 .013-.947Zm-3.813 2.86h-.667v-.667l2.4-2.393.666.667-2.4 2.392Z",
    fill: "currentColor"
  }));
}

EditImage.propTypes = {
  color: PropTypes.string,
  className: PropTypes.string,
  size: PropTypes.number,
  onMouseEnter: PropTypes.func,
  onMouseLeave: PropTypes.func,
  rotation: PropTypes.number,
  shade: PropTypes.oneOf(shadesList),
  padding: PropTypes.number
};
EditImage.defaultProps = {
  color: "neutral",
  size: 24,
  className: "",
  rotation: 0,
  shade: 500,
  padding: 0,
  onMouseEnter: function onMouseEnter() {},
  onMouseLeave: function onMouseLeave() {}
};
export default EditImage;