"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
function _export(target, all) {
    for(var name in all)Object.defineProperty(target, name, {
        enumerable: true,
        get: Object.getOwnPropertyDescriptor(all, name).get
    });
}
_export(exports, {
    get renderElement () {
        return renderElement;
    },
    get renderSanitizedHtml () {
        return renderSanitizedHtml;
    },
    get resolveTokenNode () {
        return resolveTokenNode;
    }
});
const _react = require("react");
const _sanitizeHtml = require("../utils/sanitizeHtml");
const renderElement = (key, fallback, props, children)=>/*#__PURE__*/ (0, _react.createElement)(fallback, {
        ...props,
        key
    }, children);
const renderSanitizedHtml = (key, html, tagName = 'span')=>/*#__PURE__*/ (0, _react.createElement)(tagName, {
        dangerouslySetInnerHTML: {
            __html: (0, _sanitizeHtml.sanitizeHtml)(html)
        },
        key
    });
const resolveTokenNode = (tokenRenderer, token, defaultNode, children)=>{
    const customNode = tokenRenderer?.(token, children);
    return customNode === undefined ? defaultNode : customNode;
};
