{"version":3,"file":"emojiMarkdownPlugin.mjs","names":[],"sources":["../../../../../../src/components/Message/renderText/rehypePlugins/emojiMarkdownPlugin.ts"],"sourcesContent":["import type { ReplaceFunction } from 'hast-util-find-and-replace';\nimport { findAndReplace } from 'hast-util-find-and-replace';\nimport { u } from 'unist-builder';\nimport type { Nodes } from 'hast';\n\nimport { EMOJI_REGEX } from '../../emojiRegex';\n\nexport const emojiMarkdownPlugin = () => {\n  const replace: ReplaceFunction = (match) =>\n    u('element', { properties: {}, tagName: 'emoji' }, [u('text', match)]);\n\n  const transform = (node: Nodes) => findAndReplace(node, [EMOJI_REGEX, replace]);\n\n  return transform;\n};\n"],"mappings":";;;;AAOA,IAAa,4BAA4B;CACvC,MAAM,WAA4B,UAChC,EAAE,WAAW;EAAE,YAAY,CAAC;EAAG,SAAS;CAAQ,GAAG,CAAC,EAAE,QAAQ,KAAK,CAAC,CAAC;CAEvE,MAAM,aAAa,SAAgB,eAAe,MAAM,CAAC,aAAa,OAAO,CAAC;CAE9E,OAAO;AACT"}