react-input-emoji 5.9.0-beta.1 → 5.9.0-beta.3
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.es.js +163 -76
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +163 -76
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
- package/dist/src/types/types.d.ts +0 -32
package/dist/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../node_modules/style-inject/dist/style-inject.es.js","../src/utils/emoji-utils.js","../src/utils/input-event-utils.js","../node_modules/string-replace-to-array/string-replace-to-array.js","../node_modules/react-easy-emoji/lib/replaceEmoji.js","../node_modules/react-easy-emoji/lib/makeTwemojiRenderer.js","../node_modules/react-easy-emoji/index.js","../src/hooks/use-sanitize.js","../src/hooks/use-expose.js","../src/hooks/use-emit.js","../src/text-input.js","../src/components/emoji-picker-button.js","../node_modules/@emoji-mart/react/dist/module.js","../src/components/emoji-picker.js","../src/components/emoji-picker-container.js","../src/components/emoji-picker-wrapper.js","../src/utils/mention-utils.js","../src/hooks/use-mention.js","../src/components/mention-user-list.js","../src/components/mention-wrapper.js","../src/utils/observer.js","../src/hooks/use-event-listeners.js","../src/hooks/user-pollute.js","../src/index.js"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n","/* eslint-disable valid-jsdoc */\n// @ts-check\n\nexport const TRANSPARENT_GIF =\n \"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7\";\n\nexport const EMOJI_STYLE = \"\";\n\n/**\n * Replace all text with emoji with an image html tag\n * @param {string} text\n * @return {string}\n */\nexport function replaceAllTextEmojis(text) {\n let allEmojis = getAllEmojisFromText(text);\n\n if (allEmojis) {\n allEmojis = [...new Set(allEmojis)]; // remove duplicates\n\n allEmojis.forEach(emoji => {\n text = replaceAll(text, emoji, getInputEmojiHTML('', emoji));\n });\n }\n\n return text;\n}\n\n/**\n * Replace all occurrencies in a string\n * @param {string} str\n * @param {string} find\n * @param {string} replace\n * @return {string}\n */\nfunction replaceAll(str, find, replace) {\n return str.replace(new RegExp(find, \"g\"), replace);\n}\n\n/**\n * Get all emojis from the text\n * @param {string} text\n * @return {string[]}\n */\nfunction getAllEmojisFromText(text) {\n return text.match(\n /(?:[\\u2700-\\u27bf]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|\\ud83c[\\udffb-\\udfff])?(?:\\u200d(?:[^\\ud800-\\udfff]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|\\ud83c[\\udffb-\\udfff])?)*/g\n );\n}\n\n// eslint-disable-next-line valid-jsdoc\n/**\n *\n * @param { import(\"../types/types\").EmojiMartItem } emoji\n * @return {string}\n */\nexport function getImageEmoji(emoji) {\n /** @type {HTMLElement | null} */\n const emojiPickerEl = document.querySelector('em-emoji-picker')\n\n if (!emojiPickerEl) {\n return getInputEmojiNativeHTML(emoji.native)\n }\n\n /** @type {HTMLSpanElement | null=} */\n const emojiSpanEl = emojiPickerEl?.shadowRoot?.querySelector(`[title=\"${emoji.name}\"] > span > span`)\n\n if (!emojiSpanEl) {\n return getInputEmojiNativeHTML(emoji.native)\n }\n\n const style = replaceAll(emojiSpanEl.style.cssText, '\"', \"'\");\n\n return getInputEmojiHTML(style, emoji.native);\n}\n\n// eslint-disable-next-line valid-jsdoc\n/**\n *\n * @param {string} style\n * @param {string} emoji\n * @returns\n */\nfunction getInputEmojiHTML(style, emoji) {\n return `<img style=\"${style}; display: inline-block\" data-emoji=\"${emoji}\" src=\"${TRANSPARENT_GIF}\" />`;\n}\n\n/**\n * \n * @param {string} emoji \n * @returns \n */\nfunction getInputEmojiNativeHTML(emoji) {\n return `<span class=\"width: 18px; height: 18px; display: inline-block; margin: 0 1px;\">${emoji}</span>`;\n}\n\n/**\n *\n * @param {string} html\n * @return {string}\n */\nexport function replaceAllTextEmojiToString(html) {\n const container = document.createElement(\"div\");\n container.innerHTML = html;\n\n const images = Array.prototype.slice.call(container.querySelectorAll(\"img\"));\n\n images.forEach(image => {\n container.innerHTML = container.innerHTML.replace(\n image.outerHTML,\n image.dataset.emoji\n );\n });\n\n return container.innerHTML;\n}\n","// @ts-check\n\nimport {\n getImageEmoji,\n replaceAllTextEmojis,\n replaceAllTextEmojiToString,\n} from \"./emoji-utils\";\n\n/**\n * Handle copy of current selected text\n * @param {React.ClipboardEvent} event\n */\nexport function handleCopy(event) {\n const selectedText = window.getSelection();\n\n if (selectedText === null) {\n return;\n }\n\n let container = document.createElement(\"div\");\n\n for (let i = 0, len = selectedText.rangeCount; i < len; ++i) {\n container.appendChild(selectedText.getRangeAt(i).cloneContents());\n }\n\n container = replaceEmojiToString(container);\n\n event.clipboardData.setData(\"text\", container.innerText);\n event.preventDefault();\n}\n\n/** @type {Range|undefined} */\n/** @type {Range|undefined} */\nlet currentRangeCached;\n\n/**\n * Caches the current text selection range\n */\nexport function cacheCurrentRange() {\n const selection = window.getSelection();\n if (!selection.rangeCount || (selection?.anchorNode['className'] !== 'react-input-emoji--input' && selection.anchorNode.parentNode['className'] !== 'react-input-emoji--input')) return;\n const range = selection.getRangeAt(0);\n\n currentRangeCached = range.cloneRange();\n}\n\n/**\n * Clears the cached text selection range\n */\nexport function cleanCurrentRange() {\n currentRangeCached = undefined;\n}\n\n/**\n * @param {string} html - HTML string to be pasted at the caret position\n */\nexport function handlePasteHtmlAtCaret(html) {\n let sel;\n let range;\n if (window.getSelection) {\n // IE9 and non-IE\n sel = window.getSelection();\n\n if (sel === null) return;\n\n if (sel.getRangeAt && sel.rangeCount) {\n range = currentRangeCached ?? sel.getRangeAt(0);\n range.deleteContents();\n\n // Range.createContextualFragment() would be useful here but is\n // non-standard and not supported in all browsers (IE9, for one)\n const el = document.createElement(\"div\");\n el.innerHTML = html;\n const frag = document.createDocumentFragment();\n let node;\n let lastNode;\n while ((node = el.firstChild)) {\n lastNode = frag.appendChild(node);\n }\n range.insertNode(frag);\n\n // Preserve the selection\n if (lastNode) {\n range = range.cloneRange();\n currentRangeCached = range\n range.setStartAfter(lastNode);\n range.collapse(true);\n sel.removeAllRanges();\n sel.addRange(range);\n }\n }\n }\n}\n\n/**\n * Replace emoji img to its string value\n * @param {HTMLDivElement} container\n * @return {HTMLDivElement}\n */\nfunction replaceEmojiToString(container) {\n const images = Array.prototype.slice.call(container.querySelectorAll(\"img\"));\n\n images.forEach((image) => {\n image.outerHTML = image.dataset.emoji;\n });\n\n return container;\n}\n\n/**\n * Handle past on input\n * @param {React.ClipboardEvent} event\n */\nexport function handlePaste(event) {\n event.preventDefault();\n let content;\n if (event.clipboardData) {\n content = event.clipboardData.getData(\"text/plain\");\n content = replaceAllTextEmojis(content);\n document.execCommand(\"insertHTML\", false, content);\n }\n}\n\n/**\n * @typedef {object} HandleKeyDownOptions\n * @property {HTMLDivElement} placeholderEl\n * @property {number} maxLength\n * @property {HTMLDivElement} inputEl\n * @property {React.MutableRefObject<string>} cleanedTextRef\n * @property {React.MutableRefObject<HTMLDivElement>} textInputRef\n * @property {boolean} cleanOnEnter\n * @property {function(): void} emitChange\n * @property {(function(string): void)=} onEnter\n * @property {(function(KeyboardEvent): void)=} onKeyDown\n * @property {(function(string): void)} updateHTML\n */\n\n// eslint-disable-next-line valid-jsdoc\n/**\n * @typedef {Object} HandleSelectEmojiProps\n * @property {import(\"../types/types\").EmojiMartItem} emoji\n * @property {React.MutableRefObject<import('../text-input').Ref>} textInputRef\n * @property {boolean} keepOpened\n * @property {() => void} toggleShowPicker\n * @property {number=} maxLength\n */\n\n/**\n *\n * @param {HandleSelectEmojiProps} props\n */\nexport function handleSelectEmoji({\n emoji,\n textInputRef,\n keepOpened,\n toggleShowPicker,\n maxLength,\n}) {\n if (\n typeof maxLength !== \"undefined\" &&\n totalCharacters(textInputRef.current) >= maxLength\n ) {\n return;\n }\n\n textInputRef.current.appendContent(getImageEmoji(emoji));\n\n if (!keepOpened) {\n toggleShowPicker();\n }\n}\n\n/**\n *\n * @param {{text: string, html: string}} props\n * @return {number}\n */\nexport function totalCharacters({ text, html }) {\n const textCount = text.length;\n const emojisCount = (html.match(/<img/g) || []).length;\n\n return textCount + emojisCount;\n}\n\n// eslint-disable-next-line valid-jsdoc\n/**\n * Handle keyup event\n * @param {() => void} emitChange\n * @param {(event: KeyboardEvent) => void} onKeyDownMention\n * @param {React.MutableRefObject<string>} cleanedTextRef\n * @param {React.MutableRefObject<HTMLDivElement>} textInputRef\n * @return {(event: KeyboardEvent) => void}\n */\nexport function handleKeyup(\n emitChange,\n onKeyDownMention,\n cleanedTextRef,\n textInputRef,\n) {\n return (event) => {\n const text = replaceAllTextEmojiToString(textInputRef.current.innerHTML);\n cleanedTextRef.current = text;\n emitChange();\n onKeyDownMention(event);\n };\n}\n\n/**\n * Handle focus event\n * @param {function(FocusEvent): void} onFocus\n * @return {function(FocusEvent): void}\n */\nexport function handleFocus(onFocus) {\n return (event) => {\n onFocus(event);\n };\n}\n\n/**\n * Set caret to the end of text value\n * @param {React.MutableRefObject<HTMLDivElement| null>} input\n */\nexport function moveCaretToEnd(input) {\n let range;\n let selection;\n if (document.createRange && input.current) {\n range = document.createRange();\n range.selectNodeContents(input.current);\n range.collapse(false);\n selection = window.getSelection();\n if (selection) {\n selection.removeAllRanges();\n selection.addRange(range);\n }\n }\n}\n/**\n *\n * @param {HTMLDivElement} inputDiv\n * @return {string}\n */\nexport function removeHtmlExceptBr(inputDiv) {\n const temp = inputDiv.innerHTML.replaceAll(/<br\\s*\\/?>/gi, \"[BR]\"); // temporarily replace <br> with placeholder\n const tempContainer = document.createElement(\"div\");\n tempContainer.innerHTML = temp;\n const stripped = tempContainer.innerText; // strip all html tags\n const final = stripped.replaceAll(/\\[BR\\]/gi, \"</br>\"); // replace placeholders with <br>\n return final;\n}\n\n/**\n * \n * @param {*} range \n * @returns \n */\nexport function getSelectionStart(range) {\n let node = range.startContainer;\n let offset = range.startOffset;\n\n // Handle cases where the selection start node is not a text node\n if (node.nodeType !== Node.TEXT_NODE) {\n while (node.nodeType !== Node.TEXT_NODE) {\n node = node.nextSibling;\n if (!node) break;\n }\n if (!node) {\n node = range.commonAncestorContainer;\n while (node.nodeType !== Node.TEXT_NODE) {\n node = node.firstChild;\n }\n }\n offset = 0;\n }\n\n return { node, offset };\n}\n\n/**\n * \n * @return {Object} cursor\n */\nexport function getCursor() {\n const selection = window.getSelection();\n const range = selection.getRangeAt(0);\n const selectionStart = getSelectionStart(range);\n\n return {selection, range, selectionStart}\n}\n\n/**\n *\n */\nexport function addLineBreak() {\n const { selection, range, selectionStart } = getCursor()\n\n // If cursor is at the end of the text content, add one more line break\n if (\n selection.isCollapsed &&\n selectionStart.offset === selectionStart.node.textContent.length\n ) {\n const br = document.createElement(\"br\");\n range.insertNode(br);\n range.setStartAfter(br);\n range.setEndAfter(br);\n selection.removeAllRanges();\n selection.addRange(range);\n\n const br2 = document.createElement(\"br\");\n range.insertNode(br2);\n range.setStartAfter(br2);\n range.setEndAfter(br2);\n selection.removeAllRanges();\n selection.addRange(range);\n } else {\n const br = document.createElement(\"br\");\n range.insertNode(br);\n range.setStartAfter(br);\n range.setEndAfter(br);\n selection.removeAllRanges();\n selection.addRange(range);\n // Set cursor position right before the first letter after the line break\n if (\n selectionStart.node.nextSibling &&\n selectionStart.node.nextSibling.nodeType === Node.TEXT_NODE\n ) {\n range.setStart(selectionStart.node.nextSibling, 1);\n range.setEnd(selectionStart.node.nextSibling, 1);\n }\n selection.removeAllRanges();\n selection.addRange(range);\n }\n}\n","// Inspiration: https://github.com/facebook/react/issues/3386\n\nfunction replace (string, regexpOrSubstr, newValueOrFn, globalOffset) {\n\tif (typeof string !== 'string') throw new Error('First param must be a string')\n\tif (typeof regexpOrSubstr !== 'string' && !(regexpOrSubstr instanceof RegExp)) throw new Error('Second param must be a string pattern or a regular expression')\n\n\tvar fn = (typeof regexpOrSubstr === 'string') ? replaceUsingString : replaceUsingRegexp\n\n\treturn fn(string, regexpOrSubstr, newValueOrFn, globalOffset)\n}\n\nfunction replaceUsingString (string, patternString, newValueOrFn, globalOffset) {\n\tvar index = string.indexOf(patternString)\n\n\tif (index >= 0) {\n\t\tvar arr = []\n\t\tvar endIndex = index + patternString.length\n\n\t\tif (index > 0) {\n\t\t\tarr.push(string.substring(0, index))\n\t\t}\n\n\t\tarr.push(\n\t\t\t(typeof newValueOrFn === 'function') ?\n\t\t\t\tnewValueOrFn(\n\t\t\t\t\tstring.substring(index, endIndex),\n\t\t\t\t\tindex + globalOffset,\n\t\t\t\t\tstring\n\t\t\t\t) :\n\t\t\t\tnewValueOrFn\n\t\t)\n\n\t\tif (endIndex < string.length) {\n\t\t\tarr.push(string.substring(endIndex))\n\t\t}\n\n\t\treturn arr\n\t} else {\n\t\treturn [string]\n\t}\n}\n\nfunction replaceUsingRegexp (string, regexp, newValueOrFn, globalOffset) {\n\tvar output = []\n\n\tvar replacerIsFn = (typeof newValueOrFn === 'function')\n\n\tvar storedLastIndex = regexp.lastIndex\n\tregexp.lastIndex = 0\n\n\tvar result\n\tvar lastIndex = 0\n\twhile (result = regexp.exec(string)) {\n\t\tvar index = result.index\n\n\t\tif (result[0] === '') {\n\t\t\t// When the regexp is an empty string\n\t\t\t// we still want to advance our cursor to the next item.\n\t\t\t// This is the behavior of String.replace.\n\t\t\tregexp.lastIndex++\n\t\t}\n\n\t\tif (index !== lastIndex) {\n\t\t\toutput.push(string.substring(lastIndex, index))\n\t\t}\n\n\t\tvar match = result[0]\n\t\tlastIndex = index + match.length\n\t\t\n\t\tvar out = replacerIsFn ?\n\t\t\tnewValueOrFn.apply(this, result.concat(index + globalOffset, result.input)) :\n\t\t\tnewValueOrFn\n\t\toutput.push(out)\n\n\t\tif (!regexp.global) {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif (lastIndex < string.length) {\n\t\toutput.push(string.substring(lastIndex))\n\t}\n\n\tregexp.lastIndex = storedLastIndex\n\treturn output\n}\n\nmodule.exports = function stringReplaceToArray (stringOrArray, regexpOrSubstr, newSubStrOrFn) {\n\tif (typeof stringOrArray === 'string') {\n\t\treturn replace(stringOrArray, regexpOrSubstr, newSubStrOrFn, 0)\n\t} else if (!Array.isArray(stringOrArray) || !stringOrArray[0]) {\n\t\tthrow new TypeError('First argument must be an array or non-empty string')\n\t} else {\n\t\tvar len = stringOrArray.length\n\t\tvar output = []\n\t\tvar globalOffset = 0\n\t\tfor (var i = 0; i < len; ++i) {\n\t\t\tvar arrayItem = stringOrArray[i]\n\t\t\tif (typeof arrayItem === 'string') {\n\t\t\t\toutput.push.apply(output, replace(arrayItem, regexpOrSubstr, newSubStrOrFn, globalOffset))\n\t\t\t\tglobalOffset += arrayItem.length\n\t\t\t} else {\n\t\t\t\toutput.push(arrayItem)\n\t\t\t}\n\t\t}\n\t\treturn output\n\t}\n}","var replaceStringToArray = require('string-replace-to-array')\n\n// This is based off of https://github.com/twitter/twemoji/blob/gh-pages/2/twemoji.js\n//\n// Ideally we'd use twemoji instead of replicating its logic.\n// The reason we can't is that we need to run our own replace.\n//\n// We could use it for most things (by essentially running twemoji.parse for each\n// regex match, and reading the code from the callback), but the one thing we'd always need\n// to copy and paste into this file is the regex since we need it to run the replace.\n//\n// Another option is to fork twemoji and expose a method in it that could help us, then\n// ask them to pull it in.\n//\n\n// RegExp based on emoji's official Unicode standards\n// http://www.unicode.org/Public/UNIDATA/EmojiSources.txt\nvar re = /(?:\\ud83d\\udc68\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83e\\uddd1\\ud83c[\\udffc-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83e\\uddd1\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83e\\uddd1\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83e\\uddd1\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83e\\uddd1\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udffe]|\\ud83d\\udc68\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffb\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffc-\\udfff]|\\ud83d\\udc68\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffc\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83d\\udc68\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffd\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83d\\udc68\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffe\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83d\\udc68\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udfff\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udffe]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffc-\\udfff]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc69\\ud83c[\\udffc-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc69\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc69\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udffe]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udffe]|\\ud83e\\uddd1\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83e\\uddd1\\ud83c[\\udffc-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffb\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83e\\uddd1\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffc\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83e\\uddd1\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83e\\uddd1\\ud83c\\udffd\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83e\\uddd1\\ud83c\\udffe\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udfff]|\\ud83e\\uddd1\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udffe]|\\ud83e\\uddd1\\ud83c\\udfff\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68|\\ud83d\\udc69\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d[\\udc68\\udc69]|\\ud83e\\udef1\\ud83c\\udffb\\u200d\\ud83e\\udef2\\ud83c[\\udffc-\\udfff]|\\ud83e\\udef1\\ud83c\\udffc\\u200d\\ud83e\\udef2\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83e\\udef1\\ud83c\\udffd\\u200d\\ud83e\\udef2\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83e\\udef1\\ud83c\\udffe\\u200d\\ud83e\\udef2\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83e\\udef1\\ud83c\\udfff\\u200d\\ud83e\\udef2\\ud83c[\\udffb-\\udffe]|\\ud83d\\udc68\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68|\\ud83d\\udc69\\u200d\\u2764\\ufe0f\\u200d\\ud83d[\\udc68\\udc69]|\\ud83e\\uddd1\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1|\\ud83d\\udc6b\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc6c\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc6d\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc8f\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc91\\ud83c[\\udffb-\\udfff]|\\ud83e\\udd1d\\ud83c[\\udffb-\\udfff]|\\ud83d[\\udc6b-\\udc6d\\udc8f\\udc91]|\\ud83e\\udd1d)|(?:\\ud83d[\\udc68\\udc69]|\\ud83e\\uddd1)(?:\\ud83c[\\udffb-\\udfff])?\\u200d(?:\\u2695\\ufe0f|\\u2696\\ufe0f|\\u2708\\ufe0f|\\ud83c[\\udf3e\\udf73\\udf7c\\udf84\\udf93\\udfa4\\udfa8\\udfeb\\udfed]|\\ud83d[\\udcbb\\udcbc\\udd27\\udd2c\\ude80\\ude92]|\\ud83e[\\uddaf-\\uddb3\\uddbc\\uddbd])|(?:\\ud83c[\\udfcb\\udfcc]|\\ud83d[\\udd74\\udd75]|\\u26f9)((?:\\ud83c[\\udffb-\\udfff]|\\ufe0f)\\u200d[\\u2640\\u2642]\\ufe0f)|(?:\\ud83c[\\udfc3\\udfc4\\udfca]|\\ud83d[\\udc6e\\udc70\\udc71\\udc73\\udc77\\udc81\\udc82\\udc86\\udc87\\ude45-\\ude47\\ude4b\\ude4d\\ude4e\\udea3\\udeb4-\\udeb6]|\\ud83e[\\udd26\\udd35\\udd37-\\udd39\\udd3d\\udd3e\\uddb8\\uddb9\\uddcd-\\uddcf\\uddd4\\uddd6-\\udddd])(?:\\ud83c[\\udffb-\\udfff])?\\u200d[\\u2640\\u2642]\\ufe0f|(?:\\ud83d\\udc68\\u200d\\ud83d\\udc68\\u200d\\ud83d\\udc66\\u200d\\ud83d\\udc66|\\ud83d\\udc68\\u200d\\ud83d\\udc68\\u200d\\ud83d\\udc67\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc68\\u200d\\ud83d\\udc69\\u200d\\ud83d\\udc66\\u200d\\ud83d\\udc66|\\ud83d\\udc68\\u200d\\ud83d\\udc69\\u200d\\ud83d\\udc67\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc69\\u200d\\ud83d\\udc69\\u200d\\ud83d\\udc66\\u200d\\ud83d\\udc66|\\ud83d\\udc69\\u200d\\ud83d\\udc69\\u200d\\ud83d\\udc67\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc68\\u200d\\ud83d\\udc66\\u200d\\ud83d\\udc66|\\ud83d\\udc68\\u200d\\ud83d\\udc67\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc68\\u200d\\ud83d\\udc68\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc68\\u200d\\ud83d\\udc69\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc69\\u200d\\ud83d\\udc66\\u200d\\ud83d\\udc66|\\ud83d\\udc69\\u200d\\ud83d\\udc67\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc69\\u200d\\ud83d\\udc69\\u200d\\ud83d[\\udc66\\udc67]|\\ud83c\\udff3\\ufe0f\\u200d\\u26a7\\ufe0f|\\ud83c\\udff3\\ufe0f\\u200d\\ud83c\\udf08|\\ud83d\\ude36\\u200d\\ud83c\\udf2b\\ufe0f|\\u2764\\ufe0f\\u200d\\ud83d\\udd25|\\u2764\\ufe0f\\u200d\\ud83e\\ude79|\\ud83c\\udff4\\u200d\\u2620\\ufe0f|\\ud83d\\udc15\\u200d\\ud83e\\uddba|\\ud83d\\udc3b\\u200d\\u2744\\ufe0f|\\ud83d\\udc41\\u200d\\ud83d\\udde8|\\ud83d\\udc68\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc69\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc6f\\u200d\\u2640\\ufe0f|\\ud83d\\udc6f\\u200d\\u2642\\ufe0f|\\ud83d\\ude2e\\u200d\\ud83d\\udca8|\\ud83d\\ude35\\u200d\\ud83d\\udcab|\\ud83e\\udd3c\\u200d\\u2640\\ufe0f|\\ud83e\\udd3c\\u200d\\u2642\\ufe0f|\\ud83e\\uddde\\u200d\\u2640\\ufe0f|\\ud83e\\uddde\\u200d\\u2642\\ufe0f|\\ud83e\\udddf\\u200d\\u2640\\ufe0f|\\ud83e\\udddf\\u200d\\u2642\\ufe0f|\\ud83d\\udc08\\u200d\\u2b1b)|[#*0-9]\\ufe0f?\\u20e3|(?:[©®\\u2122\\u265f]\\ufe0f)|(?:\\ud83c[\\udc04\\udd70\\udd71\\udd7e\\udd7f\\ude02\\ude1a\\ude2f\\ude37\\udf21\\udf24-\\udf2c\\udf36\\udf7d\\udf96\\udf97\\udf99-\\udf9b\\udf9e\\udf9f\\udfcd\\udfce\\udfd4-\\udfdf\\udff3\\udff5\\udff7]|\\ud83d[\\udc3f\\udc41\\udcfd\\udd49\\udd4a\\udd6f\\udd70\\udd73\\udd76-\\udd79\\udd87\\udd8a-\\udd8d\\udda5\\udda8\\uddb1\\uddb2\\uddbc\\uddc2-\\uddc4\\uddd1-\\uddd3\\udddc-\\uddde\\udde1\\udde3\\udde8\\uddef\\uddf3\\uddfa\\udecb\\udecd-\\udecf\\udee0-\\udee5\\udee9\\udef0\\udef3]|[\\u203c\\u2049\\u2139\\u2194-\\u2199\\u21a9\\u21aa\\u231a\\u231b\\u2328\\u23cf\\u23ed-\\u23ef\\u23f1\\u23f2\\u23f8-\\u23fa\\u24c2\\u25aa\\u25ab\\u25b6\\u25c0\\u25fb-\\u25fe\\u2600-\\u2604\\u260e\\u2611\\u2614\\u2615\\u2618\\u2620\\u2622\\u2623\\u2626\\u262a\\u262e\\u262f\\u2638-\\u263a\\u2640\\u2642\\u2648-\\u2653\\u2660\\u2663\\u2665\\u2666\\u2668\\u267b\\u267f\\u2692-\\u2697\\u2699\\u269b\\u269c\\u26a0\\u26a1\\u26a7\\u26aa\\u26ab\\u26b0\\u26b1\\u26bd\\u26be\\u26c4\\u26c5\\u26c8\\u26cf\\u26d1\\u26d3\\u26d4\\u26e9\\u26ea\\u26f0-\\u26f5\\u26f8\\u26fa\\u26fd\\u2702\\u2708\\u2709\\u270f\\u2712\\u2714\\u2716\\u271d\\u2721\\u2733\\u2734\\u2744\\u2747\\u2757\\u2763\\u2764\\u27a1\\u2934\\u2935\\u2b05-\\u2b07\\u2b1b\\u2b1c\\u2b50\\u2b55\\u3030\\u303d\\u3297\\u3299])(?:\\ufe0f|(?!\\ufe0e))|(?:(?:\\ud83c[\\udfcb\\udfcc]|\\ud83d[\\udd74\\udd75\\udd90]|[\\u261d\\u26f7\\u26f9\\u270c\\u270d])(?:\\ufe0f|(?!\\ufe0e))|(?:\\ud83c[\\udf85\\udfc2-\\udfc4\\udfc7\\udfca]|\\ud83d[\\udc42\\udc43\\udc46-\\udc50\\udc66-\\udc69\\udc6e\\udc70-\\udc78\\udc7c\\udc81-\\udc83\\udc85-\\udc87\\udcaa\\udd7a\\udd95\\udd96\\ude45-\\ude47\\ude4b-\\ude4f\\udea3\\udeb4-\\udeb6\\udec0\\udecc]|\\ud83e[\\udd0c\\udd0f\\udd18-\\udd1c\\udd1e\\udd1f\\udd26\\udd30-\\udd39\\udd3d\\udd3e\\udd77\\uddb5\\uddb6\\uddb8\\uddb9\\uddbb\\uddcd-\\uddcf\\uddd1-\\udddd\\udec3-\\udec5\\udef0-\\udef6]|[\\u270a\\u270b]))(?:\\ud83c[\\udffb-\\udfff])?|(?:\\ud83c\\udff4\\udb40\\udc67\\udb40\\udc62\\udb40\\udc65\\udb40\\udc6e\\udb40\\udc67\\udb40\\udc7f|\\ud83c\\udff4\\udb40\\udc67\\udb40\\udc62\\udb40\\udc73\\udb40\\udc63\\udb40\\udc74\\udb40\\udc7f|\\ud83c\\udff4\\udb40\\udc67\\udb40\\udc62\\udb40\\udc77\\udb40\\udc6c\\udb40\\udc73\\udb40\\udc7f|\\ud83c\\udde6\\ud83c[\\udde8-\\uddec\\uddee\\uddf1\\uddf2\\uddf4\\uddf6-\\uddfa\\uddfc\\uddfd\\uddff]|\\ud83c\\udde7\\ud83c[\\udde6\\udde7\\udde9-\\uddef\\uddf1-\\uddf4\\uddf6-\\uddf9\\uddfb\\uddfc\\uddfe\\uddff]|\\ud83c\\udde8\\ud83c[\\udde6\\udde8\\udde9\\uddeb-\\uddee\\uddf0-\\uddf5\\uddf7\\uddfa-\\uddff]|\\ud83c\\udde9\\ud83c[\\uddea\\uddec\\uddef\\uddf0\\uddf2\\uddf4\\uddff]|\\ud83c\\uddea\\ud83c[\\udde6\\udde8\\uddea\\uddec\\udded\\uddf7-\\uddfa]|\\ud83c\\uddeb\\ud83c[\\uddee-\\uddf0\\uddf2\\uddf4\\uddf7]|\\ud83c\\uddec\\ud83c[\\udde6\\udde7\\udde9-\\uddee\\uddf1-\\uddf3\\uddf5-\\uddfa\\uddfc\\uddfe]|\\ud83c\\udded\\ud83c[\\uddf0\\uddf2\\uddf3\\uddf7\\uddf9\\uddfa]|\\ud83c\\uddee\\ud83c[\\udde8-\\uddea\\uddf1-\\uddf4\\uddf6-\\uddf9]|\\ud83c\\uddef\\ud83c[\\uddea\\uddf2\\uddf4\\uddf5]|\\ud83c\\uddf0\\ud83c[\\uddea\\uddec-\\uddee\\uddf2\\uddf3\\uddf5\\uddf7\\uddfc\\uddfe\\uddff]|\\ud83c\\uddf1\\ud83c[\\udde6-\\udde8\\uddee\\uddf0\\uddf7-\\uddfb\\uddfe]|\\ud83c\\uddf2\\ud83c[\\udde6\\udde8-\\udded\\uddf0-\\uddff]|\\ud83c\\uddf3\\ud83c[\\udde6\\udde8\\uddea-\\uddec\\uddee\\uddf1\\uddf4\\uddf5\\uddf7\\uddfa\\uddff]|\\ud83c\\uddf4\\ud83c\\uddf2|\\ud83c\\uddf5\\ud83c[\\udde6\\uddea-\\udded\\uddf0-\\uddf3\\uddf7-\\uddf9\\uddfc\\uddfe]|\\ud83c\\uddf6\\ud83c\\udde6|\\ud83c\\uddf7\\ud83c[\\uddea\\uddf4\\uddf8\\uddfa\\uddfc]|\\ud83c\\uddf8\\ud83c[\\udde6-\\uddea\\uddec-\\uddf4\\uddf7-\\uddf9\\uddfb\\uddfd-\\uddff]|\\ud83c\\uddf9\\ud83c[\\udde6\\udde8\\udde9\\uddeb-\\udded\\uddef-\\uddf4\\uddf7\\uddf9\\uddfb\\uddfc\\uddff]|\\ud83c\\uddfa\\ud83c[\\udde6\\uddec\\uddf2\\uddf3\\uddf8\\uddfe\\uddff]|\\ud83c\\uddfb\\ud83c[\\udde6\\udde8\\uddea\\uddec\\uddee\\uddf3\\uddfa]|\\ud83c\\uddfc\\ud83c[\\uddeb\\uddf8]|\\ud83c\\uddfd\\ud83c\\uddf0|\\ud83c\\uddfe\\ud83c[\\uddea\\uddf9]|\\ud83c\\uddff\\ud83c[\\udde6\\uddf2\\uddfc]|\\ud83c[\\udccf\\udd8e\\udd91-\\udd9a\\udde6-\\uddff\\ude01\\ude32-\\ude36\\ude38-\\ude3a\\ude50\\ude51\\udf00-\\udf20\\udf2d-\\udf35\\udf37-\\udf7c\\udf7e-\\udf84\\udf86-\\udf93\\udfa0-\\udfc1\\udfc5\\udfc6\\udfc8\\udfc9\\udfcf-\\udfd3\\udfe0-\\udff0\\udff4\\udff8-\\udfff]|\\ud83d[\\udc00-\\udc3e\\udc40\\udc44\\udc45\\udc51-\\udc65\\udc6a\\udc6f\\udc79-\\udc7b\\udc7d-\\udc80\\udc84\\udc88-\\udc8e\\udc90\\udc92-\\udca9\\udcab-\\udcfc\\udcff-\\udd3d\\udd4b-\\udd4e\\udd50-\\udd67\\udda4\\uddfb-\\ude44\\ude48-\\ude4a\\ude80-\\udea2\\udea4-\\udeb3\\udeb7-\\udebf\\udec1-\\udec5\\uded0-\\uded2\\uded5-\\uded7\\udedd-\\udedf\\udeeb\\udeec\\udef4-\\udefc\\udfe0-\\udfeb\\udff0]|\\ud83e[\\udd0d\\udd0e\\udd10-\\udd17\\udd20-\\udd25\\udd27-\\udd2f\\udd3a\\udd3c\\udd3f-\\udd45\\udd47-\\udd76\\udd78-\\uddb4\\uddb7\\uddba\\uddbc-\\uddcc\\uddd0\\uddde-\\uddff\\ude70-\\ude74\\ude78-\\ude7c\\ude80-\\ude86\\ude90-\\udeac\\udeb0-\\udeba\\udec0-\\udec2\\uded0-\\uded9\\udee0-\\udee7]|[\\u23e9-\\u23ec\\u23f0\\u23f3\\u267e\\u26ce\\u2705\\u2728\\u274c\\u274e\\u2753-\\u2755\\u2795-\\u2797\\u27b0\\u27bf\\ue50a])|\\ufe0f/g\n\nfunction toCodePoint(unicodeSurrogates, sep) {\n var\n\t\tr = [],\n\t\tc = 0,\n\t\tp = 0,\n\t\ti = 0\n\t\t\n\twhile (i < unicodeSurrogates.length) {\n\t\tc = unicodeSurrogates.charCodeAt(i++)\n\t\tif (p) {\n\t\t\tr.push((0x10000 + ((p - 0xD800) << 10) + (c - 0xDC00)).toString(16))\n\t\t\tp = 0\n\t\t} else if (0xD800 <= c && c <= 0xDBFF) {\n\t\t\tp = c\n\t\t} else {\n\t\t\tr.push(c.toString(16))\n\t\t}\n\t}\n\treturn r.join(sep || '-')\n}\n\n// avoid runtime RegExp creation for not so smart,\n// not JIT based, and old browsers / engines\nvar UFE0Fg = /\\uFE0F/g\n\n// avoid using a string literal like '\\u200D' here because minifiers expand it inline\nvar U200D = String.fromCharCode(0x200D)\n\n/**\n* Used to both remove the possible variant\n* and to convert utf16 into code points.\n* If there is a zero-width-joiner (U+200D), leave the variants in.\n* @param string the raw text of the emoji match\n*/\nfunction grabTheRightIcon(rawText) {\n\t// if variant is present as \\uFE0F\n\treturn toCodePoint(rawText.indexOf(U200D) < 0 ?\n\t\trawText.replace(UFE0Fg, '') :\n\t\trawText\n\t);\n}\n\nmodule.exports = function replaceEmoji (string, render) {\n\t// Note: the latest regex added an empty matching group, so we ignore it.\n\treturn replaceStringToArray(string, re, function emojiReplacer (match, _, offset) {\n\t\tvar icon = grabTheRightIcon(match)\n\t\treturn render(icon, match, offset)\n\t})\n}\n","var createElement = require('react').createElement\n\nvar pageProtocol = (typeof location === 'undefined') ? '' : ((location.protocol === 'https:') ? 'https:' : 'http:')\n\nvar emojiStyle = {\n\theight: '1em',\n\twidth: '1em',\n\tmargin: '0 .05em 0 .1em',\n\tverticalAlign: '-0.1em'\n}\n\n// Accept protocol with or without a colon\nfunction normalizeProtocol(protocol) {\n\tif (protocol && protocol.length > 0 && protocol.charAt(protocol.length - 1) !== ':') {\n\t\treturn protocol + ':'\n\t}\n\treturn protocol\n}\n\nmodule.exports = function makeTwemojiRenderer(options) {\n\toptions = merge({\n\t\tprotocol: pageProtocol,\n\t\tbaseUrl: '//cdnjs.cloudflare.com/ajax/libs/twemoji/14.0.2/',\n\t\tsize: '72x72',\n\t\text: '.png',\n\t\tprops: null\n\t}, options)\n\n\treturn function renderTwemoji (icon, match, offset) {\n\t\tvar src = ''\n\t\tif (options.baseUrl.indexOf('http') !== 0) {\n\t\t\tsrc += normalizeProtocol(options.protocol)\n\t\t}\n\n\t\tsrc += options.baseUrl + options.size + '/' + icon + options.ext\n\n\t\treturn createElement(\n\t\t\t'img',\n\t\t\tmerge({\n\t\t\t\tkey: offset,\n\t\t\t\talt: match,\n\t\t\t\tdraggable: false,\n\t\t\t\tsrc: src,\n\t\t\t\tstyle: emojiStyle\n\t\t\t}, options.props)\n\t\t)\n\t}\n}\n\nfunction merge() {\n\tvar out = {}, len = arguments.length\n\tfor(var i = 0; i < len; ++i) {\n\t\tvar source = arguments[i]\n\t\tif (source) {\n\t\t\tfor (var key in source) {\n\t\t\t\tif (Object.prototype.hasOwnProperty.call(source, key)) {\n\t\t\t\t\tout[key] = source[key]\n\t\t\t\t}\n\t\t\t}\n\t\t}\n }\n return out\n}","var replaceEmoji = require('./lib/replaceEmoji'),\n\tmakeTwemojiRenderer = require('./lib/makeTwemojiRenderer')\n\nmodule.exports = function reactEasyEmoji (element, optionsOrFn) {\n\tvar render = (typeof optionsOrFn === 'function') ? optionsOrFn : makeTwemojiRenderer(optionsOrFn)\n\treturn replaceEmoji(element, render)\n}","// @ts-check\n\nimport { useCallback, useRef } from \"react\";\nimport { renderToString } from 'react-dom/server'\nimport emoji from 'react-easy-emoji'\nimport { removeHtmlExceptBr } from \"../utils/input-event-utils\";\n\nconst EMOJI_REGEX = new RegExp(\n /(?:[\\u2700-\\u27bf]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|\\ud83c[\\udffb-\\udfff])?(?:\\u200d(?:[^\\ud800-\\udfff]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|\\ud83c[\\udffb-\\udfff])?)*/g\n)\n\n/**\n * @typedef {import('../types/types').SanitizeFn} SanitizeFn\n */\n\n// eslint-disable-next-line valid-jsdoc\n/**\n * @param {boolean} shouldReturn\n * @param {boolean} shouldConvertEmojiToImage\n */\nexport function useSanitize(shouldReturn, shouldConvertEmojiToImage) {\n /** @type {React.MutableRefObject<SanitizeFn[]>} */\n const sanitizeFnsRef = useRef([]);\n\n const sanitizedTextRef = useRef(\"\");\n\n /** @type {(fn: SanitizeFn) => void} */\n const addSanitizeFn = useCallback(fn => {\n sanitizeFnsRef.current.push(fn);\n }, []);\n\n /** @type {(html: string) => string} */\n const sanitize = useCallback(html => {\n let result = sanitizeFnsRef.current.reduce((acc, fn) => {\n return fn(acc);\n }, html);\n\n result = replaceAllHtmlToString(result, shouldReturn);\n\n if (shouldConvertEmojiToImage) {\n result = convertEmojiToImage(result);\n }\n\n sanitizedTextRef.current = result;\n\n return result;\n }, [shouldReturn, shouldConvertEmojiToImage]);\n\n return { addSanitizeFn, sanitize, sanitizedTextRef };\n}\n\n/**\n *\n * @param {string} html\n * @param {boolean} shouldReturn\n * @return {string}\n */\nexport function replaceAllHtmlToString(html, shouldReturn) {\n const container = document.createElement(\"div\");\n container.innerHTML = html;\n let text\n if(shouldReturn) {\n text = removeHtmlExceptBr(container)\n } else {\n text = container.innerText || \"\";\n }\n\n // remove all ↵ for safari\n text = text.replace(/\\n/gi, \"\");\n\n return text;\n}\n\n/**\n * \n * @param {string} text \n * @return {string}\n */\nfunction convertEmojiToImage(text) {\n text = handleEmoji(text)\n text = renderToString(emoji(text))\n text = text.replace(\n new RegExp('<span class="message-emoji">', 'g'),\n '<span class=\"message-emoji\">'\n )\n text = text.replace(new RegExp('</span>', 'g'), '</span>')\n \n return text \n}\n\n/**\n * \n * @param {string} text \n * @return {string}\n */\nfunction handleEmoji (text) {\n return text.replace(EMOJI_REGEX, '<span class=\"message-emoji\">$&</span>')\n}\n","// @ts-check\n\nimport { useImperativeHandle } from \"react\";\nimport { useSanitize } from \"./use-sanitize\";\n\n/**\n * @typedef {Object} Props\n * @property {React.Ref<any>} ref\n * @property {React.MutableRefObject<import('../text-input').Ref | null>} textInputRef\n * @property {(value: string) => void} setValue\n * @property {() => void} emitChange\n * @property {boolean=} shouldConvertEmojiToImage\n */\n\n/**\n *\n * @param {Props} props\n */\nexport function useExpose({ ref, textInputRef, setValue, emitChange, shouldConvertEmojiToImage }) {\n const { sanitize, sanitizedTextRef } = useSanitize(false, shouldConvertEmojiToImage);\n\n useImperativeHandle(ref, () => ({\n get value() {\n return sanitizedTextRef.current;\n },\n set value(value) {\n setValue(value);\n },\n focus: () => {\n if (textInputRef.current === null) return\n textInputRef.current.focus();\n },\n blur: () => {\n if (textInputRef.current !== null) {\n sanitize(textInputRef.current.html);\n\n }\n\n emitChange();\n }\n }));\n}\n","// @ts-check\n\nimport { useCallback, useEffect, useRef } from \"react\";\n\n// eslint-disable-next-line valid-jsdoc\n/**\n * useEmit\n * @param {React.MutableRefObject<import('../text-input').Ref | null>} textInputRef\n * @param {(size: {width: number, height: number}) => void} onResize\n * @param {(text: string) => void} onChange\n */\nexport function useEmit(textInputRef, onResize, onChange) {\n /** @type {React.MutableRefObject<{width: number; height: number} | null>} */\n const currentSizeRef = useRef(null);\n const onChangeFn = useRef(onChange);\n\n const checkAndEmitResize = useCallback(() => {\n if (textInputRef.current !== null) {\n const currentSize = currentSizeRef.current;\n\n const nextSize = textInputRef.current.size;\n\n if (\n (!currentSize ||\n currentSize.width !== nextSize.width ||\n currentSize.height !== nextSize.height) &&\n typeof onResize === \"function\"\n ) {\n onResize(nextSize);\n }\n\n currentSizeRef.current = nextSize;\n }\n }, [onResize, textInputRef]);\n\n const emitChange = useCallback((sanitizedText) => {\n if (typeof onChangeFn.current === \"function\") {\n onChangeFn.current(sanitizedText);\n }\n\n if (typeof onResize === \"function\") {\n checkAndEmitResize();\n }\n }, [checkAndEmitResize, onResize]);\n\n useEffect(() => {\n if (textInputRef.current) {\n checkAndEmitResize();\n }\n }, [checkAndEmitResize, textInputRef]);\n\n return emitChange;\n}\n","// @ts-check\n// vendors\nimport React, { useImperativeHandle, forwardRef, useRef, useMemo } from \"react\";\nimport { addLineBreak, handlePasteHtmlAtCaret } from \"./utils/input-event-utils\";\nimport { replaceAllTextEmojiToString } from \"./utils/emoji-utils\";\n\n/**\n * @typedef {Object} Props\n * @property {(event: React.KeyboardEvent) => void} onKeyDown\n * @property {(event: React.KeyboardEvent) => void} onKeyUp\n * @property {() => void} onFocus\n * @property {() => void} onBlur\n * @property {(sanitizedText: string) => void=} onChange\n * @property {(event: React.KeyboardEvent) => void} onArrowUp\n * @property {(event: React.KeyboardEvent) => void} onArrowDown\n * @property {(event: React.KeyboardEvent) => void} onEnter\n * @property {boolean} shouldReturn\n * @property {(event: React.ClipboardEvent) => void} onCopy\n * @property {(event: React.ClipboardEvent) => void} onPaste\n * @property {string} placeholder\n * @property {{borderRadius?: number; color?: string; borderColor?: string; fontSize?: number; fontFamily?: string; background: string; placeholderColor?: string;}} style\n * @property {number} tabIndex\n * @property {string} className\n * @property {(html: string) => void} onChange\n */\n\n/**\n * @typedef {{\n * appendContent: (html: string) => void;\n * html: string;\n * text: string;\n * size: { width: number; height: number;};\n * focus: () => void;\n * }} Ref\n */\n\n// eslint-disable-next-line valid-jsdoc\n/** @type {React.ForwardRefRenderFunction<Ref, Props>} */\nconst TextInput = (\n { placeholder, style, tabIndex, className, onChange, ...props },\n ref\n) => {\n useImperativeHandle(ref, () => ({\n appendContent: html => {\n if (textInputRef.current) {\n textInputRef.current.focus();\n }\n\n handlePasteHtmlAtCaret(html);\n\n if (textInputRef.current) {\n textInputRef.current.focus();\n }\n\n if (textInputRef.current && placeholderRef.current && replaceAllTextEmojiToString(textInputRef.current.innerHTML) === \"\") {\n placeholderRef.current.style.visibility = \"visible\";\n } else if (placeholderRef.current) {\n placeholderRef.current.style.visibility = \"hidden\";\n }\n\n if (textInputRef.current && typeof onChange === 'function') {\n onChange(textInputRef.current.innerHTML);\n }\n },\n set html(value) {\n if (textInputRef.current) {\n textInputRef.current.innerHTML = value;\n }\n \n if (placeholderRef.current) {\n const text = replaceAllTextEmojiToString(value)\n if (text === \"\") {\n placeholderRef.current.style.visibility = \"visible\";\n } else {\n placeholderRef.current.style.visibility = \"hidden\";\n }\n }\n\n if (typeof onChange === 'function' && textInputRef.current) {\n onChange(textInputRef.current.innerHTML);\n }\n },\n get html() {\n if (!textInputRef.current) return ''\n\n return textInputRef.current.innerHTML;\n },\n get text() {\n if (!textInputRef.current) return ''\n\n return textInputRef.current.innerText;\n },\n get size() {\n if (!textInputRef.current) {\n return {\n width: 0,\n height: 0\n }\n }\n\n return {\n width: textInputRef.current.offsetWidth,\n height: textInputRef.current.offsetHeight\n };\n },\n focus() {\n if (!textInputRef.current) return\n\n textInputRef.current.focus();\n }\n }));\n\n /** @type {React.CSSProperties} */\n const placeholderStyle = useMemo(() => {\n const placeholderStyle = {}\n\n if (style.placeholderColor) {\n placeholderStyle.color = style.placeholderColor\n }\n\n return placeholderStyle\n }, [style?.placeholderColor])\n\n /** @type {React.CSSProperties} */\n const inputStyle = useMemo(() => {\n const inputStyle = {}\n\n if (style.color) {\n inputStyle.color = style.color\n }\n\n return inputStyle\n }, [style?.color])\n\n /** @type {React.MutableRefObject<HTMLDivElement | null>} */\n const placeholderRef = useRef(null);\n /** @type {React.MutableRefObject<HTMLDivElement | null>} */\n const textInputRef = useRef(null);\n\n /**\n *\n * @param {React.KeyboardEvent} event\n */\n function handleKeyDown(event) { \n if (event.key === \"Enter\" && (event.shiftKey === true || event.ctrlKey === true) && props.shouldReturn) {\n event.preventDefault();\n if(textInputRef.current) {\n addLineBreak()\n return;\n }\n } \n if (event.key === \"Enter\") {\n props.onEnter(event);\n } else if (event.key === \"ArrowUp\") {\n props.onArrowUp(event);\n } else if (event.key === \"ArrowDown\") {\n props.onArrowDown(event);\n } else {\n if (event.key.length === 1 && placeholderRef.current) {\n placeholderRef.current.style.visibility = \"hidden\";\n }\n }\n\n props.onKeyDown(event);\n }\n\n /** */\n function handleClick() {\n props.onFocus();\n }\n\n /**\n *\n * @param {React.KeyboardEvent} event\n */\n function handleKeyUp(event) {\n props.onKeyUp(event);\n\n const input = textInputRef.current;\n\n if (placeholderRef.current && input) {\n const text = replaceAllTextEmojiToString(input.innerHTML)\n if (text === \"\") {\n placeholderRef.current.style.visibility = \"visible\";\n } else {\n placeholderRef.current.style.visibility = \"hidden\";\n }\n }\n\n if (typeof onChange === 'function' && textInputRef.current) {\n onChange(textInputRef.current.innerHTML);\n }\n }\n\n return (\n <div className=\"react-input-emoji--container\" style={style}>\n <div className=\"react-input-emoji--wrapper\" onClick={handleClick}>\n <div ref={placeholderRef} className=\"react-input-emoji--placeholder\" style={placeholderStyle}>\n {placeholder}\n </div>\n <div\n ref={textInputRef}\n onKeyDown={handleKeyDown}\n onKeyUp={handleKeyUp}\n tabIndex={tabIndex}\n contentEditable\n className={`react-input-emoji--input${className ? ` ${className}` : \"\"\n }`}\n onBlur={props.onBlur}\n onCopy={props.onCopy}\n onPaste={props.onPaste}\n data-testid=\"react-input-emoji--input\"\n style={inputStyle}\n />\n </div>\n </div>\n );\n};\n\nconst TextInputWithRef = forwardRef(TextInput);\n\nexport default TextInputWithRef;\n","// vendors\nimport React, { useEffect, useRef, useState } from \"react\";\n\n/**\n * @typedef {object} Props\n * @property {boolean} showPicker\n * @property {(event: React.MouseEvent) => void} toggleShowPicker\n * @property {HTMLDivElement=} buttonElement\n * @property {React.MutableRefObject=} buttonRef\n */\n\n/**\n * Emoji Picker Button Component\n * @param {Props} props\n * @return {JSX.Element}\n */\nfunction EmojiPickerButton({ showPicker, toggleShowPicker, buttonElement, buttonRef }) {\n \n const localButtonRef = useRef(null);\n const [showCustomButtonContent, setShowCustomButtonContent] = useState(false);\n\n useEffect(() => {\n if ((buttonRef?.current?.childNodes?.length ?? 0) > 2) {\n localButtonRef.current.appendChild(buttonRef.current.childNodes[0]);\n setShowCustomButtonContent(true);\n } else if ((buttonElement?.childNodes?.length ?? 0) > 2) {\n localButtonRef.current.appendChild(buttonElement?.childNodes[0]);\n setShowCustomButtonContent(true);\n }\n }, [buttonElement?.childNodes]);\n\n return (\n <button\n ref={localButtonRef}\n type=\"button\"\n className={`react-input-emoji--button${\n showPicker ? \" react-input-emoji--button__show\" : \"\"\n }`}\n onClick={toggleShowPicker}\n >\n {!showCustomButtonContent && (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n width=\"24\"\n height=\"24\"\n className=\"react-input-emoji--button--icon\"\n >\n {/* eslint-disable-next-line max-len */}\n <path d=\"M12 0C5.373 0 0 5.373 0 12s5.373 12 12 12 12-5.373 12-12S18.627 0 12 0m0 22C6.486 22 2 17.514 2 12S6.486 2 12 2s10 4.486 10 10-4.486 10-10 10\" />\n {/* eslint-disable-next-line max-len */}\n <path d=\"M8 7a2 2 0 1 0-.001 3.999A2 2 0 0 0 8 7M16 7a2 2 0 1 0-.001 3.999A2 2 0 0 0 16 7M15.232 15c-.693 1.195-1.87 2-3.349 2-1.477 0-2.655-.805-3.347-2H15m3-2H6a6 6 0 1 0 12 0\" />\n </svg>\n )}\n </button>\n );\n}\n\nexport default EmojiPickerButton;\n","import $dvPge$react, {useRef as $dvPge$useRef, useEffect as $dvPge$useEffect} from \"react\";\nimport {Picker as $dvPge$Picker} from \"emoji-mart\";\n\n\n\nfunction $e5534fc185f7111e$export$2e2bcd8739ae039(props) {\n const ref = (0, $dvPge$useRef)(null);\n const instance = (0, $dvPge$useRef)(null);\n if (instance.current) instance.current.update(props);\n (0, $dvPge$useEffect)(()=>{\n instance.current = new (0, $dvPge$Picker)({\n ...props,\n ref: ref\n });\n return ()=>{\n instance.current = null;\n };\n }, []);\n return /*#__PURE__*/ (0, $dvPge$react).createElement(\"div\", {\n ref: ref\n });\n}\n\n\nexport {$e5534fc185f7111e$export$2e2bcd8739ae039 as default};\n//# sourceMappingURL=module.js.map\n","// vendors\nimport React, { memo, useEffect, useMemo, useState } from \"react\";\nimport Picker from \"@emoji-mart/react\";\n\nconst EMOJI_MART_DATA_URL = \"https://cdn.jsdelivr.net/npm/@emoji-mart/data\";\nconst cacheI18n = {};\n\n/**\n * @typedef {object} Props\n * @property {'light' | 'dark' | 'auto'} theme\n * @property {function(import(\"../types/types\").EmojiMartItem): void} onSelectEmoji\n * @property {boolean} disableRecent\n * @property {any[]=} customEmojis\n * @property {import('../types/types').Languages=} language\n */\n\n/**\n * Emoji Picker Component\n * @param {Props} props\n */\nfunction EmojiPicker(props) {\n const { theme, onSelectEmoji, disableRecent, customEmojis, language } = props;\n\n /** @type {string[]} */\n const categories = useMemo(() => {\n /** @type {string[]} */\n let categoryies = [];\n\n if (!disableRecent) {\n categoryies.push(\"frequent\");\n }\n\n categoryies = [\n ...categoryies,\n \"people\",\n \"nature\",\n \"foods\",\n \"activity\",\n \"places\",\n \"objects\",\n \"symbols\",\n \"flags\"\n ];\n\n return categoryies;\n }, [disableRecent]);\n\n const [i18n, setI18n] = useState(undefined);\n\n useEffect(() => {\n if (!language) {\n if (cacheI18n.en) {\n setI18n(cacheI18n.en);\n return;\n }\n\n // @ts-ignore\n fetch(`${EMOJI_MART_DATA_URL}/i18n/en.json`)\n .then(async data => {\n const translations = await data.json();\n setI18n(translations);\n cacheI18n.en = translations;\n })\n .catch(error => {\n console.error(\"Failed to load translations:\", error);\n });\n return;\n }\n\n if (cacheI18n[language]) {\n setI18n(cacheI18n[language]);\n return;\n }\n\n // @ts-ignore\n fetch(`${EMOJI_MART_DATA_URL}/i18n/${language}.json`)\n .then(async data => {\n const translations = await data.json();\n setI18n(translations);\n cacheI18n[language] = translations;\n })\n .catch(error => {\n console.error(\"Failed to load translations:\", error);\n });\n }, [language]);\n\n if (!i18n) {\n return null;\n }\n\n return (\n <Picker\n data={undefined}\n theme={theme}\n previewPosition=\"none\"\n onEmojiSelect={onSelectEmoji}\n custom={customEmojis}\n categories={categories}\n set=\"apple\"\n i18n={i18n}\n />\n );\n}\n\n\nexport default memo(EmojiPicker);\n","import React from \"react\";\nimport EmojiPicker from \"./emoji-picker\";\n\n/**\n * @typedef {object} Props\n * @property {boolean} showPicker\n * @property {'light' | 'dark' | 'auto'} theme\n * @property {(emoji: import(\"../types/types\").EmojiMartItem) => void} handleSelectEmoji\n * @property {boolean} disableRecent\n * @property {any[]=} customEmojis\n * @property {('above' | 'below')=} position\n * @property {import('../types/types').Languages=} language\n */\n\n/**\n * Emoji Picker Button Component\n * @param {Props} props\n * @return {JSX.Element}\n */\nfunction EmojiPickerContainer({\n showPicker,\n theme,\n handleSelectEmoji,\n disableRecent,\n customEmojis,\n position,\n language\n}) {\n return (\n <div className=\"react-emoji-picker--container\">\n {showPicker && (\n <div\n className=\"react-emoji-picker--wrapper\"\n onClick={evt => evt.stopPropagation()}\n style={position === 'below' ? {top: '40px'} : {}}\n >\n <div className=\"react-emoji-picker\">\n <EmojiPicker\n theme={theme}\n onSelectEmoji={handleSelectEmoji}\n disableRecent={disableRecent}\n customEmojis={customEmojis}\n language={language}\n />\n </div>\n </div>\n )}\n </div>\n );\n}\n\nexport default EmojiPickerContainer;\n","// @ts-check\n// vendors\nimport React, { useEffect, useState } from \"react\";\nimport ReactDOM from \"react-dom\";\nimport {\n getImageEmoji,\n replaceAllTextEmojis,\n replaceAllTextEmojiToString\n} from \"../utils/emoji-utils\";\n\nimport EmojiPickerButton from \"./emoji-picker-button\";\nimport EmojiPickerContainer from \"./emoji-picker-container\";\nimport { cacheCurrentRange } from \"../utils/input-event-utils\";\n\nconst EMOJI_PICKER_CONTAINER_HEIGHT = 435;\n\n/**\n * @typedef {import('../types/types').SanitizeFn} SanitizeFn\n */\n\n/**\n * @typedef {import('../types/types').PolluteFn} PolluteFn\n */\n\n/**\n * @typedef {Object} Props\n * @property {'light' | 'dark' | 'auto'} theme\n * @property {boolean} keepOpened\n * @property {boolean} disableRecent\n * @property {any[]=} customEmojis\n * @property {(fn: SanitizeFn) => void} addSanitizeFn\n * @property {(fn: PolluteFn) => void} addPolluteFn\n * @property {(html: string) => void} appendContent\n * @property {HTMLDivElement=} buttonElement\n * @property {React.MutableRefObject=} buttonRef\n * @property {import('../types/types').Languages=} language\n */\n\n// eslint-disable-next-line valid-jsdoc\n/** @type {React.FC<Props>} */\nconst EmojiPickerWrapper = props => {\n const {\n theme,\n keepOpened,\n disableRecent,\n customEmojis,\n addSanitizeFn,\n addPolluteFn,\n appendContent,\n buttonElement,\n buttonRef,\n language\n } = props;\n\n const [showPicker, setShowPicker] = useState(false);\n /** @type {[HTMLDivElement | undefined, React.Dispatch<React.SetStateAction<HTMLDivElement | undefined>>]} */\n const [customButton, setCustomButton] = useState();\n /** @type {['above' | 'below' | undefined, React.Dispatch<React.SetStateAction<'above' | 'below' | undefined>>]} */\n const [emojiPickerPosition, setEmojiPickerPosition] = useState()\n\n useEffect(() => {\n if (showPicker) {\n cacheCurrentRange()\n }\n }, [showPicker])\n\n useEffect(() => {\n addSanitizeFn(replaceAllTextEmojiToString);\n }, [addSanitizeFn]);\n\n useEffect(() => {\n addPolluteFn(replaceAllTextEmojis);\n }, [addPolluteFn]);\n\n useEffect(() => {\n /**\n *\n * @param {MouseEvent} event\n */\n function checkClickOutside(event) {\n /** @type {HTMLElement} */\n // @ts-ignore\n const element = event.target;\n\n if (\n element.classList.contains(\"react-input-emoji--button\") ||\n element.classList.contains(\"react-input-emoji--button--icon\")\n ) {\n return;\n }\n\n setShowPicker(false);\n }\n\n document.addEventListener(\"click\", checkClickOutside);\n\n return () => {\n document.removeEventListener(\"click\", checkClickOutside);\n };\n }, []);\n\n /**\n *\n * @param {React.MouseEvent} event\n */\n function toggleShowPicker(event) {\n event.stopPropagation();\n event.preventDefault();\n\n setEmojiPickerPosition(calcTopPosition(event))\n\n setShowPicker(currentShowPicker => !currentShowPicker);\n }\n\n /**\n * \n * @param {React.MouseEvent} event\n * @return {'above' | 'below'}\n */\n function calcTopPosition(event) {\n const btn = event.currentTarget\n const btnRect = btn.getBoundingClientRect();\n\n const popoverHeight = EMOJI_PICKER_CONTAINER_HEIGHT;\n\n // Decide to display above or below based on available space\n if (btnRect.top >= popoverHeight) {\n // Display above\n return 'above'\n } else {\n // Display below\n return 'below'\n }\n }\n\n // eslint-disable-next-line valid-jsdoc\n /**\n *\n * @param {import(\"../types/types\").EmojiMartItem} emoji\n */\n function handleSelectEmoji(emoji) {\n appendContent(getImageEmoji(emoji));\n\n if (!keepOpened) {\n setShowPicker(currentShowPicker => !currentShowPicker);\n }\n }\n\n useEffect(() => {\n if (buttonRef?.current?.style) {\n buttonRef.current.style.position = \"relative\";\n setCustomButton(buttonRef.current);\n } else if (buttonElement?.style) {\n buttonElement.style.position = \"relative\";\n setCustomButton(buttonElement);\n }\n }, [buttonRef, buttonElement]);\n\n return customButton ? (\n (ReactDOM.createPortal(\n <>\n <EmojiPickerContainer\n showPicker={showPicker}\n theme={theme}\n handleSelectEmoji={handleSelectEmoji}\n disableRecent={disableRecent}\n customEmojis={customEmojis}\n position={emojiPickerPosition}\n language={language}\n />\n <EmojiPickerButton\n showPicker={showPicker}\n toggleShowPicker={toggleShowPicker}\n buttonElement={customButton}\n buttonRef={buttonRef}\n />\n </>,\n customButton\n ))\n ) : (\n (<>\n <EmojiPickerContainer\n showPicker={showPicker}\n theme={theme}\n handleSelectEmoji={handleSelectEmoji}\n disableRecent={disableRecent}\n customEmojis={customEmojis}\n position={emojiPickerPosition}\n language={language}\n />\n <EmojiPickerButton\n showPicker={showPicker}\n toggleShowPicker={toggleShowPicker}\n />\n </>)\n );\n};\n\nexport default EmojiPickerWrapper;\n","// @ts-check\n\n/**\n *\n * @return {string | null}\n */\nexport function getTextFromAtToCaret() {\n const range = getRangeFromAtToCaret();\n\n if (!range) return null;\n\n const text = range.text.substring(range.begin, range.end);\n\n return text || null;\n}\n\n// eslint-disable-next-line valid-jsdoc\n/** */\nexport function deleteTextFromAtToCaret() {\n const range = getRangeFromAtToCaret();\n\n if (!range) return;\n\n // @ts-ignore\n range.element.deleteData(range.begin, range.end - range.begin);\n}\n\n/**\n *\n * @return {{begin: number, end: number, text: string, element: Node} | null}\n */\nfunction getRangeFromAtToCaret() {\n const elementWithFocus = getElementWithFocus();\n\n if (!elementWithFocus) {\n return null;\n }\n\n const { element, caretOffset } = elementWithFocus;\n const text = element.textContent;\n const lastAt = text.lastIndexOf(\"@\");\n\n if (\n lastAt === -1 ||\n lastAt >= caretOffset ||\n (lastAt !== 0 && text[lastAt - 1] !== \" \")\n ) {\n return null;\n }\n\n return { begin: lastAt, end: caretOffset, text, element };\n}\n\n/**\n *\n * @return {{element: Node, caretOffset: number}}\n */\nexport function getElementWithFocus() {\n const element = getSelectionStart();\n\n if (element === null) {\n return null;\n }\n\n let caretOffset = 0;\n if (typeof window.getSelection != \"undefined\") {\n const range = window.getSelection().getRangeAt(0);\n const preCaretRange = range.cloneRange();\n preCaretRange.selectNodeContents(element);\n preCaretRange.setEnd(range.endContainer, range.endOffset);\n caretOffset = preCaretRange.toString().length;\n } else if (\n // @ts-ignore\n typeof document.selection != \"undefined\" &&\n // @ts-ignore\n document.selection.type != \"Control\"\n ) {\n // @ts-ignore\n const textRange = document.selection.createRange();\n // @ts-ignore\n const preCaretTextRange = document.body.createTextRange();\n preCaretTextRange.moveToElementText(element);\n preCaretTextRange.setEndPoint(\"EndToEnd\", textRange);\n caretOffset = preCaretTextRange.text.length;\n }\n\n return { element, caretOffset };\n}\n\n/**\n *\n * @return {Node | null}\n */\nfunction getSelectionStart() {\n const node = document.getSelection().anchorNode;\n return node?.nodeType == 3 ? node : null;\n}\n","// @ts-check\nimport { useCallback, useState } from \"react\";\nimport {\n deleteTextFromAtToCaret,\n getElementWithFocus,\n getTextFromAtToCaret\n} from \"../utils/mention-utils\";\n\n/**\n * @typedef {import('../types/types').MentionUser} MentionUser\n */\n\n// eslint-disable-next-line valid-jsdoc\n/**\n *\n * @param {(text: string) => Promise<MentionUser[]>=} searchMention\n * @returns {{mentionSearchText: string | null, mentionUsers: MentionUser[], onKeyUp: (event: React.KeyboardEvent) => void, onFocus: () => void, onSelectUser: () => void, loading: boolean}}\n */\nexport function useMention(searchMention) {\n const [loading, setLoading] = useState(false);\n\n /** @type {[MentionUser[], React.Dispatch<React.SetStateAction<MentionUser[]>>]} */\n const [mentionUsers, setMentionUsers] = useState([]);\n\n /** @type {[string | null, React.Dispatch<React.SetStateAction<string | null>>]} */\n const [mentionSearchText, setMentionSearchText] = useState(null);\n\n const onSelectUser = useCallback(() => {\n deleteTextFromAtToCaret();\n setMentionUsers([]);\n }, []);\n\n /** */\n const checkMentionText = useCallback(async () => {\n const metionText = getTextFromAtToCaret();\n\n setMentionSearchText(metionText);\n\n if (metionText === null) {\n setMentionUsers([]);\n } else {\n setLoading(true);\n const users = await searchMention(metionText);\n setLoading(false);\n setMentionUsers(users);\n }\n }, [searchMention]);\n\n /** @type {(event: React.KeyboardEvent) => void} */\n const onKeyUp = useCallback(\n async event => {\n if (typeof searchMention !== \"function\") return;\n\n if (\n event.key === \"Backspace\" &&\n getElementWithFocus()?.element.parentElement.hasAttribute(\n \"data-mention-id\"\n )\n ) {\n const elementWithFocus = getElementWithFocus();\n elementWithFocus.element.parentElement.remove();\n } else if (\n ![\"ArrowUp\", \"ArrowDown\", \"Esc\", \"Escape\"].includes(event.key)\n ) {\n checkMentionText();\n }\n },\n [checkMentionText, searchMention]\n );\n\n const onFocus = useCallback(() => {\n checkMentionText();\n }, [checkMentionText]);\n\n return {\n mentionSearchText,\n mentionUsers,\n onKeyUp,\n onFocus,\n onSelectUser,\n loading\n };\n}\n","// @ts-check\n// vendors\nimport React, {\n useImperativeHandle,\n useState,\n forwardRef,\n useMemo,\n useEffect\n} from \"react\";\n\n/**\n * @typedef {import('../types/types').MentionUser} MentionUser\n */\n\n/**\n * @typedef {import('../types/types').TextInputListeners} TextInputListeners\n */\n\n/**\n * @typedef {Object} Props\n * @property {MentionUser[]} users\n * @property {string | null} mentionSearchText\n * @property {(user: MentionUser) => void} onSelect\n * @property {(event: keyof TextInputListeners, fn: import('../types/types').Listerner<any>) => () => void} addEventListener\n */\n\n/**\n * @typedef {{prevUser: () => void; nextUser: () => void;}} Ref\n */\n\n// eslint-disable-next-line valid-jsdoc\n/** @type {React.ForwardRefRenderFunction<Ref, Props>} */\nconst MentionUserList = (\n { users, mentionSearchText, onSelect, addEventListener },\n ref\n) => {\n const [selectedUser, setSelectedUser] = useState(0);\n\n useImperativeHandle(ref, () => ({\n prevUser: () => {\n setSelectedUser(currentSelectedUser => {\n if (currentSelectedUser === 0) {\n return 0;\n }\n\n return currentSelectedUser - 1;\n });\n },\n nextUser: () => {\n setSelectedUser(currentSelectedUser => {\n if (currentSelectedUser === users.length - 1) {\n return users.length - 1;\n }\n\n return currentSelectedUser + 1;\n });\n }\n }));\n\n useEffect(() => {\n setSelectedUser(0);\n }, [users]);\n\n /**\n *\n * @param {string} selectedText\n * @param {string} rest\n * @return {string}\n */\n function getMentionSelectedNameEl(selectedText, rest) {\n return `<span class=\"react-input-emoji--mention--item--name__selected\" data-testid=\"metion-selected-word\">${selectedText}</span>${rest}`;\n }\n\n /** @type {(MentionUser & {nameHtml: string})[]} */\n const usersFiltered = useMemo(() => {\n const searchText = mentionSearchText\n ? mentionSearchText.substring(1).toLocaleLowerCase()\n : \"\";\n return users.map(user => {\n let nameHtml = user.name;\n\n if (mentionSearchText && mentionSearchText.length > 1) {\n if (user.name.toLowerCase().startsWith(searchText)) {\n nameHtml = getMentionSelectedNameEl(\n user.name.substring(0, searchText.length),\n user.name.substring(searchText.length)\n );\n } else {\n const names = user.name.split(\" \");\n\n nameHtml = names\n .map(name => {\n if (name.toLocaleLowerCase().startsWith(searchText)) {\n return getMentionSelectedNameEl(\n name.substring(0, searchText.length),\n name.substring(searchText.length)\n );\n }\n return name;\n })\n .join(\" \");\n }\n }\n\n return {\n ...user,\n nameHtml\n };\n });\n }, [mentionSearchText, users]);\n\n // eslint-disable-next-line valid-jsdoc\n /**\n *\n * @param {MentionUser} user\n * @returns {(event: React.MouseEvent) => void} event\n */\n function handleClick(user) {\n return event => {\n event.stopPropagation();\n event.preventDefault();\n\n onSelect(user);\n };\n }\n\n useEffect(() => {\n const unsubscribe = addEventListener(\"enter\", event => {\n event.stopPropagation();\n event.preventDefault();\n onSelect(usersFiltered[selectedUser]);\n });\n\n return () => {\n unsubscribe();\n };\n }, [addEventListener, onSelect, selectedUser, usersFiltered]);\n\n return (\n <ul\n className=\"react-input-emoji--mention--list\"\n data-testid=\"mention-user-list\"\n >\n {usersFiltered.map((user, index) => (\n <li key={user.id}>\n <button\n type=\"button\"\n onClick={handleClick(user)}\n className={`react-input-emoji--mention--item${\n selectedUser === index\n ? \" react-input-emoji--mention--item__selected\"\n : \"\"\n }`}\n onMouseOver={() => setSelectedUser(index)}\n >\n <img\n className=\"react-input-emoji--mention--item--img\"\n src={user.image}\n />\n <div\n className=\"react-input-emoji--mention--item--name\"\n dangerouslySetInnerHTML={{ __html: user.nameHtml }}\n />\n </button>\n </li>\n ))}\n </ul>\n );\n};\n\nconst MentionUserListWithRef = forwardRef(MentionUserList);\n\nexport default MentionUserListWithRef;\n","// @ts-check\n// vendors\nimport React, { useEffect, useRef, useState } from \"react\";\n\n// hooks\nimport { useMention } from \"../hooks/use-mention\";\n\n// components\nimport MentionUserList from \"./mention-user-list\";\n\n/**\n * @typedef {import('../types/types').MentionUser} MetionUser\n */\n\n/**\n * @typedef {import('../types/types').TextInputListeners} TextInputListeners\n */\n\n/**\n * @typedef {import('../types/types').SanitizeFn} SanitizeFn\n */\n\n/**\n * @typedef {Object} Props\n * @property {(text: string) => Promise<MetionUser[]>=} searchMention\n * @property {(event: keyof TextInputListeners, fn: import('../types/types').Listerner<any>) => () => void} addEventListener\n * @property {(html: string) => void} appendContent\n * @property {(fn: SanitizeFn) => void} addSanitizeFn\n */\n\n// eslint-disable-next-line valid-jsdoc\n/** @type {React.FC<Props>} */\nconst MentionWrapper = ({\n searchMention,\n addEventListener,\n appendContent,\n addSanitizeFn\n}) => {\n /** @type {React.MutableRefObject<import('./mention-user-list').Ref | null>} */\n const metionUserListRef = useRef(null);\n const [showUserList, setShowUserList] = useState(false);\n\n const {\n mentionSearchText,\n mentionUsers,\n loading,\n onKeyUp,\n onFocus,\n onSelectUser\n } = useMention(searchMention);\n\n useEffect(() => {\n addSanitizeFn(html => {\n const container = document.createElement(\"div\");\n container.innerHTML = html;\n\n const mentionsEl = Array.prototype.slice.call(\n container.querySelectorAll(\".react-input-emoji--mention--text\")\n );\n\n mentionsEl.forEach(mentionEl => {\n container.innerHTML = container.innerHTML.replace(\n mentionEl.outerHTML,\n `@[${mentionEl.dataset.mentionName}](userId:${mentionEl.dataset.mentionId})`\n );\n });\n\n return container.innerHTML;\n });\n }, [addSanitizeFn]);\n\n useEffect(() => {\n setShowUserList(mentionUsers.length > 0);\n }, [mentionUsers]);\n\n useEffect(() => {\n /** */\n function checkClickOutside() {\n setShowUserList(false);\n }\n\n document.addEventListener(\"click\", checkClickOutside);\n\n return () => {\n document.removeEventListener(\"click\", checkClickOutside);\n };\n }, []);\n\n useEffect(() => {\n const unsubscribe = addEventListener(\"keyUp\", onKeyUp);\n\n return () => {\n unsubscribe();\n };\n }, [addEventListener, onKeyUp]);\n\n useEffect(() => {\n /**\n *\n * @param {React.KeyboardEvent} event\n */\n function handleKeyDown(event) {\n switch (event.key) {\n case \"Esc\": // IE/Edge specific value\n case \"Escape\":\n setShowUserList(false);\n break;\n default:\n break;\n }\n }\n\n const unsubscribe = addEventListener(\"keyDown\", handleKeyDown);\n\n return () => {\n unsubscribe();\n };\n }, [addEventListener]);\n\n useEffect(() => {\n const unsubscribe = addEventListener(\"focus\", onFocus);\n\n return () => {\n unsubscribe();\n };\n }, [addEventListener, onFocus]);\n\n useEffect(() => {\n if (showUserList) {\n const unsubscribeArrowUp = addEventListener(\"arrowUp\", event => {\n event.stopPropagation();\n event.preventDefault();\n metionUserListRef.current.prevUser();\n });\n\n const unsubscribeArrowDown = addEventListener(\"arrowDown\", event => {\n event.stopPropagation();\n event.preventDefault();\n metionUserListRef.current.nextUser();\n });\n\n return () => {\n unsubscribeArrowUp();\n unsubscribeArrowDown();\n };\n }\n }, [addEventListener, showUserList]);\n\n /**\n *\n * @param {MetionUser} user\n */\n function handleSelect(user) {\n onSelectUser();\n appendContent(\n `<span class=\"react-input-emoji--mention--text\" data-mention-id=\"${user.id}\" data-mention-name=\"${user.name}\">@${user.name}</span> `\n );\n }\n\n return (\n <>\n {loading ? (\n <div className=\"react-input-emoji--mention--container\">\n <div className=\"react-input-emoji--mention--loading\">\n <div className=\"react-input-emoji--mention--loading--spinner\">\n Loading...\n </div>\n </div>\n </div>\n ) : (\n showUserList && (\n <div\n className=\"react-input-emoji--mention--container\"\n onClick={evt => evt.stopPropagation()}\n >\n <MentionUserList\n ref={metionUserListRef}\n mentionSearchText={mentionSearchText}\n users={mentionUsers}\n onSelect={handleSelect}\n addEventListener={addEventListener}\n />\n </div>\n )\n )}\n </>\n );\n};\n\nexport default MentionWrapper;\n","// @ts-check\n\n// eslint-disable-next-line valid-jsdoc\n/**\n * @template T\n * @returns {import('../types/types').ListenerObj<T>}\n */\nexport function createObserver() {\n /** @type {import('../types/types').Listerner<T>[]} */\n let listeners = [];\n\n return {\n subscribe: listener => {\n listeners.push(listener);\n return () => {\n listeners = listeners.filter(l => l !== listener);\n };\n },\n publish: event => {\n listeners.forEach(listener => listener(event));\n },\n get currentListerners() {\n return listeners;\n }\n };\n}\n","// @ts-check\n\nimport { useCallback, useMemo } from \"react\";\nimport { createObserver } from \"../utils/observer\";\n\n/**\n * @typedef {import('../types/types').TextInputListeners} TextInputListeners\n */\n\n// eslint-disable-next-line valid-jsdoc\n/** */\nexport function useEventListeners() {\n /** @type {TextInputListeners} */\n const listeners = useMemo(\n () => ({\n keyDown: createObserver(),\n keyUp: createObserver(),\n arrowUp: createObserver(),\n arrowDown: createObserver(),\n enter: createObserver(),\n focus: createObserver(),\n blur: createObserver()\n }),\n []\n );\n\n /**\n * @template {keyof TextInputListeners} T, K\n * @type {(event: keyof TextInputListeners, fn: import('../types/types').Listerner<any>) => () => void}\n */\n const addEventListener = useCallback(\n (event, fn) => {\n return listeners[event].subscribe(fn);\n },\n [listeners]\n );\n\n return { addEventListener, listeners };\n}\n","// @ts-check\n\nimport { useCallback, useRef } from \"react\";\n\n/**\n * @typedef {import('../types/types').PolluteFn} PolluteFn\n */\n\n// eslint-disable-next-line valid-jsdoc\n/** */\nexport function usePollute() {\n /** @type {React.MutableRefObject<PolluteFn[]>} */\n const polluteFnsRef = useRef([]);\n\n /** @type {(fn: PolluteFn) => void} */\n const addPolluteFn = useCallback(fn => {\n polluteFnsRef.current.push(fn);\n }, []);\n\n /** @type {(html: string) => string} */\n const pollute = useCallback(text => {\n const result = polluteFnsRef.current.reduce((acc, fn) => {\n return fn(acc);\n }, text);\n\n return result;\n }, []);\n\n return { addPolluteFn, pollute };\n}\n","// @ts-check\n// vendors\nimport React, { useEffect, useRef, forwardRef, useCallback } from \"react\";\n\n// css\nimport \"./styles.css\";\n\n// utils\nimport { replaceAllTextEmojis } from \"./utils/emoji-utils\";\nimport { handleCopy, totalCharacters } from \"./utils/input-event-utils\";\n\n// hooks\nimport { useExpose } from \"./hooks/use-expose\";\nimport { useEmit } from \"./hooks/use-emit\";\n\n// components\nimport TextInput from \"./text-input\";\nimport EmojiPickerWrapper from \"./components/emoji-picker-wrapper\";\nimport MentionWrapper from \"./components/mention-wrapper\";\nimport { useEventListeners } from \"./hooks/use-event-listeners\";\nimport { useSanitize } from \"./hooks/use-sanitize\";\nimport { usePollute } from \"./hooks/user-pollute\";\n\n/**\n * @typedef {import('./types/types').MentionUser} MetionUser\n */\n\n/**\n * @typedef {import('./types/types').ListenerObj<any>} ListenerObj\n */\n\n/**\n * @typedef {object} Props\n * @property {string} value\n * @property {(value: string) => void} onChange\n * @property {\"light\" | \"dark\" | \"auto\"=} theme\n * @property {boolean=} cleanOnEnter\n * @property {(text: string) => void=} onEnter\n * @property {string=} placeholder\n * @property {string=} placeholderColor\n * @property {string=} color\n * @property {(size: {width: number, height: number}) => void=} onResize\n * @property {() => void=} onClick\n * @property {() => void=} onFocus\n * @property {() => void=} onBlur\n * @property {boolean} shouldReturn\n * @property {number=} maxLength\n * @property {boolean=} keepOpened\n * @property {(event: KeyboardEvent) => void=} onKeyDown\n * @property {string=} inputClass\n * @property {boolean=} disableRecent\n * @property {number=} tabIndex\n * @property {number=} height\n * @property {number=} borderRadius\n * @property {string=} borderColor\n * @property {number=} fontSize\n * @property {string=} fontFamily\n * @property {string=} background\n * @property {{id: string; name: string; emojis: {id: string; name: string; keywords: string[], skins: {src: string}[]}}[]=} customEmojis\n * @property {import('./types/types').Languages=} language\n * @property {(text: string) => Promise<MetionUser[]>=} searchMention\n * @property {HTMLDivElement=} buttonElement\n * @property {React.MutableRefObject=} buttonRef\n * @property {boolean} shouldConvertEmojiToImage\n */\n\n/**\n * Input Emoji Component\n * @param {Props} props\n * @param {React.Ref<any>} ref\n * @return {JSX.Element}\n */\nfunction InputEmoji(props, ref) {\n const {\n onChange,\n onEnter,\n onResize,\n onClick,\n onFocus,\n onBlur,\n onKeyDown,\n theme,\n cleanOnEnter,\n placeholder,\n maxLength,\n keepOpened,\n inputClass,\n disableRecent,\n tabIndex,\n value,\n customEmojis,\n language,\n searchMention,\n buttonElement,\n buttonRef,\n shouldReturn,\n shouldConvertEmojiToImage,\n // style\n borderRadius,\n borderColor,\n fontSize,\n fontFamily,\n background,\n placeholderColor,\n color,\n } = props;\n\n /** @type {React.MutableRefObject<import('./text-input').Ref | null>} */\n const textInputRef = useRef(null);\n\n const { addEventListener, listeners } = useEventListeners();\n\n const { addSanitizeFn, sanitize, sanitizedTextRef } = useSanitize(shouldReturn, shouldConvertEmojiToImage);\n\n const { addPolluteFn, pollute } = usePollute();\n\n const updateHTML = useCallback(\n (nextValue = \"\") => {\n if (textInputRef.current === null) return;\n\n textInputRef.current.html = replaceAllTextEmojis(nextValue);\n sanitizedTextRef.current = nextValue;\n },\n [sanitizedTextRef]\n );\n\n const setValue = useCallback(\n /**\n * \n * @param {string} value\n */\n (value) => {\n updateHTML(value);\n },\n [updateHTML]\n );\n\n const emitChange = useEmit(textInputRef, onResize, onChange);\n\n useExpose({\n ref,\n setValue,\n textInputRef,\n emitChange,\n shouldConvertEmojiToImage\n });\n\n useEffect(() => {\n if (sanitizedTextRef.current !== value) {\n setValue(value);\n }\n }, [sanitizedTextRef, setValue, value]);\n\n // useEffect(() => {\n // updateHTML();\n // }, [updateHTML]);\n\n useEffect(() => {\n /**\n * Handle keydown event\n * @param {React.KeyboardEvent} event\n * @return {boolean}\n */\n function handleKeydown(event) {\n if (\n typeof maxLength !== \"undefined\" &&\n event.key !== \"Backspace\" &&\n textInputRef.current !== null &&\n totalCharacters(textInputRef.current) >= maxLength\n ) {\n event.preventDefault();\n }\n\n if (event.key === \"Enter\" && textInputRef.current) {\n event.preventDefault();\n\n const text = sanitize(textInputRef.current.html);\n\n emitChange(sanitizedTextRef.current);\n\n if (\n typeof onEnter === \"function\" &&\n listeners.enter.currentListerners.length === 0\n ) {\n onEnter(text);\n }\n\n if (cleanOnEnter && listeners.enter.currentListerners.length === 0) {\n updateHTML(\"\");\n }\n\n if (typeof onKeyDown === \"function\") {\n onKeyDown(event.nativeEvent);\n }\n\n return false;\n }\n\n if (typeof onKeyDown === \"function\") {\n onKeyDown(event.nativeEvent);\n }\n\n return true;\n }\n\n const unsubscribe = addEventListener(\"keyDown\", handleKeydown);\n\n return () => {\n unsubscribe();\n };\n }, [\n addEventListener,\n cleanOnEnter,\n emitChange,\n listeners.enter.currentListerners.length,\n maxLength,\n onEnter,\n onKeyDown,\n sanitize,\n sanitizedTextRef,\n updateHTML\n ]);\n\n useEffect(() => {\n /** */\n function handleFocus() {\n if (typeof onClick === \"function\") {\n onClick();\n }\n\n if (typeof onFocus === \"function\") {\n onFocus();\n }\n }\n\n const unsubscribe = addEventListener(\"focus\", handleFocus);\n\n return () => {\n unsubscribe();\n };\n }, [addEventListener, onClick, onFocus]);\n\n useEffect(() => {\n /** */\n function handleBlur() {\n if (typeof onBlur === \"function\") {\n onBlur();\n }\n }\n\n const unsubscribe = addEventListener(\"blur\", handleBlur);\n\n return () => {\n unsubscribe();\n };\n }, [addEventListener, onBlur]);\n\n /**\n *\n * @param {string} html\n */\n function handleTextInputChange(html) {\n sanitize(html);\n\n if (value !== sanitizedTextRef.current) {\n emitChange(sanitizedTextRef.current);\n }\n }\n\n /**\n *\n * @param {string} html\n */\n function appendContent(html) {\n if (\n typeof maxLength !== \"undefined\" &&\n textInputRef.current !== null &&\n totalCharacters(textInputRef.current) >= maxLength\n ) {\n return;\n }\n\n if (textInputRef.current !== null) {\n textInputRef.current.appendContent(html);\n }\n }\n\n /**\n * Handle past on input\n * @param {React.ClipboardEvent} event\n */\n function handlePaste(event) {\n event.preventDefault();\n let content;\n if (event.clipboardData) {\n content = event.clipboardData.getData(\"text/plain\");\n content = pollute(content);\n document.execCommand(\"insertHTML\", false, content);\n }\n }\n\n return (\n <div className=\"react-emoji\">\n <MentionWrapper\n searchMention={searchMention}\n addEventListener={addEventListener}\n appendContent={appendContent}\n addSanitizeFn={addSanitizeFn}\n />\n <TextInput\n ref={textInputRef}\n onCopy={handleCopy}\n onPaste={handlePaste}\n shouldReturn={shouldReturn}\n onBlur={listeners.blur.publish}\n onFocus={listeners.focus.publish}\n onArrowUp={listeners.arrowUp.publish}\n onArrowDown={listeners.arrowDown.publish}\n onKeyUp={listeners.keyUp.publish}\n onKeyDown={listeners.keyDown.publish}\n onEnter={listeners.enter.publish}\n placeholder={placeholder}\n style={{\n borderRadius,\n borderColor,\n fontSize,\n fontFamily,\n background,\n placeholderColor,\n color\n }}\n tabIndex={tabIndex}\n className={inputClass}\n onChange={handleTextInputChange}\n />\n <EmojiPickerWrapper\n theme={theme}\n keepOpened={keepOpened}\n disableRecent={disableRecent}\n customEmojis={customEmojis}\n addSanitizeFn={addSanitizeFn}\n addPolluteFn={addPolluteFn}\n appendContent={appendContent}\n buttonElement={buttonElement}\n buttonRef={buttonRef}\n language={language}\n />\n </div>\n );\n}\n\nconst InputEmojiWithRef = forwardRef(InputEmoji);\n\nInputEmojiWithRef.defaultProps = {\n theme: /** @type {const} */ (\"auto\"),\n height: 30,\n placeholder: \"Type a message\",\n borderRadius: 21,\n borderColor: \"#EAEAEA\",\n color: \"black\",\n fontSize: 15,\n fontFamily: \"sans-serif\",\n background: \"white\",\n tabIndex: 0,\n shouldReturn: false,\n shouldConvertEmojiToImage: false,\n customEmojis: [],\n language: undefined,\n};\n\nexport default InputEmojiWithRef;\n"],"names":["styleInject","css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","TRANSPARENT_GIF","replaceAllTextEmojis","text","allEmojis","getAllEmojisFromText","Set","forEach","emoji","replaceAll","getInputEmojiHTML","str","find","replace","RegExp","match","getImageEmoji","emojiPickerEl","querySelector","getInputEmojiNativeHTML","native","emojiSpanEl","shadowRoot","name","replaceAllTextEmojiToString","html","container","innerHTML","images","Array","prototype","slice","call","querySelectorAll","image","outerHTML","dataset","handleCopy","event","selectedText","window","getSelection","i","len","rangeCount","getRangeAt","cloneContents","replaceEmojiToString","clipboardData","setData","innerText","preventDefault","currentRangeCached","cacheCurrentRange","selection","anchorNode","parentNode","range","cloneRange","handlePasteHtmlAtCaret","sel","deleteContents","el","frag","createDocumentFragment","node","lastNode","insertNode","setStartAfter","collapse","removeAllRanges","addRange","totalCharacters","textCount","length","emojisCount","removeHtmlExceptBr","inputDiv","temp","tempContainer","stripped","final","getSelectionStart","startContainer","offset","startOffset","nodeType","Node","TEXT_NODE","nextSibling","commonAncestorContainer","getCursor","selectionStart","addLineBreak","isCollapsed","textContent","br","setEndAfter","br2","setStart","setEnd","string","regexpOrSubstr","newValueOrFn","globalOffset","Error","fn","replaceUsingString","replaceUsingRegexp","patternString","index","indexOf","arr","endIndex","push","substring","regexp","output","replacerIsFn","storedLastIndex","lastIndex","result","exec","out","apply","concat","input","global","module","stringReplaceToArray","stringOrArray","newSubStrOrFn","isArray","TypeError","arrayItem","re","toCodePoint","unicodeSurrogates","sep","r","c","p","charCodeAt","toString","join","UFE0Fg","U200D","String","fromCharCode","grabTheRightIcon","rawText","replaceEmoji","render","replaceStringToArray","emojiReplacer","_","icon","require","pageProtocol","location","protocol","emojiStyle","height","width","margin","verticalAlign","normalizeProtocol","charAt","makeTwemojiRenderer","options","merge","baseUrl","size","ext","props","renderTwemoji","src","key","alt","draggable","arguments","source","Object","hasOwnProperty","reactEasyEmoji","element","optionsOrFn","EMOJI_REGEX","useSanitize","shouldReturn","shouldConvertEmojiToImage","sanitizeFnsRef","useRef","sanitizedTextRef","addSanitizeFn","useCallback","current","sanitize","reduce","acc","replaceAllHtmlToString","convertEmojiToImage","handleEmoji","renderToString","useExpose","textInputRef","setValue","emitChange","useImperativeHandle","value","focus","blur","useEmit","onResize","onChange","currentSizeRef","onChangeFn","checkAndEmitResize","currentSize","nextSize","sanitizedText","useEffect","TextInput","placeholder","tabIndex","className","appendContent","placeholderRef","visibility","offsetWidth","offsetHeight","placeholderStyle","useMemo","placeholderColor","color","inputStyle","handleKeyDown","shiftKey","ctrlKey","onEnter","onArrowUp","onArrowDown","onKeyDown","handleClick","onFocus","handleKeyUp","onKeyUp","React","onClick","contentEditable","onBlur","onCopy","onPaste","TextInputWithRef","forwardRef","EmojiPickerButton","showPicker","toggleShowPicker","buttonElement","buttonRef","localButtonRef","showCustomButtonContent","setShowCustomButtonContent","useState","childNodes","xmlns","viewBox","d","$e5534fc185f7111e$export$2e2bcd8739ae039","$dvPge$useRef","instance","update","$dvPge$useEffect","$dvPge$Picker","$dvPge$react","EMOJI_MART_DATA_URL","cacheI18n","EmojiPicker","theme","onSelectEmoji","disableRecent","customEmojis","language","categories","categoryies","i18n","setI18n","undefined","en","fetch","then","data","translations","json","catch","error","console","Picker","previewPosition","onEmojiSelect","custom","set","memo","EmojiPickerContainer","handleSelectEmoji","position","evt","stopPropagation","top","EMOJI_PICKER_CONTAINER_HEIGHT","EmojiPickerWrapper","keepOpened","addPolluteFn","setShowPicker","customButton","setCustomButton","emojiPickerPosition","setEmojiPickerPosition","checkClickOutside","target","classList","contains","addEventListener","removeEventListener","calcTopPosition","currentShowPicker","btn","currentTarget","btnRect","getBoundingClientRect","popoverHeight","ReactDOM","createPortal","Fragment","getTextFromAtToCaret","getRangeFromAtToCaret","begin","end","deleteTextFromAtToCaret","deleteData","elementWithFocus","getElementWithFocus","caretOffset","lastAt","lastIndexOf","preCaretRange","selectNodeContents","endContainer","endOffset","textRange","createRange","preCaretTextRange","body","createTextRange","moveToElementText","setEndPoint","useMention","searchMention","loading","setLoading","mentionUsers","setMentionUsers","mentionSearchText","setMentionSearchText","onSelectUser","checkMentionText","metionText","users","parentElement","hasAttribute","remove","includes","MentionUserList","onSelect","selectedUser","setSelectedUser","prevUser","currentSelectedUser","nextUser","getMentionSelectedNameEl","rest","usersFiltered","searchText","toLocaleLowerCase","map","user","nameHtml","toLowerCase","startsWith","names","split","unsubscribe","id","onMouseOver","dangerouslySetInnerHTML","__html","MentionUserListWithRef","MentionWrapper","metionUserListRef","showUserList","setShowUserList","mentionsEl","mentionEl","mentionName","mentionId","unsubscribeArrowUp","unsubscribeArrowDown","handleSelect","createObserver","listeners","subscribe","listener","filter","l","publish","currentListerners","useEventListeners","keyDown","keyUp","arrowUp","arrowDown","enter","usePollute","polluteFnsRef","pollute","InputEmoji","cleanOnEnter","maxLength","inputClass","borderRadius","borderColor","fontSize","fontFamily","background","updateHTML","nextValue","handleKeydown","nativeEvent","handleFocus","handleBlur","handleTextInputChange","handlePaste","content","getData","execCommand","InputEmojiWithRef","defaultProps"],"mappings":";;;;;;;;;;;AAAA,SAASA,WAAWA,CAACC,GAAG,EAAEC,GAAG,EAAE;EAC7B,IAAKA,GAAG,KAAK,KAAK,CAAC,EAAGA,GAAG,GAAG,EAAE,CAAA;AAC9B,EAAA,IAAIC,QAAQ,GAAGD,GAAG,CAACC,QAAQ,CAAA;AAE3B,EAAA,IAAI,CAACF,GAAG,IAAI,OAAOG,QAAQ,KAAK,WAAW,EAAE;AAAE,IAAA,OAAA;AAAQ,GAAA;AAEvD,EAAA,IAAIC,IAAI,GAAGD,QAAQ,CAACC,IAAI,IAAID,QAAQ,CAACE,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAA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AA;AAAS,GACpB,CACE,CAAC,CAAA;AAEV,CAAA;AAEA,MAAMmK,iBAAiB,gBAAG/L,gBAAU,CAAC2K,UAAU,EAAC;AAEhDoB,iBAAiB,CAACC,YAAY,GAAG;EAC/BxK,KAAK,sBAAwB,MAAO;AACpCpH,EAAAA,MAAM,EAAE,EAAE;AACV6D,EAAAA,WAAW,EAAE,gBAAgB;AAC7B8M,EAAAA,YAAY,EAAE,EAAE;AAChBC,EAAAA,WAAW,EAAE,SAAS;AACtBpM,EAAAA,KAAK,EAAE,OAAO;AACdqM,EAAAA,QAAQ,EAAE,EAAE;AACZC,EAAAA,UAAU,EAAE,YAAY;AACxBC,EAAAA,UAAU,EAAE,OAAO;AACnBjN,EAAAA,QAAQ,EAAE,CAAC;AACXnC,EAAAA,YAAY,EAAE,KAAK;AACnBC,EAAAA,yBAAyB,EAAE,KAAK;AAChC2F,EAAAA,YAAY,EAAE,EAAE;AAChBC,EAAAA,QAAQ,EAAEK,SAAAA;AACZ,CAAC;;;;"}
|
1
|
+
{"version":3,"file":"index.js","sources":["../node_modules/style-inject/dist/style-inject.es.js","../src/utils/emoji-utils.js","../src/utils/input-event-utils.js","../node_modules/string-replace-to-array/string-replace-to-array.js","../node_modules/react-easy-emoji/lib/replaceEmoji.js","../node_modules/react-easy-emoji/lib/makeTwemojiRenderer.js","../node_modules/react-easy-emoji/index.js","../src/hooks/use-sanitize.js","../src/hooks/use-expose.js","../src/hooks/use-emit.js","../src/text-input.js","../src/components/emoji-picker-button.js","../node_modules/@emoji-mart/react/dist/module.js","../src/components/emoji-picker.js","../src/components/emoji-picker-container.js","../src/components/emoji-picker-wrapper.js","../src/utils/mention-utils.js","../src/hooks/use-mention.js","../src/components/mention-user-list.js","../src/components/mention-wrapper.js","../src/utils/observer.js","../src/hooks/use-event-listeners.js","../src/hooks/user-pollute.js","../src/index.js"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n","/* eslint-disable valid-jsdoc */\n// @ts-check\n\nexport const TRANSPARENT_GIF =\n \"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7\";\n\nexport const EMOJI_STYLE = \"\";\n\n/**\n * Replace all text with emoji with an image html tag\n * @param {string} text\n * @return {string}\n */\nexport function replaceAllTextEmojis(text) {\n let allEmojis = getAllEmojisFromText(text);\n\n if (allEmojis) {\n allEmojis = [...new Set(allEmojis)]; // remove duplicates\n\n allEmojis.forEach(emoji => {\n text = replaceAll(text, emoji, getInputEmojiHTML('', emoji));\n });\n }\n\n return text;\n}\n\n/**\n * Replace all occurrencies in a string\n * @param {string} str\n * @param {string} find\n * @param {string} replace\n * @return {string}\n */\nfunction replaceAll(str, find, replace) {\n return str.replace(new RegExp(find, \"g\"), replace);\n}\n\n/**\n * Get all emojis from the text\n * @param {string} text\n * @return {string[]}\n */\nfunction getAllEmojisFromText(text) {\n return text.match(\n /(?:[\\u2700-\\u27bf]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|\\ud83c[\\udffb-\\udfff])?(?:\\u200d(?:[^\\ud800-\\udfff]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|\\ud83c[\\udffb-\\udfff])?)*/g\n );\n}\n\n// eslint-disable-next-line valid-jsdoc\n/**\n *\n * @param { import(\"../types/types\").EmojiMartItem } emoji\n * @return {string}\n */\nexport function getImageEmoji(emoji) {\n /** @type {HTMLElement | null} */\n const emojiPickerEl = document.querySelector('em-emoji-picker')\n\n if (!emojiPickerEl) {\n return getInputEmojiNativeHTML(emoji.native)\n }\n\n /** @type {HTMLSpanElement | null=} */\n const emojiSpanEl = emojiPickerEl?.shadowRoot?.querySelector(`[title=\"${emoji.name}\"] > span > span`)\n\n if (!emojiSpanEl) {\n return getInputEmojiNativeHTML(emoji.native)\n }\n\n const style = replaceAll(emojiSpanEl.style.cssText, '\"', \"'\");\n\n return getInputEmojiHTML(style, emoji.native);\n}\n\n// eslint-disable-next-line valid-jsdoc\n/**\n *\n * @param {string} style\n * @param {string} emoji\n * @returns\n */\nfunction getInputEmojiHTML(style, emoji) {\n return `<img style=\"${style}; display: inline-block\" data-emoji=\"${emoji}\" src=\"${TRANSPARENT_GIF}\" />`;\n}\n\n/**\n * \n * @param {string} emoji \n * @returns \n */\nfunction getInputEmojiNativeHTML(emoji) {\n return `<span class=\"width: 18px; height: 18px; display: inline-block; margin: 0 1px;\">${emoji}</span>`;\n}\n\n/**\n *\n * @param {string} html\n * @return {string}\n */\nexport function replaceAllTextEmojiToString(html) {\n const container = document.createElement(\"div\");\n container.innerHTML = html;\n\n const images = Array.prototype.slice.call(container.querySelectorAll(\"img\"));\n\n images.forEach(image => {\n container.innerHTML = container.innerHTML.replace(\n image.outerHTML,\n image.dataset.emoji\n );\n });\n\n return container.innerHTML;\n}\n","// @ts-check\n\nimport {\n getImageEmoji,\n replaceAllTextEmojis,\n replaceAllTextEmojiToString,\n} from \"./emoji-utils\";\n\n/**\n * Handle copy of current selected text\n * @param {React.ClipboardEvent} event\n */\nexport function handleCopy(event) {\n const selectedText = window.getSelection();\n\n if (selectedText === null) {\n return;\n }\n\n let container = document.createElement(\"div\");\n\n for (let i = 0, len = selectedText.rangeCount; i < len; ++i) {\n container.appendChild(selectedText.getRangeAt(i).cloneContents());\n }\n\n container = replaceEmojiToString(container);\n\n event.clipboardData.setData(\"text\", container.innerText);\n event.preventDefault();\n}\n\n/** @type {Range|undefined} */\n/** @type {Range|undefined} */\nlet currentRangeCached;\n\n/**\n * Caches the current text selection range\n */\nexport function cacheCurrentRange() {\n const selection = window.getSelection();\n if (!selection.rangeCount || (selection?.anchorNode['className'] !== 'react-input-emoji--input' && selection.anchorNode.parentNode['className'] !== 'react-input-emoji--input')) return;\n const range = selection.getRangeAt(0);\n\n currentRangeCached = range.cloneRange();\n}\n\n/**\n * Clears the cached text selection range\n */\nexport function cleanCurrentRange() {\n currentRangeCached = undefined;\n}\n\n/**\n * @param {string} html - HTML string to be pasted at the caret position\n */\nexport function handlePasteHtmlAtCaret(html) {\n let sel;\n let range;\n if (window.getSelection) {\n // IE9 and non-IE\n sel = window.getSelection();\n\n if (sel === null) return;\n\n if (sel.getRangeAt && sel.rangeCount) {\n range = currentRangeCached ?? sel.getRangeAt(0);\n range.deleteContents();\n\n // Range.createContextualFragment() would be useful here but is\n // non-standard and not supported in all browsers (IE9, for one)\n const el = document.createElement(\"div\");\n el.innerHTML = html;\n const frag = document.createDocumentFragment();\n let node;\n let lastNode;\n while ((node = el.firstChild)) {\n lastNode = frag.appendChild(node);\n }\n range.insertNode(frag);\n\n // Preserve the selection\n if (lastNode) {\n range = range.cloneRange();\n currentRangeCached = range\n range.setStartAfter(lastNode);\n range.collapse(true);\n sel.removeAllRanges();\n sel.addRange(range);\n }\n }\n }\n}\n\n/**\n * Replace emoji img to its string value\n * @param {HTMLDivElement} container\n * @return {HTMLDivElement}\n */\nfunction replaceEmojiToString(container) {\n const images = Array.prototype.slice.call(container.querySelectorAll(\"img\"));\n\n images.forEach((image) => {\n image.outerHTML = image.dataset.emoji;\n });\n\n return container;\n}\n\n/**\n * Handle past on input\n * @param {React.ClipboardEvent} event\n */\nexport function handlePaste(event) {\n event.preventDefault();\n let content;\n if (event.clipboardData) {\n content = event.clipboardData.getData(\"text/plain\");\n content = replaceAllTextEmojis(content);\n document.execCommand(\"insertHTML\", false, content);\n }\n}\n\n/**\n * @typedef {object} HandleKeyDownOptions\n * @property {HTMLDivElement} placeholderEl\n * @property {number} maxLength\n * @property {HTMLDivElement} inputEl\n * @property {React.MutableRefObject<string>} cleanedTextRef\n * @property {React.MutableRefObject<HTMLDivElement>} textInputRef\n * @property {boolean} cleanOnEnter\n * @property {function(): void} emitChange\n * @property {(function(string): void)=} onEnter\n * @property {(function(KeyboardEvent): void)=} onKeyDown\n * @property {(function(string): void)} updateHTML\n */\n\n// eslint-disable-next-line valid-jsdoc\n/**\n * @typedef {Object} HandleSelectEmojiProps\n * @property {import(\"../types/types\").EmojiMartItem} emoji\n * @property {React.MutableRefObject<import('../text-input').Ref>} textInputRef\n * @property {boolean} keepOpened\n * @property {() => void} toggleShowPicker\n * @property {number=} maxLength\n */\n\n/**\n *\n * @param {HandleSelectEmojiProps} props\n */\nexport function handleSelectEmoji({\n emoji,\n textInputRef,\n keepOpened,\n toggleShowPicker,\n maxLength,\n}) {\n if (\n typeof maxLength !== \"undefined\" &&\n totalCharacters(textInputRef.current) >= maxLength\n ) {\n return;\n }\n\n textInputRef.current.appendContent(getImageEmoji(emoji));\n\n if (!keepOpened) {\n toggleShowPicker();\n }\n}\n\n/**\n *\n * @param {{text: string, html: string}} props\n * @return {number}\n */\nexport function totalCharacters({ text, html }) {\n const textCount = text.length;\n const emojisCount = (html.match(/<img/g) || []).length;\n\n return textCount + emojisCount;\n}\n\n// eslint-disable-next-line valid-jsdoc\n/**\n * Handle keyup event\n * @param {() => void} emitChange\n * @param {(event: KeyboardEvent) => void} onKeyDownMention\n * @param {React.MutableRefObject<string>} cleanedTextRef\n * @param {React.MutableRefObject<HTMLDivElement>} textInputRef\n * @return {(event: KeyboardEvent) => void}\n */\nexport function handleKeyup(\n emitChange,\n onKeyDownMention,\n cleanedTextRef,\n textInputRef,\n) {\n return (event) => {\n const text = replaceAllTextEmojiToString(textInputRef.current.innerHTML);\n cleanedTextRef.current = text;\n emitChange();\n onKeyDownMention(event);\n };\n}\n\n/**\n * Handle focus event\n * @param {function(FocusEvent): void} onFocus\n * @return {function(FocusEvent): void}\n */\nexport function handleFocus(onFocus) {\n return (event) => {\n onFocus(event);\n };\n}\n\n/**\n * Set caret to the end of text value\n * @param {React.MutableRefObject<HTMLDivElement| null>} input\n */\nexport function moveCaretToEnd(input) {\n let range;\n let selection;\n if (document.createRange && input.current) {\n range = document.createRange();\n range.selectNodeContents(input.current);\n range.collapse(false);\n selection = window.getSelection();\n if (selection) {\n selection.removeAllRanges();\n selection.addRange(range);\n }\n }\n}\n/**\n *\n * @param {HTMLDivElement} inputDiv\n * @return {string}\n */\nexport function removeHtmlExceptBr(inputDiv) {\n const temp = inputDiv.innerHTML.replaceAll(/<br\\s*\\/?>/gi, \"[BR]\"); // temporarily replace <br> with placeholder\n const tempContainer = document.createElement(\"div\");\n tempContainer.innerHTML = temp;\n const stripped = tempContainer.innerText; // strip all html tags\n const final = stripped.replaceAll(/\\[BR\\]/gi, \"</br>\"); // replace placeholders with <br>\n return final;\n}\n\n/**\n * \n * @param {*} range \n * @returns \n */\nexport function getSelectionStart(range) {\n let node = range.startContainer;\n let offset = range.startOffset;\n\n // Handle cases where the selection start node is not a text node\n if (node.nodeType !== Node.TEXT_NODE) {\n while (node.nodeType !== Node.TEXT_NODE) {\n node = node.nextSibling;\n if (!node) break;\n }\n if (!node) {\n node = range.commonAncestorContainer;\n while (node.nodeType !== Node.TEXT_NODE) {\n node = node.firstChild;\n }\n }\n offset = 0;\n }\n\n return { node, offset };\n}\n\n/**\n * \n * @return {Object} cursor\n */\nexport function getCursor() {\n const selection = window.getSelection();\n const range = selection.getRangeAt(0);\n const selectionStart = getSelectionStart(range);\n\n return {selection, range, selectionStart}\n}\n\n/**\n *\n */\nexport function addLineBreak() {\n const { selection, range, selectionStart } = getCursor()\n\n // If cursor is at the end of the text content, add one more line break\n if (\n selection.isCollapsed &&\n selectionStart.offset === selectionStart.node.textContent.length\n ) {\n const br = document.createElement(\"br\");\n range.insertNode(br);\n range.setStartAfter(br);\n range.setEndAfter(br);\n selection.removeAllRanges();\n selection.addRange(range);\n\n const br2 = document.createElement(\"br\");\n range.insertNode(br2);\n range.setStartAfter(br2);\n range.setEndAfter(br2);\n selection.removeAllRanges();\n selection.addRange(range);\n } else {\n const br = document.createElement(\"br\");\n range.insertNode(br);\n range.setStartAfter(br);\n range.setEndAfter(br);\n selection.removeAllRanges();\n selection.addRange(range);\n // Set cursor position right before the first letter after the line break\n if (\n selectionStart.node.nextSibling &&\n selectionStart.node.nextSibling.nodeType === Node.TEXT_NODE\n ) {\n range.setStart(selectionStart.node.nextSibling, 1);\n range.setEnd(selectionStart.node.nextSibling, 1);\n }\n selection.removeAllRanges();\n selection.addRange(range);\n }\n}\n","// Inspiration: https://github.com/facebook/react/issues/3386\n\nfunction replace (string, regexpOrSubstr, newValueOrFn, globalOffset) {\n\tif (typeof string !== 'string') throw new Error('First param must be a string')\n\tif (typeof regexpOrSubstr !== 'string' && !(regexpOrSubstr instanceof RegExp)) throw new Error('Second param must be a string pattern or a regular expression')\n\n\tvar fn = (typeof regexpOrSubstr === 'string') ? replaceUsingString : replaceUsingRegexp\n\n\treturn fn(string, regexpOrSubstr, newValueOrFn, globalOffset)\n}\n\nfunction replaceUsingString (string, patternString, newValueOrFn, globalOffset) {\n\tvar index = string.indexOf(patternString)\n\n\tif (index >= 0) {\n\t\tvar arr = []\n\t\tvar endIndex = index + patternString.length\n\n\t\tif (index > 0) {\n\t\t\tarr.push(string.substring(0, index))\n\t\t}\n\n\t\tarr.push(\n\t\t\t(typeof newValueOrFn === 'function') ?\n\t\t\t\tnewValueOrFn(\n\t\t\t\t\tstring.substring(index, endIndex),\n\t\t\t\t\tindex + globalOffset,\n\t\t\t\t\tstring\n\t\t\t\t) :\n\t\t\t\tnewValueOrFn\n\t\t)\n\n\t\tif (endIndex < string.length) {\n\t\t\tarr.push(string.substring(endIndex))\n\t\t}\n\n\t\treturn arr\n\t} else {\n\t\treturn [string]\n\t}\n}\n\nfunction replaceUsingRegexp (string, regexp, newValueOrFn, globalOffset) {\n\tvar output = []\n\n\tvar replacerIsFn = (typeof newValueOrFn === 'function')\n\n\tvar storedLastIndex = regexp.lastIndex\n\tregexp.lastIndex = 0\n\n\tvar result\n\tvar lastIndex = 0\n\twhile (result = regexp.exec(string)) {\n\t\tvar index = result.index\n\n\t\tif (result[0] === '') {\n\t\t\t// When the regexp is an empty string\n\t\t\t// we still want to advance our cursor to the next item.\n\t\t\t// This is the behavior of String.replace.\n\t\t\tregexp.lastIndex++\n\t\t}\n\n\t\tif (index !== lastIndex) {\n\t\t\toutput.push(string.substring(lastIndex, index))\n\t\t}\n\n\t\tvar match = result[0]\n\t\tlastIndex = index + match.length\n\t\t\n\t\tvar out = replacerIsFn ?\n\t\t\tnewValueOrFn.apply(this, result.concat(index + globalOffset, result.input)) :\n\t\t\tnewValueOrFn\n\t\toutput.push(out)\n\n\t\tif (!regexp.global) {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif (lastIndex < string.length) {\n\t\toutput.push(string.substring(lastIndex))\n\t}\n\n\tregexp.lastIndex = storedLastIndex\n\treturn output\n}\n\nmodule.exports = function stringReplaceToArray (stringOrArray, regexpOrSubstr, newSubStrOrFn) {\n\tif (typeof stringOrArray === 'string') {\n\t\treturn replace(stringOrArray, regexpOrSubstr, newSubStrOrFn, 0)\n\t} else if (!Array.isArray(stringOrArray) || !stringOrArray[0]) {\n\t\tthrow new TypeError('First argument must be an array or non-empty string')\n\t} else {\n\t\tvar len = stringOrArray.length\n\t\tvar output = []\n\t\tvar globalOffset = 0\n\t\tfor (var i = 0; i < len; ++i) {\n\t\t\tvar arrayItem = stringOrArray[i]\n\t\t\tif (typeof arrayItem === 'string') {\n\t\t\t\toutput.push.apply(output, replace(arrayItem, regexpOrSubstr, newSubStrOrFn, globalOffset))\n\t\t\t\tglobalOffset += arrayItem.length\n\t\t\t} else {\n\t\t\t\toutput.push(arrayItem)\n\t\t\t}\n\t\t}\n\t\treturn output\n\t}\n}","var replaceStringToArray = require('string-replace-to-array')\n\n// This is based off of https://github.com/twitter/twemoji/blob/gh-pages/2/twemoji.js\n//\n// Ideally we'd use twemoji instead of replicating its logic.\n// The reason we can't is that we need to run our own replace.\n//\n// We could use it for most things (by essentially running twemoji.parse for each\n// regex match, and reading the code from the callback), but the one thing we'd always need\n// to copy and paste into this file is the regex since we need it to run the replace.\n//\n// Another option is to fork twemoji and expose a method in it that could help us, then\n// ask them to pull it in.\n//\n\n// RegExp based on emoji's official Unicode standards\n// http://www.unicode.org/Public/UNIDATA/EmojiSources.txt\nvar re = /(?:\\ud83d\\udc68\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83e\\uddd1\\ud83c[\\udffc-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83e\\uddd1\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83e\\uddd1\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83e\\uddd1\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83e\\uddd1\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udffe]|\\ud83d\\udc68\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffb\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffc-\\udfff]|\\ud83d\\udc68\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffc\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83d\\udc68\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffd\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83d\\udc68\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udffe\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83d\\udc68\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\ud83c\\udfff\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udffe]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffc-\\udfff]|\\ud83d\\udc69\\ud83c\\udffb\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc69\\ud83c[\\udffc-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83d\\udc69\\ud83c\\udffc\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc69\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83d\\udc69\\ud83c\\udffd\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc69\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83d\\udc69\\ud83c\\udffe\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc68\\ud83c[\\udffb-\\udffe]|\\ud83d\\udc69\\ud83c\\udfff\\u200d\\ud83e\\udd1d\\u200d\\ud83d\\udc69\\ud83c[\\udffb-\\udffe]|\\ud83e\\uddd1\\ud83c\\udffb\\u200d\\u2764\\ufe0f\\u200d\\ud83e\\uddd1\\ud83c[\\udffc-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffb\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffc\\u200d\\u2764\\ufe0f\\u200d\\ud83e\\uddd1\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffc\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffd\\u200d\\u2764\\ufe0f\\u200d\\ud83e\\uddd1\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83e\\uddd1\\ud83c\\udffd\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udfff]|\\ud83e\\uddd1\\ud83c\\udffe\\u200d\\u2764\\ufe0f\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83e\\uddd1\\ud83c\\udffe\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udfff]|\\ud83e\\uddd1\\ud83c\\udfff\\u200d\\u2764\\ufe0f\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udffe]|\\ud83e\\uddd1\\ud83c\\udfff\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc68\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d\\udc68|\\ud83d\\udc69\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc8b\\u200d\\ud83d[\\udc68\\udc69]|\\ud83e\\udef1\\ud83c\\udffb\\u200d\\ud83e\\udef2\\ud83c[\\udffc-\\udfff]|\\ud83e\\udef1\\ud83c\\udffc\\u200d\\ud83e\\udef2\\ud83c[\\udffb\\udffd-\\udfff]|\\ud83e\\udef1\\ud83c\\udffd\\u200d\\ud83e\\udef2\\ud83c[\\udffb\\udffc\\udffe\\udfff]|\\ud83e\\udef1\\ud83c\\udffe\\u200d\\ud83e\\udef2\\ud83c[\\udffb-\\udffd\\udfff]|\\ud83e\\udef1\\ud83c\\udfff\\u200d\\ud83e\\udef2\\ud83c[\\udffb-\\udffe]|\\ud83d\\udc68\\u200d\\u2764\\ufe0f\\u200d\\ud83d\\udc68|\\ud83d\\udc69\\u200d\\u2764\\ufe0f\\u200d\\ud83d[\\udc68\\udc69]|\\ud83e\\uddd1\\u200d\\ud83e\\udd1d\\u200d\\ud83e\\uddd1|\\ud83d\\udc6b\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc6c\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc6d\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc8f\\ud83c[\\udffb-\\udfff]|\\ud83d\\udc91\\ud83c[\\udffb-\\udfff]|\\ud83e\\udd1d\\ud83c[\\udffb-\\udfff]|\\ud83d[\\udc6b-\\udc6d\\udc8f\\udc91]|\\ud83e\\udd1d)|(?:\\ud83d[\\udc68\\udc69]|\\ud83e\\uddd1)(?:\\ud83c[\\udffb-\\udfff])?\\u200d(?:\\u2695\\ufe0f|\\u2696\\ufe0f|\\u2708\\ufe0f|\\ud83c[\\udf3e\\udf73\\udf7c\\udf84\\udf93\\udfa4\\udfa8\\udfeb\\udfed]|\\ud83d[\\udcbb\\udcbc\\udd27\\udd2c\\ude80\\ude92]|\\ud83e[\\uddaf-\\uddb3\\uddbc\\uddbd])|(?:\\ud83c[\\udfcb\\udfcc]|\\ud83d[\\udd74\\udd75]|\\u26f9)((?:\\ud83c[\\udffb-\\udfff]|\\ufe0f)\\u200d[\\u2640\\u2642]\\ufe0f)|(?:\\ud83c[\\udfc3\\udfc4\\udfca]|\\ud83d[\\udc6e\\udc70\\udc71\\udc73\\udc77\\udc81\\udc82\\udc86\\udc87\\ude45-\\ude47\\ude4b\\ude4d\\ude4e\\udea3\\udeb4-\\udeb6]|\\ud83e[\\udd26\\udd35\\udd37-\\udd39\\udd3d\\udd3e\\uddb8\\uddb9\\uddcd-\\uddcf\\uddd4\\uddd6-\\udddd])(?:\\ud83c[\\udffb-\\udfff])?\\u200d[\\u2640\\u2642]\\ufe0f|(?:\\ud83d\\udc68\\u200d\\ud83d\\udc68\\u200d\\ud83d\\udc66\\u200d\\ud83d\\udc66|\\ud83d\\udc68\\u200d\\ud83d\\udc68\\u200d\\ud83d\\udc67\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc68\\u200d\\ud83d\\udc69\\u200d\\ud83d\\udc66\\u200d\\ud83d\\udc66|\\ud83d\\udc68\\u200d\\ud83d\\udc69\\u200d\\ud83d\\udc67\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc69\\u200d\\ud83d\\udc69\\u200d\\ud83d\\udc66\\u200d\\ud83d\\udc66|\\ud83d\\udc69\\u200d\\ud83d\\udc69\\u200d\\ud83d\\udc67\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc68\\u200d\\ud83d\\udc66\\u200d\\ud83d\\udc66|\\ud83d\\udc68\\u200d\\ud83d\\udc67\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc68\\u200d\\ud83d\\udc68\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc68\\u200d\\ud83d\\udc69\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc69\\u200d\\ud83d\\udc66\\u200d\\ud83d\\udc66|\\ud83d\\udc69\\u200d\\ud83d\\udc67\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc69\\u200d\\ud83d\\udc69\\u200d\\ud83d[\\udc66\\udc67]|\\ud83c\\udff3\\ufe0f\\u200d\\u26a7\\ufe0f|\\ud83c\\udff3\\ufe0f\\u200d\\ud83c\\udf08|\\ud83d\\ude36\\u200d\\ud83c\\udf2b\\ufe0f|\\u2764\\ufe0f\\u200d\\ud83d\\udd25|\\u2764\\ufe0f\\u200d\\ud83e\\ude79|\\ud83c\\udff4\\u200d\\u2620\\ufe0f|\\ud83d\\udc15\\u200d\\ud83e\\uddba|\\ud83d\\udc3b\\u200d\\u2744\\ufe0f|\\ud83d\\udc41\\u200d\\ud83d\\udde8|\\ud83d\\udc68\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc69\\u200d\\ud83d[\\udc66\\udc67]|\\ud83d\\udc6f\\u200d\\u2640\\ufe0f|\\ud83d\\udc6f\\u200d\\u2642\\ufe0f|\\ud83d\\ude2e\\u200d\\ud83d\\udca8|\\ud83d\\ude35\\u200d\\ud83d\\udcab|\\ud83e\\udd3c\\u200d\\u2640\\ufe0f|\\ud83e\\udd3c\\u200d\\u2642\\ufe0f|\\ud83e\\uddde\\u200d\\u2640\\ufe0f|\\ud83e\\uddde\\u200d\\u2642\\ufe0f|\\ud83e\\udddf\\u200d\\u2640\\ufe0f|\\ud83e\\udddf\\u200d\\u2642\\ufe0f|\\ud83d\\udc08\\u200d\\u2b1b)|[#*0-9]\\ufe0f?\\u20e3|(?:[©®\\u2122\\u265f]\\ufe0f)|(?:\\ud83c[\\udc04\\udd70\\udd71\\udd7e\\udd7f\\ude02\\ude1a\\ude2f\\ude37\\udf21\\udf24-\\udf2c\\udf36\\udf7d\\udf96\\udf97\\udf99-\\udf9b\\udf9e\\udf9f\\udfcd\\udfce\\udfd4-\\udfdf\\udff3\\udff5\\udff7]|\\ud83d[\\udc3f\\udc41\\udcfd\\udd49\\udd4a\\udd6f\\udd70\\udd73\\udd76-\\udd79\\udd87\\udd8a-\\udd8d\\udda5\\udda8\\uddb1\\uddb2\\uddbc\\uddc2-\\uddc4\\uddd1-\\uddd3\\udddc-\\uddde\\udde1\\udde3\\udde8\\uddef\\uddf3\\uddfa\\udecb\\udecd-\\udecf\\udee0-\\udee5\\udee9\\udef0\\udef3]|[\\u203c\\u2049\\u2139\\u2194-\\u2199\\u21a9\\u21aa\\u231a\\u231b\\u2328\\u23cf\\u23ed-\\u23ef\\u23f1\\u23f2\\u23f8-\\u23fa\\u24c2\\u25aa\\u25ab\\u25b6\\u25c0\\u25fb-\\u25fe\\u2600-\\u2604\\u260e\\u2611\\u2614\\u2615\\u2618\\u2620\\u2622\\u2623\\u2626\\u262a\\u262e\\u262f\\u2638-\\u263a\\u2640\\u2642\\u2648-\\u2653\\u2660\\u2663\\u2665\\u2666\\u2668\\u267b\\u267f\\u2692-\\u2697\\u2699\\u269b\\u269c\\u26a0\\u26a1\\u26a7\\u26aa\\u26ab\\u26b0\\u26b1\\u26bd\\u26be\\u26c4\\u26c5\\u26c8\\u26cf\\u26d1\\u26d3\\u26d4\\u26e9\\u26ea\\u26f0-\\u26f5\\u26f8\\u26fa\\u26fd\\u2702\\u2708\\u2709\\u270f\\u2712\\u2714\\u2716\\u271d\\u2721\\u2733\\u2734\\u2744\\u2747\\u2757\\u2763\\u2764\\u27a1\\u2934\\u2935\\u2b05-\\u2b07\\u2b1b\\u2b1c\\u2b50\\u2b55\\u3030\\u303d\\u3297\\u3299])(?:\\ufe0f|(?!\\ufe0e))|(?:(?:\\ud83c[\\udfcb\\udfcc]|\\ud83d[\\udd74\\udd75\\udd90]|[\\u261d\\u26f7\\u26f9\\u270c\\u270d])(?:\\ufe0f|(?!\\ufe0e))|(?:\\ud83c[\\udf85\\udfc2-\\udfc4\\udfc7\\udfca]|\\ud83d[\\udc42\\udc43\\udc46-\\udc50\\udc66-\\udc69\\udc6e\\udc70-\\udc78\\udc7c\\udc81-\\udc83\\udc85-\\udc87\\udcaa\\udd7a\\udd95\\udd96\\ude45-\\ude47\\ude4b-\\ude4f\\udea3\\udeb4-\\udeb6\\udec0\\udecc]|\\ud83e[\\udd0c\\udd0f\\udd18-\\udd1c\\udd1e\\udd1f\\udd26\\udd30-\\udd39\\udd3d\\udd3e\\udd77\\uddb5\\uddb6\\uddb8\\uddb9\\uddbb\\uddcd-\\uddcf\\uddd1-\\udddd\\udec3-\\udec5\\udef0-\\udef6]|[\\u270a\\u270b]))(?:\\ud83c[\\udffb-\\udfff])?|(?:\\ud83c\\udff4\\udb40\\udc67\\udb40\\udc62\\udb40\\udc65\\udb40\\udc6e\\udb40\\udc67\\udb40\\udc7f|\\ud83c\\udff4\\udb40\\udc67\\udb40\\udc62\\udb40\\udc73\\udb40\\udc63\\udb40\\udc74\\udb40\\udc7f|\\ud83c\\udff4\\udb40\\udc67\\udb40\\udc62\\udb40\\udc77\\udb40\\udc6c\\udb40\\udc73\\udb40\\udc7f|\\ud83c\\udde6\\ud83c[\\udde8-\\uddec\\uddee\\uddf1\\uddf2\\uddf4\\uddf6-\\uddfa\\uddfc\\uddfd\\uddff]|\\ud83c\\udde7\\ud83c[\\udde6\\udde7\\udde9-\\uddef\\uddf1-\\uddf4\\uddf6-\\uddf9\\uddfb\\uddfc\\uddfe\\uddff]|\\ud83c\\udde8\\ud83c[\\udde6\\udde8\\udde9\\uddeb-\\uddee\\uddf0-\\uddf5\\uddf7\\uddfa-\\uddff]|\\ud83c\\udde9\\ud83c[\\uddea\\uddec\\uddef\\uddf0\\uddf2\\uddf4\\uddff]|\\ud83c\\uddea\\ud83c[\\udde6\\udde8\\uddea\\uddec\\udded\\uddf7-\\uddfa]|\\ud83c\\uddeb\\ud83c[\\uddee-\\uddf0\\uddf2\\uddf4\\uddf7]|\\ud83c\\uddec\\ud83c[\\udde6\\udde7\\udde9-\\uddee\\uddf1-\\uddf3\\uddf5-\\uddfa\\uddfc\\uddfe]|\\ud83c\\udded\\ud83c[\\uddf0\\uddf2\\uddf3\\uddf7\\uddf9\\uddfa]|\\ud83c\\uddee\\ud83c[\\udde8-\\uddea\\uddf1-\\uddf4\\uddf6-\\uddf9]|\\ud83c\\uddef\\ud83c[\\uddea\\uddf2\\uddf4\\uddf5]|\\ud83c\\uddf0\\ud83c[\\uddea\\uddec-\\uddee\\uddf2\\uddf3\\uddf5\\uddf7\\uddfc\\uddfe\\uddff]|\\ud83c\\uddf1\\ud83c[\\udde6-\\udde8\\uddee\\uddf0\\uddf7-\\uddfb\\uddfe]|\\ud83c\\uddf2\\ud83c[\\udde6\\udde8-\\udded\\uddf0-\\uddff]|\\ud83c\\uddf3\\ud83c[\\udde6\\udde8\\uddea-\\uddec\\uddee\\uddf1\\uddf4\\uddf5\\uddf7\\uddfa\\uddff]|\\ud83c\\uddf4\\ud83c\\uddf2|\\ud83c\\uddf5\\ud83c[\\udde6\\uddea-\\udded\\uddf0-\\uddf3\\uddf7-\\uddf9\\uddfc\\uddfe]|\\ud83c\\uddf6\\ud83c\\udde6|\\ud83c\\uddf7\\ud83c[\\uddea\\uddf4\\uddf8\\uddfa\\uddfc]|\\ud83c\\uddf8\\ud83c[\\udde6-\\uddea\\uddec-\\uddf4\\uddf7-\\uddf9\\uddfb\\uddfd-\\uddff]|\\ud83c\\uddf9\\ud83c[\\udde6\\udde8\\udde9\\uddeb-\\udded\\uddef-\\uddf4\\uddf7\\uddf9\\uddfb\\uddfc\\uddff]|\\ud83c\\uddfa\\ud83c[\\udde6\\uddec\\uddf2\\uddf3\\uddf8\\uddfe\\uddff]|\\ud83c\\uddfb\\ud83c[\\udde6\\udde8\\uddea\\uddec\\uddee\\uddf3\\uddfa]|\\ud83c\\uddfc\\ud83c[\\uddeb\\uddf8]|\\ud83c\\uddfd\\ud83c\\uddf0|\\ud83c\\uddfe\\ud83c[\\uddea\\uddf9]|\\ud83c\\uddff\\ud83c[\\udde6\\uddf2\\uddfc]|\\ud83c[\\udccf\\udd8e\\udd91-\\udd9a\\udde6-\\uddff\\ude01\\ude32-\\ude36\\ude38-\\ude3a\\ude50\\ude51\\udf00-\\udf20\\udf2d-\\udf35\\udf37-\\udf7c\\udf7e-\\udf84\\udf86-\\udf93\\udfa0-\\udfc1\\udfc5\\udfc6\\udfc8\\udfc9\\udfcf-\\udfd3\\udfe0-\\udff0\\udff4\\udff8-\\udfff]|\\ud83d[\\udc00-\\udc3e\\udc40\\udc44\\udc45\\udc51-\\udc65\\udc6a\\udc6f\\udc79-\\udc7b\\udc7d-\\udc80\\udc84\\udc88-\\udc8e\\udc90\\udc92-\\udca9\\udcab-\\udcfc\\udcff-\\udd3d\\udd4b-\\udd4e\\udd50-\\udd67\\udda4\\uddfb-\\ude44\\ude48-\\ude4a\\ude80-\\udea2\\udea4-\\udeb3\\udeb7-\\udebf\\udec1-\\udec5\\uded0-\\uded2\\uded5-\\uded7\\udedd-\\udedf\\udeeb\\udeec\\udef4-\\udefc\\udfe0-\\udfeb\\udff0]|\\ud83e[\\udd0d\\udd0e\\udd10-\\udd17\\udd20-\\udd25\\udd27-\\udd2f\\udd3a\\udd3c\\udd3f-\\udd45\\udd47-\\udd76\\udd78-\\uddb4\\uddb7\\uddba\\uddbc-\\uddcc\\uddd0\\uddde-\\uddff\\ude70-\\ude74\\ude78-\\ude7c\\ude80-\\ude86\\ude90-\\udeac\\udeb0-\\udeba\\udec0-\\udec2\\uded0-\\uded9\\udee0-\\udee7]|[\\u23e9-\\u23ec\\u23f0\\u23f3\\u267e\\u26ce\\u2705\\u2728\\u274c\\u274e\\u2753-\\u2755\\u2795-\\u2797\\u27b0\\u27bf\\ue50a])|\\ufe0f/g\n\nfunction toCodePoint(unicodeSurrogates, sep) {\n var\n\t\tr = [],\n\t\tc = 0,\n\t\tp = 0,\n\t\ti = 0\n\t\t\n\twhile (i < unicodeSurrogates.length) {\n\t\tc = unicodeSurrogates.charCodeAt(i++)\n\t\tif (p) {\n\t\t\tr.push((0x10000 + ((p - 0xD800) << 10) + (c - 0xDC00)).toString(16))\n\t\t\tp = 0\n\t\t} else if (0xD800 <= c && c <= 0xDBFF) {\n\t\t\tp = c\n\t\t} else {\n\t\t\tr.push(c.toString(16))\n\t\t}\n\t}\n\treturn r.join(sep || '-')\n}\n\n// avoid runtime RegExp creation for not so smart,\n// not JIT based, and old browsers / engines\nvar UFE0Fg = /\\uFE0F/g\n\n// avoid using a string literal like '\\u200D' here because minifiers expand it inline\nvar U200D = String.fromCharCode(0x200D)\n\n/**\n* Used to both remove the possible variant\n* and to convert utf16 into code points.\n* If there is a zero-width-joiner (U+200D), leave the variants in.\n* @param string the raw text of the emoji match\n*/\nfunction grabTheRightIcon(rawText) {\n\t// if variant is present as \\uFE0F\n\treturn toCodePoint(rawText.indexOf(U200D) < 0 ?\n\t\trawText.replace(UFE0Fg, '') :\n\t\trawText\n\t);\n}\n\nmodule.exports = function replaceEmoji (string, render) {\n\t// Note: the latest regex added an empty matching group, so we ignore it.\n\treturn replaceStringToArray(string, re, function emojiReplacer (match, _, offset) {\n\t\tvar icon = grabTheRightIcon(match)\n\t\treturn render(icon, match, offset)\n\t})\n}\n","var createElement = require('react').createElement\n\nvar pageProtocol = (typeof location === 'undefined') ? '' : ((location.protocol === 'https:') ? 'https:' : 'http:')\n\nvar emojiStyle = {\n\theight: '1em',\n\twidth: '1em',\n\tmargin: '0 .05em 0 .1em',\n\tverticalAlign: '-0.1em'\n}\n\n// Accept protocol with or without a colon\nfunction normalizeProtocol(protocol) {\n\tif (protocol && protocol.length > 0 && protocol.charAt(protocol.length - 1) !== ':') {\n\t\treturn protocol + ':'\n\t}\n\treturn protocol\n}\n\nmodule.exports = function makeTwemojiRenderer(options) {\n\toptions = merge({\n\t\tprotocol: pageProtocol,\n\t\tbaseUrl: '//cdnjs.cloudflare.com/ajax/libs/twemoji/14.0.2/',\n\t\tsize: '72x72',\n\t\text: '.png',\n\t\tprops: null\n\t}, options)\n\n\treturn function renderTwemoji (icon, match, offset) {\n\t\tvar src = ''\n\t\tif (options.baseUrl.indexOf('http') !== 0) {\n\t\t\tsrc += normalizeProtocol(options.protocol)\n\t\t}\n\n\t\tsrc += options.baseUrl + options.size + '/' + icon + options.ext\n\n\t\treturn createElement(\n\t\t\t'img',\n\t\t\tmerge({\n\t\t\t\tkey: offset,\n\t\t\t\talt: match,\n\t\t\t\tdraggable: false,\n\t\t\t\tsrc: src,\n\t\t\t\tstyle: emojiStyle\n\t\t\t}, options.props)\n\t\t)\n\t}\n}\n\nfunction merge() {\n\tvar out = {}, len = arguments.length\n\tfor(var i = 0; i < len; ++i) {\n\t\tvar source = arguments[i]\n\t\tif (source) {\n\t\t\tfor (var key in source) {\n\t\t\t\tif (Object.prototype.hasOwnProperty.call(source, key)) {\n\t\t\t\t\tout[key] = source[key]\n\t\t\t\t}\n\t\t\t}\n\t\t}\n }\n return out\n}","var replaceEmoji = require('./lib/replaceEmoji'),\n\tmakeTwemojiRenderer = require('./lib/makeTwemojiRenderer')\n\nmodule.exports = function reactEasyEmoji (element, optionsOrFn) {\n\tvar render = (typeof optionsOrFn === 'function') ? optionsOrFn : makeTwemojiRenderer(optionsOrFn)\n\treturn replaceEmoji(element, render)\n}","// @ts-check\n\nimport { useCallback, useRef } from \"react\";\nimport { renderToString } from 'react-dom/server'\nimport emoji from 'react-easy-emoji'\nimport { removeHtmlExceptBr } from \"../utils/input-event-utils\";\n\nconst EMOJI_REGEX = new RegExp(\n /(?:[\\u2700-\\u27bf]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|\\ud83c[\\udffb-\\udfff])?(?:\\u200d(?:[^\\ud800-\\udfff]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|\\ud83c[\\udffb-\\udfff])?)*/g\n)\n\n/**\n * @typedef {import('../types/types').SanitizeFn} SanitizeFn\n */\n\n// eslint-disable-next-line valid-jsdoc\n/**\n * @param {boolean} shouldReturn\n * @param {boolean} shouldConvertEmojiToImage\n */\nexport function useSanitize(shouldReturn, shouldConvertEmojiToImage) {\n /** @type {React.MutableRefObject<SanitizeFn[]>} */\n const sanitizeFnsRef = useRef([]);\n\n const sanitizedTextRef = useRef(\"\");\n\n /** @type {(fn: SanitizeFn) => void} */\n const addSanitizeFn = useCallback(fn => {\n sanitizeFnsRef.current.push(fn);\n }, []);\n\n /** @type {(html: string) => string} */\n const sanitize = useCallback(html => {\n let result = sanitizeFnsRef.current.reduce((acc, fn) => {\n return fn(acc);\n }, html);\n\n result = replaceAllHtmlToString(result, shouldReturn);\n\n if (shouldConvertEmojiToImage) {\n result = convertEmojiToImage(result);\n }\n\n sanitizedTextRef.current = result;\n\n return result;\n }, [shouldReturn, shouldConvertEmojiToImage]);\n\n return { addSanitizeFn, sanitize, sanitizedTextRef };\n}\n\n/**\n *\n * @param {string} html\n * @param {boolean} shouldReturn\n * @return {string}\n */\nexport function replaceAllHtmlToString(html, shouldReturn) {\n const container = document.createElement(\"div\");\n container.innerHTML = html;\n let text\n if(shouldReturn) {\n text = removeHtmlExceptBr(container)\n } else {\n text = container.innerText || \"\";\n }\n\n // remove all ↵ for safari\n text = text.replace(/\\n/gi, \"\");\n\n return text;\n}\n\n/**\n * \n * @param {string} text \n * @return {string}\n */\nfunction convertEmojiToImage(text) {\n text = handleEmoji(text)\n text = renderToString(emoji(text))\n text = text.replace(\n new RegExp('<span class="message-emoji">', 'g'),\n '<span class=\"message-emoji\">'\n )\n text = text.replace(new RegExp('</span>', 'g'), '</span>')\n \n return text \n}\n\n/**\n * \n * @param {string} text \n * @return {string}\n */\nfunction handleEmoji (text) {\n return text.replace(EMOJI_REGEX, '<span class=\"message-emoji\">$&</span>')\n}\n","// @ts-check\n\nimport { useImperativeHandle } from \"react\";\nimport { useSanitize } from \"./use-sanitize\";\n\n/**\n * @typedef {Object} Props\n * @property {React.Ref<any>} ref\n * @property {React.MutableRefObject<import('../text-input').Ref | null>} textInputRef\n * @property {(value: string) => void} setValue\n * @property {() => void} emitChange\n * @property {boolean=} shouldConvertEmojiToImage\n */\n\n/**\n *\n * @param {Props} props\n */\nexport function useExpose({ ref, textInputRef, setValue, emitChange, shouldConvertEmojiToImage }) {\n const { sanitize, sanitizedTextRef } = useSanitize(false, shouldConvertEmojiToImage);\n\n useImperativeHandle(ref, () => ({\n get value() {\n return sanitizedTextRef.current;\n },\n set value(value) {\n setValue(value);\n },\n focus: () => {\n if (textInputRef.current === null) return\n textInputRef.current.focus();\n },\n blur: () => {\n if (textInputRef.current !== null) {\n sanitize(textInputRef.current.html);\n\n }\n\n emitChange();\n }\n }));\n}\n","// @ts-check\n\nimport { useCallback, useEffect, useRef } from \"react\";\n\n// eslint-disable-next-line valid-jsdoc\n/**\n * useEmit\n * @param {React.MutableRefObject<import('../text-input').Ref | null>} textInputRef\n * @param {(size: {width: number, height: number}) => void} onResize\n * @param {(text: string) => void} onChange\n */\nexport function useEmit(textInputRef, onResize, onChange) {\n /** @type {React.MutableRefObject<{width: number; height: number} | null>} */\n const currentSizeRef = useRef(null);\n const onChangeFn = useRef(onChange);\n\n const checkAndEmitResize = useCallback(() => {\n if (textInputRef.current !== null) {\n const currentSize = currentSizeRef.current;\n\n const nextSize = textInputRef.current.size;\n\n if (\n (!currentSize ||\n currentSize.width !== nextSize.width ||\n currentSize.height !== nextSize.height) &&\n typeof onResize === \"function\"\n ) {\n onResize(nextSize);\n }\n\n currentSizeRef.current = nextSize;\n }\n }, [onResize, textInputRef]);\n\n const emitChange = useCallback((sanitizedText) => {\n if (typeof onChangeFn.current === \"function\") {\n onChangeFn.current(sanitizedText);\n }\n\n if (typeof onResize === \"function\") {\n checkAndEmitResize();\n }\n }, [checkAndEmitResize, onResize]);\n\n useEffect(() => {\n if (textInputRef.current) {\n checkAndEmitResize();\n }\n }, [checkAndEmitResize, textInputRef]);\n\n return emitChange;\n}\n","// @ts-check\n// vendors\nimport React, { useImperativeHandle, forwardRef, useRef, useMemo } from \"react\";\nimport { addLineBreak, handlePasteHtmlAtCaret } from \"./utils/input-event-utils\";\nimport { replaceAllTextEmojiToString } from \"./utils/emoji-utils\";\n\n/**\n * @typedef {Object} Props\n * @property {(event: React.KeyboardEvent) => void} onKeyDown\n * @property {(event: React.KeyboardEvent) => void} onKeyUp\n * @property {() => void} onFocus\n * @property {() => void} onBlur\n * @property {(sanitizedText: string) => void=} onChange\n * @property {(event: React.KeyboardEvent) => void} onArrowUp\n * @property {(event: React.KeyboardEvent) => void} onArrowDown\n * @property {(event: React.KeyboardEvent) => void} onEnter\n * @property {boolean} shouldReturn\n * @property {(event: React.ClipboardEvent) => void} onCopy\n * @property {(event: React.ClipboardEvent) => void} onPaste\n * @property {string} placeholder\n * @property {{borderRadius?: number; color?: string; borderColor?: string; fontSize?: number; fontFamily?: string; background: string; placeholderColor?: string;}} style\n * @property {number} tabIndex\n * @property {string} className\n * @property {(html: string) => void} onChange\n */\n\n/**\n * @typedef {{\n * appendContent: (html: string) => void;\n * html: string;\n * text: string;\n * size: { width: number; height: number;};\n * focus: () => void;\n * }} Ref\n */\n\n// eslint-disable-next-line valid-jsdoc\n/** @type {React.ForwardRefRenderFunction<Ref, Props>} */\nconst TextInput = (\n { placeholder, style, tabIndex, className, onChange, ...props },\n ref\n) => {\n useImperativeHandle(ref, () => ({\n appendContent: html => {\n if (textInputRef.current) {\n textInputRef.current.focus();\n }\n\n handlePasteHtmlAtCaret(html);\n\n if (textInputRef.current) {\n textInputRef.current.focus();\n }\n\n if (textInputRef.current && placeholderRef.current && replaceAllTextEmojiToString(textInputRef.current.innerHTML) === \"\") {\n placeholderRef.current.style.visibility = \"visible\";\n } else if (placeholderRef.current) {\n placeholderRef.current.style.visibility = \"hidden\";\n }\n\n if (textInputRef.current && typeof onChange === 'function') {\n onChange(textInputRef.current.innerHTML);\n }\n },\n set html(value) {\n if (textInputRef.current) {\n textInputRef.current.innerHTML = value;\n }\n \n if (placeholderRef.current) {\n const text = replaceAllTextEmojiToString(value)\n if (text === \"\") {\n placeholderRef.current.style.visibility = \"visible\";\n } else {\n placeholderRef.current.style.visibility = \"hidden\";\n }\n }\n\n if (typeof onChange === 'function' && textInputRef.current) {\n onChange(textInputRef.current.innerHTML);\n }\n },\n get html() {\n if (!textInputRef.current) return ''\n\n return textInputRef.current.innerHTML;\n },\n get text() {\n if (!textInputRef.current) return ''\n\n return textInputRef.current.innerText;\n },\n get size() {\n if (!textInputRef.current) {\n return {\n width: 0,\n height: 0\n }\n }\n\n return {\n width: textInputRef.current.offsetWidth,\n height: textInputRef.current.offsetHeight\n };\n },\n focus() {\n if (!textInputRef.current) return\n\n textInputRef.current.focus();\n }\n }));\n\n /** @type {React.CSSProperties} */\n const placeholderStyle = useMemo(() => {\n const placeholderStyle = {}\n\n if (style.placeholderColor) {\n placeholderStyle.color = style.placeholderColor\n }\n\n return placeholderStyle\n }, [style?.placeholderColor])\n\n /** @type {React.CSSProperties} */\n const inputStyle = useMemo(() => {\n const inputStyle = {}\n\n if (style.color) {\n inputStyle.color = style.color\n }\n\n return inputStyle\n }, [style?.color])\n\n /** @type {React.MutableRefObject<HTMLDivElement | null>} */\n const placeholderRef = useRef(null);\n /** @type {React.MutableRefObject<HTMLDivElement | null>} */\n const textInputRef = useRef(null);\n\n /**\n *\n * @param {React.KeyboardEvent} event\n */\n function handleKeyDown(event) { \n if (event.key === \"Enter\" && (event.shiftKey === true || event.ctrlKey === true) && props.shouldReturn) {\n event.preventDefault();\n if(textInputRef.current) {\n addLineBreak()\n return;\n }\n } \n if (event.key === \"Enter\") {\n props.onEnter(event);\n } else if (event.key === \"ArrowUp\") {\n props.onArrowUp(event);\n } else if (event.key === \"ArrowDown\") {\n props.onArrowDown(event);\n } else {\n if (event.key.length === 1 && placeholderRef.current) {\n placeholderRef.current.style.visibility = \"hidden\";\n }\n }\n\n props.onKeyDown(event);\n }\n\n /** */\n function handleClick() {\n props.onFocus();\n }\n\n /**\n *\n * @param {React.KeyboardEvent} event\n */\n function handleKeyUp(event) {\n props.onKeyUp(event);\n\n const input = textInputRef.current;\n\n if (placeholderRef.current && input) {\n const text = replaceAllTextEmojiToString(input.innerHTML)\n if (text === \"\") {\n placeholderRef.current.style.visibility = \"visible\";\n } else {\n placeholderRef.current.style.visibility = \"hidden\";\n }\n }\n\n if (typeof onChange === 'function' && textInputRef.current) {\n onChange(textInputRef.current.innerHTML);\n }\n }\n\n return (\n <div className=\"react-input-emoji--container\" style={style}>\n <div className=\"react-input-emoji--wrapper\" onClick={handleClick}>\n <div ref={placeholderRef} className=\"react-input-emoji--placeholder\" style={placeholderStyle}>\n {placeholder}\n </div>\n <div\n ref={textInputRef}\n onKeyDown={handleKeyDown}\n onKeyUp={handleKeyUp}\n tabIndex={tabIndex}\n contentEditable\n className={`react-input-emoji--input${className ? ` ${className}` : \"\"\n }`}\n onBlur={props.onBlur}\n onCopy={props.onCopy}\n onPaste={props.onPaste}\n data-testid=\"react-input-emoji--input\"\n style={inputStyle}\n />\n </div>\n </div>\n );\n};\n\nconst TextInputWithRef = forwardRef(TextInput);\n\nexport default TextInputWithRef;\n","// vendors\nimport React, { useEffect, useRef, useState } from \"react\";\n\n/**\n * @typedef {object} Props\n * @property {boolean} showPicker\n * @property {(event: React.MouseEvent) => void} toggleShowPicker\n * @property {HTMLDivElement=} buttonElement\n * @property {React.MutableRefObject=} buttonRef\n */\n\n/**\n * Emoji Picker Button Component\n * @param {Props} props\n * @return {JSX.Element}\n */\nfunction EmojiPickerButton({ showPicker, toggleShowPicker, buttonElement, buttonRef }) {\n \n const localButtonRef = useRef(null);\n const [showCustomButtonContent, setShowCustomButtonContent] = useState(false);\n\n useEffect(() => {\n if ((buttonRef?.current?.childNodes?.length ?? 0) > 2) {\n localButtonRef.current.appendChild(buttonRef.current.childNodes[0]);\n setShowCustomButtonContent(true);\n } else if ((buttonElement?.childNodes?.length ?? 0) > 2) {\n localButtonRef.current.appendChild(buttonElement?.childNodes[0]);\n setShowCustomButtonContent(true);\n }\n }, [buttonElement?.childNodes]);\n\n return (\n <button\n ref={localButtonRef}\n type=\"button\"\n className={`react-input-emoji--button${\n showPicker ? \" react-input-emoji--button__show\" : \"\"\n }`}\n onClick={toggleShowPicker}\n >\n {!showCustomButtonContent && (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n width=\"24\"\n height=\"24\"\n className=\"react-input-emoji--button--icon\"\n >\n {/* eslint-disable-next-line max-len */}\n <path d=\"M12 0C5.373 0 0 5.373 0 12s5.373 12 12 12 12-5.373 12-12S18.627 0 12 0m0 22C6.486 22 2 17.514 2 12S6.486 2 12 2s10 4.486 10 10-4.486 10-10 10\" />\n {/* eslint-disable-next-line max-len */}\n <path d=\"M8 7a2 2 0 1 0-.001 3.999A2 2 0 0 0 8 7M16 7a2 2 0 1 0-.001 3.999A2 2 0 0 0 16 7M15.232 15c-.693 1.195-1.87 2-3.349 2-1.477 0-2.655-.805-3.347-2H15m3-2H6a6 6 0 1 0 12 0\" />\n </svg>\n )}\n </button>\n );\n}\n\nexport default EmojiPickerButton;\n","import $dvPge$react, {useRef as $dvPge$useRef, useEffect as $dvPge$useEffect} from \"react\";\nimport {Picker as $dvPge$Picker} from \"emoji-mart\";\n\n\n\nfunction $e5534fc185f7111e$export$2e2bcd8739ae039(props) {\n const ref = (0, $dvPge$useRef)(null);\n const instance = (0, $dvPge$useRef)(null);\n if (instance.current) instance.current.update(props);\n (0, $dvPge$useEffect)(()=>{\n instance.current = new (0, $dvPge$Picker)({\n ...props,\n ref: ref\n });\n return ()=>{\n instance.current = null;\n };\n }, []);\n return /*#__PURE__*/ (0, $dvPge$react).createElement(\"div\", {\n ref: ref\n });\n}\n\n\nexport {$e5534fc185f7111e$export$2e2bcd8739ae039 as default};\n//# sourceMappingURL=module.js.map\n","// vendors\nimport React, { memo, useEffect, useMemo, useState } from \"react\";\nimport Picker from \"@emoji-mart/react\";\n\nconst EMOJI_MART_DATA_URL = \"https://cdn.jsdelivr.net/npm/@emoji-mart/data\";\nconst cacheI18n = {};\n\n/**\n * @typedef {object} Props\n * @property {'light' | 'dark' | 'auto'} theme\n * @property {function(import(\"../types/types\").EmojiMartItem): void} onSelectEmoji\n * @property {boolean} disableRecent\n * @property {any[]=} customEmojis\n * @property {import('../types/types').Languages=} language\n */\n\n/**\n * Emoji Picker Component\n * @param {Props} props\n */\nfunction EmojiPicker(props) {\n const { theme, onSelectEmoji, disableRecent, customEmojis, language } = props;\n\n /** @type {string[]} */\n const categories = useMemo(() => {\n /** @type {string[]} */\n let categoryies = [];\n\n if (!disableRecent) {\n categoryies.push(\"frequent\");\n }\n\n categoryies = [\n ...categoryies,\n \"people\",\n \"nature\",\n \"foods\",\n \"activity\",\n \"places\",\n \"objects\",\n \"symbols\",\n \"flags\"\n ];\n\n return categoryies;\n }, [disableRecent]);\n\n const [i18n, setI18n] = useState(undefined);\n\n useEffect(() => {\n if (!language) {\n if (cacheI18n.en) {\n setI18n(cacheI18n.en);\n return;\n }\n\n // @ts-ignore\n fetch(`${EMOJI_MART_DATA_URL}/i18n/en.json`)\n .then(async data => {\n const translations = await data.json();\n setI18n(translations);\n cacheI18n.en = translations;\n })\n .catch(error => {\n console.error(\"Failed to load translations:\", error);\n });\n return;\n }\n\n if (cacheI18n[language]) {\n setI18n(cacheI18n[language]);\n return;\n }\n\n // @ts-ignore\n fetch(`${EMOJI_MART_DATA_URL}/i18n/${language}.json`)\n .then(async data => {\n const translations = await data.json();\n setI18n(translations);\n cacheI18n[language] = translations;\n })\n .catch(error => {\n console.error(\"Failed to load translations:\", error);\n });\n }, [language]);\n\n if (!i18n) {\n return null;\n }\n\n return (\n <Picker\n data={undefined}\n theme={theme}\n previewPosition=\"none\"\n onEmojiSelect={onSelectEmoji}\n custom={customEmojis}\n categories={categories}\n set=\"apple\"\n i18n={i18n}\n />\n );\n}\n\n\nexport default memo(EmojiPicker);\n","import React from \"react\";\nimport EmojiPicker from \"./emoji-picker\";\n\n/**\n * @typedef {object} Props\n * @property {boolean} showPicker\n * @property {'light' | 'dark' | 'auto'} theme\n * @property {(emoji: import(\"../types/types\").EmojiMartItem) => void} handleSelectEmoji\n * @property {boolean} disableRecent\n * @property {any[]=} customEmojis\n * @property {('above' | 'below')=} position\n * @property {import('../types/types').Languages=} language\n */\n\n/**\n * Emoji Picker Button Component\n * @param {Props} props\n * @return {JSX.Element}\n */\nfunction EmojiPickerContainer({\n showPicker,\n theme,\n handleSelectEmoji,\n disableRecent,\n customEmojis,\n position,\n language\n}) {\n return (\n <div className=\"react-emoji-picker--container\">\n {showPicker && (\n <div\n className=\"react-emoji-picker--wrapper\"\n onClick={evt => evt.stopPropagation()}\n style={position === 'below' ? {top: '40px'} : {}}\n >\n <div className=\"react-emoji-picker\">\n <EmojiPicker\n theme={theme}\n onSelectEmoji={handleSelectEmoji}\n disableRecent={disableRecent}\n customEmojis={customEmojis}\n language={language}\n />\n </div>\n </div>\n )}\n </div>\n );\n}\n\nexport default EmojiPickerContainer;\n","// @ts-check\n// vendors\nimport React, { useEffect, useState } from \"react\";\nimport ReactDOM from \"react-dom\";\nimport {\n getImageEmoji,\n replaceAllTextEmojis,\n replaceAllTextEmojiToString\n} from \"../utils/emoji-utils\";\n\nimport EmojiPickerButton from \"./emoji-picker-button\";\nimport EmojiPickerContainer from \"./emoji-picker-container\";\nimport { cacheCurrentRange } from \"../utils/input-event-utils\";\n\nconst EMOJI_PICKER_CONTAINER_HEIGHT = 435;\n\n/**\n * @typedef {import('../types/types').SanitizeFn} SanitizeFn\n */\n\n/**\n * @typedef {import('../types/types').PolluteFn} PolluteFn\n */\n\n/**\n * @typedef {Object} Props\n * @property {'light' | 'dark' | 'auto'} theme\n * @property {boolean} keepOpened\n * @property {boolean} disableRecent\n * @property {any[]=} customEmojis\n * @property {(fn: SanitizeFn) => void} addSanitizeFn\n * @property {(fn: PolluteFn) => void} addPolluteFn\n * @property {(html: string) => void} appendContent\n * @property {HTMLDivElement=} buttonElement\n * @property {React.MutableRefObject=} buttonRef\n * @property {import('../types/types').Languages=} language\n */\n\n// eslint-disable-next-line valid-jsdoc\n/** @type {React.FC<Props>} */\nconst EmojiPickerWrapper = props => {\n const {\n theme,\n keepOpened,\n disableRecent,\n customEmojis,\n addSanitizeFn,\n addPolluteFn,\n appendContent,\n buttonElement,\n buttonRef,\n language\n } = props;\n\n const [showPicker, setShowPicker] = useState(false);\n /** @type {[HTMLDivElement | undefined, React.Dispatch<React.SetStateAction<HTMLDivElement | undefined>>]} */\n const [customButton, setCustomButton] = useState();\n /** @type {['above' | 'below' | undefined, React.Dispatch<React.SetStateAction<'above' | 'below' | undefined>>]} */\n const [emojiPickerPosition, setEmojiPickerPosition] = useState()\n\n useEffect(() => {\n if (showPicker) {\n cacheCurrentRange()\n }\n }, [showPicker])\n\n useEffect(() => {\n addSanitizeFn(replaceAllTextEmojiToString);\n }, [addSanitizeFn]);\n\n useEffect(() => {\n addPolluteFn(replaceAllTextEmojis);\n }, [addPolluteFn]);\n\n useEffect(() => {\n /**\n *\n * @param {MouseEvent} event\n */\n function checkClickOutside(event) {\n /** @type {HTMLElement} */\n // @ts-ignore\n const element = event.target;\n\n if (\n element.classList.contains(\"react-input-emoji--button\") ||\n element.classList.contains(\"react-input-emoji--button--icon\")\n ) {\n return;\n }\n\n setShowPicker(false);\n }\n\n document.addEventListener(\"click\", checkClickOutside);\n\n return () => {\n document.removeEventListener(\"click\", checkClickOutside);\n };\n }, []);\n\n /**\n *\n * @param {React.MouseEvent} event\n */\n function toggleShowPicker(event) {\n event.stopPropagation();\n event.preventDefault();\n\n setEmojiPickerPosition(calcTopPosition(event))\n\n setShowPicker(currentShowPicker => !currentShowPicker);\n }\n\n /**\n * \n * @param {React.MouseEvent} event\n * @return {'above' | 'below'}\n */\n function calcTopPosition(event) {\n const btn = event.currentTarget\n const btnRect = btn.getBoundingClientRect();\n\n const popoverHeight = EMOJI_PICKER_CONTAINER_HEIGHT;\n\n // Decide to display above or below based on available space\n if (btnRect.top >= popoverHeight) {\n // Display above\n return 'above'\n } else {\n // Display below\n return 'below'\n }\n }\n\n // eslint-disable-next-line valid-jsdoc\n /**\n *\n * @param {import(\"../types/types\").EmojiMartItem} emoji\n */\n function handleSelectEmoji(emoji) {\n appendContent(getImageEmoji(emoji));\n\n if (!keepOpened) {\n setShowPicker(currentShowPicker => !currentShowPicker);\n }\n }\n\n useEffect(() => {\n if (buttonRef?.current?.style) {\n buttonRef.current.style.position = \"relative\";\n setCustomButton(buttonRef.current);\n } else if (buttonElement?.style) {\n buttonElement.style.position = \"relative\";\n setCustomButton(buttonElement);\n }\n }, [buttonRef, buttonElement]);\n\n return customButton ? (\n (ReactDOM.createPortal(\n <>\n <EmojiPickerContainer\n showPicker={showPicker}\n theme={theme}\n handleSelectEmoji={handleSelectEmoji}\n disableRecent={disableRecent}\n customEmojis={customEmojis}\n position={emojiPickerPosition}\n language={language}\n />\n <EmojiPickerButton\n showPicker={showPicker}\n toggleShowPicker={toggleShowPicker}\n buttonElement={customButton}\n buttonRef={buttonRef}\n />\n </>,\n customButton\n ))\n ) : (\n (<>\n <EmojiPickerContainer\n showPicker={showPicker}\n theme={theme}\n handleSelectEmoji={handleSelectEmoji}\n disableRecent={disableRecent}\n customEmojis={customEmojis}\n position={emojiPickerPosition}\n language={language}\n />\n <EmojiPickerButton\n showPicker={showPicker}\n toggleShowPicker={toggleShowPicker}\n />\n </>)\n );\n};\n\nexport default EmojiPickerWrapper;\n","// @ts-check\n\n/**\n *\n * @return {string | null}\n */\nexport function getTextFromAtToCaret() {\n const range = getRangeFromAtToCaret();\n\n if (!range) return null;\n\n const text = range.text.substring(range.begin, range.end);\n\n return text || null;\n}\n\n// eslint-disable-next-line valid-jsdoc\n/** */\nexport function deleteTextFromAtToCaret() {\n const range = getRangeFromAtToCaret();\n\n if (!range) return;\n\n // @ts-ignore\n range.element.deleteData(range.begin, range.end - range.begin);\n}\n\n/**\n *\n * @return {{begin: number, end: number, text: string, element: Node} | null}\n */\nfunction getRangeFromAtToCaret() {\n const elementWithFocus = getElementWithFocus();\n\n if (!elementWithFocus) {\n return null;\n }\n\n const { element, caretOffset } = elementWithFocus;\n const text = element.textContent;\n const lastAt = text.lastIndexOf(\"@\");\n\n if (\n lastAt === -1 ||\n lastAt >= caretOffset ||\n (lastAt !== 0 && text[lastAt - 1] !== \" \")\n ) {\n return null;\n }\n\n return { begin: lastAt, end: caretOffset, text, element };\n}\n\n/**\n *\n * @return {{element: Node, caretOffset: number}}\n */\nexport function getElementWithFocus() {\n const element = getSelectionStart();\n\n if (element === null) {\n return null;\n }\n\n let caretOffset = 0;\n if (typeof window.getSelection != \"undefined\") {\n const range = window.getSelection().getRangeAt(0);\n const preCaretRange = range.cloneRange();\n preCaretRange.selectNodeContents(element);\n preCaretRange.setEnd(range.endContainer, range.endOffset);\n caretOffset = preCaretRange.toString().length;\n } else if (\n // @ts-ignore\n typeof document.selection != \"undefined\" &&\n // @ts-ignore\n document.selection.type != \"Control\"\n ) {\n // @ts-ignore\n const textRange = document.selection.createRange();\n // @ts-ignore\n const preCaretTextRange = document.body.createTextRange();\n preCaretTextRange.moveToElementText(element);\n preCaretTextRange.setEndPoint(\"EndToEnd\", textRange);\n caretOffset = preCaretTextRange.text.length;\n }\n\n return { element, caretOffset };\n}\n\n/**\n *\n * @return {Node | null}\n */\nfunction getSelectionStart() {\n const node = document.getSelection().anchorNode;\n return node?.nodeType == 3 ? node : null;\n}\n","// @ts-check\nimport { useCallback, useState } from \"react\";\nimport {\n deleteTextFromAtToCaret,\n getElementWithFocus,\n getTextFromAtToCaret\n} from \"../utils/mention-utils\";\n\n/**\n * @typedef {import('../types/types').MentionUser} MentionUser\n */\n\n// eslint-disable-next-line valid-jsdoc\n/**\n *\n * @param {(text: string) => Promise<MentionUser[]>=} searchMention\n * @returns {{mentionSearchText: string | null, mentionUsers: MentionUser[], onKeyUp: (event: React.KeyboardEvent) => void, onFocus: () => void, onSelectUser: () => void, loading: boolean}}\n */\nexport function useMention(searchMention) {\n const [loading, setLoading] = useState(false);\n\n /** @type {[MentionUser[], React.Dispatch<React.SetStateAction<MentionUser[]>>]} */\n const [mentionUsers, setMentionUsers] = useState([]);\n\n /** @type {[string | null, React.Dispatch<React.SetStateAction<string | null>>]} */\n const [mentionSearchText, setMentionSearchText] = useState(null);\n\n const onSelectUser = useCallback(() => {\n deleteTextFromAtToCaret();\n setMentionUsers([]);\n }, []);\n\n /** */\n const checkMentionText = useCallback(async () => {\n const metionText = getTextFromAtToCaret();\n\n setMentionSearchText(metionText);\n\n if (metionText === null) {\n setMentionUsers([]);\n } else {\n setLoading(true);\n const users = await searchMention(metionText);\n setLoading(false);\n setMentionUsers(users);\n }\n }, [searchMention]);\n\n /** @type {(event: React.KeyboardEvent) => void} */\n const onKeyUp = useCallback(\n async event => {\n if (typeof searchMention !== \"function\") return;\n\n if (\n event.key === \"Backspace\" &&\n getElementWithFocus()?.element.parentElement.hasAttribute(\n \"data-mention-id\"\n )\n ) {\n const elementWithFocus = getElementWithFocus();\n elementWithFocus.element.parentElement.remove();\n } else if (\n ![\"ArrowUp\", \"ArrowDown\", \"Esc\", \"Escape\"].includes(event.key)\n ) {\n checkMentionText();\n }\n },\n [checkMentionText, searchMention]\n );\n\n const onFocus = useCallback(() => {\n checkMentionText();\n }, [checkMentionText]);\n\n return {\n mentionSearchText,\n mentionUsers,\n onKeyUp,\n onFocus,\n onSelectUser,\n loading\n };\n}\n","// @ts-check\n// vendors\nimport React, {\n useImperativeHandle,\n useState,\n forwardRef,\n useMemo,\n useEffect\n} from \"react\";\n\n/**\n * @typedef {import('../types/types').MentionUser} MentionUser\n */\n\n/**\n * @typedef {import('../types/types').TextInputListeners} TextInputListeners\n */\n\n/**\n * @typedef {Object} Props\n * @property {MentionUser[]} users\n * @property {string | null} mentionSearchText\n * @property {(user: MentionUser) => void} onSelect\n * @property {(event: keyof TextInputListeners, fn: import('../types/types').Listerner<any>) => () => void} addEventListener\n */\n\n/**\n * @typedef {{prevUser: () => void; nextUser: () => void;}} Ref\n */\n\n// eslint-disable-next-line valid-jsdoc\n/** @type {React.ForwardRefRenderFunction<Ref, Props>} */\nconst MentionUserList = (\n { users, mentionSearchText, onSelect, addEventListener },\n ref\n) => {\n const [selectedUser, setSelectedUser] = useState(0);\n\n useImperativeHandle(ref, () => ({\n prevUser: () => {\n setSelectedUser(currentSelectedUser => {\n if (currentSelectedUser === 0) {\n return 0;\n }\n\n return currentSelectedUser - 1;\n });\n },\n nextUser: () => {\n setSelectedUser(currentSelectedUser => {\n if (currentSelectedUser === users.length - 1) {\n return users.length - 1;\n }\n\n return currentSelectedUser + 1;\n });\n }\n }));\n\n useEffect(() => {\n setSelectedUser(0);\n }, [users]);\n\n /**\n *\n * @param {string} selectedText\n * @param {string} rest\n * @return {string}\n */\n function getMentionSelectedNameEl(selectedText, rest) {\n return `<span class=\"react-input-emoji--mention--item--name__selected\" data-testid=\"metion-selected-word\">${selectedText}</span>${rest}`;\n }\n\n /** @type {(MentionUser & {nameHtml: string})[]} */\n const usersFiltered = useMemo(() => {\n const searchText = mentionSearchText\n ? mentionSearchText.substring(1).toLocaleLowerCase()\n : \"\";\n return users.map(user => {\n let nameHtml = user.name;\n\n if (mentionSearchText && mentionSearchText.length > 1) {\n if (user.name.toLowerCase().startsWith(searchText)) {\n nameHtml = getMentionSelectedNameEl(\n user.name.substring(0, searchText.length),\n user.name.substring(searchText.length)\n );\n } else {\n const names = user.name.split(\" \");\n\n nameHtml = names\n .map(name => {\n if (name.toLocaleLowerCase().startsWith(searchText)) {\n return getMentionSelectedNameEl(\n name.substring(0, searchText.length),\n name.substring(searchText.length)\n );\n }\n return name;\n })\n .join(\" \");\n }\n }\n\n return {\n ...user,\n nameHtml\n };\n });\n }, [mentionSearchText, users]);\n\n // eslint-disable-next-line valid-jsdoc\n /**\n *\n * @param {MentionUser} user\n * @returns {(event: React.MouseEvent) => void} event\n */\n function handleClick(user) {\n return event => {\n event.stopPropagation();\n event.preventDefault();\n\n onSelect(user);\n };\n }\n\n useEffect(() => {\n const unsubscribe = addEventListener(\"enter\", event => {\n event.stopPropagation();\n event.preventDefault();\n onSelect(usersFiltered[selectedUser]);\n });\n\n return () => {\n unsubscribe();\n };\n }, [addEventListener, onSelect, selectedUser, usersFiltered]);\n\n return (\n <ul\n className=\"react-input-emoji--mention--list\"\n data-testid=\"mention-user-list\"\n >\n {usersFiltered.map((user, index) => (\n <li key={user.id}>\n <button\n type=\"button\"\n onClick={handleClick(user)}\n className={`react-input-emoji--mention--item${\n selectedUser === index\n ? \" react-input-emoji--mention--item__selected\"\n : \"\"\n }`}\n onMouseOver={() => setSelectedUser(index)}\n >\n <img\n className=\"react-input-emoji--mention--item--img\"\n src={user.image}\n />\n <div\n className=\"react-input-emoji--mention--item--name\"\n dangerouslySetInnerHTML={{ __html: user.nameHtml }}\n />\n </button>\n </li>\n ))}\n </ul>\n );\n};\n\nconst MentionUserListWithRef = forwardRef(MentionUserList);\n\nexport default MentionUserListWithRef;\n","// @ts-check\n// vendors\nimport React, { useEffect, useRef, useState } from \"react\";\n\n// hooks\nimport { useMention } from \"../hooks/use-mention\";\n\n// components\nimport MentionUserList from \"./mention-user-list\";\n\n/**\n * @typedef {import('../types/types').MentionUser} MetionUser\n */\n\n/**\n * @typedef {import('../types/types').TextInputListeners} TextInputListeners\n */\n\n/**\n * @typedef {import('../types/types').SanitizeFn} SanitizeFn\n */\n\n/**\n * @typedef {Object} Props\n * @property {(text: string) => Promise<MetionUser[]>=} searchMention\n * @property {(event: keyof TextInputListeners, fn: import('../types/types').Listerner<any>) => () => void} addEventListener\n * @property {(html: string) => void} appendContent\n * @property {(fn: SanitizeFn) => void} addSanitizeFn\n */\n\n// eslint-disable-next-line valid-jsdoc\n/** @type {React.FC<Props>} */\nconst MentionWrapper = ({\n searchMention,\n addEventListener,\n appendContent,\n addSanitizeFn\n}) => {\n /** @type {React.MutableRefObject<import('./mention-user-list').Ref | null>} */\n const metionUserListRef = useRef(null);\n const [showUserList, setShowUserList] = useState(false);\n\n const {\n mentionSearchText,\n mentionUsers,\n loading,\n onKeyUp,\n onFocus,\n onSelectUser\n } = useMention(searchMention);\n\n useEffect(() => {\n addSanitizeFn(html => {\n const container = document.createElement(\"div\");\n container.innerHTML = html;\n\n const mentionsEl = Array.prototype.slice.call(\n container.querySelectorAll(\".react-input-emoji--mention--text\")\n );\n\n mentionsEl.forEach(mentionEl => {\n container.innerHTML = container.innerHTML.replace(\n mentionEl.outerHTML,\n `@[${mentionEl.dataset.mentionName}](userId:${mentionEl.dataset.mentionId})`\n );\n });\n\n return container.innerHTML;\n });\n }, [addSanitizeFn]);\n\n useEffect(() => {\n setShowUserList(mentionUsers.length > 0);\n }, [mentionUsers]);\n\n useEffect(() => {\n /** */\n function checkClickOutside() {\n setShowUserList(false);\n }\n\n document.addEventListener(\"click\", checkClickOutside);\n\n return () => {\n document.removeEventListener(\"click\", checkClickOutside);\n };\n }, []);\n\n useEffect(() => {\n const unsubscribe = addEventListener(\"keyUp\", onKeyUp);\n\n return () => {\n unsubscribe();\n };\n }, [addEventListener, onKeyUp]);\n\n useEffect(() => {\n /**\n *\n * @param {React.KeyboardEvent} event\n */\n function handleKeyDown(event) {\n switch (event.key) {\n case \"Esc\": // IE/Edge specific value\n case \"Escape\":\n setShowUserList(false);\n break;\n default:\n break;\n }\n }\n\n const unsubscribe = addEventListener(\"keyDown\", handleKeyDown);\n\n return () => {\n unsubscribe();\n };\n }, [addEventListener]);\n\n useEffect(() => {\n const unsubscribe = addEventListener(\"focus\", onFocus);\n\n return () => {\n unsubscribe();\n };\n }, [addEventListener, onFocus]);\n\n useEffect(() => {\n if (showUserList) {\n const unsubscribeArrowUp = addEventListener(\"arrowUp\", event => {\n event.stopPropagation();\n event.preventDefault();\n metionUserListRef.current.prevUser();\n });\n\n const unsubscribeArrowDown = addEventListener(\"arrowDown\", event => {\n event.stopPropagation();\n event.preventDefault();\n metionUserListRef.current.nextUser();\n });\n\n return () => {\n unsubscribeArrowUp();\n unsubscribeArrowDown();\n };\n }\n }, [addEventListener, showUserList]);\n\n /**\n *\n * @param {MetionUser} user\n */\n function handleSelect(user) {\n onSelectUser();\n appendContent(\n `<span class=\"react-input-emoji--mention--text\" data-mention-id=\"${user.id}\" data-mention-name=\"${user.name}\">@${user.name}</span> `\n );\n }\n\n return (\n <>\n {loading ? (\n <div className=\"react-input-emoji--mention--container\">\n <div className=\"react-input-emoji--mention--loading\">\n <div className=\"react-input-emoji--mention--loading--spinner\">\n Loading...\n </div>\n </div>\n </div>\n ) : (\n showUserList && (\n <div\n className=\"react-input-emoji--mention--container\"\n onClick={evt => evt.stopPropagation()}\n >\n <MentionUserList\n ref={metionUserListRef}\n mentionSearchText={mentionSearchText}\n users={mentionUsers}\n onSelect={handleSelect}\n addEventListener={addEventListener}\n />\n </div>\n )\n )}\n </>\n );\n};\n\nexport default MentionWrapper;\n","// @ts-check\n\n// eslint-disable-next-line valid-jsdoc\n/**\n * @template T\n * @returns {import('../types/types').ListenerObj<T>}\n */\nexport function createObserver() {\n /** @type {import('../types/types').Listerner<T>[]} */\n let listeners = [];\n\n return {\n subscribe: listener => {\n listeners.push(listener);\n return () => {\n listeners = listeners.filter(l => l !== listener);\n };\n },\n publish: event => {\n listeners.forEach(listener => listener(event));\n },\n get currentListerners() {\n return listeners;\n }\n };\n}\n","// @ts-check\n\nimport { useCallback, useMemo } from \"react\";\nimport { createObserver } from \"../utils/observer\";\n\n/**\n * @typedef {import('../types/types').TextInputListeners} TextInputListeners\n */\n\n// eslint-disable-next-line valid-jsdoc\n/** */\nexport function useEventListeners() {\n /** @type {TextInputListeners} */\n const listeners = useMemo(\n () => ({\n keyDown: createObserver(),\n keyUp: createObserver(),\n arrowUp: createObserver(),\n arrowDown: createObserver(),\n enter: createObserver(),\n focus: createObserver(),\n blur: createObserver()\n }),\n []\n );\n\n /**\n * @template {keyof TextInputListeners} T, K\n * @type {(event: keyof TextInputListeners, fn: import('../types/types').Listerner<any>) => () => void}\n */\n const addEventListener = useCallback(\n (event, fn) => {\n return listeners[event].subscribe(fn);\n },\n [listeners]\n );\n\n return { addEventListener, listeners };\n}\n","// @ts-check\n\nimport { useCallback, useRef } from \"react\";\n\n/**\n * @typedef {import('../types/types').PolluteFn} PolluteFn\n */\n\n// eslint-disable-next-line valid-jsdoc\n/** */\nexport function usePollute() {\n /** @type {React.MutableRefObject<PolluteFn[]>} */\n const polluteFnsRef = useRef([]);\n\n /** @type {(fn: PolluteFn) => void} */\n const addPolluteFn = useCallback(fn => {\n polluteFnsRef.current.push(fn);\n }, []);\n\n /** @type {(html: string) => string} */\n const pollute = useCallback(text => {\n const result = polluteFnsRef.current.reduce((acc, fn) => {\n return fn(acc);\n }, text);\n\n return result;\n }, []);\n\n return { addPolluteFn, pollute };\n}\n","// @ts-check\n// vendors\nimport React, { useEffect, useRef, forwardRef, useCallback } from \"react\";\n\n// css\nimport \"./styles.css\";\n\n// utils\nimport { replaceAllTextEmojis } from \"./utils/emoji-utils\";\nimport { handleCopy, totalCharacters } from \"./utils/input-event-utils\";\n\n// hooks\nimport { useExpose } from \"./hooks/use-expose\";\nimport { useEmit } from \"./hooks/use-emit\";\n\n// components\nimport TextInput from \"./text-input\";\nimport EmojiPickerWrapper from \"./components/emoji-picker-wrapper\";\nimport MentionWrapper from \"./components/mention-wrapper\";\nimport { useEventListeners } from \"./hooks/use-event-listeners\";\nimport { useSanitize } from \"./hooks/use-sanitize\";\nimport { usePollute } from \"./hooks/user-pollute\";\n\n/**\n * @typedef {import('./types/types').MentionUser} MetionUser\n */\n\n/**\n * @typedef {import('./types/types').ListenerObj<any>} ListenerObj\n */\n\n/**\n * @typedef {object} Props\n * @property {string} value\n * @property {(value: string) => void} onChange\n * @property {\"light\" | \"dark\" | \"auto\"=} theme\n * @property {boolean=} cleanOnEnter\n * @property {(text: string) => void=} onEnter\n * @property {string=} placeholder\n * @property {string=} placeholderColor\n * @property {string=} color\n * @property {(size: {width: number, height: number}) => void=} onResize\n * @property {() => void=} onClick\n * @property {() => void=} onFocus\n * @property {() => void=} onBlur\n * @property {boolean} shouldReturn\n * @property {number=} maxLength\n * @property {boolean=} keepOpened\n * @property {(event: KeyboardEvent) => void=} onKeyDown\n * @property {string=} inputClass\n * @property {boolean=} disableRecent\n * @property {number=} tabIndex\n * @property {number=} height\n * @property {number=} borderRadius\n * @property {string=} borderColor\n * @property {number=} fontSize\n * @property {string=} fontFamily\n * @property {string=} background\n * @property {{id: string; name: string; emojis: {id: string; name: string; keywords: string[], skins: {src: string}[]}}[]=} customEmojis\n * @property {import('./types/types').Languages=} language\n * @property {(text: string) => Promise<MetionUser[]>=} searchMention\n * @property {HTMLDivElement=} buttonElement\n * @property {React.MutableRefObject=} buttonRef\n * @property {boolean} shouldConvertEmojiToImage\n */\n\n/**\n * Input Emoji Component\n * @param {Props} props\n * @param {React.Ref<any>} ref\n * @return {JSX.Element}\n */\nfunction InputEmoji(props, ref) {\n const {\n onChange,\n onEnter,\n onResize,\n onClick,\n onFocus,\n onBlur,\n onKeyDown,\n theme,\n cleanOnEnter,\n placeholder,\n maxLength,\n keepOpened,\n inputClass,\n disableRecent,\n tabIndex,\n value,\n customEmojis,\n language,\n searchMention,\n buttonElement,\n buttonRef,\n shouldReturn,\n shouldConvertEmojiToImage,\n // style\n borderRadius,\n borderColor,\n fontSize,\n fontFamily,\n background,\n placeholderColor,\n color,\n } = props;\n\n /** @type {React.MutableRefObject<import('./text-input').Ref | null>} */\n const textInputRef = useRef(null);\n\n const { addEventListener, listeners } = useEventListeners();\n\n const { addSanitizeFn, sanitize, sanitizedTextRef } = useSanitize(shouldReturn, shouldConvertEmojiToImage);\n\n const { addPolluteFn, pollute } = usePollute();\n\n const updateHTML = useCallback(\n (nextValue = \"\") => {\n if (textInputRef.current === null) return;\n\n textInputRef.current.html = replaceAllTextEmojis(nextValue);\n sanitizedTextRef.current = nextValue;\n },\n [sanitizedTextRef]\n );\n\n const setValue = useCallback(\n /**\n * \n * @param {string} value\n */\n (value) => {\n updateHTML(value);\n },\n [updateHTML]\n );\n\n const emitChange = useEmit(textInputRef, onResize, onChange);\n\n useExpose({\n ref,\n setValue,\n textInputRef,\n emitChange,\n shouldConvertEmojiToImage\n });\n\n useEffect(() => {\n if (sanitizedTextRef.current !== value) {\n setValue(value);\n }\n }, [sanitizedTextRef, setValue, value]);\n\n // useEffect(() => {\n // updateHTML();\n // }, [updateHTML]);\n\n useEffect(() => {\n /**\n * Handle keydown event\n * @param {React.KeyboardEvent} event\n * @return {boolean}\n */\n function handleKeydown(event) {\n if (\n typeof maxLength !== \"undefined\" &&\n event.key !== \"Backspace\" &&\n textInputRef.current !== null &&\n totalCharacters(textInputRef.current) >= maxLength\n ) {\n event.preventDefault();\n }\n\n if (event.key === \"Enter\" && textInputRef.current) {\n event.preventDefault();\n\n const text = sanitize(textInputRef.current.html);\n\n emitChange(sanitizedTextRef.current);\n\n if (\n typeof onEnter === \"function\" &&\n listeners.enter.currentListerners.length === 0\n ) {\n onEnter(text);\n }\n\n if (cleanOnEnter && listeners.enter.currentListerners.length === 0) {\n updateHTML(\"\");\n }\n\n if (typeof onKeyDown === \"function\") {\n onKeyDown(event.nativeEvent);\n }\n\n return false;\n }\n\n if (typeof onKeyDown === \"function\") {\n onKeyDown(event.nativeEvent);\n }\n\n return true;\n }\n\n const unsubscribe = addEventListener(\"keyDown\", handleKeydown);\n\n return () => {\n unsubscribe();\n };\n }, [\n addEventListener,\n cleanOnEnter,\n emitChange,\n listeners.enter.currentListerners.length,\n maxLength,\n onEnter,\n onKeyDown,\n sanitize,\n sanitizedTextRef,\n updateHTML\n ]);\n\n useEffect(() => {\n /** */\n function handleFocus() {\n if (typeof onClick === \"function\") {\n onClick();\n }\n\n if (typeof onFocus === \"function\") {\n onFocus();\n }\n }\n\n const unsubscribe = addEventListener(\"focus\", handleFocus);\n\n return () => {\n unsubscribe();\n };\n }, [addEventListener, onClick, onFocus]);\n\n useEffect(() => {\n /** */\n function handleBlur() {\n if (typeof onBlur === \"function\") {\n onBlur();\n }\n }\n\n const unsubscribe = addEventListener(\"blur\", handleBlur);\n\n return () => {\n unsubscribe();\n };\n }, [addEventListener, onBlur]);\n\n /**\n *\n * @param {string} html\n */\n function handleTextInputChange(html) {\n sanitize(html);\n\n if (value !== sanitizedTextRef.current) {\n emitChange(sanitizedTextRef.current);\n }\n }\n\n /**\n *\n * @param {string} html\n */\n function appendContent(html) {\n if (\n typeof maxLength !== \"undefined\" &&\n textInputRef.current !== null &&\n totalCharacters(textInputRef.current) >= maxLength\n ) {\n return;\n }\n\n if (textInputRef.current !== null) {\n textInputRef.current.appendContent(html);\n }\n }\n\n /**\n * Handle past on input\n * @param {React.ClipboardEvent} event\n */\n function handlePaste(event) {\n event.preventDefault();\n let content;\n if (event.clipboardData) {\n content = event.clipboardData.getData(\"text/plain\");\n content = pollute(content);\n document.execCommand(\"insertHTML\", false, content);\n }\n }\n\n return (\n <div className=\"react-emoji\">\n <MentionWrapper\n searchMention={searchMention}\n addEventListener={addEventListener}\n appendContent={appendContent}\n addSanitizeFn={addSanitizeFn}\n />\n <TextInput\n ref={textInputRef}\n onCopy={handleCopy}\n onPaste={handlePaste}\n shouldReturn={shouldReturn}\n onBlur={listeners.blur.publish}\n onFocus={listeners.focus.publish}\n onArrowUp={listeners.arrowUp.publish}\n onArrowDown={listeners.arrowDown.publish}\n onKeyUp={listeners.keyUp.publish}\n onKeyDown={listeners.keyDown.publish}\n onEnter={listeners.enter.publish}\n placeholder={placeholder}\n style={{\n borderRadius,\n borderColor,\n fontSize,\n fontFamily,\n background,\n placeholderColor,\n color\n }}\n tabIndex={tabIndex}\n className={inputClass}\n onChange={handleTextInputChange}\n />\n <EmojiPickerWrapper\n theme={theme}\n keepOpened={keepOpened}\n disableRecent={disableRecent}\n customEmojis={customEmojis}\n addSanitizeFn={addSanitizeFn}\n addPolluteFn={addPolluteFn}\n appendContent={appendContent}\n buttonElement={buttonElement}\n buttonRef={buttonRef}\n language={language}\n />\n </div>\n );\n}\n\nconst InputEmojiWithRef = forwardRef(InputEmoji);\n\nInputEmojiWithRef.defaultProps = {\n theme: /** @type {const} */ (\"auto\"),\n height: 30,\n placeholder: \"Type a message\",\n borderRadius: 21,\n borderColor: \"#EAEAEA\",\n color: \"black\",\n fontSize: 15,\n fontFamily: \"sans-serif\",\n background: \"white\",\n tabIndex: 0,\n shouldReturn: false,\n shouldConvertEmojiToImage: false,\n customEmojis: [],\n language: undefined,\n};\n\nexport default InputEmojiWithRef;\n"],"names":["styleInject","css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","TRANSPARENT_GIF","replaceAllTextEmojis","text","allEmojis","getAllEmojisFromText","Set","forEach","emoji","replaceAll","getInputEmojiHTML","str","find","replace","RegExp","match","getImageEmoji","_emojiPickerEl$shadow","emojiPickerEl","querySelector","getInputEmojiNativeHTML","native","emojiSpanEl","shadowRoot","concat","name","replaceAllTextEmojiToString","html","container","innerHTML","images","Array","prototype","slice","call","querySelectorAll","image","outerHTML","dataset","handleCopy","event","selectedText","window","getSelection","i","len","rangeCount","getRangeAt","cloneContents","replaceEmojiToString","clipboardData","setData","innerText","preventDefault","currentRangeCached","cacheCurrentRange","selection","anchorNode","parentNode","range","cloneRange","handlePasteHtmlAtCaret","sel","_currentRangeCached","deleteContents","el","frag","createDocumentFragment","node","lastNode","insertNode","setStartAfter","collapse","removeAllRanges","addRange","totalCharacters","_ref2","textCount","length","emojisCount","removeHtmlExceptBr","inputDiv","temp","tempContainer","stripped","final","getSelectionStart","startContainer","offset","startOffset","nodeType","Node","TEXT_NODE","nextSibling","commonAncestorContainer","getCursor","selectionStart","addLineBreak","isCollapsed","textContent","br","setEndAfter","br2","setStart","setEnd","string","regexpOrSubstr","newValueOrFn","globalOffset","Error","fn","replaceUsingString","replaceUsingRegexp","patternString","index","indexOf","arr","endIndex","push","substring","regexp","output","replacerIsFn","storedLastIndex","lastIndex","result","exec","out","apply","input","global","module","stringReplaceToArray","stringOrArray","newSubStrOrFn","isArray","TypeError","arrayItem","re","toCodePoint","unicodeSurrogates","sep","r","c","p","charCodeAt","toString","join","UFE0Fg","U200D","String","fromCharCode","grabTheRightIcon","rawText","replaceEmoji","render","replaceStringToArray","emojiReplacer","_","icon","require","pageProtocol","location","protocol","emojiStyle","height","width","margin","verticalAlign","normalizeProtocol","charAt","makeTwemojiRenderer","options","merge","baseUrl","size","ext","props","renderTwemoji","src","key","alt","draggable","arguments","source","Object","hasOwnProperty","reactEasyEmoji","element","optionsOrFn","EMOJI_REGEX","useSanitize","shouldReturn","shouldConvertEmojiToImage","sanitizeFnsRef","useRef","sanitizedTextRef","addSanitizeFn","useCallback","current","sanitize","reduce","acc","replaceAllHtmlToString","convertEmojiToImage","handleEmoji","renderToString","useExpose","_ref","textInputRef","setValue","emitChange","useImperativeHandle","value","focus","blur","useEmit","onResize","onChange","currentSizeRef","onChangeFn","checkAndEmitResize","currentSize","nextSize","sanitizedText","useEffect","TextInput","placeholder","tabIndex","className","_objectWithoutProperties","_excluded","appendContent","placeholderRef","visibility","offsetWidth","offsetHeight","placeholderStyle","useMemo","placeholderColor","color","inputStyle","handleKeyDown","shiftKey","ctrlKey","onEnter","onArrowUp","onArrowDown","onKeyDown","handleClick","onFocus","handleKeyUp","onKeyUp","React","onClick","contentEditable","onBlur","onCopy","onPaste","TextInputWithRef","forwardRef","EmojiPickerButton","showPicker","toggleShowPicker","buttonElement","buttonRef","localButtonRef","showCustomButtonContent","setShowCustomButtonContent","useState","_buttonRef$current$ch","_buttonRef$current","_buttonElement$childN","_buttonElement$childN2","childNodes","xmlns","viewBox","d","$e5534fc185f7111e$export$2e2bcd8739ae039","$dvPge$useRef","instance","update","$dvPge$useEffect","$dvPge$Picker","$dvPge$react","EMOJI_MART_DATA_URL","cacheI18n","EmojiPicker","theme","onSelectEmoji","disableRecent","customEmojis","language","categories","categoryies","i18n","setI18n","undefined","en","fetch","then","data","translations","json","catch","error","console","Picker","previewPosition","onEmojiSelect","custom","set","memo","EmojiPickerContainer","handleSelectEmoji","position","evt","stopPropagation","top","EMOJI_PICKER_CONTAINER_HEIGHT","EmojiPickerWrapper","keepOpened","addPolluteFn","setShowPicker","customButton","setCustomButton","emojiPickerPosition","setEmojiPickerPosition","checkClickOutside","target","classList","contains","addEventListener","removeEventListener","calcTopPosition","currentShowPicker","btn","currentTarget","btnRect","getBoundingClientRect","popoverHeight","ReactDOM","createPortal","Fragment","getTextFromAtToCaret","getRangeFromAtToCaret","begin","end","deleteTextFromAtToCaret","deleteData","elementWithFocus","getElementWithFocus","caretOffset","lastAt","lastIndexOf","preCaretRange","selectNodeContents","endContainer","endOffset","textRange","createRange","preCaretTextRange","body","createTextRange","moveToElementText","setEndPoint","useMention","searchMention","loading","setLoading","mentionUsers","setMentionUsers","mentionSearchText","setMentionSearchText","onSelectUser","checkMentionText","metionText","users","_getElementWithFocus","parentElement","hasAttribute","remove","includes","MentionUserList","onSelect","selectedUser","setSelectedUser","prevUser","currentSelectedUser","nextUser","getMentionSelectedNameEl","rest","usersFiltered","searchText","toLocaleLowerCase","map","user","nameHtml","toLowerCase","startsWith","names","split","_objectSpread","unsubscribe","id","onMouseOver","dangerouslySetInnerHTML","__html","MentionUserListWithRef","MentionWrapper","metionUserListRef","showUserList","setShowUserList","mentionsEl","mentionEl","mentionName","mentionId","unsubscribeArrowUp","unsubscribeArrowDown","handleSelect","createObserver","listeners","subscribe","listener","filter","l","publish","currentListerners","useEventListeners","keyDown","keyUp","arrowUp","arrowDown","enter","usePollute","polluteFnsRef","pollute","InputEmoji","cleanOnEnter","maxLength","inputClass","borderRadius","borderColor","fontSize","fontFamily","background","updateHTML","nextValue","handleKeydown","nativeEvent","handleFocus","handleBlur","handleTextInputChange","handlePaste","content","getData","execCommand","InputEmojiWithRef","defaultProps"],"mappings":";;;;;;;;;;;AAAA,SAASA,WAAWA,CAACC,GAAG,EAAEC,GAAG,EAAE;EAC7B,IAAKA,GAAG,KAAK,KAAK,CAAC,EAAGA,GAAG,GAAG,EAAE,CAAA;AAC9B,EAAA,IAAIC,QAAQ,GAAGD,GAAG,CAACC,QAAQ,CAAA;AAE3B,EAAA,IAAI,CAACF,GAAG,IAAI,OAAOG,QAAQ,KAAK,WAAW,EAAE;AAAE,IAAA,OAAA;AAAQ,GAAA;AAEvD,EAAA,IAAIC,IAAI,GAAGD,QAAQ,CAACC,IAAI,IAAID,QAAQ,CAACE,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;AACpE,EAAA,IAAIC,KAAK,GAAGH,QAAQ,CAACI,aAAa,CAAC,OAAO,CAAC,CAAA;EAC3CD,KAAK,CAACE,IAAI,GAAG,UAAU,CAAA;EAEvB,IAAIN,QAAQ,KAAK,KAAK,EAAE;IACtB,IAAIE,IAAI,CAACK,UAAU,EAAE;MACnBL,IAAI,CAACM,YAAY,CAACJ,KAAK,EAAEF,IAAI,CAACK,UAAU,CAAC,CAAA;AAC3C,KAAC,MAAM;AACLL,MAAAA,IAAI,CAACO,WAAW,CAACL,KAAK,CAAC,CAAA;AACzB,KAAA;AACF,GAAC,MAAM;AACLF,IAAAA,IAAI,CAACO,WAAW,CAACL,KAAK,CAAC,CAAA;AACzB,GAAA;EAEA,IAAIA,KAAK,CAACM,UAAU,EAAE;AACpBN,IAAAA,KAAK,CAACM,UAAU,CAACC,OAAO,GAAGb,GAAG,CAAA;AAChC,GAAC,MAAM;IACLM,KAAK,CAACK,WAAW,CAACR,QAAQ,CAACW,cAAc,CAACd,GAAG,CAAC,CAAC,CAAA;AACjD,GAAA;AACF;;;;;ACzBA;AACA;;AAEO,MAAMe,eAAe,G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