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,YAAaC,mBAAoB,CACxC,eACA,MACA,SACA,UACA,cAmBJC,YAAa,CAAEwM,IAAK,GAAIiF,KAAM,EAAGC,MAAO,EAAGC,QAASC,QAAejJ,EAA2BjJ,SAAUsR,EAAkB,GAAc,SAAKrD,EAAA,EAAgB,IAAKsD,EAAevR,SAAU0N,KACnM,yGC/Ge,SAASM,GAAkB,OAAErO,EAAM,KAAEwS,EAAO,MACvD,MAAOC,EAAoBC,IAAyB,IAAArN,aAAuB,OAAXrF,QAA8B,IAAXA,OAAoB,EAASA,EAAO2S,YACjHC,GAA2B,IAAAzH,UAAQ,IAAM,KAAUa,GAAY0G,EAAsB1G,IAAUwG,IAAO,CAACA,IAgB7G,OAfA,IAAAjP,YAAU,KACN,MAAMoP,KAA0B,OAAX3S,QAA8B,IAAXA,OAAoB,EAASA,EAAO2S,WAU5E,OATAC,EAAyBD,GAMrBA,GACAC,EAAyBC,QAEtB,KACHD,EAAyBE,QAAQ,CACpC,GACF,CAAY,OAAX9S,QAA8B,IAAXA,OAAoB,EAASA,EAAO2S,UAAWC,IAC/DH,CACX","sources":["webpack://app/./node_modules/@mui/icons-material/esm/Lock.js","webpack://app/./node_modules/@mui/icons-material/esm/LockOpen.js","webpack://app/./node_modules/@mui/icons-material/esm/TextFields.js","webpack://app/./node_modules/encodeurl/index.js","webpack://app/./node_modules/lodash/_asciiSize.js","webpack://app/./node_modules/lodash/_asciiToArray.js","webpack://app/./node_modules/lodash/_baseIsRegExp.js","webpack://app/./node_modules/lodash/_baseProperty.js","webpack://app/./node_modules/lodash/_castSlice.js","webpack://app/./node_modules/lodash/_hasUnicode.js","webpack://app/./node_modules/lodash/_stringSize.js","webpack://app/./node_modules/lodash/_stringToArray.js","webpack://app/./node_modules/lodash/_unicodeSize.js","webpack://app/./node_modules/lodash/_unicodeToArray.js","webpack://app/./node_modules/lodash/isRegExp.js","webpack://app/./node_modules/lodash/toFinite.js","webpack://app/./node_modules/lodash/toInteger.js","webpack://app/./node_modules/lodash/truncate.js","webpack://app/./node_modules/mui-tiptap/dist/esm/ControlledBubbleMenu.js","webpack://app/./node_modules/mui-tiptap/dist/esm/hooks/useKeyDown.js","webpack://app/./node_modules/mui-tiptap/dist/esm/LinkBubbleMenu/EditLinkMenuContent.js","webpack://app/./node_modules/mui-tiptap/dist/esm/utils/truncateMiddle.js","webpack://app/./node_modules/mui-tiptap/dist/esm/LinkBubbleMenu/ViewLinkMenuContent.js","webpack://app/./node_modules/mui-tiptap/dist/esm/LinkBubbleMenu/index.js","webpack://app/./node_modules/mui-tiptap/dist/esm/RichTextContent.js","webpack://app/./node_modules/mui-tiptap/dist/esm/FieldContainer.js","webpack://app/./node_modules/mui-tiptap/dist/esm/MenuBar.js","webpack://app/./node_modules/mui-tiptap/dist/esm/RichTextField.js","webpack://app/./node_modules/mui-tiptap/dist/esm/RichTextEditor.js","webpack://app/./node_modules/mui-tiptap/dist/esm/RichTextEditorProvider.js","webpack://app/./node_modules/mui-tiptap/dist/esm/RichTextReadOnly.js","webpack://app/./node_modules/@mui/icons-material/esm/FormatColorFill.js","webpack://app/./node_modules/@mui/icons-material/esm/GridOff.js","webpack://app/./node_modules/mui-tiptap/dist/esm/icons/InsertColumnLeft.js","webpack://app/./node_modules/mui-tiptap/dist/esm/icons/InsertColumnRight.js","webpack://app/./node_modules/mui-tiptap/dist/esm/icons/DeleteColumn.js","webpack://app/./node_modules/mui-tiptap/dist/esm/icons/InsertRowTop.js","webpack://app/./node_modules/mui-tiptap/dist/esm/icons/InsertRowBottom.js","webpack://app/./node_modules/mui-tiptap/dist/esm/icons/DeleteRow.js","webpack://app/./node_modules/mui-tiptap/dist/esm/icons/MergeCellsHorizontal.js","webpack://app/./node_modules/mui-tiptap/dist/esm/icons/SplitCellsHorizontal.js","webpack://app/./node_modules/mui-tiptap/dist/esm/icons/LayoutRowFill.js","webpack://app/./node_modules/mui-tiptap/dist/esm/icons/LayoutColumnFill.js","webpack://app/./node_modules/mui-tiptap/dist/esm/controls/TableMenuControls.js","webpack://app/./node_modules/mui-tiptap/dist/esm/TableBubbleMenu.js","webpack://app/./node_modules/mui-tiptap/dist/esm/hooks/useDebouncedFocus.js"],"sourcesContent":["\"use client\";\n\nimport createSvgIcon from './utils/createSvgIcon';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon( /*#__PURE__*/_jsx(\"path\", {\n d: \"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2m-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2m3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1z\"\n}), 'Lock');","\"use client\";\n\nimport createSvgIcon from './utils/createSvgIcon';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon( /*#__PURE__*/_jsx(\"path\", {\n d: \"M12 17c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m6-9h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6h1.9c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2m0 12H6V10h12z\"\n}), 'LockOpen');","\"use client\";\n\nimport createSvgIcon from './utils/createSvgIcon';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon( /*#__PURE__*/_jsx(\"path\", {\n d: \"M2.5 4v3h5v12h3V7h5V4zm19 5h-9v3h3v7h3v-7h3z\"\n}), 'TextFields');","/*!\n * encodeurl\n * Copyright(c) 2016 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = encodeUrl\n\n/**\n * RegExp to match non-URL code points, *after* encoding (i.e. not including \"%\")\n * and including invalid escape sequences.\n * @private\n */\n\nvar ENCODE_CHARS_REGEXP = /(?:[^\\x21\\x25\\x26-\\x3B\\x3D\\x3F-\\x5B\\x5D\\x5F\\x61-\\x7A\\x7E]|%(?:[^0-9A-Fa-f]|[0-9A-Fa-f][^0-9A-Fa-f]|$))+/g\n\n/**\n * RegExp to match unmatched surrogate pair.\n * @private\n */\n\nvar UNMATCHED_SURROGATE_PAIR_REGEXP = /(^|[^\\uD800-\\uDBFF])[\\uDC00-\\uDFFF]|[\\uD800-\\uDBFF]([^\\uDC00-\\uDFFF]|$)/g\n\n/**\n * String to replace unmatched surrogate pair with.\n * @private\n */\n\nvar UNMATCHED_SURROGATE_PAIR_REPLACE = '$1\\uFFFD$2'\n\n/**\n * Encode a URL to a percent-encoded form, excluding already-encoded sequences.\n *\n * This function will take an already-encoded URL and encode all the non-URL\n * code points. This function will not encode the \"%\" character unless it is\n * not part of a valid sequence (`%20` will be left as-is, but `%foo` will\n * be encoded as `%25foo`).\n *\n * This encode is meant to be \"safe\" and does not throw errors. It will try as\n * hard as it can to properly encode the given URL, including replacing any raw,\n * unpaired surrogate pairs with the Unicode replacement character prior to\n * encoding.\n *\n * @param {string} url\n * @return {string}\n * @public\n */\n\nfunction encodeUrl (url) {\n return String(url)\n .replace(UNMATCHED_SURROGATE_PAIR_REGEXP, UNMATCHED_SURROGATE_PAIR_REPLACE)\n .replace(ENCODE_CHARS_REGEXP, encodeURI)\n}\n","var baseProperty = require('./_baseProperty');\n\n/**\n * Gets the size of an ASCII `string`.\n *\n * @private\n * @param {string} string The string inspect.\n * @returns {number} Returns the string size.\n */\nvar asciiSize = baseProperty('length');\n\nmodule.exports = asciiSize;\n","/**\n * Converts an ASCII `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\nfunction asciiToArray(string) {\n return string.split('');\n}\n\nmodule.exports = asciiToArray;\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar regexpTag = '[object RegExp]';\n\n/**\n * The base implementation of `_.isRegExp` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.\n */\nfunction baseIsRegExp(value) {\n return isObjectLike(value) && baseGetTag(value) == regexpTag;\n}\n\nmodule.exports = baseIsRegExp;\n","/**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\nfunction baseProperty(key) {\n return function(object) {\n return object == null ? undefined : object[key];\n };\n}\n\nmodule.exports = baseProperty;\n","var baseSlice = require('./_baseSlice');\n\n/**\n * Casts `array` to a slice if it's needed.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {number} start The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the cast slice.\n */\nfunction castSlice(array, start, end) {\n var length = array.length;\n end = end === undefined ? length : end;\n return (!start && end >= length) ? array : baseSlice(array, start, end);\n}\n\nmodule.exports = castSlice;\n","/** Used to compose unicode character classes. */\nvar rsAstralRange = '\\\\ud800-\\\\udfff',\n rsComboMarksRange = '\\\\u0300-\\\\u036f',\n reComboHalfMarksRange = '\\\\ufe20-\\\\ufe2f',\n rsComboSymbolsRange = '\\\\u20d0-\\\\u20ff',\n rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,\n rsVarRange = '\\\\ufe0e\\\\ufe0f';\n\n/** Used to compose unicode capture groups. */\nvar rsZWJ = '\\\\u200d';\n\n/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */\nvar reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');\n\n/**\n * Checks if `string` contains Unicode symbols.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {boolean} Returns `true` if a symbol is found, else `false`.\n */\nfunction hasUnicode(string) {\n return reHasUnicode.test(string);\n}\n\nmodule.exports = hasUnicode;\n","var asciiSize = require('./_asciiSize'),\n hasUnicode = require('./_hasUnicode'),\n unicodeSize = require('./_unicodeSize');\n\n/**\n * Gets the number of symbols in `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the string size.\n */\nfunction stringSize(string) {\n return hasUnicode(string)\n ? unicodeSize(string)\n : asciiSize(string);\n}\n\nmodule.exports = stringSize;\n","var asciiToArray = require('./_asciiToArray'),\n hasUnicode = require('./_hasUnicode'),\n unicodeToArray = require('./_unicodeToArray');\n\n/**\n * Converts `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\nfunction stringToArray(string) {\n return hasUnicode(string)\n ? unicodeToArray(string)\n : asciiToArray(string);\n}\n\nmodule.exports = stringToArray;\n","/** Used to compose unicode character classes. */\nvar rsAstralRange = '\\\\ud800-\\\\udfff',\n rsComboMarksRange = '\\\\u0300-\\\\u036f',\n reComboHalfMarksRange = '\\\\ufe20-\\\\ufe2f',\n rsComboSymbolsRange = '\\\\u20d0-\\\\u20ff',\n rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,\n rsVarRange = '\\\\ufe0e\\\\ufe0f';\n\n/** Used to compose unicode capture groups. */\nvar rsAstral = '[' + rsAstralRange + ']',\n rsCombo = '[' + rsComboRange + ']',\n rsFitz = '\\\\ud83c[\\\\udffb-\\\\udfff]',\n rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',\n rsNonAstral = '[^' + rsAstralRange + ']',\n rsRegional = '(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}',\n rsSurrPair = '[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]',\n rsZWJ = '\\\\u200d';\n\n/** Used to compose unicode regexes. */\nvar reOptMod = rsModifier + '?',\n rsOptVar = '[' + rsVarRange + ']?',\n rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',\n rsSeq = rsOptVar + reOptMod + rsOptJoin,\n rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';\n\n/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */\nvar reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');\n\n/**\n * Gets the size of a Unicode `string`.\n *\n * @private\n * @param {string} string The string inspect.\n * @returns {number} Returns the string size.\n */\nfunction unicodeSize(string) {\n var result = reUnicode.lastIndex = 0;\n while (reUnicode.test(string)) {\n ++result;\n }\n return result;\n}\n\nmodule.exports = unicodeSize;\n","/** Used to compose unicode character classes. */\nvar rsAstralRange = '\\\\ud800-\\\\udfff',\n rsComboMarksRange = '\\\\u0300-\\\\u036f',\n reComboHalfMarksRange = '\\\\ufe20-\\\\ufe2f',\n rsComboSymbolsRange = '\\\\u20d0-\\\\u20ff',\n rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,\n rsVarRange = '\\\\ufe0e\\\\ufe0f';\n\n/** Used to compose unicode capture groups. */\nvar rsAstral = '[' + rsAstralRange + ']',\n rsCombo = '[' + rsComboRange + ']',\n rsFitz = '\\\\ud83c[\\\\udffb-\\\\udfff]',\n rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',\n rsNonAstral = '[^' + rsAstralRange + ']',\n rsRegional = '(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}',\n rsSurrPair = '[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]',\n rsZWJ = '\\\\u200d';\n\n/** Used to compose unicode regexes. */\nvar reOptMod = rsModifier + '?',\n rsOptVar = '[' + rsVarRange + ']?',\n rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',\n rsSeq = rsOptVar + reOptMod + rsOptJoin,\n rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';\n\n/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */\nvar reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');\n\n/**\n * Converts a Unicode `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\nfunction unicodeToArray(string) {\n return string.match(reUnicode) || [];\n}\n\nmodule.exports = unicodeToArray;\n","var baseIsRegExp = require('./_baseIsRegExp'),\n baseUnary = require('./_baseUnary'),\n nodeUtil = require('./_nodeUtil');\n\n/* Node.js helper references. */\nvar nodeIsRegExp = nodeUtil && nodeUtil.isRegExp;\n\n/**\n * Checks if `value` is classified as a `RegExp` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.\n * @example\n *\n * _.isRegExp(/abc/);\n * // => true\n *\n * _.isRegExp('/abc/');\n * // => false\n */\nvar isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;\n\nmodule.exports = isRegExp;\n","var toNumber = require('./toNumber');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0,\n MAX_INTEGER = 1.7976931348623157e+308;\n\n/**\n * Converts `value` to a finite number.\n *\n * @static\n * @memberOf _\n * @since 4.12.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted number.\n * @example\n *\n * _.toFinite(3.2);\n * // => 3.2\n *\n * _.toFinite(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toFinite(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toFinite('3.2');\n * // => 3.2\n */\nfunction toFinite(value) {\n if (!value) {\n return value === 0 ? value : 0;\n }\n value = toNumber(value);\n if (value === INFINITY || value === -INFINITY) {\n var sign = (value < 0 ? -1 : 1);\n return sign * MAX_INTEGER;\n }\n return value === value ? value : 0;\n}\n\nmodule.exports = toFinite;\n","var toFinite = require('./toFinite');\n\n/**\n * Converts `value` to an integer.\n *\n * **Note:** This method is loosely based on\n * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toInteger(3.2);\n * // => 3\n *\n * _.toInteger(Number.MIN_VALUE);\n * // => 0\n *\n * _.toInteger(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toInteger('3.2');\n * // => 3\n */\nfunction toInteger(value) {\n var result = toFinite(value),\n remainder = result % 1;\n\n return result === result ? (remainder ? result - remainder : result) : 0;\n}\n\nmodule.exports = toInteger;\n","var baseToString = require('./_baseToString'),\n castSlice = require('./_castSlice'),\n hasUnicode = require('./_hasUnicode'),\n isObject = require('./isObject'),\n isRegExp = require('./isRegExp'),\n stringSize = require('./_stringSize'),\n stringToArray = require('./_stringToArray'),\n toInteger = require('./toInteger'),\n toString = require('./toString');\n\n/** Used as default options for `_.truncate`. */\nvar DEFAULT_TRUNC_LENGTH = 30,\n DEFAULT_TRUNC_OMISSION = '...';\n\n/** Used to match `RegExp` flags from their coerced string values. */\nvar reFlags = /\\w*$/;\n\n/**\n * Truncates `string` if it's longer than the given maximum string length.\n * The last characters of the truncated string are replaced with the omission\n * string which defaults to \"...\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to truncate.\n * @param {Object} [options={}] The options object.\n * @param {number} [options.length=30] The maximum string length.\n * @param {string} [options.omission='...'] The string to indicate text is omitted.\n * @param {RegExp|string} [options.separator] The separator pattern to truncate to.\n * @returns {string} Returns the truncated string.\n * @example\n *\n * _.truncate('hi-diddly-ho there, neighborino');\n * // => 'hi-diddly-ho there, neighbo...'\n *\n * _.truncate('hi-diddly-ho there, neighborino', {\n * 'length': 24,\n * 'separator': ' '\n * });\n * // => 'hi-diddly-ho there,...'\n *\n * _.truncate('hi-diddly-ho there, neighborino', {\n * 'length': 24,\n * 'separator': /,? +/\n * });\n * // => 'hi-diddly-ho there...'\n *\n * _.truncate('hi-diddly-ho there, neighborino', {\n * 'omission': ' [...]'\n * });\n * // => 'hi-diddly-ho there, neig [...]'\n */\nfunction truncate(string, options) {\n var length = DEFAULT_TRUNC_LENGTH,\n omission = DEFAULT_TRUNC_OMISSION;\n\n if (isObject(options)) {\n var separator = 'separator' in options ? options.separator : separator;\n length = 'length' in options ? toInteger(options.length) : length;\n omission = 'omission' in options ? baseToString(options.omission) : omission;\n }\n string = toString(string);\n\n var strLength = string.length;\n if (hasUnicode(string)) {\n var strSymbols = stringToArray(string);\n strLength = strSymbols.length;\n }\n if (length >= strLength) {\n return string;\n }\n var end = length - stringSize(omission);\n if (end < 1) {\n return omission;\n }\n var result = strSymbols\n ? castSlice(strSymbols, 0, end).join('')\n : string.slice(0, end);\n\n if (separator === undefined) {\n return result + omission;\n }\n if (strSymbols) {\n end += (result.length - end);\n }\n if (isRegExp(separator)) {\n if (string.slice(end).search(separator)) {\n var match,\n substring = result;\n\n if (!separator.global) {\n separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');\n }\n separator.lastIndex = 0;\n while ((match = separator.exec(substring))) {\n var newEnd = match.index;\n }\n result = result.slice(0, newEnd === undefined ? end : newEnd);\n }\n } else if (string.indexOf(baseToString(separator), end) != end) {\n var index = result.lastIndexOf(separator);\n if (index > -1) {\n result = result.slice(0, index);\n }\n }\n return result + omission;\n}\n\nmodule.exports = truncate;\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { Fade, Paper, Popper, useTheme, } from \"@mui/material\";\nimport { isNodeSelection, posToDOMRect } from \"@tiptap/core\";\nimport { useCallback } from \"react\";\nimport { makeStyles } from \"tss-react/mui\";\nimport { Z_INDEXES, getUtilityClasses } from \"./styles\";\nconst controlledBubbleMenuClasses = getUtilityClasses(ControlledBubbleMenu.name, [\"root\", \"paper\"]);\nconst useStyles = makeStyles({ name: { ControlledBubbleMenu } })((theme) => ({\n root: {\n zIndex: Z_INDEXES.BUBBLE_MENU,\n },\n paper: {\n backgroundColor: theme.palette.background.default,\n },\n}));\n// The `BubbleMenu` React component provided by Tiptap in @tiptap/react and the\n// underlying BubbleMenuPlugin don't work very well in practice. There are two\n// primary problems:\n// 1) BubbleMenu places its tippy DOM element *within* the editor DOM structure,\n// so it can get clipped by the edges of the editor, especially noticeable\n// when there is no content in the editor yet (so it'll get sliced off at the\n// top of the editor). It's not possible to use a React Portal there as a\n// workaround due to the way in which the element is dynamically\n// created/destroyed via tippy inside Tiptap, preventing interactivity (see\n// https://github.com/ueberdosis/tiptap/issues/2292).\n// 2) The BubbleMenu visibility cannot be controlled programmatically. Its\n// `shouldShow` callback only runs when editor internal state changes, so we\n// can't control it beyond that without wacky hacks. See the issue here\n// https://github.com/ueberdosis/tiptap/issues/2305.\n//\n// This alternative component has a simpler API, with just an `open` flag, which\n// properly responds to all changes in React props, and it uses MUI's Popper\n// rather than relying on tippy, so we inherently get \"Portal\" behavior and\n// don't have to worry about visual clipping.\nexport default function ControlledBubbleMenu({ editor, open, className, classes: overrideClasses = {}, children, anchorEl, container, disablePortal, placement = \"top\", fallbackPlacements = [\n \"top\",\n \"bottom\",\n \"top-start\",\n \"bottom-start\",\n \"top-end\",\n \"bottom-end\",\n], flipPadding = 8, PaperProps, }) {\n const { classes, cx } = useStyles(undefined, {\n props: { classes: overrideClasses },\n });\n const theme = useTheme();\n const defaultAnchorEl = useCallback(() => {\n // The logic here is taken from the positioning implementation in Tiptap's BubbleMenuPlugin\n // https://github.com/ueberdosis/tiptap/blob/16bec4e9d0c99feded855b261edb6e0d3f0bad21/packages/extension-bubble-menu/src/bubble-menu-plugin.ts#L183-L193\n const { ranges } = editor.state.selection;\n const from = Math.min(...ranges.map((range) => range.$from.pos));\n const to = Math.max(...ranges.map((range) => range.$to.pos));\n return {\n getBoundingClientRect: () => {\n if (isNodeSelection(editor.state.selection)) {\n const node = editor.view.nodeDOM(from);\n if (node instanceof HTMLElement) {\n return node.getBoundingClientRect();\n }\n }\n return posToDOMRect(editor.view, from, to);\n },\n };\n }, [editor]);\n return (_jsx(Popper, { open: open, placement: placement, modifiers: [\n {\n name: \"offset\",\n options: {\n // Add a slight vertical offset for the popper from the current selection\n offset: [0, 6],\n },\n },\n {\n name: \"flip\",\n enabled: true,\n options: {\n // We'll reposition (to one of the below fallback placements) whenever our Popper goes\n // outside of the editor. (This is necessary since our children aren't actually rendered\n // here, but instead with a portal, so the editor DOM node isn't a parent.)\n boundary: editor.options.element,\n fallbackPlacements: fallbackPlacements,\n padding: flipPadding,\n },\n },\n {\n // Don't allow the bubble menu to overflow outside of the its clipping parents\n // or viewport\n name: \"preventOverflow\",\n enabled: true,\n options: {\n // Check for overflow in the y-axis direction instead of x-axis direction\n // (the default for top and bottom placements), since that's likely to be\n // the more problematic direction when scrolling. (Theoretically it would be\n // nice to have it check all axes which seemingly could be done with\n // `mainAxis: false`, but for an element that is wide and tall, this ends up\n // not placing the Popper in a visible location, so the behavior of\n // `altAxis: true` seems preferable.)\n altAxis: true,\n boundary: \"clippingParents\",\n padding: 8,\n },\n },\n // If we want to add an arrow to the Popper, we'll seemingly need to implement a lot\n // of custom styling and whatnot, like in\n // https://github.com/mui-org/material-ui/blob/84671ab1d6db4f6901d60206f2375bd51862c66e/docs/src/pages/components/popper/ScrollPlayground.js#L19-L103,\n // which is probably not worth it\n ], anchorEl: anchorEl !== null && anchorEl !== void 0 ? anchorEl : defaultAnchorEl, className: cx(controlledBubbleMenuClasses.root, classes.root, className), container: container, disablePortal: disablePortal, transition: true, children: ({ TransitionProps }) => (_jsx(Fade, { ...TransitionProps, timeout: {\n enter: theme.transitions.duration.enteringScreen,\n // Exit immediately rather than using a transition, since the\n // content of the bubble menu will usually be updating as the editor\n // content and thus `open` state changes, and we don't want it to\n // \"flash\" with incorrect content during the transition\n exit: 0,\n }, children: _jsx(Paper, { elevation: 7, ...PaperProps, className: cx(controlledBubbleMenuClasses.paper, classes.paper, PaperProps === null || PaperProps === void 0 ? void 0 : PaperProps.className), children: children }) })) }));\n}\n","import { useEffect, useRef } from \"react\";\n/** When the given key is pressed down, execute the given callback. */\nexport default function useKeyDown(key, callback) {\n // Use a ref in case `callback` isn't memoized\n const callbackRef = useRef(callback);\n useEffect(() => {\n callbackRef.current = callback;\n }, [callback]);\n useEffect(() => {\n function handleKeyDown(event) {\n if (key === event.key) {\n callbackRef.current(event);\n }\n }\n document.addEventListener(\"keydown\", handleKeyDown);\n return () => {\n document.removeEventListener(\"keydown\", handleKeyDown);\n };\n }, [key]);\n}\n","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { Button, DialogActions, TextField, Typography } from \"@mui/material\";\nimport { getMarkRange, getMarkType } from \"@tiptap/core\";\nimport encodeurl from \"encodeurl\";\nimport { useCallback, useEffect, useRef, useState, } from \"react\";\nimport useKeyDown from \"../hooks/useKeyDown\";\n/** Shown when a user is adding/editing a Link for Tiptap. */\nexport default function EditLinkMenuContent({ editor, onCancel, onSave, labels, }) {\n var _a, _b, _c, _d, _e, _f;\n const existingHref = editor.isActive(\"link\")\n ? editor.getAttributes(\"link\").href\n : \"\";\n const linkRange = getMarkRange(editor.state.selection.$from, getMarkType(\"link\", editor.schema));\n const linkText = linkRange\n ? editor.state.doc.textBetween(linkRange.from, linkRange.to)\n : \"\";\n const selectedText = editor.state.doc.textBetween(editor.state.selection.$from.pos, editor.state.selection.$to.pos);\n // If we're on a link, we'll use the full link text, otherwise we'll fall back\n // to the selected text\n const initialText = linkText || selectedText;\n const [textValue, setTextValue] = useState(initialText);\n const [hrefValue, setHrefValue] = useState(existingHref);\n const textRef = useRef(null);\n const hrefRef = useRef(null);\n // If there's already a link where the user has clicked, they're \"editing\",\n // otherwise the menu has been brought up to add a new link\n const isNewLink = !existingHref;\n const addLinkTitle = (_a = labels === null || labels === void 0 ? void 0 : labels.editLinkAddTitle) !== null && _a !== void 0 ? _a : \"Add link\";\n const editLinkTitle = (_b = labels === null || labels === void 0 ? void 0 : labels.editLinkEditTitle) !== null && _b !== void 0 ? _b : \"Edit link\";\n const editMenuTitle = isNewLink ? addLinkTitle : editLinkTitle;\n // When bringing up the Popper of the `ControlledBubbleMenu` and using\n // autoFocus on the TextField elements, it is causing a scroll jump as\n // described here https://github.com/mui-org/material-ui/issues/16740. (It\n // seems the fix that was merged for that has since been undone, as the popper\n // styles now using `absolute` positioning again.) So we'll focus on the\n // appropriate input with `useEffect` below instead.\n useEffect(() => {\n var _a, _b;\n // We'll auto-focus on the text input if (a) it's not a new link, or (b)\n // it's a new link and they do not have some initial text already (e.g.,\n // they brought up the link menu with some text selected already). Otherwise\n // well focus on the href input.\n const autoFocusOnTextInput = !isNewLink || !initialText;\n if (autoFocusOnTextInput) {\n (_a = textRef.current) === null || _a === void 0 ? void 0 : _a.focus();\n }\n else {\n (_b = hrefRef.current) === null || _b === void 0 ? void 0 : _b.focus();\n }\n }, [isNewLink, initialText]);\n // If the user presses escape, we should cancel\n useKeyDown(\"Escape\", onCancel);\n const formatHref = useCallback(() => {\n if (!hrefRef.current) {\n return;\n }\n // Parse what the user typed in, and add a protocol if they typed in a value\n // but didn't include a protocol. (This also includes mailto and tel, since\n // they are also valid for `href`\n // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-href and\n // Tiptap has builtin autolink support for email address conversion to\n // mailto.) This is what Slack does, and seems like a reasonable behavior to\n // ensure it's a valid URL (e.g. if someone types \"example.com\", we should\n // accept it and treat it as \"http://example.com\", not a relative path on the\n // current site). It also allows the value to pass browser-builtin\n // `type=\"url\"` validation.\n let currentHrefValue = hrefRef.current.value.trim();\n if (currentHrefValue &&\n !currentHrefValue.startsWith(\"http://\") &&\n !currentHrefValue.startsWith(\"https://\") &&\n !currentHrefValue.startsWith(\"mailto:\") &&\n !currentHrefValue.startsWith(\"tel:\")) {\n currentHrefValue = `http://${currentHrefValue}`;\n }\n // URL-encode any characters that wouldn't be valid. We use `encodeurl`\n // instead of the builtin `encodeURI` so that if there are any\n // already-encoded sequences, they're not double-encoded and thus broken.\n // (Useful for instance when a user pastes a URL into the form with complex\n // and already-encoded parameters.)\n setHrefValue(encodeurl(currentHrefValue));\n }, []);\n const [isSubmitting, setIsSubmitting] = useState(false);\n return (_jsxs(\"form\", { onSubmit: (event) => {\n var _a, _b, _c, _d;\n // Don't submit the form with a standard full-page request\n event.preventDefault();\n // Don't let this event propagate upwards in the React tree, to prevent\n // submitting any form the rich text editor is wrapped in\n // (https://github.com/sjdemartini/mui-tiptap/issues/105)\n event.stopPropagation();\n setIsSubmitting(true);\n const text = (_b = (_a = textRef.current) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : \"\";\n const href = (_d = (_c = hrefRef.current) === null || _c === void 0 ? void 0 : _c.value) !== null && _d !== void 0 ? _d : \"\";\n onSave({ text: text, link: href });\n setIsSubmitting(false);\n }, autoComplete: \"off\", children: [_jsx(Typography, { variant: \"h6\", children: editMenuTitle }), _jsx(TextField, { inputRef: textRef, value: textValue, disabled: isSubmitting, onChange: (event) => setTextValue(event.target.value), label: (_c = labels === null || labels === void 0 ? void 0 : labels.editLinkTextInputLabel) !== null && _c !== void 0 ? _c : \"Text\", margin: \"normal\", size: \"small\", fullWidth: true, required: true }), _jsx(TextField, { inputRef: hrefRef, value: hrefValue, onChange: (event) => setHrefValue(event.target.value), disabled: isSubmitting, label: (_d = labels === null || labels === void 0 ? void 0 : labels.editLinkHrefInputLabel) !== null && _d !== void 0 ? _d : \"Link\", margin: \"dense\", size: \"small\", type: \"url\", onBlur: formatHref, onKeyDown: (event) => {\n // If the user is trying to submit the form directly from the href field, make\n // sure we first format what they entered (which will update it to allow it to\n // pass URL field validation)\n if (event.key === \"Enter\") {\n formatHref();\n }\n }, fullWidth: true, required: true }), _jsxs(DialogActions, { sx: { px: 0 }, children: [_jsx(Button, { onClick: onCancel, variant: \"outlined\", size: \"small\", children: (_e = labels === null || labels === void 0 ? void 0 : labels.editLinkCancelButtonLabel) !== null && _e !== void 0 ? _e : \"Cancel\" }), _jsx(Button, { type: \"submit\", color: \"primary\", variant: \"outlined\", size: \"small\", disabled: isSubmitting, children: (_f = labels === null || labels === void 0 ? void 0 : labels.editLinkSaveButtonLabel) !== null && _f !== void 0 ? _f : \"Save\" })] })] }));\n}\n","/**\n * Truncate the middle of the given text, if it's longer than the given length.\n */\nexport default function truncateMiddle(text, length = 20) {\n if (text.length <= length) {\n return text;\n }\n const half = Math.floor(length / 2);\n return `${text.slice(0, half).trim()}…${text.slice(-half).trim()}`;\n}\n","import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from \"react/jsx-runtime\";\nimport { Button, DialogActions, Link } from \"@mui/material\";\nimport { getMarkRange, getMarkType } from \"@tiptap/core\";\nimport truncate from \"lodash/truncate\";\nimport { makeStyles } from \"tss-react/mui\";\nimport useKeyDown from \"../hooks/useKeyDown\";\nimport truncateMiddle from \"../utils/truncateMiddle\";\nconst useStyles = makeStyles({ name: { ViewLinkMenuContent } })({\n linkPreviewText: {\n overflowWrap: \"anywhere\",\n },\n});\n/** Shown when a user is viewing the details of an existing Link for Tiptap. */\nexport default function ViewLinkMenuContent({ editor, onCancel, onEdit, onRemove, labels, }) {\n var _a, _b, _c;\n const { classes } = useStyles();\n const linkRange = getMarkRange(editor.state.selection.$to, getMarkType(\"link\", editor.schema));\n const linkText = linkRange\n ? editor.state.doc.textBetween(linkRange.from, linkRange.to)\n : \"\";\n const currentHref = (_a = editor.getAttributes(\"link\").href) !== null && _a !== void 0 ? _a : \"\";\n // If the user presses escape, we should cancel\n useKeyDown(\"Escape\", onCancel);\n return (_jsxs(_Fragment, { children: [_jsx(\"div\", { className: classes.linkPreviewText, children: truncate(linkText, {\n length: 50,\n omission: \"…\",\n }) }), _jsx(\"div\", { className: classes.linkPreviewText, children: _jsx(Link, { href: currentHref, target: \"_blank\", rel: \"noopener\", children: truncateMiddle(currentHref, 50) }) }), _jsxs(DialogActions, { sx: { px: 0 }, children: [_jsx(Button, { onClick: onEdit, color: \"primary\", variant: \"outlined\", size: \"small\", children: (_b = labels === null || labels === void 0 ? void 0 : labels.viewLinkEditButtonLabel) !== null && _b !== void 0 ? _b : \"Edit\" }), _jsx(Button, { onClick: onRemove, color: \"error\", variant: \"outlined\", size: \"small\", children: (_c = labels === null || labels === void 0 ? void 0 : labels.viewLinkRemoveButtonLabel) !== null && _c !== void 0 ? _c : \"Remove\" })] })] }));\n}\n","import { jsx as _jsx } from \"react/jsx-runtime\";\n/// \nimport { makeStyles } from \"tss-react/mui\";\nimport ControlledBubbleMenu from \"../ControlledBubbleMenu\";\nimport { useRichTextEditorContext } from \"../context\";\nimport { LinkMenuState, } from \"../extensions/LinkBubbleMenuHandler\";\nimport EditLinkMenuContent from \"./EditLinkMenuContent\";\nimport ViewLinkMenuContent from \"./ViewLinkMenuContent\";\nconst useStyles = makeStyles({ name: { LinkBubbleMenu } })((theme) => ({\n content: {\n padding: theme.spacing(1.5, 2, 0.5),\n },\n}));\n/**\n * A component that renders a bubble menu when viewing, creating, or editing a\n * link. Requires the mui-tiptap LinkBubbleMenuHandler extension and Tiptap's\n * Link extension (@tiptap/extension-link, https://tiptap.dev/api/marks/link) to\n * both be included in your editor `extensions` array.\n *\n * Pairs well with the `` component.\n *\n * If you're using `RichTextEditor`, include this component via\n * `RichTextEditor`’s `children` render-prop. Otherwise, include the\n * `LinkBubbleMenu` as a child of the component where you call `useEditor` and\n * render your `RichTextField` or `RichTextContent`. (The bubble menu itself\n * will be positioned appropriately no matter where you put it in your React\n * tree, as long as it is re-rendered whenever the Tiptap `editor` forces an\n * update, which will happen if it's a child of the component using\n * `useEditor`).\n */\nexport default function LinkBubbleMenu({ labels, ...controlledBubbleMenuProps }) {\n const { classes } = useStyles();\n const editor = useRichTextEditorContext();\n if (!(editor === null || editor === void 0 ? void 0 : editor.isEditable)) {\n return null;\n }\n if (!(\"linkBubbleMenuHandler\" in editor.storage)) {\n throw new Error(\"You must add the LinkBubbleMenuHandler extension to the useEditor `extensions` array in order to use this component!\");\n }\n const handlerStorage = editor.storage\n .linkBubbleMenuHandler;\n // Update the menu step if the bubble menu state has changed\n const menuState = handlerStorage.state;\n let linkMenuContent = null;\n if (menuState === LinkMenuState.VIEW_LINK_DETAILS) {\n linkMenuContent = (_jsx(ViewLinkMenuContent, { editor: editor, onCancel: editor.commands.closeLinkBubbleMenu, onEdit: editor.commands.editLinkInBubbleMenu, onRemove: () => {\n // Remove the link and place the cursor at the end of the link (which\n // requires \"focus\" to take effect)\n editor\n .chain()\n .unsetLink()\n .setTextSelection(editor.state.selection.to)\n .focus()\n .run();\n }, labels: labels }));\n }\n else if (menuState === LinkMenuState.EDIT_LINK) {\n linkMenuContent = (_jsx(EditLinkMenuContent, { editor: editor, onCancel: editor.commands.closeLinkBubbleMenu, onSave: ({ text, link }) => {\n editor\n .chain()\n // Make sure if we're updating a link, we update the link for the\n // full link \"mark\"\n .extendMarkRange(\"link\")\n // Update the link href and its text content\n .insertContent({\n type: \"text\",\n marks: [\n {\n type: \"link\",\n attrs: {\n href: link,\n },\n },\n ],\n text: text,\n })\n // Note that as of \"@tiptap/extension-link\" 2.0.0-beta.37 when\n // `autolink` is on (which we want), adding the link mark directly\n // via `insertContent` above wasn't sufficient for the link mark to\n // be applied (though specifying it above is still necessary), so we\n // insert the content there and call `setLink` separately here.\n // Unclear why this separate command is necessary, but it does the\n // trick.\n .setLink({\n href: link,\n })\n // Place the cursor at the end of the link (which requires \"focus\"\n // to take effect)\n .focus()\n .run();\n editor.commands.closeLinkBubbleMenu();\n }, labels: labels }));\n }\n return (_jsx(ControlledBubbleMenu, { editor: editor, open: menuState !== LinkMenuState.HIDDEN, ...handlerStorage.bubbleMenuOptions, ...controlledBubbleMenuProps, children: _jsx(\"div\", { className: classes.content, children: linkMenuContent }) }));\n}\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { Box } from \"@mui/material\";\nimport { EditorContent } from \"@tiptap/react\";\nimport { useMemo } from \"react\";\nimport { makeStyles } from \"tss-react/mui\";\nimport { useRichTextEditorContext } from \"./context\";\nimport { getEditorStyles, getUtilityClasses } from \"./styles\";\nconst richTextContentClasses = getUtilityClasses(RichTextContent.name, [\"root\", \"readonly\", \"editable\"]);\nconst useStyles = makeStyles({ name: { RichTextContent } })((theme) => {\n return {\n root: {\n // We add `as CSSObject` to get around typing issues with our editor\n // styles function. For future reference, this old issue and its solution\n // are related, though not quite right\n // https://github.com/garronej/tss-react/issues/2\n // https://github.com/garronej/tss-react/commit/9dc3f6f9f70b6df0bd83cd5689c3313467fb4f06\n \"& .ProseMirror\": {\n ...getEditorStyles(theme),\n },\n },\n // Styles applied when the editor is in read-only mode (editable=false)\n readonly: {},\n // Styles applied when the editor is editable (editable=true)\n editable: {},\n };\n});\n/**\n * A component for rendering a MUI-styled version of Tiptap rich text editor\n * content.\n *\n * Must be a child of the RichTextEditorProvider so that the `editor` context is\n * available.\n */\nexport default function RichTextContent({ className, classes: overrideClasses = {}, }) {\n const { classes, cx } = useStyles(undefined, {\n props: { classes: overrideClasses },\n });\n const editor = useRichTextEditorContext();\n const editorClasses = useMemo(() => cx(richTextContentClasses.root, className, classes.root, (editor === null || editor === void 0 ? void 0 : editor.isEditable)\n ? [richTextContentClasses.editable, classes.editable]\n : [richTextContentClasses.readonly, classes.readonly]), [className, classes, cx, editor === null || editor === void 0 ? void 0 : editor.isEditable]);\n return (_jsx(Box, { className: editorClasses, component: EditorContent, editor: editor }));\n}\n","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { makeStyles } from \"tss-react/mui\";\nimport { Z_INDEXES, getUtilityClasses } from \"./styles\";\nconst fieldContainerClasses = getUtilityClasses(FieldContainer.name, [\"root\", \"outlined\", \"standard\", \"focused\", \"disabled\", \"notchedOutline\"]);\n// eslint-disable-next-line @typescript-eslint/no-invalid-void-type\nconst useStyles = makeStyles({\n name: { FieldContainer },\n uniqId: \"Os7ZPW\", // https://docs.tss-react.dev/nested-selectors#ssr\n})((theme, _params, classes) => {\n // Based on the concept behind and styles of OutlinedInput and NotchedOutline\n // styles here, to imitate outlined input appearance in material-ui\n // https://github.com/mui-org/material-ui/blob/a4972c5931e637611f6421ed2a5cc3f78207cbb2/packages/material-ui/src/OutlinedInput/OutlinedInput.js#L9-L37\n // https://github.com/mui/material-ui/blob/a4972c5931e637611f6421ed2a5cc3f78207cbb2/packages/material-ui/src/OutlinedInput/NotchedOutline.js\n return {\n root: {},\n // Class/styles applied to the root element if the component is using the\n // \"outlined\" variant\n outlined: {\n borderRadius: theme.shape.borderRadius,\n padding: 1,\n position: \"relative\",\n [`&:hover .${classes.notchedOutline}`]: {\n borderColor: theme.palette.text.primary,\n },\n [`&.${classes.focused} .${classes.notchedOutline}`]: {\n borderColor: theme.palette.primary.main,\n borderWidth: 2,\n },\n [`&.${classes.disabled} .${classes.notchedOutline}`]: {\n borderColor: theme.palette.action.disabled,\n },\n },\n // Class/styles applied to the root element if the component is using the\n // \"standard\" variant\n standard: {},\n // Class/styles applied to the root element if the component is focused (if the\n // `focused` prop is true)\n focused: {},\n // Styles applied to the root element if the component is disabled (if the\n // `disabled` prop is true)\n disabled: {},\n notchedOutline: {\n position: \"absolute\",\n inset: 0,\n borderRadius: \"inherit\",\n borderColor: theme.palette.mode === \"light\"\n ? \"rgba(0, 0, 0, 0.23)\"\n : \"rgba(255, 255, 255, 0.23)\",\n borderStyle: \"solid\",\n borderWidth: 1,\n pointerEvents: \"none\",\n overflow: \"hidden\",\n zIndex: Z_INDEXES.NOTCHED_OUTLINE,\n },\n };\n});\n/**\n * Renders an element with classes and styles that correspond to the state and\n * style-variant of a user-input field, the content of which should be passed in as\n * `children`.\n */\nexport default function FieldContainer({ variant = \"outlined\", children, focused, disabled, classes: overrideClasses = {}, className, }) {\n const { classes, cx } = useStyles(undefined, {\n props: { classes: overrideClasses },\n });\n return (_jsxs(\"div\", { className: cx(fieldContainerClasses.root, classes.root, variant === \"outlined\"\n ? [fieldContainerClasses.outlined, classes.outlined]\n : [fieldContainerClasses.standard, classes.standard], \n // Note that we want focused and disabled styles of equal specificity to\n // trump default root/outlined/standard styles, so they should be defined\n // in this order\n focused && [fieldContainerClasses.focused, classes.focused], disabled && [fieldContainerClasses.disabled, classes.disabled], className), children: [children, variant === \"outlined\" && (_jsx(\"div\", { className: cx(fieldContainerClasses.notchedOutline, classes.notchedOutline), \"aria-hidden\": true }))] }));\n}\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { Collapse } from \"@mui/material\";\nimport { makeStyles } from \"tss-react/mui\";\nimport { Z_INDEXES, getUtilityClasses } from \"./styles\";\nconst menuBarClasses = getUtilityClasses(MenuBar.name, [\n \"root\",\n \"sticky\",\n \"nonSticky\",\n \"content\",\n]);\nconst useStyles = makeStyles({\n name: { MenuBar },\n})((theme, { stickyOffset }) => {\n return {\n root: {\n borderBottomColor: theme.palette.divider,\n borderBottomStyle: \"solid\",\n borderBottomWidth: 1,\n },\n sticky: {\n position: \"sticky\",\n top: stickyOffset !== null && stickyOffset !== void 0 ? stickyOffset : 0,\n zIndex: Z_INDEXES.MENU_BAR,\n background: theme.palette.background.default,\n },\n nonSticky: {},\n content: {},\n };\n});\n/**\n * A collapsible, optionally-sticky container for showing editor controls atop\n * the editor content.\n */\nexport default function MenuBar({ hide, disableSticky, stickyOffset, children, className, classes: overrideClasses, }) {\n const { classes, cx } = useStyles({ stickyOffset }, {\n props: { classes: overrideClasses },\n });\n return (_jsx(Collapse, { in: !hide, \n // For performance reasons, we set unmountOnExit to avoid rendering the\n // menu bar unless it's needed/shown\n unmountOnExit: true, \n // Note that we have to apply the sticky CSS classes to the container\n // (rather than the menu bar itself) in order for it to behave\n // properly\n className: cx(menuBarClasses.root, classes.root, disableSticky\n ? [menuBarClasses.nonSticky, classes.nonSticky]\n : [menuBarClasses.sticky, classes.sticky], className), children: _jsx(\"div\", { className: classes.content, children: children }) }));\n}\n","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { makeStyles } from \"tss-react/mui\";\nimport FieldContainer from \"./FieldContainer\";\nimport MenuBar from \"./MenuBar\";\nimport RichTextContent from \"./RichTextContent\";\nimport { useRichTextEditorContext } from \"./context\";\nimport useDebouncedFocus from \"./hooks/useDebouncedFocus\";\nimport { getUtilityClasses } from \"./styles\";\nimport DebounceRender from \"./utils/DebounceRender\";\nconst richTextFieldClasses = getUtilityClasses(RichTextField.name, [\"root\", \"standard\", \"outlined\", \"menuBar\", \"menuBarContent\", \"content\"]);\n// eslint-disable-next-line @typescript-eslint/no-invalid-void-type\nconst useStyles = makeStyles({\n name: { RichTextField },\n uniqId: \"E2Alw3\", // https://docs.tss-react.dev/nested-selectors#ssr\n})((theme, _params, classes) => {\n return {\n // This first class is added to allow convenient user overrides. Users can\n // similarly override the other classes below.\n root: {},\n standard: {\n // We don't need horizontal spacing when not using the outlined variant\n [`& .${classes.content}`]: {\n padding: theme.spacing(1.5, 0),\n },\n [`& .${classes.menuBarContent}`]: {\n padding: theme.spacing(1, 0),\n },\n },\n outlined: {\n // Add padding around the input area and menu bar, since they're\n // contained in the outline\n [`& .${classes.content}`]: {\n padding: theme.spacing(1.5),\n },\n [`& .${classes.menuBarContent}`]: {\n padding: theme.spacing(1, 1.5),\n },\n },\n menuBar: {},\n menuBarContent: {},\n content: {},\n };\n});\n/**\n * Renders the Tiptap rich text editor content and a controls menu bar.\n *\n * With the \"outlined\" variant, renders a bordered UI similar to the Material UI\n * `TextField`. The \"standard\" variant does not have an outline/border.\n *\n * Must be a child of the RichTextEditorProvider so that the `editor` context is\n * available.\n */\nexport default function RichTextField({ variant = \"outlined\", controls, disableDebounceRenderControls = false, disabled, className, classes: overrideClasses = {}, footer, MenuBarProps, RichTextContentProps, }) {\n var _a, _b;\n const { classes, cx } = useStyles(undefined, {\n props: { classes: overrideClasses },\n });\n const editor = useRichTextEditorContext();\n // Because the user interactions with the editor menu bar buttons unfocus the editor\n // (since it's not part of the editor content), we'll debounce our visual focused\n // state so that the (outlined) field focus styles don't \"flash\" whenever that happens\n const isFieldFocused = useDebouncedFocus({ editor });\n return (_jsxs(FieldContainer, { variant: variant, focused: !disabled && isFieldFocused, disabled: disabled, className: cx(richTextFieldClasses.root, classes.root, variant === \"outlined\"\n ? [richTextFieldClasses.outlined, classes.outlined]\n : [richTextFieldClasses.standard, classes.standard], className), children: [controls && (_jsx(MenuBar, { ...MenuBarProps, classes: {\n ...MenuBarProps === null || MenuBarProps === void 0 ? void 0 : MenuBarProps.classes,\n root: cx(richTextFieldClasses.menuBar, classes.menuBar, (_a = MenuBarProps === null || MenuBarProps === void 0 ? void 0 : MenuBarProps.classes) === null || _a === void 0 ? void 0 : _a.root),\n content: cx(richTextFieldClasses.content, classes.menuBarContent, (_b = MenuBarProps === null || MenuBarProps === void 0 ? void 0 : MenuBarProps.classes) === null || _b === void 0 ? void 0 : _b.content),\n }, children: disableDebounceRenderControls ? (controls) : (_jsx(DebounceRender, { children: controls })) })), _jsx(RichTextContent, { ...RichTextContentProps, className: cx(richTextFieldClasses.content, classes.content, RichTextContentProps === null || RichTextContentProps === void 0 ? void 0 : RichTextContentProps.className) }), footer] }));\n}\n","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { useEditor } from \"@tiptap/react\";\nimport { forwardRef, useEffect, useImperativeHandle, } from \"react\";\nimport RichTextEditorProvider from \"./RichTextEditorProvider\";\nimport RichTextField from \"./RichTextField\";\n/**\n * An all-in-one component to directly render a MUI-styled Tiptap rich text\n * editor field.\n *\n * NOTE: changes to `content` will not trigger re-rendering of the component.\n * i.e., by default the `content` prop is essentially \"initial content\". To\n * change content after rendering, you can use a hook and call\n * `rteRef.current?.editor?.setContent(newContent)`. See README \"Re-rendering\n * `RichTextEditor` when `content` changes\" for more details.\n *\n * Example:\n * Hello world

\" extensions={[...]} />\n */\nconst RichTextEditor = forwardRef(function RichTextEditor({ className, renderControls, RichTextFieldProps = {}, children, editorDependencies = [], \n// We default to `editable=true` just like `useEditor` does\neditable = true, ...editorProps }, ref) {\n const editor = useEditor({\n editable: editable,\n ...editorProps,\n }, editorDependencies);\n // Allow consumers of this component to access the editor via ref\n useImperativeHandle(ref, () => ({\n editor: editor,\n }));\n // Update editable state if/when it changes\n useEffect(() => {\n if (!editor || editor.isDestroyed || editor.isEditable === editable) {\n return;\n }\n // We use queueMicrotask to avoid any flushSync console errors as\n // mentioned here (though setEditable shouldn't trigger them in practice)\n // https://github.com/ueberdosis/tiptap/issues/3764#issuecomment-1546854730\n queueMicrotask(() => editor.setEditable(editable));\n }, [editable, editor]);\n return (_jsxs(RichTextEditorProvider, { editor: editor, children: [_jsx(RichTextField, { disabled: !editable, controls: renderControls === null || renderControls === void 0 ? void 0 : renderControls(editor), className: className, ...RichTextFieldProps }), children === null || children === void 0 ? void 0 : children(editor)] }));\n});\nexport default RichTextEditor;\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { RichTextEditorContext } from \"./context\";\n/**\n * Makes the Tiptap `editor` available to any nested components, via the\n * `useRichTextEditorContext()` hook so that the `editor` does not need to be\n * manually passed in at every level.\n *\n * Required as a parent for most mui-tiptap components besides the all-in-one\n * `RichTextEditor` and `RichTextReadOnly`.\n */\nexport default function RichTextEditorProvider({ editor, children, }) {\n return (_jsx(RichTextEditorContext.Provider, { value: editor, children: children }));\n}\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { useEditor } from \"@tiptap/react\";\nimport { useEffect, useRef } from \"react\";\nimport RichTextContent from \"./RichTextContent\";\nimport RichTextEditorProvider from \"./RichTextEditorProvider\";\nfunction RichTextReadOnlyInternal(props) {\n const editor = useEditor({\n ...props,\n editable: false,\n });\n // Update content if/when it changes\n const previousContent = useRef(props.content);\n useEffect(() => {\n if (!editor ||\n editor.isDestroyed ||\n props.content === undefined ||\n props.content === previousContent.current) {\n return;\n }\n // We use queueMicrotask to avoid any flushSync console errors as\n // mentioned here\n // https://github.com/ueberdosis/tiptap/issues/3764#issuecomment-1546854730\n queueMicrotask(() => {\n // Validate that props.content isn't undefined again to appease TS\n if (props.content !== undefined) {\n editor.commands.setContent(props.content);\n }\n });\n }, [props.content, editor]);\n useEffect(() => {\n previousContent.current = props.content;\n }, [props.content]);\n return (_jsx(RichTextEditorProvider, { editor: editor, children: _jsx(RichTextContent, {}) }));\n}\n/**\n * An all-in-one component to directly render read-only Tiptap editor content.\n *\n * When to use this component:\n * - You just want to render editor HTML/JSON content directly, without any\n * outlined field styling, menu bar, extra setup, etc.\n * - You want a convenient way to render content that re-renders as the\n * `content` prop changes.\n *\n * Though RichtextEditor (or useEditor, RichTextEditorProvider, and\n * RichTextContent) can be used as read-only via the editor's `editable` prop,\n * this is a simpler and more efficient version that only renders content and\n * nothing more (e.g., skips instantiating the editor at all if there's no\n * content to display, and does not contain additional rendering logic related\n * to controls, outlined field UI state, etc.).\n *\n * Example:\n * Hello world

\" extensions={[StarterKit]} />\n */\nexport default function RichTextReadOnly(props) {\n if (!props.content) {\n // Don't bother instantiating an editor at all (for performance) if we have\n // no content\n return null;\n }\n return _jsx(RichTextReadOnlyInternal, { ...props });\n}\n","\"use client\";\n\nimport createSvgIcon from './utils/createSvgIcon';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon( /*#__PURE__*/_jsx(\"path\", {\n d: \"M16.56 8.94 7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.59-.59 1.54 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.58.59-1.53 0-2.12M5.21 10 10 5.21 14.79 10zM19 11.5s-2 2.17-2 3.5c0 1.1.9 2 2 2s2-.9 2-2c0-1.33-2-3.5-2-3.5M2 20h20v4H2z\"\n}), 'FormatColorFill');","\"use client\";\n\nimport createSvgIcon from './utils/createSvgIcon';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon( /*#__PURE__*/_jsx(\"path\", {\n d: \"M8 4v1.45l2 2V4h4v4h-3.45l2 2H14v1.45l2 2V10h4v4h-3.45l2 2H20v1.45l2 2V4c0-1.1-.9-2-2-2H4.55l2 2zm8 0h4v4h-4zM1.27 1.27 0 2.55l2 2V20c0 1.1.9 2 2 2h15.46l2 2 1.27-1.27zM10 12.55 11.45 14H10zm-6-6L5.45 8H4zM8 20H4v-4h4zm0-6H4v-4h3.45l.55.55zm6 6h-4v-4h3.45l.55.54zm2 0v-1.46L17.46 20z\"\n}), 'GridOff');","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { createSvgIcon } from \"@mui/material\";\nconst InsertColumnLeft = createSvgIcon(\n// From https://remixicon.com/ (https://github.com/Remix-Design/RemixIcon)\n_jsx(\"path\", { d: \"M20 3C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H14C13.4477 21 13 20.5523 13 20V4C13 3.44772 13.4477 3 14 3H20ZM19 5H15V19H19V5ZM6 7C8.76142 7 11 9.23858 11 12C11 14.7614 8.76142 17 6 17C3.23858 17 1 14.7614 1 12C1 9.23858 3.23858 7 6 7ZM7 9H5V10.999L3 11V13L5 12.999V15H7V12.999L9 13V11L7 10.999V9Z\" }), \"InsertColumnLeft\");\nexport default InsertColumnLeft;\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { createSvgIcon } from \"@mui/material\";\nconst InsertColumnRight = createSvgIcon(\n// From https://remixicon.com/ (https://github.com/Remix-Design/RemixIcon)\n_jsx(\"path\", { d: \"M10 3C10.5523 3 11 3.44772 11 4V20C11 20.5523 10.5523 21 10 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3H10ZM9 5H5V19H9V5ZM18 7C20.7614 7 23 9.23858 23 12C23 14.7614 20.7614 17 18 17C15.2386 17 13 14.7614 13 12C13 9.23858 15.2386 7 18 7ZM19 9H17V10.999L15 11V13L17 12.999V15H19V12.999L21 13V11L19 10.999V9Z\" }), \"InsertColumnRight\");\nexport default InsertColumnRight;\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { createSvgIcon } from \"@mui/material\";\nconst DeleteColumn = createSvgIcon(\n// From https://remixicon.com/ (https://github.com/Remix-Design/RemixIcon)\n_jsx(\"path\", { d: \"M12 3C12.5523 3 13 3.44772 13 4L12.9998 11.9998C13.8355 11.372 14.8743 11 16 11C18.7614 11 21 13.2386 21 16C21 18.7614 18.7614 21 16 21C14.9681 21 14.0092 20.6874 13.2129 20.1518L13 20C13 20.5523 12.5523 21 12 21H6C5.44772 21 5 20.5523 5 20V4C5 3.44772 5.44772 3 6 3H12ZM11 5H7V19H11V5ZM19 15H13V17H19V15Z\" }), \"DeleteColumn\");\nexport default DeleteColumn;\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { createSvgIcon } from \"@mui/material\";\nconst InsertRowTop = createSvgIcon(\n// From https://remixicon.com/ (https://github.com/Remix-Design/RemixIcon)\n_jsx(\"path\", { d: \"M20 13C20.5523 13 21 13.4477 21 14V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V14C3 13.4477 3.44772 13 4 13H20ZM19 15H5V19H19V15ZM12 1C14.7614 1 17 3.23858 17 6C17 8.76142 14.7614 11 12 11C9.23858 11 7 8.76142 7 6C7 3.23858 9.23858 1 12 1ZM13 3H11V4.999L9 5V7L11 6.999V9H13V6.999L15 7V5L13 4.999V3Z\" }), \"InsertRowTop\");\nexport default InsertRowTop;\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { createSvgIcon } from \"@mui/material\";\nconst InsertRowBottom = createSvgIcon(\n// From https://remixicon.com/ (https://github.com/Remix-Design/RemixIcon)\n_jsx(\"path\", { d: \"M12 13C14.7614 13 17 15.2386 17 18C17 20.7614 14.7614 23 12 23C9.23858 23 7 20.7614 7 18C7 15.2386 9.23858 13 12 13ZM13 15H11V16.999L9 17V19L11 18.999V21H13V18.999L15 19V17L13 16.999V15ZM20 3C20.5523 3 21 3.44772 21 4V10C21 10.5523 20.5523 11 20 11H4C3.44772 11 3 10.5523 3 10V4C3 3.44772 3.44772 3 4 3H20ZM5 5V9H19V5H5Z\" }), \"InsertRowBottom\");\nexport default InsertRowBottom;\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { createSvgIcon } from \"@mui/material\";\nconst DeleteRow = createSvgIcon(\n// From https://remixicon.com/ (https://github.com/Remix-Design/RemixIcon)\n_jsx(\"path\", { d: \"M20 5C20.5523 5 21 5.44772 21 6V12C21 12.5523 20.5523 13 20 13C20.628 13.8355 21 14.8743 21 16C21 18.7614 18.7614 21 16 21C13.2386 21 11 18.7614 11 16C11 14.8743 11.372 13.8355 11.9998 12.9998L4 13C3.44772 13 3 12.5523 3 12V6C3 5.44772 3.44772 5 4 5H20ZM13 15V17H19V15H13ZM19 7H5V11H19V7Z\" }), \"DeleteRow\");\nexport default DeleteRow;\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { createSvgIcon } from \"@mui/material\";\nconst MergeCellsHorizontal = createSvgIcon(\n// From https://remixicon.com/ (https://github.com/Remix-Design/RemixIcon)\n_jsx(\"path\", { d: \"M20 3C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3H20ZM11 5H5V10.999H7V9L10 12L7 15V13H5V19H11V17H13V19H19V13H17V15L14 12L17 9V10.999H19V5H13V7H11V5ZM13 13V15H11V13H13ZM13 9V11H11V9H13Z\" }), \"MergeCellsHorizontal\");\nexport default MergeCellsHorizontal;\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { createSvgIcon } from \"@mui/material\";\nconst SplitCellsHorizontal = createSvgIcon(\n// From https://remixicon.com/ (https://github.com/Remix-Design/RemixIcon)\n_jsx(\"path\", { d: \"M20 3C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3H20ZM11 5H5V19H11V15H13V19H19V5H13V9H11V5ZM15 9L18 12L15 15V13H9V15L6 12L9 9V11H15V9Z\" }), \"SplitCellsHorizontal\");\nexport default SplitCellsHorizontal;\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { createSvgIcon } from \"@mui/material\";\nconst LayoutRowFill = createSvgIcon(\n// From https://remixicon.com/ (https://github.com/Remix-Design/RemixIcon)\n_jsx(\"path\", { d: \"M19 12H5V19H19V12ZM4 3H20C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3Z\" }), \"LayoutRowFill\");\nexport default LayoutRowFill;\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { createSvgIcon } from \"@mui/material\";\nconst LayoutColumnFill = createSvgIcon(\n// From https://remixicon.com/ (https://github.com/Remix-Design/RemixIcon)\n_jsx(\"path\", { d: \"M12 5V19H19V5H12ZM4 3H20C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3Z\" }), \"LayoutColumnFill\");\nexport default LayoutColumnFill;\n","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { FormatColorFill, GridOff } from \"@mui/icons-material\";\nimport MenuDivider from \"../MenuDivider\";\nimport { useRichTextEditorContext } from \"../context\";\nimport { DeleteColumn, DeleteRow, InsertColumnLeft, InsertColumnRight, InsertRowBottom, InsertRowTop, LayoutColumnFill, LayoutRowFill, MergeCellsHorizontal, SplitCellsHorizontal, } from \"../icons\";\nimport MenuButton from \"./MenuButton\";\nimport MenuControlsContainer from \"./MenuControlsContainer\";\n/**\n * Renders all of the controls for manipulating a table in a Tiptap editor\n * (add or delete columns or rows, merge cells, etc.).\n */\nexport default function TableMenuControls({ className, labels, }) {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;\n const editor = useRichTextEditorContext();\n return (_jsxs(MenuControlsContainer, { className: className, children: [_jsx(MenuButton, { tooltipLabel: (_a = labels === null || labels === void 0 ? void 0 : labels.insertColumnBefore) !== null && _a !== void 0 ? _a : \"Insert column before\", IconComponent: InsertColumnLeft, onClick: () => editor === null || editor === void 0 ? void 0 : editor.chain().focus().addColumnBefore().run(), disabled: !(editor === null || editor === void 0 ? void 0 : editor.can().addColumnBefore()) }), _jsx(MenuButton, { tooltipLabel: (_b = labels === null || labels === void 0 ? void 0 : labels.insertColumnAfter) !== null && _b !== void 0 ? _b : \"Insert column after\", IconComponent: InsertColumnRight, onClick: () => editor === null || editor === void 0 ? void 0 : editor.chain().focus().addColumnAfter().run(), disabled: !(editor === null || editor === void 0 ? void 0 : editor.can().addColumnAfter()) }), _jsx(MenuButton, { tooltipLabel: (_c = labels === null || labels === void 0 ? void 0 : labels.deleteColumn) !== null && _c !== void 0 ? _c : \"Delete column\", IconComponent: DeleteColumn, onClick: () => editor === null || editor === void 0 ? void 0 : editor.chain().focus().deleteColumn().run(), disabled: !(editor === null || editor === void 0 ? void 0 : editor.can().deleteColumn()) }), _jsx(MenuDivider, {}), _jsx(MenuButton, { tooltipLabel: (_d = labels === null || labels === void 0 ? void 0 : labels.insertRowAbove) !== null && _d !== void 0 ? _d : \"Insert row above\", IconComponent: InsertRowTop, onClick: () => editor === null || editor === void 0 ? void 0 : editor.chain().focus().addRowBefore().run(), disabled: !(editor === null || editor === void 0 ? void 0 : editor.can().addRowBefore()) }), _jsx(MenuButton, { tooltipLabel: (_e = labels === null || labels === void 0 ? void 0 : labels.insertRowBelow) !== null && _e !== void 0 ? _e : \"Insert row below\", IconComponent: InsertRowBottom, onClick: () => editor === null || editor === void 0 ? void 0 : editor.chain().focus().addRowAfter().run(), disabled: !(editor === null || editor === void 0 ? void 0 : editor.can().addRowAfter()) }), _jsx(MenuButton, { tooltipLabel: (_f = labels === null || labels === void 0 ? void 0 : labels.deleteRow) !== null && _f !== void 0 ? _f : \"Delete row\", IconComponent: DeleteRow, onClick: () => editor === null || editor === void 0 ? void 0 : editor.chain().focus().deleteRow().run(), disabled: !(editor === null || editor === void 0 ? void 0 : editor.can().deleteRow()) }), _jsx(MenuDivider, {}), _jsx(MenuButton, { tooltipLabel: (_g = labels === null || labels === void 0 ? void 0 : labels.mergeCells) !== null && _g !== void 0 ? _g : \"Merge cells\", IconComponent: MergeCellsHorizontal, onClick: () => editor === null || editor === void 0 ? void 0 : editor.chain().focus().mergeCells().run(), disabled: !(editor === null || editor === void 0 ? void 0 : editor.can().mergeCells()) }), _jsx(MenuButton, { tooltipLabel: (_h = labels === null || labels === void 0 ? void 0 : labels.splitCell) !== null && _h !== void 0 ? _h : \"Split cell\", IconComponent: SplitCellsHorizontal, onClick: () => editor === null || editor === void 0 ? void 0 : editor.chain().focus().splitCell().run(), disabled: !(editor === null || editor === void 0 ? void 0 : editor.can().splitCell()) }), _jsx(MenuDivider, {}), _jsx(MenuButton, { tooltipLabel: (_j = labels === null || labels === void 0 ? void 0 : labels.toggleHeaderRow) !== null && _j !== void 0 ? _j : \"Toggle header row\", IconComponent: LayoutRowFill, onClick: () => editor === null || editor === void 0 ? void 0 : editor.chain().focus().toggleHeaderRow().run(), disabled: !(editor === null || editor === void 0 ? void 0 : editor.can().toggleHeaderRow()) }), _jsx(MenuButton, { tooltipLabel: (_k = labels === null || labels === void 0 ? void 0 : labels.toggleHeaderColumn) !== null && _k !== void 0 ? _k : \"Toggle header column\", IconComponent: LayoutColumnFill, onClick: () => editor === null || editor === void 0 ? void 0 : editor.chain().focus().toggleHeaderColumn().run(), disabled: !(editor === null || editor === void 0 ? void 0 : editor.can().toggleHeaderColumn()) }), _jsx(MenuButton, { tooltipLabel: (_l = labels === null || labels === void 0 ? void 0 : labels.toggleHeaderCell) !== null && _l !== void 0 ? _l : \"Toggle header cell\", IconComponent: FormatColorFill, onClick: () => editor === null || editor === void 0 ? void 0 : editor.chain().focus().toggleHeaderCell().run(), disabled: !(editor === null || editor === void 0 ? void 0 : editor.can().toggleHeaderCell()), selected: (_m = editor === null || editor === void 0 ? void 0 : editor.isActive(\"tableHeader\")) !== null && _m !== void 0 ? _m : false }), _jsx(MenuDivider, {}), _jsx(MenuButton, { tooltipLabel: (_o = labels === null || labels === void 0 ? void 0 : labels.deleteTable) !== null && _o !== void 0 ? _o : \"Delete table\", IconComponent: GridOff, onClick: () => editor === null || editor === void 0 ? void 0 : editor.chain().focus().deleteTable().run(), disabled: !(editor === null || editor === void 0 ? void 0 : editor.can().deleteTable()) })] }));\n}\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { findParentNodeClosestToPos, posToDOMRect } from \"@tiptap/core\";\nimport { useMemo } from \"react\";\nimport { makeStyles } from \"tss-react/mui\";\nimport ControlledBubbleMenu from \"./ControlledBubbleMenu\";\nimport { useRichTextEditorContext } from \"./context\";\nimport TableMenuControls from \"./controls/TableMenuControls\";\nimport { useDebouncedFocus } from \"./hooks\";\nimport DebounceRender from \"./utils/DebounceRender\";\nconst useStyles = makeStyles({\n name: { TableBubbleMenu },\n})((theme) => ({\n controls: {\n maxWidth: \"90vw\",\n padding: theme.spacing(0.5, 1),\n },\n}));\n/**\n * Renders a bubble menu to manipulate the contents of a Table (add or delete\n * columns or rows, merge cells, etc.), when the user's caret/selection is\n * inside a Table.\n *\n * For use with mui-tiptap's `TableImproved` extension or Tiptap's\n * `@tiptap/extension-table` extension.\n *\n * If you're using `RichTextEditor`, include this component via\n * `RichTextEditor`’s `children` render-prop. Otherwise, include the\n * `TableBubbleMenu` as a child of the component where you call `useEditor` and\n * render your `RichTextField` or `RichTextContent`. (The bubble menu itself\n * will be positioned appropriately no matter where you put it in your React\n * tree, as long as it is re-rendered whenever the Tiptap `editor` forces an\n * update, which will happen if it's a child of the component using\n * `useEditor`).\n */\nexport default function TableBubbleMenu({ disableDebounce = false, DebounceProps, labels, ...controlledBubbleMenuProps }) {\n const editor = useRichTextEditorContext();\n const { classes } = useStyles();\n // Because the user interactions with the table menu bar buttons unfocus the\n // editor (since it's not part of the editor content), we'll debounce our\n // visual focused state so that we keep the bubble menu open during those\n // interactions. That way we don't close it upon menu bar button click\n // immediately, which can prevent menu button callbacks from working and\n // also undesirably will close the bubble menu rather than keeping it open for\n // future menu interaction.\n const isEditorFocusedDebounced = useDebouncedFocus({ editor });\n // We want to position the table menu outside the entire table, rather than at the\n // current cursor position, so that it's essentially static even as the table changes\n // in size and doesn't \"block\" things within the table while you're trying to edit.\n // NOTE: Popper accepts an `anchorEl` prop as an HTML element, virtualElement\n // (https://popper.js.org/docs/v2/virtual-elements/), or a function that returns\n // either. However, if you use a function that return an element, Popper will *not*\n // re-evaluate which element that is except when the function itself changes, or when\n // the Popper `open` state changes\n // (https://github.com/mui/material-ui/blob/5b2583a1c8b227661c4bf4113a79346634ea53af/packages/mui-base/src/PopperUnstyled/PopperUnstyled.tsx#L126-L130).\n // As such, we need to return a virtualElement (object with `getBoundingClientRect`)\n // and *not* return an HTML element, since we don't want it to get cached. Otherwise\n // clicking from one table to another will incorrectly get the bubble menu \"stuck\" on\n // the table that was first used to position the Popper.\n const bubbleMenuAnchorEl = useMemo(() => editor\n ? {\n getBoundingClientRect: () => {\n const nearestTableParent = editor.isActive(\"table\")\n ? findParentNodeClosestToPos(editor.state.selection.$anchor, (node) => node.type.name === \"table\")\n : null;\n if (nearestTableParent) {\n const wrapperDomNode = editor.view.nodeDOM(nearestTableParent.pos);\n // The DOM node of a Tiptap table node is a div wrapper, which contains a `table` child.\n // The div wrapper is a block element that fills the entire row, but the table may not be\n // full width, so we want to get our bounding rectangle based on the `table` (to align it\n // with the table itself), not the div. See\n // https://github.com/ueberdosis/tiptap/blob/40a9404c94c7fef7900610c195536384781ae101/packages/extension-table/src/TableView.ts#L69-L71\n const tableDomNode = wrapperDomNode === null || wrapperDomNode === void 0 ? void 0 : wrapperDomNode.querySelector(\"table\");\n if (tableDomNode) {\n return tableDomNode.getBoundingClientRect();\n }\n }\n // Since we weren't able to find a table from the current user position, that means the user\n // hasn't put their cursor in a table. We'll be hiding the table in this case, but we need\n // to return a bounding rect regardless (can't return `null`), so we use the standard logic\n // based on the current cursor position/selection instead.\n const { ranges } = editor.state.selection;\n const from = Math.min(...ranges.map((range) => range.$from.pos));\n const to = Math.max(...ranges.map((range) => range.$to.pos));\n return posToDOMRect(editor.view, from, to);\n },\n }\n : null, [editor]);\n if (!(editor === null || editor === void 0 ? void 0 : editor.isEditable)) {\n return null;\n }\n const controls = (_jsx(TableMenuControls, { className: classes.controls, labels: labels }));\n return (_jsx(ControlledBubbleMenu, { editor: editor, open: isEditorFocusedDebounced && editor.isActive(\"table\"), anchorEl: bubbleMenuAnchorEl, \n // So the menu doesn't move as columns are added, removed, or resized, we\n // prefer \"foo-start\" rather than the centered \"foo\" placement. Similarly,\n // we prefer \"top\" to \"bottom\" so that the menu doesn't move as the number\n // and size of rows changes.\n placement: \"top-start\", fallbackPlacements: [\n \"bottom-start\",\n \"top\",\n \"bottom\",\n \"top-end\",\n \"bottom-end\",\n ], \n // Though we prefer for the menu to stay on top if there's room, we\n // definitely do not want the table bubble menu to cover up the main\n // editor menu bar, which is typically going to be above the editor, since\n // users are likely to want to change styles of elements within a table\n // while using/editing a table. This overlap could happen if the Table is\n // the first element within the editor content, or if the content is long\n // and the menu bar is sticky, with the user having scrolled such that a\n // table is at the top of the page. What would be nice is if PopperJS let\n // you specify a placement to use if the `placement` *and none of the\n // fallbacks* are satisfied, so that we could default to \"bottom-start\" in\n // that scenario rather than the main `placement` value of \"top-start\".\n // Since that is not an option, we add an artificial infinite negative\n // bottom padding (so that it's like we actually have infinite extra room\n // below our table bubble menu within the editor) as a way to ensure we\n // only fall back to bottom placements if the top has no room. Similarly\n // we add a top padding equal to what should give us enough room to avoid\n // overlapping the main menu bar.\n flipPadding: { top: 35, left: 8, right: 8, bottom: -Infinity }, ...controlledBubbleMenuProps, children: disableDebounce ? (controls) : (_jsx(DebounceRender, { ...DebounceProps, children: controls })) }));\n}\n","import debounce from \"lodash/debounce\";\nimport { useEffect, useMemo, useState } from \"react\";\n/**\n * A hook for getting the Tiptap editor focused state, but debounced to prevent\n * \"flashing\" for brief blur/refocus moments, like when interacting with the\n * menu bar buttons.\n *\n * This is useful for showing the focus state visually, as with the `focused`\n * prop of .\n */\nexport default function useDebouncedFocus({ editor, wait = 250, }) {\n const [isFocusedDebounced, setIsFocusedDebounced] = useState(!!(editor === null || editor === void 0 ? void 0 : editor.isFocused));\n const updateIsFocusedDebounced = useMemo(() => debounce((focused) => setIsFocusedDebounced(focused), wait), [wait]);\n useEffect(() => {\n const isFocused = !!(editor === null || editor === void 0 ? void 0 : editor.isFocused);\n updateIsFocusedDebounced(isFocused);\n // We'll immediately \"flush\" to update the focused state of the outlined field when\n // the editor *becomes* focused (e.g. when a user first clicks into it), but we'll\n // debounce otherwise, since the editor can lose focus as a user interacts with the\n // menu bar, for instance. It feels fine to have a visual delay losing the focus\n // outline, but awkward to have delay in gaining the focus outline.\n if (isFocused) {\n updateIsFocusedDebounced.flush();\n }\n return () => {\n updateIsFocusedDebounced.cancel();\n };\n }, [editor === null || editor === void 0 ? void 0 : editor.isFocused, updateIsFocusedDebounced]);\n return isFocusedDebounced;\n}\n"],"names":["d","module","exports","url","String","replace","UNMATCHED_SURROGATE_PAIR_REGEXP","UNMATCHED_SURROGATE_PAIR_REPLACE","ENCODE_CHARS_REGEXP","encodeURI","asciiSize","baseProperty","string","split","baseGetTag","isObjectLike","value","key","object","undefined","baseSlice","array","start","end","length","reHasUnicode","RegExp","test","hasUnicode","unicodeSize","asciiToArray","unicodeToArray","rsAstralRange","rsAstral","rsCombo","rsFitz","rsNonAstral","rsRegional","rsSurrPair","reOptMod","rsOptVar","rsSeq","join","rsSymbol","reUnicode","result","lastIndex","match","baseIsRegExp","baseUnary","nodeUtil","nodeIsRegExp","isRegExp","toNumber","INFINITY","toFinite","remainder","baseToString","castSlice","isObject","stringSize","stringToArray","toInteger","toString","reFlags","options","omission","separator","strLength","strSymbols","slice","search","substring","global","source","exec","newEnd","index","indexOf","lastIndexOf","controlledBubbleMenuClasses","ControlledBubbleMenu","name","useStyles","theme","root","zIndex","BUBBLE_MENU","paper","backgroundColor","palette","background","default","editor","open","className","classes","overrideClasses","children","anchorEl","container","disablePortal","placement","fallbackPlacements","flipPadding","PaperProps","cx","props","defaultAnchorEl","useCallback","ranges","state","selection","from","Math","min","map","range","$from","pos","to","max","$to","getBoundingClientRect","node","view","nodeDOM","HTMLElement","modifiers","offset","enabled","boundary","element","padding","altAxis","transition","TransitionProps","timeout","enter","transitions","duration","enteringScreen","exit","elevation","useKeyDown","callback","callbackRef","useRef","useEffect","current","handleKeyDown","event","document","addEventListener","removeEventListener","EditLinkMenuContent","onCancel","onSave","labels","_a","_b","_c","_d","_e","_f","existingHref","isActive","getAttributes","href","linkRange","schema","linkText","doc","textBetween","selectedText","initialText","textValue","setTextValue","useState","hrefValue","setHrefValue","textRef","hrefRef","isNewLink","addLinkTitle","editLinkAddTitle","editLinkTitle","editLinkEditTitle","editMenuTitle","focus","formatHref","currentHrefValue","trim","startsWith","isSubmitting","setIsSubmitting","onSubmit","preventDefault","stopPropagation","text","link","autoComplete","Typography","variant","TextField","inputRef","disabled","onChange","target","label","editLinkTextInputLabel","margin","size","fullWidth","required","editLinkHrefInputLabel","type","onBlur","onKeyDown","DialogActions","sx","px","Button","onClick","editLinkCancelButtonLabel","color","editLinkSaveButtonLabel","truncateMiddle","half","floor","ViewLinkMenuContent","linkPreviewText","overflowWrap","onEdit","onRemove","currentHref","Link","rel","viewLinkEditButtonLabel","viewLinkRemoveButtonLabel","LinkBubbleMenu","content","spacing","controlledBubbleMenuProps","isEditable","storage","Error","handlerStorage","linkBubbleMenuHandler","menuState","linkMenuContent","VIEW_LINK_DETAILS","commands","closeLinkBubbleMenu","editLinkInBubbleMenu","chain","unsetLink","setTextSelection","run","EDIT_LINK","extendMarkRange","insertContent","marks","attrs","setLink","HIDDEN","bubbleMenuOptions","richTextContentClasses","RichTextContent","readonly","editable","editorClasses","useMemo","component","fieldContainerClasses","FieldContainer","uniqId","_params","outlined","borderRadius","shape","position","notchedOutline","borderColor","primary","focused","main","borderWidth","action","standard","inset","mode","borderStyle","pointerEvents","overflow","NOTCHED_OUTLINE","menuBarClasses","MenuBar","stickyOffset","borderBottomColor","divider","borderBottomStyle","borderBottomWidth","sticky","top","MENU_BAR","nonSticky","hide","disableSticky","Collapse","in","unmountOnExit","richTextFieldClasses","RichTextField","menuBarContent","menuBar","controls","disableDebounceRenderControls","footer","MenuBarProps","RichTextContentProps","isFieldFocused","useDebouncedFocus","DebounceRender","forwardRef","renderControls","RichTextFieldProps","editorDependencies","editorProps","ref","useImperativeHandle","isDestroyed","queueMicrotask","setEditable","RichTextEditorProvider","Provider","RichTextReadOnlyInternal","previousContent","setContent","RichTextReadOnly","createSvgIcon","TableMenuControls","_g","_h","_j","_k","_l","_m","_o","MenuControlsContainer","MenuButton","tooltipLabel","insertColumnBefore","IconComponent","addColumnBefore","can","insertColumnAfter","addColumnAfter","deleteColumn","MenuDivider","insertRowAbove","addRowBefore","insertRowBelow","addRowAfter","deleteRow","mergeCells","splitCell","toggleHeaderRow","toggleHeaderColumn","toggleHeaderCell","FormatColorFill","selected","deleteTable","GridOff","TableBubbleMenu","maxWidth","disableDebounce","DebounceProps","isEditorFocusedDebounced","bubbleMenuAnchorEl","nearestTableParent","$anchor","wrapperDomNode","tableDomNode","querySelector","left","right","bottom","Infinity","wait","isFocusedDebounced","setIsFocusedDebounced","isFocused","updateIsFocusedDebounced","flush","cancel"],"sourceRoot":""}