'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var _extends = require('@babel/runtime/helpers/extends');
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
var React = require('react');
var emojiText = require('@evo/emoji-text');
var Text = require('@prom-ui/core/Text');

function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }

function _interopNamespaceCompat(e) {
    if (e && typeof e === 'object' && 'default' in e) return e;
    var n = Object.create(null);
    if (e) {
        Object.keys(e).forEach(function (k) {
            if (k !== 'default') {
                var d = Object.getOwnPropertyDescriptor(e, k);
                Object.defineProperty(n, k, d.get ? d : {
                    enumerable: true,
                    get: function () { return e[k]; }
                });
            }
        });
    }
    n.default = e;
    return Object.freeze(n);
}

var _extends__default = /*#__PURE__*/_interopDefaultCompat(_extends);
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultCompat(_objectWithoutProperties);
var React__namespace = /*#__PURE__*/_interopNamespaceCompat(React);

var _excluded = ["children", "size", "type"];
var TEXT_SIZES_LIST = {
  small: 11,
  "default": 13,
  big: 15,
  h1: 24,
  h2: 22,
  h3: 20,
  h4: 18,
  h5: 16,
  h6: 14
};
var TextEmoji = /*#__PURE__*/React__namespace.forwardRef(function (_ref, ref) {
  var children = _ref.children,
    _ref$size = _ref.size,
    size = _ref$size === void 0 ? TEXT_SIZES_LIST["default"] : _ref$size,
    _ref$type = _ref.type,
    type = _ref$type === void 0 ? 'apple' : _ref$type,
    props = _objectWithoutProperties__default.default(_ref, _excluded);
  return /*#__PURE__*/React__namespace.createElement(Text.Text, _extends__default.default({
    ref: ref
  }, props), /*#__PURE__*/React__namespace.createElement(emojiText.EmojiText, {
    size: TEXT_SIZES_LIST[props['text-size']] || size,
    type: type
  }, children));
});
TextEmoji.displayName = 'TextEmoji';

exports.TextEmoji = TextEmoji;
