import _extends from "@babel/runtime/helpers/esm/extends";
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
var _excluded = ["type", "size", "monoColor", "className", "title"];
import * as React from 'react';
import classNames from 'classnames';
import { ICON_COLOR } from '../icons/Icon';
import { generateId } from '../utils';
export var TYPE = {
  ACCOUNTANCY: 'accountancy',
  ADMINISTRATION: 'administration',
  ALGEBRA: 'algebra',
  ALL: 'all',
  ARABIC: 'arabic',
  ART: 'art',
  ARTMUSIC: 'artmusic',
  ASTRONOMY: 'astronomy',
  BELARUS: 'belarus',
  BELARUS_ALT: 'belarus-alt',
  BIOLOGY: 'biology',
  BUSINESS: 'business',
  CATALA: 'catala',
  CHEMISTRY: 'chemistry',
  CHINESE: 'chinese',
  ECONOMICS: 'economics',
  EGZAM: 'egzam',
  EXAM: 'exam',
  ENGLISH: 'english',
  ENVIRONMENT: 'environment',
  ETHICS: 'ethics',
  EUSKARA: 'euskara',
  FIRST_AID: 'first-aid',
  FRENCH: 'french',
  GALEGO: 'galego',
  GEOGRAPHY: 'geography',
  GEOLOGY: 'geology',
  GEOMETRY: 'geometry',
  GERMAN: 'german',
  GRAMMAR: 'grammar',
  HEALTH: 'health',
  HISTORY: 'history',
  INDIA_LANG: 'india-lang',
  INDONESIAN_LANG: 'indonesian-lang',
  INFORMATICS: 'informatics',
  ITALIAN: 'italian',
  JAPANESE: 'japanese',
  KAZACH: 'kazach',
  KAZACH_ALT: 'kazach-alt',
  KYRGYZ: 'kyrgyz',
  LANGUAGE: 'language',
  LATIN: 'latin',
  LAW: 'law',
  LIFE_SCIENCE: 'life-science',
  LITERATURE: 'literature',
  LOGIC: 'logic',
  MATHEMATICS: 'mathematics',
  MUSIC: 'music',
  OTHERLANGUAGES: 'otherlanguages',
  OTHERS: 'others',
  PEDAGOGICS: 'pedagogics',
  PHILOSOPHY: 'philosophy',
  PHYSICAL_EDUCATION: 'physical-education',
  PHYSICS: 'physics',
  POLITICS: 'politics',
  PSYCHOLOGY: 'psychology',
  RELIGION: 'religion',
  RUSSIAN: 'russian',
  RUSSIAN_ALT: 'russian-alt',
  SCIENCE: 'science',
  SECURITY: 'security',
  SKILLS: 'skills',
  SOCIAL_SCIENCE: 'social-science',
  SOCIOLOGY: 'sociology',
  SPANISH: 'spanish',
  STATISTICS: 'statistics',
  TECHNOLOGY: 'technology',
  TOURISM: 'tourism',
  TRAFFIC: 'traffic',
  TURKISH: 'turkish',
  UKRAINIAN: 'ukrainian',
  UKRAINIAN_ALT: 'ukrainian-alt',
  UKRAINIAN_LITERATURE: 'ukrainian-literature',
  UZBEK: 'uzbek',
  WOS: 'wos'
};
export var SIZE = {
  SMALL: 'small',
  MEDIUM: 'medium',
  NORMAL: 'normal'
};

var SubjectIcon = function SubjectIcon(_ref) {
  var _classNames;

  var type = _ref.type,
      _ref$size = _ref.size,
      size = _ref$size === void 0 ? SIZE.NORMAL : _ref$size,
      monoColor = _ref.monoColor,
      className = _ref.className,
      title = _ref.title,
      props = _objectWithoutProperties(_ref, _excluded);

  var _React$useRef = React.useRef(generateId()),
      id = _React$useRef.current;

  var iconClass = classNames('sg-subject-icon', (_classNames = {}, _defineProperty(_classNames, "sg-subject-icon--".concat(size), size !== SIZE.NORMAL), _defineProperty(_classNames, "sg-subject-icon--".concat(String(monoColor)), monoColor !== ICON_COLOR['icon-white'] && monoColor !== undefined), _classNames), className);
  var iconType = "#icon-subject-".concat(monoColor ? 'mono-' : '').concat(type);
  var titleId = "sg-math-symbol-icon-".concat(type, "-title-").concat(id);
  var defaultTitle = type.replace(/-alt$/g, '').replace(/-/g, ' ');
  return /*#__PURE__*/React.createElement("svg", _extends({}, props, {
    className: iconClass,
    "aria-labelledby": titleId,
    role: "img"
    /* @ts-expect-error */
    ,
    suppressHydrationWarning: true
  }), /*#__PURE__*/React.createElement("text", {
    id: titleId,
    visibility: "hidden"
    /* @ts-expect-error */
    ,
    suppressHydrationWarning: true
  }, title || defaultTitle), /*#__PURE__*/React.createElement("use", {
    xlinkHref: iconType,
    "aria-hidden": "true"
  }));
};

export default SubjectIcon;
export { ICON_COLOR } from '../icons/Icon';