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 Rocket(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: "M10.99 10.825a3.175 3.175 0 0 1-2.552 3.112l-2.444.488a.635.635 0 0 1-.572-.171l-.45-.444a1.27 1.27 0 0 1 0-1.797l.914-.92a8.365 8.365 0 0 1-.902-.896l-.914.914a1.27 1.27 0 0 1-1.797 0l-.444-.444a.635.635 0 0 1-.178-.572l.489-2.45a3.175 3.175 0 0 1 3.11-2.553h.547a8.298 8.298 0 0 1 8.14-3.473.635.635 0 0 1 .527.527 8.241 8.241 0 0 1-3.48 8.14v.54h.007Zm-2.8 1.867c.89-.178 1.53-.96 1.53-1.867v-.888a.635.635 0 0 1 .299-.534 7.01 7.01 0 0 0 3.25-6.59 6.971 6.971 0 0 0-6.59 3.25.635.635 0 0 1-.54.299h-.888c-.905 0-1.686.637-1.867 1.524l-.419 2.12.21.21 1.422-1.422a.635.635 0 0 1 .965.076 7.033 7.033 0 0 0 1.65 1.65.635.635 0 0 1 .077.966l-1.422 1.422.21.21 2.113-.426Zm2.032-6.28a.635.635 0 1 1 0-1.27.635.635 0 0 1 0 1.27Z",
    fill: "currentColor"
  }));
}

Rocket.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
};
Rocket.defaultProps = {
  color: "neutral",
  size: 24,
  className: "",
  rotation: 0,
  shade: 500,
  padding: 0,
  onMouseEnter: function onMouseEnter() {},
  onMouseLeave: function onMouseLeave() {}
};
export default Rocket;