'use strict';

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

var _rollupPluginBabelHelpers = require('../../../../_virtual/_rollupPluginBabelHelpers.js');
var React = require('react');
var sanitizeHtml = require('../utils/sanitizeHtml.js');

var renderElement = function renderElement(key, fallback, props, children) {
  return /*#__PURE__*/React.createElement(fallback, _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, props), {}, {
    key: key
  }), children);
};
var renderSanitizedHtml = function renderSanitizedHtml(key, html) {
  var tagName = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'span';
  return /*#__PURE__*/React.createElement(tagName, {
    dangerouslySetInnerHTML: {
      __html: sanitizeHtml.sanitizeHtml(html)
    },
    key: key
  });
};
var resolveTokenNode = function resolveTokenNode(tokenRenderer, token, defaultNode, children) {
  var customNode = tokenRenderer === null || tokenRenderer === void 0 ? void 0 : tokenRenderer(token, children);
  return customNode === undefined ? defaultNode : customNode;
};

exports.renderElement = renderElement;
exports.renderSanitizedHtml = renderSanitizedHtml;
exports.resolveTokenNode = resolveTokenNode;
