import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
var _excluded = ["icon"];

/* eslint-disable comma-dangle */
import React, { useEffect } from "react";
import PropTypes from "prop-types";
import isString from "lodash-es/isString";
import capitalize from "lodash-es/capitalize";
import { getColorsLabels, getShades } from "../styles/colors";
import Age from "./Age";
import Alarm from "./Alarm";
import Alert from "./Alert";
import AlignCenter from "./AlignCenter";
import AlignCenterAlt from "./AlignCenterAlt";
import AlignJustify from "./AlignJustify";
import AlignLeft from "./AlignLeft";
import AlignRight from "./AlignRight";
import Analytics from "./Analytics";
import ArrowLeft from "./ArrowLeft";
import ArrowRight from "./ArrowRight";
import ArrowUpperRight from "./ArrowUpperRight";
import At from "./At";
import Bag from "./Bag";
import Balance from "./Balance";
import BarsGraph from "./BarsGraph";
import Bell from "./Bell";
import BellMute from "./BellMute";
import BellOutlined from "./BellOutlined";
import Binoculars from "./Binoculars";
import Bold from "./Bold";
import Bolt from "./Bolt";
import Book from "./Book";
import Bookmark from "./Bookmark";
import BookOpen from "./BookOpen";
import Budget from "./Budget";
import Building from "./Building";
import Calendar from "./Calendar";
import CalendarAlt from "./CalendarAlt";
import Channel from "./Channel";
import ChartPie from "./ChartPie";
import Chat from "./Chat";
import Check from "./Check";
import CheckAlt from "./CheckAlt";
import CheckImage from "./CheckImage";
import CheckRound from "./CheckRound";
import ChevronDoubleLeft from "./ChevronDoubleLeft";
import ChevronDoubleRight from "./ChevronDoubleRight";
import ChevronDown from "./ChevronDown";
import ChevronLeft from "./ChevronLeft";
import ChevronRight from "./ChevronRight";
import ChevronUp from "./ChevronUp";
import Circle from "./Circle";
import CircleArrowDown from "./CircleArrowDown";
import CircleArrowLeft from "./CircleArrowLeft";
import CircleArrowRight from "./CircleArrowRight";
import CircleArrowUp from "./CircleArrowUp";
import CirclePlus from "./CirclePlus";
import CircleTimes from "./CircleTimes";
import Click from "./Click";
import Clipboard from "./Clipboard";
import Clock from "./Clock";
import Cloud from "./Cloud";
import CloudCheck from "./CloudCheck";
import CloudExclamation from "./CloudExclamation";
import CloudUpload from "./CloudUpload";
import Codebar from "./Codebar";
import Cog from "./Cog";
import Comment from "./Comment";
import Compass from "./Compass";
import Compress from "./Compress";
import Condition from "./Condition";
import Copy from "./Copy";
import Cpa from "./Cpa";
import Create from "./Create";
import CreditCard from "./CreditCard";
import Cta from "./Cta";
import CtaAlt from "./CtaAlt";
import Delete from "./Delete";
import Desktop from "./Desktop";
import Discount from "./Discount";
import DownArrow from "./DownArrow";
import Download from "./Download";
import DownloadAlt from "./DownloadAlt";
import Duplicate from "./Duplicate";
import Edit from "./Edit";
import EditImage from "./EditImage";
import Enter from "./Enter";
import Envelope from "./Envelope";
import Equalizer from "./Equalizer";
import Exclamation from "./Exclamation";
import Exit from "./Exit";
import Expand from "./Expand";
import Export from "./Export";
import ExternalLink from "./ExternalLink";
import Eye from "./Eye";
import Female from "./Female";
import File from "./File";
import FileCheck from "./FileCheck";
import FilePdf from "./FilePdf";
import FileSvg from "./FileSvg";
import FilterFunnel from "./FilterFunnel";
import Gender from "./Gender";
import GoogleAds from "./GoogleAds";
import Graph from "./Graph";
import Headline from "./Headline";
import Headlines from "./Headlines";
import Heart from "./Heart";
import Hide from "./Hide";
import Home from "./Home";
import Image from "./Image";
import ImageResize from "./ImageResize";
import Images from "./Images";
import Income from "./Income";
import Infinity from "./Infinity";
import InfoCircle from "./InfoCircle";
import Iphone from "./Iphone";
import Italic from "./Italic";
import Key from "./Key";
import Languages from "./Languages";
import Light from "./Light";
import Link from "./Link";
import Location from "./Location";
import LocationAlt from "./LocationAlt";
import Lock from "./Lock";
import Male from "./Male";
import MaximizeAlt from "./MaximizeAlt";
import Medal from "./Medal";
import MedalAlt from "./MedalAlt";
import Megaphone from "./Megaphone";
import Menu from "./Menu";
import Merge from "./Merge";
import MergePlus from "./MergePlus";
import Message from "./Message";
import MinimizeAlt from "./MinimizeAlt";
import MoneyBill from "./MoneyBill";
import Moon from "./Moon";
import MoonAlt from "./MoonAlt";
import Mouse from "./Mouse";
import MousePointer from "./MousePointer";
import OpenBlock from "./OpenBlock";
import OpenLock from "./OpenLock";
import PanoramaH from "./PanoramaH";
import PauseCircle from "./PauseCircle";
import Pen from "./Pen";
import Percent from "./Percent";
import PlayCircle from "./PlayCircle";
import Plug from "./Plug";
import Plus from "./Plus";
import PlusRound from "./PlusRound";
import Puzzle from "./Puzzle";
import QuestionMark from "./QuestionMark";
import Radio from "./Radio";
import RadioButtonChecked from "./RadioButtonChecked";
import RadioButtonUnchecked from "./RadioButtonUnchecked";
import Redo from "./Redo";
import Refresh from "./Refresh";
import Report from "./Report";
import Rocket from "./Rocket";
import Ruler from "./Ruler";
import Score from "./Score";
import Search from "./Search";
import Select from "./Select";
import Settings from "./Settings";
import Shape from "./Shape";
import Share from "./Share";
import ShoppingBag from "./ShoppingBag";
import ShoppingCart from "./ShoppingCart";
import ShowMore from "./ShowMore";
import Sign from "./Sign";
import Smart from "./Smart";
import Spent from "./Spent";
import Star from "./Star";
import StarEmpty from "./StarEmpty";
import StepBackward from "./StepBackward";
import StepForward from "./StepForward";
import Sun from "./Sun";
import Support from "./Support";
import Tablet from "./Tablet";
import Tag from "./Tag";
import Target from "./Target";
import Telephone from "./Telephone";
import Template from "./Template";
import Text from "./Text";
import ThumbDown from "./ThumbDown";
import ThumbUp from "./ThumbUp";
import Times from "./Times";
import TimesRound from "./TimesRound";
import Trash from "./Trash";
import Trophy from "./Trophy";
import Underline from "./Underline";
import UpArrow from "./UpArrow";
import Upload from "./Upload";
import User from "./User";
import UserCheck from "./UserCheck";
import Users from "./Users";
import Warning from "./Warning";
import ExclamationTriangle from "./ExclamationTriangle";

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

export var ICONS_MAP = {
  age: Age,
  alarm: Alarm,
  alert: Alert,
  aligncenter: AlignCenter,
  aligncenteralt: AlignCenterAlt,
  alignjustify: AlignJustify,
  alignleft: AlignLeft,
  alignright: AlignRight,
  analytics: Analytics,
  arrowleft: ArrowLeft,
  arrowright: ArrowRight,
  arrowupperright: ArrowUpperRight,
  at: At,
  bag: Bag,
  balance: Balance,
  barsgraph: BarsGraph,
  bell: Bell,
  bellmute: BellMute,
  belloutlined: BellOutlined,
  binoculars: Binoculars,
  bold: Bold,
  bolt: Bolt,
  book: Book,
  bookmark: Bookmark,
  bookopen: BookOpen,
  budget: Budget,
  building: Building,
  calendar: Calendar,
  calendaralt: CalendarAlt,
  channel: Channel,
  chartpie: ChartPie,
  chat: Chat,
  check: Check,
  checkalt: CheckAlt,
  checkimage: CheckImage,
  checkround: CheckRound,
  chevrondoubleleft: ChevronDoubleLeft,
  chevrondoubleright: ChevronDoubleRight,
  chevrondown: ChevronDown,
  chevronleft: ChevronLeft,
  chevronright: ChevronRight,
  chevronup: ChevronUp,
  circle: Circle,
  circlearrowdown: CircleArrowDown,
  circlearrowleft: CircleArrowLeft,
  circlearrowright: CircleArrowRight,
  circlearrowup: CircleArrowUp,
  circleplus: CirclePlus,
  circletimes: CircleTimes,
  click: Click,
  clipboard: Clipboard,
  clock: Clock,
  cloud: Cloud,
  cloudcheck: CloudCheck,
  cloudexclamation: CloudExclamation,
  cloudupload: CloudUpload,
  codebar: Codebar,
  cog: Cog,
  comment: Comment,
  compass: Compass,
  compress: Compress,
  condition: Condition,
  copy: Copy,
  cpa: Cpa,
  create: Create,
  creditcard: CreditCard,
  cta: Cta,
  ctaalt: CtaAlt,
  "delete": Delete,
  desktop: Desktop,
  discount: Discount,
  downarrow: DownArrow,
  download: Download,
  downloadalt: DownloadAlt,
  duplicate: Duplicate,
  edit: Edit,
  editimage: EditImage,
  enter: Enter,
  envelope: Envelope,
  equalizer: Equalizer,
  exclamation: Exclamation,
  exit: Exit,
  expand: Expand,
  "export": Export,
  externallink: ExternalLink,
  eye: Eye,
  female: Female,
  file: File,
  filecheck: FileCheck,
  filepdf: FilePdf,
  filesvg: FileSvg,
  filterfunnel: FilterFunnel,
  gender: Gender,
  googleads: GoogleAds,
  graph: Graph,
  headline: Headline,
  headlines: Headlines,
  heart: Heart,
  hide: Hide,
  home: Home,
  image: Image,
  imageresize: ImageResize,
  images: Images,
  income: Income,
  infinity: Infinity,
  infocircle: InfoCircle,
  iphone: Iphone,
  italic: Italic,
  key: Key,
  languages: Languages,
  light: Light,
  link: Link,
  location: Location,
  locationalt: LocationAlt,
  lock: Lock,
  male: Male,
  maximizealt: MaximizeAlt,
  medal: Medal,
  medalalt: MedalAlt,
  megaphone: Megaphone,
  menu: Menu,
  merge: Merge,
  mergeplus: MergePlus,
  message: Message,
  minimizealt: MinimizeAlt,
  moneybill: MoneyBill,
  moon: Moon,
  moonalt: MoonAlt,
  mouse: Mouse,
  mousepointer: MousePointer,
  openblock: OpenBlock,
  openlock: OpenLock,
  panoramah: PanoramaH,
  pausecircle: PauseCircle,
  pen: Pen,
  percent: Percent,
  playcircle: PlayCircle,
  plug: Plug,
  plus: Plus,
  plusround: PlusRound,
  puzzle: Puzzle,
  questionmark: QuestionMark,
  radio: Radio,
  radiobuttonchecked: RadioButtonChecked,
  radiobuttonunchecked: RadioButtonUnchecked,
  redo: Redo,
  refresh: Refresh,
  report: Report,
  rocket: Rocket,
  ruler: Ruler,
  score: Score,
  search: Search,
  select: Select,
  settings: Settings,
  shape: Shape,
  share: Share,
  shoppingbag: ShoppingBag,
  shoppingcart: ShoppingCart,
  showmore: ShowMore,
  sign: Sign,
  smart: Smart,
  spent: Spent,
  star: Star,
  starempty: StarEmpty,
  stepbackward: StepBackward,
  stepforward: StepForward,
  sun: Sun,
  support: Support,
  tablet: Tablet,
  tag: Tag,
  target: Target,
  telephone: Telephone,
  template: Template,
  text: Text,
  thumbdown: ThumbDown,
  thumbup: ThumbUp,
  times: Times,
  timesround: TimesRound,
  trash: Trash,
  trophy: Trophy,
  underline: Underline,
  uparrow: UpArrow,
  upload: Upload,
  user: User,
  usercheck: UserCheck,
  users: Users,
  warning: Warning,
  exclamationtriangle: ExclamationTriangle
};
var colorsList = getColorsLabels();
var shadesList = getShades();

var Icon = function Icon(_ref) {
  var icon = _ref.icon,
      props = _objectWithoutProperties(_ref, _excluded);

  var name = icon.trim().toLowerCase();
  var IconSelected = ICONS_MAP[name];
  useEffect(function () {
    deprecationWarning("The component\n    <Icon icon=\"".concat(icon, "\" /> is deprecated, use\n    <").concat(capitalize(icon), " />"));
  }, []);

  if (!IconSelected) {
    return null;
  }

  return /*#__PURE__*/React.createElement(IconSelected, props);
};

Icon.propTypes = {
  icon: function icon(_ref2) {
    var _icon = _ref2.icon;

    if (!isString(_icon)) {
      return new Error("Invalid prop icon supplied to Icon Component. Validation failed.");
    }

    if (!ICONS_MAP[_icon.trim().toLowerCase()]) {
      return new Error("Invalid prop icon supplied to Icon Component. Validation failed. INVALID ICON");
    }

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